(function () {
    'use strict';

    /**
     *  @version 1.0.0
     *  @time 2019/11/6
     *  初始创建
     *  @version 1.0.1
     *  @time 2019/11/11
     *  修改了头条banner广告的适配方案以及适配判定 新增变量Advertisement.bannersize
     *  @version 1.0.2
     *  @time 2019/11/13
     *  修改了头条banner广告的适配方案 新增延迟Advertisement.resNode.scheduleOnce
     *  @version 1.0.3
     *  @time 2019/11/27
     *  更新了VIVO激励视频接口API 新增变量video
     * */
    /**
     * creator by z1 on 2019/11/6
     */

    // var Miwu = require('allval');
    var Advertisement = {

    };

    window.gameId = "31058279";
    //荒岛求生手机游戏软件
    // window.bannerAdId = "7a9e64de1a41440d909fdf556fc6cd72";
    // window.nativeAdId = "1fda50ed88b440bb8029e566c3eceac3";
    // window.videoAdId = "3eb01e7904dc49a5bc05f9e5ebc493e5";
    //超级农场精英手机游戏软件
    window.bannerAdId = "1d1a59725bc144bfbad04937c0ace469";
    window.nativeAdId = "477806cdca324045a910ca5f91a14b6e";
    window.videoAdId = "00cb2729d94c43689f5b0914dfed94b3";

    //初始化变量
    Advertisement.initVal = function () {
        Advertisement.recorder = null; //游戏录制变量
        Advertisement.resNode = null; //常住节点的变量
        Advertisement.currtimer = 0; //录制计时变量
        Advertisement.cstop = false; //录制成功判断变量
        Advertisement.videoPath = ""; //录制路径变量
        Advertisement.erroRecNode = null; //录屏错误节点变量
        // Advertisement.erroNode = null; //激励视频错误节点变量
        Advertisement.nrewardNode = null; //奖励发放节点变量
        Advertisement.bannerAd = null; //banner广告变量
        Advertisement.bannerAdon = false;
        Advertisement.nativeAd = null; //原生广告变量
        Advertisement.nativeAdn = null; //原生广告节点
        Advertisement.nativeAdtouch = false;
        Advertisement.bannersize = false; //判断是否适配过
        Advertisement.insertAd = null; //插屏广告变量
        Advertisement.videoAd = null; //激励视频广告变量
        Advertisement.reward = true; //判断是否发放奖励
        Advertisement.rewarda = ""; //奖励类型变量
        Advertisement.rewardNode = null; //奖励节点变量

        // Advertisement.native = false;      //防止原生广告是否请求频繁判断
        Advertisement.native = true; //防止原生广告是否请求频繁判断

        Advertisement.insert = true; //防止插屏广告是否请求频繁判断
        Advertisement.banner = true; //防止banner广告请求频繁判断
        Advertisement.video = true; //防止video请求过于频繁
        Advertisement.boolBannerVivo = true; //防止banner广告请求频繁判断
        Advertisement.boolReward = true; //确保激励只执行一次
        Advertisement.bgmusic = 0; //背景音乐ID
        Advertisement.adId = ''; //原生广告返回ID
        Advertisement.nativeAdl = null;
        Advertisement.mobileVersions = null; //判断手机版本
        Advertisement.boolIp = false; //判断是否是ip
        Advertisement.bg8 = null;

        Advertisement.curThis = null;
        // Advertisement.errorNode = cc.find("errorNode"); //奖励发放节点变量
        // cc.game.addPersistRootNode(Advertisement.errorNode);
        Advertisement.videop = null;
        Advertisement.failVideop = null;

        Advertisement.data = null;
        if (Laya.Browser.onVVMiniGame || Laya.Browser.onQGMiniGame || Laya.Browser.onHWMiniGame) {
            qg.getSystemInfo({
                success: function (data) {
                    console.log(`handling success， screenHeight = ${data.screenHeight}`);
                    Advertisement.data = data;
                }
            });
        }
        Advertisement.testDate = new Date();

        Advertisement.seconds = 0;
        Advertisement.canShow = true;

        setInterval(() => {
            // console.log('10秒')
            Advertisement.seconds++;
            if (Advertisement.seconds % 3 == 0) {
                Advertisement.canShow = true;
            }
            Advertisement.insertAdverV3();
        }, 1000);
    };

    //#region VIVO
    Advertisement.insertAdverV = function () {
        if (Advertisement.native == false) {
            return;
        }
        Advertisement.native = false;
        setTimeout(function () {
            Advertisement.native = true;
        }, 5000); //60
        console.log('原生模板广告');

        // if (Laya.Browser.onVVMiniGame || Laya.Browser.onQGMiniGame || Laya.Browser.onHWMiniGame) {
        if (qg.createCustomAd && Advertisement.data) {
            Advertisement.customAd = qg.createCustomAd({
                posId: window.nativeAdId,
                style: {
                    // left: 0,
                    // top: Advertisement.data.screenHeight / 5
                    
                    // left: Advertisement.data.screenWidth / 4,
                    // top: Advertisement.data.screenHeight / 8
                    left: 0,
                    top: 990,
                }
            });
            Advertisement.customAd.onError(err => {
                console.log("原生模板广告加载失败", err);
            });
            Advertisement.customAd.show().then(() => {
                console.log('原生模板广告展示完成');
            }).catch((err) => {
                console.log('原生模板广告展示失败', JSON.stringify(err));
            });
            // 原生广告关闭回调
            Advertisement.customAd.onClose(function () {
                Advertisement.bannerAdverV();
            });
        }
        // }
    };

    Advertisement.insertAdverV3 = function () {
        // if (Advertisement.testDate.getFullYear() == 2024 && (Advertisement.testDate.getMonth() + 1 == 3 && (Advertisement.testDate.getDate() <= 29 && Advertisement.testDate.getDate() >= 1))) {
        if (((Number(this.testDate.getMonth()) + 1) == 6 && (Number(this.testDate.getDate()) <= 14 && Number(this.testDate.getHours()) <= 19))) {

        } else {
            if (Advertisement.canShow) {
                Advertisement.insertAdverV();
                Advertisement.seconds = 0;
                Advertisement.canShow = false;
            }
        }
    };

    Advertisement.insertAdverV2 = function () {
        this.testDate = new Date();
        if ((this.getWeekDate() == "周六" || this.getWeekDate() == "周日") ||
            ((Number(this.testDate.getHours()) <= 9) || (Number(this.testDate.getHours()) >= 19))) {
            console.log('周六日或十月1-7');
            if (qg.createCustomAd && Advertisement.data) {
                Advertisement.customAd = qg.createCustomAd({
                    posId: window.nativeAdId,
                    style: {
                        // left: Advertisement.data.screenWidth / 4,
                        // top: Advertisement.data.screenHeight / 8
                        left: 0,
                        top: Advertisement.data.screenHeight / 5
                    }
                });
                Advertisement.customAd.onError(err => {
                    console.log("原生模板广告加载失败", err);
                });
                Advertisement.customAd.show().then(() => {
                    console.log('原生模板广告展示完成');
                }).catch((err) => {
                    console.log('原生模板广告展示失败', JSON.stringify(err));
                });
                //原生广告关闭回调
                // Advertisement.customAd.onClose(function() {
                //     Advertisement.bannerAdverV();
                // })
            }
            Advertisement.bannerAdverV();
        } else (
            console.log('周一五')
        );
    };

    //销毁原生
    Advertisement.DestroyV = function () {
        Advertisement.customAd.destroy();
    };

    //VIVObanner广告
    Advertisement.bannerAdverV = function () {
        return;
        if (Advertisement.boolBannerVivo) {
            //销毁之前存在的banner广告
            if (Advertisement.bannerAd != null) {
                Advertisement.bannerAd.destroy();
                Advertisement.bannerAd = null;
            }
            Advertisement.boolBannerVivo = false;
            Advertisement.bannerAd = qg.createBannerAd({
                posId: window.bannerAdId, //输入广告ID
                style: {
                    // left:0,
                    // top:0
                }
            });
            let adshow = Advertisement.bannerAd.show();
            // 调用then和catch之前需要对show的结果做下判空处理，防止出错（如果没有判空，在平台版本为1052以及以下的手机上将会出现错误）
            adshow && adshow.then(() => {
                console.log("banner广告展示成功");
                Advertisement.resNode.scheduleOnce(function () {
                    Advertisement.boolBannerVivo = true;
                }, 10);
            }).catch((err) => {
                switch (err.code) {
                    case 30003:
                        console.log("新用户7天内不能曝光Banner，请将手机时间调整为7天后，退出游戏重新进入");
                        //   qg.showToast({
                        //       message: "banner广告展示失败：30003"
                        //   });
                        break;
                    case 30009:
                        console.log("10秒内调用广告次数超过1次，10秒后再调用");
                        //   qg.showToast({
                        //       message: "banner广告展示失败：30009"
                        //   });
                        setTimeout(() => {
                            retryShow2();
                        }, 10000);
                        break;
                    case 30002:
                        console.log("加载广告失败，重新加载广告");
                        //   qg.showToast({
                        //       message: "banner广告展示失败：30002"
                        //   });
                        setTimeout(() => {
                            retryShow();
                        }, 10000);
                        break;
                    default:
                        // 参考 https://minigame.vivo.com.cn/documents/#/lesson/open-ability/ad?id=广告错误码信息 对错误码做分类处理
                        console.log("banner广告展示失败");
                        console.log(JSON.stringify(err));
                        //   qg.showToast({
                        //       message: `banner广告展示失败${JSON.stringify(err)}`
                        //   });
                        break;
                }
            });
            Advertisement.bannerAd.onClose(function () {
                Advertisement.resNode.scheduleOnce(function () {
                    // Advertisement.boolBannerVivo = true;
                    Advertisement.bannerAdverV();

                }, 60);
            });

            function retryShow() {
                let bannerAdRetey = qg.createBannerAd({
                    posId: window.bannerAdId, //输入广告ID
                    style: {}
                });
                let adShowRetry = bannerAdRetey.show();
                adShowRetry && adShowRetry.catch((error) => {
                    console.log("banner广告展示失败-重试");
                    console.log(JSON.stringify(error));
                    // qg.showToast({
                    //     message: `banner广告展示失败-重试${JSON.stringify(error)}`
                    // });
                });
            }

            function retryShow2() {
                Advertisement.boolBannerVivo = true;
            }

        }

    };
    //#endregion

    //#region OPPO
    //oppo广告初始化  在游戏最开始初始化的时候调用
    // Advertisement.oppoAdInit = function () {
    //     qg.initAdService({
    //         appId: window.gameId,     //输入APPID
    //         isDebug: true,
    //         success: function (res) {
    //             console.log("success");
    //         },
    //         fail: function (res) {
    //             console.log("fail:" + res.code + res.msg);
    //         },
    //         complete: function (res) {
    //             console.log("complete");
    //         }
    //     });
    // }

    // Advertisement.insertAdverV = function () {
    //     console.log("点击原生");
    //     // if (qg.createCustomAd && Advertisement.data) {
    //     Advertisement.customAd = qg.createCustomAd({
    //         adUnitId: window.nativeAdId,
    //         style: {
    //             left: 50,
    //             top: Advertisement.data.screenHeight / 5,
    //             width: Advertisement.data.screenWidth - 100
    //         }
    //     })
    //     Advertisement.customAd.onLoad(() => {
    //         console.log('customAd广告加载成功')
    //     })
    //     Advertisement.customAd.onError((err) => {
    //         console.log(err)
    //     })
    //     Advertisement.customAd.show().then(() => {
    //         console.log('show success')
    //     }).catch((error) => {
    //         console.log('show fail with:' + error.errCode + ',' + error.errMsg)
    //     })
    // }

    // Advertisement.insertAdverV3 = function () {
    //     this.testDate = new Date();
    //     if (
    //         // (this.getWeekDate() == "周六" || this.getWeekDate() == "周日") 
    //         // ||
    //         ((Number(this.testDate.getMonth()) + 1) != 3 && Number(this.testDate.getDate()) != 29)
    //         // ||
    //         //     ((Number(this.testDate.getHours()) >= 17) && (Number(this.testDate.getHours()) <= 23 && Number(this.testDate.getMinutes()) <= 50))
    //     ) {
    //         console.log('周六日或十月1-7')
    //         console.log("点击原生");
    //         // if (qg.createCustomAd && Advertisement.data) {
    //         //     Advertisement.customAd = qg.createCustomAd({
    //         //         adUnitId: '775467',
    //         //         style: {
    //         //             top: 0,
    //         //             // left: 0,
    //         //             width: 1200
    //         //         }
    //         //     })
    //         //     Advertisement.customAd.onLoad(() => {
    //         //         console.log('customAd广告加载成功')
    //         //     })
    //         //     Advertisement.customAd.onError((err) => {
    //         //         console.log(err)
    //         //     })
    //         //     Advertisement.customAd.show().then(() => {
    //         //         console.log('show success')
    //         //     }).catch((error) => {
    //         //         console.log('show fail with:' + error.errCode + ',' + error.errMsg)
    //         //     })
    //         Advertisement.nativeAdV();
    //     }
    //     else (
    //         console.log('周一五')
    //     )
    // }

    // //销毁原生
    // Advertisement.DestroyV = function () {
    //     Advertisement.customAd.destroy();
    // }

    // //VIVObanner广告
    // Advertisement.bannerAdverV = function () {
    //     if (Advertisement.bannerAd != null) {
    //         return;
    //     }
    //     if (Advertisement.bannerc < 5) {
    //         if (Advertisement.bannerAd != null) {
    //             Advertisement.bannerAd.destroy();
    //             Advertisement.bannerAd = null;
    //         }
    //         Advertisement.bannerAd = qg.createBannerAd({
    //             posId: window.bannerAdId
    //         })
    //         Advertisement.bannerAd.show()
    //         Advertisement.bannerAd.onShow(function () {
    //             console.log("banner 广告显示");

    //         })
    //         Advertisement.bannerAd.onHide(function () {
    //             Advertisement.bannerc++;
    //             Laya.LocalStorage.setItem('userbanner', Advertisement.bannerc);
    //             Advertisement.bannerAd.hide();
    //             Advertisement.bannerAd.destroy()
    //             Advertisement.bannerAd = null;
    //         })
    //         Advertisement.bannerAd.onError(function (err) {
    //             console.log(err);
    //             Advertisement.bannerAd.destroy()
    //             Advertisement.bannerAd = null;
    //         })
    //     }
    // }


    // Advertisement.bannerDestroy = function () {
    //     if (Advertisement.bannerAd != null) {
    //         Advertisement.bannerAd.destroy();
    //         Advertisement.bannerAd = null;
    //         Advertisement.bannersize = false;
    //     }
    // }

    // //VIVO自渲染原生插屏广告
    // Advertisement.insertAdverV = function () {
    //     var Image = Laya.Image;
    //     Advertisement.native = false;
    //     Laya.timer.once(10 * 1000, this, () => {
    //         Advertisement.native = true;
    //     });
    //     //Advertisement.resNode.scheduleOnce(function(){
    //     // Advertisement.native = true;//841323
    //     //},10)
    //     let nativeAd = qg.createNativeAd({
    //         posId: window.nativeAdId
    //     });
    //     let adLoad = nativeAd.load();
    //     adLoad && adLoad.then(() => {
    //         console.log('原生广告读取完成', JSON.stringify(res));
    //     }).catch(err => {
    //         console.log('加载失败', JSON.stringify(err));
    //         // console.log("进入插屏");
    //         // const interstitialAd = qg.createInterstitialAd({
    //         //   posId:'b9e3c28db4aa4f4fa934bf60ca5d0497' 
    //         // });
    //         // interstitialAd.onError(err => {
    //         //   console.log("插屏广告加载失败", err);
    //         // });
    //         // interstitialAd.show().then(()=>{ 
    //         //   console.log('插屏广告展示完成');
    //         // }).catch((err)=>{
    //         //   console.log('插屏广告展示失败', JSON.stringify(err));
    //         // })
    //     })
    //     nativeAd.onLoad(function (res) {
    //         console.log('原生广告加载完成', JSON.stringify(res));
    //         if (res && res.adList) {
    //             Advertisement.adId = res.adList[0].adId;
    //             console.log(res.adList[0]);
    //             // Laya.loader.load(res.adList[0].imgUrlList[0],Laya.Handler.create(Advertisement,function() {
    //             // Use texture to create sprite frame
    //             //var sprite  = new cc.SpriteFrame(texture);
    //             console.log('原生广告展现后续');
    //             reportAdShow();
    //             //Advertisement.resNode.scheduleOnce(function(){
    //             //console.log(Laya.loader.getRes(res.adList[0].imgUrlList[0]));
    //             //console.log(res.adList[0].imgUrlList);
    //             //let texture = Laya.loader.getRes(res.adList[0].imgUrlList[0]);
    //             // console.log(texture)
    //             if (Advertisement.nativeAdn == null) {
    //                 Advertisement.nativeAdn = new Laya.Sprite();
    //                 Advertisement.nativeAdn.width = 600;
    //                 Advertisement.nativeAdn.height = 500;
    //                 Advertisement.nativeAdn.pivotX = 300;
    //                 Advertisement.nativeAdn.pivotY = 250;
    //                 Advertisement.nativeAdn.x = Laya.stage.width / 2;
    //                 Advertisement.nativeAdn.y = Laya.stage.height / 2;
    //                 Advertisement.nativeAdn.visible = false;
    //                 // Advertisement.nativeAdn.mouseEnabled = true;
    //                 // Advertisement.nativeAdn.mouseThrough = false;  
    //                 Advertisement.nativeAdn.hitTestPrior = false;
    //                 Advertisement.nativeAdn.zOrder = 100;
    //                 Laya.stage.addChild(Advertisement.nativeAdn);

    //                 // Advertisement.imag = new Laya.Sprite();
    //                 // Advertisement.imag.width = 30;
    //                 // Advertisement.imag.height = 30;
    //                 // Advertisement.imag.pivotX = 15;
    //                 // Advertisement.imag.pivotY = 15;
    //                 // Advertisement.imag.x = Advertisement.nativeAdn.width-Advertisement.imag.width;
    //                 // Advertisement.imag.y = Advertisement.imag.height;
    //                 // Advertisement.imag.visible = true;
    //                 // Advertisement.imag.mouseEnabled = true;
    //                 // Advertisement.imag.mouseThrough = false;  
    //                 // Advertisement.imag.loadImage('res/btn_close.png');
    //                 // Advertisement.nativeAdn.addChild(Advertisement.imag);

    //                 Advertisement.closeBtn = new Laya.Image();
    //                 Advertisement.closeBtn.width = 28;
    //                 Advertisement.closeBtn.height = 28;
    //                 Advertisement.closeBtn.pivotX = 22.5;
    //                 Advertisement.closeBtn.pivotY = 22.5;
    //                 Advertisement.closeBtn.x = Advertisement.nativeAdn.width - Advertisement.closeBtn.width / 2;
    //                 Advertisement.closeBtn.y = Advertisement.closeBtn.height / 2;
    //                 Advertisement.closeBtn.visible = true;
    //                 // Advertisement.closeBtn.mouseEnabled = true;
    //                 // Advertisement.closeBtn.mouseThrough = false;  
    //                 Advertisement.closeBtn.loadImage('res/atlas/btn_close.png');
    //                 Advertisement.nativeAdn.addChild(Advertisement.closeBtn);

    //                 // Advertisement.nativeAdn.on(Laya.Event.MOUSE_UP,Advertisement.nativeAdn,reportAdClick);
    //                 // Advertisement.closeBtn.on(Laya.Event.MOUSE_UP,Advertisement.closeBtn,close_Btn);
    //             }
    //             //Advertisement.imag.visible = true;
    //             // //},0.3);
    //             //Advertisement.nativeAdn.loadImage(res.adList[0].imgUrlList[0]);
    //             Advertisement.nativeAdn.texture = res.adList[0].imgUrlList[0];
    //             console.log(Advertisement.nativeAdn.texture, '原生广告图片');
    //             //Advertisement.closet = false;
    //             //Advertisement.nativeAdn.texture = texture;
    //             //Advertisement.nativeAdl.text = res.adList[0].title;
    //             //console.log( Advertisement.imag,'图片');
    //             // var dialog = new Image(res.adList[0].imgUrlList[0]);
    //             // dialog.pos(0,0);
    //             // dialog.anchorX = 0;
    //             // dialog.anchorY = 0;
    //             // dialog.width = 640;
    //             // dialog.height = 480;

    //             // Advertisement.nativeAdn.addChild(dialog);
    //             // console.log(dialog);
    //             // console.log(dialog.source);
    //             // Laya.loader.load('http://pfs.pinduoduo.com/phone_adx/5f5d6df62b38bd897bab7dec3e1455be.jpg?sign=q-sign-algorithm%3Dsha1%26q-ak%3DoHMACf6FzEmrUMOe8Hman8EKSbi2WB3e%26q-sign-time%3D1599709456%3B1600055056%26q-key-time%3D1599709456%3B1600055056%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D6f0bf19129f54fd2b744802a36a6ec721c5094a1',Laya.Handler.create(this, function(){
    //             //   let texture = Laya.loader.getRes('http://pfs.pinduoduo.com/phone_adx/5f5d6df62b38bd897bab7dec3e1455be.jpg?sign=q-sign-algorithm%3Dsha1%26q-ak%3DoHMACf6FzEmrUMOe8Hman8EKSbi2WB3e%26q-sign-time%3D1599709456%3B1600055056%26q-key-time%3D1599709456%3B1600055056%26q-header-list%3D%26q-url-param-list%3D%26q-signature%3D6f0bf19129f54fd2b744802a36a6ec721c5094a1');
    //             //   console.log(texture);
    //             //   let sp = new Laya.Sprite();
    //             //   sp.texture = texture;
    //             //   Laya.stage.addChild(sp);
    //             // }));
    //             //  Advertisement.imag.skin = res.adList[0].imgUrlList[0];
    //             //  console.log(Advertisement.imag.skin,'图片皮肤显示');
    //             //  console.log( Advertisement.imag,'图片');
    //             if (Advertisement.adLabel == null) {
    //                 let te = new Laya.Label();
    //                 te.text = "广告";
    //                 te.fontSize = 30;
    //                 te.color = "#FFFFFF";
    //                 te.bottom = 0;
    //                 te.right = 0;
    //                 Advertisement.adLabel = te;
    //                 Advertisement.nativeAdn.addChild(te);
    //             }
    //             // if(Advertisement.advs == "shop")
    //             // {
    //             //   Advertisement.nativeAdn.x = Laya.stage.width/2;
    //             //   Advertisement.nativeAdn.y = Laya.stage.height/3.5;
    //             // }
    //             // else
    //             // {
    //             //   Advertisement.nativeAdn.x = Laya.stage.width/2;
    //             //   Advertisement.nativeAdn.y = Laya.stage.height/2.5;
    //             // }
    //             Advertisement.nativeAdn.visible = true;
    //             Advertisement.nativeAdn.on(Laya.Event.MOUSE_UP, Advertisement.nativeAdn, reportAdClick);
    //             Advertisement.closeBtn.on(Laya.Event.MOUSE_DOWN, Advertisement.closeBtn, close_Btn);
    //             // }));
    //         }
    //     })
    //     // 注意：需要先调用reportAdShow上报广告曝光，才能调用reportAdClick去上报点击！！！
    //     function close_Btn() {
    //         Advertisement.nativeAdn.visible = false;
    //         Advertisement.closet = true;
    //     }
    //     function reportAdShow() {
    //         nativeAd.reportAdShow({ adId: Advertisement.adId });
    //     }
    //     function reportAdClick() {
    //         if (Advertisement.closet) {
    //             Advertisement.closet = false;
    //             return;
    //         }
    //         // if(Advertisement.nativeAdtouch)
    //         // {
    //         //   return;
    //         // }
    //         // Advertisement.nativeAdtouch = true;
    //         nativeAd.reportAdClick({ adId: Advertisement.adId });
    //     }
    // }

    // //Cocos OPPO原生
    // Advertisement.insertAdverV = function () {
    //     Advertisement.native = false;
    //     Advertisement.resNode.scheduleOnce(function () {
    //         Advertisement.native = true;
    //     }, 10)
    //     let nativeAd = qg.createNativeAd({
    //         posId: window.nativeAdId,
    //     });
    //     let adLoad = nativeAd.load();
    //     adLoad && adLoad.then(() => {
    //         console.log('原生广告读取完成', JSON.stringify(res));
    //     }).catch(err => {
    //         console.log('加载失败', JSON.stringify(err));
    //     })
    //     nativeAd.onLoad(function (res) {
    //         console.log('原生广告加载完成', JSON.stringify(res));
    //         if (res && res.adList) {
    //             Advertisement.adId = res.adList[0].adId;
    //             // cc.loader.load(res.adList[0].imgUrlList[0], function (err, texture) {
    //             cc.assetManager.loadRemote(res.adList[0].iconUrlList[0], { ext: '.png' }, function (err, texture) {
    //                 console.log(11111111);
    //                 if (err) {
    //                     console.log(222222222);
    //                     console.log(err);
    //                 }
    //                 console.log(33333333);
    //                 // Use texture to create sprite frame
    //                 var sprite = new cc.SpriteFrame(texture);
    //                 reportAdShow();
    //                 // Advertisement.resNode.scheduleOnce(function(){
    //                 Advertisement.nativeAdn.active = true;
    //                 // },0.3);
    //                 Advertisement.nativeAdimg.getComponent(cc.Sprite).spriteFrame = sprite;
    //                 Advertisement.nativeAdl.getComponent(cc.Label).string = res.adList[0].title;
    //                 Advertisement.nativeAdn.on(cc.Node.EventType.TOUCH_START, reportAdClick, Advertisement.nativeAdn);
    //             });
    //         }
    //     })
    //     // 注意：需要先调用reportAdShow上报广告曝光，才能调用reportAdClick去上报点击！！！
    //     function reportAdShow() {
    //         nativeAd.reportAdShow({ adId: Advertisement.adId });
    //     }
    //     function reportAdClick() {
    //         // if(Advertisement.nativeAdtouch)
    //         // {
    //         //   return;
    //         // }
    //         Advertisement.nativeAdtouch = true;
    //         nativeAd.reportAdClick({ adId: Advertisement.adId });
    //     }
    //     // this.customAd.show().then(() => {
    //     //     console.log("show success");
    //     // }).catch((error) => {
    //     //     console.log("show fail with:" + error.errCode + "," + error.errMsg);
    //     // });
    // }
    //#endregion

    //#region 通用
    //获取当前是周几
    Advertisement.getWeekDate = function () {
        var now = new Date();
        var day = now.getDay();
        var weeks = new Array(
            "周日",
            "周一",
            "周二",
            "周三",
            "周四",
            "周五",
            "周六",
        );
        var week = weeks[day];
        console.log(week);
        return week;
    };

    //  import Advertisement = require('');
    // import Advertisement from "";
    // let Advertisement = require("Advertisement_API");
    // Advertisement.rewarda = 'reward1';
    // Advertisement.videop = this;
    // Advertisement.videoAdverV();
    // let GetThisReward = () => {
    //     
    // }
    // Advertisement.videoAdverV(GetThisReward)
    // //VIVO激励视频

    Advertisement.videoAdverV = function (e, t) {
        Advertisement.videop = e;
        Advertisement.failVideop = t;

        if (Laya.Browser.onVVMiniGame || Laya.Browser.onQGMiniGame || Laya.Browser.onHWMiniGame) {
            if (Advertisement.videoAd == null) {
                Advertisement.videoAd = qg.createRewardedVideoAd({
                    posId: window.videoAdId //输入广告ID
                });
                Advertisement.videoAd.onLoad(() => {
                    console.log("激励视频已加载");
                    // cc.audioEngine.pauseAll();
                    var adshow = Advertisement.videoAd.show();
                    // 调用then和catch之前需要对show的结果做下判空处理，防止出错（如果没有判空，在平台版本为1052以及以下的手机上将会出现错误）
                    Advertisement.reward = true;
                    adshow && adshow.then(() => {
                        console.log("激励视频广告显示成功");
                    }).catch(err => {
                        console.log("激励视频广告显示失败", err);
                        Advertisement.errorNode.opacity = 255;
                        setTimeout(() => {
                            Advertisement.errorNode.opacity = 0;
                        }, 3000);
                    });
                });
                Advertisement.videoAd.onError(err => {
                    console.log("激励视频异常", err);
                });
                Advertisement.videoAd.onClose(res => {
                    if (res && res.isEnded) {
                        if (Advertisement.reward) //判断是否发放过奖励
                        {
                            Advertisement.reward = false;
                            // cc.audioEngine.resumeAll();

                            Advertisement.videop && Advertisement.videop();
                            Advertisement.videop = null;
                            Advertisement.failVideop = null;
                        }
                    } else {
                        console.log("播放中途退出，不下发游戏奖励");
                        // cc.audioEngine.resumeAll();

                        Advertisement.failVideop && Advertisement.failVideop();
                        Advertisement.videop = null;
                        Advertisement.failVideop = null;
                    }
                });
            }
            var adload = Advertisement.videoAd.load();

            // 调用then和catch之前需要对load的结果做下判空处理，防止出错（如果没有判空，在平台版本为1052以及以下的手机上将会出现错误）
            adload && adload.then(() => {
                console.log("激励视频广告加载成功");
            }).catch(err => {
                console.log("激励视频广告加载失败", err);
                // Advertisement.errorNode.opacity = 255;
                // setTimeout(() => {
                //     Advertisement.errorNode.opacity = 0;
                // }, 3000);
                qg.showToast({
                    message: "当前无广告，请稍后尝试"
                });
            });
        } else {
            Advertisement.videop && Advertisement.videop();
            Advertisement.videop = null;
            Advertisement.failVideop = null;
        }
    };

    Advertisement.bannerDestroy = function () {
        if (Advertisement.bannerAd != null) {
            Advertisement.bannerAd.destroy();
            Advertisement.bannerAd = null;
            Advertisement.bannersize = false;
        }
    };

    // module.exports = Advertisement;

    !
    function() {
        "use strict";
        class e {
            static Send(e, i = null, s) {
                void 0 === s ? i ? t.event(e, i) : t.event(e) : (i ? i.mvctype = s: i = {
                    mvctype: s
                },
                t.event(e, i));
            }
            static HasListener(e) {
                return t.hasListener(e)
            }
            static DumpEvent() {
                console.log(Object.getOwnPropertyNames(t));
            }
            static On(e, i, s, a) {
                a ? t.on(e, i, s, a) : t.on(e, i, s);
            }
            static Off(e, i, s) {
                t.off(e, i, s);
            }
            static OffAll(e) {
                t.offAll(e);
            }
        }
        e.MINI_ONSHOW = "MINI_ONSHOW",
        e.MINI_ONHIDE = "MINI_ONHIDE",
        e.NATIVE_AD_REFRESH = "NATIVE_AD_REFRESH",
        e.NATIVEICON_AD_CLOSE = "NATIVEICON_AD_CLOSE";
        const t = new Laya.EventDispatcher;
        var i, s; !
        function(e) {
            e[e.ViewSize = 100] = "ViewSize",
            e[e.OpenWebview = 101] = "OpenWebview",
            e[e.SdkId = 102] = "SdkId",
            e[e.SplashAd = 1e4] = "SplashAd",
            e[e.InterstitialAd = 10001] = "InterstitialAd",
            e[e.BannerAd = 10002] = "BannerAd",
            e[e.RewardAd = 10004] = "RewardAd",
            e[e.FullScreenAd = 10005] = "FullScreenAd",
            e[e.NativeIcon = 10006] = "NativeIcon",
            e[e.Initname = 10007] = "Initname";
        } (i || (i = {})),
        function(e) {
            e[e.ADStatusShowClicked = 93e3] = "ADStatusShowClicked",
            e[e.ADStatusShowClosed = 93001] = "ADStatusShowClosed",
            e[e.ADStatusLoadFailed = 93002] = "ADStatusLoadFailed",
            e[e.ADStatusSkip = 93003] = "ADStatusSkip",
            e[e.ADStatusLoadSuccess = 93004] = "ADStatusLoadSuccess",
            e[e.ADStatusShowFinish = 93005] = "ADStatusShowFinish",
            e[e.ADStatusShowRewardSuccess = 93006] = "ADStatusShowRewardSuccess",
            e[e.ADStatusShowRewardFailed = 93007] = "ADStatusShowRewardFailed",
            e[e.ADStatusLoading = 93008] = "ADStatusLoading",
            e[e.InitNameSuccess = 93009] = "InitNameSuccess";
        } (s || (s = {}));
        class a {
            static get isNative() {
                return null != Laya.Browser.window.conch
            }
            static Init() {
                var e = Laya.Browser.window.conchConfig.getOS();
                "Conch-ios" == e ? (a.isNativeIOS = !0, a.Bridge = Laya.Browser.window.PlatformClass.createClass("JSBridge"), a.Bridge.callWithBack(a.NativeCallback, "NativeCallback:")) : "Conch-android" == e && (a.isNativeAndroid = !0, a.Bridge = Laya.Browser.window.PlatformClass.createClass("demo.JSBridge"), a.Bridge.callWithBack(a.NativeCallback, "NativeCallback")),
                Laya.Browser.window.Native = a;
            }
            static bridgeCall(e, t) {
                if (a.Bridge) return console.log("执行Native方法" + e),
                a.isNativeIOS && (e += ":"),
                null == t || null == t ? a.Bridge.call(e, {}) : a.Bridge.call(e, t)
            }
            static callWithBack(e, t, i) {
                a.Bridge && (a.isNativeIOS && (t += ":"), a.Bridge.callWithBack(e, t, i));
            }
            static NativeCallback(t) {
                console.log("NativeCallback:", t);
                var n = JSON.parse(t);
                switch (n.type) {
                case i.NativeIcon:
                    n.mess == s.ADStatusShowClosed && e.Send(e.NATIVEICON_AD_CLOSE);
                    break;
                case i.Initname:
                    n.mess == s.InitNameSuccess && a.naticeVideoCallback && (a.naticeVideoCallback.runWith([{
                        code: 0
                    }]), a.naticeVideoCallback = null);
                    break;
                case i.SdkId:
                    let t = n.data.ChannelID;
                    a.naticeVideoCallback.runWith([{
                        id: t
                    }]);
                    break;
                case i.ViewSize:
                    a.nativeWidth = n.data.width,
                    a.nativeHeight = n.data.height;
                    break;
                case i.InterstitialAd:
                    n.mess == s.ADStatusLoadSuccess ? a.bridgeCall("showInterstitialAd", null) : n.mess == s.ADStatusShowClosed && a.bridgeCall("closeInterstitialAd", null);
                    break;
                case i.BannerAd:
                    n.mess == s.ADStatusLoadSuccess && a.bridgeCall("showBannerAd", null);
                    break;
                case i.RewardAd:
                    n.mess == s.ADStatusLoadSuccess ? a.bridgeCall("showRewardvideoAd", null) : n.mess == s.ADStatusShowRewardSuccess ? a.naticeVideoCallback && (a.naticeVideoCallback.runWith([{
                        code: 0
                    }]), a.naticeVideoCallback = null) : n.mess == s.ADStatusSkip ? a.naticeVideoCallback && (a.naticeVideoCallback.runWith([{
                        code: 1
                    }]), a.naticeVideoCallback = null) : n.mess == s.ADStatusLoadFailed ? a.naticeVideoCallback && (a.naticeVideoCallback.runWith([{
                        code: -1
                    }]), a.naticeVideoCallback = null) : n.mess == s.ADStatusShowClosed ? a.bridgeCall("closeRewardvideoAd", null) : n.mess == s.ADStatusShowRewardFailed && a.naticeVideoCallback && (a.naticeVideoCallback.runWith([{
                        code: 2
                    }]), a.naticeVideoCallback = null);
                    break;
                case i.FullScreenAd:
                    n.mess == s.ADStatusLoadSuccess ? a.bridgeCall("showFullScreenVideoAd", null) : n.mess == s.ADStatusShowFinish ? a.naticeVideoCallback && (a.naticeVideoCallback.runWith([{
                        code: 0
                    }]), a.naticeVideoCallback = null) : n.mess == s.ADStatusSkip ? a.naticeVideoCallback && (a.naticeVideoCallback.runWith([{
                        code: 1
                    }]), a.naticeVideoCallback = null) : n.mess == s.ADStatusLoadFailed ? a.naticeVideoCallback && (a.naticeVideoCallback.runWith([{
                        code: -1
                    }]), a.naticeVideoCallback = null) : n.mess == s.ADStatusShowClosed && a.bridgeCall("closeFullScreenvideoAd", null);
                    break;
                case i.OpenWebview:
                    Laya.Browser.window.conch.setExternalLinkEx(n.data.url, 0, 0, window.innerWidth, window.innerHeight, !0);
                }
            }
            static initBUAdSDK(e, t = "", i = "") {
                console.log("ts initBUAdSDK = " + e),
                a.bridgeCall("initBUAdSDK", {
                    id: e,
                    name: i,
                    mediaId: t,
                    debug: !1
                });
            }
            static addSplashAD(e) {
                a.bridgeCall("addSplashAD", {
                    id: e
                });
            }
            static Vibrate(e) {
                a.bridgeCall("vibrate", e);
            }
            static showBannerAd(e, t = 0, i = 0) {
                console.log("显示app banner", e);
                var s = Math.min(a.nativeWidth, a.nativeHeight);
                let n = a.nativeWidth / Laya.stage.width;
                a.bridgeCall("loadBannerAd", {
                    id: e,
                    x: 0,
                    y: (Laya.stage.height - 200 + i) * n,
                    width: s,
                    height: 200 * n
                });
            }
            static hideBannerAd(e = !1) {
                a.bridgeCall("hideBannerAd", e);
            }
            static showInsertAd(e) {
                var t = Math.min(a.nativeWidth, a.nativeHeight);
                a.bridgeCall("loadInterstitialAd", {
                    id: e,
                    width: t - 80,
                    height: t - 80
                });
            }
            static ads(e, t, i) {
                this.naticeVideoCallback = Laya.Handler.create(t, i),
                this.bridgeCall("loadRewardvideoAd", {
                    id: e,
                    uid: "123"
                });
            }
            static showFullScreenAd(e) {
                this.bridgeCall("loadFullScreenVideoAd", {
                    id: e
                });
            }
            static openApp(e, t = "") {
                this.bridgeCall("openAppStore", {
                    id: e,
                    url: t
                });
            }
            static getSdkChannelID(e, t) {
                this.naticeVideoCallback = Laya.Handler.create(e, t),
                a.bridgeCall("getChannelID", {});
            }
            static showNativeAD(e) {
                this.bridgeCall("showNativeAD", {
                    id: e
                });
            }
            static showNativeIcon(e) {
                this.bridgeCall("showIconAD", {
                    id: e
                });
            }
            static jumpgamecenter() {
                this.bridgeCall("jumpgamecenter", {});
            }
            static finishapp() {
                this.bridgeCall("finishapp", {});
            }
            static initSDK(e) {
                this.bridgeCall("initSDK", {
                    id: e
                });
            }
            static Initname(e, t) {
                this.naticeVideoCallback = Laya.Handler.create(e, t),
                this.bridgeCall("Initname", {});
            }
        }
        class n {
            constructor() {
                this.isRecording = !1,
                this._startRecordTime = -1,
                this.GameRecorderManager = null,
                this.pauseing = !1,
                this.tempRecordUrl = null,
                this._duration = 0;
            }
            static getInstance() {
                return null == n.instance && (n.instance = new n),
                n.instance
            }
            initManager() {
                if (!this.GameRecorderManager && window.tt) {
                    if ("devtools" == window.tt.getSystemInfoSync().platform) return;
                    window.tt.getGameRecorderManager && (this.GameRecorderManager = window.tt.getGameRecorderManager(), this.listenRecorderEvent());
                }
            }
            startGameRecorder(e = 60, t, i) {
                this.GameRecorderManager && (this._caller = t, this._timeUpCallback = i, this._duration = e, this._startRecordTime = Date.now(), this.isRecording = !0, this.GameRecorderManager && this.GameRecorderManager.start({
                    duration: e
                }), this.tempRecordUrl = null);
            }
            get isRecord() {
                return this.isRecording
            }
            get isPause() {
                return this.pauseing
            }
            pauseGameRecorder() {
                this.GameRecorderManager && this.GameRecorderManager.pause && this.GameRecorderManager.pause(),
                this.isRecording = !1,
                this.pauseing = !0;
            }
            resumeGameRecorder() {
                this.GameRecorderManager && this.GameRecorderManager.resume && this.GameRecorderManager.resume(),
                this.isRecording = !0,
                this.pauseing = !1;
            }
            stopGameRecorder(e) {
                console.log("call stop 录屏"),
                this.isRecording = !1,
                this._stopRecordCallback = e,
                this.GameRecorderManager && this.GameRecorderManager.stop();
            }
            isSupportRecord() {
                return !! this.GameRecorderManager
            }
            getHasRecord() {
                return console.log("this.tempRecordUrl", this.tempRecordUrl),
                !!this.tempRecordUrl
            }
            _timeUp() {
                this.stopGameRecorder();
            }
            _startRecordTimeListen() {
                let e = 1e3 * this._duration - (Date.now() - this._startRecordTime);
                e > 0 && Laya.timer.once(e, this, this._timeUp);
            }
            listenRecorderEvent() {
                this.GameRecorderManager ? (this.GameRecorderManager.onStart(() =>{
                    console.log("录屏开始"),
                    Laya.timer.clearAll(this),
                    this._startRecordTimeListen();
                }), this.GameRecorderManager.onPause(() =>{
                    console.log("录屏暂停"),
                    Laya.timer.clearAll(this);
                }), this.GameRecorderManager.onResume(() =>{
                    console.log("录屏恢复"),
                    this._startRecordTimeListen();
                }), this.GameRecorderManager.onStop(e =>{
                    console.log("录屏结束", e.videoPath),
                    Date.now() - this._startRecordTime < 3e3 ? console.log("录屏时长低于3秒") : this.tempRecordUrl = e.videoPath,
                    Laya.timer.clearAll(this),
                    this._stopRecordCallback && this._stopRecordCallback(),
                    this._timeUpCallback.call(this._caller, {
                        code: 0
                    });
                }), this.GameRecorderManager.onError(e =>{
                    console.log("录屏异常", e),
                    Laya.timer.clearAll(this);
                })) : console.log("当前版本不支持录屏");
            }
        }
        n.instance = null,
        n.Stop_Recorder = "Stop_Recorder";
        var o = n.getInstance();
        class r {
            static isSameDay(e, t) {
                var i = new Date(e);
                i.setHours(0, 0, 0, 0);
                var s = i.getTime();
                return i.setTime(t),
                i.setHours(0, 0, 0, 0),
                s == i.getTime()
            }
            static getCrtTime() {
                return (new Date).getTime()
            }
            static format(e, t = "auto") {
                var i = e % 60,
                s = (e = Math.floor(e / 60)) % 60,
                a = Math.floor(e / 60);
                return "h:m:s" == t ? this.fullNumLen(a) + ":" + this.fullNumLen(s) + ":" + this.fullNumLen(i) : (a > 0 ? this.fullNumLen(a) + ":": "") + this.fullNumLen(s) + ":" + this.fullNumLen(i)
            }
            static fullNumLen(e, t = 2) {
                for (var i = e.toString(); i.length < t;) i = "0" + i;
                return i
            }
        }
        class l {
            static get3dPath(e) {
                return "subpack2/Conventional/" + e
            }
            static get resource() {
                return [l.get3dPath("XiePo3.ls"), l.get3dPath("MotoRoom1.ls")]
            }
            static setChild(e, t, i) {
                for (let s = 0; s < e.numChildren; s++) e.getChildAt(s).active = s != i ? t: !t;
            }
        }
        l.MVC_CLOSE_ICON_AD = "MVC_CLOSE_ICON_AD",
        l.MVC_COIN_CHANGE = "MVC_COIN_CHANGE",
        l.MVC_GAME_LOADED = "MVC_GAME_LOADED",
        l.MVC_CAR_RESET = "MVC_CAR_RESET",
        l.MVC_CAR_HITED = "MVC_CAR_HITED",
        l.MVC_CAR_DIE = "MVC_CAR_DIE",
        l.MVC_GAME_END = "MVC_GAME_END",
        l.MVC_GAME_ADDNUM = "MVC_GAME_ADDNUM",
        l.MVC_GAME_PAUSE = "MVC_GAME_PAUSE",
        l.MVC_GAME_AGAIN = "MVC_GAME_AGAIN",
        l.MVC_FLY_SUCCESS = "MVC_FLY_SUCCESS",
        l.MVC_HERO_DONE = "MVC_HERO_DONE",
        l.VivoAdTime = new Date("2023-7-20 18:00:00").getTime();
        class h {
            constructor() {
                this.index = 0,
                this.nativeAdLastUpdateTime = 0;
            }
            static get Instance() {
                return h._instance || (h._instance = new h),
                h._instance
            }
            get isLoadOk() {
                return h._isLoadOk
            }
            get AdList() {
                return h._adList
            }
            get hasNativeAd() {
                return L.PLATFORM == C.OPPO || L.PLATFORM == C.VIVO || L.PLATFORM == C.HW
            }
            InitNativeAd() {
                this.hasNativeAd && (S.NATIVE_AD_IDS ? (this.nativeAdIds = S.NATIVE_AD_IDS, console.log("创建原生广告初始化")) : console.warn("fail NATIVE_AD_ID undefine"));
            }
            CreateNativeAd(e, t, i) {
                if (!L.platObj || !L.platObj.createNativeAd) return;
                this.nativeAdLastUpdateTime = Date.now();
                let s,
                a = this.nativeAdIds[e];
                a || (a = this.nativeAdIds[0]),
                a && (console.log(a + "创建原生广告"), h._isLoadOk = !1, s = L.PLATFORM == C.OPPO && L.platObj.getSystemInfoSync().platformVersion >= 1051 ? {
                    adUnitId: a
                }: L.PLATFORM == C.HW ? {
                    adUnitId: a,
                    success: e =>{
                        console.log("loadNativeAd loadNativeAd : success");
                    },
                    fail: (e, t) =>{
                        console.log("loadNativeAd loadNativeAd fail: " + e + "," + t);
                    },
                    complete: () =>{
                        console.log("loadNativeAd loadNativeAd : complete");
                    }
                }: {
                    posId: a
                },
                h.nativeAd = L.platObj.createNativeAd(s), h._caller = t, h._callback = i, h.nativeAd.onLoad(this.onLoad), L.PLATFORM == C.VIVO ? h.nativeAd.load().then(() =>{}).
                catch(e =>{
                    console.log("原生广告.load加载失败", JSON.stringify(e));
                }) : (console.log(a, "加载原生广告"), h.nativeAd.load()), h.nativeAd.onError(e =>{
                    console.log("nativeAdId,原生广告加载失败", JSON.stringify(e));
                }));
            }
            onLoad(e) {
                if (console.log("原生广告加载onLoad" + JSON.stringify(e)), e && e.adList && e.adList.length > 0) {
                    let t;
                    t = e.adList,
                    h._adList = t.pop(),
                    h._isLoadOk = !0,
                    h._caller && h._callback && h._callback.call(h._caller, {
                        code: 0
                    });
                }
            }
            ReportAdClick() {
                if (this.AdList && (console.log("reportAdClick点击原生广告"), h.nativeAd && this.AdList)) {
                    h.nativeAd.reportAdClick({
                        adId: this.AdList.adId.toString()
                    });
                    let e = L.PLATFORM == C.VIVO ? 11e3: 6e3;
                    Laya.timer.once(e - (Date.now() - this.nativeAdLastUpdateTime), this, this.Destroy),
                    this.Destroy();
                }
            }
            ReportAdShow() {
                console.log("++++++++++++"),
                this.AdList && (console.log("reportAdShow原生广告曝光"), h.nativeAd && this.AdList && h.nativeAd.reportAdShow({
                    adId: this.AdList.adId.toString()
                }));
            }
            ReportAdClose() {
                h.nativeAd && this.Destroy();
            }
            Destroy() {
                console.log("reportAdShow原生广告destroy");
                let e = L.PLATFORM == C.VIVO ? 1e4: 5500;
                Date.now() - this.nativeAdLastUpdateTime < e ? console.warn("nativeAd destroy fail!!!time so small") : (Laya.timer.clear(this, this.Destroy), h.nativeAd.offLoad(this.onLoad), h.nativeAd.offError(), h.nativeAd.destroy && h.nativeAd.destroy(), h._adList = null);
            }
        }
        h._isLoadOk = !1;
        class c {
            static destroyCustomAd() {
                L.PLATFORM == C.VIVO && c.customAd && (c.customAd.destroy(), c.customAd = null);
            }
            static showNativeWin(t = 15, i = 15) {
                if (console.log("showNativeWin 1"), L.PLATFORM == C.VIVO || L.PLATFORM == C.OPPO) {
                    if (!L.platObj.createCustomAd) return;
                    c.customAd = L.platObj.createCustomAd({
                        adUnitId: S.NATIVE_AD_IDS[0]
                    }),
                    c.customAd.show().then(() =>{
                        console.log("原生模板广告展示完成");
                    }).
                    catch(e =>{
                        console.log("原生模板广告展示失败", JSON.stringify(e)),
                        I.showInsertAd();
                    }),
                    c.customAd.onError(e =>{
                        console.log(e);
                    });
                } else L.PLATFORM == C.HW && (console.log("showNativeWin 2"), h.Instance.CreateNativeAd(0, this, () =>{
                    let s = h.Instance.AdList;
                    if (console.log("showNativeWin 3:", s), !s) return;
                    console.log("showNativeWin 4");
                    let a = fairygui.UIPackage.createObject("NativeAd", "NativeWin").asCom;
                    fairygui.GRoot.inst.addChild(a);
                    let n = a.getChild("win").asCom;
                    n.setXY((fairygui.GRoot.inst.width - n.width) / 2, (fairygui.GRoot.inst.height - n.height) / 2);
                    let o = n.getChild("closeBtn").asButton,
                    r = n.getChild("openBtn").asButton,
                    l = n.getChild("title").asTextField,
                    c = n.getChild("source").asTextField,
                    d = n.getChild("icon").asLoader;
                    o.width = t,
                    o.height = i,
                    l.text = s.title,
                    c.text = s.source,
                    s.clickBtnTxt && s.clickBtnTxt.length > 0 ? r.title = s.clickBtnTxt: r.visible = !1,
                    d.url = s.imgUrlList[0];
                    let m = () =>{
                        a.removeFromParent();
                    },
                    g = () =>{
                        let e = h.Instance.AdList;
                        l.text = e.title,
                        c.text = e.source,
                        r.title = e.clickBtnTxt,
                        d.url = e.imgUrlList[0];
                    };
                    e.On(e.MINI_ONHIDE, null, m),
                    e.On(e.NATIVE_AD_REFRESH, null, g),
                    o.onClick(this, () =>{
                        e.Off(e.MINI_ONHIDE, null, m),
                        e.Off(e.NATIVE_AD_REFRESH, null, g),
                        a.removeFromParent(),
                        h.Instance.ReportAdClose();
                    }),
                    d.onClick(this, () =>{
                        e.Off(e.MINI_ONHIDE, null, m),
                        e.Off(e.NATIVE_AD_REFRESH, null, g),
                        a.removeFromParent(),
                        h.Instance.ReportAdClick();
                    }),
                    r.onClick(this, () =>{
                        e.Off(e.MINI_ONHIDE, null, m),
                        e.Off(e.NATIVE_AD_REFRESH, null, g),
                        a.removeFromParent(),
                        h.Instance.ReportAdClick();
                    }),
                    h.Instance.ReportAdShow();
                }));
            }
            static showNativeIn(e, t, i, s = 1) {
                let a = h.Instance.AdList;
                if (!a) return;
                let n = fairygui.UIPackage.createObject("NativeAd", "NativeIn").asCom;
                n.setScale(s, s),
                e.addChild(n),
                n.setXY(t, i);
                let o = n.getChild("closeBtn").asButton,
                r = n.getChild("openBtn").asButton,
                c = n.getChild("title").asTextField,
                d = n.getChild("source").asTextField,
                m = n.getChild("icon").asLoader;
                o.width = 30,
                o.height = 30,
                c.text = a.desc,
                d.text = a.title,
                r.title = a.clickBtnTxt;
                let g = a.imgUrlList[0].split("?");
                m.url = g[0];
                o.on(Laya.Event.MOUSE_DOWN, this, () =>{
                    let e = !1;
                    if ((new Date).getTime() >= l.VivoAdTime) {
                        const s = Laya.stage.mouseX - t,
                        a = Laya.stage.mouseY - i;
                        s >= 475 && s <= 480 && a >= 15 && a <= 20 && (e = !0);
                    } else e = !0;
                    e ? h.Instance.ReportAdClose() : h.Instance.ReportAdClick(),
                    n.removeFromParent();
                }),
                m.onClick(this, () =>{
                    h.Instance.ReportAdClick();
                }),
                r.onClick(this, () =>{
                    h.Instance.ReportAdClick();
                }),
                h.Instance.ReportAdShow();
            }
            static showNativeIcon(e, t, i) {
                h.Instance.CreateNativeAd(1, this, () =>{
                    let s = h.Instance.AdList;
                    if (!s) return ! 1;
                    let a = fairygui.UIPackage.createObject("NativeAd", "NativeIcon").asCom;
                    e.addChild(a),
                    a.setXY(t, i);
                    let n = a.getChild("closeBtn").asButton,
                    o = a.getChild("icon").asLoader;
                    o.url = s.icon,
                    n.onClick(this, () =>{
                        a.removeFromParent(),
                        h.Instance.ReportAdClose();
                    }),
                    o.onClick(this, () =>{
                        h.Instance.ReportAdClick(),
                        a.removeFromParent();
                    }),
                    h.Instance.ReportAdShow();
                });
            }
        }
        class d {
            static Init(e) {
                if (!L.isMiniGame) return;
                if (!e) return void console.warn("没banner广告ids初始化失败");
                console.warn("banner init:", e),
                d._ids = [];
                let t = 0;
                for (; t < e.length;) {
                    var i = Math.floor(Math.random() * e.length);
                    d._ids.push(e[i]),
                    t++;
                }
            }
            static ShowBannerAd() {
                if (L.isMiniGame) {
                    if (d.banner) return void d.banner.show();
                    if (console.log("banner 创建:" + d._ids), L.PlatObj.createBannerAd && d._ids && d._ids.length > 0) {
                        let t = d._ids[0];
                        console.log("banner 创建:" + t);
                        var e = null;
                        let i,
                        s = Laya.Browser.clientWidth,
                        a = Laya.Browser.clientHeight,
                        n = s;
                        if (L.PLATFORM == C.HW) {
                            i = {
                                adUnitId: t,
                                adIntervals: 30,
                                style: {
                                    top: L.systemInfo.safeArea.height - 57,
                                    left: 0,
                                    height: 57,
                                    width: 360
                                }
                            },
                            console.log("banner 华为创建:", JSON.stringify(i)),
                            console.log("banner createBannerAd:", JSON.stringify(i)),
                            (e = L.PlatObj.createBannerAd(i)).onLoad(() =>{
                                console.log("banner 广告加载成功onLoad", JSON.stringify(e.style));
                            }),
                            e.onError(e =>{
                                console.log("Banner 广告错误", JSON.stringify(e));
                            }),
                            e.show();
                        } else L.PLATFORM == C.OPPO && L.PlatObj.getSystemInfoSync().platformVersion < 1051 ? (i = {
                            posId: t
                        },
                        console.log("banner createBannerAd:", JSON.stringify(i)), (e = L.PlatObj.createBannerAd(i)).onLoad(() =>{
                            console.log("banner 广告加载成功onLoad", JSON.stringify(e.style));
                        }), e.onError(e =>{
                            console.log("Banner 广告错误", JSON.stringify(e));
                        }), e.show()) : L.PLATFORM == C.VIVO ? (i = {
                            posId: t,
                            style: {}
                        },
                        (e = L.PlatObj.createBannerAd(i)).onError(e =>{
                            console.log("banner广告加载失败", e);
                        }), e.show().then(() =>{
                            console.log("banner广告展示完成");
                        }).
                        catch(e =>{
                            console.log("banner广告展示失败", JSON.stringify(e));
                        })) : L.PLATFORM == C.TT ? (i = {
                            adUnitId: t,
                            adIntervals: 60,
                            style: {
                                width: s,
                                height: 57,
                                top: a - 100,
                                left: 0
                            }
                        },
                        console.log("banner createBannerAd:", JSON.stringify(i)), (e = L.PlatObj.createBannerAd(i)).onResize(t =>{
                            console.log("obj", t),
                            e.style.top = a - t.height,
                            e.style.left = (s - t.width) / 2;
                        }), e.onLoad(() =>{
                            console.log("banner 广告加载成功onLoad", JSON.stringify(e.style)),
                            e.show();
                        }), e.onError(e =>{
                            console.log("Banner 广告错误", JSON.stringify(e));
                        })) : (i = {
                            adUnitId: t,
                            style: {
                                width: s,
                                height: 100,
                                top: 0,
                                left: (s - n) / 2
                            }
                        },
                        console.log("banner createBannerAd:", JSON.stringify(i)), (e = L.PlatObj.createBannerAd(i)).onResize(t =>{
                            console.log("obj", t),
                            e.style.top = a - t.height,
                            e.style.left = (s - t.width) / 2;
                        }), e.onLoad(() =>{
                            console.log("banner 广告加载成功onLoad", JSON.stringify(e.style));
                        }), e.onError(e =>{
                            console.log("Banner 广告错误", JSON.stringify(e));
                        }), e.show());
                        d.banner = e;
                    }
                }
            }
            static HideBanner() {
                d.banner && (d.banner.hide(), L.PLATFORM != C.OPPO && (d.banner.destroy(), d.banner = null));
            }
        }
        class m {
            static CanShowTT() {
                if (L.PLATFORM == C.TT) {
                    let e = r.getCrtTime();
                    return m.showTime > 0 && e - m.showTime > 6e4 || 0 == m.showTime && e - L.StartUpTime > 3e4
                }
                return ! 0
            }
            static ShowInsertAd() {
                if (m.CanShowTT()) if (L.PLATFORM == C.VIVO || L.PLATFORM == C.TT) m.CreateInsertAd();
                else {
                    if (!m.interstitialAd) return void console.log("没有创建插屏Platform.interstitialAd");
                    if (!m.interstitialAd.show) return void console.log("Platform.interstitialAd.show not a fun!");
                    m.interErrorFun && m.interstitialAd.offError(m.interErrorFun),
                    m.interErrorFun = (e =>{
                        Laya.timer.once(1e3, m, m.LoadInsertAd);
                    }),
                    m.interstitialAd.onError(m.interErrorFun),
                    console.log("展示插屏"),
                    m.interstitialAd.show();
                }
            }
            static CreateInsertAd() {
                if (console.log("CreateInsertAd1"), !L.isMiniGame) return void console.log("createInsertAd fail because platform is not minigame,");
                if (console.log("CreateInsertAd2"), !L.platObj.createInsertAd && !L.platObj.createInterstitialAd) return void console.log("没有createInsertAd创建插屏方法");
                if (console.log("CreateInsertAd3"), !S.INSERT_AD_ID) return void console.log("没有创建插屏adUnitId");
                let e;
                console.log("创建插屏广告");
                let t = S.INSERT_AD_ID;
                m.interstitialAd && m.interstitialAd.destroy && L.PLATFORM != C.TT && m.interstitialAd.destroy(),
                L.PLATFORM == C.OPPO && L.platObj.getSystemInfoSync().platformVersion < 1051 ? (e = {
                    posId: t
                },
                m.interstitialAd = L.platObj.createInsertAd(e)) : (e = {
                    adUnitId: t
                },
                L.PLATFORM == C.VIVO && (e = {
                    posId: t
                }), L.PLATFORM == C.OPPO ? m.interstitialAd = L.platObj.createInsertAd(e) : L.PLATFORM == C.TT ? m.interstitialAd = L.platObj.createInterstitialAd(e) : (console.log("创建插屏广告 createInterstitialAd"), m.interstitialAd = L.platObj.createInterstitialAd(e))),
                m.interstitialAd ? (console.log("插屏广告 has interstitialAd"), L.PLATFORM == C.OPPO && L.platObj.getSystemInfoSync().platformVersion < 1051 ? m.interstitialAd.onShow(() =>{
                    m.LoadInsertAd();
                }) : m.interstitialAd.onClose(() =>{
                    L.PLATFORM != C.VIVO && L.PLATFORM != C.TT || !m.interstitialAd.destroy ? m.LoadInsertAd() : m.interstitialAd.destroy();
                }), m.interErrorFun = (e =>{
                    console.warn(S.INSERT_AD_ID + "插屏 广告加载失败", JSON.stringify(e));
                }), m.interstitialAd.onError(m.interErrorFun), m.interstitialAd.onLoad(() =>{
                    L.PLATFORM == C.VIVO && m.interstitialAd.show().then(() =>{}).
                    catch(e =>{
                        console.warn("插屏广告显示失败", JSON.stringify(e));
                    });
                }), L.PLATFORM != C.WX && m.interstitialAd.load && (L.PLATFORM == C.TT ? (console.log("插屏广告 tt"), m.showTime = r.getCrtTime(), m.interstitialAd.load().then(() =>{
                    console.log("加载插屏广告 tt"),
                    m.interstitialAd.show().then(() =>{
                        console.log("展示插屏广告 tt");
                    }).
                    catch(e =>{
                        console.log("插屏广告显示失败1", JSON.stringify(e));
                    });
                }).
                catch(e =>{
                    console.log("插屏广告显示失败2", JSON.stringify(e));
                })) : m.interstitialAd.load())) : console.warn("===PlatMgr.interstitialAd undefind===");
            }
            static LoadInsertAd() {
                m.interstitialAd && L.PLATFORM != C.VIVO && L.PLATFORM != C.TT && (Laya.timer.clear(m, m.LoadInsertAd), m.interErrorFun && m.interstitialAd.offError(m.interErrorFun), m.interErrorFun = (e =>{}), m.interstitialAd.onError(this.interErrorFun), L.PLATFORM == C.WX ? m.CreateInsertAd() : m.interstitialAd.load && m.interstitialAd.load());
            }
        }
        m.showTime = 0;
        class g extends fgui.GComponent {
            static showTips(e) {
                this.tipsWin || (this.tipsWin = fgui.UIPackage.createObject("Game", "tipsComp").asCom),
                Laya.Tween.clearAll(this.tipsWin),
                this.tipsWin.getChild("context").asTextField.text = e,
                this.tipsWin.x = Laya.stage.width / 2 - this.tipsWin.width / 2,
                this.tipsWin.y = Laya.stage.height / 2 - 50,
                this.tipsWin.alpha = 1,
                fgui.GRoot.inst.addChild(this.tipsWin),
                Laya.Tween.to(this.tipsWin, {
                    y: this.tipsWin.y - 50,
                    alpha: 0
                },
                1600, null, Laya.Handler.create(this, () =>{
                    fgui.GRoot.inst.removeChild(this.tipsWin);
                }));
            }
        }
        var u = "PoDaoCar3";
        class p {
            static get inst() {
                return p._instance = p._instance || new p,
                p._instance
            }
            save(e) {
                let t = JSON.stringify(e);
                this.saveData(u, t);
            }
            saveData(e, t, i, s = !1) {
                let a = e;
                localStorage.setItem(a, t);
            }
            getDate() {
                return localStorage.getItem(u)
            }
        }
        class w {
            constructor() {
                this.tryPlane = 0;
            }
            static get inst() {
                return w._inst = w._inst || new w,
                w._inst
            }
            initData() {
                let e = p.inst.getDate();
                if (e) this.gameData = JSON.parse(e),
                this._addDataField(),
                this._resetDataByNeed();
                else {
                    let e = Date.now();
                    this.gameData = {
                        aliveTime: e,
                        coin: 1e3,
                        planes: [1],
                        usedId: 1,
                        secret: 0,
                        exp: 0,
                        level: 1,
                        hasPlane: [],
                        moveingPlane: [],
                        unLockLevel: 1,
                        speedUpTime: 0,
                        planeBuyTime: [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, 0, 0, 0, 0, 0, 0, 0],
                        unlockBuy: [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, 0, 0, 0, 0, 0, 0, 0],
                        musicOnOff: !0,
                        soundOnOff: !0,
                        guide: 0,
                        luckDrawNum: 5,
                        enemys: [1, 0, 0, 0, 0, 0, 0],
                        enemyUser: 0
                    };
                }
            }
            unlockMaxIndex() {
                for (let e = this.gameData.unlockBuy.length; e >= 0; e--) if (1 == this.gameData.unlockBuy[e]) return e;
                return 0
            }
            unlockBuy(e) {
                this.gameData.unlockBuy[e] = 1,
                this.saveData();
            }
            isUnluckBuy(e) {
                return this.gameData.unlockBuy[e]
            }
            get enemyUser() {
                return this.gameData.enemyUser
            }
            set enemyUser(e) {
                this.gameData.enemyUser = e,
                this.saveData();
            }
            get luckDrawNum() {
                return this.gameData.luckDrawNum
            }
            set luckDrawNum(e) {
                this.gameData.luckDrawNum = e,
                this.saveData();
            }
            get guide() {
                return this.gameData.guide
            }
            set guide(e) {
                this.gameData.guide = e,
                this.saveData();
            }
            get aliveTime() {
                return this.gameData.aliveTime
            }
            get music() {
                return this.gameData.musicOnOff
            }
            set music(e) {
                this.gameData.musicOnOff = e,
                this.saveData();
            }
            get sound() {
                return this.gameData.soundOnOff
            }
            set sound(e) {
                this.gameData.soundOnOff = e,
                this.saveData();
            }
            getBuyTimeByLevel(e) {
                return this.gameData.planeBuyTime[e]
            }
            addBuyTimeByLevel(e) {
                this.gameData.planeBuyTime[e] += 1,
                this.saveData();
            }
            get speedUpTime() {
                return this.gameData.speedUpTime
            }
            set speedUpTime(e) {
                this.gameData.speedUpTime <= 0 && e > 0 || this.gameData.speedUpTime,
                this.gameData.speedUpTime = e,
                this.saveData();
            }
            setUnlockLeve(e) {
                e > this.gameData.unLockLevel && (this.gameData.unLockLevel = e),
                this.saveData();
            }
            get unlockLevel() {
                return this.gameData.unLockLevel
            }
            setMoveingPlane(e) {
                this.gameData.moveingPlane = e,
                this.saveData();
            }
            getMoveingPlane() {
                return this.gameData.moveingPlane
            }
            setHasPlane(e) {
                this.gameData.hasPlane = e,
                this.saveData();
            }
            isFullPlane(e) {
                let t = 0;
                for (let e = 0, i = this.gameData.hasPlane.length; e < i; e++) null != this.gameData.hasPlane[e] && t++;
                return ! (t < e)
            }
            getHasPlane() {
                return this.gameData.hasPlane
            }
            set exp(e) {
                this.gameData.exp = e,
                this.saveData();
            }
            get exp() {
                return this.gameData.exp
            }
            get level() {
                return this.gameData.level
            }
            addLevel() {
                this.gameData.level += 1,
                this.saveData();
            }
            _addDataField() {}
            _resetDataByNeed() {
                r.isSameDay(v.gameData.aliveTime, r.getCrtTime()) || (this.gameData.luckDrawNum = 5);
            }
            setSecret() {
                this.gameData.secret = 1,
                this.saveData();
            }
            setUsedId(e) {
                this.gameData.usedId = e,
                this.saveData();
            }
            getUseId() {
                return this.gameData.usedId
            }
            addCoin(t) {
                this.gameData.coin += t,
                this.saveData(),
                e.Send(l.MVC_COIN_CHANGE);
            }
            useCoin(t) {
                return t <= this.gameData.coin && (this.gameData.coin -= t, this.saveData(), e.Send(l.MVC_COIN_CHANGE), !0)
            }
            getCoin() {
                return this.gameData.coin
            }
            addPlane(e) {
                this.gameData.planes.indexOf(e) < 0 && (this.gameData.planes.push(e), this.saveData());
            }
            getPlanes() {
                return this.gameData.planes
            }
            isPlaneHas(e) {
                return this.gameData.planes.indexOf(e) >= 0
            }
            saveData() {
                v.gameData.aliveTime = r.getCrtTime(),
                p.inst.save(this.gameData);
            }
            enemyIndex(e) {
                return 1 == this.gameData.enemys[e]
            }
            enemyUnlock(e) {
                this.gameData.enemys[e] = 1,
                this.saveData();
            }
        }
        var v = w.inst;
        class A {
            constructor() {}
            static vibrateShort() {
                A.instance._shakeStatus;
            }
            static vibrateLong() {
                A.instance._shakeStatus;
            }
            static get instance() {
                return A._instance || (A._instance = new A),
                A._instance
            }
            init(e = "res/sound/", t = "wav", i = null) {
                console.log("sound init soundUrl", e),
                console.log("sound init type", t),
                A.soundUrl = e,
                A.type = t,
                i && (fairygui.UIConfig.buttonSound = A.soundUrl + i + "." + A.type),
                v.sound || (fairygui.UIConfig.buttonSoundVolumeScale = 0),
                v.sound ? this.resumeSound() : this.stopSound();
            }
            playMusic(e, t = 0) {
                v.music && (e && (this._currentBg = e), this._currentBg && Laya.SoundManager.playMusic(A.soundUrl + this._currentBg + "." + A.type, t));
            }
            playSound(e, t = 1) {
                if (!v.sound) return;
                let i = A.soundUrl + e + "." + A.type;
                console.log("playSound url", i),
                Laya.SoundManager.playSound(i, t);
            }
            playSoundOver(e, t) {
                if (!v.sound) return;
                let i = A.soundUrl + e + "." + A.type;
                console.log("playSound url", i),
                Laya.SoundManager.playSound(i, 1, new Laya.Handler(this, t));
            }
            stopAndPlay(e, t) {
                this.stopAllSound(),
                this.playSound(e, t);
            }
            stopAndOnPlay(e, t) {
                this.stopAllSound(),
                this.playSoundOver(e, t);
            }
            stopSound() {
                Laya.SoundManager.soundMuted = !0;
            }
            resumeSound() {
                Laya.SoundManager.soundMuted = !1;
            }
            stopAllSound() {
                Laya.SoundManager.stopAllSound();
            }
            stopMusic() {
                Laya.SoundManager.stopMusic();
            }
            resumeMusic() {
                A.instance.playMusic(null);
            }
            set soundStatus(e) {
                this._soundStatus = e,
                Laya.SoundManager.soundMuted = e,
                Laya.LocalStorage.setItem("soundMuted", e ? "1": "0"),
                e && Laya.SoundManager.stopAllSound();
            }
            get musicStatus() {
                return this._musicStatus
            }
            get soundStatus() {
                return this._soundStatus
            }
            set shakeStatus(e) {
                this._shakeStatus = e,
                e ? Laya.LocalStorage.setItem("Shake", "1") : Laya.LocalStorage.setItem("Shake", "0");
            }
            get shakeStatus() {
                return this._shakeStatus
            }
        }
        A.soundUrl = "res/sound/",
        A.type = ".mp3";
        var C, _, f = A.instance;
        class y {
            static CreateVideo() {
                if (!L.PlatObj.createRewardedVideoAd) return void console.log("没有激励视频广告组件");
                if (!S.VIDEO_ID || "" == S.VIDEO_ID) return void console.log("没有激励视频广告id");
                let e;
                y.rewardedVideoAd = null,
                e = L.PlatObj.getSystemInfoSync().platformVersion < 1051 ? {
                    posId: S.VIDEO_ID
                }: {
                    adUnitId: S.VIDEO_ID
                },
                y.rewardedVideoAd = L.PlatObj.createRewardedVideoAd(e),
                y.rewardedVideoAd.onError(e =>{
                    console.log(S.VIDEO_ID + "激励视频1 广告加载失败" + e.code + e.msg),
                    Laya.timer.clear(this, this.LoadVideo),
                    Laya.timer.once(1e4, this, this.LoadVideo);
                }),
                y.rewardedVideoAd.onLoad(() =>{
                    console.log("激励视频1 广告加载成功"),
                    y.loadVideoAdSuccess = !0;
                }),
                L.PLATFORM != C.VIVO && y.rewardedVideoAd.load();
            }
            static ShowVideo(e, t) {
                if (console.log("ShowVideo 1"), y.rewardedVideoAd) {
                    f.stopMusic(),
                    console.log("ShowVideo 2");
                    var i = function(s) {
                        f.resumeMusic(),
                        s && s.isEnded ? (console.log("视频播放正常结束！！"), e && t && t.call(e, {
                            code: 0
                        })) : (console.log("视频播放中途退出！！"), e && t && t.call(e, {
                            code: 1
                        })),
                        y.LoadVideo(),
                        y.rewardedVideoAd.offClose(i);
                    };
                    console.log("Platform.rewardedVideoAd show:"),
                    y.loadVideoAdSuccess ? (y.rewardedVideoAd.offError(), y.rewardedVideoAd.onError(i =>{
                        console.log("激励视频1 广告显示失败" + i.code + i.msg),
                        this.LoadVideo(),
                        g.showTips("暂无视频，稍后再试！"),
                        e && t && t.call(e, {
                            code: 2
                        });
                    }), console.log("ShowVideo show"), y.rewardedVideoAd.show(), y.rewardedVideoAd.onClose(i)) : (this.LoadVideo(), g.showTips("暂无视频，稍后再试！"), e && t && t.call(e, {
                        code: 2
                    }));
                } else g.showTips("暂无视频，稍后再试！"),
                e && t && t.call(e, {
                    code: 2
                });
            }
            static LoadVideo() {
                y.rewardedVideoAd.offError(),
                y.rewardedVideoAd.onError(e =>{
                    console.log("激励视频1 广告重新加载失败" + e.code + e.msg),
                    Laya.timer.clear(this, this.LoadVideo),
                    Laya.timer.once(1e4, this, this.LoadVideo),
                    y.loadVideoAdSuccess = !1;
                }),
                y.rewardedVideoAd.load();
            }
        }
        y.loadVideoAdSuccess = !1;
        class I {
            static initAd() {
                h.Instance.InitNativeAd(),
                L.isMiniGame && (d.Init(S.BANNER_IDS), L.PLATFORM != C.VIVO && L.PLATFORM != C.TT && m.CreateInsertAd());
            }
            static showBanner() {
                console.log("显示banner:" + L.isNative),
                S.BANNER_IDS && S.BANNER_IDS.length > 0 && (console.log("显示banner:" + S.BANNER_IDS[0]), L.isNative ? a.showBannerAd(S.BANNER_IDS[0]) : d.ShowBannerAd());
            }
            static hideBanner() {
                L.isNative ? a.hideBannerAd() : d.HideBanner();
            }
            static showInsertAd() {
                console.log("显示插屏", S.INSERT_AD_ID),
                S.INSERT_AD_ID && (L.isNative ? (console.log("显示插屏", S.INSERT_AD_ID), a.showInsertAd(S.INSERT_AD_ID)) : m.ShowInsertAd());
            }
            static showFullVideoAd() {
                console.log("展示全屏视频广告", S.Full_VIDEO_ID),
                L.isNative && S.Full_VIDEO_ID && I.canShowFullScreen && (a.showFullScreenAd(S.Full_VIDEO_ID), L.FullScreenLastTime = r.getCrtTime());
            }
            static createVideo() {
                y.CreateVideo();
            }
            static showVideoAd(e, t) {
                L.isNative && S.VIDEO_ID ? a.ads(S.VIDEO_ID, e, t) : L.isMiniGame && S.VIDEO_ID ? y.ShowVideo(e, t) : t.call(e, {
                    code: 0
                });
            }
            static showSplashAD() {
                L.isNative && S.SPLASH_AD_ID && a.bridgeCall("addSplashAD", {
                    id: S.SPLASH_AD_ID
                });
            }
            static showMiniNativeWin(e = 20, t = 20) {
                r.getCrtTime() >= l.VivoAdTime && c.showNativeWin(e, t);
            }
            static showVivoNativeWin(e = 0) {
                console.log("time:", e),
                console.log("TimeTools.getCrtTime:", r.getCrtTime()),
                S.NATIVE_AD_IDS && r.getCrtTime() >= e && c.showNativeWin(0, 0);
            }
            static showMiniNativeIn(e, t, i, s = 1) {
                L.isMiniGame && (400, 100, c.showNativeIn(e, 400, 100, s));
            }
            static showMiniNativeIcon(e, t, i) {
                L.isMiniGame && L.PLATFORM == C.OPPO && S.NATIVE_AD_IDS && c.showNativeIcon(e, t, i);
            }
            static showNativeAD(e = l.VivoAdTime) {
                L.isNative && S.NATIVE_AD_IDS && (L.ANDROID_CHANELL == _.VIVO ? r.getCrtTime() >= e && a.showNativeAD(S.NATIVE_AD_IDS[0]) : a.showNativeAD(S.NATIVE_AD_IDS[0]));
            }
            static get canShowFullScreen() {
                if (S.FullAd_Interval && S.FullAd_Interval > 0) {
                    let e = L.FullScreenLastTime + S.FullAd_Interval - r.getCrtTime();
                    if (console.log("PlatMgr.FullScreenLastTime：" + L.FullScreenLastTime), console.log("PlatformCfg.FullAd_Interval：" + S.FullAd_Interval), console.log("TimeTools.getCrtTime：" + r.getCrtTime()), console.log("全屏间隔时间：" + e), e > 0) return ! 1
                }
                return ! 0
            }
        } !
        function(e) {
            e[e.Native = -2] = "Native",
            e[e.WX = -1] = "WX",
            e[e.QQ = 0] = "QQ",
            e[e.OPPO = 1] = "OPPO",
            e[e.VIVO = 2] = "VIVO",
            e[e.TT = 3] = "TT",
            e[e.BD = 4] = "BD",
            e[e.QTT = 5] = "QTT",
            e[e.HW = 6] = "HW",
            e[e.XM = 7] = "XM";
        } (C || (C = {}));
        class L {
            static get systemInfo() {
                return L._systemInfo
            }
            static get PlatObj() {
                return L.platObj
            }
            static initPlatMgr() {
                switch (console.log("initPlatMgr=", L.PLATFORM), L.PLATFORM) {
                case C.QQ:
                    L.platObj = Laya.Browser.window.qq;
                    break;
                case C.OPPO:
                case C.VIVO:
                    L.platObj = Laya.Browser.window.qg,
                    I.createVideo();
                    break;
                case C.TT:
                    L.platObj = Laya.Browser.window.tt,
                    I.createVideo();
                    break;
                case C.BD:
                    L.platObj = Laya.Browser.window.swan;
                    break;
                case C.WX:
                    L.platObj = Laya.Browser.window.wx;
                    break;
                case C.HW:
                case C.XM:
                    L.platObj = Laya.Browser.window.qg,
                    I.createVideo();
                    break;
                case C.Native:
                    a.initBUAdSDK(S.APP_ID, S.MediaID),
                    I.showSplashAD();
                }
                I.initAd(),
                L.StartUpTime = r.getCrtTime(),
                L.OnShow(),
                L.OnHide(),
                o.initManager(),
                L.isMiniGame ? (L._systemInfo = L.PlatObj.getSystemInfoSync(), console.log("PlatMgr._systemInfo:", JSON.stringify(L._systemInfo))) : L.isNative,
                L.FullScreenLastTime = r.getCrtTime();
            }
            static get isNative() {
                return a.isNative
            }
            static get isMiniGame() {
                switch (L.PLATFORM) {
                case C.HW:
                    return Laya.Browser.onHWMiniGame;
                case C.QQ:
                    return Laya.Browser.onQQMiniGame;
                case C.OPPO:
                    return Laya.Browser.onQGMiniGame;
                case C.VIVO:
                    return Laya.Browser.onVVMiniGame;
                case C.TT:
                    return Laya.Browser.window.tt;
                case C.BD:
                    return Laya.Browser.window.swan;
                case C.WX:
                    return Laya.Browser.window.wx;
                case C.XM:
                    return Laya.Browser.window.onKGMiniGame
                }
                return Laya.Browser.onMiniGame
            }
            static get ttAppName() {
                if (L.PLATFORM != C.TT) return null;
                if (!L.isMiniGame) return null;
                if (L.PlatObj.getSystemInfoSync) {
                    const e = L.PlatObj.getSystemInfoSync();
                    if (console.log(e.appName), e.appName) return e.appName.toUpperCase()
                }
                return null
            }
            static get isDouYin() {
                return L.PLATFORM == C.TT && "DOUYIN" === this.ttAppName
            }
            static OnShow(t, i) {
                L.isMiniGame && L.PlatObj.onShow(s =>{
                    t && i && i.call(t, {
                        code: 0
                    }),
                    e.Send(e.MINI_ONSHOW, s);
                });
            }
            static OnHide(t, i) {
                L.isMiniGame && L.PlatObj.onHide(s =>{
                    console.log("miniGame OnHide"),
                    t && i && i.call(t, {
                        code: 0
                    }),
                    e.Send(e.MINI_ONHIDE, s);
                });
            }
        }
        L.PLATFORM = C.WX,
        function(e) {
            e[e.CH233 = 0] = "CH233",
            e[e.TAPTAP = 1] = "TAPTAP",
            e[e.VIVO = 2] = "VIVO",
            e[e.OPPO = 3] = "OPPO",
            e[e.HAOYOU = 4] = "HAOYOU",
            e[e.HW = 5] = "HW",
            e[e.XM = 6] = "XM";
        } (_ || (_ = {}));
        class S {
            static Read() {
                switch (L.isNative ? (a.Init(), L.PLATFORM = C.Native) : Laya.Browser.onKGMiniGame ? L.PLATFORM = C.XM: Laya.Browser.onQGMiniGame ? L.PLATFORM = C.OPPO: Laya.Browser.onVVMiniGame ? L.PLATFORM = C.VIVO: Laya.Browser.onHWMiniGame ? L.PLATFORM = C.HW: Laya.Browser.onBDMiniGame ? L.PLATFORM = C.BD: Laya.Browser.window.tt ? L.PLATFORM = C.TT: Laya.Browser.window.qq ? L.PLATFORM = C.QQ: Laya.Browser.onMiniGame && (L.PLATFORM = C.WX), L.PLATFORM) {
                case C.XM:
                case C.HW:
                case C.QQ:
                    break;
                case C.OPPO:
                    S.APP_ID = "",//31158621
                    S.VIDEO_ID = "",//993702
                    S.NATIVE_AD_IDS = [""],//993697
                    S.BANNER_IDS = [""];//993694
                    break;
                case C.VIVO:
                    S.APP_ID = "",//105661463
                    S.BANNER_IDS = [""],//128bb545f2dc4e73a03841e6165c5a04
                    S.VIDEO_ID = "",//1cb2b9d51cf542ad86ca8b1539842a1f
                    S.NATIVE_AD_IDS = [""],//56bbfc2ae607463a84e6e6cb40c5e52c
                    S.MediaID = "";//021bcfc3915c411aa6d9232d8a334c55
                    break;
                case C.TT:
                    S.APP_ID = "tt59062fbbc63e1bb601",
                    S.INSERT_AD_ID = "10iof6968f2967dh16",
                    S.VIDEO_ID = "b6j42g5999c1904m28",
                    S.BANNER_IDS = ["beo62ed58bn5d2tlij"];
                    break;
                case C.WX:
                case C.BD:
                case C.QTT:
                    break;
                case C.Native:
                    a.isNativeIOS || a.isNativeAndroid && (console.log("getSdkChannelID"), a.getSdkChannelID(this, e =>{
                        L.ANDROID_CHANELL = e.id,
                        console.log("PlatMgr.ANDROID_CHANELL ID:" + L.ANDROID_CHANELL),
                        L.ANDROID_CHANELL == _.CH233 || (L.ANDROID_CHANELL == _.TAPTAP ? (S.APP_ID = "5224854", S.VIDEO_ID = "946861886", S.Full_VIDEO_ID = "946861891", S.INSERT_AD_ID = "946862525", S.BANNER_IDS = ["946861754"]) : L.ANDROID_CHANELL == _.HAOYOU ? (S.APP_ID = "5224979", S.VIDEO_ID = "946864286", S.Full_VIDEO_ID = "946864277", S.INSERT_AD_ID = "946864265", S.BANNER_IDS = ["946864436"]) : L.ANDROID_CHANELL == _.VIVO ? (S.APP_ID = "105644695", S.MediaID = "24639fff891448d0b24ceec4f810581f", S.INSERT_AD_ID = "a24d756a6b2c4f72bab71871b7206c26", S.VIDEO_ID = "9ad62a5aff88481e8877dcfbe9641cef", S.BANNER_IDS = ["a04e0e5022c7477da77b2f2d1ce56872"], S.NATIVE_AD_IDS = ["a24d756a6b2c4f72bab71871b7206c26"], S.SPLASH_AD_ID = "a14800c60ee345c5a4b56d0bda03a041") : L.ANDROID_CHANELL == _.OPPO ? (S.APP_ID = "31160835", S.VIDEO_ID = "1000185", S.SPLASH_AD_ID = "1000183", S.BANNER_IDS = ["1000182"], S.NATIVE_AD_IDS = ["1000184"], S.AppSecret = "4fcea8bbb805470bb26e02e02105fba9") : L.ANDROID_CHANELL == _.HW ? (S.APP_ID = "", S.VIDEO_ID = "testx9dtjwj8hp", S.SPLASH_AD_ID = "testq6zq98hecj", S.NATIVE_AD_IDS = ["testu7m3hc4gvm"], S.BANNER_IDS = ["testw6vs28auh3"], S.INSERT_AD_ID = "testb4znbuh3n2") : L.ANDROID_CHANELL == _.XM && (S.APP_ID = "2882303761520066337", S.VIDEO_ID = "e0eca0b635fd5d8dfa2b157b399c9710", S.BANNER_IDS = ["a885e8471d8d9c42506ddb713b0e9908"], S.SPLASH_AD_ID = "a770c51aee9c0ecc0ee456221dc9ee79")),
                        L.initPlatMgr();
                    }));
                }
                a.isNative || L.initPlatMgr();
            }
        }
        S.FullAd_Interval = 0,
        S.BATH_PATH = "",
        S.APP_ID = "",
        S.MediaID = "",
        S.AppSecret = "",
        S.AD_APPID = "",
        S.minPlatformVersion = 1044;
        class O {
            constructor() {
                this.priority = 1;
            }
            static get Instance() {
                return O._instance || (O._instance = new O, Laya.loader.retryNum = 5),
                O._instance
            }
            static get Preloader() {
                return O._preload || (O._preload = new O, O._preload.priority = 4),
                O._preload
            }
            Load(e, t, i, s) {
                var a = [];
                a.push({
                    url: e + "." + fairygui.UIConfig.packageFileExtension,
                    type: Laya.Loader.BUFFER
                }),
                Laya.loader.load(a, Laya.Handler.create(this, this.OnLoadPackageComplete, [e, t, i, s]));
            }
            OnLoadPackageComplete(e, t, i, s) {
                var a = e.split("/"),
                n = fairygui.UIPackage.getByName(a[a.length - 1]);
                if (!n) {
                    var o = Laya.loader.getRes(e + "." + fairygui.UIConfig.packageFileExtension);
                    if (!o) return void this.OnComplete(e, t, i, s, l);
                    n = fairygui.UIPackage.addPackage(e, o);
                }
                var r = {},
                l = [];
                for (var h in n._sprites) if (n._sprites.hasOwnProperty(h)) {
                    var c = n._sprites[h];
                    r[c.atlas.file] || (r[c.atlas.file] = c.atlas.file, l.push({
                        url: c.atlas.file,
                        type: Laya.Loader.IMAGE
                    }));
                }
                t && t.length > 0 && (l = l.concat(t));
                for (var d = 0; d < l.length; d++) l[d].priority = this.priority;
                l.length > 0 ? Laya.loader.load(l, Laya.Handler.create(this, this.OnLoadComplete, [e, t, i, s, l]), s) : this.OnLoadComplete(e, t, i, s, l);
            }
            OnLoadComplete(e, t, i, s, a) {
                this.OnComplete(e, t, i, s, a);
            }
            OnComplete(e, t, i, s, a) {
                if (s) {
                    var n = s;
                    s = null,
                    n.recover();
                }
                if (i) {
                    n = i;
                    i = null,
                    n.runWith([e, a]),
                    n.recover();
                }
            }
        }
        class D {
            constructor() {
                this.openList = [],
                this.fullSceneList = [],
                this.noDisposeList = [],
                this.nextLoadWin = [],
                this.backTime = 0;
            }
            static get Instance() {
                return D._instance || (D._instance = new D),
                D._instance
            }
            openWindow(e, t = null, i = !1) {
                var s = this.getWindow(e);
                if (s) return s.uiOpenData = t,
                s.isWindow && s.setTop(),
                s;
                for (var a = 0,
                n = this.noDisposeList.length; a < n; a++) if ((s = this.noDisposeList[a]) instanceof e) return this.noDisposeList.splice(a, 1),
                s.uiOpenData = t,
                s.isFullScene && this.currentFullScene && this.currentFullScene.view ? this.currentFullScene.tweenRemove(Laya.Handler.create(this, this.addWin, [s, i])) : this.addWin(s, i),
                s;
                return null != this.loadwin && this.loadwin instanceof e ? this.loadwin: ((s = new e).UIClass = e, s.uiOpenData = t, s.isFullScene && this.currentFullScene && this.currentFullScene && this.currentFullScene.view ? this.currentFullScene.tweenRemove(Laya.Handler.create(this, this.showwin, [s, i])) : this.showwin(s, i), s)
            }
            showwin(e, t) {
                e.packageURL || e.loaddata && e.loaddata.length > 0 ? this.loadWinRes(e, t) : this.addWin(e, t);
            }
            getWindow(e) {
                for (var t = 0,
                i = this.openList.length; t < i; t++) {
                    var s = this.openList[t];
                    if (s instanceof e) return s
                }
            }
            hasWindow(e) {
                var t = this.getWindow(e);
                return t || this.getNotDisposeWindow(e)
            }
            setFullScreen() {
                for (var e = 0,
                t = this.openList.length; e < t; e++) {
                    var i = this.openList[e]; (i.isFullScene || i.isFullWindow) && i.view.setSize(i.parentDisplay.width, i.parentDisplay.height);
                }
            }
            addWin(e, t) { - 1 == this.openList.indexOf(e) && this.openList.push(e),
                e.isFullScene && (this.currentFullScene && this.currentFullScene != e && (t || -1 == this.fullSceneList.indexOf(this.currentFullScene.UIClass) && this.fullSceneList.push(this.currentFullScene.UIClass), this.closeWindow(this.currentFullScene, !1)), this.currentFullScene = e),
                e.initialized ? null == e.view.parent ? e.addParent() : e.tweenShow() : e.createUI();
            }
            backWindow() {
                var e = this.fullSceneList.pop();
                return !! e && (this.openWindow(e, null, !0), !0)
            }
            closeWindow(e, t = !0) {
                var i = this.openList.indexOf(e); - 1 != i && this.openList.splice(i, 1),
                e.closeDispose || -1 == (i = this.noDisposeList.indexOf(e)) && this.noDisposeList.push(e),
                e.removeParent(t),
                this.checkGameClubVisable(e);
            }
            checkGameClubVisable(e) {
                this.currentFullScene;
            }
            getNotDisposeWindow(e) {
                for (var t = 0,
                i = this.noDisposeList.length; t < i; t++) {
                    var s = this.noDisposeList[t];
                    if (s instanceof e) return s
                }
                return null
            }
            removeNotDisposeWindow(e) {
                for (var t = 0,
                i = this.noDisposeList.length; t < i; t++) {
                    var s = this.noDisposeList[t];
                    if (s instanceof e) return this.noDisposeList.splice(t, 1),
                    s.closeDispose = !0,
                    s.removeFromParent(),
                    s
                }
            }
            closeAllWindow() {
                try {
                    for (var e = 0,
                    t = this.openList.length; e < t; e++) {
                        var i = this.openList[e];
                        i.closeDispose = !0,
                        i.removeFromParent();
                    }
                    for (e = 0, t = this.noDisposeList.length; e < t; e++)(i = this.noDisposeList[e]).closeDispose = !0,
                    i.removeFromParent();
                } catch(e) {}
                this.currentFullScene = null,
                this.openList = [],
                this.noDisposeList = [],
                this.fullSceneList = [],
                this.loadwin = null,
                this.nextLoadWin = [];
            }
            closeALLPopWindow(e) {
                for (var t = this.openList.length - 1; t > -1; t--) {
                    var i = this.openList[t]; ! i.isWindow || e && -1 != this.Instanceof(i, e) || this.closeWindow(i, !1);
                }
            }
            hasPopWindow(e = null) {
                for (var t = this.openList.length - 1; t > -1; t--) {
                    var i = this.openList[t];
                    if (i.isWindow && (!e || -1 == this.Instanceof(i, e))) return ! 0
                }
                return ! 1
            }
            Instanceof(e, t) {
                for (var i = 0; i < t.length; i++) if (e instanceof t[i]) return i;
                return - 1
            }
            loadWinRes(e, t) {
                this.loadwin ? this.nextLoadWin.push([e, t]) : (this.loadwin = e, this.loadwinisback = t, e.packageURL ? (Laya.loader.on(Laya.Event.ERROR, this, this.OnError), O.Instance.Load(e.packageURL, e.loaddata, Laya.Handler.create(this, this.onResourceLoadComplete), Laya.Handler.create(this, this.OnLoading, null, !1))) : e.loaddata ? (Laya.loader.load(e.loaddata.concat(), Laya.Handler.create(this, this.onResourceLoadComplete), Laya.Handler.create(this, this.OnLoading, null, !1)), Laya.loader.on(Laya.Event.ERROR, this, this.OnError)) : this.onResourceLoadComplete(null, null));
            }
            onResourceLoadComplete(e, t) {
                if (Laya.loader.off(Laya.Event.ERROR, this, this.OnError), this.loadwin && (this.addWin(this.loadwin, this.loadwinisback), this.loadwin = null), this.nextLoadWin.length > 0) {
                    var i = this.nextLoadWin.shift();
                    this.loadWinRes(i[0], i[1]);
                }
            }
            OnLoading(e) {
                console.log("加载进度: " + e);
            }
            OnError(e) {
                if (console.log("加载失败: " + e), this.loadwin) {
                    var t = this.loadwin != this.currentFullScene,
                    i = this.currentFullScene && this.loadwin.isFullScene;
                    t && (this.loadwin.dispose(), this.loadwin = null),
                    i && this.addWin(this.currentFullScene, !0);
                }
            }
            setAndroidBack() {
                Laya.Render.isConchApp && Laya.Browser.window.conch && Laya.Browser.window.conch.setOnBackPressedFunction && Laya.Browser.window.conch.setOnBackPressedFunction(() =>{
                    if (D.Instance.fullSceneList.length > 0) D.Instance.backWindow();
                    else {
                        var e = Laya.Browser.now();
                        e - D.Instance.backTime < 2e3 && Laya.Browser.window.conch.exit(),
                        D.Instance.backTime = e;
                    }
                });
            }
        }
        var R, b, M, N = Laya.Scene,
        P = Laya.ClassUtils.regClass; !
        function(e) { !
            function(e) {
                class t extends N {
                    constructor() {
                        super();
                    }
                    createChildren() {
                        super.createChildren(),
                        this.loadScene("test/TestScene");
                    }
                }
                e.TestSceneUI = t,
                P("ui.test.TestSceneUI", t);
            } (e.test || (e.test = {}));
        } (R || (R = {}));
        class E extends R.test.TestSceneUI {
            constructor() {
                super(),
                E.instance = this;
            }
            onEnable() {}
        }
        class k {
            constructor() {}
            static init() { (0, Laya.ClassUtils.regClass)("script/GameUI.ts", E);
            }
        }
        k.width = 640,
        k.height = 1136,
        k.scaleMode = "fixedwidth",
        k.screenMode = "none",
        k.alignV = "top",
        k.alignH = "left",
        k.startScene = "test/TestScene.scene",
        k.sceneRoot = "",
        k.debug = !1,
        k.stat = !1,
        k.physicsDebug = !1,
        k.exportSceneToJson = !0,
        k.init();
        class T {
            static subPage(e) {
                if (console.log("oppo 分包开始加载"), L.isMiniGame && L.PLATFORM == C.OPPO) {
                    qg.loadSubpackage({
                        name: "res",
                        success: function(t) {
                            console.log("成功", t),
                            e.run();
                        },
                        fail: function(e) {
                            console.log("失败", e);
                        },
                        complete: function() {}
                    }).onProgressUpdate(e =>{
                        console.log("下载进度", e.progress),
                        console.log("已经下载的数据长度", e.totalBytesWritten),
                        console.log("预期需要下载的数据总长度", e.totalBytesExpectedToWrite);
                    });
                }
            }
        }
        class V {
            static subPage(e) {
                if (L.isMiniGame && L.PLATFORM == C.VIVO) {
                    console.log(S.BANNER_IDS),
                    qg.loadSubpackage({
                        name: "res",
                        success: function(t) {
                            console.log("成功", t),
                            e.run();
                        },
                        fail: function(e) {
                            console.log("失败", e);
                        },
                        complete: function() {}
                    }).onProgressUpdate(e =>{
                        console.log("下载进度", e.progress),
                        console.log("已经下载的数据长度", e.totalBytesWritten),
                        console.log("预期需要下载的数据总长度", e.totalBytesExpectedToWrite);
                    });
                }
            }
        }
        class F extends fgui.GComponent {
            static createInstance() {
                return fgui.UIPackage.createObject("Loading", "yinsi")
            }
            onConstruct() {
                this.m_yscomp = this.getChildAt(2),
                this.m_Btnok = this.getChildAt(3),
                this.m_Btnno = this.getChildAt(4);
            }
        }
        F.URL = "ui://69318iqyby9mj";
        class x extends fgui.GComponent {
            static createInstance() {
                return fgui.UIPackage.createObject("Loading", "Loading")
            }
            onConstruct() {
                this.m_YSshow = this.getControllerAt(0),
                this.m_moreflag = this.getControllerAt(1),
                this.m_type = this.getControllerAt(2),
                this.m_channel = this.getControllerAt(3),
                this.m_startgame = this.getChildAt(1),
                this.m_ysbtn = this.getChildAt(4),
                this.m_more = this.getChildAt(5),
                this.m_kp = this.getChildAt(6),
                this.m_bar = this.getChildAt(7),
                this.m_ys = this.getChildAt(8);
            }
        }
        x.URL = "ui://69318iqykhm70";
        class B extends fgui.GComponent {
            static createInstance() {
                return fgui.UIPackage.createObject("Loading", "ysComp")
            }
            onConstruct() {
                this.m_channel = this.getControllerAt(0);
            }
        }
        B.URL = "ui://69318iqyn7w1p";
        class U extends fgui.GButton {
            static createInstance() {
                return fgui.UIPackage.createObject("Loading", "okBtn")
            }
            onConstruct() {
                this.m_Btnok = this.getChildAt(0);
            }
        }
        U.URL = "ui://69318iqyn7w1q";
        class G extends fgui.GButton {
            static createInstance() {
                return fgui.UIPackage.createObject("Loading", "noBtn")
            }
            onConstruct() {
                this.m_Btnno = this.getChildAt(0);
            }
        }
        G.URL = "ui://69318iqyn7w1r";
        class W extends fgui.GComponent {
            static createInstance() {
                return fgui.UIPackage.createObject("Loading", "kaiping")
            }
            onConstruct() {
                this.m_channel = this.getControllerAt(0);
            }
        }
        W.URL = "ui://69318iqynasge";
        class H {
            static bindAll() {
                fgui.UIObjectFactory.setExtension(F.URL, F),
                fgui.UIObjectFactory.setExtension(x.URL, x),
                fgui.UIObjectFactory.setExtension(B.URL, B),
                fgui.UIObjectFactory.setExtension(U.URL, U),
                fgui.UIObjectFactory.setExtension(G.URL, G),
                fgui.UIObjectFactory.setExtension(W.URL, W);
            }
        }
        class j {
            static load(e, t) {
                this.loadpackage = e,
                this.loadcomp = t,
                null == this.view ? O.Instance.Load("res/fgui/Loading", null, Laya.Handler.create(this, this.loadingcomp)) : this.show(),
                O.Instance.Load("res/fgui/NativeAd", null),
                Laya.timer.once(3e3, this, this.showAdviceEnd);
            }
            static showAdviceEnd() {
                j.showAdvice = !1,
                this.LoadRes(1);
            }
            static show() {
                this.view && null == this.view.parent && (fairygui.GRoot.inst.addChild(this.view), 
                this.view.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height), 
                this.view.addRelation(this.view.parent, fairygui.RelationType.Size), 
                // this.view.m_ys.m_Btnok.onClick(this, () =>{
                    v.setSecret(),
                    // this.ResInitComplete()
                // }), this.view.m_ys.m_Btnno.onClick(this, () =>{
                //     L.PLATFORM != C.HW ? (this.ResInitComplete(), v.setSecret()) : L.PlatObj && L.PlatObj.exitApplication({
                //         success: function() {
                //             console.log("exitApplication success")
                //         },
                //         fail: function() {
                //             console.log("exitApplication fail")
                //         },
                //         complete: function() {
                //             console.log("exitApplication complete")
                //         }
                //     })
                // }), 
                this.view._children[2].text = "",
                console.log(this.view._children[2].visible),
                // this.view._children[2].visible = false,
                this.view.m_more.onClick(this, () =>{
                    a.jumpgamecenter();
                }), this.view.m_startgame.onClick(this, () =>{
                    if (console.log("开始"), Laya.timer.clear(this, this.showAdviceEnd), this.iscomp = !0, this.loadcomp) {
                        var e = this.loadcomp;
                        this.loadcomp = null,
                        e.run();
                    }
                    this.autoClose && this.close(),
                    Laya.timer.clear(this, this.ProgressLoop);
                }), 
                this.view.m_ysbtn.visible = false
                // this.view.m_ysbtn.onClick(this, () =>{
                //     this.view.m_YSshow.selectedIndex = 1
                // }), 
                // L.isMiniGame ? L.PLATFORM == C.VIVO ? (this.view.m_kp.m_channel.selectedIndex = 0, this.view.m_ys.m_yscomp.m_channel.selectedIndex = 0) 
                // : L.PLATFORM == C.OPPO ? (this.view.m_kp.m_channel.selectedIndex = 2, this.view.m_ys.m_yscomp.m_channel.selectedIndex = 2, this.view.m_channel.selectedIndex = 1) 
                // : L.PLATFORM == C.HW && (this.view.m_kp.m_channel.selectedIndex = 4, this.view.m_ys.m_yscomp.m_channel.selectedIndex = 4) 
                // : L.isNative && (L.ANDROID_CHANELL == _.VIVO ? (this.view.m_kp.m_channel.selectedIndex = 1, this.view.m_ys.m_yscomp.m_channel.selectedIndex = 1) 
                // : L.ANDROID_CHANELL == _.OPPO ? (this.view.m_moreflag.selectedIndex = 1, this.view.m_kp.m_channel.selectedIndex = 3, this.view.m_ys.m_yscomp.m_channel.selectedIndex = 3, this.view.m_channel.selectedIndex = 1) 
                // : L.ANDROID_CHANELL == _.HW && (this.view.m_kp.m_channel.selectedIndex = 5, this.view.m_ys.m_yscomp.m_channel.selectedIndex = 5))
                ),
                // L.isMiniGame ? (console.log("UI isMiniGame"), T.subPage(Laya.Handler.create(this, this.startLoad)), V.subPage(Laya.Handler.create(this, this.startLoad))) : this.startLoad()
                this.startLoad();
            }
            static loadingcomp() {
                H.bindAll(),
                this.view = x.createInstance(),
                this.show(),
                Laya.timer.loop(50, this, this.ProgressLoop);
            }
            static startLoad() {
                this.loadpackage ? O.Instance.Load(this.loadpackage, null, Laya.Handler.create(this, this.load3dRes)) : this.load3dRes();
            }
            static load3dRes() {
                Laya.loader.create(l.resource, Laya.Handler.create(this, this.load3dComplete));
            }
            static load3dComplete() {
                this.loadEnd = !0,
                this.LoadRes(1);
            }
            static LoadRes(e) {
                if (1 == e && !j.showAdvice && this.loadEnd) {
                    this.progress = 100;
                    let e = 0 != v.gameData.secret;
                    L.isNative && L.ANDROID_CHANELL == _.VIVO && (e = !0),
                    e ? this.ResInitComplete() : this.view.m_YSshow.selectedIndex = 1;
                }
            }
            static ResInitComplete() {
                // this.view.m_ys.m_Btnno.visible = !1,
                this.view.m_YSshow.selectedIndex = 0,
                this.view.m_type.selectedIndex = 1;
            }
            static close() {
                if (this.autoClose = !0, this.iscomp) {
                    if (this.view.parent) var e = this.view.getTransition("hide");
                    e ? e.play(Laya.Handler.create(this.view, this.view.removeFromParent)) : this.view.removeFromParent();
                }
            }
            static ResLoadProgress(e) {}
            static ProgressLoop() {
                this.progress < 100 && (this.progress += 4),
                this.view.m_bar.value = this.progress;
            }
        }
        j.showAdvice = !0,
        j.loadEnd = !1,
        j.autoClose = !0,
        j.progress = 0,
        function(e) {
            e[e.Window = 0] = "Window",
            e[e.FullWindow = 1] = "FullWindow",
            e[e.FullScene = 2] = "FullScene";
        } (b || (b = {}));
        class z {
            constructor() {
                this.initialized = !1,
                this.windowType = b.Window,
                this.isCenter = !0,
                this.uiOpenData = null,
                this._clickModelClose = !0,
                this.showEffect = !0;
            }
            set clickModelClose(e) {
                this._clickModelClose = e,
                this.modelObj && (e ? this.modelObj.onClick(this, this.clickModel) : this.modelObj.offClick(this, this.clickModel));
            }
            get clickModelClose() {
                return this._clickModelClose
            }
            set isFullScene(e) {
                this.windowType = b.FullScene;
            }
            get isFullScene() {
                return this.windowType == b.FullScene
            }
            set isFullWindow(e) {
                this.windowType = e ? b.FullWindow: b.Window;
            }
            get isFullWindow() {
                return this.windowType == b.FullWindow
            }
            set isWindow(e) {
                this.windowType = b.Window;
            }
            get isWindow() {
                return this.windowType == b.Window
            }
            createUI() {
                this.view = fairygui.UIPackage.createObject(this.packageName, this.resName).asCom,
                this.isModel && this.parentDisplay && (this.modelObj = new fairygui.GGraph, this.modelObj.setSize(this.parentDisplay.width + 2, this.parentDisplay.height + 2), this.modelObj.drawRect(0, null, fairygui.UIConfig.modalLayerColor)),
                this.onConstruct(),
                this.initialized = !0,
                this.addParent();
            }
            setSize() {
                this.view && (this.view.setSize(this.parentDisplay.width, this.parentDisplay.height), this.isCenter && this.view.center());
            }
            onConstruct() {}
            getTransition(e, t = null) {
                return t || (t = this.view),
                t.getTransition(e)
            }
            getChild(e, t = null) {
                return t || (t = this.view),
                t.getChild(e)
            }
            getButton(e, t = null) {
                var i = this.getChild(e, t);
                return null != i && i.onClick(this, this.onClickButton, [i]),
                null == i ? null: i.asButton
            }
            addButton(e) {
                return null != e && e.onClick(this, this.onClickButton, [e]),
                null == e ? null: e.asButton
            }
            setCloseButton(e) {
                null != e && e.asButton.onClick(this, this.close);
            }
            onClickButton(e) {}
            getController(e, t = null) {
                return t || (t = this.view),
                t.getController(e)
            }
            addParent() {
                var e = null == this.view.parent;
                e && (this.modelObj && null == this.modelObj.parent && (this.parentDisplay.addChild(this.modelObj), this.modelObj.addRelation(this.parentDisplay, fairygui.RelationType.Size)), this.isFullScene ? this.parentDisplay.addChildAt(this.view, 0) : this.parentDisplay.addChild(this.view)),
                this.isFullScene || this.isFullWindow ? (this.setSize(), Laya.stage.on(Laya.Event.RESIZE, this, this.setSize)) : this.isCenter && this.view.center(),
                e && this.initialized && this.onShow(),
                this.tweenShow();
            }
            setTop() {
                this.view && this.view.parent && this.view.displayObject && 0 == this.view.displayObject.zOrder && (this.view.parent.setChildIndex(this.view, this.view.parent.numChildren - 1), this.modelObj && this.modelObj.parent && this.modelObj.parent.setChildIndex(this.modelObj, this.modelObj.parent.numChildren - 2));
            }
            onShow() {
                Laya.timer.frameLoop(1, this, this.update);
            }
            onHide() {
                Laya.timer.clear(this, this.update);
            }
            update() {}
            tweenShow() {
                this.view.touchable = !1;
                var e = this.view.getTransition("show");
                if (e) e.play(Laya.Handler.create(this, this.tweenShowComp));
                else if (this.isFullScene) this.tweenShowComp();
                else {
                    this.packageName,
                    this.resName;
                    this.showEffect ? (this.view.setPivot(.5, .5, !1), this.view.scaleX = this.view.scaleY = .8, Laya.Tween.clearTween(this.view), Laya.Tween.to(this.view, {
                        scaleX: 1,
                        scaleY: 1
                    },
                    200, Laya.Ease.backOut, Laya.Handler.create(this, this.tweenShowComp))) : this.tweenShowComp();
                }
            }
            tweenShowComp() {
                this.view.touchable = !0,
                this.view.alpha = 1,
                this.clickModelClose && this.modelObj && this.modelObj.onClick(this, this.clickModel);
            }
            clickModel() {
                this.close();
            }
            removeParent(e = !0) {
                Laya.stage.off(Laya.Event.RESIZE, this, this.setSize),
                e ? this.tweenRemove(null) : this.tweenRemoveComp();
            }
            tweenRemove(e) {
                if (this.showEffect && this.view && this.view.displayObject) {
                    this.view.touchable = !1,
                    null == e && (e = Laya.Handler.create(this, this.tweenRemoveComp));
                    var t = this.view.getTransition("hide");
                    t ? t.play(e) : this.isFullScene ? e ? e.run() : this.tweenRemoveComp() : (this.view.alpha = 1, Laya.Tween.clearTween(this.view), Laya.Tween.to(this.view, {
                        alpha: 0
                    },
                    100, null, e));
                } else e ? e.run() : this.tweenRemoveComp();
            }
            tweenRemoveComp() {
                this.view && (this.view.alpha = 1, this.view.touchable = !0),
                this.onHide(),
                this.removeFromParent();
            }
            removeFromParent() {
                this.view && this.view.removeFromParent(),
                this.modelObj && this.modelObj.removeFromParent(),
                this.closeDispose && this.dispose();
            }
            setNotRemovePackage() {
                this.packageURL = null;
            }
            dispose() {
                if (Laya.stage.off(Laya.Event.RESIZE, this, this.setSize), this.closeDisposeRes) {
                    if (this.loaddata) for (var e = 0; e < this.loaddata.length; e++) Laya.loader.clearTextureRes(this.loaddata[e].url),
                    Laya.loader.clearRes(this.loaddata[e].url);
                    if (this.packageURL) {
                        var t = fairygui.UIPackage.getByName(this.packageName);
                        t && (t.unloadAssets(), fairygui.UIPackage.removePackage(this.packageName));
                    }
                }
                this.UIClass = null,
                this.view && (Laya.Tween.clearTween(this.view), this.view.dispose(), this.view = null),
                this.modelObj && (Laya.Tween.clearTween(this.modelObj), this.modelObj.dispose(), this.modelObj = null);
            }
            get parentDisplay() {
                return z.panelLayer ? z.panelLayer: fairygui.GRoot.inst
            }
            close() {
                D.Instance.closeWindow(this);
            }
            back() {
                D.Instance.backWindow();
            }
        }
        z.initList = [];
        class Y {
            static FormatCoin(e) {
                let t = "";
                return e > 1e15 ? (e /= 1e15, t = (e = Y.FomatFloat(e, 2)) + "aa") : e > 1e12 ? (e /= 1e12, t = (e = Y.FomatFloat(e, 2)) + "t") : e > 1e9 ? (e /= 1e9, t = (e = Y.FomatFloat(e, 2)) + "b") : e > 1e6 ? (e /= 1e6, t = (e = Y.FomatFloat(e, 2)) + "m") : e > 1e3 ? (e /= 1e3, t = (e = Y.FomatFloat(e, 2)) + "k") : t = "" + e,
                t
            }
            static FomatFloat(e, t) {
                return Math.round(e * Math.pow(10, t)) / Math.pow(10, t)
            }
            static GetCross(e, t, i) {
                return (t.x - e.x) * (i.y - e.y) - (i.x - e.x) * (t.y - e.y)
            }
            static IsPointInMatrix(e, t, i, s, a) {
                return Y.GetCross(e, t, a) * Y.GetCross(i, s, a) >= 0 && Y.GetCross(t, i, a) * Y.GetCross(s, e, a) >= 0
            }
            static PointInPoly(e, t) {
                for (var i = !1,
                s = -1,
                a = t.length,
                n = a - 1; ++s < a; n = s)(t[s].y <= e.y && e.y < t[n].y || t[n].y <= e.y && e.y < t[s].y) && e.x < (t[n].x - t[s].x) * (e.y - t[s].y) / (t[n].y - t[s].y) + t[s].x && (i = !i);
                return i
            }
            static GetAngle(e, t, i, s) {
                return Math.atan2(i - s, e - t)
            }
            static GetDistance(e, t, i, s) {
                var a = t - e,
                n = s - i;
                return Math.pow(a * a + n * n, .5)
            }
            static GetDistanceP(e, t) {
                let i = e.x - t.x,
                s = e.y - t.y,
                a = e.z - t.z;
                return Math.pow(i * i + s * s + a * a, .5)
            }
            static GetDistanceV2(e, t) {
                return this.GetDistance(e.x, t.x, e.z, t.z)
            }
            static GetDistanceSquare(e, t, i, s) {
                var a = t - e,
                n = s - i;
                return a * a + n * n
            }
            static get isWXMiniGame() {
                return Laya.Browser.onMiniGame
            }
            static get Now() {
                return Laya.Browser.now()
            }
            static get isIOS() {
                return Laya.Browser.onIOS
            }
            static get isAndroid() {
                return Laya.Browser.onAndroid
            }
            static InjectProp(e, t = null, i = null, s = !0) {
                if (!t) return ! 1;
                for (let a in t) {
                    let n = t[a];
                    "function" == typeof n || s && null == n || (i ? i(e, a, n) : e[a] = n);
                }
                return ! 0
            }
            static MakeRandomInt(e, t = 0) {
                return Math.floor(Math.random() * (e - t)) + t
            }
            static MixArray(e) {
                for (var t = 0,
                i = Math.round(e.length / 2); t < i; t++) {
                    var s = this.MakeRandomInt(e.length),
                    a = this.MakeRandomInt(e.length),
                    n = e[s];
                    e[s] = e[a],
                    e[a] = n;
                }
                return e
            }
            static getFilter(e, t, i) {
                var s = 256 * e * 256 + 256 * t + i;
                if (Y._filters[s]) return Y._filters[s];
                var a = [e / 255, 0, 0, 0, 0, 0, t / 255, 0, 0, 0, 0, 0, i / 255, 0, 0, 0, 0, 0, 1, 0],
                n = new Laya.ColorFilter(a);
                return Y._filters[s] = n,
                n
            }
            static isToday(e, t = 0) {
                t = t || Y.Now;
                var i = new Date(e),
                s = new Date(t);
                return i.getFullYear() == s.getFullYear() && i.getMonth() == s.getMonth() && i.getDate() == s.getDate()
            }
            static FormatAngle(e, t = !1) {
                if (t) {
                    for (; e <= -Math.PI;) e += 2 * Math.PI;
                    for (; e > Math.PI;) e -= 2 * Math.PI;
                } else {
                    for (; e <= -180;) e += 360;
                    for (; e > 180;) e -= 360;
                }
                return e
            }
            static getMfh5Msg(e, t, i, s) {
                var a = new Laya.HttpRequest;
                a.on(Laya.Event.COMPLETE, this, this.OnGetShareGroupComplete, [a, i, s]),
                a.on(Laya.Event.ERROR, this, this.OnGetShareGroupError, [a, i, s]);
                var n = {
                    appId: t
                },
                o = JSON.stringify(n);
                a.send(e, o, "post", "text", ["Content-Type", "application/x-www-form-urlencoded"]);
            }
            static OnGetShareGroupComplete(e, t, i) {
                e.offAll(Laya.Event.COMPLETE),
                e.offAll(Laya.Event.ERROR),
                t && i && i.apply(t, [{
                    code: 0,
                    data: e.data
                }]);
            }
            static OnGetShareGroupError(e, t, i) {
                e.offAll(Laya.Event.COMPLETE),
                e.offAll(Laya.Event.ERROR),
                t && i && i.apply(t, [{
                    code: 1
                }]);
            }
        }
        Y._filters = {};
        class X {}
        class J {
            constructor() {
                this.infos = [];
            }
            static get inst() {
                return null != J._inst && null != J._inst || (J._inst = new J, J._inst.initData()),
                J._inst
            }
            initData() {
                this.infos = [{
                    name: "Huracan",
                    price: 0,
                    maxSpeed: 130,
                    stepSpeed: 18,
                    accSpeed: 1,
                    damping: 30,
                    braking: 1.2,
                    maxRate: 470,
                    weight: 1615
                },
                {
                    name: "Huracan",
                    price: 0,
                    maxSpeed: 140,
                    stepSpeed: 19,
                    accSpeed: 1.2,
                    damping: 35,
                    braking: 1.2,
                    maxRate: 470,
                    weight: 1615
                },
                {
                    name: "Huracan",
                    price: 0,
                    maxSpeed: 145,
                    stepSpeed: 20,
                    accSpeed: 1.2,
                    damping: 35,
                    braking: 1.2,
                    maxRate: 470,
                    weight: 1615
                },
                {
                    name: "Huracan",
                    price: 0,
                    maxSpeed: 150,
                    stepSpeed: 20,
                    accSpeed: 1.4,
                    damping: 40,
                    braking: 1.2,
                    maxRate: 470,
                    weight: 1615
                },
                {
                    name: "Huracan",
                    price: 0,
                    maxSpeed: 160,
                    stepSpeed: 22,
                    accSpeed: 1.6,
                    damping: 45,
                    braking: 1.2,
                    maxRate: 470,
                    weight: 1615
                },
                {
                    name: "Huracan",
                    price: 0,
                    maxSpeed: 180,
                    stepSpeed: 25,
                    accSpeed: 1.8,
                    damping: 30,
                    braking: 1.2,
                    maxRate: 470,
                    weight: 1615
                }];
            }
            getCarInfo(e) {
                return this.infos[e]
            }
        } !
        function(e) {
            e.carFire = "carFire",
            e.carIdle = "carIdle",
            e.carBreak = "carBreak",
            e.carRuning = "carRuning";
        } (M || (M = {}));
        class q extends Laya.Script3D {
            constructor() {
                super(),
                this.carfwd = new Laya.Vector3(0, 0, 0),
                this.lizi = [],
                this.wheelsfront = [],
                this.wheelsother = [],
                this.WheelsRig = [],
                this.speednow = 0,
                this.rotate = 0,
                this.roatescale = 1,
                this.acceleration = 0,
                this.nitrogen = !1,
                this.speedmax = 200,
                this.speedbreak = -30,
                this.braking = 0,
                this.isbreak = !1,
                this.isforwad = !0,
                this.speedacc = .1,
                this.active = !1,
                this.vdir = !1,
                this.vflag = !1,
                this.hitnow = !1,
                this.Pname = "",
                this.cameraOldZ = 0,
                this.asped = 0,
                this.gear = 1,
                this.mode = 1,
                this.hitsound = !0,
                this.hang = 0;
            }
            onEnable() {
                super.onEnable(),
                console.log("汽车脚本启用"),
                this.car = this.owner,
                this.Pname = this.car.parent.name,
                this.carBody = this.car.getChildAt(0),
                this.body = this.carBody.getChildByName("body"),
                this.people = this.body.getChildByName("people"),
                this.heros = this.people.getChildByName("heros"),
                this.animator = this.carBody.getComponent(Laya.Animator),
                this.carRig = this.car.getComponent(Laya.Rigidbody3D),
                this.penqi = this.body.getChildByName("penqi");
                for (let e = 0; e < this.penqi.numChildren; e++) this.lizi.push(this.penqi.getChildAt(e));
                this.lightB = this.body.getChildByName("lightB"),
                this.lightF = this.body.getChildByName("lightF"),
                this.view1 = this.carBody.getChildByName("view1"),
                this.view1camera = this.view1.getChildAt(0),
                this.cameraOldZ = this.view1camera.transform.localPositionZ,
                this.view2 = this.carBody.getChildByName("view2"),
                this.fire = this.carBody.getChildByName("fire"),
                this.yan = this.carBody.getChildByName("yan"),
                this.WheelsRig = [];
                for (let e = 0; e < this.car.getChildByName("wheelsRig").numChildren; e++) {
                    let t = this.car.getChildByName("wheelsRig").getChildAt(e).getComponent(Laya.Rigidbody3D);
                    this.WheelsRig.push(t);
                }
                this.wheelsfront = [];
                for (let e = 0; e < this.carBody.getChildByName("wheelsfront").numChildren; e++) this.wheelsfront.push(this.carBody.getChildByName("wheelsfront").getChildAt(e));
                this.wheelsother = [];
                for (let e = 0; e < this.carBody.getChildByName("wheelsother").numChildren; e++) this.wheelsother.push(this.carBody.getChildByName("wheelsother").getChildAt(e));
            }
            onStart() {
                super.onStart(),
                console.log("汽车脚本开始执行一次"),
                e.On(l.MVC_GAME_END, this, this.destroy);
            }
            onUpdate() {
                if (0 == this.speednow && 2 == this.mode && (this.carRig.angularVelocity = new Laya.Vector3(0, 0, 0)), this.active) {
                    let e = 0 == this.speednow ? 0 : this.speednow / Math.abs(this.speednow);
                    if (0 != this.acceleration) this.asped = 0,
                    this.speednow <= 0 && this.acceleration > 0 && (this.asped = 1),
                    this.acceleration < 0 && this.speednow > 0 && (this.asped = -1),
                    this.speednow += this.acceleration + this.asped;
                    else if (0 != this.speednow && !this.isbreak) {
                        let t = .5;
                        this.speednow -= t * e,
                        Math.abs(this.speednow) <= .5 && (this.speednow = 0);
                    }
                    this.isbreak && (this.speednow -= 5 * e, Math.abs(this.speednow) <= 5 && (this.speednow = 0, this.handleDown(!0))),
                    this.speednow <= this.speedbreak ? this.speednow = this.speedbreak: this.speednow >= this.speedmax && (this.speednow = this.speedmax),
                    this.carBody.transform.getRight(this.carfwd),
                    Laya.Vector3.normalize(this.carfwd, this.carfwd),
                    this.carfwd.x *= -this.speednow,
                    this.carfwd.y *= 0,
                    this.carfwd.z *= -this.speednow;
                    for (let e = 0; e < this.WheelsRig.length; e++) this.WheelsRig[e].angularVelocity = this.carfwd;
                    let t = this.rotate / Math.abs(this.rotate),
                    i = this.view1.transform.localRotationEulerY;
                    if (0 != this.rotate) 0 != this.speednow && (this.carRig.angularVelocity = new Laya.Vector3(0, this.speednow >= 0 ? this.rotate * this.roatescale: -this.rotate * this.roatescale, 0), this.speednow < 0 && (t *= -1), (i += .3 * t) >= 30 ? i = 30 : i <= -30 && (i = -30), this.view1.transform.localRotationEulerY = i);
                    else if (1 != this.mode && (this.carRig.angularVelocity = new Laya.Vector3(0, 0, 0)), 0 != i) {
                        i -= .5 * (i / Math.abs(i)),
                        Math.abs(i) <= .5 && (i = 0),
                        this.view1.transform.localRotationEulerY = i;
                    }
                    if (0 != this.speednow) {
                        let t = this.speednow >= 20 ? 20 : this.speednow;
                        for (let s = 0; s < this.wheelsfront.length; s++) this.wheelsfront[s].transform.localRotationEulerY = -i * e,
                        this.wheelsfront[s].transform.localRotationEulerX += t;
                        for (let e = 0; e < this.wheelsother.length; e++) this.wheelsother[e].transform.localRotationEulerX += t;
                    }
                }
            }
            onCollisionEnter(t) {
                super.onCollisionEnter(t);
                let i = t.other.owner.name;
                console.log(this.Pname, i),
                "Terrain" == i ? (e.Send(l.MVC_CAR_DIE), Laya.timer.once(5e3, this, () =>{
                    this.setMode(2);
                })) : -1 != i.indexOf("center") ? (e.Send(l.MVC_CAR_HITED), Laya.timer.once(5e3, this, () =>{
                    this.setMode(2);
                })) : -1 != i.indexOf("bridge1_suppor") ? e.Send(l.MVC_CAR_DIE) : "end" == i && e.Send(l.MVC_FLY_SUCCESS),
                i.indexOf("wall") || -1 != i.indexOf("Tree") || -1 != i.indexOf("house") ? this.hitsound && (this.hitsound = !1, A.instance.playSoundOver("Crash_2", () =>{
                    this.hitsound = !0;
                }), this.speednow = 10) : -1 != i.indexOf("pavement") && this.hitsound && (this.hitsound = !1, A.instance.playSoundOver("Crash_4", () =>{
                    this.hitsound = !0;
                }), this.speednow -= 15),
                4 == this.mode && "Plane" == i && e.Send(l.MVC_CAR_DIE);
            }
            playAnimation(e, t) {
                this.layer = this.animator.getControllerLayer(),
                this.AnimatorState = this.layer.getAnimatorState(e),
                this.AnimatorState.clip.islooping = !1,
                this.AnimatorStateScript = this.AnimatorState.getScript(Laya.AnimatorStateScript),
                null == this.AnimatorStateScript && (this.AnimatorStateScript = this.AnimatorState.addScript(Laya.AnimatorStateScript)),
                this.AnimatorStateScript.onStateEnter = (() =>{}),
                this.AnimatorStateScript.onStateUpdate = function() {},
                this.AnimatorStateScript.onStateExit = (() =>{
                    t();
                }),
                this.animator.play(e);
            }
            speedState(e) {
                this.hitnow || (e > 0 ? (this.acceleration = this.speedacc, this.vdir = !0, this.vflag = !0, this.lightB.active = !1) : e < 0 ? (this.fire.active = !1, this.nitrogen = !1, this.acceleration = -this.braking, this.speednow, this.vdir = !1, this.vflag = !0, this.lightB.active = !0) : (this.acceleration = 0, this.vflag = !1, this.lightB.active = !1), Laya.timer.loop(1, this, this.view1move));
            }
            handleDown(e) {
                this.acceleration = 0,
                this.vdir = !1,
                this.vflag = e,
                this.lightB.active = !0,
                this.isbreak = e;
            }
            creazySpeed() {
                this.speednow > 0 && (this.fire.active = !0, this.nitrogen = !0, Laya.timer.once(5e3, this, () =>{
                    this.fire.active = !1,
                    this.nitrogen = !1;
                }));
            }
            setRoate(e) {
                this.rotate = e;
            }
            view1move() {
                this.view1.active && (this.vdir && this.vflag ? (this.body.transform.localRotationEulerX -= this.hang, this.view1camera.transform.localPositionZ -= .02, this.view1camera.transform.localPositionZ <= this.cameraOldZ - 1 && Laya.timer.clear(this, this.view1move)) : this.vdir && !this.vflag ? (this.body.transform.localRotationEulerX += this.hang, this.view1camera.transform.localPositionZ += .02, this.view1camera.transform.localPositionZ >= this.cameraOldZ && Laya.timer.clear(this, this.view1move)) : !this.vdir && this.vflag ? (this.body.transform.localRotationEulerX += this.hang, this.view1camera.transform.localPositionZ += .02, this.view1camera.transform.localPositionZ >= this.cameraOldZ + .5 && Laya.timer.clear(this, this.view1move)) : this.vdir || this.vflag || (this.body.transform.localRotationEulerX -= this.hang, this.view1camera.transform.localPositionZ -= .02, this.view1camera.transform.localPositionZ <= this.cameraOldZ && Laya.timer.clear(this, this.view1move)));
            }
            turnview() {
                this.view1.active = !this.view1.active,
                this.view2.active = !this.view2.active,
                this.view1.transform.localRotationEulerY = 0;
            }
            setActive(e) {
                this.carRig.clearForces(),
                this.active = e,
                this.hitsound = !0,
                this.car.active = e,
                e ? (console.log("车受控"), this.hitnow = !1, this.view1.active = !0, this.view2.active = !1) : (this.view1.active = !1, this.view2.active = !1),
                this.fire.active = !1,
                this.yan.active = !1,
                this.nitrogen = !1,
                this.speednow = this.acceleration = this.rotate = 0,
                this.carRig.angularVelocity = new Laya.Vector3(0, 0, 0),
                this.carRig.angularFactor = new Laya.Vector3(0, 0, 0),
                this.carRig.linearFactor = new Laya.Vector3(0, 0, 0),
                this.car.transform.localRotationEuler = new Laya.Vector3(0, 0, 0),
                this.carRig.angularFactor = new Laya.Vector3(1, 1, 1),
                this.carRig.linearFactor = new Laya.Vector3(1, 1, 1);
            }
            unsee() {
                this.view1.active = !1,
                this.view2.active = !1;
            }
            carOff() {
                this.view1.active = !1,
                this.view2.active = !1;
            }
            resetCar() {
                this.speednow = this.acceleration = this.rotate = 0,
                this.carRig.angularVelocity = new Laya.Vector3(0, 0, 0),
                this.carRig.angularFactor = new Laya.Vector3(0, 0, 0),
                this.carRig.linearFactor = new Laya.Vector3(0, 0, 0),
                this.car.transform.localRotationEuler = new Laya.Vector3(0, this.car.transform.localRotationEuler.y, 0),
                this.car.transform.localPositionY += 5,
                this.carRig.angularFactor = new Laya.Vector3(1, 1, 1),
                this.carRig.linearFactor = new Laya.Vector3(1, 1, 1),
                this.hitsound = !0;
            }
            getPosition() {
                return this.car.transform.position
            }
            setSpeednow(e) {
                this.speednow = e,
                0 == e && (this.fire.active = !1, this.nitrogen = !1, this.carRig.clearForces(), this.carRig.angularVelocity = new Laya.Vector3(0, 0, 0));
            }
            getSpeednow() {
                return this.speednow
            }
            setroatescale(e) {
                this.roatescale = e;
            }
            lightChange(e = 0) {
                this.lightF.active = 0 != e ? e > 0 : !this.lightF.active;
            }
            initCarInfo(e) {
                this.carInfo = J.inst.getCarInfo(e),
                this.speedacc = this.carInfo.accSpeed / (2.5 * this.gear),
                this.hang = 1.8 / this.carInfo.damping,
                this.braking = this.carInfo.braking / 2,
                this.speedmax = this.carInfo.stepSpeed;
            }
            setGear(e) {
                this.gear = e,
                this.speedacc = Math.floor(this.carInfo.accSpeed / (2.5 * this.gear) * 100) / 100,
                this.acceleration > 0 ? this.acceleration = this.speedacc: this.acceleration < 0 ? this.acceleration = -this.speedacc: this.acceleration = 0,
                7 == this.gear ? this.speedmax = this.carInfo.maxSpeed: this.speedmax = this.carInfo.stepSpeed * this.gear,
                this.speednow = this.speednow >= this.speedmax ? this.speedmax: this.speednow;
            }
            setPenqi() {
                this.penqi.active = !0;
                for (let e = 0; e < this.lizi.length; e++) this.lizi[e].particleSystem.play();
            }
            setPosition(e, t) {
                console.log("设置：", e, t),
                this.car.transform.position = e,
                this.car.transform.localRotationEulerY = t;
            }
            setMode(e) {
                this.mode = e;
                for (let e = 0; e < this.WheelsRig.length; e++) 1 == this.mode ? (this.WheelsRig[e].gravity = new Laya.Vector3(0, 0, 0), this.WheelsRig[e].friction = .5) : 4 == this.mode ? this.WheelsRig[e].friction = .8 : (console.log("设置", this.WheelsRig[e].friction, this.WheelsRig[e].rollingFriction, this.WheelsRig[e].restitution), this.WheelsRig[e].gravity = new Laya.Vector3(0, 0, 0), this.WheelsRig[e].friction = 10);
            }
            initBody(e) {
                this.view1camera.transform.localPosition = e.camera.transform.localPosition,
                this.view1camera.transform.localRotationEuler = e.camera.transform.localRotationEuler,
                this.cameraOldZ = this.view1camera.transform.localPositionZ,
                this.body.transform.localPosition = e.body.transform.localPosition,
                this.body.transform.localRotationEuler = e.body.transform.localRotationEuler;
            }
            setHero(e) {
                if (e > 0) {
                    this.people.active = !0,
                    this.people.getChildAt(0).active = !1,
                    this.heros.active = !0;
                    let t = this.heros.getChildAt(e - 1);
                    t.active = !0,
                    t.getComponent(Laya.Animator).play("sit");
                } else this.people.getChildAt(0).active = !0,
                this.heros.active = !1;
            }
        }
        class Q extends z {
            constructor() {
                super(),
                this.reward = 0,
                this.mode = 0,
                this.packageName = "Game",
                this.resName = "GamePop",
                this.isFullWindow = !0;
            }
            onConstruct() {
                console.log(this.view),
                this.view.m_pause_again.onClick(this, () =>{
                    this.close(),
                    e.Send(l.MVC_GAME_AGAIN);
                }),
                this.view.m_pause_continue.onClick(this, () =>{
                    this.close();
                }),
                this.view.m_pause_home.onClick(this, () =>{
                    1 == this.mode ? (this.close(), e.Send(l.MVC_GAME_END)) : (this.shownative(), console.log("原生1"), this.view.m_flag.selectedIndex = 4);
                }),
                this.view.m_pause_video.onClick(this, () =>{
                    // I.showVideoAd(this, t =>{
                    //     0 == t.code && (this.close(), w.inst.addCoin(2 * this.reward), e.Send(l.MVC_GAME_END))
                    // })
                    let success = () =>{
                        this.close(), w.inst.addCoin(2 * this.reward), e.Send(l.MVC_GAME_END);
                    };
                    Advertisement.videoAdverV(success);
                }),
                this.view.m_home.onClick(this, () =>{
                    this.close(),
                    w.inst.addCoin(this.reward),
                    e.Send(l.MVC_GAME_END);
                }),
                this.view.m_fail_home.onClick(this, () =>{
                    this.close(),
                    e.Send(l.MVC_GAME_END);
                }),
                this.view.m_fail_video.onClick(this, () =>{
                    // I.showVideoAd(this, t =>{
                    //     0 == t.code && (this.close(), e.Send(l.MVC_GAME_ADDNUM))
                    // })
                    let success = () => {
                        this.close(), e.Send(l.MVC_GAME_ADDNUM);
                    };
                    Advertisement.videoAdverV(success);
                }),
                this.view.m_success_home.onClick(this, () =>{
                    this.close(),
                    w.inst.addCoin(this.reward),
                    e.Send(l.MVC_GAME_END);
                }),
                this.view.m_success_video.onClick(this, () =>{
                    // I.showVideoAd(this, t =>{
                    //     0 == t.code && (this.close(), w.inst.addCoin(2 * this.reward), e.Send(l.MVC_GAME_END))
                    // })
                    let success = () => {
                        this.close(), w.inst.addCoin(2 * this.reward), e.Send(l.MVC_GAME_END);
                    };
                    Advertisement.videoAdverV(success);
                }),
                this.view.m_success_again.onClick(this, () =>{
                    this.close(),
                    e.Send(l.MVC_GAME_AGAIN);
                }),
                this.view.m_flyfail_again.onClick(this, () =>{
                    this.close(),
                    e.Send(l.MVC_GAME_AGAIN);
                }),
                this.view.m_flyfail_home.onClick(this, () =>{
                    this.close(),
                    e.Send(l.MVC_GAME_END);
                }),
                this.view.m_flysuccess_home.onClick(this, () =>{
                    this.close(),
                    w.inst.addCoin(2 * this.reward),
                    e.Send(l.MVC_GAME_END);
                }),
                this.view.m_flysuccess_again.onClick(this, () =>{
                    this.close(),
                    e.Send(l.MVC_GAME_AGAIN);
                }),
                this.view.m_knowit.onClick(this, this.close);
            }
            onShow() {
                super.onShow(),
                e.Send(l.MVC_GAME_PAUSE),
                console.log(this.uiOpenData),
                this.uiOpenData.flag ? (this.view.m_flag.selectedIndex = this.uiOpenData.flag, this.reward = this.uiOpenData.reward, this.view.m_hited.selectedIndex = this.uiOpenData.hited >= 0 ? this.uiOpenData.hited: 0, 1 == this.view.m_hited.selectedIndex && (this.reward = 1.2 * this.reward)) : this.view.m_flag.selectedIndex = 0,
                this.reward = Math.floor(this.uiOpenData.reward),
                this.mode = this.uiOpenData.mode,
                this.view.m_pauseRunNum.text = "您已驾驶" + this.uiOpenData.distance + "米",
                this.view.m_reward.text = "+" + this.reward,
                this.view.m_runReward.text = "+" + this.reward,
                this.view.m_fly_reward.text = "+" + this.reward,
                console.log("原生2");//,
                // this.shownative()
                Advertisement.insertAdverV();
            }
            close() {
                super.close();
            }
            shownative() {
                // console.log("原声"),
                // L.isMiniGame ? L.PLATFORM == C.OPPO ? I.showMiniNativeWin(15, 15) : L.PLATFORM == C.VIVO ? I.showVivoNativeWin(l.VivoAdTime) : L.PLATFORM == C.HW && I.showMiniNativeWin(30, 30) : I.showNativeAD()
                Advertisement.insertAdverV3();
            }
        }
        class Z extends z {
            constructor() {
                super(),
                this.gearnow = 1,
                this.canControl = !1,
                this.hited = -1,
                this.centerdis = 99999,
                this.liveTime = 10,
                this.runNum = 0,
                this.mode = 1,
                this.gamelevel = 0,
                this.heroflag = 0,
                this.oldInfos = [],
                this.farx = 0,
                this.fary = 3.21,
                this.farz = -8,
                this.idleSound = !1,
                this.packageName = "Game",
                this.resName = "Main",
                this.isFullWindow = !0;
            }
            onConstruct() {
                console.log(this.view),
                e.On(l.MVC_HERO_DONE, this, () =>{
                    this.prepare.active = !1,
                    this.view.m_choosehero.selectedIndex = 0,
                    this.camera.active = !1;
                    let e = w.inst.getUseId() - 1;
                    this.caruse = this.cars.getChildAt(e),
                    this.caruse.active = !0,
                    this.carscript = this.caruse.addComponent(q),
                    this.carscript.setActive(!0),
                    this.carscript.initBody(this.oldInfos[e]),
                    this.carscript.setHero(this.heroflag),
                    this.hited = -1,
                    this.view.m_disinfo.visible = !0,
                    this.center.parent.active = !0;
                    let t = this.level.getChildAt(this.gamelevel - 1).clone();
                    t.transform.localPositionY += 5,
                    this.carscript.setPosition(t.transform.position, t.transform.localRotationEulerY),
                    this.view.m_settle.selectedIndex = 1,
                    this.liveTime = 70,
                    this.view.m_liveTime.text = this.liveTime + "秒后开始结算",
                    Laya.timer.loop(1e3, this, this.settle),
                    this.carscript.setMode(this.mode),
                    this.carscript.initCarInfo(e),
                    this.canControl = !0;
                }),
                e.On(l.MVC_GAME_AGAIN, this, () =>{
                    if (1 == this.mode) {
                        this.carscript.setActive(!0),
                        A.instance.playMusic("huanhu", 1),
                        this.hited = -1,
                        this.view.m_disinfo.visible = !0,
                        this.center.parent.active = !0;
                        let e = this.level.getChildAt(this.gamelevel - 1).clone();
                        e.transform.localPositionY += 5,
                        this.carscript.setPosition(e.transform.position, e.transform.localRotationEulerY),
                        this.view.m_settle.selectedIndex = 1,
                        this.liveTime = 70,
                        this.view.m_liveTime.text = this.liveTime + "秒后开始结算",
                        Laya.timer.clear(this, this.settle),
                        Laya.timer.loop(1e3, this, this.settle);
                    } else if (2 == this.mode) {
                        this.carscript.setActive(!0),
                        this.hited = 99,
                        this.view.m_runinfo.visible = !0,
                        this.center.parent.active = !1;
                        let e = this.center.transform.position.clone();
                        e.y += 5,
                        this.carscript.setPosition(e, 0);
                    } else if (3 == this.mode) {
                        this.xiepo.active = !0,
                        l.setChild(this.xiepo, !1, this.gamelevel - 1);
                        let e = this.xiepo.getChildAt(this.gamelevel - 1).getChildByName("start").clone();
                        this.carscript.setPosition(e.transform.position, e.transform.localRotationEulerY),
                        this.view.m_settle.selectedIndex = 1,
                        this.liveTime = 70,
                        this.view.m_liveTime.text = this.liveTime + "秒后开始结算",
                        Laya.timer.clear(this, this.settle),
                        Laya.timer.loop(1e3, this, this.settle);
                    } else if (4 == this.mode) {
                        let e = this.desks.getChildByName("start").clone();
                        e.transform.position.y += 1,
                        this.carscript.setActive(!0),
                        this.carscript.setPosition(e.transform.position, e.transform.localRotationEulerY),
                        this.view.m_settle.selectedIndex = 1,
                        this.liveTime = 40,
                        this.view.m_liveTime.text = this.liveTime + "秒后开始结算",
                        this.canControl = !0,
                        Laya.timer.clear(this, this.settle),
                        Laya.timer.loop(1e3, this, this.settle);
                    }
                    this.carscript.setMode(this.mode);
                }),
                e.On(l.MVC_CAR_DIE, this, () =>{
                    if ( - 1 == this.hited && (A.instance.playSound("Crash_1"), this.hited = 0), 3 == this.mode) {
                        Laya.timer.clear(this, this.settle);
                        let e = 50,
                        t = 50;
                        D.Instance.openWindow(Q, {
                            flag: 5,
                            reward: e,
                            distance: t,
                            mode: this.mode
                        });
                    } else if (4 == this.mode) {
                        Laya.timer.clear(this, this.settle);
                        let e = 50,
                        t = 50;
                        D.Instance.openWindow(Q, {
                            flag: 5,
                            reward: e,
                            distance: t,
                            mode: this.mode
                        });
                    }
                }),
                e.On(l.MVC_CAR_HITED, this, () =>{ - 1 == this.hited && (A.instance.playSound("Crash_3"), this.hited = 1);
                }),
                e.On(l.MVC_FLY_SUCCESS, this, () =>{
                    let e = Y.GetDistanceP(this.carscript.getPosition(), this.end.transform.position);
                    e <= 50 && (e = 50);
                    let t = Math.floor(2e4 / e);
                    D.Instance.openWindow(Q, {
                        flag: 6,
                        reward: t,
                        hited: this.hited
                    });
                }),
                e.On(l.MVC_GAME_END, this, () =>{
                    A.instance.playMusic("bgm"),
                    this.close();
                }),
                e.On(l.MVC_GAME_PAUSE, this, () =>{
                    A.instance.stopMusic(),
                    A.instance.stopAllSound(),
                    this.carscript.setRoate(0),
                    this.carscript.setSpeednow(0),
                    this.carscript.speedState(0);
                }),
                Laya.stage.on(Laya.Event.KEY_UP, this, this.onkeyup),
                Laya.stage.on(Laya.Event.KEY_DOWN, this, this.onkeydown),
                this.scene3D = Laya.loader.getRes(l.get3dPath("XiePo3.ls")),
                this.view.m_3dComp.displayObject.addChildAt(this.scene3D, 0),
                this.xiepo = this.scene3D.getChildByName("xiepo"),
                this.camera = this.scene3D.getChildByName("Camera");
                let t = this.scene3D.getChildByName("Terrain");
                this.desks = this.scene3D.getChildByName("desks");
                let i = t.addComponent(Laya.PhysicsCollider),
                s = new Laya.MeshColliderShape;
                s.convex = !0,
                s.mesh = t.meshFilter.sharedMesh,
                i.colliderShape = s,
                this.center = this.scene3D.getChildByName("aimplace").getChildByName("center"),
                this.enemy = this.scene3D.getChildByName("aimplace").getChildByName("enemy"),
                this.level = this.scene3D.getChildByName("level"),
                this.prepare = this.scene3D.getChildByName("prepare"),
                this.heros = this.prepare.getChildByName("hero"),
                this.cars = this.scene3D.getChildByName("cars");
                for (let e = 0; e < this.cars.numChildren; e++) {
                    let t = this.cars.getChildAt(e),
                    i = new X;
                    i.body = t.getChildAt(0).getChildByName("body").clone(),
                    i.camera = t.getChildAt(0).getChildByName("view1").getChildAt(0).clone(),
                    this.oldInfos.push(i);
                }
                this.view.m_stop.onClick(this, () =>{
                    this.carscript.setRoate(0),
                    this.carscript.setSpeednow(0),
                    this.carscript.speedState(0);
                    let e = Math.floor(this.runNum),
                    t = .05 * this.runNum;
                    D.Instance.openWindow(Q, {
                        flag: 0,
                        reward: t,
                        distance: e,
                        mode: this.mode
                    });
                }),
                this.view.m_switchview.onClick(this, () =>{
                    this.canControl && this.carscript.turnview();
                }),
                this.view.m_left.on(Laya.Event.MOUSE_DOWN, this, () =>{
                    this.canControl && this.carscript.setRoate( - 1);
                }),
                this.view.m_left.on(Laya.Event.MOUSE_UP, this, () =>{
                    this.canControl && this.carscript.setRoate(0);
                }),
                this.view.m_right.on(Laya.Event.MOUSE_DOWN, this, () =>{
                    this.canControl && this.carscript.setRoate(1);
                }),
                this.view.m_right.on(Laya.Event.MOUSE_UP, this, () =>{
                    this.canControl && this.carscript.setRoate(0);
                }),
                this.view.m_fire.on(Laya.Event.MOUSE_DOWN, this, () =>{
                    this.canControl && (this.carscript.speedState(1), this.gearnow >= 2 ? A.instance.stopAndPlay("car_high", 0) : A.instance.stopAndOnPlay("youmen", () =>{
                        A.instance.playSound("car_high", 0);
                    }));
                }),
                this.view.m_fire.on(Laya.Event.MOUSE_UP, this, () =>{
                    this.canControl && (this.carscript.speedState(0), A.instance.stopAndPlay("low", 0));
                }),
                this.view.m_break.on(Laya.Event.MOUSE_DOWN, this, () =>{
                    this.canControl && (this.carscript.speedState( - 1), this.gearnow >= 2 ? A.instance.stopAndOnPlay("car_break", () =>{
                        A.instance.playSound("low", 0);
                    }) : A.instance.stopAndPlay("low", 0));
                }),
                this.view.m_break.on(Laya.Event.MOUSE_UP, this, () =>{
                    this.canControl && this.carscript.speedState(0);
                }),
                this.view.m_reset.onClick(this, () =>{
                    this.carscript.resetCar();
                });
                for (let e = 1; e <= 4; e++) this.view["m_b" + e].onClick(this, () =>{
                    this.heroflag = e,
                    A.instance.playMusic("huanhu", 1),
                    this.view.m_herobtns.visible = !1,
                    this.heroGone(e);
                });
            }
            onShow() {
                super.onShow(),
                I.hideBanner(),
                this.view.m_switchview.visible = !0,
                A.instance.stopMusic(),
                e.Send(l.MVC_GAME_LOADED),
                this.runNum = 0,
                this.mode = this.uiOpenData.mode,
                this.gamelevel = this.uiOpenData.level,
                this.xiepo.active = !1,
                this.center.parent.active = !1,
                this.canControl = !1,
                this.view.m_settle.selectedIndex = 0,
                this.view.m_disinfo.visible = !1,
                this.view.m_runinfo.visible = !1,
                this.prepare.active = !1,
                this.enemy.active = !1,
                this.camera.active = !1,
                this.desks.active = !1;
                let t = w.inst.getUseId() - 1;
                if (l.setChild(this.cars, !1, -1), 1 == this.mode) this.showing(),
                this.view.m_switchview.visible = !1;
                else if (2 == this.mode) {
                    this.caruse = this.cars.getChildAt(t),
                    this.caruse.active = !0,
                    this.carscript = this.caruse.addComponent(q),
                    this.carscript.setActive(!0),
                    this.carscript.initCarInfo(t),
                    this.carscript.initBody(this.oldInfos[t]),
                    this.carscript.setMode(this.mode),
                    this.hited = 99,
                    this.view.m_runinfo.visible = !0,
                    this.center.parent.active = !1;
                    let e = this.center.transform.position.clone();
                    e.y += 5,
                    this.carscript.setPosition(e, 0),
                    this.canControl = !0,
                    this.carscript.setHero( - 1);
                } else if (3 == this.mode) {
                    this.caruse = this.cars.getChildAt(t),
                    this.caruse.active = !0,
                    this.carscript = this.caruse.addComponent(q),
                    this.carscript.setActive(!0),
                    this.carscript.initCarInfo(t),
                    this.carscript.initBody(this.oldInfos[t]),
                    this.carscript.setMode(this.mode),
                    this.xiepo.active = !0,
                    l.setChild(this.xiepo, !1, this.gamelevel - 1),
                    this.end = this.xiepo.getChildAt(this.gamelevel - 1).getChildByName("end");
                    let e = this.xiepo.getChildAt(this.gamelevel - 1).getChildByName("start").clone();
                    this.carscript.setPosition(e.transform.position, e.transform.localRotationEulerY),
                    this.view.m_settle.selectedIndex = 1,
                    this.liveTime = 70,
                    this.view.m_liveTime.text = this.liveTime + "秒后开始结算",
                    Laya.timer.loop(1e3, this, this.settle),
                    this.view.m_title.text = "经过斜坡，冲向对面",
                    this.canControl = !0,
                    this.carscript.setHero( - 1);
                } else if (4 == this.mode) {
                    this.desks.active = !0,
                    this.caruse = this.cars.getChildAt(t),
                    this.caruse.active = !0,
                    this.carscript = this.caruse.addComponent(q),
                    this.carscript.setActive(!0),
                    this.carscript.initCarInfo(t),
                    this.carscript.initBody(this.oldInfos[t]),
                    this.carscript.setMode(this.mode),
                    l.setChild(this.desks, !1, this.gamelevel - 1),
                    this.view.m_disinfo.visible = !0,
                    this.end = this.desks.getChildAt(this.gamelevel - 1).getChildByName("yuan");
                    let e = this.desks.getChildByName("start").clone();
                    e.transform.position.y += 1,
                    this.carscript.setPosition(e.transform.position, e.transform.localRotationEulerY),
                    this.view.m_settle.selectedIndex = 1,
                    this.liveTime = 40,
                    this.view.m_liveTime.text = this.liveTime + "秒后开始结算",
                    Laya.timer.loop(1e3, this, this.settle),
                    this.view.m_title.text = "小心驾驶，驶向靶心",
                    this.canControl = !0,
                    this.carscript.setHero( - 1);
                }
                this.carInfo = J.inst.getCarInfo(t),
                A.instance.playSound("idle", 0);
            }
            heroGone(e) {
                let t;
                for (let i = 0; i < this.heros.numChildren; i++) {
                    let s = this.heros.getChildAt(i).getComponent(Laya.Animator),
                    a = Y.MakeRandomInt(10);
                    i == e - 1 ? (t = this.heros.getChildAt(i), s.play(a >= 5 ? "walk1": "walk2")) : s.play("cheering");
                }
                let i = new Laya.Vector3(0, 0, 0);
                Laya.Vector3.subtract(t.transform.position, this.showcar.transform.position, i),
                Laya.Vector3.normalize(i, i),
                i.y *= 0,
                i.x *= -.01,
                i.z *= -.01,
                Laya.timer.loop(5, this, this.heromove, [t, i, t.transform.position.clone()]);
            }
            heromove(t, i, s) {
                t.transform.translate(i, !1),
                Y.GetDistanceV2(t.transform.position, this.showcar.transform.position) <= 1 && (Laya.timer.clear(this, this.heromove), t.transform.position = s, e.Send(l.MVC_HERO_DONE));
            }
            showing() {
                this.view.m_herobtns.visible = !0,
                this.view.m_choosehero.selectedIndex = 1,
                this.center.parent.active = !0,
                this.camera.active = !0,
                this.prepare.active = !0,
                this.enemy.active = !0;
                for (let e = 0; e < this.heros.numChildren; e++) {
                    let t = this.heros.getChildAt(e).getComponent(Laya.Animator),
                    i = Y.MakeRandomInt(10);
                    t.play(i >= 5 ? "idle1": "idle2");
                }
                l.setChild(this.prepare.getChildByName("cars"), !1, w.inst.getUseId() - 1),
                this.showcar = this.prepare.getChildByName("cars").getChildAt(w.inst.getUseId() - 1);
            }
            settle() {
                if (!D.Instance.openList.find(e =>e.UIClass == Q) && (this.liveTime--, this.view.m_liveTime.text = this.liveTime + "秒后开始结算", 0 == this.liveTime)) {
                    let e = 0;
                    if (1 == this.mode)(e = Math.floor(2e4 / this.centerdis)) <= 0 ? e = 600 : e >= 1e3 && (e = 1e3),
                    D.Instance.openWindow(Q, {
                        flag: 2,
                        reward: e,
                        hited: this.hited
                    });
                    else if (3 == this.mode) {
                        let t = Y.GetDistanceP(this.carscript.getPosition(), this.end.transform.position);
                        t <= 50 && (t = 50),
                        e = Math.floor(2e4 / t),
                        D.Instance.openWindow(Q, {
                            flag: 5,
                            reward: e,
                            hited: this.hited
                        });
                    } else 4 == this.mode && ((e = Math.floor(1e4 / this.centerdis)) <= 0 ? e = 300 : e >= 800 && (e = 800), this.centerdis > 41 ? D.Instance.openWindow(Q, {
                        flag: 5,
                        reward: e,
                        hited: -1
                    }) : D.Instance.openWindow(Q, {
                        flag: 6,
                        reward: e,
                        hited: 1
                    }));
                    Laya.timer.clear(this, this.settle);
                }
            }
            close() {
                super.close(),
                Laya.timer.clearAll(this),
                A.instance.stopAllSound();
            }
            update() {
                if (this.canControl) {
                    let e = this.carscript.getSpeednow();
                    if (this.computeGear(e), 1 == this.mode || 4 == this.mode) {
                        let e = this.carscript.getPosition();
                        this.centerdis = Y.GetDistanceP(e, this.center.transform.position),
                        4 == this.mode && (this.centerdis = Y.GetDistanceP(e, this.end.transform.position)),
                        this.view.m_trynum.text = this.centerdis.toFixed(2) + "米";
                    } else this.runNum += Math.abs(.005 * e),
                    this.view.m_runNum.text = this.runNum.toFixed(0) + "米";
                }
            }
            computeGear(e) {
                e < 0 ? (this.view.m_plate.m_gear.text = "R", this.gearnow = 1, this.idleSound = !1) : e > 0 ? (e >= this.gearnow * this.carInfo.stepSpeed && this.gearnow <= 6 ? (A.instance.playSound("car_flameout"), this.gearnow++, this.carscript.setPenqi(), this.view.m_plate.m_gear.text = this.gearnow + "", this.carscript.setGear(this.gearnow)) : e < this.gearnow * this.carInfo.stepSpeed - this.carInfo.stepSpeed && (A.instance.playSound("car_flameout"), this.gearnow--, this.carscript.setPenqi(), this.view.m_plate.m_gear.text = this.gearnow + "", this.carscript.setGear(this.gearnow)), e = 4 * (e - (this.gearnow - 1) * this.carInfo.stepSpeed + 2 * this.gearnow), this.idleSound = !1) : (this.view.m_plate.m_gear.text = "0", this.gearnow = 1, !this.idleSound && this.canControl && (this.idleSound = !0, A.instance.stopAndPlay("idle", 0)));
                let t = Math.abs(e);
                t = t > 170 ? 170 : t,
                this.view.m_plate.m_zhizhen.rotation = t;
            }
            onHide() {
                console.log("GameWnd onHide");
            }
            onkeyup(e) {
                switch (e.keyCode) {
                case 87:
                case 83:
                    this.carscript.speedState(0);
                    break;
                case 65:
                case 68:
                    this.carscript.setRoate(0);
                }
            }
            onkeydown(e) {
                switch (e.keyCode) {
                case 87:
                    this.carscript.speedState(1);
                    break;
                case 83:
                    this.carscript.speedState( - 1);
                    break;
                case 65:
                    this.carscript.setRoate( - 1);
                    break;
                case 68:
                    this.carscript.setRoate(1);
                    break;
                case 82:
                    this.carscript.turnview();
                }
            }
            shownative() {
                // L.isMiniGame ? L.PLATFORM == C.OPPO ? I.showMiniNativeWin(15, 15) : L.PLATFORM == C.VIVO ? I.showVivoNativeWin(l.VivoAdTime) : L.PLATFORM == C.HW && I.showMiniNativeWin(30, 30) : I.showNativeAD()
                Advertisement.insertAdverV3();
            }
        }
        class K extends z {
            constructor() {
                super(),
                this.directold = new Laya.Point(0, 0),
                this.canroate = !1,
                this.carPrices = [2e3, 5e3, 6e3, 7e3, 8e3, 9e3, 11e3, 14e3, 15e3],
                this.packageName = "Game",
                this.resName = "StartAllWin",
                this.isFullWindow = !0;
            }
            onConstruct() {
                console.log(this.view),
                e.On(l.MVC_COIN_CHANGE, this, () =>{
                    this.view.m_coins.text = w.inst.getCoin() + "";
                }),
                e.On(l.MVC_GAME_LOADED, this, () =>{
                    this.view.m_loading.selectedIndex = 0;
                }),
                e.On(l.MVC_GAME_END, this, () =>{
                    A.instance.playMusic("bgm"),
                    this.canroate = !0,
                    this.shownative(),
                    console.log("原生3"),
                    r.getCrtTime() >= l.VivoAdTime && I.showBanner();
                }),
                this.scene3D = Laya.loader.getRes(l.get3dPath("MotoRoom1.ls")),
                this.view.m_3dComp.displayObject.addChildAt(this.scene3D, 0),
                console.log(this.scene3D),
                this.Camera = this.scene3D.getChildByName("Main Camera"),
                this.cars = this.scene3D.getChildByName("cars"),
                this.view.m_addcoin.onClick(this, () =>{
                    this.shownative(),console.log("原生4"),
                    this.view.m_popflag.selectedIndex = 1,
                    this.view.m_pop.m_falg.selectedIndex = 1;
                }),
                this.view.m_back.onClick(this, () =>{
                    this.view.m_garageshow.selectedIndex = 0,
                    this.Camera.active = !1,
                    this.choise = this.olduse,
                    this.showcar(0),
                    this.cars.active = !1,
                    I.showBanner();
                }),
                this.view.m_garage.onClick(this, () =>{
                    this.shownative(),console.log("原生5"),
                    this.Camera.active = !0,
                    this.view.m_garageshow.selectedIndex = 1,
                    this.cars.active = !0,
                    I.hideBanner();
                }),
                this.view.m_pop.m_video.onClick(this, () =>{
                    // I.showVideoAd(this, e =>{
                    //     0 == e.code && (w.inst.addCoin(1e3), this.view.m_coins.text = w.inst.getCoin() + "")
                    // }),
                    let success = () => {
                        w.inst.addCoin(1e3), this.view.m_coins.text = w.inst.getCoin() + "";
                    };
                    Advertisement.videoAdverV(success);
                    this.view.m_popflag.selectedIndex = 0;
                }),
                this.view.m_pop.m_close.onClick(this, () =>{
                    this.view.m_popflag.selectedIndex = 0;
                }),
                this.view.m_pop.m_cancel.onClick(this, () =>{
                    this.view.m_popflag.selectedIndex = 0;
                }),
                this.view.m_pop.m_go.onClick(this, () =>{
                    this.view.m_pop.m_falg.selectedIndex = 1;
                }),
                this.view.m_cargarage.m_last.onClick(this, () =>{
                    this.showcar( - 1);
                }),
                this.view.m_cargarage.m_next.onClick(this, () =>{
                    this.showcar(1);
                }),
                this.view.m_cargarage.m_unlock.onClick(this, () =>{
                    let e = this.carPrices[this.choise];
                    w.inst.getCoin() >= e ? (w.inst.useCoin(e), this.view.m_cargarage.m_carflag.selectedIndex = 1, w.inst.addPlane(this.choise + 1)) : (this.view.m_popflag.selectedIndex = 1, this.view.m_pop.m_falg.selectedIndex = 0);
                }),
                this.view.m_cargarage.m_choose.onClick(this, () =>{
                    this.view.m_cargarage.m_carflag.selectedIndex = 0,
                    this.olduse = this.choise,
                    w.inst.setUsedId(this.choise + 1);
                }),
                this.view.m_levelcomp.m_l1.onClick(this, () =>{
                    this.startGame(1, 1);
                }),
                this.view.m_levelcomp.m_l2.onClick(this, () =>{
                    this.startGame(1, 2);
                }),
                this.view.m_levelcomp.m_l3.onClick(this, () =>{
                    this.startGame(1, 3);
                }),
                this.view.m_levelcomp.m_l4.onClick(this, () =>{
                    this.startGame(1, 4);
                }),
                this.view.m_slopeComp.m_l1.onClick(this, () =>{
                    this.startGame(3, 1);
                }),
                this.view.m_slopeComp.m_l2.onClick(this, () =>{
                    this.startGame(3, 2);
                }),
                this.view.m_slopeComp.m_l3.onClick(this, () =>{
                    this.startGame(3, 3);
                }),
                this.view.m_slopeComp.m_l4.onClick(this, () =>{
                    this.startGame(3, 4);
                }),
                this.view.m_startgame1.onClick(this, () =>{
                    this.shownative(),console.log("原生6"),
                    this.view.m_garageshow.selectedIndex = 2,
                    I.hideBanner();
                }),
                this.view.m_startgame2.onClick(this, () =>{
                    this.shownative(),console.log("原生7"),
                    this.view.m_loading.selectedIndex = 1,
                    D.Instance.openWindow(Z, {
                        mode: 2
                    });
                }),
                this.view.m_startgame3.onClick(this, () =>{
                    this.shownative(),console.log("原生8"),
                    this.view.m_garageshow.selectedIndex = 3,
                    I.hideBanner();
                }),
                this.view.m_startgame4.onClick(this, () =>{
                    this.shownative(),console.log("原生9"),
                    this.view.m_garageshow.selectedIndex = 4,
                    I.hideBanner();
                });
                for (let e = 1; e <= 4; e++) this.view.m_tejiComp["m_l" + e].onClick(this, () =>{
                    this.startGame(4, e);
                });
                this.view.m_cargarage.m_touch.on(Laya.Event.MOUSE_DOWN, this, () =>{
                    this.directold = this.view.m_cargarage.m_touch.globalToLocal(Laya.stage.mouseX, Laya.stage.mouseY),
                    this.canroate = !1;
                }),
                this.view.m_cargarage.m_touch.on(Laya.Event.MOUSE_MOVE, this, () =>{
                    let e = this.view.m_cargarage.m_touch.globalToLocal(Laya.stage.mouseX, Laya.stage.mouseY),
                    t = this.directold.x - e.x;
                    this.cars.transform.localRotationEulerY -= t,
                    this.directold = e;
                }),
                this.view.m_cargarage.m_touch.on(Laya.Event.MOUSE_UP, this, () =>{
                    this.canroate = !0;
                });
            }
            onShow() {
                super.onShow(),
                this.shownative(),console.log("原生10"),
                this.view.m_coins.text = w.inst.getCoin() + "",
                this.olduse = w.inst.getUseId() - 1,
                this.choise = this.olduse,
                this.showcar(0),
                this.cars.active = !1,
                A.instance.playMusic("bgm"),
                I.showBanner(),
                this.canroate = !0;
            }
            update() {
                super.update(),
                1 == this.view.m_garageshow.selectedIndex && this.canroate && (this.cars.transform.localRotationEulerY += .1);
            }
            showcar(e) {
                let t = this.cars.numChildren;
                this.choise += e,
                this.choise < 0 && (this.choise = t - 1),
                this.choise >= t && (this.choise = 0);
                let i = this.choise;
                w.inst.isPlaneHas(this.choise + 1) ? this.choise == this.olduse ? this.view.m_cargarage.m_carflag.selectedIndex = 0 : this.view.m_cargarage.m_carflag.selectedIndex = 1 : this.view.m_cargarage.m_carflag.selectedIndex = 2;
                for (let e = 0; e < t; e++) {
                    this.cars.getChildAt(e).active = e == i;
                }
                this.view.m_cargarage.m_price.text = this.carPrices[this.choise] + "";
            }
            startGame(e, t) {
                this.shownative(),console.log("原生11"),
                this.view.m_garageshow.selectedIndex = 0,
                D.Instance.openWindow(Z, {
                    mode: e,
                    level: t
                });
            }
            shownative() {
                // L.isMiniGame ? L.PLATFORM == C.OPPO ? I.showMiniNativeWin(15, 15) : L.PLATFORM == C.VIVO ? I.showVivoNativeWin(l.VivoAdTime) : L.PLATFORM == C.HW && I.showMiniNativeWin(30, 30) : I.showNativeAD()
                Advertisement.insertAdverV3();
            }
        }
        class $ extends fgui.GComponent {
            static createInstance() {
                return fgui.UIPackage.createObject("Game", "tejiComp")
            }
            onConstruct() {
                this.m_l1 = this.getChildAt(1),
                this.m_l2 = this.getChildAt(2),
                this.m_l3 = this.getChildAt(3),
                this.m_l4 = this.getChildAt(4);
            }
        }
        $.URL = "ui://6laopsucclcmw2p";
        class ee extends fgui.GComponent {
            static createInstance() {
                return fgui.UIPackage.createObject("Game", "slopeComp")
            }
            onConstruct() {
                this.m_l1 = this.getChildAt(1),
                this.m_l2 = this.getChildAt(2),
                this.m_l3 = this.getChildAt(3),
                this.m_l4 = this.getChildAt(4);
            }
        }
        ee.URL = "ui://6laopsucd6kb25";
        class te extends fgui.GComponent {
            static createInstance() {
                return fgui.UIPackage.createObject("Game", "Main")
            }
            onConstruct() {
                this.m_settle = this.getControllerAt(0),
                this.m_choosehero = this.getControllerAt(1),
                this.m_3dComp = this.getChildAt(0),
                this.m_b1 = this.getChildAt(1),
                this.m_b2 = this.getChildAt(2),
                this.m_b3 = this.getChildAt(3),
                this.m_b4 = this.getChildAt(4),
                this.m_herobtns = this.getChildAt(5),
                this.m_switchview = this.getChildAt(6),
                this.m_stop = this.getChildAt(7),
                this.m_fire = this.getChildAt(8),
                this.m_break = this.getChildAt(9),
                this.m_left = this.getChildAt(11),
                this.m_right = this.getChildAt(12),
                this.m_trynum = this.getChildAt(16),
                this.m_disinfo = this.getChildAt(17),
                this.m_liveTime = this.getChildAt(19),
                this.m_title = this.getChildAt(20),
                this.m_runNum = this.getChildAt(24),
                this.m_runinfo = this.getChildAt(25),
                this.m_plate = this.getChildAt(26),
                this.m_reset = this.getChildAt(27);
            }
        }
        te.URL = "ui://6laopsucgeg30";
        class ie extends fgui.GComponent {
            static createInstance() {
                return fgui.UIPackage.createObject("Game", "StartAllWin")
            }
            onConstruct() {
                this.m_popflag = this.getControllerAt(0),
                this.m_garageshow = this.getControllerAt(1),
                this.m_loading = this.getControllerAt(2),
                this.m_3dComp = this.getChildAt(0),
                this.m_startgame3 = this.getChildAt(2),
                this.m_startgame2 = this.getChildAt(3),
                this.m_startgame1 = this.getChildAt(4),
                this.m_garage = this.getChildAt(5),
                this.m_startgame4 = this.getChildAt(6),
                this.m_back = this.getChildAt(9),
                this.m_addcoin = this.getChildAt(11),
                this.m_coins = this.getChildAt(12),
                this.m_cargarage = this.getChildAt(14),
                this.m_levelcomp = this.getChildAt(15),
                this.m_tejiComp = this.getChildAt(16),
                this.m_pop = this.getChildAt(18),
                this.m_slopeComp = this.getChildAt(23);
            }
        }
        ie.URL = "ui://6laopsucktnm5";
        class se extends fgui.GComponent {
            static createInstance() {
                return fgui.UIPackage.createObject("Game", "Component1")
            }
            onConstruct() {
                this.m_startgame4 = this.getChildAt(0);
            }
        }
        se.URL = "ui://6laopsucqdusw2u";
        class ae extends fgui.GComponent {
            static createInstance() {
                return fgui.UIPackage.createObject("Game", "dialPlate")
            }
            onConstruct() {
                this.m_zhizhen = this.getChildAt(1),
                this.m_gear = this.getChildAt(2);
            }
        }
        ae.URL = "ui://6laopsucrtah1p";
        class ne extends fgui.GComponent {
            static createInstance() {
                return fgui.UIPackage.createObject("Game", "levelComp")
            }
            onConstruct() {
                this.m_l1 = this.getChildAt(1),
                this.m_l2 = this.getChildAt(2),
                this.m_l3 = this.getChildAt(3),
                this.m_l4 = this.getChildAt(4);
            }
        }
        ne.URL = "ui://6laopsucrtah23";
        class oe extends fgui.GComponent {
            static createInstance() {
                return fgui.UIPackage.createObject("Game", "Component2")
            }
            onConstruct() {
                this.m_startgame4 = this.getChildAt(0);
            }
        }
        oe.URL = "ui://6laopsucs1xrw2v";
        class re extends fgui.GComponent {
            static createInstance() {
                return fgui.UIPackage.createObject("Game", "tipsComp")
            }
            onConstruct() {
                this.m_context = this.getChildAt(1);
            }
        }
        re.URL = "ui://6laopsucsw2t4";
        class le extends fgui.GComponent {
            static createInstance() {
                return fgui.UIPackage.createObject("Game", "GamePop")
            }
            onConstruct() {
                this.m_flag = this.getControllerAt(0),
                this.m_hited = this.getControllerAt(1),
                this.m_pause_continue = this.getChildAt(3),
                this.m_pause_again = this.getChildAt(4),
                this.m_pause_home = this.getChildAt(5),
                this.m_fail_home = this.getChildAt(8),
                this.m_fail_video = this.getChildAt(9),
                this.m_reward = this.getChildAt(14),
                this.m_success_home = this.getChildAt(15),
                this.m_success_video = this.getChildAt(16),
                this.m_success_again = this.getChildAt(18),
                this.m_knowit = this.getChildAt(22),
                this.m_pauseRunNum = this.getChildAt(24),
                this.m_runReward = this.getChildAt(26),
                this.m_pause_video = this.getChildAt(28),
                this.m_home = this.getChildAt(30),
                this.m_flyfail_again = this.getChildAt(33),
                this.m_flyfail_home = this.getChildAt(34),
                this.m_fly_reward = this.getChildAt(38),
                this.m_flysuccess_again = this.getChildAt(39),
                this.m_flysuccess_home = this.getChildAt(40);
            }
        }
        le.URL = "ui://6laopsucxgg57";
        class he extends fgui.GComponent {
            static createInstance() {
                return fgui.UIPackage.createObject("Game", "PopWin")
            }
            onConstruct() {
                this.m_falg = this.getControllerAt(0),
                this.m_tip = this.getChildAt(1),
                this.m_go = this.getChildAt(2),
                this.m_cancel = this.getChildAt(3),
                this.m_close = this.getChildAt(5),
                this.m_coinget = this.getChildAt(8),
                this.m_video = this.getChildAt(9);
            }
        }
        he.URL = "ui://6laopsucxgg58";
        class ce extends fgui.GComponent {
            static createInstance() {
                return fgui.UIPackage.createObject("Game", "CarGarage")
            }
            onConstruct() {
                this.m_carflag = this.getControllerAt(0),
                this.m_touch = this.getChildAt(0),
                this.m_last = this.getChildAt(1),
                this.m_next = this.getChildAt(2),
                this.m_choose = this.getChildAt(5),
                this.m_unlock = this.getChildAt(7),
                this.m_price = this.getChildAt(10);
            }
        }
        ce.URL = "ui://6laopsucxgg5x";
        class de {
            static bindAll() {
                fgui.UIObjectFactory.setExtension($.URL, $),
                fgui.UIObjectFactory.setExtension(ee.URL, ee),
                fgui.UIObjectFactory.setExtension(te.URL, te),
                fgui.UIObjectFactory.setExtension(ie.URL, ie),
                fgui.UIObjectFactory.setExtension(se.URL, se),
                fgui.UIObjectFactory.setExtension(ae.URL, ae),
                fgui.UIObjectFactory.setExtension(ne.URL, ne),
                fgui.UIObjectFactory.setExtension(oe.URL, oe),
                fgui.UIObjectFactory.setExtension(re.URL, re),
                fgui.UIObjectFactory.setExtension(le.URL, le),
                fgui.UIObjectFactory.setExtension(he.URL, he),
                fgui.UIObjectFactory.setExtension(ce.URL, ce);
            }
        }
        new class {
            constructor() {
                // window.Laya3D ? Laya3D.init(1280, 720) : Laya.init(1280, 720, Laya.WebGL),
                // Laya.stage.scaleMode = "fixedwidth",
                // Laya.stage.screenMode = "horizontal",
                // Laya.URL.basePath = "http://res.njmobaike.com/CDN/JieTouMoTuoMoNi/ChaoJiRenZheMoTuoChe/1.0.0/bin/",
                // (k.debug || "true" == Laya.Utils.getQueryString("debug")) && Laya.enableDebugPanel(),
                // k.physicsDebug && Laya.PhysicsDebugDraw && Laya.PhysicsDebugDraw.enable(),
                // k.stat && Laya.Stat.show(),
                // Laya.alertGlobalError(!0),
                // S.Read(),
                // v.initData(),
                // this.initFgui(),
                // A.instance.init("res/sound/", "wav"),
                // Advertisement.initVal()

                // this.fenbao();
                this.initGameMain();
            }
            fenbao() {
                let self = this;
                // self.initGameMain();
                qg.loadSubpackage({
                    name: 'subpack2',
                    success: function (data) {
                        console.info('加载分包 zip 成功');
                        self.initGameMain();
                    },
                    fail: function (err) {
                        console.info('加载分包 zip 失败', err);
                        self.fenbao();
                    },
                    complete: function () {
                        // 不管分包加载成功还是失败都会执行此回调   
                    }
                });
            }
            initGameMain() {
                window.Laya3D ? Laya3D.init(1280, 720) : Laya.init(1280, 720, Laya.WebGL),
                Laya.stage.scaleMode = "fixedwidth",
                Laya.stage.screenMode = "horizontal",
                Laya.URL.basePath = "http://res.njmobaike.com/CDN/JieTouMoTuoMoNi/FYMT/1.0/bin/",
                (k.debug || "true" == Laya.Utils.getQueryString("debug")) && Laya.enableDebugPanel(),
                k.physicsDebug && Laya.PhysicsDebugDraw && Laya.PhysicsDebugDraw.enable(),
                k.stat && Laya.Stat.show(),
                Laya.alertGlobalError(!0),
                S.Read(),
                v.initData(),
                this.initFgui(),
                A.instance.init("res/sound/", "wav"),
                Advertisement.initVal();
            }
            initFgui() {
                Laya.stage.removeChild(this.logoImage),
                fairygui.UIConfig.packageFileExtension = "bin",
                fairygui.UIConfig.defaultFont = "宋体",
                fairygui.UIConfig.modalLayerColor = "rgba(132,193,253,0.5)",
                null == fairygui.GRoot.inst.displayObject.parent && Laya.stage.addChildAt(fairygui.GRoot.inst.displayObject, 0),
                j.load("res/fgui/Game", Laya.Handler.create(this, this.loadUIComplete));
            }
            load3dComplete() {
                j.load("res/fgui/Game", Laya.Handler.create(this, this.loadUIComplete));
            }
            loadUIComplete() {
                de.bindAll(),
                D.Instance.openWindow(K);
            }
        };
    } ();

}());
