
                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/__qc_index__.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}
require('./assets/Script/Barrier');
require('./assets/Script/Block');
require('./assets/Script/CollisionDetection');
require('./assets/Script/ControlManager');
require('./assets/Script/DynamicAtlasManager');
require('./assets/Script/GameManager');
require('./assets/Script/GameOver');
require('./assets/Script/GameScene');
require('./assets/Script/JiaZai');
require('./assets/Script/Load');
require('./assets/Script/Map');
require('./assets/Script/MapBlock');
require('./assets/Script/NewMode');
require('./assets/Script/NumberToImage');
require('./assets/Script/Pause');
require('./assets/Script/RankManager');
require('./assets/Script/Reduce');
require('./assets/Script/SceneManager');
require('./assets/Script/Sdk/DouyinEntranceView');
require('./assets/Script/Sdk/MiniGameManager');
require('./assets/Script/Sdk/MiniGameSdk');
require('./assets/Script/Wall');
require('./assets/Script/Window');
require('./assets/Script/btnControl');
require('./assets/Script/lq_base/data/lq_const');
require('./assets/Script/lq_base/data/lq_data');
require('./assets/Script/lq_base/data/lq_interface');
require('./assets/Script/lq_base/util/lq_base_util');
require('./assets/Script/lq_base/util/lq_game_util');
require('./assets/Script/lq_base/util/lq_math_util');
require('./assets/Script/lq_base/util/lq_platform_util');
require('./assets/Script/lq_base/util/lq_pool_util');
require('./assets/Script/lq_collide_system/lq_collide');
require('./assets/Script/lq_collide_system/lq_collide_base');
require('./assets/Script/lq_collide_system/lq_collide_config');
require('./assets/Script/lq_collide_system/lq_collide_system');
require('./assets/Script/module/Config/GameConfig');
require('./assets/Script/module/Crypto/HttpUtil');
require('./assets/Script/module/Crypto/crypto-js.min');
require('./assets/Script/module/GameStart/GameAppStart');
require('./assets/Script/module/Music/AudioManager');
require('./assets/Script/module/Notification/Notification');
require('./assets/Script/module/RankList/ItemRender');
require('./assets/Script/module/RankList/List');
require('./assets/Script/module/Share/share');
require('./assets/Script/module/Storage/Storage');
require('./assets/Script/module/Tool/GameTool');
require('./assets/Script/peizhi');
require('./assets/Script/position');
require('./assets/Script/prop/Adhesive');
require('./assets/Script/prop/Boom');
require('./assets/Script/prop/Freeze');
require('./assets/Script/prop/Key');
require('./assets/Script/prop/Lock');
require('./assets/Script/prop/Star');
require('./assets/animation/NewScript');
require('./assets/effect/融化');
require('./assets/migration/use_v2.1-2.2.1_cc.Toggle_event');
require('./assets/migration/use_v2.1-2.2.1_cc.Toggle_event_1');
require('./assets/shop/script/item');
require('./assets/shop/script/shop');
require('./tiledmap-optimize-resource/Script/TmoAssembler');
require('./tiledmap-optimize-resource/Script/TmoObjectGroup');
require('./tiledmap-optimize-resource/Script/TmoSprite');
require('./tiledmap-optimize-resource/Script/TmoTiledLayer');
require('./tiledmap-optimize-resource/Script/TmoTiledMap');

                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/Sdk/MiniGameSdk.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'c1af9nd7gNA95YJ04h9DdNX', 'MiniGameSdk');
// Script/Sdk/MiniGameSdk.ts

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MiniGameSdk = void 0;
/**
 * 小游戏平台SDK工具封装，目前只支持微信和抖音平台
 */
var MiniGameSdk;
(function (MiniGameSdk) {
    function isWechat() {
        //@ts-ignore
        return window.wx !== null && window.wx !== undefined;
    }
    MiniGameSdk.isWechat = isWechat;
    function isBytedance() {
        //@ts-ignore
        return window.tt !== null && window.tt !== undefined;
    }
    MiniGameSdk.isBytedance = isBytedance;
    function getSysWinSize() {
        var sys;
        if (isWechat()) {
            // @ts-ignore
            sys = wx.getSystemInfoSync();
        }
        else if (isBytedance()) {
            // @ts-ignore
            sys = tt.getSystemInfoSync();
        }
        var size = { width: 0, height: 0 };
        if (sys) {
            size.width = sys.windowWidth;
            size.height = sys.windowHeight;
        }
        return size;
    }
    /**
     * 插屏广告。微信抖音都支持！
     */
    var ADInterstitial = /** @class */ (function () {
        function ADInterstitial(adUid) {
            this._adUid = adUid;
        }
        Object.defineProperty(ADInterstitial.prototype, "aduid", {
            get: function () {
                return this._adUid;
            },
            enumerable: false,
            configurable: true
        });
        ADInterstitial.prototype.show = function () {
            var _this = this;
            var _a, _b;
            // @ts-ignore
            if (isWechat() && !wx.createInterstitialAd) {
                console.warn('wechat unsupport interstitial AD!');
                this._interstitial = null;
                return;
            }
            // @ts-ignore
            if (isBytedance() && !tt.createInterstitialAd) {
                console.warn('bytedance unsupport interstitial AD!');
                this._interstitial = null;
                return;
            }
            if (this._interstitial) {
                this._interstitial.load();
            }
            else {
                if (isWechat()) {
                    // @ts-ignore
                    this._interstitial = wx.createInterstitialAd({ adUnitId: this._adUid });
                }
                else if (isBytedance()) {
                    // @ts-ignore
                    this._interstitial = tt.createInterstitialAd({ adUnitId: this._adUid });
                }
                else {
                    this._interstitial = null;
                }
                (_a = this._interstitial) === null || _a === void 0 ? void 0 : _a.onLoad(function () {
                    console.log('load interstitial ad success');
                    _this._interstitial.show().catch(function (err) {
                        console.log('catch interstitial ad error:', err);
                    });
                });
                (_b = this._interstitial) === null || _b === void 0 ? void 0 : _b.onError(function (err) {
                    console.log('interstitial ad on error:', err);
                });
            }
        };
        ADInterstitial.prototype.destory = function () {
            var _a;
            (_a = this._interstitial) === null || _a === void 0 ? void 0 : _a.destroy();
        };
        return ADInterstitial;
    }());
    var ADBanner = /** @class */ (function () {
        /**
         * 抖音和微信都支持
         * 横幅广告。预估宽度默认为300，预估高度为140。如果你不确定就按默认值来。
         * @param adUid 广告UID，后端配置
         * @param isTop 是否在屏幕顶部展示。内部会自动居中计算位置。
         * @param bannerWidth 横幅广告的预估宽度。默认300
         * @param autoShow 广告加载完成后是否立刻显示，默认为不显示
         */
        function ADBanner(adUid, param, bannerWidth, autoShow) {
            if (bannerWidth === void 0) { bannerWidth = 300; }
            if (autoShow === void 0) { autoShow = false; }
            this._adUid = adUid;
            this.create(autoShow, bannerWidth, param); // 默认300比较合适
        }
        Object.defineProperty(ADBanner.prototype, "aduid", {
            get: function () {
                return this._adUid;
            },
            enumerable: false,
            configurable: true
        });
        ADBanner.prototype.create = function (autoShow, bannerWidth, param) {
            var _this = this;
            var _a, _b;
            if (!isWechat() && !isBytedance()) {
                this._banner = null;
                return;
            }
            this.destroy();
            var winSize = getSysWinSize();
            var height = bannerWidth * 0.4;
            var top = 0, left = 0;
            if (typeof param === "boolean") {
                left = (winSize.width - bannerWidth) / 2;
                top = param ? 5 : (winSize.height - height);
            }
            else {
                left = param.left;
                top = param.top;
            }
            var params = {
                adUnitId: this._adUid,
                adIntervals: 30,
                style: { left: left, top: top, width: bannerWidth }
            };
            if (isWechat()) {
                // @ts-ignore
                this._banner = wx.createBannerAd(params);
            }
            else if (isBytedance()) {
                // @ts-ignore
                this._banner = tt.createBannerAd(params);
            }
            else {
                this._banner = null;
            }
            (_a = this._banner) === null || _a === void 0 ? void 0 : _a.onError(function (err) {
                console.log('ad banner error:', err);
            });
            (_b = this._banner) === null || _b === void 0 ? void 0 : _b.onLoad(function () {
                autoShow && _this._banner.show();
            });
        };
        ADBanner.prototype.show = function () {
            var _a;
            (_a = this._banner) === null || _a === void 0 ? void 0 : _a.show();
        };
        ADBanner.prototype.hide = function () {
            var _a;
            (_a = this._banner) === null || _a === void 0 ? void 0 : _a.hide();
        };
        ADBanner.prototype.destroy = function () {
            var _a;
            (_a = this._banner) === null || _a === void 0 ? void 0 : _a.destroy();
        };
        return ADBanner;
    }());
    var ADCustom = /** @class */ (function () {
        /**
         * 由于原生模板广告在微信服务后端可以定制宽度大小，个数，缩放比例等，所以位置调整要根据设置的宽度来定。抖音不支持！
         * @param adUid 广告UID，后端配置
         * @param top 从左上角开始，距离屏幕顶部的距离。注意：这个数据为设备屏幕宽度width。如果需要获取屏幕的像素，需要乘以设备像素比Pixel-Ratio，例如iPhone 13 Pro的Pixel-Ratio为3，像素为Width*3。
         * @param left 从左上角开始，距离屏幕最左边的距离。注意：这个数据为设备屏幕宽度width。如果需要获取屏幕的像素，需要乘以设备像素比Pixel-Ratio，例如iPhone 13 Pro的Pixel-Ratio为3，像素为Width*3。
         * @param scale 原生模板广告的尺寸，默认为1，即100%。此值在微信服务后端广告中获得，默认为100%，目前有100%，90%，80%三种，一般情况不用修改。若有修改，记得传入值，例如90%就传入0.9。
         */
        function ADCustom(adUid, top, left, scale) {
            if (top === void 0) { top = 0; }
            if (left === void 0) { left = 0; }
            if (scale === void 0) { scale = 1.0; }
            this._adUid = adUid;
            this.createCustomAd(top, left, scale);
        }
        Object.defineProperty(ADCustom.prototype, "aduid", {
            get: function () {
                return this._adUid;
            },
            enumerable: false,
            configurable: true
        });
        ADCustom.prototype.createCustomAd = function (top, left, scale) {
            var _a;
            if (!isWechat()) { // only wechat support custom ad
                this._adCustom = null;
                console.log('Only wechat support Custom Ad');
                return;
            }
            this.destroy();
            // 原生模板5个应用宽度为375，若设置了缩放比例，则宽度也需要设置
            // let width = 375 * this._scale;
            // let newLeft = (sys.windowWidth - width) / 2;
            // let newTop = sys.windowHeight / 2; // 120是预估高度
            // @ts-ignore
            this._adCustom = wx.createCustomAd({
                adUnitId: this._adUid,
                //@ts-ignore
                style: { left: left, top: top, fixed: true }
            });
            (_a = this._adCustom) === null || _a === void 0 ? void 0 : _a.onError(function (err) {
                console.log('ad custom error:', err);
            });
        };
        ADCustom.prototype.show = function () {
            var _a;
            (_a = this._adCustom) === null || _a === void 0 ? void 0 : _a.show();
        };
        ADCustom.prototype.hide = function () {
            var _a;
            (_a = this._adCustom) === null || _a === void 0 ? void 0 : _a.hide();
        };
        ADCustom.prototype.destroy = function () {
            var _a;
            (_a = this._adCustom) === null || _a === void 0 ? void 0 : _a.destroy();
        };
        return ADCustom;
    }());
    /**
     * 视频广告用户点击行为结果
     */
    var EAdVideoResult;
    (function (EAdVideoResult) {
        /**
         * 用户看完了广告，游戏可发放奖励。
         */
        EAdVideoResult[EAdVideoResult["ACCEPT"] = 0] = "ACCEPT";
        /**
         * 用户中途关闭了广告，即未看完状态。不可发放奖励。
         */
        EAdVideoResult[EAdVideoResult["REJECT"] = 1] = "REJECT";
        /**
         * 广告组件内部发生了错误。不可发放奖励。
         */
        EAdVideoResult[EAdVideoResult["ERROR"] = 2] = "ERROR";
    })(EAdVideoResult = MiniGameSdk.EAdVideoResult || (MiniGameSdk.EAdVideoResult = {}));
    var ADVideo = /** @class */ (function () {
        function ADVideo(adUid) {
            this._adVideo = null;
            this._adUid = adUid;
        }
        Object.defineProperty(ADVideo.prototype, "aduid", {
            get: function () {
                return this._adUid;
            },
            enumerable: false,
            configurable: true
        });
        /**
         * 由于微信和抖音视频广告机制不同，微信可以看的视频广告个数只有0和1个，抖音平台则可以看0~maxVideoCount
         * @param onResult 两个参数：第一个res是EAdVideoResult定义，第二count是用户看了多少个视频广告。
         * @param target onResult的拥有者
         * @param maxVideoCount 可以连续看最大视频个数，可最大化商业效率。默认为3个。
         * @returns
         */
        ADVideo.prototype.show = function (onResult, target, maxVideoCount) {
            var _this = this;
            var _a, _b, _c, _d, _e;
            if (maxVideoCount === void 0) { maxVideoCount = 3; }
            var callback = function (state, count) {
                onResult === null || onResult === void 0 ? void 0 : onResult.call(target, state, count);
            };
            if (!isWechat() && !isBytedance()) {
                callback(EAdVideoResult.ACCEPT, 1);
                this._adVideo = null;
                return;
            }
            var onAdVideoClosed = function (res) {
                var _a;
                (_a = _this._adVideo) === null || _a === void 0 ? void 0 : _a.offClose(onAdVideoClosed);
                if (isWechat()) {
                    if (res && res.isEnded || res === undefined) {
                        callback(EAdVideoResult.ACCEPT, 1);
                    }
                    else {
                        callback(EAdVideoResult.REJECT, 0);
                    }
                }
                else if (isBytedance()) {
                    var resConverted = res;
                    if (resConverted && resConverted.count > 0) {
                        callback(EAdVideoResult.ACCEPT, resConverted.count);
                    }
                    else {
                        callback(EAdVideoResult.REJECT, 0);
                    }
                }
            };
            (_a = this._adVideo) === null || _a === void 0 ? void 0 : _a.offClose(onAdVideoClosed);
            if (isWechat()) {
                // @ts-ignore
                this._adVideo = wx.createRewardedVideoAd({
                    adUnitId: this._adUid
                });
            }
            else if (isBytedance()) {
                // @ts-ignore
                this._adVideo = tt.createRewardedVideoAd({
                    adUnitId: this._adUid,
                    multiton: true,
                    multitonRewardMsg: ['多1次奖励', '再多一次奖励', '再多一次奖励'],
                    multitonRewardTimes: maxVideoCount,
                });
            }
            else {
                this._adVideo = null;
            }
            (_b = this._adVideo) === null || _b === void 0 ? void 0 : _b.onLoad(function () {
                console.log('Ad load success');
            });
            (_c = this._adVideo) === null || _c === void 0 ? void 0 : _c.onError(function (err) {
                console.log('Ad video error:', err);
                callback(EAdVideoResult.ERROR, 0);
            });
            (_d = this._adVideo) === null || _d === void 0 ? void 0 : _d.onClose(onAdVideoClosed);
            (_e = this._adVideo) === null || _e === void 0 ? void 0 : _e.show().catch(function () {
                var _a;
                (_a = _this._adVideo) === null || _a === void 0 ? void 0 : _a.load().then(function () { var _a; return (_a = _this._adVideo) === null || _a === void 0 ? void 0 : _a.show(); }).catch(function (err) {
                    console.log('Catch video ad error:', err);
                    callback(EAdVideoResult.ERROR, 0);
                });
            });
        };
        ADVideo.prototype.destory = function () {
            var _a;
            (_a = this._adVideo) === null || _a === void 0 ? void 0 : _a.destory();
        };
        return ADVideo;
    }());
    var EAdBannerLocation;
    (function (EAdBannerLocation) {
        /**
         * 屏幕顶部
         */
        EAdBannerLocation[EAdBannerLocation["TOP"] = 0] = "TOP";
        /**
         * 屏幕底部
         */
        EAdBannerLocation[EAdBannerLocation["BOTTOM"] = 1] = "BOTTOM";
    })(EAdBannerLocation = MiniGameSdk.EAdBannerLocation || (MiniGameSdk.EAdBannerLocation = {}));
    var AdvertManager = /** @class */ (function () {
        function AdvertManager() {
            this._customs = {};
        }
        Object.defineProperty(AdvertManager, "instance", {
            get: function () {
                if (!AdvertManager._instance) {
                    AdvertManager._instance = new AdvertManager();
                }
                return AdvertManager._instance;
            },
            enumerable: false,
            configurable: true
        });
        /**
         * 预加载横幅广告，不会显示。只有你在调用showBanner时才会显示。
         * 可重复调用，但是会销毁上一次的实例。一般情况，全局有一个就行了，太多占用内存，而且没必要。
         * @param adUid 广告UID
         * @param location 位置有两种情况：1、可以传入枚举值，默认上方; 2、可以自定义位置传入IPosition，注意IPosition中的top和left跟平台的top,left是一致（没有乘以设备像素比ratio），需要开发者自己调试位置
         * @param scale 默认为跟屏幕一样的宽度，可以通过设置缩放比例来调整大小。当然，平台有规定最大或最小宽度，函数内部会自动计算。
         */
        AdvertManager.prototype.loadBanner = function (adUid, location, scale) {
            var _a;
            if (location === void 0) { location = EAdBannerLocation.TOP; }
            if (scale === void 0) { scale = 1.0; }
            (_a = this._banner) === null || _a === void 0 ? void 0 : _a.destroy();
            var size = getSysWinSize();
            // 当 style.width 小于 300 时，会取作 300。 当 style.width 大于屏幕宽度时，会取作屏幕宽度。
            var width = size.width * scale;
            width = width < 300 ? 300 : width; // 最小值矫正
            width = width > size.width ? size.width : width; //最大值矫正
            this._banner = typeof location === 'number' ? new ADBanner(adUid, location === EAdBannerLocation.TOP, width, false) : new ADBanner(adUid, location, width, false);
        };
        /**
         * 显示横幅广告
         */
        AdvertManager.prototype.showBanner = function () {
            if (this._banner) {
                this._banner.show();
            }
            else {
                console.warn('MiniGameSDK: banner is null, you must call loadBanner(...) first!');
            }
        };
        /**
         * 隐藏横幅广告
         */
        AdvertManager.prototype.hideBanner = function () {
            var _a;
            (_a = this._banner) === null || _a === void 0 ? void 0 : _a.hide();
        };
        /**
         * 弹出插屏广告
         * @param adUid 广告单元id
         */
        AdvertManager.prototype.showInterstitial = function (adUid) {
            var _a;
            if (this._interstitial && this._interstitial.aduid === adUid) {
                this._interstitial.show();
            }
            else {
                (_a = this._interstitial) === null || _a === void 0 ? void 0 : _a.destory();
                this._interstitial = new ADInterstitial(adUid);
                this._interstitial.show();
            }
        };
        /**
         * 加载原生模板广告，不会显示。只有你在调用showCustom时才会显示。
         * 由于原生模板广告在微信服务后端可以定制宽度大小，个数，缩放比例等，所以位置调整要根据设置的宽度来定。抖音不支持本函数，会调用无效！
         * @param adUid 广告ID
         * @param location 位置有两种情况：1、可以传入枚举值，默认上方; 2、可以自定义位置传入IPosition，注意IPosition中的top和left跟平台的top,left是一致（没有乘以设备像素比ratio），需要开发者自己调试位置
         * @param scale 缩放比例，默认是1，即不缩放。这个缩放并不是自己填，而是根据微信MP后台你配置的原生模板广告的缩放比例填，目前有100%，90%，80%三种，一般情况不用修改。若有后台修改，记得传入值，例如90%就传入0.9。
         */
        AdvertManager.prototype.loadCustom = function (adUid, location, scale) {
            if (location === void 0) { location = { top: 0, left: 0 }; }
            if (scale === void 0) { scale = 1; }
            // this._custom?.destroy();
            // this._custom = new ADCustom(adUid, location.top, location.left, scale);
            if (this._customs[adUid]) {
                console.log(adUid + " has been loaded.");
                return;
            }
            this._customs[adUid] = new ADCustom(adUid, location.top, location.left, scale);
        };
        /**
         * 显示自定义广告。
         * @param adUid 广告的唯一标识符。使用此标识符来查找和显示特定的自定义广告。
         *
         * 此方法尝试根据提供的adUid显示一个自定义广告。如果给定的adUid对应的自定义广告已加载，
         * 则调用该广告的显示方法。如果广告未加载，则在控制台输出警告信息。
         */
        AdvertManager.prototype.showCustom = function (adUid) {
            if (this._customs[adUid]) {
                this._customs[adUid].show();
            }
            else {
                console.warn("You have not load " + adUid + " of Custom AD, can not show!");
            }
        };
        /**
         * 隐藏指定的自定义广告单元
         *
         * 此方法用于隐藏通过广告单元标识符（adUid）指定的自定义广告。如果指定的广告单元已加载并显示，
         * 则将其隐藏；如果广告单元未加载，则在控制台输出警告信息。
         *
         * @param adUid 广告单元标识符，用于唯一标识一个自定义广告单元。
         */
        AdvertManager.prototype.hideCustom = function (adUid) {
            if (this._customs[adUid]) {
                this._customs[adUid].hide();
            }
            else {
                console.warn("You have not load " + adUid + " of Custom AD, can not hide!");
            }
        };
        /**
         * 由于微信和抖音视频广告机制不同，微信可以看的视频广告个数只有0和1个，抖音平台则可以看0~maxVideoCount
         * @param adUid 广告ID。如果与上一次UID不同，则内部会重新创建实例。开发者完全不用关心这个细节。
         * @param onVideoResult 两个参数：第一个res是EAdVideoResult定义，第二count是用户看了多少个视频广告。
         * @param target onVideoResult的拥有者
         * @param maxVideoCount 最大视频个数。默认是3，仅对抖音平台生效。微信平台看完视频count的结果永远是1或0
         */
        AdvertManager.prototype.showVideo = function (adUid, onVideoResult, target, maxVideoCount) {
            var _a;
            if (maxVideoCount === void 0) { maxVideoCount = 3; }
            if (this._video && this._video.aduid === adUid) {
                this._video.show(onVideoResult, target, maxVideoCount);
            }
            else {
                (_a = this._video) === null || _a === void 0 ? void 0 : _a.destory();
                this._video = new ADVideo(adUid);
                this._video.show(onVideoResult, target, maxVideoCount);
            }
        };
        /**
         * 销毁内部所有实例，清空内存
         */
        AdvertManager.prototype.destroyAll = function () {
            var _a, _b, _c, _d;
            (_a = this._banner) === null || _a === void 0 ? void 0 : _a.destroy();
            this._banner = null;
            (_b = this._interstitial) === null || _b === void 0 ? void 0 : _b.destory();
            this._interstitial = null;
            (_c = this._video) === null || _c === void 0 ? void 0 : _c.destory();
            this._video = null;
            if (this._customs) {
                for (var val in this._customs) {
                    (_d = this._customs[val]) === null || _d === void 0 ? void 0 : _d.destroy();
                }
                this._customs = {};
            }
        };
        return AdvertManager;
    }());
    MiniGameSdk.AdvertManager = AdvertManager;
    var EGameClubIcon;
    (function (EGameClubIcon) {
        /** 绿色图标 */
        EGameClubIcon["GREEN"] = "green";
        /** 红色图标 */
        EGameClubIcon["WHITE"] = "white";
        /** 有黑色圆角背景的白色图标 */
        EGameClubIcon["DARK"] = "dark";
        /** 有白色圆角背景的绿色图标 */
        EGameClubIcon["LIGHT"] = "light";
    })(EGameClubIcon = MiniGameSdk.EGameClubIcon || (MiniGameSdk.EGameClubIcon = {}));
    var GameClub = /** @class */ (function () {
        function GameClub() {
        }
        Object.defineProperty(GameClub, "instance", {
            get: function () {
                if (!this._instance) {
                    this._instance = new GameClub();
                }
                return this._instance;
            },
            enumerable: false,
            configurable: true
        });
        /**
         * 创建游戏圈按钮
         * @param icon
         * @param position
         * @param size
         * @param openLink
         */
        GameClub.prototype.create = function (icon, position, size, openLink) {
            if (icon === void 0) { icon = EGameClubIcon.GREEN; }
            if (position === void 0) { position = { top: 0, left: 0 }; }
            if (size === void 0) { size = { width: 40, height: 40 }; }
            if (isWechat()) {
                // @ts-ignore
                this._club = wx.createGameClubButton({
                    icon: icon,
                    style: {
                        left: position.left,
                        top: position.top,
                        width: size.width,
                        height: size.height
                    },
                    openlink: openLink
                });
            }
        };
        GameClub.prototype.show = function () {
            var _a;
            (_a = this._club) === null || _a === void 0 ? void 0 : _a.show();
        };
        GameClub.prototype.hide = function () {
            var _a;
            (_a = this._club) === null || _a === void 0 ? void 0 : _a.hide();
        };
        GameClub.prototype.destory = function () {
            var _a;
            (_a = this._club) === null || _a === void 0 ? void 0 : _a.destroy();
        };
        return GameClub;
    }());
    MiniGameSdk.GameClub = GameClub;
    /**
     * 振动类型
     */
    var EVirbrateType;
    (function (EVirbrateType) {
        /**
         * 短振动
         */
        EVirbrateType[EVirbrateType["SHORT"] = 0] = "SHORT";
        /**
         * 长振动
         */
        EVirbrateType[EVirbrateType["LONG"] = 1] = "LONG";
    })(EVirbrateType = MiniGameSdk.EVirbrateType || (MiniGameSdk.EVirbrateType = {}));
    /**
 * 抖音侧边栏专属接口
 */
    var BytedanceSidebar = /** @class */ (function () {
        function BytedanceSidebar() {
        }
        /**
         * 本游戏在抖音环境下启动监控，需要放在全局环境中，保证能第一时间启动。因为可能监听抖音失败（抖音小游戏官方的说明）！
         * @param onResult 包含一个boolean参数的函数
         * @param target 上述函数的拥有者，如果是类的成员函数，需要传入this。普通或匿名函数忽略即可。
         */
        BytedanceSidebar.listenFromSidebar = function (onResult, target) {
            if (!isBytedance()) {
                onResult === null || onResult === void 0 ? void 0 : onResult.call(target, false);
                return;
            }
            // @ts-ignore
            tt.onShow(function (res) {
                console.log('onShow launch res:', res);
                if (res.scene === '021036') {
                    onResult === null || onResult === void 0 ? void 0 : onResult.call(target, true);
                    console.log('launch from sidebar');
                }
                else {
                    onResult === null || onResult === void 0 ? void 0 : onResult.call(target, false);
                    console.log('NOT launch from douyin sidebar!');
                }
            });
            // @ts-ignore
            var options = tt.getLaunchOptionsSync();
            if (options && options.scene === '021036') {
                onResult === null || onResult === void 0 ? void 0 : onResult.call(target, true);
            }
        };
        /**
         * 检测抖音侧边栏是否存在
         * @param onResult 包含一个boolean参数的函数
         * @param target 上述函数的拥有者，如果是类的成员函数，需要传入this。普通或匿名函数忽略即可。
         * @returns
         */
        BytedanceSidebar.checkSideBar = function (onResult, target) {
            if (!isBytedance()) {
                onResult === null || onResult === void 0 ? void 0 : onResult.call(target, false);
                return;
            }
            //@ts-ignore
            tt.checkScene({
                scene: "sidebar",
                success: function (res) {
                    console.log("check scene success: ", res.isExist);
                    onResult === null || onResult === void 0 ? void 0 : onResult.call(target, res.isExist);
                },
                fail: function (res) {
                    console.log("check scene fail:", res);
                    onResult === null || onResult === void 0 ? void 0 : onResult.call(target, false);
                }
            });
        };
        /**
         * 跳转到抖音侧边栏
         * @param onResult 包含一个boolean参数的函数
         * @param target 上述函数的拥有者，如果是类的成员函数，需要传入this。普通或匿名函数忽略即可。
         * @returns
         */
        BytedanceSidebar.navigateToSidebar = function (onResult, target) {
            if (!isBytedance()) {
                console.log("not douyin platform!");
                onResult === null || onResult === void 0 ? void 0 : onResult.call(target, false);
                return;
            }
            // @ts-ignore
            tt.navigateToScene({
                scene: "sidebar",
                success: function () {
                    console.log("navigate success");
                    onResult === null || onResult === void 0 ? void 0 : onResult.call(target, true);
                },
                fail: function (res) {
                    console.log("navigate failed reason:", res);
                    onResult === null || onResult === void 0 ? void 0 : onResult.call(target, false);
                },
            });
        };
        return BytedanceSidebar;
    }());
    MiniGameSdk.BytedanceSidebar = BytedanceSidebar;
    /**
     * 平台常用API合集
     */
    var API = /** @class */ (function () {
        function API() {
        }
        /**
         * 分享app给朋友，微信小游戏分享是没有onSuccess回调的。
         * @param title 标题
         * @param description 细节描述信息
         * @param imageUrl 图片地址
         * @param query 查询信息
         * @param onSuccess 抖音会回调，微信不会回调
         */
        API.shareAppToFriends = function (title, description, imageUrl, query, onSuccess) {
            if (description === void 0) { description = ''; }
            if (isWechat()) {
                try {
                    //@ts-ignore
                    wx.shareAppMessage({
                        title: title,
                        imageUrl: imageUrl,
                        query: query,
                    });
                }
                catch (err) {
                    console.log("share faild: " + err);
                }
            }
            if (isBytedance()) {
                //@ts-ignore
                tt.shareAppMessage({
                    title: title,
                    desc: description,
                    imageUrl: imageUrl !== null && imageUrl !== void 0 ? imageUrl : '',
                    query: query !== null && query !== void 0 ? query : '',
                    success: function (res) {
                        console.log('share success:', res);
                        onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
                    },
                    fail: function (res) {
                        console.log('share fail:', res);
                    }
                });
            }
        };
        /**
         * 显示提示信息
         * @param title 标题
         * @param duration 时长（单位：秒）
         * @returns
         */
        API.showToast = function (title, duration) {
            if (duration === void 0) { duration = 2; }
            if (isWechat()) {
                // @ts-ignore
                wx.showToast({
                    title: title,
                    icon: 'none',
                    duration: duration * 500
                });
            }
        };
        /**
         * 设备震动效果，默认为短震动。注意：可能一些机型不会生效，具体看平台方的说明
         * @param type MiniGameSdk.API.EVirbrateType
         */
        API.vibrate = function (type) {
            if (type === void 0) { type = EVirbrateType.SHORT; }
            if (isWechat()) {
                switch (type) {
                    case EVirbrateType.SHORT:
                        //@ts-ignore
                        wx.vibrateShort({
                            success: function (res) {
                                console.log('vibrate success:', res);
                            },
                            fail: function (res) {
                                console.log('vibrateShort failed', res);
                            },
                        });
                        break;
                    case EVirbrateType.LONG:
                        //@ts-ignore
                        wx.vibrateLong({
                            success: function (res) {
                                console.log('vibrate success', res);
                            },
                            fail: function (res) {
                                console.log("vibrateLong failed", res);
                            },
                        });
                        break;
                    default:
                        break;
                }
            }
            if (isBytedance()) {
                switch (type) {
                    case EVirbrateType.SHORT:
                        //@ts-ignore
                        tt.vibrateShort({
                            success: function (res) {
                                console.log('vibrate success:', res);
                            },
                            fail: function (res) {
                                console.log('vibrateShort failed', res);
                            },
                        });
                        break;
                    case EVirbrateType.LONG:
                        //@ts-ignore
                        tt.vibrateLong({
                            success: function (res) {
                                console.log('vibrate success', res);
                            },
                            fail: function (res) {
                                console.log("vibrateLong failed", res);
                            },
                        });
                        break;
                    default:
                        break;
                }
            }
        };
        /**
         * 重启小游戏
         */
        API.reboot = function () {
            if (isWechat()) {
                //@ts-ignore
                wx.restartMiniProgram({
                    success: function () {
                        console.log('restart success');
                    },
                    fail: function () {
                        console.log('restart failed');
                    }
                });
            }
            if (isBytedance()) {
                try {
                    // @ts-ignore
                    tt.restartMiniProgramSync();
                }
                catch (error) {
                    console.log("restartMiniProgramSync", error);
                }
            }
        };
        /**
         * 退出小游戏
         */
        API.exit = function () {
            if (isWechat()) {
                //@ts-ignore
                wx.exitMiniProgram({
                    success: function () {
                        console.log('exit success');
                    },
                    fail: function () {
                        console.log('exit failed');
                    }
                });
            }
            if (isBytedance()) {
                // @ts-ignore
                tt.exitMiniProgram({
                    success: function (res) {
                        console.log("exit success:", res === null || res === void 0 ? void 0 : res.data);
                    },
                    fail: function (res) {
                        console.log("exit fail:", res === null || res === void 0 ? void 0 : res.errMsg);
                    },
                });
            }
        };
        /**
         * 显示转发按钮。通常在刚进入游戏的时候调用。
         * 主要是打开平台“...”这个按钮里面的分享菜单，一般默认是关闭的，需要调用这个函数打开。可以让用户分享你的游戏入口。
         */
        API.showShareMenu = function () {
            if (isWechat()) {
                //@ts-ignore
                wx.showShareMenu({
                    withShareTicket: true,
                    menus: ['shareAppMessage', 'shareTimeline'],
                    success: function () { },
                    fail: function () { },
                    complete: function () { }
                });
            }
        };
        /**
         * 微信小游戏：跳转到另外一款小游戏
         * 抖音小游戏：跳转到指定的视频界面
         * @param targetId 微信小游戏appid或者视频界面
         */
        API.navigateTo = function (targetId, onSuccess) {
            if (isWechat()) {
                // @ts-ignore
                wx.navigateToMiniProgram({
                    appId: targetId,
                    extraData: {
                        foo: 'bar'
                    },
                    envVersion: 'develop',
                    success: function (res) {
                        onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
                    }
                });
            }
            if (isBytedance()) {
                // @ts-ignore
                tt.navigateToVideoView({
                    videoId: targetId,
                    success: function (res) {
                        onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
                    },
                    fail: function (err) {
                        console.log("bytedance navigateToVideoView fail", err);
                    },
                });
            }
        };
        /**
         * 小游戏平台登录功能。微信返回code，抖音返回code和anonymousCode。用于登录的凭证，需要把这个code传回你的服务器程序中去调用code2Session
         * @param callback (code, anonymousCode) 第一个参数为code，微信和抖音都支持；第二个参数为匿名设备ID，仅抖音支持，失败都返回null
         */
        API.login = function (callback) {
            var loginPlatform = function () {
                if (isWechat()) {
                    //@ts-ignore
                    wx.login({
                        success: function (res) {
                            if (res.code) {
                                API._loginCode = res.code;
                                API._loginAnonymousCode = null;
                                callback === null || callback === void 0 ? void 0 : callback(API._loginCode, API._loginAnonymousCode);
                            }
                            else {
                                console.log('login error:', res.errMsg);
                            }
                        },
                        fail: function () {
                            API._loginCode = null;
                            API._loginAnonymousCode = null;
                            callback === null || callback === void 0 ? void 0 : callback(API._loginCode, API._loginAnonymousCode);
                            console.log('login fail');
                        }
                    });
                }
                else if (isBytedance()) {
                    //@ts-ignore
                    tt.login({
                        force: true,
                        success: function (res) {
                            var _a, _b;
                            console.log("login " + res.code + " " + res.anonymousCode);
                            if (res.code) {
                                API._loginCode = (_a = res.code) === null || _a === void 0 ? void 0 : _a.toString();
                                API._loginAnonymousCode = (_b = res.anonymousCode) === null || _b === void 0 ? void 0 : _b.toString();
                                callback === null || callback === void 0 ? void 0 : callback(API._loginCode, API._loginAnonymousCode);
                            }
                            else {
                                console.log('login error:', res.errMsg);
                            }
                        },
                        fail: function (res) {
                            API._loginCode = null;
                            API._loginAnonymousCode = null;
                            callback === null || callback === void 0 ? void 0 : callback(API._loginCode, API._loginAnonymousCode);
                            console.log("login fail", res);
                        },
                    });
                }
                else {
                    API._loginCode = null;
                    API._loginAnonymousCode = null;
                    callback === null || callback === void 0 ? void 0 : callback(API._loginCode, API._loginAnonymousCode);
                    console.log('not mini game platform, login codes are all null');
                }
            };
            if (!API._loginCode) {
                loginPlatform();
            }
            else {
                if (isWechat()) {
                    //@ts-ignore
                    wx.checkSession({
                        success: function () {
                            console.log("session is valid, use current code:", API._loginCode);
                            callback === null || callback === void 0 ? void 0 : callback(API._loginCode, API._loginAnonymousCode);
                        },
                        fail: function () {
                            console.log("session expired");
                            loginPlatform();
                        }
                    });
                }
                else if (isBytedance()) {
                    //@ts-ignore
                    tt.checkSession({
                        success: function () {
                            console.log("session is valid, user current code: " + API._loginCode + ", " + API._loginAnonymousCode);
                            callback === null || callback === void 0 ? void 0 : callback(API._loginCode, API._loginAnonymousCode);
                        },
                        fail: function () {
                            console.log("session expired");
                            loginPlatform();
                        },
                    });
                }
                else {
                    console.log('not mini game platform, login null');
                    callback === null || callback === void 0 ? void 0 : callback(null, null);
                }
            }
        };
        /**
 * 小游戏平台登录功能。微信返回code，抖音返回code和anonymousCode。用于登录的凭证，需要把这个code传回你的服务器程序中去调用code2Session
 * @param callback (code, anonymousCode) 第一个参数为code，微信和抖音都支持；第二个参数为匿名设备ID，仅抖音支持，失败都返回null
 */
        API.getUserInfo = function (callback) {
            //@ts-ignore
            tt.getUserInfo({
                withCredentials: true,
                success: function (res) {
                    API._userInfo = res;
                    callback(API._userInfo);
                },
                fail: function (err) {
                    callback(err);
                }
            });
        };
        /**
         * 调用微信云函数。由于参数需要自定义，所以为any，需要自行解释。函数只完成通道和处理一场的作用
         * @param callback 返回云函数调用结果。需要检查返回参数是否为空，失败的时候为空
         * @param name 云函数的名字
         * @param data 云函数的内容
         */
        API.callWechatCloudFunction = function (callback, name, data) {
            if (!isWechat()) {
                console.log('Not wechat platform, not support callWechatCloudFunction');
                return;
            }
            this.login(function (code, anonymousCode) {
                if (!API._hasInitWechatCloudFunction) {
                    //@ts-ignore
                    wx.cloud.init();
                    API._hasInitWechatCloudFunction = true;
                }
                //@ts-ignore
                wx.cloud.callFunction({
                    name: name,
                    data: data,
                    success: function (res) { return callback === null || callback === void 0 ? void 0 : callback(res); },
                    fail: function (err) {
                        console.log('wechat cloud function error:', err);
                        callback === null || callback === void 0 ? void 0 : callback(null);
                    }
                });
            });
        };
        /**
         * 存储用户信息，数据量不能大。可以考虑用于分数排行榜。用户之间可共享排行数据。
         * @param key
         * @param value
         */
        API.setUserCloudStorage = function (key, value) {
            if (isWechat()) {
                // @ts-ignore
                wx.setUserCloudStorage({
                    KVDataList: [{ key: key, value: value }],
                    success: function () { return console.log("set cloud storage success:" + key + ", value:" + value); },
                    fail: function (err) { return console.log('set cloud storage error:', err); }
                });
            }
            if (isBytedance()) {
                // @ts-ignore
                tt.setUserCloudStorage({
                    KVDataList: [{ key: key, value: value, }],
                    success: function () { return console.log("set cloud storage success:" + key + ", value:" + value); },
                    fail: function (err) { return console.log('set cloud storage error:', err); }
                });
            }
        };
        /*
        * 数数平台初始化以及登录
        */
        API.shushu_Init = function () {
            if (typeof wx !== 'undefined' && wx !== null) {
                console.log("开始接入数数平台");
                //getWechatGameVersion
                var appId = "121591378fc1423893deb12041413eb3";
                var test = cc.fx.GameTool.getWechatGameVersion();
                if (test == "正式版") {
                    appId = "87d18958cea145f29d3265470ecd3486";
                }
                var config = {
                    // appId: "73e1ec654f15b47a1a7354fbabec05ad", // 项目 APP ID
                    appId: appId,
                    serverUrl: "https://data.nika4fun.com",
                    autoTrack: {
                        appShow: true,
                        appHide: true // 自动采集 ta_mg_hide
                    }
                };
                // 创建 TA 实例
                API._ta = new ThinkingAnalyticsAPI(config);
                //var deviceId = API._ta.getDeviceId();
                API._ta.login(cc.fx.GameConfig.GM_INFO.openid);
                var result = "success";
                API.shushu_Track("login", result);
                // 初始化
                API._ta.init();
                API.shushu_SetSuperProperties();
                //console.log("数数平台初始化成功!");
                // this.TA.clearSuperProperties();
                //设置用户属性
                // this.TA.userSet({ username: "大核桃" });
            }
        };
        API.shushu_userSet = function (time) {
            if (typeof wx !== 'undefined' && wx !== null) {
                console.log("设置用户注册属性");
                API._ta.userSet({ register_time: time });
            }
        };
        /*
        * 数数平台设置动态公共属性
        */
        API.shushu_SetSuperProperties = function () {
            if (typeof wx !== 'undefined' && wx !== null && API._ta) {
                var versionData = "1.3";
                // API._ta.userSetOnce({ register_time:time});
                var superProperties = {
                    current_level: (cc.fx.GameConfig.GM_INFO.level + 1),
                    current_health: cc.fx.GameConfig.GM_INFO.hp,
                    tmp_coin: cc.fx.GameConfig.GM_INFO.coin,
                    version: versionData
                };
                API._ta.setSuperProperties(superProperties); //设置公共事件属性
            }
        };
        API.getWechatGameVersion = function () {
            if (typeof wx !== 'undefined' && wx !== null) {
                // @ts-ignore
                var accountInfo = wx.getAccountInfoSync();
                return accountInfo.miniProgram.version;
            }
        };
        /*
        * 数数平台具体埋点
        */
        API.shushu_Track = function (name, data, callback) {
            if (typeof wx !== 'undefined' && wx !== null) {
                if (API._ta) {
                    // 假设 track 方法返回一个 Promise
                    API._ta.track(name, // 事件名称
                    data // 事件属性 
                    );
                }
            }
        };
        API._loginCode = null;
        API._loginAnonymousCode = null;
        API._hasInitWechatCloudFunction = false;
        API._userInfo = null;
        API._ta = null;
        return API;
    }());
    MiniGameSdk.API = API;
})(MiniGameSdk = exports.MiniGameSdk || (exports.MiniGameSdk = {}));

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 96560 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/module/GameStart/GameAppStart.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '61d4ccY2ztLMYIh8WvqPPAw', 'GameAppStart');
// Script/module/GameStart/GameAppStart.ts

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Storage_1 = require("../Storage/Storage");
var GameConfig_1 = require("../Config/GameConfig");
var HttpUtil_1 = require("../Crypto/HttpUtil");
var AudioManager_1 = require("../Music/AudioManager");
var Notification_1 = require("../Notification/Notification");
var GameTool_1 = require("../Tool/GameTool");
window.initMgr = function () {
    if (cc.fx) {
        return;
    }
    cc.fx = {};
    // console.log("1初始化");
    //基础状态信息
    cc.fx.StateInfo = {
        debugMode: true,
        networkConnected: true,
        networkType: 'none',
        isOnForeground: true //当前是否是在前台
    };
    //应用系统信息
    //配置文件
    cc.fx.StorageMessage = Storage_1.StorageMessage;
    cc.fx.AudioManager = AudioManager_1.default;
    cc.fx.GameConfig = GameConfig_1.GameConfig;
    cc.fx.HttpUtil = HttpUtil_1.default;
    cc.fx.GameTool = GameTool_1.GameTool;
    cc.fx.Notifications = Notification_1.Notifications;
    cc.fx.ShareInfo = {
        queryId: -1 //分享id
    };
    cc.fx.Message = {
        control: "10001",
        startGame: "10002",
        next: "10003",
        changePath: "10004",
        changeMap: "10005",
        nextWater: "10006",
        addEnd: "10007",
        setData: "10008",
        guideNext: "10009",
        showResult: "10010",
        removeTip: "10011" //执行撤回或者后退动作，移除提示
    };
    /*
        * 客户端埋点分享类型
    */
    cc.fx.BurialShareType = {
        Default: "default",
        Invite: "invite",
        DailyInviteRoomJoin: 'invite_join_room',
        DailyInviteFriend: 'invite_friend',
        DailyInviteGroup: 'invate_group',
        DailyInviteGroupAlive: 'invate_alive',
        DailyInviteGroupReward: 'invate_rewared',
        DailyInviteGroupBox: 'invate_box',
        DailyInviteGroupBall: 'invate_ball',
        MatchResult: 'matchResult',
        MatchFix5: 'MatchFix5',
        MatchFix20: 'MatchFix20',
        MatchFix100: 'MatchFix100',
        MatchFix500: 'MatchFix500',
        NewerRedEnvelope: 'newerRedEnvelope',
        CoinRoomResult: 'coinRoomResult',
        HighRate: "highRate",
        CoinRoomWinStreak: 'coinRoomWinStreak',
        CoinRoomBankruptcy1: 'coinRoomBankruptcy1',
        CoinRoomBankruptcy2: 'coinRoomBankruptcy2',
        CoinRoomBankruptcy3: 'coinRoomBankruptcy3',
    };
    /*
     * 分享到哪儿给奖励 group frined all
     */
    cc.fx.ShareWhereReward = {
        Group: "group",
        Friend: "friend",
        All: "all",
    };
    //用于存储消息的ID
    cc.fx.storageType = cc.Enum({
        storageTypeCustom: 1000101,
    });
    //用于存储提示语  按照步骤提示
    cc.fx.tipType = cc.Enum({
        tipOne: '神农氏回到家中，开始整理今天收集来的物品。当他第一次拿出或说出一种植物时，请告诉他这是新植物。',
        tipTwo: '如果他拿出或说出的植物你今天看到过，请告诉他上次是看到的；如果你听他说过，则请告诉他上次是听到的。',
        tipErrNew: '这是这局游戏第一次出现{植物}',
        tipErrOld: '{植物}刚才出现过呢',
        tipErrHear: '上次遇到{植物}时，似乎不是听到的吧',
        tipErrSee: '上次遇到{植物}时，似乎不是看到的吧',
        tipErrLast: '之前确实看到过{植物}，但最近一次似乎不是看到的呢',
    });
};

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 9300 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/lq_base/data/lq_interface.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '41e45V6/vBNz5ftgHCoFmei', 'lq_interface');
// Script/lq_base/data/lq_interface.ts

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcU2NyaXB0XFxscV9iYXNlXFxkYXRhXFxscV9pbnRlcmZhY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiIiLCJzb3VyY2VSb290IjoiLyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBWZWMyID0gY2MuVmVjMjtcclxuXHJcbmV4cG9ydCBpbnRlcmZhY2UgSVBvcyB7XHJcbiAgICB4OiBudW1iZXI7XHJcbiAgICB5OiBudW1iZXI7XHJcblxyXG4gICAgc3ViKHBvczogSVBvcyk6IFZlYzI7XHJcblxyXG4gICAgYWRkKHBvczogSVBvcyk6IFZlYzI7XHJcbn1cclxuXHJcbmV4cG9ydCBpbnRlcmZhY2UgSVJlY3Qge1xyXG4gICAgeDogbnVtYmVyO1xyXG4gICAgeTogbnVtYmVyO1xyXG4gICAgd2lkdGg6IG51bWJlcjtcclxuICAgIGhlaWdodDogbnVtYmVyO1xyXG4gICAgaGFsZl93aWR0aDogbnVtYmVyO1xyXG4gICAgaGFsZl9oZWlnaHQ6IG51bWJlcjtcclxuXHJcbiAgICBzdWIocG9zOiBJUG9zKTogVmVjMjtcclxuXHJcbiAgICBhZGQocG9zOiBJUG9zKTogVmVjMjtcclxufSJdfQ==
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/shop/script/shop.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '48bfeZuYFZE2qmgxbW2IigB', 'shop');
// shop/script/shop.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var NewClass = /** @class */ (function (_super) {
    __extends(NewClass, _super);
    function NewClass() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        //商店界面
        _this.shop = null;
        //商品列表
        _this.itemList = null;
        return _this;
        // update (dt) {}
    }
    // onLoad () {}
    NewClass.prototype.start = function () {
        this.openShop();
    };
    //打开商店界面
    NewClass.prototype.openShop = function () {
        // 商品数据数组
        var products = [
            { product_id: "gold_pack_1", name: "金币包1", price: 600, title: "3x2六档金币" },
            { product_id: "gold_pack_2", name: "金币包2", price: 3600, title: "" },
            { product_id: "gold_pack_3", name: "金币包3", price: 6800, title: "" },
            { product_id: "gold_pack_4", name: "金币包4", price: 12800, title: "" },
            { product_id: "gold_pack_5", name: "金币包5", price: 32800, title: "" },
            { product_id: "gold_pack_6", name: "金币包6", price: 64800, title: "" },
            { product_id: "unlimited_health_bundle_1", name: "无限体力组合包1", price: 1800, title: "3个横版礼包" },
            { product_id: "unlimited_health_bundle_2", name: "无限体力组合包2", price: 6600, title: "" }
        ];
        for (var i = 1; i <= 8 && i < this.itemList.children.length; i++) {
            var spriteComp = this.itemList.children[i].children[0].getComponent(cc.Sprite);
            var price = this.itemList.children[i].children[1].getComponent(cc.Label);
            var title = this.itemList.children[i].children[2].getComponent(cc.Label);
            var product = products[i - 1];
            if (spriteComp && product) {
                // TODO: 根据 product_id 或 name 设置 spriteComp.spriteFrame
            }
            if (price && product) {
                price.string = (product.price / 100).toString() + "元";
            }
            if (title && product) {
                title.string = product.name;
            }
        }
    };
    //关闭商店界面
    NewClass.prototype.closeShop = function () {
        //销毁预制体
        this.shop.destroy();
    };
    __decorate([
        property(cc.Node)
    ], NewClass.prototype, "shop", void 0);
    __decorate([
        property(cc.Node)
    ], NewClass.prototype, "itemList", void 0);
    NewClass = __decorate([
        ccclass
    ], NewClass);
    return NewClass;
}(cc.Component));
exports.default = NewClass;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 6144 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/tiledmap-optimize-resource/Script/TmoTiledLayer.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'd60cfrGbXBLBbplLoT7TBn7', 'TmoTiledLayer');
// Script/TmoTiledLayer.js

"use strict";

exports.__esModule = true;
exports["default"] = void 0;
// Learn cc.Class:
//  - https://docs.cocos.com/creator/manual/en/scripting/class.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

var _mat4_temp = cc.mat4();
var _vec2_temp = cc.v2();
var _vec2_temp2 = cc.v2();
var _default = cc.Class({
  "extends": cc.TiledLayer,
  // 此处修改 增加firstTmxLayer参数
  _init: function _init(layerInfo, mapInfo, tilesets, textures, texGrids, tiledMap, firstTmxLayer) {
    // 修改结束
    this._cullingDirty = true;
    this._layerInfo = layerInfo;
    this._mapInfo = mapInfo;
    // 此处修改 保存firstTmxLayer参数
    this._firstTmxLayer = firstTmxLayer;
    this._tiledMap = tiledMap;
    // 修改结束

    var size = layerInfo._layerSize;

    // layerInfo
    this._layerName = layerInfo.name;
    this._tiles = layerInfo._tiles;
    this._properties = layerInfo.properties;
    this._layerSize = size;
    this._minGID = layerInfo._minGID;
    this._maxGID = layerInfo._maxGID;
    this._opacity = layerInfo._opacity;
    this._renderOrder = mapInfo.renderOrder;
    this._staggerAxis = mapInfo.getStaggerAxis();
    this._staggerIndex = mapInfo.getStaggerIndex();
    this._hexSideLength = mapInfo.getHexSideLength();
    this._animations = mapInfo.getTileAnimations();

    // tilesets
    this._tilesets = tilesets;
    // textures
    this._textures = textures;
    // grid texture
    this._texGrids = texGrids;

    // mapInfo
    this._layerOrientation = mapInfo.orientation;
    this._mapTileSize = mapInfo.getTileSize();
    var maptw = this._mapTileSize.width;
    var mapth = this._mapTileSize.height;
    var layerW = this._layerSize.width;
    var layerH = this._layerSize.height;
    if (this._layerOrientation === cc.TiledMap.Orientation.HEX) {
      // handle hex map
      var TiledMap = cc.TiledMap;
      var StaggerAxis = TiledMap.StaggerAxis;
      var StaggerIndex = TiledMap.StaggerIndex;
      var width = 0,
        height = 0;
      this._odd_even = this._staggerIndex === StaggerIndex.STAGGERINDEX_ODD ? 1 : -1;
      if (this._staggerAxis === StaggerAxis.STAGGERAXIS_X) {
        this._diffX1 = (maptw - this._hexSideLength) / 2;
        this._diffY1 = 0;
        height = mapth * (layerH + 0.5);
        width = (maptw + this._hexSideLength) * Math.floor(layerW / 2) + maptw * (layerW % 2);
      } else {
        this._diffX1 = 0;
        this._diffY1 = (mapth - this._hexSideLength) / 2;
        width = maptw * (layerW + 0.5);
        height = (mapth + this._hexSideLength) * Math.floor(layerH / 2) + mapth * (layerH % 2);
      }
      this.node.setContentSize(width, height);
    } else if (this._layerOrientation === cc.TiledMap.Orientation.ISO) {
      var wh = layerW + layerH;
      this.node.setContentSize(maptw * 0.5 * wh, mapth * 0.5 * wh);
    } else {
      this.node.setContentSize(layerW * maptw, layerH * mapth);
    }

    // offset (after layer orientation is set);
    this._offset = cc.v2(layerInfo.offset.x, -layerInfo.offset.y);
    this._useAutomaticVertexZ = false;
    this._vertexZvalue = 0;
    this._syncAnchorPoint();
    this._prepareToRender();
  },
  _updateCulling: function _updateCulling() {
    if (CC_EDITOR) {
      this.enableCulling(false);
    } else if (this._enableCulling) {
      // 此处修改 若不为首个layer 直接复用firstLayer的结果
      // this._firstTmxLayer不为空时 表示当前layer不是首个layer
      var firstTmxLayer = this._firstTmxLayer;
      if (!!firstTmxLayer) {
        this._cullingRect = firstTmxLayer._cullingRect;
        this._cullingDirty = firstTmxLayer._cacheCullingDirty;
        return;
      }
      // 修改结束

      this.node._updateWorldMatrix();
      cc.Mat4.invert(_mat4_temp, this.node._worldMatrix);
      var rect = cc.visibleRect;
      var camera = cc.Camera.findCamera(this.node);
      if (camera) {
        _vec2_temp.x = 0;
        _vec2_temp.y = 0;
        _vec2_temp2.x = _vec2_temp.x + rect.width;
        _vec2_temp2.y = _vec2_temp.y + rect.height;
        camera.getScreenToWorldPoint(_vec2_temp, _vec2_temp);
        camera.getScreenToWorldPoint(_vec2_temp2, _vec2_temp2);
        cc.Vec2.transformMat4(_vec2_temp, _vec2_temp, _mat4_temp);
        cc.Vec2.transformMat4(_vec2_temp2, _vec2_temp2, _mat4_temp);
        this._updateViewPort(_vec2_temp.x, _vec2_temp.y, _vec2_temp2.x - _vec2_temp.x, _vec2_temp2.y - _vec2_temp.y);
        // 此处修改 若为首个layer 缓存_cullingDirty。
        // _cullingDirty会在填充渲染数据后被改为false 所以需要缓存这里的结果
        if (!firstTmxLayer) {
          this._cacheCullingDirty = this._cullingDirty;
        }
        // 修改结束
      }
    }
  },
  _traverseAllGrid: function _traverseAllGrid() {
    var tiles = this._tiles;
    var texGrids = this._texGrids;
    var tilesetIndexArr = this._tilesetIndexArr;
    var tilesetIndexToArrIndex = this._tilesetIndexToArrIndex = {};
    var TiledMap = cc.TiledMap;
    var TileFlag = TiledMap.TileFlag;
    var FLIPPED_MASK = TileFlag.FLIPPED_MASK;
    var singleTexture = this._tiledMap.isSingleTexture();
    tilesetIndexArr.length = 0;
    for (var i = 0; i < tiles.length; i++) {
      var gid = tiles[i];
      if (gid === 0) continue;
      gid = (gid & FLIPPED_MASK) >>> 0;
      var grid = texGrids[gid];
      if (!grid) {
        cc.error("CCTiledLayer:_traverseAllGrid grid is null, gid is:", gid);
        continue;
      }
      var tilesetIdx = grid.texId;
      if (tilesetIndexToArrIndex[tilesetIdx] !== undefined) continue;
      tilesetIndexToArrIndex[tilesetIdx] = tilesetIndexArr.length;
      tilesetIndexArr.push(tilesetIdx);

      // 此处修改 当只有一个图集时 可以直接停止遍历
      if (singleTexture) {
        break;
      }
      // 修改结束
    }
  }
});
exports["default"] = _default;
module.exports = exports["default"];

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 19188 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/CollisionDetection.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'f1883pXzMVIp5/ARDAWfZ7j', 'CollisionDetection');
// Script/CollisionDetection.ts

"use strict";
// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, requireComponent = _a.requireComponent;
var CollisionDetection = /** @class */ (function (_super) {
    __extends(CollisionDetection, _super);
    function CollisionDetection() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    CollisionDetection_1 = CollisionDetection;
    CollisionDetection.prototype.onLoad = function () {
        if (CollisionDetection_1._instance == null) {
            CollisionDetection_1._instance = this;
            // cc.game.addPersistRootNode(this.node);
        }
        else {
            return;
        }
    };
    //碰撞检测函数
    CollisionDetection.prototype.isColliding = function (rect1, rect2) {
        // 快速排除：检查边界框是否相交
        if (rect1.xMax < rect2.xMin || rect2.xMax < rect1.xMin || rect1.yMax < rect2.yMin || rect2.yMax < rect1.yMin) {
            return { isColliding: false };
        }
        // 调用原始的 intersects 方法
        var isColliding = rect1.intersects(rect2);
        return { isColliding: isColliding };
    };
    // 获取多边形的所有边的法线
    CollisionDetection.prototype.getNormals = function (polygon) {
        var normals = [];
        var length = polygon.length;
        for (var i = 0; i < length; i++) {
            var p1 = polygon[i];
            var p2 = polygon[(i + 1) % length];
            var edge = new cc.Vec2(p2.x - p1.x, p2.y - p1.y);
            var normal = new cc.Vec2(-edge.y, edge.x);
            normal.normalize();
            normals.push(normal);
        }
        return normals;
    };
    // 将多边形投影到轴上
    CollisionDetection.prototype.project = function (polygon, axis) {
        var min = cc.Vec2.dot(polygon[0], axis);
        var max = min;
        for (var i = 1; i < polygon.length; i++) {
            var dotProduct = cc.Vec2.dot(polygon[i], axis);
            if (dotProduct < min) {
                min = dotProduct;
            }
            else if (dotProduct > max) {
                max = dotProduct;
            }
        }
        return { min: min, max: max };
    };
    // 检查两个投影是否重叠
    CollisionDetection.prototype.overlap = function (projection1, projection2) {
        return !(projection1.max < projection2.min || projection2.max < projection1.min);
    };
    var CollisionDetection_1;
    CollisionDetection = CollisionDetection_1 = __decorate([
        ccclass
    ], CollisionDetection);
    return CollisionDetection;
}(cc.Component));
exports.default = CollisionDetection;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 6784 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/animation/NewScript.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '2cd54+HgYFITpFe6QLlvqDB', 'NewScript');
// animation/NewScript.js

"use strict";

// Learn cc.Class:
//  - https://docs.cocos.com/creator/manual/en/scripting/class.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

cc.Class({
  "extends": cc.Component,
  properties: {
    sex: {
      type: cc.Enum({
        male: 0,
        female: 1
      }),
      "default": 0
    }
    // foo: {
    //     // ATTRIBUTES:
    //     default: null,        // The default value will be used only when the component attaching
    //                           // to a node for the first time
    //     type: cc.SpriteFrame, // optional, default is typeof default
    //     serializable: true,   // optional, default is true
    // },
    // bar: {
    //     get () {
    //         return this._bar;
    //     },
    //     set (value) {
    //         this._bar = value;
    //     }
    // },
  },
  // LIFE-CYCLE CALLBACKS:
  // onLoad () {},
  start: function start() {} // update (dt) {},
});

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcYW5pbWF0aW9uXFxOZXdTY3JpcHQuanMiXSwibmFtZXMiOlsiY2MiLCJDbGFzcyIsIkNvbXBvbmVudCIsInByb3BlcnRpZXMiLCJzZXgiLCJ0eXBlIiwiRW51bSIsIm1hbGUiLCJmZW1hbGUiLCJzdGFydCJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUFBLEVBQUUsQ0FBQ0MsS0FBSyxDQUFDO0VBQ0wsV0FBU0QsRUFBRSxDQUFDRSxTQUFTO0VBRXJCQyxVQUFVLEVBQUU7SUFDUkMsR0FBRyxFQUFDO01BQ0FDLElBQUksRUFBQ0wsRUFBRSxDQUFDTSxJQUFJLENBQUM7UUFDVEMsSUFBSSxFQUFDLENBQUM7UUFDTkMsTUFBTSxFQUFDO01BQ1gsQ0FBQyxDQUFDO01BQ0YsV0FBUTtJQUNaO0lBQ0E7SUFDQTtJQUNBO0lBQ0E7SUFDQTtJQUNBO0lBQ0E7SUFDQTtJQUNBO0lBQ0E7SUFDQTtJQUNBO0lBQ0E7SUFDQTtJQUNBO0VBQ0osQ0FBQztFQUVEO0VBRUE7RUFFQUMsS0FBSyxXQUFBQSxNQUFBLEVBQUksQ0FFVCxDQUFDLENBRUQ7QUFDSixDQUFDLENBQUMiLCJzb3VyY2VSb290IjoiLyIsInNvdXJjZXNDb250ZW50IjpbIi8vIExlYXJuIGNjLkNsYXNzOlxyXG4vLyAgLSBodHRwczovL2RvY3MuY29jb3MuY29tL2NyZWF0b3IvbWFudWFsL2VuL3NjcmlwdGluZy9jbGFzcy5odG1sXHJcbi8vIExlYXJuIEF0dHJpYnV0ZTpcclxuLy8gIC0gaHR0cHM6Ly9kb2NzLmNvY29zLmNvbS9jcmVhdG9yL21hbnVhbC9lbi9zY3JpcHRpbmcvcmVmZXJlbmNlL2F0dHJpYnV0ZXMuaHRtbFxyXG4vLyBMZWFybiBsaWZlLWN5Y2xlIGNhbGxiYWNrczpcclxuLy8gIC0gaHR0cHM6Ly9kb2NzLmNvY29zLmNvbS9jcmVhdG9yL21hbnVhbC9lbi9zY3JpcHRpbmcvbGlmZS1jeWNsZS1jYWxsYmFja3MuaHRtbFxyXG5cclxuY2MuQ2xhc3Moe1xyXG4gICAgZXh0ZW5kczogY2MuQ29tcG9uZW50LFxyXG5cclxuICAgIHByb3BlcnRpZXM6IHtcclxuICAgICAgICBzZXg6e1xyXG4gICAgICAgICAgICB0eXBlOmNjLkVudW0oe1xyXG4gICAgICAgICAgICAgICAgbWFsZTowLFxyXG4gICAgICAgICAgICAgICAgZmVtYWxlOjFcclxuICAgICAgICAgICAgfSksXHJcbiAgICAgICAgICAgIGRlZmF1bHQ6MFxyXG4gICAgICAgIH1cclxuICAgICAgICAvLyBmb286IHtcclxuICAgICAgICAvLyAgICAgLy8gQVRUUklCVVRFUzpcclxuICAgICAgICAvLyAgICAgZGVmYXVsdDogbnVsbCwgICAgICAgIC8vIFRoZSBkZWZhdWx0IHZhbHVlIHdpbGwgYmUgdXNlZCBvbmx5IHdoZW4gdGhlIGNvbXBvbmVudCBhdHRhY2hpbmdcclxuICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRvIGEgbm9kZSBmb3IgdGhlIGZpcnN0IHRpbWVcclxuICAgICAgICAvLyAgICAgdHlwZTogY2MuU3ByaXRlRnJhbWUsIC8vIG9wdGlvbmFsLCBkZWZhdWx0IGlzIHR5cGVvZiBkZWZhdWx0XHJcbiAgICAgICAgLy8gICAgIHNlcmlhbGl6YWJsZTogdHJ1ZSwgICAvLyBvcHRpb25hbCwgZGVmYXVsdCBpcyB0cnVlXHJcbiAgICAgICAgLy8gfSxcclxuICAgICAgICAvLyBiYXI6IHtcclxuICAgICAgICAvLyAgICAgZ2V0ICgpIHtcclxuICAgICAgICAvLyAgICAgICAgIHJldHVybiB0aGlzLl9iYXI7XHJcbiAgICAgICAgLy8gICAgIH0sXHJcbiAgICAgICAgLy8gICAgIHNldCAodmFsdWUpIHtcclxuICAgICAgICAvLyAgICAgICAgIHRoaXMuX2JhciA9IHZhbHVlO1xyXG4gICAgICAgIC8vICAgICB9XHJcbiAgICAgICAgLy8gfSxcclxuICAgIH0sXHJcblxyXG4gICAgLy8gTElGRS1DWUNMRSBDQUxMQkFDS1M6XHJcblxyXG4gICAgLy8gb25Mb2FkICgpIHt9LFxyXG5cclxuICAgIHN0YXJ0ICgpIHtcclxuXHJcbiAgICB9LFxyXG5cclxuICAgIC8vIHVwZGF0ZSAoZHQpIHt9LFxyXG59KTtcclxuIl19
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/effect/融化.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '341aezWi/BCGa2q28VO8ioy', '融化');
// effect/融化.ts

"use strict";
// IceMelt.ts
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.IceMelt = void 0;
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var IceMelt = /** @class */ (function (_super) {
    __extends(IceMelt, _super);
    function IceMelt() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.speed = 1;
        //是否融化
        _this._isMelt = false;
        _this._time = 0;
        return _this;
    }
    IceMelt.prototype.start = function () {
        this._material = this.node.getComponent(cc.Sprite).getMaterial(0);
    };
    IceMelt.prototype.update = function (dt) {
        if (this._material && this._isMelt) {
            this._material.setProperty('u_time', this._time);
            this._time += dt * this.speed;
        }
    };
    //开始融化
    IceMelt.prototype.startMelt = function () {
        this._isMelt = true;
        this._time = 0;
    };
    IceMelt = __decorate([
        ccclass()
    ], IceMelt);
    return IceMelt;
}(cc.Component));
exports.IceMelt = IceMelt;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcZWZmZWN0XFzono3ljJYudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLGFBQWE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFJUCxJQUFBLEtBQXdCLEVBQUUsQ0FBQyxVQUFVLEVBQW5DLE9BQU8sYUFBQSxFQUFFLFFBQVEsY0FBa0IsQ0FBQztBQUc1QztJQUE2QiwyQkFBWTtJQUF6QztRQUFBLHFFQXlCQztRQXZCRyxXQUFLLEdBQVcsQ0FBQyxDQUFDO1FBRWxCLE1BQU07UUFDRSxhQUFPLEdBQVksS0FBSyxDQUFDO1FBQ3pCLFdBQUssR0FBVyxDQUFDLENBQUM7O0lBbUI5QixDQUFDO0lBaEJHLHVCQUFLLEdBQUw7UUFDSSxJQUFJLENBQUMsU0FBUyxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsWUFBWSxDQUFDLEVBQUUsQ0FBQyxNQUFNLENBQUMsQ0FBQyxXQUFXLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFDdEUsQ0FBQztJQUVELHdCQUFNLEdBQU4sVUFBTyxFQUFFO1FBQ0wsSUFBSSxJQUFJLENBQUMsU0FBUyxJQUFJLElBQUksQ0FBQyxPQUFPLEVBQUU7WUFDaEMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxXQUFXLENBQUMsUUFBUSxFQUFFLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQztZQUNqRCxJQUFJLENBQUMsS0FBSyxJQUFJLEVBQUUsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDO1NBQ2pDO0lBQ0wsQ0FBQztJQUVELE1BQU07SUFDTiwyQkFBUyxHQUFUO1FBQ0ksSUFBSSxDQUFDLE9BQU8sR0FBRyxJQUFJLENBQUM7UUFDcEIsSUFBSSxDQUFDLEtBQUssR0FBRyxDQUFDLENBQUM7SUFDbkIsQ0FBQztJQXhCUSxPQUFPO1FBRG5CLE9BQU8sRUFBRTtPQUNHLE9BQU8sQ0F5Qm5CO0lBQUQsY0FBQztDQXpCRCxBQXlCQyxDQXpCNEIsRUFBRSxDQUFDLFNBQVMsR0F5QnhDO0FBekJZLDBCQUFPIiwiZmlsZSI6IiIsInNvdXJjZVJvb3QiOiIvIiwic291cmNlc0NvbnRlbnQiOlsiLy8gSWNlTWVsdC50c1xyXG5cclxuXHJcblxyXG5jb25zdCB7IGNjY2xhc3MsIHByb3BlcnR5IH0gPSBjYy5fZGVjb3JhdG9yO1xyXG5cclxuQGNjY2xhc3MoKVxyXG5leHBvcnQgY2xhc3MgSWNlTWVsdCBleHRlbmRzIGNjLkNvbXBvbmVudCB7XHJcblxyXG4gICAgc3BlZWQ6IG51bWJlciA9IDE7XHJcblxyXG4gICAgLy/mmK/lkKbono3ljJZcclxuICAgIHByaXZhdGUgX2lzTWVsdDogYm9vbGVhbiA9IGZhbHNlO1xyXG4gICAgcHJpdmF0ZSBfdGltZTogbnVtYmVyID0gMDtcclxuICAgIHByaXZhdGUgX21hdGVyaWFsOiBjYy5NYXRlcmlhbFZhcmlhbnQ7XHJcblxyXG4gICAgc3RhcnQoKSB7XHJcbiAgICAgICAgdGhpcy5fbWF0ZXJpYWwgPSB0aGlzLm5vZGUuZ2V0Q29tcG9uZW50KGNjLlNwcml0ZSkuZ2V0TWF0ZXJpYWwoMCk7XHJcbiAgICB9XHJcblxyXG4gICAgdXBkYXRlKGR0KSB7XHJcbiAgICAgICAgaWYgKHRoaXMuX21hdGVyaWFsICYmIHRoaXMuX2lzTWVsdCkge1xyXG4gICAgICAgICAgICB0aGlzLl9tYXRlcmlhbC5zZXRQcm9wZXJ0eSgndV90aW1lJywgdGhpcy5fdGltZSk7XHJcbiAgICAgICAgICAgIHRoaXMuX3RpbWUgKz0gZHQgKiB0aGlzLnNwZWVkO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuXHJcbiAgICAvL+W8gOWni+iejeWMllxyXG4gICAgc3RhcnRNZWx0KCkge1xyXG4gICAgICAgIHRoaXMuX2lzTWVsdCA9IHRydWU7XHJcbiAgICAgICAgdGhpcy5fdGltZSA9IDA7XHJcbiAgICB9XHJcbn0iXX0=
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/migration/use_v2.1-2.2.1_cc.Toggle_event.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '7a231Rz0d9LBYYgY3bDYlLB', 'use_v2.1-2.2.1_cc.Toggle_event');
// migration/use_v2.1-2.2.1_cc.Toggle_event.js

"use strict";

/*
 * This script is automatically generated by Cocos Creator and is only used for projects compatible with the v2.1.0 ～ 2.2.1 version.
 * You do not need to manually add this script in any other project.
 * If you don't use cc.Toggle in your project, you can delete this script directly.
 * If your project is hosted in VCS such as git, submit this script together.
 *
 * 此脚本由 Cocos Creator 自动生成，仅用于兼容 v2.1.0 ~ 2.2.1 版本的工程，
 * 你无需在任何其它项目中手动添加此脚本。
 * 如果你的项目中没用到 Toggle，可直接删除该脚本。
 * 如果你的项目有托管于 git 等版本库，请将此脚本一并上传。
 */

if (cc.Toggle) {
  // Whether to trigger 'toggle' and 'checkEvents' events when modifying 'toggle.isChecked' in the code
  // 在代码中修改 'toggle.isChecked' 时是否触发 'toggle' 与 'checkEvents' 事件
  cc.Toggle._triggerEventInScript_isChecked = true;
}

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcbWlncmF0aW9uXFx1c2VfdjIuMS0yLjIuMV9jYy5Ub2dnbGVfZXZlbnQuanMiXSwibmFtZXMiOlsiY2MiLCJUb2dnbGUiLCJfdHJpZ2dlckV2ZW50SW5TY3JpcHRfaXNDaGVja2VkIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7OztBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEsSUFBSUEsRUFBRSxDQUFDQyxNQUFNLEVBQUU7RUFDWDtFQUNBO0VBQ0FELEVBQUUsQ0FBQ0MsTUFBTSxDQUFDQywrQkFBK0IsR0FBRyxJQUFJO0FBQ3BEIiwic291cmNlUm9vdCI6Ii8iLCJzb3VyY2VzQ29udGVudCI6WyIvKlxyXG4gKiBUaGlzIHNjcmlwdCBpcyBhdXRvbWF0aWNhbGx5IGdlbmVyYXRlZCBieSBDb2NvcyBDcmVhdG9yIGFuZCBpcyBvbmx5IHVzZWQgZm9yIHByb2plY3RzIGNvbXBhdGlibGUgd2l0aCB0aGUgdjIuMS4wIO+9niAyLjIuMSB2ZXJzaW9uLlxyXG4gKiBZb3UgZG8gbm90IG5lZWQgdG8gbWFudWFsbHkgYWRkIHRoaXMgc2NyaXB0IGluIGFueSBvdGhlciBwcm9qZWN0LlxyXG4gKiBJZiB5b3UgZG9uJ3QgdXNlIGNjLlRvZ2dsZSBpbiB5b3VyIHByb2plY3QsIHlvdSBjYW4gZGVsZXRlIHRoaXMgc2NyaXB0IGRpcmVjdGx5LlxyXG4gKiBJZiB5b3VyIHByb2plY3QgaXMgaG9zdGVkIGluIFZDUyBzdWNoIGFzIGdpdCwgc3VibWl0IHRoaXMgc2NyaXB0IHRvZ2V0aGVyLlxyXG4gKlxyXG4gKiDmraTohJrmnKznlLEgQ29jb3MgQ3JlYXRvciDoh6rliqjnlJ/miJDvvIzku4XnlKjkuo7lhbzlrrkgdjIuMS4wIH4gMi4yLjEg54mI5pys55qE5bel56iL77yMXHJcbiAqIOS9oOaXoOmcgOWcqOS7u+S9leWFtuWug+mhueebruS4reaJi+WKqOa3u+WKoOatpOiEmuacrOOAglxyXG4gKiDlpoLmnpzkvaDnmoTpobnnm67kuK3msqHnlKjliLAgVG9nZ2xl77yM5Y+v55u05o6l5Yig6Zmk6K+l6ISa5pys44CCXHJcbiAqIOWmguaenOS9oOeahOmhueebruacieaJmOeuoeS6jiBnaXQg562J54mI5pys5bqT77yM6K+35bCG5q2k6ISa5pys5LiA5bm25LiK5Lyg44CCXHJcbiAqL1xyXG5cclxuaWYgKGNjLlRvZ2dsZSkge1xyXG4gICAgLy8gV2hldGhlciB0byB0cmlnZ2VyICd0b2dnbGUnIGFuZCAnY2hlY2tFdmVudHMnIGV2ZW50cyB3aGVuIG1vZGlmeWluZyAndG9nZ2xlLmlzQ2hlY2tlZCcgaW4gdGhlIGNvZGVcclxuICAgIC8vIOWcqOS7o+eggeS4reS/ruaUuSAndG9nZ2xlLmlzQ2hlY2tlZCcg5pe25piv5ZCm6Kem5Y+RICd0b2dnbGUnIOS4jiAnY2hlY2tFdmVudHMnIOS6i+S7tlxyXG4gICAgY2MuVG9nZ2xlLl90cmlnZ2VyRXZlbnRJblNjcmlwdF9pc0NoZWNrZWQgPSB0cnVlO1xyXG59XHJcbiJdfQ==
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/prop/Lock.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '41cb8ugLSBH/5aNhnsJ5lX7', 'Lock');
// Script/prop/Lock.ts

"use strict";
// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var NumberToImage_1 = require("../NumberToImage");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var Lock = /** @class */ (function (_super) {
    __extends(Lock, _super);
    function Lock() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.time = 0;
        return _this;
        // update (dt) {}
    }
    // mapInfo: number[][] = [];
    Lock.prototype.onLoad = function () {
    };
    Lock.prototype.start = function () {
    };
    Lock.prototype.init = function (time) {
        if (time)
            this.time = time;
        this.node.getChildByName("time").active = true;
        NumberToImage_1.default.numberToImageNodes(this.time, 20, 8, "lock_", this.node.getChildByName("time"), false);
    };
    Lock.prototype.reduce = function () {
        this.time -= 1;
        NumberToImage_1.default.numberToImageNodes(this.time, 20, 8, "lock_", this.node.getChildByName("time"), false);
        if (this.time <= 0) {
            this.node.parent.getComponent("Block").type = 0;
            this.node.destroy();
            this.node.removeFromParent();
        }
    };
    Lock = __decorate([
        ccclass
    ], Lock);
    return Lock;
}(cc.Component));
exports.default = Lock;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcU2NyaXB0XFxwcm9wXFxMb2NrLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxvQkFBb0I7QUFDcEIsd0VBQXdFO0FBQ3hFLG1CQUFtQjtBQUNuQixrRkFBa0Y7QUFDbEYsOEJBQThCO0FBQzlCLGtGQUFrRjs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBR2xGLGtEQUE2QztBQUV2QyxJQUFBLEtBQXNCLEVBQUUsQ0FBQyxVQUFVLEVBQWxDLE9BQU8sYUFBQSxFQUFFLFFBQVEsY0FBaUIsQ0FBQztBQUsxQztJQUFrQyx3QkFBWTtJQUE5QztRQUFBLHFFQStCQztRQTdCRyxVQUFJLEdBQVcsQ0FBQyxDQUFDOztRQTRCakIsaUJBQWlCO0lBQ3JCLENBQUM7SUEzQkcsNEJBQTRCO0lBRTVCLHFCQUFNLEdBQU47SUFFQSxDQUFDO0lBRUQsb0JBQUssR0FBTDtJQUNBLENBQUM7SUFFRCxtQkFBSSxHQUFKLFVBQUssSUFBSTtRQUNMLElBQUcsSUFBSTtZQUFFLElBQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDO1FBQzFCLElBQUksQ0FBQyxJQUFJLENBQUMsY0FBYyxDQUFDLE1BQU0sQ0FBQyxDQUFDLE1BQU0sR0FBRyxJQUFJLENBQUM7UUFDL0MsdUJBQWEsQ0FBQyxrQkFBa0IsQ0FBQyxJQUFJLENBQUMsSUFBSSxFQUFDLEVBQUUsRUFBQyxDQUFDLEVBQUMsT0FBTyxFQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsY0FBYyxDQUFDLE1BQU0sQ0FBQyxFQUFDLEtBQUssQ0FBQyxDQUFDO0lBRXBHLENBQUM7SUFFRCxxQkFBTSxHQUFOO1FBQ0ksSUFBSSxDQUFDLElBQUksSUFBSSxDQUFDLENBQUM7UUFDZix1QkFBYSxDQUFDLGtCQUFrQixDQUFDLElBQUksQ0FBQyxJQUFJLEVBQUMsRUFBRSxFQUFDLENBQUMsRUFBQyxPQUFPLEVBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxjQUFjLENBQUMsTUFBTSxDQUFDLEVBQUMsS0FBSyxDQUFDLENBQUM7UUFDaEcsSUFBRyxJQUFJLENBQUMsSUFBSSxJQUFJLENBQUMsRUFBQztZQUNkLElBQUksQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLFlBQVksQ0FBQyxPQUFPLENBQUMsQ0FBQyxJQUFJLEdBQUcsQ0FBQyxDQUFDO1lBQ2hELElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTyxFQUFFLENBQUM7WUFDcEIsSUFBSSxDQUFDLElBQUksQ0FBQyxnQkFBZ0IsRUFBRSxDQUFDO1NBQ2hDO0lBQ0wsQ0FBQztJQTVCZ0IsSUFBSTtRQUR4QixPQUFPO09BQ2EsSUFBSSxDQStCeEI7SUFBRCxXQUFDO0NBL0JELEFBK0JDLENBL0JpQyxFQUFFLENBQUMsU0FBUyxHQStCN0M7a0JBL0JvQixJQUFJIiwiZmlsZSI6IiIsInNvdXJjZVJvb3QiOiIvIiwic291cmNlc0NvbnRlbnQiOlsiLy8gTGVhcm4gVHlwZVNjcmlwdDpcclxuLy8gIC0gaHR0cHM6Ly9kb2NzLmNvY29zLmNvbS9jcmVhdG9yL21hbnVhbC9lbi9zY3JpcHRpbmcvdHlwZXNjcmlwdC5odG1sXHJcbi8vIExlYXJuIEF0dHJpYnV0ZTpcclxuLy8gIC0gaHR0cHM6Ly9kb2NzLmNvY29zLmNvbS9jcmVhdG9yL21hbnVhbC9lbi9zY3JpcHRpbmcvcmVmZXJlbmNlL2F0dHJpYnV0ZXMuaHRtbFxyXG4vLyBMZWFybiBsaWZlLWN5Y2xlIGNhbGxiYWNrczpcclxuLy8gIC0gaHR0cHM6Ly9kb2NzLmNvY29zLmNvbS9jcmVhdG9yL21hbnVhbC9lbi9zY3JpcHRpbmcvbGlmZS1jeWNsZS1jYWxsYmFja3MuaHRtbFxyXG5cclxuaW1wb3J0IE1hcENvbnJvbGVyIGZyb20gXCIuLi9NYXBcIjtcclxuaW1wb3J0IE51bWJlclRvSW1hZ2UgZnJvbSBcIi4uL051bWJlclRvSW1hZ2VcIjtcclxuXHJcbmNvbnN0IHtjY2NsYXNzLCBwcm9wZXJ0eX0gPSBjYy5fZGVjb3JhdG9yO1xyXG5cclxuXHJcblxyXG5AY2NjbGFzc1xyXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBMb2NrIGV4dGVuZHMgY2MuQ29tcG9uZW50IHtcclxuICAgIHN0YXRpYyBfaW5zdGFuY2U6IGFueTtcclxuICAgIHRpbWU6IG51bWJlciA9IDA7XHJcblxyXG4gICAgLy8gbWFwSW5mbzogbnVtYmVyW11bXSA9IFtdO1xyXG5cclxuICAgIG9uTG9hZCAoKSB7XHJcblxyXG4gICAgfSBcclxuXHJcbiAgICBzdGFydCAoKSB7XHJcbiAgICB9XHJcblxyXG4gICAgaW5pdCh0aW1lKXtcclxuICAgICAgICBpZih0aW1lKSB0aGlzLnRpbWUgPSB0aW1lO1xyXG4gICAgICAgIHRoaXMubm9kZS5nZXRDaGlsZEJ5TmFtZShcInRpbWVcIikuYWN0aXZlID0gdHJ1ZTtcclxuICAgICAgICBOdW1iZXJUb0ltYWdlLm51bWJlclRvSW1hZ2VOb2Rlcyh0aGlzLnRpbWUsMjAsOCxcImxvY2tfXCIsdGhpcy5ub2RlLmdldENoaWxkQnlOYW1lKFwidGltZVwiKSxmYWxzZSk7XHJcblxyXG4gICAgfVxyXG5cclxuICAgIHJlZHVjZSgpe1xyXG4gICAgICAgIHRoaXMudGltZSAtPSAxO1xyXG4gICAgICAgIE51bWJlclRvSW1hZ2UubnVtYmVyVG9JbWFnZU5vZGVzKHRoaXMudGltZSwyMCw4LFwibG9ja19cIix0aGlzLm5vZGUuZ2V0Q2hpbGRCeU5hbWUoXCJ0aW1lXCIpLGZhbHNlKTtcclxuICAgICAgICBpZih0aGlzLnRpbWUgPD0gMCl7XHJcbiAgICAgICAgICAgIHRoaXMubm9kZS5wYXJlbnQuZ2V0Q29tcG9uZW50KFwiQmxvY2tcIikudHlwZSA9IDA7XHJcbiAgICAgICAgICAgIHRoaXMubm9kZS5kZXN0cm95KCk7XHJcbiAgICAgICAgICAgIHRoaXMubm9kZS5yZW1vdmVGcm9tUGFyZW50KCk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIC8vIHVwZGF0ZSAoZHQpIHt9XHJcbn1cclxuIl19
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/lq_collide_system/lq_collide_base.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'c22a3wcU/tBdJ/qjn/Q6uuA', 'lq_collide_base');
// Script/lq_collide_system/lq_collide_base.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.LQCollideBase = void 0;
var ccclass = cc._decorator.ccclass;
var executeInEditMode = cc._decorator.executeInEditMode;
var PolygonCollider = cc.PolygonCollider;
var property = cc._decorator.property;
var lq_collide_1 = require("./lq_collide");
var lq_const_1 = require("../lq_base/data/lq_const");
var LQCollideBase = /** @class */ (function (_super) {
    __extends(LQCollideBase, _super);
    function LQCollideBase() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.auto_update_point = true;
        return _this;
    }
    LQCollideBase.prototype.find_collide = function () {
        var collide = this.node.getComponent(lq_collide_1.LQCollide);
        if (!collide) {
            console.error(this.node.name + ':没有找到LQCollide组件');
            return undefined;
        }
        return collide;
    };
    LQCollideBase.prototype.onLoad = function () {
        var collide = this.find_collide();
        if (!collide) {
            return;
        }
        collide.init_lq_collide();
    };
    LQCollideBase.prototype.onEnable = function () {
        var collide = this.find_collide();
        if (!collide) {
            return;
        }
        collide.enable_lq_collide();
    };
    LQCollideBase.prototype.onDisable = function () {
        var collide = this.find_collide();
        if (!collide) {
            return;
        }
        collide.disable_lq_collide();
    };
    LQCollideBase.prototype.onDestroy = function () {
        var collide = this.find_collide();
        if (!collide) {
            return;
        }
    };
    LQCollideBase.prototype.onFocusInEditor = function () {
        var collide = this.find_collide();
        if (!collide) {
            return;
        }
    };
    LQCollideBase.prototype.onLostFocusInEditor = function () {
        var collide = this.find_collide();
        if (!collide) {
            return;
        }
    };
    LQCollideBase.prototype.resetInEditor = function () {
        var collide = this.find_collide();
        if (!collide) {
            return;
        }
    };
    LQCollideBase.prototype.update = function (dt) {
        if (!CC_EDITOR || !this.auto_update_point) {
            return;
        }
        var collide = this.find_collide();
        if (!collide) {
            return;
        }
        if (collide.collide_shape !== lq_const_1.LQCollideShape.Polygon) {
            return;
        }
        var polygonCollider = this.node.getComponent(PolygonCollider);
        if (!polygonCollider) {
            return;
        }
        collide.polygon_points = polygonCollider.points;
    };
    __decorate([
        property({ tooltip: '多边形自动同步cocos PolygonCollider 组件中的碰撞点' })
    ], LQCollideBase.prototype, "auto_update_point", void 0);
    LQCollideBase = __decorate([
        ccclass,
        executeInEditMode
    ], LQCollideBase);
    return LQCollideBase;
}(cc.Component));
exports.LQCollideBase = LQCollideBase;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 6432 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/lq_base/util/lq_math_util.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '997fc58y39OFLflh6T58fZD', 'lq_math_util');
// Script/lq_base/util/lq_math_util.ts

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LQMathUtil = void 0;
var LQMathUtil = /** @class */ (function () {
    function LQMathUtil() {
    }
    LQMathUtil.random = function (min, max) {
        if (min === max) {
            return min;
        }
        else if (min < max) {
            return Math.random() * (max - min) + min;
        }
        else {
            return Math.random() * (min - max) + max;
        }
    };
    LQMathUtil.random_int = function (min, max) {
        return Math.floor(this.random(min, max));
    };
    LQMathUtil.get_radians = function (pos, target_pos) {
        var r = Math.atan2(target_pos.y - pos.y, target_pos.x - pos.x);
        return r > 0 ? r : r + 6.28;
    };
    LQMathUtil.intersects_rect = function (r1, r2) {
        return Math.abs(r1.x - r2.x) < r1.half_width + r2.half_width && Math.abs(r1.y - r2.y) < r1.half_height + r2.half_height;
    };
    LQMathUtil.intersects_point_rect = function (p, r) {
        return (p.x > r.x - r.width * 0.5) && (p.x < r.x + r.width * 0.5) && (p.y > r.y - r.height * 0.5) && (p.y < r.y + r.height * 0.5);
    };
    LQMathUtil.intersects_point_circle = function (p1, p2, r) {
        return p1.sub(p2).magSqr() < r * r;
    };
    LQMathUtil.intersects_circle = function (p1, r1, p2, r2) {
        return p1.sub(p2).mag() < r1 + r2;
    };
    LQMathUtil.intersects_circle_rect = function (p, r, rect) {
        var relative_x = p.x - rect.x;
        var relative_y = p.y - rect.y;
        var dx = Math.min(relative_x, rect.half_width);
        var dx1 = Math.max(dx, -rect.half_width);
        var dy = Math.min(relative_y, rect.half_height);
        var dy1 = Math.max(dy, -rect.half_height);
        return (dx1 - relative_x) * (dx1 - relative_x) + (dy1 - relative_y) * (dy1 - relative_y) <= r * r;
    };
    return LQMathUtil;
}());
exports.LQMathUtil = LQMathUtil;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 5988 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/module/Notification/Notification.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '55403VjGlpPL564gsdiZBg3', 'Notification');
// Script/module/Notification/Notification.ts

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Notifications = void 0;
//全局通知
var Notifications = {
    _eventMap: [],
    on: function (masgId, callback, target) {
        if (this._eventMap[masgId] === undefined) {
            this._eventMap[masgId] = [];
        }
        this._eventMap[masgId].push({ callback: callback, target: target });
    },
    emit: function (masgId, parameter) {
        var array = this._eventMap[masgId];
        if (array === undefined)
            return;
        for (var i = 0; i < array.length; i++) {
            var element = array[i];
            if (element)
                element.callback.call(element.target, parameter);
        }
    },
    off: function (masgId, callback) {
        var array = this._eventMap[masgId];
        if (array === undefined)
            return;
        for (var i = 0; i < array.length; i++) {
            var element = array[i];
            if (element && element.callback === callback) {
                array[i] = undefined;
                break;
            }
        }
    },
    offMasgId: function (masgId) {
        this._eventMap[masgId] = undefined;
    },
    removeAllMsg: function () {
        for (var k in this._eventMap) {
            if (this._eventMap[k]) {
                this.offMasgId(k);
            }
        }
    }
};
exports.Notifications = Notifications;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcU2NyaXB0XFxtb2R1bGVcXE5vdGlmaWNhdGlvblxcTm90aWZpY2F0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLE1BQU07QUFDTixJQUFJLGFBQWEsR0FBRztJQUNoQixTQUFTLEVBQUUsRUFBRTtJQUNiLEVBQUUsRUFBRSxVQUFVLE1BQU0sRUFBRSxRQUFRLEVBQUUsTUFBTTtRQUNsQyxJQUFJLElBQUksQ0FBQyxTQUFTLENBQUMsTUFBTSxDQUFDLEtBQUssU0FBUyxFQUFFO1lBQ3RDLElBQUksQ0FBQyxTQUFTLENBQUMsTUFBTSxDQUFDLEdBQUcsRUFBRSxDQUFDO1NBQy9CO1FBQ0QsSUFBSSxDQUFDLFNBQVMsQ0FBQyxNQUFNLENBQUMsQ0FBQyxJQUFJLENBQUMsRUFBRSxRQUFRLEVBQUUsUUFBUSxFQUFFLE1BQU0sRUFBRSxNQUFNLEVBQUUsQ0FBQyxDQUFDO0lBQ3hFLENBQUM7SUFFRCxJQUFJLEVBQUUsVUFBVSxNQUFNLEVBQUUsU0FBUztRQUM3QixJQUFJLEtBQUssR0FBRyxJQUFJLENBQUMsU0FBUyxDQUFDLE1BQU0sQ0FBQyxDQUFDO1FBQ25DLElBQUksS0FBSyxLQUFLLFNBQVM7WUFBRSxPQUFPO1FBRWhDLEtBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxLQUFLLENBQUMsTUFBTSxFQUFFLENBQUMsRUFBRSxFQUFFO1lBQ25DLElBQUksT0FBTyxHQUFHLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQztZQUN2QixJQUFJLE9BQU87Z0JBQUUsT0FBTyxDQUFDLFFBQVEsQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLE1BQU0sRUFBRSxTQUFTLENBQUMsQ0FBQztTQUNqRTtJQUNMLENBQUM7SUFFRCxHQUFHLEVBQUUsVUFBVSxNQUFNLEVBQUUsUUFBUTtRQUMzQixJQUFJLEtBQUssR0FBRyxJQUFJLENBQUMsU0FBUyxDQUFDLE1BQU0sQ0FBQyxDQUFDO1FBQ25DLElBQUksS0FBSyxLQUFLLFNBQVM7WUFBRSxPQUFPO1FBQ2hDLEtBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxLQUFLLENBQUMsTUFBTSxFQUFFLENBQUMsRUFBRSxFQUFFO1lBQ25DLElBQUksT0FBTyxHQUFHLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQztZQUN2QixJQUFJLE9BQU8sSUFBSSxPQUFPLENBQUMsUUFBUSxLQUFLLFFBQVEsRUFBRTtnQkFDMUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxHQUFHLFNBQVMsQ0FBQztnQkFDckIsTUFBTTthQUNUO1NBQ0o7SUFDTCxDQUFDO0lBRUQsU0FBUyxFQUFFLFVBQVUsTUFBTTtRQUN2QixJQUFJLENBQUMsU0FBUyxDQUFDLE1BQU0sQ0FBQyxHQUFHLFNBQVMsQ0FBQztJQUN2QyxDQUFDO0lBRUQsWUFBWSxFQUFFO1FBQ1YsS0FBSyxJQUFJLENBQUMsSUFBSSxJQUFJLENBQUMsU0FBUyxFQUFFO1lBQzFCLElBQUksSUFBSSxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsRUFBRTtnQkFDbkIsSUFBSSxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsQ0FBQzthQUNyQjtTQUNKO0lBQ0wsQ0FBQztDQUNKLENBQUM7QUFDTyxzQ0FBYSIsImZpbGUiOiIiLCJzb3VyY2VSb290IjoiLyIsInNvdXJjZXNDb250ZW50IjpbIi8v5YWo5bGA6YCa55+lXHJcbnZhciBOb3RpZmljYXRpb25zID0ge1xyXG4gICAgX2V2ZW50TWFwOiBbXSxcclxuICAgIG9uOiBmdW5jdGlvbiAobWFzZ0lkLCBjYWxsYmFjaywgdGFyZ2V0KSB7XHJcbiAgICAgICAgaWYgKHRoaXMuX2V2ZW50TWFwW21hc2dJZF0gPT09IHVuZGVmaW5lZCkge1xyXG4gICAgICAgICAgICB0aGlzLl9ldmVudE1hcFttYXNnSWRdID0gW107XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHRoaXMuX2V2ZW50TWFwW21hc2dJZF0ucHVzaCh7IGNhbGxiYWNrOiBjYWxsYmFjaywgdGFyZ2V0OiB0YXJnZXQgfSk7XHJcbiAgICB9LFxyXG5cclxuICAgIGVtaXQ6IGZ1bmN0aW9uIChtYXNnSWQsIHBhcmFtZXRlcikge1xyXG4gICAgICAgIGxldCBhcnJheSA9IHRoaXMuX2V2ZW50TWFwW21hc2dJZF07XHJcbiAgICAgICAgaWYgKGFycmF5ID09PSB1bmRlZmluZWQpIHJldHVybjtcclxuXHJcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnJheS5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICBsZXQgZWxlbWVudCA9IGFycmF5W2ldO1xyXG4gICAgICAgICAgICBpZiAoZWxlbWVudCkgZWxlbWVudC5jYWxsYmFjay5jYWxsKGVsZW1lbnQudGFyZ2V0LCBwYXJhbWV0ZXIpO1xyXG4gICAgICAgIH1cclxuICAgIH0sXHJcblxyXG4gICAgb2ZmOiBmdW5jdGlvbiAobWFzZ0lkLCBjYWxsYmFjaykge1xyXG4gICAgICAgIGxldCBhcnJheSA9IHRoaXMuX2V2ZW50TWFwW21hc2dJZF07XHJcbiAgICAgICAgaWYgKGFycmF5ID09PSB1bmRlZmluZWQpIHJldHVybjtcclxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFycmF5Lmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgIGxldCBlbGVtZW50ID0gYXJyYXlbaV07XHJcbiAgICAgICAgICAgIGlmIChlbGVtZW50ICYmIGVsZW1lbnQuY2FsbGJhY2sgPT09IGNhbGxiYWNrKSB7XHJcbiAgICAgICAgICAgICAgICBhcnJheVtpXSA9IHVuZGVmaW5lZDtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfSxcclxuXHJcbiAgICBvZmZNYXNnSWQ6IGZ1bmN0aW9uIChtYXNnSWQpIHtcclxuICAgICAgICB0aGlzLl9ldmVudE1hcFttYXNnSWRdID0gdW5kZWZpbmVkO1xyXG4gICAgfSxcclxuXHJcbiAgICByZW1vdmVBbGxNc2c6IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICBmb3IgKGxldCBrIGluIHRoaXMuX2V2ZW50TWFwKSB7XHJcbiAgICAgICAgICAgIGlmICh0aGlzLl9ldmVudE1hcFtrXSkge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5vZmZNYXNnSWQoayk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbn07XHJcbmV4cG9ydCB7IE5vdGlmaWNhdGlvbnMgfTsiXX0=
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/module/RankList/ItemRender.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'ca0f9k0oBVDbpQC+OMNTF3m', 'ItemRender');
// Script/module/RankList/ItemRender.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var ItemRender = /** @class */ (function (_super) {
    __extends(ItemRender, _super);
    function ItemRender() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        /**数据 */
        _this.data = null;
        /**索引 0表示第一项*/
        _this.itemIndex = 0;
        return _this;
    }
    /**数据改变时调用 */
    ItemRender.prototype.dataChanged = function () {
        this.data.name = cc.fx.GameTool.subName(this.data.name, 6);
        this.node.getChildByName("rankLab").getComponent(cc.Label).string = this.data.rank + "";
        this.node.getChildByName("nameLab").getComponent(cc.Label).string = this.data.name + "";
        this.node.getChildByName("totalLab").getComponent(cc.Label).string = this.data.total;
        var timeTemp = cc.fx.GameTool.getTimeShenNong(this.data.time);
        // this.node.getChildByName("timeLab").getComponent(cc.Label).string = timeTemp + "";
        this.node.getChildByName("rank").getChildByName("one").active = false;
        this.node.getChildByName("rank").getChildByName("two").active = false;
        this.node.getChildByName("rank").getChildByName("three").active = false;
        if (this.data.rank == 1) {
            this.node.getChildByName("rank").getChildByName("one").active = true;
            this.node.getChildByName("rankLab").active = false;
        }
        else if (this.data.rank == 2) {
            this.node.getChildByName("rank").getChildByName("two").active = true;
            this.node.getChildByName("rankLab").active = false;
        }
        else if (this.data.rank == 3) {
            this.node.getChildByName("rank").getChildByName("three").active = true;
            this.node.getChildByName("rankLab").active = false;
        }
        else {
            this.node.getChildByName("rankLab").active = true;
        }
        this.setPic();
    };
    ItemRender.prototype.setPic = function () {
        var _this = this;
        this.node.getChildByName("pic").getChildByName("icon").active = false;
        this.node.getChildByName("pic").getChildByName("pic").active = false;
        var self = this;
        var url = this.data.pic;
        fetch(url)
            .then(function (response) {
            return response.headers.get('Content-Length');
        })
            .then(function (errNo) {
            // console.log(this.data.rank,'X-Info:', errNo); // 输出X-ErrNo的值
            if (errNo == "5093") {
                // console.log(this.data.rank,"没头像");
                _this.node.getChildByName("pic").getChildByName("icon").active = true;
            }
        })
            .catch(function (error) {
            // console.error('Error fetching X-Info:', error);
        });
        cc.assetManager.loadRemote(url, { ext: '.png' }, function (err, texture) {
            if (texture) {
                _this.node.getChildByName("pic").getChildByName("pic").active = true;
                var sprite = _this.node.getChildByName("pic").getChildByName("pic").getComponent(cc.Sprite);
                sprite.spriteFrame = new cc.SpriteFrame(texture);
                // console.log(this.data.rank,"设置头像成功",err);
            }
            else {
                // console.log("设置头像失败",url);
                console.log(err, texture);
            }
        });
    };
    ItemRender = __decorate([
        ccclass
    ], ItemRender);
    return ItemRender;
}(cc.Component));
exports.default = ItemRender;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 9192 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/module/Storage/Storage.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '1002938VFRJd70RiAno9Iys', 'Storage');
// Script/module/Storage/Storage.ts

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StorageMessage = void 0;
//缓存浏览器数据
var StorageMessage = {
    getStorage: function (key) {
        var result = null;
        if (cc.sys.localStorage.getItem(key)) {
            var result = cc.sys.localStorage.getItem(key);
        }
        if (result) {
            result = JSON.parse(result);
        }
        return result;
    },
    setStorage: function (key, value) {
        //主动拉起分享接口
        var temp = JSON.stringify(value);
        cc.sys.localStorage.setItem(key, temp);
    },
    removeStorage: function (key) {
        //主动删除消息接口
        if (cc.sys.localStorage.getItem(key)) {
            cc.sys.localStorage.removeItem(key);
        }
    },
};
exports.StorageMessage = StorageMessage;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcU2NyaXB0XFxtb2R1bGVcXFN0b3JhZ2VcXFN0b3JhZ2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsU0FBUztBQUNULElBQUksY0FBYyxHQUFHO0lBQ2pCLFVBQVUsRUFBRyxVQUFTLEdBQUc7UUFDckIsSUFBSSxNQUFNLEdBQUcsSUFBSSxDQUFDO1FBQ2xCLElBQUcsRUFBRSxDQUFDLEdBQUcsQ0FBQyxZQUFZLENBQUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxFQUFDO1lBQ2xDLElBQUksTUFBTSxHQUFHLEVBQUUsQ0FBQyxHQUFHLENBQUMsWUFBWSxDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQztTQUMvQztRQUVELElBQUcsTUFBTSxFQUFDO1lBQ1IsTUFBTSxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUMsTUFBTSxDQUFDLENBQUM7U0FDN0I7UUFDRCxPQUFPLE1BQU0sQ0FBQztJQUNsQixDQUFDO0lBQ0QsVUFBVSxFQUFHLFVBQVMsR0FBRyxFQUFDLEtBQUs7UUFDM0IsVUFBVTtRQUNWLElBQUksSUFBSSxHQUFHLElBQUksQ0FBQyxTQUFTLENBQUMsS0FBSyxDQUFDLENBQUM7UUFDakMsRUFBRSxDQUFDLEdBQUcsQ0FBQyxZQUFZLENBQUMsT0FBTyxDQUFDLEdBQUcsRUFBRSxJQUFJLENBQUMsQ0FBQTtJQUMxQyxDQUFDO0lBQ0QsYUFBYSxFQUFHLFVBQVMsR0FBRztRQUMxQixVQUFVO1FBQ1YsSUFBRyxFQUFFLENBQUMsR0FBRyxDQUFDLFlBQVksQ0FBQyxPQUFPLENBQUMsR0FBRyxDQUFDLEVBQUM7WUFDbEMsRUFBRSxDQUFDLEdBQUcsQ0FBQyxZQUFZLENBQUMsVUFBVSxDQUFDLEdBQUcsQ0FBQyxDQUFBO1NBQ3BDO0lBQ0gsQ0FBQztDQUNKLENBQUM7QUFFTyx3Q0FBYyIsImZpbGUiOiIiLCJzb3VyY2VSb290IjoiLyIsInNvdXJjZXNDb250ZW50IjpbIi8v57yT5a2Y5rWP6KeI5Zmo5pWw5o2uXHJcbnZhciBTdG9yYWdlTWVzc2FnZSA9IHtcclxuICAgIGdldFN0b3JhZ2UgOiBmdW5jdGlvbihrZXkpe1xyXG4gICAgICAgIHZhciByZXN1bHQgPSBudWxsO1xyXG4gICAgICAgIGlmKGNjLnN5cy5sb2NhbFN0b3JhZ2UuZ2V0SXRlbShrZXkpKXtcclxuICAgICAgICAgIHZhciByZXN1bHQgPSBjYy5zeXMubG9jYWxTdG9yYWdlLmdldEl0ZW0oa2V5KTtcclxuICAgICAgICB9XHJcbiAgICAgICAgXHJcbiAgICAgICAgaWYocmVzdWx0KXtcclxuICAgICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KTtcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcclxuICAgIH0sXHJcbiAgICBzZXRTdG9yYWdlIDogZnVuY3Rpb24oa2V5LHZhbHVlKXtcclxuICAgICAgICAvL+S4u+WKqOaLiei1t+WIhuS6q+aOpeWPo1xyXG4gICAgICAgIHZhciB0ZW1wID0gSlNPTi5zdHJpbmdpZnkodmFsdWUpO1xyXG4gICAgICAgIGNjLnN5cy5sb2NhbFN0b3JhZ2Uuc2V0SXRlbShrZXksIHRlbXApXHJcbiAgICB9LFxyXG4gICAgcmVtb3ZlU3RvcmFnZSA6IGZ1bmN0aW9uKGtleSl7XHJcbiAgICAgIC8v5Li75Yqo5Yig6Zmk5raI5oGv5o6l5Y+jXHJcbiAgICAgIGlmKGNjLnN5cy5sb2NhbFN0b3JhZ2UuZ2V0SXRlbShrZXkpKXtcclxuICAgICAgICBjYy5zeXMubG9jYWxTdG9yYWdlLnJlbW92ZUl0ZW0oa2V5KVxyXG4gICAgICB9XHJcbiAgICB9LFxyXG59O1xyXG5cclxuZXhwb3J0IHsgU3RvcmFnZU1lc3NhZ2UgfTsiXX0=
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/module/Crypto/HttpUtil.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '771a32aQBNGVKd3+66gyTKA', 'HttpUtil');
// Script/module/Crypto/HttpUtil.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var CryptoJS = require("./crypto-js.min.js"); //引用AES源码js
var BASE_URL = "https://api.sparkus.cn";
//只负责网络接口 次类只负责和后端交互，不负责处理数据 数据处理在GameTool
var HttpUtil = /** @class */ (function (_super) {
    __extends(HttpUtil, _super);
    function HttpUtil() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    HttpUtil = __decorate([
        ccclass
    ], HttpUtil);
    return HttpUtil;
}(cc.Component));
exports.default = HttpUtil;
// 响应拦截器
// Rq.interceptors.response.use(responseHandler)
var config = {
    gameId: "100012",
    secretKey: "onnfPKJW",
    EK: "hui231%1"
};
var Crypoto = /** @class */ (function () {
    function Crypoto() {
        // 加密的向明值，自己根据项目实际情况定，需要跟后端开发保持一致
        this.keyHex = this.getHetKey();
    }
    Crypoto.prototype.getHetKey = function () {
        return CryptoJS.enc.Utf8.parse(config.EK);
    };
    /** DES加密 */
    Crypoto.prototype.encryptByDES = function (message, secret) {
        if (!message) {
            return message;
        }
        var key = secret ? CryptoJS.enc.Utf8.parse(secret) : this.keyHex;
        var encrypted = CryptoJS.DES.encrypt(message, key, {
            mode: CryptoJS.mode.ECB,
            padding: CryptoJS.pad.Pkcs7
        });
        return encrypted.toString();
    };
    /** DES解密 */
    Crypoto.prototype.decryptByDES = function (message, secret) {
        var key = secret ? CryptoJS.enc.Utf8.parse(secret) : this.keyHex;
        var decrypted = CryptoJS.DES.decrypt({
            ciphertext: CryptoJS.enc.Base64.parse(message)
        }, key, {
            mode: CryptoJS.mode.ECB,
            padding: CryptoJS.pad.Pkcs7
        });
        return decrypted.toString(CryptoJS.enc.Utf8);
    };
    /** hmacSHA256加密 */
    Crypoto.prototype.hmacSha256 = function (message, secret) {
        var keyHex = secret ? CryptoJS.enc.Utf8.parse(secret) : this.keyHex;
        var hash = CryptoJS.HmacSHA256(message, keyHex);
        return hash.toString();
    };
    /** hmacSHA256验证 */
    Crypoto.prototype.verifyHmacSha256 = function (message, signature) {
        var hash = CryptoJS.HmacSHA256(message, this.keyHex);
        return hash.toString() === signature;
    };
    /** CBC加密 */
    Crypoto.prototype.encryptCBC = function (word) {
        if (!word) {
            return word;
        }
        var srcs = CryptoJS.enc.Utf8.parse(word);
        var encrypted = CryptoJS.AES.encrypt(srcs, this.keyHex, {
            iv: this.keyHex,
            mode: CryptoJS.mode.CBC,
            padding: CryptoJS.pad.ZeroPadding
        });
        return encrypted.toString();
    };
    /** CBC解密 */
    Crypoto.prototype.decryptCBC = function (word) {
        if (!word) {
            return word;
        }
        var encryptedHexStr = CryptoJS.enc.Hex.parse(word);
        var srcs = CryptoJS.enc.Base64.stringify(encryptedHexStr);
        var decrypt = CryptoJS.AES.decrypt(srcs, this.keyHex, {
            iv: this.keyHex,
            mode: CryptoJS.mode.CBC,
            padding: CryptoJS.pad.ZeroPadding
        });
        var decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);
        return decryptedStr.toString();
    };
    return Crypoto;
}());
var fxCry = new Crypoto();

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 8796 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/GameScene.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'e8b235WjRBErajwLmN8xFUz', 'GameScene');
// Script/GameScene.js


// cc.Class({
//     extends: cc.Component,
//     properties: {
//         localTest: {
//             default: false,
//             tooltip: '本地测试时勾选，避免tz_url和Configure报错，提交前勾掉'
//         },
//         clientTest: {
//             default: false,
//             tooltip: '客户端测试时勾选，展示版本标记方便测试区分，上线前勾掉'
//         },
//         clientTestVersion: {
//             default: '',
//             tooltip: '版本标记'
//         },
//         testVersion: cc.Label,
//         score: cc.Label,
//         double_hit: cc.Node,
//         add: cc.Node,
//         add2: cc.Node,
//         double_title: cc.Node,
//         count_time: cc.Node,
//         beginNode: cc.Node,
//         ball_nomal: [cc.SpriteFrame],
//         bg_nomal: [cc.SpriteFrame],
//         ball_light: [cc.SpriteFrame],
//         kuang_Frame: [cc.SpriteFrame],
//         daojishi: cc.Label,
//         pause_anniu: cc.Sprite,
//         mask: cc.Node,

//         flashUI: {
//             default: null,
//             type: cc.SpriteAtlas
//         },
//     },

//     onLoad() {

//     },

//     update(dt) {

//     },

// });
"use strict";

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcU2NyaXB0XFxHYW1lU2NlbmUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUdBOztBQUVBOztBQUVBOztBQUVBO0FBQUEiLCJzb3VyY2VSb290IjoiLyIsInNvdXJjZXNDb250ZW50IjpbIlxyXG4vLyBjYy5DbGFzcyh7XHJcbi8vICAgICBleHRlbmRzOiBjYy5Db21wb25lbnQsXHJcbi8vICAgICBwcm9wZXJ0aWVzOiB7XHJcbi8vICAgICAgICAgbG9jYWxUZXN0OiB7XHJcbi8vICAgICAgICAgICAgIGRlZmF1bHQ6IGZhbHNlLFxyXG4vLyAgICAgICAgICAgICB0b29sdGlwOiAn5pys5Zyw5rWL6K+V5pe25Yu+6YCJ77yM6YG/5YWNdHpfdXJs5ZKMQ29uZmlndXJl5oql6ZSZ77yM5o+Q5Lqk5YmN5Yu+5o6JJ1xyXG4vLyAgICAgICAgIH0sXHJcbi8vICAgICAgICAgY2xpZW50VGVzdDoge1xyXG4vLyAgICAgICAgICAgICBkZWZhdWx0OiBmYWxzZSxcclxuLy8gICAgICAgICAgICAgdG9vbHRpcDogJ+WuouaIt+err+a1i+ivleaXtuWLvumAie+8jOWxleekuueJiOacrOagh+iusOaWueS+v+a1i+ivleWMuuWIhu+8jOS4iue6v+WJjeWLvuaOiSdcclxuLy8gICAgICAgICB9LFxyXG4vLyAgICAgICAgIGNsaWVudFRlc3RWZXJzaW9uOiB7XHJcbi8vICAgICAgICAgICAgIGRlZmF1bHQ6ICcnLFxyXG4vLyAgICAgICAgICAgICB0b29sdGlwOiAn54mI5pys5qCH6K6wJ1xyXG4vLyAgICAgICAgIH0sXHJcbi8vICAgICAgICAgdGVzdFZlcnNpb246IGNjLkxhYmVsLFxyXG4vLyAgICAgICAgIHNjb3JlOiBjYy5MYWJlbCxcclxuLy8gICAgICAgICBkb3VibGVfaGl0OiBjYy5Ob2RlLFxyXG4vLyAgICAgICAgIGFkZDogY2MuTm9kZSxcclxuLy8gICAgICAgICBhZGQyOiBjYy5Ob2RlLFxyXG4vLyAgICAgICAgIGRvdWJsZV90aXRsZTogY2MuTm9kZSxcclxuLy8gICAgICAgICBjb3VudF90aW1lOiBjYy5Ob2RlLFxyXG4vLyAgICAgICAgIGJlZ2luTm9kZTogY2MuTm9kZSxcclxuLy8gICAgICAgICBiYWxsX25vbWFsOiBbY2MuU3ByaXRlRnJhbWVdLFxyXG4vLyAgICAgICAgIGJnX25vbWFsOiBbY2MuU3ByaXRlRnJhbWVdLFxyXG4vLyAgICAgICAgIGJhbGxfbGlnaHQ6IFtjYy5TcHJpdGVGcmFtZV0sXHJcbi8vICAgICAgICAga3VhbmdfRnJhbWU6IFtjYy5TcHJpdGVGcmFtZV0sXHJcbi8vICAgICAgICAgZGFvamlzaGk6IGNjLkxhYmVsLFxyXG4vLyAgICAgICAgIHBhdXNlX2Fubml1OiBjYy5TcHJpdGUsXHJcbi8vICAgICAgICAgbWFzazogY2MuTm9kZSxcclxuXHJcbi8vICAgICAgICAgZmxhc2hVSToge1xyXG4vLyAgICAgICAgICAgICBkZWZhdWx0OiBudWxsLFxyXG4vLyAgICAgICAgICAgICB0eXBlOiBjYy5TcHJpdGVBdGxhc1xyXG4vLyAgICAgICAgIH0sXHJcbi8vICAgICB9LFxyXG5cclxuLy8gICAgIG9uTG9hZCgpIHtcclxuXHJcblxyXG4vLyAgICAgfSxcclxuXHJcbi8vICAgICB1cGRhdGUoZHQpIHtcclxuXHJcbi8vICAgICB9LFxyXG5cclxuLy8gfSk7Il19
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/ControlManager.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'e35abcX5VRAoItO6mgFcYyX', 'ControlManager');
// Script/ControlManager.ts

"use strict";
// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var NewClass = /** @class */ (function (_super) {
    __extends(NewClass, _super);
    function NewClass() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.Map = null;
        _this.tip = null;
        _this.reinforce = null;
        _this.soil = null;
        return _this;
        // update (dt) {}
    }
    // LIFE-CYCLE CALLBACKS:
    // onLoad () {}
    NewClass.prototype.start = function () {
        this.tipArray = [];
        this.controlArray = [];
        this.canTouch = true;
        this.Reinforce = false;
        this.Soil = false;
        this.mapHeight = 0;
    };
    NewClass.prototype.setPosition = function (tip) {
        tip.setPosition(30, -25);
        if (this.tipArray.length > 0) {
            var length = this.tipArray.length + 1;
            var posY = Math.ceil(length / 8) - 1;
            var posX = length - Math.floor(posY) * 8 - 1;
            tip.setPosition(30 + 48 * posX, -25 - 48 * posY + this.mapHeight);
        }
    };
    //清空所有
    NewClass.prototype.removeAllTip = function () {
        if (!this.canTouch)
            return;
        if (this.tipArray.length > 0) {
            cc.fx.AudioManager._instance.playEffect("qingkong", null);
            for (var i = 0; i < this.tipArray.length; i++) {
                var tip = this.tipArray[i];
                tip.active = false;
                tip.removeFromParent(this.Map);
                tip = null;
            }
            this.tipArray = [];
            this.controlArray = [];
            var drawingReset = cc.fx.GameConfig.CLICK_DATA.drawingReset + 1;
            cc.fx.GameConfig.CLICK_SET("drawingReset", drawingReset);
            cc.fx.Notifications.emit(cc.fx.Message.removeTip, "remove");
            this.mapHeight = 0;
        }
    };
    //撤回一步
    NewClass.prototype.back_Click = function () {
        if (!this.canTouch)
            return;
        if (this.tipArray.length > 0) {
            cc.fx.AudioManager._instance.playEffect("chehui", null);
            var tip = this.tipArray[this.tipArray.length - 1];
            tip.active = false;
            tip.removeFromParent(this.Map);
            tip = null;
            this.tipArray.pop();
            this.controlArray.pop();
            var drawingBack = cc.fx.GameConfig.CLICK_DATA.drawingBack + 1;
            cc.fx.GameConfig.CLICK_SET("drawingBack", drawingBack);
            cc.fx.Notifications.emit(cc.fx.Message.removeTip, "back");
            if (this.tipArray.length >= 24) {
                if ((this.tipArray.length) % 8 == 0) {
                    this.mapMove(false);
                }
            }
        }
    };
    //点击事件
    NewClass.prototype.btn_Click = function (target, data) {
        var GameManager = this.node.parent.getComponent("GameManager");
        if (GameManager.btnClick == true) {
            GameManager.btnClick = false;
            cc.fx.Notifications.emit(cc.fx.Message.guideNext);
        }
        cc.fx.Notifications.emit(cc.fx.Message.control, data);
        if (!this.canTouch)
            return;
        var prefab = this.tip;
        if (data == "reinforce" || data == "soil") {
            prefab = this[data];
            if (data == "reinforce") {
                if (this.Reinforce) {
                    this.Reinforce = false;
                    this.back_Click();
                    return;
                }
                else {
                    cc.fx.AudioManager._instance.playEffect("jineng", null);
                    this.Reinforce = true;
                    this.Soil = false;
                }
            }
            else if (data == "soil") {
                if (this.Soil) {
                    this.Soil = false;
                    this.back_Click();
                    return;
                }
                else {
                    cc.fx.AudioManager._instance.playEffect("jineng", null);
                    this.Soil = true;
                    this.Reinforce = false;
                }
            }
        }
        else {
            cc.fx.AudioManager._instance.playEffect("fangxiang", null);
            this.Reinforce = false;
            this.Soil = false;
        }
        var tip = cc.instantiate(prefab);
        if (data == "up")
            tip.angle = 180;
        if (data == "left")
            tip.angle = -90;
        if (data == "right")
            tip.angle = 90;
        tip.parent = this.Map;
        if (this.controlArray[this.controlArray.length - 1] == "reinforce" ||
            this.controlArray[this.controlArray.length - 1] == "soil") {
            if (data == "reinforce" || data == "soil") {
                this.tipArray[this.tipArray.length - 1].removeFromParent();
                this.tipArray[this.tipArray.length - 1] = null;
                this.tipArray.pop();
                this.controlArray.pop();
            }
        }
        this.setPosition(tip);
        this.tipArray.push(tip);
        this.controlArray.push(data);
        if (this.tipArray.length >= 25) {
            if ((this.tipArray.length - 1) % 8 == 0) {
                this.mapMove(true);
            }
        }
    };
    //地图放不下了上下移动
    NewClass.prototype.mapMove = function (type) {
        if (type)
            this.mapHeight += 48;
        else
            this.mapHeight -= 48;
        for (var i = 0; i < this.tipArray.length; i++) {
            var tip = this.tipArray[i];
            if (type)
                tip.y += 48;
            else
                tip.y -= 48;
        }
    };
    //点击开始 创建河道
    NewClass.prototype.start_Click = function () {
        if (!this.canTouch)
            return;
        this.canTouch = false;
        cc.fx.AudioManager._instance.playEffect("build", null);
        cc.fx.Notifications.emit(cc.fx.Message.startGame, this.controlArray);
    };
    __decorate([
        property(cc.Node)
    ], NewClass.prototype, "Map", void 0);
    __decorate([
        property(cc.Prefab)
    ], NewClass.prototype, "tip", void 0);
    __decorate([
        property(cc.Prefab)
    ], NewClass.prototype, "reinforce", void 0);
    __decorate([
        property(cc.Prefab)
    ], NewClass.prototype, "soil", void 0);
    NewClass = __decorate([
        ccclass
    ], NewClass);
    return NewClass;
}(cc.Component));
exports.default = NewClass;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 17204 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/DynamicAtlasManager.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '5c9b8FZiaNLMrMDs9T3rByf', 'DynamicAtlasManager');
// Script/DynamicAtlasManager.js

"use strict";

cc.Class({
  "extends": cc.Component,
  properties: {},
  onLoad: function onLoad() {
    cc.dynamicAtlasManager.enabled = false;
  }
});

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcU2NyaXB0XFxEeW5hbWljQXRsYXNNYW5hZ2VyLmpzIl0sIm5hbWVzIjpbImNjIiwiQ2xhc3MiLCJDb21wb25lbnQiLCJwcm9wZXJ0aWVzIiwib25Mb2FkIiwiZHluYW1pY0F0bGFzTWFuYWdlciIsImVuYWJsZWQiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUFBLEVBQUUsQ0FBQ0MsS0FBSyxDQUFDO0VBQ0wsV0FBU0QsRUFBRSxDQUFDRSxTQUFTO0VBRXJCQyxVQUFVLEVBQUUsQ0FDWixDQUFDO0VBRURDLE1BQU0sV0FBQUEsT0FBQSxFQUFJO0lBQ05KLEVBQUUsQ0FBQ0ssbUJBQW1CLENBQUNDLE9BQU8sR0FBRyxLQUFLO0VBQzFDO0FBQ0osQ0FBQyxDQUFDIiwic291cmNlUm9vdCI6Ii8iLCJzb3VyY2VzQ29udGVudCI6WyJjYy5DbGFzcyh7XHJcbiAgICBleHRlbmRzOiBjYy5Db21wb25lbnQsXHJcblxyXG4gICAgcHJvcGVydGllczoge1xyXG4gICAgfSxcclxuXHJcbiAgICBvbkxvYWQgKCkge1xyXG4gICAgICAgIGNjLmR5bmFtaWNBdGxhc01hbmFnZXIuZW5hYmxlZCA9IGZhbHNlO1xyXG4gICAgfSxcclxufSk7XHJcbiJdfQ==
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/module/Music/AudioManager.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '58403/n16JCa5sZhNMjZzGo', 'AudioManager');
// Script/module/Music/AudioManager.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var AudioManager = /** @class */ (function (_super) {
    __extends(AudioManager, _super);
    function AudioManager() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        //背景音乐
        _this.audioGameBgm0 = null;
        _this.xiaochu = null;
        _this.hit = null;
        _this.down = null;
        _this.fangxiang = null;
        _this.build = null;
        _this.win = null;
        _this.lose = null;
        _this.anniu_Big = null;
        _this.anniu_little = null;
        _this.zhuan1 = null;
        _this.zhuan2 = null;
        return _this;
    }
    AudioManager_1 = AudioManager;
    AudioManager.prototype.onLoad = function () {
        if (AudioManager_1._instance == null) {
            AudioManager_1._instance = this;
            cc.game.addPersistRootNode(this.node);
        }
        else {
            return;
        }
        this.reward = false;
        this.finish = false;
        this.rewardCount = 0;
        this.ctor();
        this.preload();
    };
    AudioManager.prototype.ctor = function () {
        this.mAudioMap = {};
        /**
         * 默认音量大小
         * @type {number}
         */
        this.bgMusicVolume = 0.1;
        this.effectMusicVolume = 1;
        this.mMusicSwitch = 1;
        this.mEffectSwitch = 1;
    };
    AudioManager.prototype.play = function (audioSource, loop, callback, isBgMusic) {
        // if (isBgMusic && !this.mMusicSwitch) return;
        // if (!isBgMusic && !this.mEffectSwitch) return;
        var volume = isBgMusic ? this.bgMusicVolume : this.effectMusicVolume;
        // if (cc.sys.isBrowser) {
        // if(audioSource == this.brickSound){
        //     volume = 0.1;
        // } 
        volume = 1;
        cc.audioEngine.setEffectsVolume(1);
        cc.audioEngine.setMusicVolume(1);
        if (audioSource.name == "lose") {
            cc.audioEngine.setEffectsVolume(0.5);
        }
        else {
            cc.audioEngine.setEffectsVolume(1);
        }
        var context = cc.audioEngine.playEffect(audioSource, loop);
        if (callback) {
            cc.audioEngine.setFinishCallback(context, function () {
                callback.call(this);
            }.bind(this));
        }
        // cc.wwx.OutPut.log('play audio effect isBrowser: ' + context.src);
        this.mAudioMap[audioSource] = context;
        return audioSource;
        // } else {
        //     return audioSource;
        // }
    };
    AudioManager.prototype.save = function () {
        // cc.wwx.Storage.setItem(cc.wwx.Storage.Key_Setting_Music_Volume, this.mMusicSwitch);
        // cc.wwx.Storage.setItem(cc.wwx.Storage.Key_Setting_Effect_Volume, this.mEffectSwitch);
    };
    // static get Instance()
    // {
    //     if (this._instance == null)
    //     {
    //         this._instance = new AudioManager();
    //     }
    //     return this._instance;
    // }
    AudioManager.prototype.preload = function () {
        if (!(cc.sys.platform === cc.sys.WECHAT_GAME)) {
            return;
        }
        var musics = [
            this.audioGameBgm0,
        ];
        musics.forEach(function (path) {
        });
    };
    AudioManager.prototype.getAudioMusicSwitch = function () {
        return this.mMusicSwitch;
    };
    AudioManager.prototype.getAudioEffectSwitch = function () {
        return this.mEffectSwitch;
    };
    AudioManager.prototype.trunAudioSound = function (on) {
        this.switchMusic(on);
        this.switchEffect(on);
    };
    AudioManager.prototype.switchMusic = function (on) {
        if (this.mMusicSwitch != (on ? 1 : 0)) {
            this.mMusicSwitch = 1 - this.mMusicSwitch;
            // this.save();
        }
        if (on) {
            this.playMusicGame();
        }
        else {
            this.stopMusic();
        }
    };
    AudioManager.prototype.switchEffect = function (on) {
        if (this.mEffectSwitch != (on ? 1 : 0)) {
            this.mEffectSwitch = 1 - this.mEffectSwitch;
            // this.save();
        }
    };
    AudioManager.prototype.onHide = function () {
        cc.audioEngine.pauseAll();
    };
    AudioManager.prototype.onShow = function () {
        cc.audioEngine.resumeAll();
    };
    //播放音效
    AudioManager.prototype.playEffect = function (name, callback) {
        if (!cc.fx.GameConfig.GM_INFO.effectOpen) {
            return;
        }
        if (this[name])
            return this.play(this[name], false, callback, this.mEffectSwitch);
    };
    AudioManager.prototype.playMusic = function (key, callback, loop) {
        if (!cc.fx.GameConfig.GM_INFO.musicOpen) {
            return;
        }
        loop = typeof loop == 'undefined' || loop ? true : false;
        this.stopMusic();
        this.mMusicKey = this.play(key, loop, callback, true);
    };
    /**
     * 游戏背景音乐
     */
    AudioManager.prototype.playMusicGame = function () {
        this.stopMusic();
        this.playMusic(this.audioGameBgm0, {}, true);
    };
    /**
     * 停止背景音乐播放
     */
    AudioManager.prototype.stopMusic = function () {
        // cc.wwx.OutPut.log('stopMusic audio effect wx: ' + this.mMusicKey);
        cc.audioEngine.stopAll();
    };
    /**
     * 恢复被暂停的背景音乐播放
     */
    AudioManager.prototype.resumeMusic = function () {
        // 调用 cc.audioEngine 的 resumeMusic 方法恢复音乐播放
        cc.audioEngine.resumeMusic();
    };
    /*
    * 游戏开始音效
    *
    */
    AudioManager.prototype.playGameStart = function () {
    };
    /*
    * 失败的游戏结束
    */
    AudioManager.prototype.playGameOver = function () {
    };
    /*
        * 成功的游戏结束
        */
    AudioManager.prototype.playGameResultFailed = function () {
    };
    /*
    * 成功的游戏结束
    */
    AudioManager.prototype.playGameResultSuccess = function () {
    };
    /**
     * 报警的音效
     */
    /**
     * 按钮
     */
    AudioManager.prototype.playAudioButton = function () {
        // return this.play(this.audioButtonClick, false,null,this.mEffectSwitch);
    };
    var AudioManager_1;
    __decorate([
        property(cc.AudioClip)
    ], AudioManager.prototype, "audioGameBgm0", void 0);
    __decorate([
        property(cc.AudioClip)
    ], AudioManager.prototype, "xiaochu", void 0);
    __decorate([
        property(cc.AudioClip)
    ], AudioManager.prototype, "hit", void 0);
    __decorate([
        property(cc.AudioClip)
    ], AudioManager.prototype, "down", void 0);
    __decorate([
        property(cc.AudioClip)
    ], AudioManager.prototype, "fangxiang", void 0);
    __decorate([
        property(cc.AudioClip)
    ], AudioManager.prototype, "build", void 0);
    __decorate([
        property(cc.AudioClip)
    ], AudioManager.prototype, "win", void 0);
    __decorate([
        property(cc.AudioClip)
    ], AudioManager.prototype, "lose", void 0);
    __decorate([
        property(cc.AudioClip)
    ], AudioManager.prototype, "anniu_Big", void 0);
    __decorate([
        property(cc.AudioClip)
    ], AudioManager.prototype, "anniu_little", void 0);
    __decorate([
        property(cc.AudioClip)
    ], AudioManager.prototype, "zhuan1", void 0);
    __decorate([
        property(cc.AudioClip)
    ], AudioManager.prototype, "zhuan2", void 0);
    AudioManager = AudioManager_1 = __decorate([
        ccclass
    ], AudioManager);
    return AudioManager;
}(cc.Component));
exports.default = AudioManager;
;
// export { AudioManager };

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 15952 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/module/Tool/GameTool.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '43bfcJ6/25Fs4fHUE0PeBOX', 'GameTool');
// Script/module/Tool/GameTool.ts

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GameTool = void 0;
var MiniGameSdk_1 = require("../../Sdk/MiniGameSdk");
//最大工具类  各种公共方法，以及处理上传，获取后端接口数据
var GameTool = {
    _startTime: 0,
    _endTime: 0,
    _totalTime: 0,
    //获取userId
    Authentication: function () {
        var name = "user_" + cc.fx.GameConfig.GM_INFO.gameId;
        var data = JSON.parse(localStorage.getItem(name));
        if (data == "undifend" || data == null || data == "") {
            var urlNow = window.location.href;
            if (!this.containsTrain(urlNow)) {
                var url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback=" + location.href;
                window.location.href = url;
            }
        }
        else {
            cc.fx.StorageMessage.setStorage(name, data);
            cc.fx.GameConfig.GM_INFO.userId = parseInt(data.userId);
        }
    },
    containsTrain: function (str) {
        return /from=train/i.test(str);
    },
    //埋点上传
    setGameData: function () {
        //GAME_DATA 初始化 每次清零
        cc.fx.GameConfig.GAME_DATA = [];
        cc.fx.GameConfig.GAME_DATA.push(cc.fx.GameConfig.CLICK_DATA);
        cc.fx.GameConfig.CLICK_init();
        var data = cc.fx.GameConfig.GAME_DATA;
        var matchId = this.getMatchId();
        var postData = {
            "gameId": cc.fx.GameConfig.GM_INFO.gameId,
            "userId": cc.fx.GameConfig.GM_INFO.userId,
            "scode": cc.fx.GameConfig.GM_INFO.scode,
            "matchId": matchId,
            "data": data
        };
        // console.log("上传数据:",postData);
        // cc.fx.HttpUtil.uploadUserLogData(postData,function(){})
    },
    //上传排行榜  type为1
    setRank: function (data) {
        //GAME_DATA 初始化 每次清零
        var postData = {
            "gameId": cc.fx.GameConfig.GM_INFO.gameId,
            "userId": cc.fx.GameConfig.GM_INFO.userId,
            "type": 1,
            "score": data.score,
            "accuracy": data.date,
            "success": cc.fx.GameConfig.GM_INFO.success
        };
        // cc.fx.HttpUtil.rankData(1,function(){},postData);
    },
    //获取排行榜 type为2
    getRank: function (data, callback) {
        var rankLength = data.length;
        var postData = {
            "gameId": cc.fx.GameConfig.GM_INFO.gameId,
            "userId": cc.fx.GameConfig.GM_INFO.userId,
            "page": 1,
            "pageSize": rankLength
        };
        //回调进getRankData
        // cc.fx.HttpUtil.rankData(2,data =>{callback(data)},postData);
    },
    //获取matchId  用于上传每次点击数据里面记录id方便查询
    getMatchId: function () {
        var matchId = cc.sys.localStorage.getItem("matchId");
        var tempId = matchId;
        if (matchId == "undifend" || matchId == null) {
            matchId = this.setMatchId();
        }
        else {
            if (this.containsNanana(matchId) == true) {
                matchId = this.setMatchId();
            }
            else {
                var char = parseInt(tempId.substring(10, tempId.length));
                if (cc.fx.GameConfig.GM_INFO.level == 1) {
                    char += 1;
                    matchId = tempId.slice(0, 10) + char + "";
                    if (this.containsNanana(matchId))
                        matchId = this.setMatchId();
                    cc.fx.GameConfig.GM_INFO.matchId = matchId;
                    cc.sys.localStorage.setItem("matchId", matchId);
                }
            }
        }
        if (this.containsNanana(matchId) == true) {
            matchId = this.setMatchId();
        }
        return matchId;
    },
    //检测matchId 如果有缓存以前的nanana数据清除
    containsNanana: function (str) {
        return /na/i.test(str);
    },
    //重新设置MatchId
    setMatchId: function () {
        // 定义包含可用字符的字符集
        var characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
        // 创建一个数组以保存随机字符
        var uuidArray = [];
        // 循环10次 生成10位的UUID
        for (var i = 0; i < 10; i++) {
            // 生成随机索引，范围是字符集的长度
            var randomIndex = Math.floor(Math.random() * characters.length);
            // 从字符集中获取随机字符
            var randomChar = characters.charAt(randomIndex);
            // 将字符添加到数组中
            uuidArray.push(randomChar);
        }
        var data = uuidArray.join('') + 1 + "";
        cc.sys.localStorage.setItem("matchNumber", 1);
        cc.sys.localStorage.setItem("matchId", data);
        cc.fx.GameConfig.GM_INFO.matchId = data;
        return data;
    },
    //截取名字
    subName: function (name, length) {
        if (name.length > length) {
            name = name.substring(0, length) + "...";
        }
        return name;
    },
    //设置头像
    setPic: function (node, pic) {
        node.active = false;
        var url = pic;
        setTimeout(function () {
            fetch(url)
                .then(function (response) {
                return response.headers.get('Content-Length');
            })
                .then(function (errNo) {
                if (errNo == "5093") {
                    node.active = true;
                }
            })
                .catch(function (error) {
                // console.error('Error fetching X-Info:', error);
            });
        }, 100);
        cc.assetManager.loadRemote(url, { ext: '.png' }, function (err, texture) {
            if (texture) {
                node.active = true;
                node.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(texture);
            }
            else {
                // console.log(err,texture)
            }
        });
    },
    //第一个参数把目标带进来处理，第二个参数为名字长度，不同场景不同需求
    //名字4短，小排行，名字6长，大排行
    getRankData: function (data, target, nameLength) {
        target.listData = data.data.list;
        target.selfData = data.data.info;
        var rankData = [];
        var self = false;
        cc.fx.GameTool.setPic(target.selfNode.getChildByName("pic").getChildByName("icon"), target.selfData.pic);
        for (var i = 0; i <= target.listData.length - 1; i++) {
            rankData.push({ rank: (i + 1), name: target.listData[i].nickName, total: target.listData[i].score, time: null, pic: target.listData[i].pic });
            if (cc.fx.GameConfig.GM_INFO.userId == target.listData[i].userId) {
                self = true;
                target.rankNumber = i;
                target.selfNode.getChildByName("rankLab").getComponent(cc.Label).string = (i + 1) + "";
            }
            if (i == (target.listData.length - 1) && self == false) {
                target.rankNumber = i;
                target.selfNode.getChildByName("rankLab").getComponent(cc.Label).string = "99+";
            }
        }
        target.selfData.nickName = cc.fx.GameTool.subName(target.selfData.nickName, nameLength);
        target.selfNode.getChildByName("nameLab").getComponent(cc.Label).string = target.selfData.nickName;
        target.selfNode.getChildByName("totalLab").getComponent(cc.Label).string = target.selfData.score;
        var timeTemp = cc.fx.GameTool.getTimeShenNong(target.selfData.totleTimes);
        // target.selfNode.getChildByName("timeLab").getComponent(cc.Label).string = timeTemp + "";
        switch (target.selfNode.getChildByName("rankLab").getComponent(cc.Label).string) {
            case "1":
                target.selfNode.getChildByName("rank").getChildByName("one").active = true;
                break;
            case "2":
                target.selfNode.getChildByName("rank").getChildByName("two").active = true;
                break;
            case "3":
                target.selfNode.getChildByName("rank").getChildByName("three").active = true;
                break;
        }
        // 大排行
        if (nameLength == 6) {
            target.rankList.setData(rankData);
            target.selfNode.opacity = 255;
            if (target.selfData.totalSunCount == 0)
                target.selfNode.opacity = 0;
        }
    },
    getSeedRandom: function (min, max) {
        // console.log("随机数:",cc.fx.GameConfig.GM_INFO.currSeed);
        max = max || 1;
        min = min || 0;
        cc.fx.GameConfig.GM_INFO.currSeed = (cc.fx.GameConfig.GM_INFO.currSeed * 9301 + 49297) % 233280;
        var rnd = cc.fx.GameConfig.GM_INFO.currSeed / 233280.0;
        var tmp = min + rnd * (max - min);
        return parseInt(tmp);
    },
    //获取关卡配置的那个关卡数
    getCustom: function (type) {
        var custom = cc.fx.StorageMessage.getStorage(cc.fx.storageType.storageTypeCustom);
        if (custom == "undifend" || custom == null || custom == "") {
            this.setCustom();
        }
        else {
            cc.fx.GameConfig.GM_INFO_SET("custom", custom[0]);
            if (custom[0] != 0 || type == true) {
                custom.shift();
                if (custom.length == 0) {
                    this.setCustom();
                }
                else
                    cc.fx.StorageMessage.setStorage(cc.fx.storageType.storageTypeCustom, custom);
            }
        }
    },
    //本地没有存储到配置，或者配置用完，重新创建配置
    setCustom: function () {
        var arrayLength = cc.fx.GameConfig.LEVEL_INFO.length;
        var arrayList = [];
        for (var i = 1; i < arrayLength; i++) {
            arrayList.push(i);
        }
        arrayList.sort(function () { return Math.random() - 0.5; });
        arrayList.unshift(0);
        cc.fx.GameConfig.GM_INFO_SET("custom", arrayList[0]);
        cc.fx.StorageMessage.setStorage(cc.fx.storageType.storageTypeCustom, arrayList);
    },
    getSetScreenResolutionFlag: function () {
        var size = cc.winSize;
        var width = size.width;
        var height = size.height;
        if ((height / width) > (16.2 / 9))
            return false;
        return true;
    },
    //判断全面屏适配
    setFit: function (canvas) {
        var flag = cc.fx.GameTool.getSetScreenResolutionFlag();
        if (flag) {
            // console.log("不是全面屏");
        }
        else {
            // console.log("是全面屏");
        }
        return flag;
    },
    //获取游戏信息
    getGameInfo: function (node) {
        var jg = false;
        return jg;
    },
    //设置游戏信息
    setGameInfo: function (pd) {
    },
    //打字机效果
    typingAni: function (label, text, cb, target) {
        var self = target;
        var html = '';
        var arr = text.split('');
        var len = arr.length;
        var step = 0;
        self.func = function () {
            html += arr[step];
            label.string = html;
            if (++step == len) {
                self.unschedule(self.func);
                cb && cb();
            }
        };
        self.schedule(self.func, 0.1, cc.macro.REPEAT_FOREVER, 0);
    },
    //输入秒,返回需要展示时间格式
    getTimeMargin: function (second) {
        var total = 0;
        total = second;
        var hour = 0;
        hour = parseInt((total / 3600) + ""); //计算整数小时数
        var afterHour = total - hour * 60 * 60; //取得算出小时数后剩余的秒数
        var min = parseInt((afterHour / 60) + ""); //计算整数分
        var m = "" + min;
        if (min < 10)
            m = "0" + min;
        var afterMin = total - hour * 60 * 60 - min * 60; //取得算出分后剩余的秒数
        var miao = afterMin + "";
        if (afterMin < 10)
            miao = "0" + afterMin;
        return m + ':' + miao;
    },
    //输入秒,返回需要展示时间格式
    getTimeShenNong: function (second) {
        second = parseInt(second / 1000 + "");
        var total = 0;
        total = second;
        var min = 0;
        if (total > 60) {
            min = parseInt((total / 60) + ""); //计算整数分
        }
        var m = min + "'";
        var afterMin = total - min * 60; //取得算出分后剩余的秒数
        var miao = afterMin + "''";
        return m + miao;
    },
    //打乱数组
    shuffleArray: function (array) {
        var _a;
        for (var i = array.length - 1; i > 0; i--) {
            var j = Math.floor(Math.random() * (i + 1));
            _a = [array[j], array[i]], array[i] = _a[0], array[j] = _a[1];
        }
        return array;
    },
    //增加关卡数
    addLevel: function (time) {
        cc.fx.GameConfig.GM_INFO.level += 1;
        if (cc.fx.GameConfig.GM_INFO.level > 156) {
            cc.fx.GameConfig.GM_INFO.level = 156;
        }
        var timestamp = Date.now();
        var levelInfo = {
            level: cc.fx.GameConfig.GM_INFO.level,
            timestamp: timestamp,
        };
        // console.log("55555存储关卡数据:",levelInfo);
        cc.fx.StorageMessage.setStorage("level", levelInfo);
        var data = {
            time: time.count_Time,
            add_Time: time.add_Time,
            result: "success"
        };
        cc.fx.GameTool.shushu_Track("finish_stage", data);
        MiniGameSdk_1.MiniGameSdk.API.shushu_SetSuperProperties();
        cc.fx.GameTool.setUserLevel(function (data) {
            // console.log("存储结果:",data);
            // console.log("上传",data);
        });
    },
    //改变金币信息
    changeCoin: function (coin) {
        console.log("changeCoin", coin);
        if (coin == undefined)
            return;
        if (coin < 0 && cc.fx.GameConfig.GM_INFO.coin < -coin) {
            // console.log("金币不足",cc.fx.GameConfig.GM_INFO.coin,-coin);
            return;
        }
        cc.fx.GameConfig.GM_INFO.coin += coin;
        if (cc.fx.GameConfig.GM_INFO.coin < 0) {
            cc.fx.GameConfig.GM_INFO.coin = 0;
        }
        // console.log("改变的金币:",coin);
        // console.log("自身金币信息:",cc.fx.GameConfig.GM_INFO.coin);
        var timestamp = Date.now();
        var coinInfo = {
            coin: cc.fx.GameConfig.GM_INFO.coin,
            timestamp: timestamp,
        };
        MiniGameSdk_1.MiniGameSdk.API.shushu_SetSuperProperties();
        cc.fx.StorageMessage.setStorage("coin", coinInfo);
        // console.log("存储金币数据:",cc.fx.GameConfig.GM_INFO.coin,coinInfo);
        cc.fx.GameTool.setUserCoin(function (data) {
            // console.log("上传",data);
        });
    },
    //获取用户金币数量
    getUserCoin: function (callback) {
        if (typeof wx !== 'undefined' && wx !== null) {
            //@ts-ignore
            wx.cloud.callFunction({
                name: 'userCoin',
                data: {
                    action: 'read'
                },
                success: function (res) {
                    // console.log('读取用户金币数据成功', res.result)
                    if (callback)
                        callback(res);
                },
                fail: function (err) {
                    callback(err);
                }
            });
        }
    },
    //改变用户金币
    setUserCoin: function (callback) {
        if (typeof wx !== 'undefined' && wx !== null) {
            if (cc.fx.GameConfig.GM_INFO.coin <= 0 || cc.fx.GameConfig.GM_INFO.coin == undefined) {
                console.log("金币上传失败", cc.fx.GameConfig.GM_INFO.coin);
                // MiniGameSdk.API.showToast(cc.fx.GameConfig.GM_INFO.coin);
                cc.fx.GameConfig.GM_INFO.coin = 0;
            }
            console.log("即将上传的金币数量:", cc.fx.GameConfig.GM_INFO.coin);
            //@ts-ignore
            wx.cloud.callFunction({
                name: 'userCoin',
                data: {
                    action: 'save',
                    coinAmount: cc.fx.GameConfig.GM_INFO.coin
                },
                success: function (res) {
                    // console.log('云函数返回结果:', res);
                    if (res.result.code == 200) {
                        // console.log('存储金币数据成功',cc.fx.GameConfig.GM_INFO.coin);
                    }
                    if (callback) {
                        callback(res);
                    }
                },
                fail: function (err) {
                    // console.log('存储金币数据失败')
                    if (callback) {
                        callback(err);
                    }
                    console.error('存储用户数据失败', err);
                }
            });
        }
    },
    //获取用户关卡数
    getUserLevel: function (callback) {
        if (typeof wx !== 'undefined' && wx !== null) {
            //@ts-ignore
            wx.cloud.callFunction({
                name: 'userLevel',
                data: {
                    action: 'read'
                },
                success: function (res) {
                    if (callback)
                        callback(res);
                },
                fail: function (err) {
                    callback(err);
                }
            });
        }
    },
    //进游戏处理 体力值情况
    getHealth: function (callback) {
        var health = cc.fx.StorageMessage.getStorage("health");
        var timestamp = Date.now();
        cc.fx.GameConfig.GM_INFO.hp = 5;
        //没有存储过体力值
        if (health == null || health == undefined || health == "") {
            console.log("没存储过体力值，初进");
            cc.fx.GameConfig.GM_INFO.hp = 5;
            cc.fx.GameTool.getUserHealth(function (data) {
                console.log("体力接口返回结果", data);
                if (data.result.code == 200) {
                    cc.fx.GameConfig.GM_INFO.hp = data.result.data;
                    cc.fx.GameConfig.GM_INFO.min_Time = data.result.timestamp;
                    var healthInfo = {
                        "health": cc.fx.GameConfig.GM_INFO.hp,
                        "timestamp": data.result.timestamp
                    };
                    MiniGameSdk_1.MiniGameSdk.API.shushu_SetSuperProperties();
                    cc.fx.StorageMessage.setStorage("health", healthInfo);
                }
                else if (data.result.code == 404 && data.result.message == "未找到体力数据") {
                    cc.fx.GameTool.setUserHealth(0, function () {
                    });
                }
                if (callback)
                    callback();
            });
        }
        else {
            console.log("有存储过体力值:", health);
            cc.fx.GameConfig.GM_INFO.hp = health.health;
            if (callback) {
                console.log("体力值读取完毕");
                callback();
            }
            if (health.health < 0) {
                console.log("体力值异常，归零");
                cc.fx.GameConfig.GM_INFO.hp = 0;
                cc.fx.GameTool.setUserHealth(0, function () {
                    if (callback)
                        callback();
                });
            }
            else if (health.health < 5) {
                // 30分钟的毫秒数
                var thirtyMinutes = 30 * 60 * 1000;
                var elapsedTime = timestamp - health.timestamp;
                // 计算恢复的体力值
                var recoveredHealth = Math.min(5 - health.health, Math.floor(elapsedTime / thirtyMinutes));
                if (recoveredHealth > 0) {
                    health.health += recoveredHealth;
                    cc.fx.GameTool.setUserHealth(recoveredHealth, function () {
                        if (callback)
                            callback();
                    });
                    console.log("\u4F53\u529B\u503C\u6062\u590D " + recoveredHealth + " \u70B9\uFF0C\u5F53\u524D\u4F53\u529B\u503C: " + cc.fx.GameConfig.GM_INFO.hp);
                }
                else {
                    // 计算距离下一次恢复的剩余时间
                    var remainingTime = Math.ceil((thirtyMinutes - (elapsedTime % thirtyMinutes)) / 1000);
                    console.log("\u4F53\u529B\u503C\u672A\u6EE1\uFF0C\u5F85\u6062\u590D\uFF0C\u8DDD\u79BB\u4E0B\u4E00\u6B21\u6062\u590D\u8FD8\u5269 " + remainingTime + " \u79D2");
                    cc.fx.GameConfig.GM_INFO.min_Time = remainingTime;
                }
            }
        }
    },
    //获取用户体力值
    getUserHealth: function (callback) {
        if (typeof wx !== 'undefined' && wx !== null) {
            console.log("即将进入体力获取接口");
            //@ts-ignore
            wx.cloud.callFunction({
                name: 'userHealth',
                data: {
                    action: 'read'
                },
                success: function (res) {
                    // console.log("体力获取成功",res);
                    if (callback)
                        callback(res);
                },
                fail: function (err) {
                    // console.log("体力获取失败",err);
                    callback(err);
                }
            });
        }
    },
    //设置用户体力值  有可能加，有可能定时器减
    setUserHealth: function (health, callback) {
        cc.fx.GameConfig.GM_INFO.hp += health;
        // if(health < 0) {
        // }
        // else MiniGameSdk.API.showToast("体力值恢复");
        var timestamp = Date.now();
        var healthInfo = {};
        //如果消耗之前不是满体力，说明已经在恢复期，并不用修改时间
        if (health < 0 && cc.fx.GameConfig.GM_INFO.hp != 4) {
            var oldTime = cc.fx.StorageMessage.getStorage("health").timestamp;
            healthInfo = {
                "health": cc.fx.GameConfig.GM_INFO.hp,
                "timestamp": oldTime
            };
        }
        else {
            healthInfo = {
                "health": cc.fx.GameConfig.GM_INFO.hp,
                "timestamp": timestamp
            };
        }
        cc.fx.StorageMessage.setStorage("health", healthInfo);
        MiniGameSdk_1.MiniGameSdk.API.shushu_SetSuperProperties();
        if (typeof wx !== 'undefined' && wx !== null) {
            //@ts-ignore
            wx.cloud.callFunction({
                name: 'userHealth',
                data: {
                    action: 'save',
                    healthAmount: cc.fx.GameConfig.GM_INFO.hp,
                    timestamp: timestamp
                },
                success: function (res) {
                    if (callback) {
                        callback(res);
                    }
                },
                fail: function (err) {
                    if (callback) {
                        callback(err);
                    }
                    // console.error('存储关卡数据失败', err)
                }
            });
        }
    },
    //购买行为
    buyReview: function (coin, callback) {
        if (typeof wx !== 'undefined' && wx !== null) {
            // console.log("实际即将消耗金币:",coin);
            // this.changeCoin(coin);
            callback();
        }
    },
    //更改用户道具数
    buyProp: function (propid, callback) {
        if (typeof wx !== 'undefined' && wx !== null) {
            cc.fx.GameTool.changeCoin(-1500);
            cc.fx.GameTool.setUserProp(propid, 3, function (data) {
            });
            var data = {
                id: (propid + ""),
                num: 3
            };
            cc.fx.GameTool.shushu_Track("resource_get", data);
            var _id = "";
            if (propid == 2001)
                _id = "freeze_in_game";
            else if (propid == 2002)
                _id = "hammer_in_game";
            else if (propid == 2003)
                _id = "wand_in_game";
            var buyData = {
                item_id: _id,
                item_num: 1,
                item_price: 1500,
                cost_type: "gold"
            };
            console.log("____________即将上传Shop_buy", buyData);
            cc.fx.GameTool.shushu_Track("shop_buy", buyData);
            callback();
        }
    },
    //改变用户关卡
    setUserLevel: function (callback) {
        if (typeof wx !== 'undefined' && wx !== null) {
            // if(cc.fx.GameConfig.GM_INFO.level <= 0 || cc.fx.GameConfig.GM_INFO.level == undefined){
            //     console.log("等级重置为0");
            //     cc.fx.GameConfig.GM_INFO.level = 0;
            // }
            // console.log("即将上传的关卡数:",cc.fx.GameConfig.GM_INFO.level);
            //@ts-ignore
            wx.cloud.callFunction({
                name: 'userLevel',
                data: {
                    action: 'save',
                    levelAmount: cc.fx.GameConfig.GM_INFO.level
                },
                success: function (res) {
                    // console.log('云函数返回结果:', res);
                    // console.log('存储关卡数据成功',cc.fx.GameConfig.GM_INFO.level);
                    if (callback) {
                        callback(res);
                    }
                },
                fail: function (err) {
                    // console.log('存储关卡数据失败')
                    return;
                    if (callback) {
                        callback(err);
                    }
                    console.error('存储关卡数据失败', err);
                }
            });
        }
    },
    //获取用户关卡数
    getUserProp: function (callback) {
        if (typeof wx !== 'undefined' && wx !== null) {
            //@ts-ignore
            wx.cloud.callFunction({
                name: 'userProp',
                data: {
                    action: 'read'
                },
                success: function (res) {
                    // console.log('读取用户道具数据成功', res.result)
                    if (res.result.data) {
                        // cc.fx.GameConfig.GM_INFO.freezeAmount = res.result.data.freeze;
                        // cc.fx.GameConfig.GM_INFO.hammerAmount = res.result.data.hammer;
                        // cc.fx.GameConfig.GM_INFO.magicAmount = res.result.data.magic_wand;
                    }
                    if (callback)
                        callback(res);
                },
                fail: function (err) {
                    callback(err);
                }
            });
        }
    },
    //改变用户道具
    setUserProp: function (propid, amount, callback) {
        if (typeof wx !== 'undefined' && wx !== null) {
            var newPropData = null;
            if (propid == 0) {
                newPropData = {
                    freeze: cc.fx.GameConfig.GM_INFO.freezeAmount,
                    hammer: cc.fx.GameConfig.GM_INFO.hammerAmount,
                    magic_wand: cc.fx.GameConfig.GM_INFO.magicAmount,
                };
            }
            else if (propid == 2001) {
                newPropData = amount;
            }
            else if (propid == 2002) {
                newPropData = amount;
            }
            else if (propid == 2003) {
                newPropData = amount;
            }
            //@ts-ignore
            wx.cloud.callFunction({
                name: 'userProp',
                data: {
                    action: 'save',
                    propType: propid,
                    propData: newPropData
                },
                success: function (res) {
                    // console.log('云函数返回结果:', res);
                    if (callback) {
                        callback(res);
                    }
                    // console.log('存储道具数据成功')
                },
                fail: function (err) {
                    // console.log('存储道具数据失败')
                    if (callback) {
                        callback(err);
                    }
                    console.error('存储道具数据失败', err);
                }
            });
        }
    },
    // 检查是否有足够的硬币
    consumeCoins: function (requiredCoins, propName, amount, callback) {
    },
    // 设置用户信息
    setUserInfo: function (callback) {
        //@ts-ignore
        if (typeof wx !== 'undefined' && wx !== null) {
            var time = cc.fx.GameTool.formatDate(new Date());
            var userInfo = {
                // 这里填写要存储的用户数据
                username: cc.fx.GameConfig.GM_INFO.username,
                useravatar: cc.fx.GameConfig.GM_INFO.useravatar,
                register_time: time
            };
            //@ts-ignore
            wx.cloud.callFunction({
                name: 'userData',
                data: {
                    action: 'save',
                    userData: userInfo
                },
                success: function (res) {
                    // console.log('存储用户数据成功')
                    if (callback) {
                        callback(res);
                    }
                },
                fail: function (err) {
                    if (callback) {
                        callback("fail");
                    }
                }
            });
        }
    },
    formatDate: function (date) {
        var year = date.getFullYear();
        var month = String(date.getMonth() + 1).padStart(2, '0');
        var day = String(date.getDate()).padStart(2, '0');
        var hours = String(date.getHours()).padStart(2, '0');
        var minutes = String(date.getMinutes()).padStart(2, '0');
        var seconds = String(date.getSeconds()).padStart(2, '0');
        var milliseconds = String(date.getMilliseconds()).padStart(3, '0');
        return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds + "." + milliseconds;
    },
    //获取时间戳
    getTime: function () {
        var timestamp = (new Date().getTime());
        return timestamp;
    },
    pushLister: function () {
    },
    removeAllLister: function () {
    },
    shushu_Track: function (name, data) {
        var eventData = {};
        switch (name) {
            case "register":
                break;
            case "enter_stage":
                eventData = {
                    stage_id: (cc.fx.GameConfig.GM_INFO.level + 1)
                };
                break;
            case "finish_stage":
                eventData = {
                    stage_id: (cc.fx.GameConfig.GM_INFO.level + 1),
                    stage_duration: data.time,
                    added_time: data.add_Time,
                    result: data.result
                };
                break;
            case "resource_get":
                eventData = {
                    change_reason: "购买道具",
                    change_num: data.num,
                    resource_id: data.id //道具id
                };
                break;
            case "resource_cost":
                eventData = {
                    change_reason: "使用道具",
                    change_num: data.num,
                    resource_id: data.id //道具id
                };
                break;
            case "shop_buy":
                eventData = {
                    item_id: data.item_id,
                    item_num: data.item_num,
                    item_price: data.item_price,
                    cost_type: data.cost_type,
                };
                console.log("数据:", eventData);
                break;
        }
        // MiniGameSdk.API.shushu_Track(name,eventData);
        MiniGameSdk_1.MiniGameSdk.API.shushu_Track(name, eventData);
    },
    getWechatGameVersion: function () {
        //@ts-ignore
        var accountInfo = wx.getAccountInfoSync();
        var miniProgram = accountInfo.miniProgram;
        switch (miniProgram.envVersion) {
            case 'develop':
                return '开发版';
            case 'trial':
                return '体验版';
            case 'release':
                return '正式版';
            default:
                return '未知版本';
        }
    },
};
exports.GameTool = GameTool;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 80232 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/MapBlock.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '52958xsurVAp54WMo+xFDo6', 'MapBlock');
// Script/MapBlock.ts

"use strict";
// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var NewClass = /** @class */ (function (_super) {
    __extends(NewClass, _super);
    function NewClass() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.label = null;
        _this.block_Id = '';
        // LIFE-CYCLE CALLBACKS:
        _this.posX = 0; //地图块的X坐标
        _this.posY = 0; //地图块的Y坐标
        _this.direction = ""; //地图块的方向
        return _this;
        // update (dt) {}
    }
    // onLoad () {}
    NewClass.prototype.start = function () {
        this.direction = "";
        this.block_Id = "";
        // this.node.getChildByName("num").getComponent(cc.Label).string = this.direction;
    };
    NewClass.prototype.setDiraction = function (direction) {
        this.direction = direction;
        // this.node.getChildByName("num").getComponent(cc.Label).string = this.direction;
    };
    NewClass.prototype.init = function (posX, posY) {
        this.posX = posX;
        this.posY = posY;
    };
    __decorate([
        property(cc.Label)
    ], NewClass.prototype, "label", void 0);
    __decorate([
        property
    ], NewClass.prototype, "block_Id", void 0);
    NewClass = __decorate([
        ccclass
    ], NewClass);
    return NewClass;
}(cc.Component));
exports.default = NewClass;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcU2NyaXB0XFxNYXBCbG9jay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsb0JBQW9CO0FBQ3BCLHdFQUF3RTtBQUN4RSxtQkFBbUI7QUFDbkIsa0ZBQWtGO0FBQ2xGLDhCQUE4QjtBQUM5QixrRkFBa0Y7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUU1RSxJQUFBLEtBQXNCLEVBQUUsQ0FBQyxVQUFVLEVBQWxDLE9BQU8sYUFBQSxFQUFFLFFBQVEsY0FBaUIsQ0FBQztBQUcxQztJQUFzQyw0QkFBWTtJQUFsRDtRQUFBLHFFQWdDQztRQTdCRyxXQUFLLEdBQWEsSUFBSSxDQUFDO1FBR3ZCLGNBQVEsR0FBVyxFQUFFLENBQUM7UUFFdEIsd0JBQXdCO1FBRXhCLFVBQUksR0FBVyxDQUFDLENBQUMsQ0FBZSxTQUFTO1FBQ3pDLFVBQUksR0FBVyxDQUFDLENBQUMsQ0FBZSxTQUFTO1FBQ3pDLGVBQVMsR0FBVyxFQUFFLENBQUMsQ0FBVSxRQUFROztRQW1CekMsaUJBQWlCO0lBQ3JCLENBQUM7SUFuQkcsZUFBZTtJQUVmLHdCQUFLLEdBQUw7UUFDSSxJQUFJLENBQUMsU0FBUyxHQUFHLEVBQUUsQ0FBQztRQUNwQixJQUFJLENBQUMsUUFBUSxHQUFHLEVBQUUsQ0FBQztRQUNuQixrRkFBa0Y7SUFDdEYsQ0FBQztJQUVELCtCQUFZLEdBQVosVUFBYSxTQUFTO1FBQ2xCLElBQUksQ0FBQyxTQUFTLEdBQUcsU0FBUyxDQUFDO1FBQzNCLGtGQUFrRjtJQUN0RixDQUFDO0lBRUQsdUJBQUksR0FBSixVQUFLLElBQUksRUFBQyxJQUFJO1FBQ1YsSUFBSSxDQUFDLElBQUksR0FBRyxJQUFJLENBQUM7UUFDakIsSUFBSSxDQUFDLElBQUksR0FBRyxJQUFJLENBQUM7SUFDckIsQ0FBQztJQTFCRDtRQURDLFFBQVEsQ0FBQyxFQUFFLENBQUMsS0FBSyxDQUFDOzJDQUNJO0lBR3ZCO1FBREMsUUFBUTs4Q0FDYTtJQU5MLFFBQVE7UUFENUIsT0FBTztPQUNhLFFBQVEsQ0FnQzVCO0lBQUQsZUFBQztDQWhDRCxBQWdDQyxDQWhDcUMsRUFBRSxDQUFDLFNBQVMsR0FnQ2pEO2tCQWhDb0IsUUFBUSIsImZpbGUiOiIiLCJzb3VyY2VSb290IjoiLyIsInNvdXJjZXNDb250ZW50IjpbIi8vIExlYXJuIFR5cGVTY3JpcHQ6XHJcbi8vICAtIGh0dHBzOi8vZG9jcy5jb2Nvcy5jb20vY3JlYXRvci9tYW51YWwvZW4vc2NyaXB0aW5nL3R5cGVzY3JpcHQuaHRtbFxyXG4vLyBMZWFybiBBdHRyaWJ1dGU6XHJcbi8vICAtIGh0dHBzOi8vZG9jcy5jb2Nvcy5jb20vY3JlYXRvci9tYW51YWwvZW4vc2NyaXB0aW5nL3JlZmVyZW5jZS9hdHRyaWJ1dGVzLmh0bWxcclxuLy8gTGVhcm4gbGlmZS1jeWNsZSBjYWxsYmFja3M6XHJcbi8vICAtIGh0dHBzOi8vZG9jcy5jb2Nvcy5jb20vY3JlYXRvci9tYW51YWwvZW4vc2NyaXB0aW5nL2xpZmUtY3ljbGUtY2FsbGJhY2tzLmh0bWxcclxuXHJcbmNvbnN0IHtjY2NsYXNzLCBwcm9wZXJ0eX0gPSBjYy5fZGVjb3JhdG9yO1xyXG5cclxuQGNjY2xhc3NcclxuZXhwb3J0IGRlZmF1bHQgY2xhc3MgTmV3Q2xhc3MgZXh0ZW5kcyBjYy5Db21wb25lbnQge1xyXG5cclxuICAgIEBwcm9wZXJ0eShjYy5MYWJlbClcclxuICAgIGxhYmVsOiBjYy5MYWJlbCA9IG51bGw7XHJcblxyXG4gICAgQHByb3BlcnR5XHJcbiAgICBibG9ja19JZDogc3RyaW5nID0gJyc7XHJcblxyXG4gICAgLy8gTElGRS1DWUNMRSBDQUxMQkFDS1M6XHJcblxyXG4gICAgcG9zWDogbnVtYmVyID0gMDsgICAgICAgICAgICAgICAvL+WcsOWbvuWdl+eahFjlnZDmoIdcclxuICAgIHBvc1k6IG51bWJlciA9IDA7ICAgICAgICAgICAgICAgLy/lnLDlm77lnZfnmoRZ5Z2Q5qCHXHJcbiAgICBkaXJlY3Rpb246IHN0cmluZyA9IFwiXCI7ICAgICAgICAgIC8v5Zyw5Zu+5Z2X55qE5pa55ZCRXHJcbiAgICAvLyBvbkxvYWQgKCkge31cclxuXHJcbiAgICBzdGFydCAoKSB7XHJcbiAgICAgICAgdGhpcy5kaXJlY3Rpb24gPSBcIlwiO1xyXG4gICAgICAgIHRoaXMuYmxvY2tfSWQgPSBcIlwiO1xyXG4gICAgICAgIC8vIHRoaXMubm9kZS5nZXRDaGlsZEJ5TmFtZShcIm51bVwiKS5nZXRDb21wb25lbnQoY2MuTGFiZWwpLnN0cmluZyA9IHRoaXMuZGlyZWN0aW9uO1xyXG4gICAgfVxyXG5cclxuICAgIHNldERpcmFjdGlvbihkaXJlY3Rpb24pe1xyXG4gICAgICAgIHRoaXMuZGlyZWN0aW9uID0gZGlyZWN0aW9uOyAgIFxyXG4gICAgICAgIC8vIHRoaXMubm9kZS5nZXRDaGlsZEJ5TmFtZShcIm51bVwiKS5nZXRDb21wb25lbnQoY2MuTGFiZWwpLnN0cmluZyA9IHRoaXMuZGlyZWN0aW9uO1xyXG4gICAgfVxyXG5cclxuICAgIGluaXQocG9zWCxwb3NZKXtcclxuICAgICAgICB0aGlzLnBvc1ggPSBwb3NYO1xyXG4gICAgICAgIHRoaXMucG9zWSA9IHBvc1k7XHJcbiAgICB9XHJcblxyXG4gICAgLy8gdXBkYXRlIChkdCkge31cclxufVxyXG4iXX0=
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/RankManager.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'e74a999IDFOabyymZgXQIiy', 'RankManager');
// Script/RankManager.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var List_1 = require("./module/RankList/List");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
//排行榜
var RankManager = /** @class */ (function (_super) {
    __extends(RankManager, _super);
    function RankManager() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.Player = null;
        _this.selfNode = null;
        _this.phone = null;
        return _this;
    }
    RankManager.prototype.onLoad = function () {
        this.init();
    };
    //初始化数据
    RankManager.prototype.init = function () {
        this.rankList = cc.find("ScrollView", this.node).getComponent(List_1.default);
        this.Player.getChildByName("rank").active = false;
        this.listData = [];
        this.selfData = null;
        this.rankNumber = 100;
        this.rankTotal = 100;
        this.selfNode.opacity = 0;
    };
    RankManager.prototype.start = function () {
        this.Player.active = false;
        this.getRank();
    };
    //调用获取排行榜接口
    RankManager.prototype.getRank = function () {
        var _this = this;
        var dataFile = {
            length: 100
        };
        cc.fx.GameTool.getRank(dataFile, function (data) { return _this.getRankData(data); });
    };
    //实际设置排行数据
    RankManager.prototype.getRankData = function (data) {
        if (data) {
            // console.log(data);
            cc.fx.GameTool.getRankData(data, this, 6);
            this.setPic(this.selfData.pic);
        }
    };
    //返回按钮
    RankManager.prototype.backClick = function () {
        cc.director.loadScene("LoadScene");
    };
    //最上方用户动画
    RankManager.prototype.playerAction = function () {
        var _this = this;
        //-254 377  210 453
        this.Player.getChildByName("rank").active = false;
        var time = 1;
        this.tween = cc.tween(this.Player)
            .to(2, { position: cc.v3(215, 525, 0) })
            .call(function () {
            _this.Player.getChildByName("rank").active = true;
            _this.Player.getChildByName("rank").getChildByName("number")
                .getComponent(cc.Label).string = parseInt(time * 100 + "") + "%";
        })
            .start();
        time = (this.listData.length - this.rankNumber) / this.listData.length;
        if (this.listData.length >= 99) {
            if (this.rankNumber >= 99) {
                time = (Math.random() * 49 + 1) / 100;
                var matchId = cc.sys.localStorage.getItem("matchNumber");
                if (matchId == null || matchId == undefined) {
                    time = 0;
                }
            }
        }
        setTimeout(function () {
            if (_this.tween)
                _this.tween.stop();
            _this.Player.getChildByName("rank").active = true;
            _this.Player.getChildByName("rank").getChildByName("number")
                .getComponent(cc.Label).string = parseInt(time * 100 + "") + "%";
        }, time * 2000);
    };
    //设置头像  处理的逻辑比较多，不用公共类的了
    RankManager.prototype.setPic = function (pic) {
        var _this = this;
        this.phone.node.parent.getChildByName("icon").active = false;
        this.phone.node.active = false;
        this.Player.active = true;
        this.Player.opacity = 0;
        this.Player.getChildByName("mask").getChildByName("icon").active = false;
        this.Player.getChildByName("mask").getChildByName("phone").active = false;
        fetch(pic)
            .then(function (response) {
            return response.headers.get('Content-Length');
        })
            .then(function (errNo) {
            if (errNo == "5093") {
                _this.phone.node.parent.getChildByName("icon").active = true;
                _this.Player.getChildByName("mask").getChildByName("icon").active = true;
            }
        })
            .catch(function (error) {
            // console.error('Error fetching X-Info:', error);
        });
        var self = this;
        cc.assetManager.loadRemote(pic, { ext: '.png' }, function (err, texture) {
            self.Player.opacity = 255;
            if (texture) {
                self.phone.node.active = true;
                self.phone.spriteFrame = new cc.SpriteFrame(texture);
                self.Player.getChildByName("mask").getChildByName("icon").active = false;
                self.Player.getChildByName("mask").getChildByName("phone").active = true;
                self.Player.getChildByName("mask").getChildByName("phone").getComponent(cc.Sprite)
                    .spriteFrame = new cc.SpriteFrame(texture);
                setTimeout(function () {
                    self.playerAction();
                }, 500);
            }
            else {
                self.Player.getChildByName("mask").getChildByName("icon").active = true;
                setTimeout(function () {
                    self.playerAction();
                }, 500);
            }
        });
    };
    __decorate([
        property(cc.Node) //用户上方头像
    ], RankManager.prototype, "Player", void 0);
    __decorate([
        property(cc.Node) //用户最下方个人信息
    ], RankManager.prototype, "selfNode", void 0);
    __decorate([
        property(cc.Sprite) //用户头像换图
    ], RankManager.prototype, "phone", void 0);
    RankManager = __decorate([
        ccclass
    ], RankManager);
    return RankManager;
}(cc.Component));
exports.default = RankManager;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 13940 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/GameOver.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '805c6nf399HWZeuWnNB9CTH', 'GameOver');
// Script/GameOver.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var NewClass = /** @class */ (function (_super) {
    __extends(NewClass, _super);
    function NewClass() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.count = null;
        _this.time = null;
        _this.selfNode = null;
        _this.one = null;
        _this.two = null;
        _this.three = null;
        _this.four = null;
        _this.five = null;
        return _this;
    }
    // onLoad () {}
    NewClass.prototype.start = function () {
        this.count.string = cc.fx.GameConfig.GM_INFO.score + "";
        var yes = 0;
        var successList = cc.fx.GameConfig.GM_INFO.successList;
        if (successList.length > 0) {
            var success = 0;
            for (var i = 0; i < successList.length; i++) {
                if (successList[i] == true)
                    success += 1;
            }
            yes = success / successList.length;
        }
        yes = Math.floor(yes * 1000) / 10;
        this.time.string = yes + "%";
        this.init();
    };
    //初始化数据
    NewClass.prototype.init = function () {
        this.listData = [];
        this.selfData = null;
        this.one.active = false;
        this.two.active = false;
        this.three.active = false;
        this.four.active = false;
        this.five.active = false;
        var urlNow = window.location.href;
        if (this.containsTrain(urlNow)) {
            this.node.getChildByName("again").active = false;
            this.node.getChildByName("back").active = false;
            this.node.getChildByName("finishi").active = true;
            this.setLocalStorage();
        }
        else {
            this.setLocalStorage();
            this.node.getChildByName("again").active = true;
            this.node.getChildByName("back").active = true;
            this.node.getChildByName("finishi").active = false;
        }
        this.getRank();
    };
    NewClass.prototype.setLocalStorage = function () {
        var timeData = cc.fx.GameConfig.TIME_INFO.totalTime;
        var today = new Date().toLocaleDateString();
        var name = "success_" + today + "_" + cc.fx.GameConfig.GM_INFO.scode + "_" + cc.fx.GameConfig.GM_INFO.gameId;
        localStorage.setItem(name, JSON.stringify({ success: true }));
    };
    //打开排行榜
    NewClass.prototype.openRank = function () {
        cc.director.loadScene("RankScene");
    };
    //重新开始玩
    NewClass.prototype.again = function () {
        cc.fx.GameConfig.GM_INFO.round = 0;
        cc.fx.GameConfig.GM_INFO.level = 0;
        cc.fx.GameConfig.GM_INFO.stepTimeList = 0;
        cc.fx.GameConfig.GM_INFO.successList = [];
        cc.fx.GameConfig.GM_INFO.fen = 0;
        cc.fx.GameConfig.GM_INFO.score = 0;
        cc.fx.GameConfig.GM_INFO.min_Steps = 0;
        cc.fx.GameConfig.GM_INFO.min_Time = 0;
        cc.fx.GameConfig.TIME_INFO.totalTime = 120;
        cc.director.loadScene("GameScene");
    };
    //判断来源
    NewClass.prototype.containsTrain = function (str) {
        return /from=train/i.test(str);
    };
    //获取排行榜
    NewClass.prototype.getRank = function () {
        var _this = this;
        //获取排行榜数据  所需数据量
        var dataFile = {
            length: 5
        };
        cc.fx.GameTool.getRank(dataFile, function (data) { return _this.getRankData(data); });
    };
    //打开排行榜
    NewClass.prototype.jumpFinishi = function () {
        var url = "https://train.sparkus.cn/poster/game/" + cc.fx.GameConfig.GM_INFO.scode + "?suc=1";
        window.location.href = url;
    };
    //设置排行信息
    NewClass.prototype.getRankData = function (data) {
        if (data) {
            cc.fx.GameTool.getRankData(data, this, 4);
            cc.fx.GameTool.setPic(this.selfNode.getChildByName("pic").getChildByName("icon"), this.selfData.pic);
            var length = this.listData.length - 1;
            if (length > 4)
                length = 4;
            for (var i = 0; i <= length; i++) {
                this.setRank(i, this.listData[i]);
            }
        }
    };
    //根据内容填充排行榜
    NewClass.prototype.setRank = function (num, data) {
        var _this = this;
        if (!data) {
            return;
        }
        var hitNode = null;
        if (num == 0) {
            hitNode = this.one;
        }
        else if (num == 1) {
            hitNode = this.two;
        }
        else if (num == 2) {
            hitNode = this.three;
        }
        else if (num == 3) {
            hitNode = this.four;
        }
        else if (num == 4) {
            hitNode = this.five;
        }
        var trun = num + 1;
        for (var i = 0; i < trun; i++) {
            if (this.listData[i] && this.listData[i].nickName == cc.fx.GameConfig.GM_INFO.nickName) {
                trun = i + 1;
                break;
            }
            else if (!this.listData[i] == null) {
                trun = i * 2;
                break;
            }
            this.node.color = cc.color(this.listData[0], this.listData[1], this.listData[2]);
            cc.tween(this.node)
                .to(0.5, { scale: 2 })
                .by(1, { opacity: 0 })
                .delay(0.5)
                .call(function () {
                _this.node.scale = 1;
                _this.node.opacity = 255;
                _this.node.color = cc.color(255, 255, 255);
            })
                .start();
        }
        hitNode.getChildByName("num").getComponent(cc.Label).string = num + "";
        cc.tween(hitNode.getChildByName("num").getComponent(cc.Label))
            .to(0.5, { string: trun + "" })
            .start();
        var record = cc.fx.GameConfi.GM_INFO.score;
        if (data.score >= record) {
            this.selfData = data;
            this.selfNode.active = true;
        }
        if (hitNode) {
            hitNode.active = true;
            if (data.nickName.length >= 4)
                data.nickName = cc.fx.GameTool.subName(data.nickName, 4);
            hitNode.getChildByName("name").getComponent(cc.Label).string = data.nickName;
            hitNode.getChildByName("total").getComponent(cc.Label).string = data.score;
            cc.fx.GameTool.setPic(hitNode.getChildByName("pic").getChildByName("icon"), data.pic);
        }
    };
    __decorate([
        property(cc.Label)
    ], NewClass.prototype, "count", void 0);
    __decorate([
        property(cc.Label)
    ], NewClass.prototype, "time", void 0);
    __decorate([
        property(cc.Node)
    ], NewClass.prototype, "selfNode", void 0);
    __decorate([
        property(cc.Node)
    ], NewClass.prototype, "one", void 0);
    __decorate([
        property(cc.Node)
    ], NewClass.prototype, "two", void 0);
    __decorate([
        property(cc.Node)
    ], NewClass.prototype, "three", void 0);
    __decorate([
        property(cc.Node)
    ], NewClass.prototype, "four", void 0);
    __decorate([
        property(cc.Node)
    ], NewClass.prototype, "five", void 0);
    NewClass = __decorate([
        ccclass
    ], NewClass);
    return NewClass;
}(cc.Component));
exports.default = NewClass;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 18500 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/Load.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '454adgphRpA6oq5lB6Cg1fK', 'Load');
// Script/Load.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, requireComponent = _a.requireComponent;
var NewClass = /** @class */ (function (_super) {
    __extends(NewClass, _super);
    function NewClass() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.node1 = null;
        _this.node2 = null;
        _this.node3 = null;
        _this.localTest = false;
        _this.clientTestVersion = "1.0.0";
        _this.testVersion = null;
        return _this;
        //     3月17日 - 3月21日 工作完成内容
        // 1：游戏框架搭建
        // 2：制作18个基础方块预制体 (方块可编辑颜色与道具和状态)
        // 3：完成地图的搭建，可配置8*8以内，任意组合，包括可缺口和障碍物配置
        // 4：完成地图墙面建立，根据 ↑3上面构建的地图自动生成墙体。
        // 5：做完方块的基础移动，跟随手指，遇到方块或者墙壁或者障碍物阻碍移动。
        // 6：方块的自动落点做完11个基础方块的（未做完还差11个）
        // 3月24日 - 3月28日 预计完成目标
        // 1：完成全部方块的落点。
        // 2：完成门的搭建，门可选颜色，可选开关或者星星等特殊状态
        // 3：完成方块通过门的游戏逻辑，使游戏可以最基础运行玩起来
        // 4：出5关版本，配合小白备案审核。
        // 5：根据方块，地图，以及道具，制作地图编辑器 (方块和地图制作的时候都已经考虑到编辑器的需求了) 
        // 	优先制作，后续开发拓展玩法功能时，小白可同步进行制作关卡。
    }
    NewClass.prototype.onLoad = function () {
        // cc.director.getPhysicsManager().enabled = true;
        // cc.director.getPhysicsManager().debugDrawFlags = 1;
        // cc.director.getPhysicsManager().enabledAccumulator = true;
        // cc.PhysicsManager.VELOCITY_ITERATIONS = 20;
        // cc.PhysicsManager.FIXED_TIME_STEP = 1 / 120;
        // cc.PhysicsManager.POSITION_ITERATIONS = 20;
        //@ts-ignore
        cc.internal.inputManager._maxTouches = 1;
        var manager = cc.director.getCollisionManager();
        manager.enabled = true;
        this.setWX();
        cc.debug.setDisplayStats(false);
        cc.tween(this.node1)
            .delay(0 * 0.3)
            .to(0.3, { scale: 1 })
            .to(0.3, { scale: 1.3 })
            .to(0.3, { scale: 1 })
            .union()
            .repeatForever()
            .start();
        cc.tween(this.node2)
            .delay(1 * 0.3)
            .to(0.3, { scale: 1 })
            .to(0.3, { scale: 1.3 })
            .to(0.3, { scale: 1 })
            .union()
            .repeatForever()
            .start();
        cc.tween(this.node3)
            .delay(2 * 0.3)
            .to(0.3, { scale: 1 })
            .to(0.3, { scale: 1.3 })
            .to(0.3, { scale: 1 })
            .union()
            .repeatForever()
            .start();
    };
    NewClass.prototype.setWX = function () {
        //@ts-ignore
        if (typeof wx !== 'undefined' && wx !== null) { // 判断是否在微信环境
            wx.setPreferredFramesPerSecond(60);
            // // 设置转发按钮点击后的回调
            // wx.onShareAppMessage(() => {
            //     return {
            //         title: '你想玩上怎样的游戏？',
            //         imageUrl: '',
            //         query: ''
            //     };
            // });
            wx.onShareAppMessage(function () {
                // 用户点击了“转发”按钮
                return {
                    title: '你想玩上怎样的游戏？'
                };
            });
            // 监听分享到朋友圈事件
            //@ts-ignore
            wx.onShareTimeline(function () {
                return {
                    title: '你想玩上怎样的游戏？'
                };
            });
            wx.showShareMenu(function () {
                return {
                    title: '你想玩上怎样的游戏？',
                    imageUrl: '',
                    query: ''
                };
            });
            setTimeout(function () {
                wx.showShareMenu({
                    menus: ['shareAppMessage', 'shareTimeline']
                });
            }, 2000);
            // 设置分享到朋友圈
            //@ts-ignore
            // wx.updateShareMenu({
            //     withShareTicket: true,
            //     success: (data) => {
            //         console.log('更新分享菜单成功', data);
            //     },
            //     fail: (data) => {
            //         console.log('更新分享菜单失败', data);
            //     },
            //     complete: (data) => {
            //         console.log('更新分享菜单完成', data);
            //     }
            // });
            //@ts-ignore
        }
    };
    //判断来源
    NewClass.prototype.containsTrain = function (str) {
        return /from=train/i.test(str);
    };
    //开始游戏，跳转至引导页面
    NewClass.prototype.startGame = function () {
        cc.director.loadScene("GameScene");
        // cc.director.loadScene("GuideScene");
    };
    //备用，用来测试跳转 指定关卡
    NewClass.prototype.clickBtn = function (event, data) {
        cc.fx.GameConfig.GM_INFO.custom = parseInt(data);
        cc.director.loadScene("GameScene");
    };
    //打开排行榜
    NewClass.prototype.openRank = function () {
        cc.director.loadScene("RankScene");
    };
    NewClass.prototype.update = function (dt) {
    };
    __decorate([
        property(cc.Node)
    ], NewClass.prototype, "node1", void 0);
    __decorate([
        property(cc.Node)
    ], NewClass.prototype, "node2", void 0);
    __decorate([
        property(cc.Node)
    ], NewClass.prototype, "node3", void 0);
    __decorate([
        property(false)
    ], NewClass.prototype, "localTest", void 0);
    __decorate([
        property("")
    ], NewClass.prototype, "clientTestVersion", void 0);
    __decorate([
        property(cc.Label)
    ], NewClass.prototype, "testVersion", void 0);
    NewClass = __decorate([
        ccclass
    ], NewClass);
    return NewClass;
}(cc.Component));
exports.default = NewClass;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 12660 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/module/Config/GameConfig.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'c5692vnhwNF5J9nI7VNKQNW', 'GameConfig');
// Script/module/Config/GameConfig.ts

"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.GameConfig = void 0;
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var GameConfig = /** @class */ (function () {
    function GameConfig() {
    }
    GameConfig_1 = GameConfig;
    Object.defineProperty(GameConfig, "Instance", {
        //游戏内信息
        get: function () {
            if (this._instance == null) {
                this._instance = new GameConfig_1();
            }
            return this._instance;
        },
        enumerable: false,
        configurable: true
    });
    //getSeedRandom
    GameConfig.init = function (Authentication) {
        //@ts-ignore
        if (typeof wx !== 'undefined' && wx !== null) {
            //@ts-ignore
            wx.cloud.init();
        }
        this.TA = null;
        this.CLICK_init();
        this.GM_INFO_init();
        this.LEVEL_INFO_init(false, 0);
        var self = this;
        //GAME_DATA 废弃了，暂时不删除以防后面修改回 一整局传一次
        this.GAME_DATA = [];
        // if(!Authentication) self.Authentication();
    };
    GameConfig.generateUUID = function () {
        return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
            var r = Math.random() * 16 | 0;
            var v = c === 'x' ? r : (r & 0x3 | 0x8);
            return v.toString(16);
        });
    };
    // 版本比较函数
    GameConfig.compareVersion = function (v1, v2) {
        var arr1 = v1.split('.');
        var arr2 = v2.split('.');
        var len = Math.max(arr1.length, arr2.length);
        for (var i = 0; i < len; i++) {
            var num1 = parseInt(arr1[i] || '0', 10);
            var num2 = parseInt(arr2[i] || '0', 10);
            if (num1 > num2) {
                return 1;
            }
            else if (num1 < num2) {
                return -1;
            }
        }
        return 0;
    };
    GameConfig.GM_INFO_SET = function (key, value) {
        this.GM_INFO[key] = value;
    };
    GameConfig.CLICK_init = function () {
        this.CLICK_DATA =
            {
                type: 1,
                success: false,
                round: 0,
                getScore: 0,
                cumulativeScore: 0,
                mapId: "",
                difficulty: 0,
                optimizedSteps: 0,
                usedSteps: 0,
                stepList: [],
                startTime: -1,
                submitTime: -1,
                duration: 0,
                drawingBack: 0,
                drawingReset: 0,
                timer: 0 //测评倒计时剩余时间 去秒
            };
    };
    GameConfig.CLICK_SET = function (key, value) {
        this.CLICK_DATA[key] = value;
    };
    //数据备用
    GameConfig.GM_INFO_init = function () {
        var _this = this;
        this.GM_INFO = {
            // isEnd: false,    
            mean_Time: 0,
            hp: 5,
            review: 0,
            currSeed: 200000,
            openid: "",
            gameId: "100001",
            userId: 0,
            scode: "",
            username: "user",
            useravatar: "",
            guide: true,
            url: "https://api.sparkus.cn",
            coin: 0,
            success: false,
            matchId: null,
            gameState: false,
            custom: 0,
            round: 0,
            level: 0,
            stepTimeList: 0,
            successList: [],
            first: false,
            score: 0,
            scale: 1,
            min_Steps: 0,
            min_Time: 0,
            freezeAmount: 0,
            hammerAmount: 0,
            magicAmount: 0,
            musicOpen: true,
            effectOpen: true,
            vibrateOpen: true,
        };
        // this.setCode(this.getKey("scode"));
        // this.GM_INFO.level = 0;
        cc.resources.load("Json/NEW_LEVEL", function (err, res) {
            if (err) {
                console.error("加载 NEW_LEVEL.JSON 失败:", err);
                return;
            }
            var newLevelData = res.json;
            _this.NEW_LEVEL = newLevelData.NEW_LEVEL;
            // 可以根据需求对 newLevelData 进行处理
            // //console.log("NEW_LEVEL.JSON 加载成功:", newLevelData);
        });
    };
    GameConfig.LEVEL_INFO_init = function (type, time) {
        // 示例         围墙会根据缺的地块自动生成
        // 带缺口       {"id":"1006","map":[10,11],"gap":[cc.v2(4,9),cc.v2(5,9)]},
        // 带升降地块   {"id":"1004","map":[7,8],"risefall":[{pos:cc.v2(5,4),color:2},{pos:cc.v2(5,5),color:5}]},
        // 如果普通的就  {"id":"1001","map":[6,7]}, 这个样子就可以了
        var self = this;
        if ((cc.fx.GameConfig.GM_INFO.level) > 156) {
            cc.fx.GameConfig.GM_INFO.level = 156;
        }
        var name = "Json/level" + (cc.fx.GameConfig.GM_INFO.level + 1);
        // //console.log("关卡名称:",name);
        // name = "Json/level" + 68;
        // cc.fx.StorageMessage.setStorage("level",cc.fx.GameConfig.GM_INFO.level.toString());
        cc.resources.load(name, function (err, res) {
            if (err) {
                cc.fx.GameTool.addLevel();
                self.LEVEL_INFO_init(type, time);
                return;
            }
            var jsonData = res.json;
            self.BLOCK_INFO = jsonData["BLOCK_INFO"];
            self.LEVEL_INFO = jsonData["LEVEL_INFO"];
            self.WALL_INFO = jsonData["WALL_INFO"];
            // //console.log("配置加载完成"); 
            if (type) {
                cc.director.preloadScene("GameScene", function () {
                    if (time == 0)
                        cc.director.loadScene("GameScene");
                    else {
                        setTimeout(function () {
                            cc.director.loadScene("GameScene");
                        }, time);
                    }
                });
            }
        });
        //道具位置信息
        this.PROP_INFO = [
            {
                "pos1": { "x": -66, "y": 60, "z": 0 },
                "pos2": { "x": -19, "y": 36, "z": 0 },
                "pos3": { "x": -34.362, "y": 13.246, "z": 0 },
                "pos4": { "x": -17, "y": 12, "z": 0 },
                "pos5": { "x": -85, "y": 70, "z": 0 },
                "pos6": { "x": -5, "y": 3, "z": 0 },
            },
            {
                "pos1": { "x": -126, "y": 61, "z": 0 },
                "pos2": { "x": -25.792, "y": 34.675, "z": 0 },
                "pos3": { "x": -94.792, "y": 21.675, "z": 0 },
                "pos4": { "x": -20, "y": 13, "z": 0 },
                "pos5": { "x": -140, "y": 68, "z": 0 },
                "pos6": { "x": -2, "y": 0, "z": 0 },
            },
            {
                "pos1": { "x": -67, "y": 122, "z": 0 },
                "pos2": { "x": -20, "y": 94, "z": 0 },
                "pos3": { "x": -34.792, "y": 23.675, "z": 0 },
                "pos4": { "x": -14, "y": 24, "z": 0 },
                "pos5": { "x": -84, "y": 128, "z": 0 },
                "pos6": { "x": -5, "y": 3, "z": 0 },
            },
            {
                "pos1": { "x": -178, "y": 61, "z": 0 },
                "pos2": { "x": -34.792, "y": 37.675, "z": 0 },
                "pos3": { "x": -150, "y": 23.675, "z": 0 },
                "pos4": { "x": -22, "y": 16, "z": 0 },
                "pos5": { "x": -200, "y": 67, "z": 0 },
                "pos6": { "x": 0, "y": 0, "z": 0 },
            },
            {
                "pos1": { "x": -63, "y": 178, "z": 0 },
                "pos2": { "x": -17.792, "y": 166.675, "z": 0 },
                "pos3": { "x": -31.792, "y": 33.675, "z": 0 },
                "pos4": { "x": -14, "y": 37, "z": 0 },
                "pos5": { "x": -78, "y": 182, "z": 0 },
                "pos6": { "x": 0, "y": 2, "z": 0 },
            },
            {
                "pos1": { "x": -123, "y": 124, "z": 0 },
                "pos2": { "x": -25.792, "y": 99.675, "z": 0 },
                "pos3": { "x": -97.792, "y": 27.675, "z": 0 },
                "pos4": { "x": -27, "y": 19, "z": 0 },
                "pos5": { "x": -135, "y": 127, "z": 0 },
                "pos6": { "x": 0, "y": 0, "z": 0 },
            },
            {
                "pos1": { "x": -64, "y": 178, "z": 0 },
                "pos2": { "x": -24.792, "y": 275.675, "z": 0 },
                "pos3": { "x": -31.792, "y": 35.675, "z": 0 },
                "pos4": { "x": -7, "y": 39, "z": 0 },
                "pos5": { "x": -77, "y": 188, "z": 0 },
                "pos6": { "x": 0, "y": 0, "z": 0 },
            },
            {
                "pos1": { "x": -178, "y": 186, "z": 0 },
                "pos2": { "x": -31.792, "y": 163.675, "z": 0 },
                "pos3": { "x": -33.792, "y": 34.675, "z": 0 },
                "pos4": { "x": -18, "y": 30, "z": 0 },
                "pos5": { "x": -200, "y": 192, "z": 0 },
                "pos6": { "x": 0, "y": 5, "z": 0 },
            },
            {
                "pos1": { "x": -186, "y": 178, "z": 0 },
                "pos2": { "x": -25.792, "y": 38.675, "z": 0 },
                "pos3": { "x": -153.792, "y": 34.675, "z": 0 },
                "pos4": { "x": -23, "y": 14, "z": 0 },
                "pos5": { "x": -200, "y": 185, "z": 0 },
                "pos6": { "x": 0, "y": 0, "z": 0 },
            },
            {
                "pos1": { "x": -183, "y": 64, "z": 0 },
                "pos2": { "x": -37.792, "y": 37.675, "z": 0 },
                "pos3": { "x": -36.792, "y": 26.675, "z": 0 },
                "pos4": { "x": -24, "y": 17, "z": 0 },
                "pos5": { "x": -212, "y": 74, "z": 0 },
                "pos6": { "x": 0, "y": 0, "z": 0 },
            },
            {
                "pos1": { "x": -65, "y": 177, "z": 0 },
                "pos2": { "x": 93.208, "y": 276.675, "z": 0 },
                "pos3": { "x": -33.792, "y": 34.675, "z": 0 },
                "pos4": { "x": 3, "y": 31, "z": 0 },
                "pos5": { "x": -80, "y": 190, "z": 0 },
                "pos6": { "x": 0, "y": 3, "z": 0 },
            },
            {
                "pos1": { "x": 58, "y": 179, "z": 0 },
                "pos2": { "x": 205.225, "y": 154.034, "z": 0 },
                "pos3": { "x": -29.642, "y": 25.691, "z": 0 },
                "pos4": { "x": 7.218, "y": 29.765, "z": 0 },
                "pos5": { "x": 45, "y": 185, "z": 0 },
                "pos6": { "x": 0, "y": 0, "z": 0 },
            },
            {
                "pos1": { "x": -68, "y": 182, "z": 0 },
                "pos2": { "x": -25.792, "y": 37.675, "z": 0 },
                "pos3": { "x": -35.792, "y": 33.675, "z": 0 },
                "pos4": { "x": -14, "y": 12, "z": 0 },
                "pos5": { "x": -82, "y": 190, "z": 0 },
                "pos6": { "x": -2, "y": 1, "z": 0 },
            },
            {
                "pos1": { "x": -184, "y": 62, "z": 0 },
                "pos2": { "x": -35.792, "y": 36.675, "z": 0 },
                "pos3": { "x": -271.792, "y": 24.675, "z": 0 },
                "pos4": { "x": -17, "y": 20, "z": 0 },
                "pos5": { "x": -200, "y": 72, "z": 0 },
                "pos6": { "x": 0, "y": 0, "z": 0 },
            },
            {
                "pos1": { "x": -62, "y": 175, "z": 0 },
                "pos2": { "x": 87.208, "y": 164.675, "z": 0 },
                "pos3": { "x": -31.792, "y": 35.675, "z": 0 },
                "pos4": { "x": -6, "y": 24, "z": 0 },
                "pos5": { "x": -79, "y": 172, "z": 0 },
                "pos6": { "x": 0, "y": 5, "z": 0 },
            },
            {
                "pos1": { "x": -184, "y": 72, "z": 0 },
                "pos2": { "x": -33.792, "y": 38.675, "z": 0 },
                "pos3": { "x": -154.792, "y": 29.675, "z": 0 },
                "pos4": { "x": -29, "y": 16, "z": 0 },
                "pos5": { "x": -201, "y": 85, "z": 0 },
                "pos6": { "x": -1, "y": 3, "z": 0 },
            },
            {
                "pos1": { "x": -64, "y": 181, "z": 0 },
                "pos2": { "x": 95.208, "y": 155.675, "z": 0 },
                "pos3": { "x": -30.792, "y": 36.675, "z": 0 },
                "pos4": { "x": -12, "y": 32, "z": 0 },
                "pos5": { "x": -78, "y": 190, "z": 0 },
                "pos6": { "x": 0, "y": 3, "z": 0 },
            },
            {
                "pos1": { "x": -65, "y": 178, "z": 0 },
                "pos2": { "x": -21.792, "y": 156.675, "z": 0 },
                "pos3": { "x": -31.792, "y": 37.675, "z": 0 },
                "pos4": { "x": -12, "y": 32, "z": 0 },
                "pos5": { "x": -78, "y": 188, "z": 0 },
                "pos6": { "x": 0, "y": 2, "z": 0 },
            },
            {
                "pos1": { "x": -62, "y": 183, "z": 0 },
                "pos2": { "x": 88.208, "y": 162.675, "z": 0 },
                "pos3": { "x": -29.792, "y": 41.675, "z": 0 },
                "pos4": { "x": -12, "y": 18, "z": 0 },
                "pos5": { "x": -80, "y": 188, "z": 0 },
                "pos6": { "x": -4, "y": 2, "z": 0 },
            },
            {
                "pos1": { "x": -67, "y": 80, "z": 0 },
                "pos2": { "x": -26.792, "y": 32.675, "z": 0 },
                "pos3": { "x": -34.792, "y": 23.675, "z": 0 },
                "pos4": { "x": -12, "y": 18, "z": 0 },
                "pos5": { "x": -84, "y": 90, "z": 0 },
                "pos6": { "x": 0, "y": 0, "z": 0 },
            },
            {
                "pos1": { "x": -184, "y": 80, "z": 0 },
                "pos2": { "x": -25.792, "y": 34.675, "z": 0 },
                "pos3": { "x": -155.792, "y": 25.675, "z": 0 },
                "pos4": { "x": -18, "y": 26, "z": 0 },
                "pos5": { "x": -196, "y": 96, "z": 0 },
                "pos6": { "x": 0, "y": 0, "z": 0 },
            },
            {
                "pos1": { "x": -62, "y": 160, "z": 0 },
                "pos2": { "x": 95.208, "y": 158.675, "z": 0 },
                "pos3": { "x": -33.792, "y": 29.675, "z": 0 },
                "pos4": { "x": -18, "y": 26, "z": 0 },
                "pos5": { "x": -78, "y": 170, "z": 0 },
                "pos6": { "x": 0, "y": 2, "z": 0 },
            },
            {
                "pos1": { "x": -68, "y": 160, "z": 0 },
                "pos2": { "x": -25.792, "y": 156.675, "z": 0 },
                "pos3": { "x": -35.792, "y": 27.675, "z": 0 },
                "pos4": { "x": -25, "y": 40, "z": 0 },
                "pos5": { "x": -82, "y": 170, "z": 0 },
                "pos6": { "x": -2, "y": 2, "z": 0 },
            }
        ];
        // this.PROP_INFO = [{"pos1": {"x": -60,"y": 60,"z": 0},"pos2": {"x": -16.442,"y": 30,"z": 0},"pos3": {"x": -34.362,"y": 13.246,"z": 0},"pos4": {"x": -17,"y": 12,"z": 0}},{"pos1": {"x": -126,"y": 63,"z": 0},"pos2": {"x": -25.792,"y": 34.675,"z": 0},"pos3": {"x": -94.792,"y": 21.675,"z": 0},"pos4": {"x": -20,"y": 13,"z": 0}},{"pos1": {"x": -60,"y": 125,"z": 0},"pos2": {"x": -12.792,"y": 92.675,"z": 0},"pos3": {"x": -34.792,"y": 23.675,"z": 0},"pos4": {"x": -14,"y": 24,"z": 0}},{"pos1": {"x": -185,"y": 63,"z": 0},"pos2": {"x": -34.792,"y": 37.675,"z": 0},"pos3": {"x": -154.792,"y": 23.675,"z": 0},"pos4": {"x": -22,"y": 16,"z": 0}},{"pos1": {"x": -57,"y": 178,"z": 0},"pos2": {"x": -17.792,"y": 166.675,"z": 0},"pos3": {"x": -31.792,"y": 33.675,"z": 0},"pos4": {"x": -14,"y": 37,"z": 0}},{"pos1": {"x": -123,"y": 127,"z": 0},"pos2": {"x": -25.792,"y": 99.675,"z": 0},"pos3": {"x": -97.792,"y": 27.675,"z": 0},"pos4": {"x": -27,"y": 19,"z": 0}},{"pos1": {"x": -62,"y": 181,"z": 0},"pos2": {"x": -24.792,"y": 275.675,"z": 0},"pos3": {"x": -31.792,"y": 35.675,"z": 0},"pos4": {"x": -7,"y": 39,"z": 0}},{"pos1": {"x": -181,"y": 180,"z": 0},"pos2": {"x": -31.792,"y": 163.675,"z": 0},"pos3": {"x": -33.792,"y": 34.675,"z": 0},"pos4": {"x": -18,"y": 30,"z": 0}},{"pos1": {"x": -182,"y": 182,"z": 0},"pos2": {"x": -25.792,"y": 38.675,"z": 0},"pos3": {"x": -153.792,"y": 34.675,"z": 0},"pos4": {"x": -23,"y": 14,"z": 0}},{"pos1": {"x": -186,"y": 61,"z": 0},"pos2": {"x": -37.792,"y": 37.675,"z": 0},"pos3": {"x": -36.792,"y": 26.675,"z": 0},"pos4": {"x": -24,"y": 17,"z": 0}},{"pos1": {"x": -62,"y": 177,"z": 0},"pos2": {"x": 93.208,"y": 276.675,"z": 0},"pos3": {"x": -33.792,"y": 34.675,"z": 0},"pos4": {"x": 3,"y": 31,"z": 0}},{"pos1": {"x": 58,"y": 179,"z": 0},"pos2": {"x": 205.225,"y": 154.034,"z": 0},"pos3": {"x": -29.642,"y": 25.691,"z": 0},"pos4": {"x": 7.218,"y": 29.765,"z": 0}},{"pos1": {"x": -57,"y": 182,"z": 0},"pos2": {"x": -25.792,"y": 37.675,"z": 0},"pos3": {"x": -35.792,"y": 33.675,"z": 0},"pos4": {"x": -14,"y": 12,"z": 0}},{"pos1": {"x": -180,"y": 62,"z": 0},"pos2": {"x": -35.792,"y": 36.675,"z": 0},"pos3": {"x": -271.792,"y": 24.675,"z": 0},"pos4": {"x": -17,"y": 20,"z": 0}},{"pos1": {"x": -62,"y": 178,"z": 0},"pos2": {"x": 87.208,"y": 164.675,"z": 0},"pos3": {"x": -31.792,"y": 35.675,"z": 0},"pos4": {"x": -6,"y": 24,"z": 0}},{"pos1": {"x": -176,"y": 60,"z": 0},"pos2": {"x": -33.792,"y": 38.675,"z": 0},"pos3": {"x": -154.792,"y": 29.675,"z": 0},"pos4": {"x": -29,"y": 16,"z": 0}},{"pos1": {"x": -60,"y": 181,"z": 0},"pos2": {"x": 95.208,"y": 155.675,"z": 0},"pos3": {"x": -30.792,"y": 36.675,"z": 0},"pos4": {"x": -12,"y": 32,"z": 0}},{"pos1": {"x": -63,"y": 178,"z": 0},"pos2": {"x": -21.792,"y": 156.675,"z": 0},"pos3": {"x": -31.792,"y": 37.675,"z": 0},"pos4": {"x": -12,"y": 32,"z": 0}},{"pos1": {"x": -60,"y": 183,"z": 0},"pos2": {"x": 88.208,"y": 162.675,"z": 0},"pos3": {"x": -29.792,"y": 41.675,"z": 0},"pos4": {"x": -12,"y": 18,"z": 0}},{"pos1": {"x": -64,"y": 58,"z": 0},"pos2": {"x": -26.792,"y": 32.675,"z": 0},"pos3": {"x": -34.792,"y": 23.675,"z": 0},"pos4": {"x": -12,"y": 18,"z": 0}},{"pos1": {"x": -184,"y": 62,"z": 0},"pos2": {"x": -25.792,"y": 34.675,"z": 0},"pos3": {"x": -155.792,"y": 25.675,"z": 0},"pos4": {"x": -18,"y": 26,"z": 0}},{"pos1": {"x": -57,"y": 190,"z": 0},"pos2": {"x": 95.208,"y": 158.675,"z": 0},"pos3": {"x": -33.792,"y": 29.675,"z": 0},"pos4": {"x": -18,"y": 26,"z": 0}},{"pos1": {"x": -71,"y": 184,"z": 0},"pos2": {"x": -25.792,"y": 156.675,"z": 0},"pos3": {"x": -35.792,"y": 27.675,"z": 0},"pos4": {"x": -25,"y": 40,"z": 0}}];
    };
    GameConfig.setCode = function (code) {
        this.GM_INFO.scode = code;
    };
    GameConfig.getKey = function (key) {
        // var reg = new RegExp('(^|&)' + key + '=([^&]*)(&|$)', 'i');
        // var r = window.location.search.substring(1).match(reg);
        // if (r != null) {
        //     return unescape(r[2]);
        // }
        return "";
    };
    GameConfig.Authentication = function () {
        cc.fx.GameTool.Authentication();
    };
    var GameConfig_1;
    //所有控制信息都通过GameAppStart内控制
    GameConfig._instance = null;
    GameConfig = GameConfig_1 = __decorate([
        ccclass('GameConfig')
    ], GameConfig);
    return GameConfig;
}());
exports.GameConfig = GameConfig;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 60860 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/Map.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '2234assp7RIvpDgrnqljp2R', 'Map');
// Script/Map.ts

"use strict";
// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var GameManager_1 = require("./GameManager");
var NumberToImage_1 = require("./NumberToImage");
var MiniGameSdk_1 = require("./Sdk/MiniGameSdk");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var MapConroler = /** @class */ (function (_super) {
    __extends(MapConroler, _super);
    function MapConroler() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.Block_Array = [];
        _this.Block_Prop = [];
        _this.MapBlockPrefab = null;
        _this.Block_Color = [];
        _this.Wall_Prefab = [];
        _this.wallTurnPrefab = null;
        _this.timeBtn = null;
        _this.destroyBtn = null;
        _this.magicBtn = null;
        _this.mask = null;
        _this.iceLabel = null;
        _this.hammerLabel = null;
        _this.magicLabel = null;
        _this.magicMask = null;
        _this.hammerMask = null;
        _this.freezeMask = null;
        _this.coinPop = null;
        _this.timeLabel = null;
        _this.levelLabel = null;
        _this.new_mode = 0;
        _this.mapWidth = 0;
        _this.mapHeight = 0;
        _this.wallNum = 0;
        _this.blockNum = 0;
        _this.homeCanTouch = true; //按钮可用状态
        _this.againCanTouch = true; //重玩按钮可以用状态
        _this.gameOver = false; //游戏结束状态
        _this.gameWin = false; //游戏胜利状态
        _this.gameStart = false; //游戏开始状态
        _this.timeNumber = 0; //游戏时间 用于倒计时
        _this.count_Time = 0; //用于统计总游戏时长
        _this.add_Time = 0; //复活时间
        _this.pause = false; //暂停状态
        _this.hammer = false; //锤子状态
        return _this;
    }
    MapConroler_1 = MapConroler;
    // mapInfo: number[][] = [];
    MapConroler.prototype.onLoad = function () {
        var _this = this;
        cc.fx.GameConfig.GM_INFO.review = 0;
        cc.fx.GameConfig.GM_INFO.gameState = true;
        this.mask.opacity = 0;
        this.node.getChildByName("Adhesive").zIndex = 500;
        cc.game.setFrameRate(63);
        cc.fx.AudioManager._instance.playEffect("zhuan2", null);
        this.node.parent.parent.parent.getChildByName("zhuanchang").active = true;
        this.node.parent.parent.parent.getChildByName("zhuanchang").getComponent(sp.Skeleton).setAnimation(1, "down", false);
        this.node.parent.parent.parent.getChildByName("zhuanchang").getComponent(sp.Skeleton).setCompleteListener(function (entry) {
            if (entry.animation.name === "down") {
                // 动画播放结束后执行的逻辑
                _this.node.parent.parent.parent.getChildByName("zhuanchang").active = false;
            }
        });
        this.blocks = [];
        this.leftDoors = []; //左门
        this.rightDoors = []; //右门
        this.topDoors = []; //上门
        this.bottomDoors = []; //下门
        this.gameWin = false;
        this.gameOver = false;
        this.gameStart = false;
        this.homeCanTouch = true;
        this.againCanTouch = true;
        this.new_mode = 0;
        this.iceLabel.string = cc.fx.GameConfig.GM_INFO.freezeAmount.toString();
        this.hammerLabel.string = cc.fx.GameConfig.GM_INFO.hammerAmount.toString();
        this.magicLabel.string = cc.fx.GameConfig.GM_INFO.magicAmount.toString();
        // cc.game.addPersistRootNode(this.node);
        MapConroler_1._instance = this;
    };
    MapConroler.prototype.start = function () {
        setTimeout(function () {
            cc.director.preloadScene("HomeScene", function (err, asset) {
                if (err) {
                    console.error('动态加载 HomeScene 失败:', err);
                    return;
                }
            });
        }, 1000);
        // console.log("进入GameScene");
        this.Block_Array = GameManager_1.default._instance.Block_Array;
        this.Wall_Prefab = GameManager_1.default._instance.Wall_Prefab;
        this.Block_Color = GameManager_1.default._instance.Block_Color;
        // this.particleEffects = GameManager._instance.particleEffects;
        this.initMap();
    };
    MapConroler.prototype.startUpdate = function () {
        if (this.gameStart == false) {
            this.gameStart = true;
            //发送数数事件——进入关卡
            console.log("准备进入下一关,发送下一关进入");
            cc.fx.GameTool.shushu_Track("enter_stage");
            this.startTimeCutDown();
            for (var i = 0; i < this.blocks.length; i++) {
                if (this.blocks[i].getComponent("Block").type == 6) {
                    this.blocks[i].getChildByName("boom").getComponent("Boom").startBoom();
                }
            }
        }
    };
    MapConroler.prototype.initMap = function () {
        // this.node.getChildByName("Wall").zIndex = 10;
        this.timeLabel = this.node.parent.getChildByName("Top").getChildByName("time");
        this.levelLabel = this.node.parent.getChildByName("Top").getChildByName("level");
        this.timeNumber = cc.fx.GameConfig.LEVEL_INFO[0].time;
        this.count_Time = 0;
        this.add_Time = 0;
        NumberToImage_1.default.getTimeMargin(this.timeNumber, 50, "time_", this.timeLabel);
        // var timeTemp = cc.fx.GameTool.getTimeMargin(this.timeNumber);
        // this.timeLabel.string = timeTemp.toString();
        NumberToImage_1.default.numberToImageNodes((cc.fx.GameConfig.GM_INFO.level + 1), 50, 20, "level_", this.levelLabel, false);
        //this.startTimeCutDown();
        this.mapWidth = cc.fx.GameConfig.LEVEL_INFO[0].map[0];
        this.mapHeight = cc.fx.GameConfig.LEVEL_INFO[0].map[1];
        var gap = cc.fx.GameConfig.LEVEL_INFO[0].gap;
        var risefall = cc.fx.GameConfig.LEVEL_INFO[0].risefall;
        this.pause = false;
        this.hammer = false;
        this.wallNum = 0;
        this.setMapInfo();
        this.blocks = [];
        this.mapBlocksWall = [];
        this.mapInfo = [];
        this.wallInfo = [];
        this.openWall = [];
        this.wallArray = [];
        this.freezeWall = [];
        this.riseFallBlcok = [];
        this.mapBlockArray = [];
        this.freezeArray = [];
        this.loackArray = [];
        var startX = this.mapWidth % 2 == 0 ? -(this.mapWidth - 1) * 60 : -(this.mapWidth - 1) * 60;
        var startY = this.mapHeight % 2 == 0 ? -(this.mapHeight - 1) * 60 : -(this.mapHeight - 1) * 60;
        // startX =(this.mapWidth-1)*60 + 60;
        // startY =-(this.mapHeight-1)*60 - 60;
        for (var i = 0; i < this.mapWidth; i++) {
            this.mapBlocksWall[i] = [];
            for (var j = 0; j < this.mapHeight; j++) {
                var block = cc.instantiate(this.MapBlockPrefab);
                block.parent = this.node.getChildByName("mapBlock");
                block.getComponent("MapBlock").init(i, j);
                // block.getChildByName("num").getComponent(cc.Label).string = i + ":" + j;
                block.setPosition(cc.v2(startX + i * 120, startY + j * 120));
                if (risefall != null) {
                    if (this.mapRiseFall(cc.v2(i, j), risefall, block)) {
                        this.riseFallBlcok.push(block);
                    }
                }
                if (gap != null) {
                    if (!this.mapGap(cc.v2(i, j), gap) || i == 0 || i == this.mapWidth - 1
                        || j == 0 || j == this.mapHeight - 1) {
                        block.opacity = 254;
                        block.removeComponent(cc.Sprite);
                        block.removeAllChildren();
                        this.wallInfo.push(block);
                    }
                    else
                        this.mapInfo.push(block);
                }
                else {
                    if (i == 0 || i == this.mapWidth - 1
                        || j == 0 || j == this.mapHeight - 1) {
                        block.opacity = 254;
                        block.removeComponent(cc.Sprite);
                        block.removeAllChildren();
                        this.wallInfo.push(block);
                    }
                    else
                        this.mapInfo.push(block);
                }
                this.mapBlocksWall[i].push(block);
            }
        }
        this.wallInit();
        this.blockInit();
    };
    //创建方块
    // ... 已有代码 ...
    //创建方块
    // ... 已有代码 ...
    MapConroler.prototype.blockInit = function () {
        var _this = this;
        var blockArray = cc.fx.GameConfig.BLOCK_INFO[0];
        blockArray = this.sortBlock(blockArray);
        console.log("创建方块", blockArray);
        var index = 0; // 当前要创建的方块索引
        var BLOCKS_PER_FRAME = 1; // 初始每帧创建的方块数量
        var MAX_PER_FRAME = 10; // 每帧最大创建数量
        var MIN_PER_FRAME = 1; // 每帧最小创建数量
        var createBlocks = function () {
            var startTime = performance.now();
            var _loop_1 = function (i) {
                var blockInfo = blockArray[index];
                // 缓存 Block_Array 访问
                var blockPrefab = _this.Block_Array[blockInfo.block];
                var block = cc.instantiate(blockPrefab);
                block.parent = _this.node;
                block.setPosition(cc.v2(blockInfo.position.x, blockInfo.position.y));
                if (blockInfo.block != 23) {
                    _this.blockNum += 1;
                    _this.blocks.push(block);
                    if (blockInfo.type == 1) {
                        var info = {
                            id: blockInfo.id + 1,
                            block: blockInfo.block,
                            color: blockInfo.stacking,
                            type: 10,
                            position: blockInfo.position,
                            stacking: blockInfo.color
                        };
                        // 缓存 Block_Array 访问
                        var blockUpPrefab = _this.Block_Array[info.block];
                        var blockUp = cc.instantiate(blockUpPrefab);
                        blockUp.parent = _this.node;
                        blockUp.setPosition(cc.v2(info.position.x, info.position.y));
                        _this.blocks.push(blockUp);
                        block.getComponent("Block").init(blockInfo, null, null, blockUp);
                        blockUp.getComponent("Block").init(info, null, null, block);
                        _this.blockNum += 1;
                    }
                    else if (blockInfo.type == 9) {
                        if (blockInfo.adhesiveTime < 2) {
                            index++;
                            return "continue";
                        }
                        index++;
                        var info_1 = blockArray[index];
                        // 缓存 Block_Array 访问
                        var blockUpPrefab = _this.Block_Array[info_1.block];
                        var blockUp_1 = cc.instantiate(blockUpPrefab);
                        blockUp_1.parent = _this.node;
                        blockUp_1.setPosition(cc.v2(info_1.position.x, info_1.position.y));
                        _this.blocks.push(blockUp_1);
                        block.getComponent("Block").init(blockInfo, null, null, blockUp_1, false);
                        setTimeout(function () {
                            blockUp_1.getComponent("Block").init(info_1, null, null, block, true);
                        }, 100);
                        _this.blockNum += 1;
                    }
                    else {
                        block.getComponent("Block").init(blockInfo);
                    }
                }
                else {
                    block.getComponent("Barrier").init(blockInfo);
                }
                index++;
            };
            for (var i = 0; i < BLOCKS_PER_FRAME && index < blockArray.length; i++) {
                _loop_1(i);
            }
            var endTime = performance.now();
            var frameTime = endTime - startTime;
            // 如果当前帧执行时间过长，减少每帧创建数量
            if (frameTime > 16) {
                BLOCKS_PER_FRAME = Math.max(BLOCKS_PER_FRAME - 1, MIN_PER_FRAME);
            }
            else {
                BLOCKS_PER_FRAME = Math.min(BLOCKS_PER_FRAME + 1, MAX_PER_FRAME);
            }
            // 如果还有方块未创建，下一帧继续创建
            if (index < blockArray.length) {
                // 使用 scheduleOnce 在下一帧执行 createBlocks
                _this.scheduleOnce(function () {
                    createBlocks();
                }, 0);
            }
            else {
            }
        };
        // 开始分帧创建方块
        createBlocks();
    };
    //给创建方块排序，用来降低drawcall 合批
    MapConroler.prototype.sortBlock = function (allBlocks) {
        return allBlocks.sort(function (a, b) {
            // 先处理 type 为 1 的情况，将其放到最后
            if (a.type === 1 && b.type !== 1) {
                return 1;
            }
            if (a.type !== 1 && b.type === 1) {
                return -1;
            }
            // 对 type 不为 0 的元素按 type 排序
            if (a.type !== 0 && b.type !== 0) {
                return a.type - b.type;
            }
            if (a.type !== 0 && b.type === 0) {
                return 1;
            }
            if (a.type === 0 && b.type !== 0) {
                return -1;
            }
            // 再处理 block 为 23 的情况，将其放到最前面
            if (a.block === 23 && b.block !== 23) {
                return -1;
            }
            if (a.block !== 23 && b.block === 23) {
                return 1;
            }
            // 其余按 color 升序排列
            return a.color - b.color;
        });
    };
    //创建墙壁
    MapConroler.prototype.wallInit = function () {
        var _this = this;
        var index = 0; // 当前要创建的墙壁索引
        var WALLS_PER_FRAME = 1; // 初始每帧创建的墙壁数量
        var MAX_PER_FRAME = 10; // 每帧最大创建数量
        var MIN_PER_FRAME = 1; // 每帧最小创建数量
        var createWalls = function () {
            var startTime = performance.now();
            for (var i = 0; i < WALLS_PER_FRAME && index < _this.wallInfo.length; i++) {
                var block = _this.wallInfo[index];
                var dir = _this.getWllDiraction("wall", cc.v2(block.getComponent("MapBlock").posX, block.getComponent("MapBlock").posY));
                if (dir != null) {
                    _this.createWall(dir, block);
                }
                index++;
            }
            var endTime = performance.now();
            var frameTime = endTime - startTime;
            // 如果当前帧执行时间过长，减少每帧创建数量
            if (frameTime > 16) {
                WALLS_PER_FRAME = Math.max(WALLS_PER_FRAME - 1, MIN_PER_FRAME);
            }
            else {
                WALLS_PER_FRAME = Math.min(WALLS_PER_FRAME + 1, MAX_PER_FRAME);
            }
            // 如果还有墙壁未创建，下一帧继续创建
            if (index < _this.wallInfo.length) {
                _this.scheduleOnce(function () {
                    createWalls();
                }, 0);
            }
            else {
                // 所有墙壁创建完成后，创建拐角节点
                _this.createCornerNodes();
            }
        };
        // 开始分帧创建墙壁
        createWalls();
    };
    // ... 已有代码 ...
    MapConroler.prototype.getWllDiraction = function (type, pointA) {
        var dir = [];
        var pointB = cc.v2(pointA.x + 1, pointA.y);
        var pointC = cc.v2(pointA.x - 1, pointA.y);
        var pointD = cc.v2(pointA.x, pointA.y + 1);
        var pointE = cc.v2(pointA.x, pointA.y - 1);
        var opacity = 0;
        if (type == "wall")
            opacity = 255;
        if (type == "turn")
            opacity = 250;
        if (pointB.x < this.mapWidth) {
            if (this.mapBlocksWall[pointB.x][pointB.y].opacity == opacity) {
                if (type == "turn" && this.mapBlocksWall[pointB.x][pointB.y].getComponent("MapBlock").direction == "right") {
                }
                else
                    dir.push("right");
            }
        }
        if (pointC.x >= 0) {
            if (this.mapBlocksWall[pointC.x][pointC.y].opacity == opacity) {
                if (type == "turn" && this.mapBlocksWall[pointC.x][pointC.y].getComponent("MapBlock").direction == "left") {
                }
                else
                    dir.push("left");
            }
        }
        if (pointD.y < this.mapHeight) {
            if (this.mapBlocksWall[pointD.x][pointD.y].opacity == opacity) {
                if (type == "turn" && this.mapBlocksWall[pointD.x][pointD.y].getComponent("MapBlock").direction == "up") {
                }
                else
                    dir.push("up");
            }
        }
        if (pointE.y >= 0) {
            if (this.mapBlocksWall[pointE.x][pointE.y].opacity == opacity) {
                if (type == "turn" && this.mapBlocksWall[pointE.x][pointE.y].getComponent("MapBlock").direction == "down") {
                }
                else
                    dir.push("down");
            }
        }
        if (dir.length > 2) {
            return null;
        }
        if (dir.length == 1) {
            if (type == "wall")
                return dir[0];
            else
                return null;
        }
        else if (dir.length == 2) {
            return dir[0] + dir[1];
        }
    };
    MapConroler.prototype.createCornerNodes = function () {
        // 定义拐角位置
        for (var i = 0; i < this.wallInfo.length; i++) {
            var block = this.wallInfo[i];
            if (block.opacity != 250) {
                var dir = this.getWllDiraction("turn", cc.v2(block.getComponent("MapBlock").posX, block.getComponent("MapBlock").posY));
                if (dir != null) {
                    this.createTurn(dir, block, block.getComponent("MapBlock").posX, block.getComponent("MapBlock").posY);
                }
            }
        }
    };
    MapConroler.prototype.createWall = function (direction, node) {
        var wall = null;
        node.getComponent("MapBlock").setDiraction(direction);
        switch (direction) {
            case "right":
                node.opacity = 250;
                wall = cc.instantiate(this.Wall_Prefab[4]);
                this.leftDoors.push(wall);
                // wall.parent = this.node.getChildByName("Wall");
                wall.parent = this.node;
                wall.setPosition(cc.v2(node.x, node.y));
                node.opacity = 250;
                wall.getChildByName("wall").getComponent("Wall").init(null, node.getComponent("MapBlock").posX, node.getComponent("MapBlock").posY, direction);
                //wall.getChildByName("wall").getChildByName("num").getComponent(cc.Label).string = this.wallNum.toString();
                this.setDoorInfo(wall.getChildByName("wall"));
                this.wallNum += 1;
                if (wall.getChildByName("wall").getComponent("Wall").special == 2)
                    this.openWall.push(wall);
                else if (wall.getChildByName("wall").getComponent("Wall").special == 3)
                    this.freezeWall.push(wall);
                break;
            case "left":
                node.opacity = 250;
                wall = cc.instantiate(this.Wall_Prefab[3]);
                // wall.parent = this.node.getChildByName("Wall");
                this.rightDoors.push(wall);
                wall.parent = this.node;
                wall.setPosition(cc.v2(node.x, node.y));
                wall.getChildByName("wall").getComponent("Wall").init(null, node.getComponent("MapBlock").posX, node.getComponent("MapBlock").posY, direction);
                this.setDoorInfo(wall.getChildByName("wall"));
                //wall.getChildByName("wall").getChildByName("num").getComponent(cc.Label).string = this.wallNum.toString();
                this.wallNum += 1;
                if (wall.getChildByName("wall").getComponent("Wall").special == 2)
                    this.openWall.push(wall);
                else if (wall.getChildByName("wall").getComponent("Wall").special == 3)
                    this.freezeWall.push(wall);
                break;
            case "up":
                node.opacity = 250;
                wall = cc.instantiate(this.Wall_Prefab[5]);
                this.topDoors.push(wall);
                // wall.parent = this.node.getChildByName("Wall");
                wall.parent = this.node;
                wall.setPosition(cc.v2(node.x, node.y));
                wall.getChildByName("wall").getComponent("Wall").init(null, node.getComponent("MapBlock").posX, node.getComponent("MapBlock").posY, direction);
                this.setDoorInfo(wall.getChildByName("wall"));
                //wall.getChildByName("wall").getChildByName("num").getComponent(cc.Label).string = this.wallNum.toString();
                this.wallNum += 1;
                if (wall.getChildByName("wall").getComponent("Wall").special == 2)
                    this.openWall.push(wall);
                else if (wall.getChildByName("wall").getComponent("Wall").special == 3)
                    this.freezeWall.push(wall);
                break;
            case "down":
                node.opacity = 250;
                wall = cc.instantiate(this.Wall_Prefab[0]);
                this.bottomDoors.push(wall);
                // wall.parent = this.node.getChildByName("Wall");
                wall.parent = this.node;
                wall.setPosition(cc.v2(node.x, node.y));
                // this.setDoorInfo(wall.getChildByName("wall"));
                wall.getChildByName("wall").getComponent("Wall").init(null, node.getComponent("MapBlock").posX, node.getComponent("MapBlock").posY, direction);
                this.setDoorInfo(wall.getChildByName("wall"));
                //wall.getChildByName("wall").getChildByName("num").getComponent(cc.Label).string = this.wallNum.toString();
                this.wallNum += 1;
                if (wall.getChildByName("wall").getComponent("Wall").special == 2)
                    this.openWall.push(wall);
                else if (wall.getChildByName("wall").getComponent("Wall").special == 3)
                    this.freezeWall.push(wall);
                break;
            case "upright":
            case "rightup":
                node.opacity = 249;
                wall = cc.instantiate(this.Wall_Prefab[7]);
                // wall.parent = this.node.getChildByName("Wall");
                wall.parent = this.node;
                wall.setPosition(cc.v2(node.x, node.y));
                wall.children[1].getComponent("Wall").init(null, node.getComponent("MapBlock").posX, node.getComponent("MapBlock").posY, direction);
                wall.children[2].getComponent("Wall").init(null, node.getComponent("MapBlock").posX, node.getComponent("MapBlock").posY, direction);
                //wall.children[0].getChildByName("num").getComponent(cc.Label).string = this.wallNum.toString();
                this.setDoorInfo(wall.children[0]);
                this.wallNum += 1;
                //wall.children[1].getChildByName("num").getComponent(cc.Label).string = this.wallNum.toString();
                this.setDoorInfo(wall.children[1]);
                this.wallNum += 1;
                break;
            case "upleft":
            case "leftup":
                node.opacity = 249;
                wall = cc.instantiate(this.Wall_Prefab[6]);
                // wall.parent = this.node.getChildByName("Wall");
                wall.parent = this.node;
                wall.setPosition(cc.v2(node.x, node.y));
                wall.children[1].getComponent("Wall").init(null, node.getComponent("MapBlock").posX, node.getComponent("MapBlock").posY, direction);
                wall.children[2].getComponent("Wall").init(null, node.getComponent("MapBlock").posX, node.getComponent("MapBlock").posY, direction);
                //wall.children[0].getChildByName("num").getComponent(cc.Label).string = this.wallNum.toString();
                this.setDoorInfo(wall.children[0]);
                this.wallNum += 1;
                //wall.children[1].getChildByName("num").getComponent(cc.Label).string = this.wallNum.toString();
                this.setDoorInfo(wall.children[1]);
                this.wallNum += 1;
                break;
            case "downright":
            case "rightdown":
                node.opacity = 249;
                wall = cc.instantiate(this.Wall_Prefab[2]);
                // wall.parent = this.node.getChildByName("Wall");
                wall.parent = this.node;
                wall.setPosition(cc.v2(node.x, node.y));
                wall.children[1].getComponent("Wall").init(null, node.getComponent("MapBlock").posX, node.getComponent("MapBlock").posY, direction);
                wall.children[2].getComponent("Wall").init(null, node.getComponent("MapBlock").posX, node.getComponent("MapBlock").posY, direction);
                //wall.children[0].getChildByName("num").getComponent(cc.Label).string = this.wallNum.toString();
                this.setDoorInfo(wall.children[0]);
                this.wallNum += 1;
                //wall.children[1].getChildByName("num").getComponent(cc.Label).string = this.wallNum.toString();
                this.setDoorInfo(wall.children[1]);
                this.wallNum += 1;
                break;
            case "downleft":
            case "leftdown":
                node.opacity = 249;
                wall = cc.instantiate(this.Wall_Prefab[1]);
                // wall.parent = this.node.getChildByName("Wall");
                wall.parent = this.node;
                wall.setPosition(cc.v2(node.x, node.y));
                wall.children[1].getComponent("Wall").init(null, node.getComponent("MapBlock").posX, node.getComponent("MapBlock").posY, direction);
                wall.children[2].getComponent("Wall").init(null, node.getComponent("MapBlock").posX, node.getComponent("MapBlock").posY, direction);
                //wall.children[0].getChildByName("num").getComponent(cc.Label).string = this.wallNum.toString();
                this.setDoorInfo(wall.children[0]);
                this.wallNum += 1;
                //wall.children[1].getChildByName("num").getComponent(cc.Label).string = this.wallNum.toString();
                this.setDoorInfo(wall.children[1]);
                this.wallNum += 1;
                break;
        }
        // if(wallTurn){
        //     wallTurn.getComponent("wallTunr").init(wall);
        // }
    };
    MapConroler.prototype.setDoorInfo = function (wall) {
        var doorInfo = cc.fx.GameConfig.WALL_INFO[0];
        if (doorInfo) {
            for (var j = 0; j < doorInfo.length; j++) {
                if (doorInfo[j].num == this.wallNum) {
                    wall.getComponent("Wall").init(doorInfo[j], null, null, null);
                    this.wallArray.push(wall.parent);
                }
            }
        }
    };
    MapConroler.prototype.createTurn = function (direction, node, posX, posY) {
        var wall = null;
        wall = cc.instantiate(this.wallTurnPrefab);
        wall.parent = this.node;
        wall.setPosition(cc.v2(node.x, node.y));
        switch (direction) {
            case "upright":
            case "rightup":
                wall.angle = 0;
                wall.getChildByName("icon").angle = 0;
                break;
            case "upleft":
            case "leftup":
                wall.angle = 90;
                wall.getChildByName("icon").angle = -90;
                wall.getChildByName("icon").y += 5;
                wall.getChildByName("icon").x -= 1.3;
                break;
            case "downright":
            case "rightdown":
                wall.angle = 270;
                wall.getChildByName("icon").angle = -270;
                wall.getChildByName("icon").x += 2.5;
                wall.getChildByName("icon").y += 1;
                break;
            case "downleft":
            case "leftdown":
                wall.angle = 180;
                wall.getChildByName("icon").angle = -180;
                wall.getChildByName("icon").x += 4.5;
                wall.getChildByName("icon").y += 3.2;
                break;
        }
        // if(direction == "rightdown" || direction == "downright") {
        //     wall.zIndex = 50 + posX - posY*3;
        // }
        // else 
        //     wall.zIndex = 50 + posX - posY*3;
        if (direction == "up" || direction == "leftup" || direction == "upleft") {
            wall.zIndex = 100 + posX - posY * 3;
        }
        else if (direction == "rightup" || direction == "upright" || direction == "rightdown" || direction == "downright" || direction == "downleft") {
            wall.zIndex = 30 + posX - posY * 3;
        }
        else if (direction == "left" || direction == "leftdown") {
            wall.zIndex = 70 + posX - posY * 3;
        }
        else
            wall.zIndex = 70 + posX - posY * 3;
        // wall.getChildByName("num").angle = -wall.angle;
        //wall.getChildByName("num").getComponent(cc.Label).string = direction;
        //wall.getChildByName("num").getComponent(cc.Label).string = wall.zIndex+ "";
        // console.log(posX,posY,wall.zIndex);
        // this.wallNum +=  1;
        // wall.getChildByName("num").getComponent(cc.Label).string = this.wallNum + "";
    };
    //地图底块缺口判断
    MapConroler.prototype.mapGap = function (point, gap) {
        for (var i = 0; i < gap.length; i++) {
            if (point.x == gap[i].x && point.y == gap[i].y) {
                return false;
            }
        }
        return true;
    };
    //升降地块判断
    MapConroler.prototype.mapRiseFall = function (point, risefall, block) {
        for (var i = 0; i < risefall.length; i++) {
            if (point.x == risefall[i].pos.x && point.y == risefall[i].pos.y) {
                block.getChildByName("risefall").active = true;
                block.getChildByName('risefall').getChildByName("color").getComponent(cc.Label).string = risefall[i].color + "";
                block.getChildByName('risefall').addComponent(cc.BoxCollider);
                block.getChildByName('risefall').getComponent(cc.BoxCollider).size = cc.size(110, 110);
                return true;
            }
        }
        return false;
    };
    //升降地块
    MapConroler.prototype.changeRiseFall = function (color, down) {
        color = color.toString();
        for (var i = 0; i < this.riseFallBlcok.length; i++) {
            if (color == this.riseFallBlcok[i].getChildByName("risefall").getChildByName("color").getComponent(cc.Label).string) {
                if (down) {
                    this.riseFallBlcok[i].getChildByName("risefall").active = false;
                    this.riseFallBlcok[i].getChildByName('risefall').removeComponent(cc.BoxCollider);
                }
                else {
                    this.riseFallBlcok[i].getChildByName("risefall").active = true;
                    this.riseFallBlcok[i].getChildByName('risefall').addComponent(cc.BoxCollider);
                    this.riseFallBlcok[i].getChildByName('risefall').getComponent(cc.BoxCollider).size = cc.size(110, 110);
                }
            }
        }
    };
    //查询叠加快id
    MapConroler.prototype.foundDownBlock = function (id) {
        for (var i = 0; i < this.blocks.length; i++) {
            if (this.blocks[i].getComponent("Block").blockId == id) {
                return this.blocks[i];
            }
        }
        return null;
    };
    //删除块
    MapConroler.prototype.removeBlock = function (id) {
        for (var i = 0; i < this.blocks.length; i++) {
            if (this.blocks[i].getComponent("Block").blockId == id) {
                return this.blocks[i];
            }
        }
        return null;
    };
    MapConroler.prototype.getMinAndMax = function (block) {
        var width = Math.floor(block.width / 120);
        var height = Math.floor(block.height / 120);
        var minX = width;
        var maxX = this.mapWidth - 2;
        var minY = 1;
        var maxY = this.mapHeight - 2 - height + 1;
        if (block.name == "block10") {
            minX = width - 1;
            if (this.mapWidth > 3)
                maxX = maxX - 1;
        }
        else if (block.name == "block11") {
            minX = width - 2;
            if (this.mapWidth > 3)
                maxX = maxX - 2;
        }
        else if (block.name == "block14") {
            minX = width - 1;
            maxX = maxX - 1;
        }
        else if (block.name == "block16") {
            minX = width - 1;
            maxX = maxX - 1;
        }
        else if (block.name == "block18") {
            minX = width - 1;
            maxX = maxX - 1;
        }
        else if (block.name == "block21") {
            minX = width - 1;
            maxX = maxX - 1;
        }
        return { minX: minX, maxX: maxX, minY: minY, maxY: maxY };
    };
    //检测落点是否可以消除
    MapConroler.prototype.checkPass = function (node, blocks) {
        var minAndMax = this.getMinAndMax(node);
        var minX = minAndMax.minX;
        var maxX = minAndMax.maxX;
        var minY = minAndMax.minY;
        var maxY = minAndMax.maxY;
        var nodePos = cc.v2(node.getComponent("Block").posX, node.getComponent("Block").posY);
        // 获取地图边界信息
        var allBlocks = [];
        for (var i = 0; i < blocks.length; i++) {
            allBlocks.push(cc.v2(nodePos.x + blocks[i].x, nodePos.y + blocks[i].y));
        }
        // const date1 = new Date().getTime();
        // console.log("将小块放入数组的时间",date1);
        var jg = -1;
        var pz = 0;
        // 获取所有墙壁节点
        // let wall = this.node;
        var direction = this.checkDiraction(allBlocks, maxX, maxY);
        // 判断方块是否在地图边缘
        if (nodePos.x <= minX || direction[0] == true) {
            // const date2 = new Date().getTime();
            // console.log("碰到左边缘",date2);
            pz += 1;
            var leftWalls = [];
            for (var i = 0; i < this.leftDoors.length; i++) {
                var wallLeft = this.leftDoors[i].getChildByName("wall");
                var wallPos = cc.v2(wallLeft.getComponent("Wall").posX, wallLeft.getComponent("Wall").posY);
                for (var i_1 = 0; i_1 < allBlocks.length; i_1++) {
                    if (allBlocks[i_1].y == wallPos.y && allBlocks[i_1].x > wallPos.x) {
                        // console.log("id:",wall.getChildByName("num").getComponent(cc.Label).string);
                        leftWalls.push(wallLeft);
                    }
                }
            }
            // console.log("得到左边墙壁数组",date6);
            if (leftWalls.length != 0) {
                var result = this.detectingBlock("left", node.getComponent("Block").posX, node.getComponent("Block").posY, allBlocks);
                if (result == true)
                    result = this.passWall(result, leftWalls, node);
                // console.log("碰到左边缘结果:",jg);
                if (result) {
                    this.blockNum -= 1;
                    this.special_Treatment(node);
                    jg = 2;
                    this.createParticle(node, jg);
                    return jg;
                }
            }
        }
        if (nodePos.x >= maxX || direction[1] == true) {
            // const date3 = new Date().getTime();
            // console.log("碰到右边缘",date3);
            pz += 1;
            var rightWalls = [];
            for (var i = 0; i < this.rightDoors.length; i++) {
                var wallRight = this.rightDoors[i].getChildByName("wall");
                var wallPos = cc.v2(wallRight.getComponent("Wall").posX, wallRight.getComponent("Wall").posY);
                for (var i_2 = 0; i_2 < allBlocks.length; i_2++) {
                    if (allBlocks[i_2].y == wallPos.y && allBlocks[i_2].x < wallPos.x) {
                        // console.log("id:",wall.getChildByName("num").getComponent(cc.Label).string);
                        rightWalls.push(wallRight);
                    }
                }
            }
            if (rightWalls.length != 0) {
                var result = this.detectingBlock("right", node.getComponent("Block").posX, node.getComponent("Block").posY, allBlocks);
                if (result == true)
                    result = this.passWall(result, rightWalls, node);
                // console.log("碰到右边缘结果:",jg);
                if (result) {
                    this.blockNum -= 1;
                    this.special_Treatment(node);
                    jg = 3;
                    this.createParticle(node, jg);
                    return jg;
                }
            }
        }
        if (nodePos.y <= minY || direction[2] == true) {
            pz += 1;
            // const date4 = new Date().getTime();
            // console.log("碰到下边缘",date4);
            var downWalls = [];
            for (var i = 0; i < this.topDoors.length; i++) {
                var wallBottom = this.topDoors[i].getChildByName("wall");
                var wallPos = cc.v2(wallBottom.getComponent("Wall").posX, wallBottom.getComponent("Wall").posY);
                for (var i_3 = 0; i_3 < allBlocks.length; i_3++) {
                    var luocha = Math.abs(allBlocks[i_3].y - wallPos.y);
                    if (allBlocks[i_3].x == wallPos.x && allBlocks[i_3].y > wallPos.y && luocha <= node.getComponent("Block").shu) {
                        // console.log("id:",wall.getChildByName("num").getComponent(cc.Label).string);
                        downWalls.push(wallBottom);
                    }
                }
            }
            if (downWalls.length != 0) {
                var result = this.detectingBlock("down", node.getComponent("Block").posX, node.getComponent("Block").posY, allBlocks);
                if (result == true)
                    result = this.passWall(result, downWalls, node);
                // console.log("碰到下边缘结果:",jg);
                if (result) {
                    this.blockNum -= 1;
                    this.special_Treatment(node);
                    jg = 1;
                    this.createParticle(node, jg);
                    return jg;
                }
            }
        }
        if (nodePos.y >= maxY || direction[3] == true) {
            pz += 1;
            // const date5 = new Date().getTime();
            // console.log("碰到上边缘",date5);
            var upWalls = [];
            for (var i = 0; i < this.bottomDoors.length; i++) {
                var wallTop = this.bottomDoors[i].getChildByName("wall");
                var wallPos = cc.v2(wallTop.getComponent("Wall").posX, wallTop.getComponent("Wall").posY);
                for (var i_4 = 0; i_4 < allBlocks.length; i_4++) {
                    var luocha = Math.abs(allBlocks[i_4].y - wallPos.y);
                    if (allBlocks[i_4].x == wallPos.x && allBlocks[i_4].y < wallPos.y && luocha <= node.getComponent("Block").shu) {
                        upWalls.push(wallTop);
                    }
                }
            }
            if (upWalls.length != 0) {
                var result = this.detectingBlock("up", node.getComponent("Block").posX, node.getComponent("Block").posY, allBlocks);
                if (result == true)
                    result = this.passWall(result, upWalls, node);
                // console.log("碰到上边缘结果:",result);
                if (result) {
                    this.blockNum -= 1;
                    this.special_Treatment(node);
                    jg = 0;
                    this.createParticle(node, jg);
                    return jg;
                }
            }
        }
        if (pz == 0)
            jg = -1;
        // const date10 = new Date().getTime();
        // console.log("所有检测结束耗时",date10,jg);
        return jg;
    };
    MapConroler.prototype.changeState = function () {
        if (this.openWall.length != 0) {
            for (var i = 0; i < this.openWall.length; i++) {
                this.openWall[i].getChildByName("wall").getComponent("Wall").changeLock();
            }
        }
        if (this.freezeWall.length != 0) {
            for (var i = 0; i < this.freezeWall.length; i++) {
                this.freezeWall[i].getChildByName("wall").getComponent("Wall").changeFreeze();
            }
        }
    };
    //检测是否可以通过门
    MapConroler.prototype.passWall = function (jg, wallArray, node) {
        for (var i = 0; i < wallArray.length; i++) {
            if (wallArray[i].getComponent("Wall").special == 2) {
                console.log("尝试通过开关门:", wallArray[i].getComponent("Wall").open);
            }
            if (wallArray[i].getComponent("Wall").special == 2 && wallArray[i].getComponent("Wall").open == false) {
                jg = false;
                break;
            }
            //console.log(wallArray[i].getChildByName("wall").getComponent("Wall").color,node.getComponent("Block").color)
            if (wallArray[i].getComponent("Wall").color != node.getComponent("Block").color) {
                jg = false;
                break;
            }
            if (node.getComponent("Block").type == 5) {
                if (wallArray[i].getComponent("Wall").special != 1) {
                    jg = false;
                    break;
                }
            }
        }
        if (jg == true && node.getComponent("Block").type == 5) {
            for (var j = 0; j < wallArray.length; j++) {
                if (wallArray[j].getComponent("Wall").special == 1 && wallArray[j].getComponent("Wall").wall_Info.length != 0) {
                    wallArray[j].getComponent("Wall").playStarDoor();
                }
            }
        }
        // const date8 = new Date().getTime();
        // console.log("检测颜色是否能够通过门",date8);
        return jg;
    };
    //检测方块和门中间有没有夹杂其他块
    MapConroler.prototype.detectingBlock = function (direction, posX, posY, blocks) {
        var jg = true;
        var id = "";
        if (blocks.length > 0) {
            for (var i = 0; i < blocks.length; i++) {
                var pos = blocks[i];
                var x = pos.x;
                var y = pos.y;
                id = this.mapBlocksWall[x][y].getComponent("MapBlock").block_Id;
                jg = this.checkAllDirections(id, direction, x, y);
                if (!jg) {
                    // console.log("方向检测没过");
                    i = 1000000;
                    return jg;
                }
            }
        }
        // const date7 = new Date().getTime();
        // console.log("方向检测通过",date7,jg);
        return jg;
    };
    //检测物体各方向是否有别的物块，防止碰到墙壁了但是是凹凸形状，墙与块之间有阻挡物块
    MapConroler.prototype.checkAllDirections = function (id, direction, x, y) {
        var jg = true;
        if (direction == "left") {
            if (this.mapBlocksWall[x - 1][y].getComponent("MapBlock").block_Id != "" && this.mapBlocksWall[x - 1][y].getComponent("MapBlock").block_Id != "Wall"
                && this.mapBlocksWall[x - 1][y].getComponent("MapBlock").block_Id != id) {
                // console.log("左侧有物体")
                jg = false;
                return jg;
            }
            if (this.mapBlocksWall[x - 1][y].opacity == 249) {
                jg = false;
                return jg;
            }
            if ((x - 2) >= 0) {
                if (this.mapBlocksWall[x - 2][y].getComponent("MapBlock").block_Id != "" && this.mapBlocksWall[x - 2][y].getComponent("MapBlock").block_Id != "Wall"
                    && this.mapBlocksWall[x - 2][y].getComponent("MapBlock").block_Id != id) {
                    // console.log("左侧有物体")
                    jg = false;
                    return jg;
                }
                if (this.mapBlocksWall[x - 2][y].opacity == 249) {
                    jg = false;
                    return jg;
                }
            }
        }
        else if (direction == "right") {
            if (this.mapBlocksWall[x + 1][y].getComponent("MapBlock").block_Id != "" && this.mapBlocksWall[x + 1][y].getComponent("MapBlock").block_Id != "Wall"
                && this.mapBlocksWall[x + 1][y].getComponent("MapBlock").block_Id != id) {
                // console.log("右侧有物体")
                jg = false;
                return jg;
            }
            if (this.mapBlocksWall[x + 1][y].opacity == 249) {
                jg = false;
                return jg;
            }
            if ((x + 2) <= this.mapBlocksWall.length - 1) {
                if (this.mapBlocksWall[x + 2][y].getComponent("MapBlock").block_Id != "" && this.mapBlocksWall[x + 2][y].getComponent("MapBlock").block_Id != "Wall"
                    && this.mapBlocksWall[x + 2][y].getComponent("MapBlock").block_Id != id) {
                    // console.log("右侧有物体")
                    jg = false;
                    return jg;
                }
                if (this.mapBlocksWall[x + 2][y].opacity == 249) {
                    jg = false;
                    return jg;
                }
            }
        }
        if (direction == "up") {
            if (this.mapBlocksWall[x][y + 1].getComponent("MapBlock").block_Id != "" && this.mapBlocksWall[x][y + 1].getComponent("MapBlock").block_Id != "Wall"
                && this.mapBlocksWall[x][y + 1].getComponent("MapBlock").block_Id != id) {
                // console.log("上侧有物体")
                jg = false;
                return jg;
            }
            if (this.mapBlocksWall[x][y + 1].opacity == 249) {
                jg = false;
                return jg;
            }
            if ((y + 2) <= this.mapBlocksWall[x].length - 1) {
                if (this.mapBlocksWall[x][y + 2].getComponent("MapBlock").block_Id != "" && this.mapBlocksWall[x][y + 2].getComponent("MapBlock").block_Id != "Wall"
                    && this.mapBlocksWall[x][y + 2].getComponent("MapBlock").block_Id != id) {
                    // console.log("上侧有物体")
                    jg = false;
                    return jg;
                }
                if (this.mapBlocksWall[x][y + 2].opacity == 249) {
                    jg = false;
                    return jg;
                }
            }
        }
        if (direction == "down") {
            if (this.mapBlocksWall[x][y - 1].getComponent("MapBlock").block_Id != "" && this.mapBlocksWall[x][y - 1].getComponent("MapBlock").block_Id != "Wall"
                && this.mapBlocksWall[x][y - 1].getComponent("MapBlock").block_Id != id) {
                // console.log("下侧有物体")
                jg = false;
                return jg;
            }
            if (this.mapBlocksWall[x][y - 1].opacity == 249) {
                jg = false;
                return jg;
            }
            if ((y - 2) >= 0) {
                if (this.mapBlocksWall[x][y - 2].getComponent("MapBlock").block_Id != "" && this.mapBlocksWall[x][y - 2].getComponent("MapBlock").block_Id != "Wall"
                    && this.mapBlocksWall[x][y - 2].getComponent("MapBlock").block_Id != id) {
                    // console.log("下侧有物体")
                    jg = false;
                    return jg;
                }
                if (this.mapBlocksWall[x][y - 2].opacity == 249) {
                    jg = false;
                    return jg;
                }
            }
        }
        // console.log("检测物体各方向是否有别的物块",jg);
        return jg;
    };
    MapConroler.prototype.checkDiraction = function (allBlocks, maxX, maxY) {
        var jg = [false, false, false, false];
        for (var i = 0; i < allBlocks.length; i++) {
            if (allBlocks[i].x > 0 && jg[0] == false) {
                if (this.mapBlocksWall[allBlocks[i].x - 1][allBlocks[i].y].opacity == 250) {
                    jg[0] = true;
                }
            }
            if (jg[1] == false) {
                if (this.mapBlocksWall[allBlocks[i].x + 1][allBlocks[i].y].opacity == 250) {
                    jg[1] = true;
                }
            }
            if (allBlocks[i].y > 0 && jg[2] == false) {
                if (this.mapBlocksWall[allBlocks[i].x][allBlocks[i].y - 1].opacity == 250) {
                    jg[2] = true;
                }
            }
            if (jg[3] == false) {
                if (this.mapBlocksWall[allBlocks[i].x][allBlocks[i].y + 1].opacity == 250) {
                    jg[3] = true;
                }
            }
        }
        return jg;
    };
    MapConroler.prototype.checkLeft = function (allBlocks) {
        var jg = false;
        return jg;
    };
    MapConroler.prototype.checkRight = function (allBlocks, max) {
        var jg = false;
        for (var i = 0; i < allBlocks.length; i++) {
        }
        return jg;
    };
    MapConroler.prototype.checkDown = function (allBlocks) {
        var jg = false;
        for (var i = 0; i < allBlocks.length; i++) {
        }
        return jg;
    };
    MapConroler.prototype.checkUp = function (allBlocks, max) {
        var jg = false;
        for (var i = 0; i < allBlocks.length; i++) {
        }
        return jg;
    };
    //特殊处理，方块带道具或者需要消除冰块
    MapConroler.prototype.special_Treatment = function (node) {
        var freezeBlock = this.node.children.filter(function (child) {
            if (child.getComponent("Block")) {
                if (child.getComponent("Block").type == 4)
                    return child;
            }
        });
        if (freezeBlock.length > 0) {
            for (var i = 0; i < freezeBlock.length; i++) {
                freezeBlock[i].getChildByName("freeze").getComponent("Freeze").reduce(1);
            }
        }
        if (node.getComponent("Block").type == 2 || node.getComponent("Block").type == 4) {
            var lockBlock = this.node.children.filter(function (child) {
                if (child.getComponent("Block")) {
                    if (child.getComponent("Block").type == 3)
                        return child;
                }
            });
            if (lockBlock.length > 0)
                for (var i = 0; i < lockBlock.length; i++) {
                    lockBlock[i].getChildByName("lock").getComponent("Lock").reduce();
                }
        }
        for (var i = 0; i < this.blocks.length; i++) {
            if (this.blocks[i] == node) {
                this.blocks.splice(i, 1);
            }
        }
    };
    //判断游戏成功下一关
    MapConroler.prototype.nextLevel = function () {
        var _this = this;
        this.pause = false;
        this.openIce();
        this.blockNum = this.blocks.length;
        if (this.blockNum == 0 && !this.gameWin && !this.gameOver) {
            // alert("游戏成功");
            this.gameWin = true;
            this.stopTimeCutDown();
            // console.log("成功消除一个");
            cc.fx.GameTool.changeCoin(40);
            var timeData = {
                count_Time: this.count_Time,
                add_Time: this.add_Time
            };
            cc.fx.GameTool.addLevel(timeData);
            this.check_NewMode();
            setTimeout(function () {
                _this.node.parent.parent.getChildByName("Win").active = true;
            }, 660);
            // console.log("游戏成功");
        }
        else {
            if (this.gameOver == true) {
                this.failLevel(null);
            }
        }
    };
    MapConroler.prototype.check_NewMode = function () {
        for (var i = 0; i < cc.fx.GameConfig.NEW_LEVEL.length; i++) {
            if ((cc.fx.GameConfig.GM_INFO.level + 1) == cc.fx.GameConfig.NEW_LEVEL[i].level) {
                this.new_mode = 3;
            }
        }
    };
    MapConroler.prototype.winLevel = function () {
        cc.fx.AudioManager._instance.playEffect("anniu_Big", null);
        if (cc.fx.GameConfig.GM_INFO.level > 156) {
            cc.fx.GameConfig.GM_INFO.level = 156;
            MapConroler_1._instance = null;
            if (this.new_mode == 3) {
                this.node.parent.parent.getChildByName("Win").active = false;
                this.openNewMode(2);
                cc.fx.GameConfig.LEVEL_INFO_init(false, 0);
                return;
            }
            // cc.fx.GameConfig.LEVEL_INFO_init(true);
            cc.fx.AudioManager._instance.playEffect("zhuan1", null);
            this.node.parent.parent.parent.getChildByName("zhuanchang").active = true;
            this.node.parent.parent.parent.getChildByName("zhuanchang").getComponent(sp.Skeleton).setAnimation(1, "up", false);
            // this.node.parent.parent.parent.getChildByName("zhuanchang").getComponent(sp.Skeleton).setCompleteListener((entry) => {
            //     if (entry.animation.name === "up") {
            //         // 动画播放结束后执行的逻辑
            //         this.node.parent.parent.parent.getChildByName("zhuanchang").active = false;
            //     }
            // });
            cc.director.preloadScene("HomeScene", function (err, asset) {
                if (err) {
                    console.error('动态加载 Prefab 失败:', err);
                    return;
                }
            });
            setTimeout(function () {
                cc.director.loadScene("HomeScene");
            }, 1200);
        }
        else {
            // console.log("下一关");
            MapConroler_1._instance = null;
            if (this.new_mode == 3) {
                this.node.parent.parent.getChildByName("Win").active = false;
                this.openNewMode(2);
                cc.fx.GameConfig.LEVEL_INFO_init(false, 0);
                return;
            }
            cc.fx.AudioManager._instance.playEffect("zhuan1", null);
            this.node.parent.parent.parent.getChildByName("zhuanchang").active = true;
            this.node.parent.parent.parent.getChildByName("zhuanchang").getComponent(sp.Skeleton).setAnimation(1, "up", false);
            // this.node.parent.parent.parent.getChildByName("zhuanchang").getComponent(sp.Skeleton).setCompleteListener((entry) => {
            //     if (entry.animation.name === "up") {
            //         // 动画播放结束后执行的逻辑
            //         this.node.parent.parent.parent.getChildByName("zhuanchang").active = false;
            //     }
            // });
            setTimeout(function () {
                cc.fx.GameConfig.LEVEL_INFO_init(true, 0);
            }, 1200);
            // this.node.parent.parent.parent.destroy();
        }
    };
    MapConroler.prototype.againLevel = function () {
        cc.fx.AudioManager._instance.playEffect("anniu_Big", null);
        if (cc.fx.GameConfig.GM_INFO.hp < 1) {
            MiniGameSdk_1.MiniGameSdk.API.showToast("体力值不足");
            return;
        }
        if (!this.againCanTouch)
            return;
        this.againCanTouch = false;
        MapConroler_1._instance = null;
        cc.fx.AudioManager._instance.playEffect("zhuan1", null);
        this.node.parent.parent.parent.getChildByName("zhuanchang").active = true;
        this.node.parent.parent.parent.getChildByName("zhuanchang").getComponent(sp.Skeleton).setAnimation(1, "up", false);
        // this.node.parent.parent.parent.getChildByName("zhuanchang").getComponent(sp.Skeleton).setCompleteListener((entry) => {
        //     if (entry.animation.name === "up") {
        //         // 动画播放结束后执行的逻辑
        //         this.node.parent.parent.parent.getChildByName("zhuanchang").active = false;
        //     }
        // });
        setTimeout(function () {
            cc.fx.GameConfig.LEVEL_INFO_init(true, 0);
        }, 1200);
        // this.node.parent.parent.parent.destroy();
    };
    MapConroler.prototype.reviewLevel = function () {
        cc.fx.AudioManager._instance.playEffect("anniu_Big", null);
        var coin = 900;
        if (cc.fx.GameConfig.GM_INFO.review == 1)
            coin = 1900;
        else if (cc.fx.GameConfig.GM_INFO.review == 2)
            coin = 2500;
        // console.log("自身金币:",cc.fx.GameConfig.GM_INFO.coin,"消耗金币:",coin);
        if (cc.fx.GameConfig.GM_INFO.coin < Math.abs(coin)) {
            MiniGameSdk_1.MiniGameSdk.API.showToast("金币不足，无法加时间");
            return;
        }
        else {
            this.runRewive(-coin);
        }
    };
    MapConroler.prototype.runRewive = function (data) {
        console.log("复活回调函数内", data);
        cc.fx.GameTool.changeCoin(data);
        MiniGameSdk_1.MiniGameSdk.API.showToast("继续游戏");
        if (cc.fx.GameConfig.GM_INFO.review < 2)
            cc.fx.GameConfig.GM_INFO.review += 1;
        this.gameOver = false;
        this.timeNumber = 21;
        this.add_Time += 20;
        this.pause = false;
        this.node.parent.parent.getChildByName("Lose").active = false;
        this.startTimeCutDown();
    };
    MapConroler.prototype.homeBtn = function () {
        // alert("游戏失败");
        cc.fx.AudioManager._instance.playEffect("anniu_Big", null);
        if (!this.homeCanTouch)
            return;
        this.homeCanTouch = false;
        this.node.parent.parent.getChildByName("Lose").active = true;
        this.node.parent.parent.getChildByName("Lose").getChildByName("Time").active = false;
        this.node.parent.parent.getChildByName("Lose").getChildByName("Boom").active = false;
        this.node.parent.parent.getChildByName("Lose").getChildByName("Lock").active = false;
        this.node.parent.parent.getChildByName("Lose").getChildByName("Health").active = true;
        var data = {
            time: this.count_Time,
            add_Time: this.add_Time,
            result: "fail"
        };
        cc.fx.GameTool.shushu_Track("finish_stage", data);
        if (this.gameStart == true) {
            cc.fx.GameTool.setUserHealth(-1, function (data) {
            });
        }
        // this.node.parent.parent.parent.destroy();
    };
    MapConroler.prototype.returnHome = function () {
        cc.fx.AudioManager._instance.playEffect("anniu_Big", null);
        if (MapConroler_1._instance = null) {
            return;
        }
        // MiniGameSdk.API.showToast("体力值减少");
        MapConroler_1._instance = null;
        cc.fx.GameConfig.LEVEL_INFO_init(false, 0);
        if (this.new_mode == 3) {
            this.node.parent.parent.getChildByName("Win").active = false;
            this.openNewMode(1);
            return;
        }
        cc.fx.AudioManager._instance.playEffect("zhuan1", null);
        this.node.parent.parent.parent.getChildByName("zhuanchang").active = true;
        this.node.parent.parent.parent.getChildByName("zhuanchang").getComponent(sp.Skeleton).setAnimation(1, "up", false);
        cc.director.preloadScene("HomeScene", function (err, asset) {
            if (err) {
                console.error('动态加载 Prefab 失败:', err);
                return;
            }
        });
        setTimeout(function () {
            cc.director.loadScene("HomeScene");
        }, 1200);
    };
    //判断游戏失败
    MapConroler.prototype.failLevel = function (type) {
        var _this = this;
        this.stopTimeCutDown();
        if (this.gameOver == true || this.gameWin == true) {
            return;
        }
        var time = 0;
        this.gameOver = true;
        if (type == "boom") {
            time = 2000;
        }
        setTimeout(function () {
            _this.node.parent.parent.getChildByName("Lose").active = true;
            _this.node.parent.parent.getChildByName("Lose").getChildByName("Time").active = true;
            _this.node.parent.parent.getChildByName("Lose").getChildByName("Boom").active = false;
            var buyBtn = _this.node.parent.parent.getChildByName("Lose").getChildByName("Time").getChildByName("buyBtn");
            buyBtn.getChildByName("coin1").active = buyBtn.getChildByName("coin2").active = buyBtn.getChildByName("coin3").active = false;
            if (cc.fx.GameConfig.GM_INFO.review == 0)
                buyBtn.getChildByName("coin1").active = true;
            else if (cc.fx.GameConfig.GM_INFO.review == 1)
                buyBtn.getChildByName("coin2").active = true;
            else if (cc.fx.GameConfig.GM_INFO.review == 2)
                buyBtn.getChildByName("coin3").active = true;
            if (type) {
                if (type == "boom") {
                    _this.node.parent.parent.getChildByName("Lose").getChildByName("Time").active = false;
                    _this.node.parent.parent.getChildByName("Lose").getChildByName("Boom").active = true;
                }
            }
        }, time);
        // console.log("游戏失败");
    };
    //打开新模式弹窗
    MapConroler.prototype.openNewMode = function (type) {
        var _this = this;
        var index = 0;
        var BLOCKS_PER_FRAME = 5; // 每帧销毁的方块数量
        var destroyBlocks = function () {
            var endIndex = Math.min(index + BLOCKS_PER_FRAME, _this.blocks.length);
            for (; index < endIndex; index++) {
                if (_this.blocks[index]) {
                    _this.blocks[index].destroy();
                }
            }
            // 如果还有方块未销毁，下一帧继续
            if (index < _this.blocks.length) {
                _this.scheduleOnce(destroyBlocks, 0);
            }
            else {
            }
        };
        // 开始分帧销毁方块
        destroyBlocks();
        this.node.parent.parent.getChildByName("NewMode").active = true;
        this.node.parent.parent.getChildByName("NewMode").getComponent("NewMode").setMode(type);
    };
    MapConroler.prototype.downDoor = function (color, type) {
        for (var i = 0; i < this.wallArray.length; i++) {
            if (this.wallArray[i].getChildByName("wall").getComponent("Wall").color == color) {
                if (type) {
                    if (type == 5) {
                        if (this.wallArray[i].getChildByName("wall").getComponent("Wall").special == 1) {
                            this.wallArray[i].getChildByName("wall").getComponent("Wall").downDoor();
                        }
                    }
                    else
                        this.wallArray[i].getChildByName("wall").getComponent("Wall").downDoor();
                }
                else
                    this.wallArray[i].getChildByName("wall").getComponent("Wall").downDoor();
            }
        }
    };
    MapConroler.prototype.upDoor = function () {
        for (var i = 0; i < this.wallArray.length; i++) {
            if (this.wallArray[i].getChildByName("wall").opacity == 0) {
                this.wallArray[i].getChildByName("wall").getComponent("Wall").upDoor();
            }
        }
    };
    //开始倒计时
    MapConroler.prototype.startTimeCutDown = function () {
        this.scheduleCallback = function () {
            if (this.pause)
                return;
            if (this.timeNumber <= 0) {
                this.stopTimeCutDown();
                var timeTemp = cc.fx.GameTool.getTimeMargin(this.timeNumber);
                NumberToImage_1.default.getTimeMargin(this.timeNumber, 50, "time_", this.timeLabel);
                // this.timeLabel.string = timeTemp.toString();
                if (!this.pause)
                    this.failLevel("time");
            }
            else {
                this.timeNumber -= 1;
                this.count_Time += 1;
                var timeTemp = cc.fx.GameTool.getTimeMargin(this.timeNumber);
                NumberToImage_1.default.getTimeMargin(this.timeNumber, 50, "time_", this.timeLabel);
                // this.timeLabel.string = timeTemp.toString();
            }
        }.bind(this);
        this.schedule(this.scheduleCallback, 1);
    };
    // 停止倒计时
    MapConroler.prototype.stopTimeCutDown = function () {
        if (this.scheduleCallback) {
            this.unschedule(this.scheduleCallback);
        }
    };
    //使用时间道具
    MapConroler.prototype.useTimeProp = function () {
        if (this.node.parent.getChildByName("Ice").active == true || this.hammer == true
            || this.magicMask.active == true || this.timeNumber <= 1) {
            return;
        }
        var freezeBtn = this.node.parent.getChildByName("Bottom").getChildByName("timeBtn");
        if (freezeBtn.getComponent("btnControl")._touch) {
            freezeBtn.getComponent("btnControl").setTouch(false);
            if (cc.fx.GameConfig.GM_INFO.freezeAmount < 1) {
                if (cc.fx.GameConfig.GM_INFO.coin < 1500) {
                    MiniGameSdk_1.MiniGameSdk.API.showToast("金币不足，无法购买道具");
                    freezeBtn.getComponent("btnControl").setTouch(true);
                    return;
                }
                this.node.parent.parent.getChildByName("propWindow").active = true;
                this.node.parent.parent.parent.getComponent("SceneManager").openPropBuy("freeze");
            }
            else {
                if (!this.node.parent.getChildByName("Ice").active && !this.pause) {
                    var timestamp = Date.now();
                    this.freezeMask.active = true;
                    this.pause = true;
                    this.node.parent.getChildByName("Ice").active = true;
                    this.node.parent.getChildByName("Top").getChildByName("Ice").active = true;
                    cc.fx.GameConfig.GM_INFO.freezeAmount -= 1;
                    if (cc.fx.GameConfig.GM_INFO.freezeAmount < 0)
                        cc.fx.GameConfig.GM_INFO.freezeAmount = 0;
                    this.iceLabel.string = cc.fx.GameConfig.GM_INFO.freezeAmount.toString();
                    var propInfo = cc.fx.StorageMessage.getStorage("prop");
                    propInfo.freezeAmount = cc.fx.GameConfig.GM_INFO.freezeAmount;
                    propInfo.timestamp = timestamp;
                    cc.fx.StorageMessage.setStorage("prop", propInfo);
                    cc.fx.GameTool.setUserProp(2001, cc.fx.GameConfig.GM_INFO.freezeAmount, function (data) {
                    });
                    var data = {
                        id: "2001",
                        num: -1
                    };
                    cc.fx.GameTool.shushu_Track("resource_cost", data);
                }
                else
                    MiniGameSdk_1.MiniGameSdk.API.showToast("道具使用中，请稍后再试");
            }
        }
    };
    //解开时间冻结
    MapConroler.prototype.openIce = function () {
        if (this.node.parent.getChildByName("Ice").active) {
            this.freezeMask.active = false;
            var freezeBtn = this.node.parent.getChildByName("Bottom").getChildByName("timeBtn");
            freezeBtn.getComponent("btnControl").setTouch(true);
            this.node.parent.getChildByName("Ice").active = false;
            this.node.parent.getChildByName("Top").getChildByName("Ice").active = false;
            this.pause = false;
            // this.startTimeCutDown();
        }
    };
    MapConroler.prototype.handleBuySuccess = function (data) {
        var _this = this;
        this.pause = false;
        var timestamp = Date.now();
        // console.log("回调函数内:",this.pause);
        var freezeBtn = this.node.parent.getChildByName("Bottom").getChildByName("timeBtn");
        var hammerBtn = this.node.parent.getChildByName("Bottom").getChildByName("destroyBtn");
        var magicBtn = this.node.parent.getChildByName("Bottom").getChildByName("magicBtn");
        if (data == "freezeAmount")
            freezeBtn.getComponent("btnControl").setTouch(true);
        else if (data == "hammerAmount")
            hammerBtn.getComponent("btnControl").setTouch(true);
        else if (data == "magicAmount")
            magicBtn.getComponent("btnControl").setTouch(true);
        if (data == "freezeAmount") {
            cc.fx.GameConfig.GM_INFO.freezeAmount += 3;
            var propInfo = cc.fx.StorageMessage.getStorage("prop");
            propInfo.freezeAmount = cc.fx.GameConfig.GM_INFO.freezeAmount;
            propInfo.timestamp = timestamp;
            cc.fx.StorageMessage.setStorage("prop", propInfo);
            this.node.parent.parent.parent.getComponent("SceneManager").closePropBuy();
            setTimeout(function () {
                _this.iceLabel.string = cc.fx.GameConfig.GM_INFO.freezeAmount.toString();
                MiniGameSdk_1.MiniGameSdk.API.showToast("购买冻结时间道具成功");
            }, 200);
        }
        else if (data == "magicAmount") {
            cc.fx.GameConfig.GM_INFO.magicAmount += 3;
            var propInfo = cc.fx.StorageMessage.getStorage("prop");
            propInfo.magicAmount = cc.fx.GameConfig.GM_INFO.magicAmount;
            propInfo.timestamp = timestamp;
            cc.fx.StorageMessage.setStorage("prop", propInfo);
            this.node.parent.parent.parent.getComponent("SceneManager").closePropBuy();
            setTimeout(function () {
                MiniGameSdk_1.MiniGameSdk.API.showToast("购买锤子道具成功");
                _this.magicLabel.string = cc.fx.GameConfig.GM_INFO.magicAmount.toString();
            }, 200);
        }
        else if (data == "hammerAmount") {
            cc.fx.GameConfig.GM_INFO.hammerAmount += 3;
            var propInfo = cc.fx.StorageMessage.getStorage("prop");
            propInfo.hammerAmount = cc.fx.GameConfig.GM_INFO.hammerAmount;
            propInfo.timestamp = timestamp;
            cc.fx.StorageMessage.setStorage("prop", propInfo);
            this.node.parent.parent.parent.getComponent("SceneManager").closePropBuy();
            setTimeout(function () {
                _this.hammerLabel.string = cc.fx.GameConfig.GM_INFO.hammerAmount.toString();
                MiniGameSdk_1.MiniGameSdk.API.showToast("购买魔法棒道具成功");
            }, 200);
        }
    };
    //使用锤子道具
    MapConroler.prototype.useHammer = function () {
        if (this.node.parent.getChildByName("Ice").active == true || this.hammer == true
            || this.magicMask.active == true || this.timeNumber <= 1) {
            return;
        }
        var hammerBtn = this.node.parent.getChildByName("Bottom").getChildByName("destroyBtn");
        if (hammerBtn.getComponent("btnControl")._touch) {
            hammerBtn.getComponent("btnControl").setTouch(false);
            if (cc.fx.GameConfig.GM_INFO.hammerAmount < 1) {
                if (cc.fx.GameConfig.GM_INFO.coin < 1500) {
                    MiniGameSdk_1.MiniGameSdk.API.showToast("金币不足，无法购买道具");
                    hammerBtn.getComponent("btnControl").setTouch(true);
                    return;
                }
                this.node.parent.parent.getChildByName("propWindow").active = true;
                this.node.parent.parent.parent.getComponent("SceneManager").openPropBuy("hammer");
            }
            else {
                if (!this.hammer) {
                    var timestamp = Date.now();
                    this.hammerMask.active = true;
                    this.hammer = true;
                    cc.fx.GameConfig.GM_INFO.hammerAmount -= 1;
                    if (cc.fx.GameConfig.GM_INFO.hammerAmount < 0)
                        cc.fx.GameConfig.GM_INFO.hammerAmount = 0;
                    this.hammerLabel.string = cc.fx.GameConfig.GM_INFO.hammerAmount.toString();
                    var propInfo = cc.fx.StorageMessage.getStorage("prop");
                    console.log("锤子道具信息:", propInfo);
                    propInfo.hammerAmount = cc.fx.GameConfig.GM_INFO.hammerAmount;
                    propInfo.timestamp = timestamp;
                    cc.fx.StorageMessage.setStorage("prop", propInfo);
                    cc.fx.GameTool.setUserProp(2002, cc.fx.GameConfig.GM_INFO.hammerAmount, function (data) {
                    });
                    var data = {
                        id: "2002",
                        num: -1
                    };
                    cc.fx.GameTool.shushu_Track("resource_cost", data);
                }
                else
                    MiniGameSdk_1.MiniGameSdk.API.showToast("道具使用中，请稍后再试");
            }
        }
    };
    MapConroler.prototype.buyMagic = function () {
        if (cc.fx.GameConfig.GM_INFO.coin < 1500) {
            MiniGameSdk_1.MiniGameSdk.API.showToast("金币不足，无法购买道具");
            return;
        }
        cc.fx.GameTool.buyProp(2003, this.handleBuySuccess.bind(this, "magicAmount"));
    };
    MapConroler.prototype.buyHammer = function () {
        if (cc.fx.GameConfig.GM_INFO.coin < 1500) {
            MiniGameSdk_1.MiniGameSdk.API.showToast("金币不足，无法购买道具");
            return;
        }
        cc.fx.GameTool.buyProp(2002, this.handleBuySuccess.bind(this, "hammerAmount"));
    };
    MapConroler.prototype.buyFreeze = function () {
        if (cc.fx.GameConfig.GM_INFO.coin < 1500) {
            MiniGameSdk_1.MiniGameSdk.API.showToast("金币不足，无法购买道具");
            return;
        }
        cc.fx.GameTool.buyProp(2001, this.handleBuySuccess.bind(this, "freezeAmount"));
    };
    //使用魔法棒随机消除两个方块
    MapConroler.prototype.useMagic = function () {
        var _this = this;
        if (this.node.parent.getChildByName("Ice").active == true || this.hammer == true
            || this.magicMask.active == true || this.timeNumber <= 1) {
            return;
        }
        var magicBtn = this.node.parent.getChildByName("Bottom").getChildByName("magicBtn");
        if (magicBtn.getComponent("btnControl")._touch) {
            magicBtn.getComponent("btnControl").setTouch(false);
            if (cc.fx.GameConfig.GM_INFO.magicAmount < 1) {
                if (cc.fx.GameConfig.GM_INFO.coin < 1500) {
                    MiniGameSdk_1.MiniGameSdk.API.showToast("金币不足，无法购买道具");
                    magicBtn.getComponent("btnControl").setTouch(true);
                    return;
                }
                this.node.parent.parent.getChildByName("propWindow").active = true;
                this.node.parent.parent.parent.getComponent("SceneManager").openPropBuy("magic");
                // MiniGameSdk.API.showToast("魔法棒数量不足,自动购买魔法棒");
            }
            else {
                var timestamp = Date.now();
                this.magicMask.active = true;
                setTimeout(function () {
                    _this.magicMask.active = false;
                    magicBtn.getComponent("btnControl").setTouch(true);
                }, 1000);
                cc.fx.GameConfig.GM_INFO.magicAmount -= 1;
                if (cc.fx.GameConfig.GM_INFO.magicAmount < 0)
                    cc.fx.GameConfig.GM_INFO.magicAmount = 0;
                this.magicLabel.string = cc.fx.GameConfig.GM_INFO.magicAmount.toString();
                var propInfo = cc.fx.StorageMessage.getStorage("prop");
                propInfo.magicAmount = cc.fx.GameConfig.GM_INFO.magicAmount;
                propInfo.timestamp = timestamp;
                cc.fx.StorageMessage.setStorage("prop", propInfo);
                cc.fx.GameTool.setUserProp(2003, cc.fx.GameConfig.GM_INFO.magicAmount, function (data) {
                });
                var data = {
                    id: "2003",
                    num: -1
                };
                cc.fx.GameTool.shushu_Track("resource_cost", data);
                var nomalArray_1 = [];
                // this.magicBtn.node.active = false;
                for (var i = 0; i < this.blocks.length; i++) {
                    // console.log("方块类型",this.blocks[i].getComponent("Block").type);
                    if (this.blocks[i].getComponent("Block").type == 3) {
                        this.loackArray.push(this.blocks[i]);
                    }
                    else if (this.blocks[i].getComponent("Block").type == 4) {
                        this.freezeArray.push(this.blocks[i]);
                    }
                    else if (this.blocks[i].getComponent("Block").type == 10) {
                        if (this.blocks[i].getComponent("Block").block_Info.node) {
                            nomalArray_1.push(this.blocks[i].getComponent("Block").block_Info.node);
                        }
                        else
                            nomalArray_1.push(this.blocks[i]);
                    }
                    else {
                        nomalArray_1.push(this.blocks[i]);
                    }
                }
                if (nomalArray_1.length > 1) {
                    nomalArray_1 = cc.fx.GameTool.shuffleArray(nomalArray_1);
                    nomalArray_1[0].getComponent("Block").eliminate();
                    var time = 0;
                    if (nomalArray_1[0].getComponent("Block").type == 1 || nomalArray_1[0].getComponent("Block").type == 9) {
                        time = 200;
                    }
                    if (time > 0) {
                        setTimeout(function () {
                            nomalArray_1[1].getComponent("Block").eliminate();
                        }, time);
                        return;
                    }
                    else {
                        nomalArray_1[1].getComponent("Block").eliminate();
                        return;
                    }
                }
                else if (nomalArray_1.length == 1) {
                    nomalArray_1[0].getComponent("Block").eliminate();
                    var time = 0;
                    if (nomalArray_1[0].getComponent("Block").type == 1 || nomalArray_1[0].getComponent("Block").type == 9) {
                        time = 200;
                    }
                    setTimeout(function () {
                        if (_this.freezeArray.length == 0 && _this.loackArray.length == 0) {
                            // console.log("只剩下一个块道具使用完毕");
                        }
                        else {
                            if (_this.loackArray.length != 0) {
                                // console.log("消除一个普通块后，消除一个带锁块");
                                _this.loackArray[0].getComponent("Block").eliminate();
                                return;
                            }
                            else if (_this.freezeArray.length != 0) {
                                // console.log("消除一个普通块后，消除一个冻结块");
                                _this.freezeArray[0].getComponent("Block").eliminate();
                                return;
                            }
                        }
                    }, 200 + time);
                }
                else {
                    var count_1 = 2;
                    if (this.loackArray.length != 0) {
                        for (var i = 0; i < this.loackArray.length; i++) {
                            // console.log("没有普通快，魔法消除一个带锁块");
                            this.loackArray[i].getComponent("Block").eliminate();
                            count_1 -= 1;
                            if (count_1 == 0) {
                                break;
                            }
                        }
                    }
                    setTimeout(function () {
                        if (count_1 != 0) {
                            for (var i = 0; i < _this.freezeArray.length; i++) {
                                // console.log("没有普通快，魔法消除一个冻结块");
                                // this.freezeArray[i].getComponent("Block").eliminate();
                                count_1 -= 1;
                                if (count_1 == 0) {
                                    break;
                                }
                            }
                        }
                    }, 100);
                }
            }
        }
    };
    //按下暂停按钮
    MapConroler.prototype.usePause = function () {
        if (this.pause) {
            this.pause = false;
        }
        else {
            this.pause = true;
        }
    };
    //根据关卡设置地图大小
    MapConroler.prototype.setMapInfo = function () {
        var width = 0;
        if (this.mapWidth < 10) {
            width = 0.2;
        }
        else if (this.mapWidth < 17) {
            width = 0.15 - (this.mapWidth - 11) * 0.01;
        }
        this.node.scale = 1.6 + (6 - this.mapWidth) * width;
        if (this.mapWidth == 8 && this.mapHeight > 13) {
            this.node.scale = 1;
        }
        // this.node.scale = 1;
        cc.fx.GameConfig.GM_INFO.scale = this.node.scale;
        // this.node.scale = 0.5;
        // console.log(this.node.scale);
        // this.node.scale = 1;
    };
    //创建门的粒子特效
    MapConroler.prototype.createParticle = function (block, jg) {
        var particle = cc.instantiate(MapConroler_1._instance.Block_Prop[9]);
        particle.parent = this.node;
        particle.zIndex = 1000;
        var width = Math.floor(block.width / 120);
        var height = Math.floor(block.height / 120);
        var name = "";
        if (jg == 0 || jg == 1) {
            var y = block.y + block.height;
            var x = block.x - block.width / 2;
            name = "top_" + width + "_" + height;
            if (jg == 1) {
                name = "bot_" + width + "_" + height;
                y = block.y;
            }
            if (block.anchorX == 0.5) {
                x = block.x;
            }
            else if (block.anchorX == 0.33) {
                x = block.x + block.width * (0.5 - 0.33);
            }
            else if (block.anchorX == 0.66) {
                x = block.x + block.width * (0.5 - 0.66);
            }
            particle.setPosition(x, y);
        }
        else if (jg == 2 || jg == 3) {
            name = "left_" + height + "_" + width;
            var x = block.x - block.width;
            var y = block.y + block.height / 2;
            if (block.anchorX == 0.5) {
                x = block.x - block.width / 2;
            }
            else if (block.anchorX == 0.33) {
                x = block.x - block.width * 0.33;
            }
            else if (block.anchorX == 0.66) {
                x = block.x + block.width * 0.66;
            }
            if (jg == 3) {
                name = "right_" + height + "_" + width;
                x = block.x;
                if (block.anchorX == 0.5) {
                    x = block.x + block.width / 2;
                }
                else if (block.anchorX == 0.33) {
                    x = block.x + block.width * 0.66;
                }
                else if (block.anchorX == 0.66) {
                    x = block.x + block.width * 0.33;
                }
            }
            particle.setPosition(x, y);
        }
        var particleNode = particle.getChildByName(name);
        var color = block.getComponent("Block").color - 1;
        particleNode.getComponent(cc.ParticleSystem).spriteFrame = particle.getComponent("Reduce").Block_Color[color];
        particleNode.active = true;
        setTimeout(function () {
            cc.tween(particle)
                .to(2, { opacity: 0 })
                .call(function () {
                particle.destroy();
            })
                .start();
        }, 1200);
    };
    MapConroler.prototype.removeOneBlock = function () {
        // 移除所有方块
        for (var i = 0; i < this.blocks.length; i++) {
            if (this.blocks[i].opacity == 0) {
                this.blocks[i].destroy();
                this.blocks.splice(i, 1);
            }
        }
    };
    MapConroler.prototype.update = function (dt) {
    };
    var MapConroler_1;
    __decorate([
        property({ type: [cc.Prefab], tooltip: "方块数组" })
    ], MapConroler.prototype, "Block_Array", void 0);
    __decorate([
        property({ type: [cc.Prefab], tooltip: "方块道具数组" })
    ], MapConroler.prototype, "Block_Prop", void 0);
    __decorate([
        property(cc.Prefab)
    ], MapConroler.prototype, "MapBlockPrefab", void 0);
    __decorate([
        property({ type: [cc.SpriteAtlas], tooltip: "方块颜色" })
    ], MapConroler.prototype, "Block_Color", void 0);
    __decorate([
        property({ type: [cc.Prefab], tooltip: "墙壁数组" })
    ], MapConroler.prototype, "Wall_Prefab", void 0);
    __decorate([
        property(cc.Prefab)
    ], MapConroler.prototype, "wallTurnPrefab", void 0);
    __decorate([
        property(cc.Button)
    ], MapConroler.prototype, "timeBtn", void 0);
    __decorate([
        property(cc.Button)
    ], MapConroler.prototype, "destroyBtn", void 0);
    __decorate([
        property(cc.Button)
    ], MapConroler.prototype, "magicBtn", void 0);
    __decorate([
        property(cc.Node)
    ], MapConroler.prototype, "mask", void 0);
    __decorate([
        property(cc.Label)
    ], MapConroler.prototype, "iceLabel", void 0);
    __decorate([
        property(cc.Label)
    ], MapConroler.prototype, "hammerLabel", void 0);
    __decorate([
        property(cc.Label)
    ], MapConroler.prototype, "magicLabel", void 0);
    __decorate([
        property(cc.Node)
    ], MapConroler.prototype, "magicMask", void 0);
    __decorate([
        property(cc.Node)
    ], MapConroler.prototype, "hammerMask", void 0);
    __decorate([
        property(cc.Node)
    ], MapConroler.prototype, "freezeMask", void 0);
    __decorate([
        property(cc.Node)
    ], MapConroler.prototype, "coinPop", void 0);
    MapConroler = MapConroler_1 = __decorate([
        ccclass
    ], MapConroler);
    return MapConroler;
}(cc.Component));
exports.default = MapConroler;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 225116 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/Reduce.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'ca599IU5hFEYYrzoN59YOpT', 'Reduce');
// Script/Reduce.ts

"use strict";
// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var NewClass = /** @class */ (function (_super) {
    __extends(NewClass, _super);
    function NewClass() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.Block_Color = [];
        _this.level = null;
        return _this;
        // update (dt) {}
    }
    // LIFE-CYCLE CALLBACKS:
    NewClass.prototype.onLoad = function () {
    };
    NewClass.prototype.start = function () {
    };
    __decorate([
        property({ type: [cc.SpriteFrame], tooltip: "方块颜色图片" })
    ], NewClass.prototype, "Block_Color", void 0);
    __decorate([
        property(cc.Label)
    ], NewClass.prototype, "level", void 0);
    NewClass = __decorate([
        ccclass
    ], NewClass);
    return NewClass;
}(cc.Component));
exports.default = NewClass;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcU2NyaXB0XFxSZWR1Y2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLG9CQUFvQjtBQUNwQix3RUFBd0U7QUFDeEUsbUJBQW1CO0FBQ25CLGtGQUFrRjtBQUNsRiw4QkFBOEI7QUFDOUIsa0ZBQWtGOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFFNUUsSUFBQSxLQUFzQixFQUFFLENBQUMsVUFBVSxFQUFsQyxPQUFPLGFBQUEsRUFBRSxRQUFRLGNBQWlCLENBQUM7QUFHMUM7SUFBc0MsNEJBQVk7SUFBbEQ7UUFBQSxxRUF1QkM7UUFwQkcsaUJBQVcsR0FBMkIsRUFBRSxDQUFDO1FBSXpDLFdBQUssR0FBYSxJQUFJLENBQUM7O1FBZXZCLGlCQUFpQjtJQUNyQixDQUFDO0lBZEcsd0JBQXdCO0lBRXhCLHlCQUFNLEdBQU47SUFFQSxDQUFDO0lBQ0Qsd0JBQUssR0FBTDtJQUVBLENBQUM7SUFiRDtRQURDLFFBQVEsQ0FBQyxFQUFDLElBQUksRUFBRSxDQUFDLEVBQUUsQ0FBQyxXQUFXLENBQUMsRUFBRSxPQUFPLEVBQUMsUUFBUSxFQUFDLENBQUM7aURBQ1o7SUFJekM7UUFEQyxRQUFRLENBQUMsRUFBRSxDQUFDLEtBQUssQ0FBQzsyQ0FDSTtJQVBOLFFBQVE7UUFENUIsT0FBTztPQUNhLFFBQVEsQ0F1QjVCO0lBQUQsZUFBQztDQXZCRCxBQXVCQyxDQXZCcUMsRUFBRSxDQUFDLFNBQVMsR0F1QmpEO2tCQXZCb0IsUUFBUSIsImZpbGUiOiIiLCJzb3VyY2VSb290IjoiLyIsInNvdXJjZXNDb250ZW50IjpbIi8vIExlYXJuIFR5cGVTY3JpcHQ6XHJcbi8vICAtIGh0dHBzOi8vZG9jcy5jb2Nvcy5jb20vY3JlYXRvci9tYW51YWwvZW4vc2NyaXB0aW5nL3R5cGVzY3JpcHQuaHRtbFxyXG4vLyBMZWFybiBBdHRyaWJ1dGU6XHJcbi8vICAtIGh0dHBzOi8vZG9jcy5jb2Nvcy5jb20vY3JlYXRvci9tYW51YWwvZW4vc2NyaXB0aW5nL3JlZmVyZW5jZS9hdHRyaWJ1dGVzLmh0bWxcclxuLy8gTGVhcm4gbGlmZS1jeWNsZSBjYWxsYmFja3M6XHJcbi8vICAtIGh0dHBzOi8vZG9jcy5jb2Nvcy5jb20vY3JlYXRvci9tYW51YWwvZW4vc2NyaXB0aW5nL2xpZmUtY3ljbGUtY2FsbGJhY2tzLmh0bWxcclxuXHJcbmNvbnN0IHtjY2NsYXNzLCBwcm9wZXJ0eX0gPSBjYy5fZGVjb3JhdG9yO1xyXG5cclxuQGNjY2xhc3NcclxuZXhwb3J0IGRlZmF1bHQgY2xhc3MgTmV3Q2xhc3MgZXh0ZW5kcyBjYy5Db21wb25lbnQge1xyXG5cclxuICAgIEBwcm9wZXJ0eSh7dHlwZTogW2NjLlNwcml0ZUZyYW1lXSwgdG9vbHRpcDpcIuaWueWdl+minOiJsuWbvueJh1wifSlcclxuICAgIEJsb2NrX0NvbG9yIDogQXJyYXk8Y2MuU3ByaXRlRnJhbWU+ID0gW107XHJcblxyXG5cclxuICAgIEBwcm9wZXJ0eShjYy5MYWJlbClcclxuICAgIGxldmVsOiBjYy5MYWJlbCA9IG51bGw7XHJcblxyXG4gICAgLy8gTElGRS1DWUNMRSBDQUxMQkFDS1M6XHJcblxyXG4gICAgb25Mb2FkICgpIHtcclxuXHJcbiAgICB9XHJcbiAgICBzdGFydCAoKSB7XHJcblxyXG4gICAgfVxyXG4gICAgXHJcblxyXG5cclxuXHJcblxyXG4gICAgLy8gdXBkYXRlIChkdCkge31cclxufVxyXG4iXX0=
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/SceneManager.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '80998T1AYNNRZdRxsVvXR65', 'SceneManager');
// Script/SceneManager.ts

"use strict";
// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var Map_1 = require("./Map");
var MiniGameSdk_1 = require("./Sdk/MiniGameSdk");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var SceneManager = /** @class */ (function (_super) {
    __extends(SceneManager, _super);
    function SceneManager() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.label = null;
        _this.text = 'hello';
        _this.freeze = null;
        _this.hammer = null;
        _this.magic_wand = null;
        _this.pause = null;
        _this.Block_Array = [];
        _this.Wall_Prefab = [];
        // @property({type: [cc.ParticleSystem], tooltip:"粒子数组"})
        // particleEffects : Array<cc.ParticleSystem> = [];
        _this.load1 = false;
        _this.load2 = false;
        _this.load3 = false;
        _this.btnName = '';
        return _this;
    }
    // LIFE-CYCLE CALLBACKS:
    SceneManager.prototype.onLoad = function () {
        cc.game.setFrameRate(63);
        this.changeBg();
        setTimeout(function () {
            cc.director.preloadScene("HomeScene", function (err) {
                if (err) {
                    // console.error('预加载 HomeScene 场景失败:', err);
                    return;
                }
                // console.log('成功预加载 HomeScene 场景');
            });
        }, 1000);
    };
    SceneManager.prototype.changeBg = function () {
        var _this = this;
        var number = Math.floor(Math.random() * 8) + 1;
        var path = 'bg/bg' + number;
        cc.resources.load(path, cc.SpriteFrame, function (err, spriteFrame) {
            if (err) {
                console.error('动态加载背景图失败:', err);
                return;
            }
            _this.node.getChildByName("Game").getChildByName("bg").getComponent(cc.Sprite).spriteFrame = spriteFrame;
        });
    };
    SceneManager.prototype.loadParticleEffects = function () {
        var _this = this;
        var path = 'Particle';
        cc.resources.loadDir(path, cc.ParticleAsset, function (err, assets) {
            if (err) {
                console.error('动态加载粒子特效失败:', err);
                return;
            }
            _this.particleEffects = assets;
            _this.setParticleSort();
            _this.load3 = true;
            //console.log('粒子特效加载成功，共加载了', this.particleEffects.length, '个粒子特效');
        });
    };
    SceneManager.prototype.setWallPrefabSort = function () {
        var order = ['down', 'downLeft', 'downRight', 'left', 'right', 'up', 'upLeft', 'upRight'];
        this.Wall_Prefab.sort(function (a, b) {
            var indexA = order.indexOf(a.name);
            var indexB = order.indexOf(b.name);
            if (indexA === -1)
                return 1;
            if (indexB === -1)
                return -1;
            return indexA - indexB;
        });
    };
    SceneManager.prototype.setParticleSort = function () {
        var order = ['top', 'bot', 'rig', 'lef'];
        this.particleEffects.sort(function (a, b) {
            // console.log(a.name.substr(0,3),b.name.substr(0,3));
            var indexA = order.indexOf(a.name.substr(0, 3));
            var indexB = order.indexOf(b.name.substr(0, 3));
            if (indexA === -1)
                return 1;
            if (indexB === -1)
                return -1;
            return indexA - indexB;
        });
    };
    SceneManager.prototype.setSort = function () {
        this.Block_Array.sort(function (a, b) {
            var _a, _b;
            // 从名称中提取数字部分
            var numberA = parseInt(((_a = a.name.match(/\d+/)) === null || _a === void 0 ? void 0 : _a[0]) || '0', 10);
            var numberB = parseInt(((_b = b.name.match(/\d+/)) === null || _b === void 0 ? void 0 : _b[0]) || '0', 10);
            return numberA - numberB;
        });
    };
    SceneManager.prototype.start = function () {
    };
    SceneManager.prototype.startGame = function () {
        cc.director.loadScene("HomeScene", function (err) {
            if (err) {
                console.error('加载 HomeScene 场景失败:', err);
            }
            else {
                // console.log('成功切换到 HomeScene 场景');
                cc.director.loadScene("HomeScene");
            }
        });
    };
    SceneManager.prototype.returnHome = function () {
        if (this.node.getChildByName("Pause").getChildByName("btn").getComponent("btnControl")._touch) {
            if (Map_1.default._instance.gameStart == true) {
                MiniGameSdk_1.MiniGameSdk.API.showToast("体力值减少");
                cc.fx.GameTool.setUserHealth(-1, function (data) {
                });
                var data = {
                    time: Map_1.default._instance.count_Time,
                    add_Time: Map_1.default._instance.add_Time,
                    result: "give_up"
                };
                cc.fx.GameTool.shushu_Track("finish_stage", data);
            }
            this.node.getChildByName("Pause").getChildByName("btn").getComponent("btnControl").setTouch(false);
            cc.fx.AudioManager._instance.playEffect("zhuan1", null);
            this.node.getChildByName("zhuanchang").active = true;
            this.node.getChildByName("zhuanchang").getComponent(sp.Skeleton).setAnimation(1, "up", false);
            cc.director.preloadScene("HomeScene", function (err, asset) {
                if (err) {
                    console.error('动态加载 Prefab 失败:', err);
                    return;
                }
            });
            setTimeout(function () {
                cc.director.loadScene("HomeScene");
            }, 1200);
        }
    };
    SceneManager.prototype.destroyNodesInFrames = function (nodes, callback) {
        var _this = this;
        var BATCH_SIZE = 10; // 每帧销毁的节点数量
        var index = 0;
        var destroyBatch = function () {
            var count = 0;
            while (index < nodes.length && count < BATCH_SIZE) {
                var node = nodes[index];
                if (node) {
                    node.active = false;
                }
                index++;
                count++;
            }
            if (index < nodes.length) {
                _this.scheduleOnce(destroyBatch, 6);
            }
            else {
                callback();
            }
        };
        destroyBatch();
    };
    // 改进后的切换场景方法
    SceneManager.prototype.switchToEmptyScene = function () {
        var allNodes = cc.director.getScene().children;
        this.destroyNodesInFrames(allNodes, function () {
            cc.director.loadScene("HomeScene");
        });
    };
    SceneManager.prototype.openPause = function () {
        cc.fx.AudioManager._instance.playEffect("anniu_little", null);
        if (this.pause.getComponent("btnControl")._touch) {
            this.pause.getComponent("btnControl").setTouch(false);
            this.node.getChildByName("Pause").active = true;
            Map_1.default._instance.pause = true;
        }
    };
    SceneManager.prototype.closePause = function () {
        cc.fx.AudioManager._instance.playEffect("anniu_little", null);
        this.pause.getComponent("btnControl").setTouch(true);
        this.node.getChildByName("Pause").active = false;
        if (Map_1.default._instance.node.parent.getChildByName("Ice").active == false) {
            Map_1.default._instance.pause = false;
        }
    };
    SceneManager.prototype.openPropBuy = function (name) {
        Map_1.default._instance.pause = true;
        this.btnName = name;
        var propWindow = this.node.getChildByName("Game").getChildByName("propWindow");
        propWindow.active = true;
        propWindow.getChildByName("freeze").active = false;
        propWindow.getChildByName("hammer").active = false;
        propWindow.getChildByName("magic").active = false;
        propWindow.getChildByName("buy_Btn").getComponent("btnControl").setTouch(true);
        propWindow.getChildByName(name).active = true;
    };
    SceneManager.prototype.clickBtn = function () {
        cc.fx.AudioManager._instance.playEffect("anniu_Big", null);
        var propWindow = this.node.getChildByName("Game").getChildByName("propWindow");
        if (propWindow.getChildByName("buy_Btn").getComponent("btnControl")._touch) {
            propWindow.getChildByName("buy_Btn").getComponent("btnControl").setTouch(false);
            if (this.btnName == "freeze")
                Map_1.default._instance.buyFreeze();
            else if (this.btnName == "hammer")
                Map_1.default._instance.buyHammer();
            else if (this.btnName == "magic")
                Map_1.default._instance.buyMagic();
        }
    };
    //打开商店
    SceneManager.prototype.openShop = function () {
        var _this = this;
        // 加载 shop  bundle
        cc.assetManager.loadBundle('shop', function (err, bundle) {
            bundle.load('prefab/shop', cc.Prefab, function (err, prefab) {
                if (err) {
                    cc.error(err.message || err);
                    return;
                }
                if (prefab) {
                    var shopNode = cc.instantiate(prefab);
                    _this.node.addChild(shopNode);
                    console.log("shopNode parent:", shopNode.parent);
                }
            });
        });
    };
    SceneManager.prototype.closePropBuy = function () {
        Map_1.default._instance.pause = false;
        var freezeBtn = Map_1.default._instance.node.parent.getChildByName("Bottom").getChildByName("timeBtn");
        var hammerBtn = Map_1.default._instance.node.parent.getChildByName("Bottom").getChildByName("destroyBtn");
        var magicBtn = Map_1.default._instance.node.parent.getChildByName("Bottom").getChildByName("magicBtn");
        if (this.btnName == "freeze")
            freezeBtn.getComponent("btnControl").setTouch(true);
        else if (this.btnName == "hammer")
            hammerBtn.getComponent("btnControl").setTouch(true);
        else if (this.btnName == "magic")
            magicBtn.getComponent("btnControl").setTouch(true);
        this.node.getChildByName("Game").getChildByName("propWindow").active = false;
    };
    SceneManager.prototype.update = function (dt) {
    };
    __decorate([
        property(cc.Label)
    ], SceneManager.prototype, "label", void 0);
    __decorate([
        property
    ], SceneManager.prototype, "text", void 0);
    __decorate([
        property(cc.Node)
    ], SceneManager.prototype, "freeze", void 0);
    __decorate([
        property(cc.Node)
    ], SceneManager.prototype, "hammer", void 0);
    __decorate([
        property(cc.Node)
    ], SceneManager.prototype, "magic_wand", void 0);
    __decorate([
        property(cc.Node)
    ], SceneManager.prototype, "pause", void 0);
    __decorate([
        property({ type: [cc.Prefab], tooltip: "方块数组" })
    ], SceneManager.prototype, "Block_Array", void 0);
    __decorate([
        property({ type: [cc.Prefab], tooltip: "墙壁数组" })
    ], SceneManager.prototype, "Wall_Prefab", void 0);
    SceneManager = __decorate([
        ccclass
    ], SceneManager);
    return SceneManager;
}(cc.Component));
exports.default = SceneManager;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 27220 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/btnControl.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '6ee6czJ4eVNb4Feiqps5SIa', 'btnControl');
// Script/btnControl.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var btnControl = /** @class */ (function (_super) {
    __extends(btnControl, _super);
    function btnControl() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    btnControl.prototype.onLoad = function () {
        this._touch = true;
    };
    btnControl.prototype.start = function () {
    };
    btnControl.prototype.setTouch = function (type) {
        this._touch = type;
    };
    btnControl.prototype.update = function (dt) {
    };
    btnControl = __decorate([
        ccclass
    ], btnControl);
    return btnControl;
}(cc.Component));
exports.default = btnControl;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcU2NyaXB0XFxidG5Db250cm9sLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUdNLElBQUEsS0FBc0IsRUFBRSxDQUFDLFVBQVUsRUFBbEMsT0FBTyxhQUFBLEVBQUUsUUFBUSxjQUFpQixDQUFDO0FBSTFDO0lBQXdDLDhCQUFZO0lBQXBEOztJQWtCQSxDQUFDO0lBYkcsMkJBQU0sR0FBTjtRQUNJLElBQUksQ0FBQyxNQUFNLEdBQUcsSUFBSSxDQUFDO0lBQ3ZCLENBQUM7SUFFRCwwQkFBSyxHQUFMO0lBQ0EsQ0FBQztJQUVELDZCQUFRLEdBQVIsVUFBUyxJQUFJO1FBQ1QsSUFBSSxDQUFDLE1BQU0sR0FBRyxJQUFJLENBQUM7SUFDdkIsQ0FBQztJQUVELDJCQUFNLEdBQU4sVUFBUSxFQUFFO0lBQ1YsQ0FBQztJQWpCZ0IsVUFBVTtRQUQ5QixPQUFPO09BQ2EsVUFBVSxDQWtCOUI7SUFBRCxpQkFBQztDQWxCRCxBQWtCQyxDQWxCdUMsRUFBRSxDQUFDLFNBQVMsR0FrQm5EO2tCQWxCb0IsVUFBVSIsImZpbGUiOiIiLCJzb3VyY2VSb290IjoiLyIsInNvdXJjZXNDb250ZW50IjpbIlxyXG5cclxuXHJcbmNvbnN0IHtjY2NsYXNzLCBwcm9wZXJ0eX0gPSBjYy5fZGVjb3JhdG9yO1xyXG5cclxuXHJcbkBjY2NsYXNzXHJcbmV4cG9ydCBkZWZhdWx0IGNsYXNzIGJ0bkNvbnRyb2wgZXh0ZW5kcyBjYy5Db21wb25lbnQge1xyXG4gICAgc3RhdGljIF9pbnN0YW5jZTogYW55O1xyXG4gICAgX3RvdWNoOiBib29sZWFuO1xyXG5cclxuXHJcbiAgICBvbkxvYWQgKCkgeyBcclxuICAgICAgICB0aGlzLl90b3VjaCA9IHRydWU7XHJcbiAgICB9IFxyXG5cclxuICAgIHN0YXJ0ICgpIHtcclxuICAgIH1cclxuXHJcbiAgICBzZXRUb3VjaCh0eXBlKXtcclxuICAgICAgICB0aGlzLl90b3VjaCA9IHR5cGU7XHJcbiAgICB9XHJcblxyXG4gICAgdXBkYXRlIChkdCkge1xyXG4gICAgfVxyXG59XHJcbiJdfQ==
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/NewMode.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '7fe14dRFQZKSKKAoEn4S7OU', 'NewMode');
// Script/NewMode.ts

"use strict";
// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var NewClass = /** @class */ (function (_super) {
    __extends(NewClass, _super);
    function NewClass() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.label = null;
        _this.text = 'hello';
        _this.btnStatic = 0;
        _this.propName = "";
        return _this;
        // update (dt) {}
    }
    // LIFE-CYCLE CALLBACKS:
    // onLoad () {}
    NewClass.prototype.start = function () {
        var _this = this;
        for (var i = 0; i < cc.fx.GameConfig.NEW_LEVEL.length; i++) {
            if ((cc.fx.GameConfig.GM_INFO.level + 1) == cc.fx.GameConfig.NEW_LEVEL[i].level) {
                this.propName = cc.fx.GameConfig.NEW_LEVEL[i].name;
                var path = 'Window_Prop/' + this.propName;
                cc.resources.load(path, cc.SpriteFrame, function (err, spriteFrame) {
                    if (err) {
                        console.error('动态加载背景图失败:', err);
                        return;
                    }
                    _this.node.getChildByName("icon").getComponent(cc.Sprite).spriteFrame = spriteFrame;
                });
                break;
            }
        }
    };
    NewClass.prototype.setMode = function (mode) {
        this.btnStatic = mode;
        var name = "GameScene";
        if (mode == 1) {
            name = "HomeScene";
        }
        cc.director.preloadScene(name, function () {
        });
    };
    NewClass.prototype.clickBtn = function () {
        cc.fx.AudioManager._instance.playEffect("anniu_Big", null);
        if (this.btnStatic == 1) {
            cc.director.loadScene("HomeScene");
        }
        else if (this.btnStatic == 2) {
            cc.director.loadScene("GameScene");
        }
    };
    __decorate([
        property(cc.Label)
    ], NewClass.prototype, "label", void 0);
    __decorate([
        property
    ], NewClass.prototype, "text", void 0);
    NewClass = __decorate([
        ccclass
    ], NewClass);
    return NewClass;
}(cc.Component));
exports.default = NewClass;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 5408 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/module/Share/share.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '7290caA39xMWZc2phTMKovP', 'share');
// Script/module/Share/share.ts



cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcU2NyaXB0XFxtb2R1bGVcXFNoYXJlXFxzaGFyZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwiZmlsZSI6IiIsInNvdXJjZVJvb3QiOiIvIiwic291cmNlc0NvbnRlbnQiOlsiIl19
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/GameManager.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'df248lSLllOZpCHwGqQ5Ye3', 'GameManager');
// Script/GameManager.ts

"use strict";
// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var MiniGameSdk_1 = require("./Sdk/MiniGameSdk");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var GameManager = /** @class */ (function (_super) {
    __extends(GameManager, _super);
    function GameManager() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.label = null;
        _this.text = 'hello';
        _this.Block_Array = [];
        _this.Wall_Prefab = [];
        _this.Block_Color = [];
        // @property({type: [cc.ParticleSystem], tooltip:"粒子数组"})
        // particleEffects : Array<cc.ParticleSystem> = [];
        _this.load1 = false;
        _this.load2 = false;
        _this.load3 = false;
        _this.load4 = false;
        _this.load5 = false;
        return _this;
    }
    GameManager_1 = GameManager;
    // LIFE-CYCLE CALLBACKS:
    GameManager.prototype.onLoad = function () {
        var _this = this;
        window.initMgr();
        this.timeNumber = 3;
        this.startTimeCutDown();
        cc.fx.GameConfig.init(true);
        cc.fx.GameConfig.GM_INFO.gameState = false;
        this.readMusicConfig();
        console.log("音乐开关", cc.fx.GameConfig.GM_INFO.musicOpen);
        cc.fx.AudioManager._instance.playMusicGame();
        this.load1 = this.load2 = this.load3 = this.load4 = this.load5 = false;
        setTimeout(function () {
            _this.readUserData();
        }, 200);
        if (GameManager_1._instance == null) {
            GameManager_1._instance = this;
            cc.game.addPersistRootNode(this.node);
        }
        else {
            return;
        }
        var path = 'prefab/block';
        var path2 = 'prefab/wall';
        cc.resources.loadDir(path, cc.Prefab, function (err, assets) {
            if (err) {
                console.error('动态加载 Prefab 失败:', err);
                cc.director.loadScene("LoadScene");
                return;
            }
            // 将加载的 Prefab 赋值给 Block_Array
            _this.Block_Array = assets;
            console.log('方块加载成功，共加载了', _this.Block_Array.length, '个方块');
            _this.setSort();
            _this.load1 = true;
        });
        cc.resources.loadDir(path2, cc.Prefab, function (err, assets) {
            if (err) {
                console.error('动态加载 Prefab 失败:', err);
                cc.director.loadScene("LoadScene");
                return;
            }
            // 将加载的 Prefab 赋值给 Block_Array
            _this.Wall_Prefab = assets;
            _this.load2 = true;
            console.log('墙加载成功，共加载了', _this.Wall_Prefab.length, '个墙');
            _this.setWallPrefabSort();
        });
        // debugger;
        // setTimeout(() => {
        //     cc.director.preloadScene("HomeScene", (err) => {
        //         if (err) {
        //             console.error('预加载 HomeScene 场景失败:', err);
        //             return;
        //         }
        //     });
        // }, 1000);
        // 检测微信小游戏切到后台
        if (cc.sys.platform === cc.sys.WECHAT_GAME) {
            //@ts-ignore
            wx.onHide(function () {
                _this.onHide();
            });
            // 检测微信小游戏回到前台
            //@ts-ignore
            wx.onShow(function () {
                _this.onShow();
            });
        }
    };
    GameManager.prototype.onHide = function () {
        cc.audioEngine.stopMusic();
        cc.game.pause();
    };
    GameManager.prototype.onShow = function () {
        cc.audioEngine.resumeMusic();
        cc.game.resume();
    };
    GameManager.prototype.loadParticleEffects = function () {
    };
    GameManager.prototype.setWallPrefabSort = function () {
        var order = ['down', 'downLeft', 'downRight', 'left', 'right', 'up', 'upLeft', 'upRight'];
        this.Wall_Prefab.sort(function (a, b) {
            var indexA = order.indexOf(a.name);
            var indexB = order.indexOf(b.name);
            if (indexA === -1)
                return 1;
            if (indexB === -1)
                return -1;
            return indexA - indexB;
        });
    };
    GameManager.prototype.setParticleSort = function () {
        var order = ['top', 'bot', 'rig', 'lef'];
        this.particleEffects.sort(function (a, b) {
            var indexA = order.indexOf(a.name.substr(0, 3));
            var indexB = order.indexOf(b.name.substr(0, 3));
            if (indexA === -1)
                return 1;
            if (indexB === -1)
                return -1;
            return indexA - indexB;
        });
    };
    GameManager.prototype.setSort = function () {
        this.Block_Array.sort(function (a, b) {
            var _a, _b;
            // 从名称中提取数字部分
            var numberA = parseInt(((_a = a.name.match(/\d+/)) === null || _a === void 0 ? void 0 : _a[0]) || '0', 10);
            var numberB = parseInt(((_b = b.name.match(/\d+/)) === null || _b === void 0 ? void 0 : _b[0]) || '0', 10);
            return numberA - numberB;
        });
    };
    GameManager.prototype.start = function () {
    };
    GameManager.prototype.startGame = function () {
        console.log("进入场景之前_____________", cc.fx.GameConfig.GM_INFO.first);
        cc.director.loadScene("HomeScene");
    };
    GameManager.prototype.returnHome = function () {
        cc.tween(this.node.getChildByName("Game"))
            .to(0.5, { opacity: 100 })
            .call(function () {
            // 预加载成功后加载场景
            cc.director.loadScene("HomeScene", function (err) {
                if (err) {
                    console.error('加载 HomeScene 场景失败:', err);
                }
                else {
                    cc.director.loadScene("HomeScene");
                }
            });
        })
            .start();
        cc.tween(this.node.getChildByName("mask"))
            .to(0.5, { opacity: 255 })
            .start();
        // cc.loader.releaseAll();
        // 预加载 HomeScene 场景
    };
    GameManager.prototype.readUserData = function (retryCount) {
        var _this = this;
        if (retryCount === void 0) { retryCount = 0; }
        //@ts-ignore
        if (typeof wx !== 'undefined' && wx !== null) {
            var levelInfo = cc.fx.StorageMessage.getStorage("level");
            //旧的读取数据设置数据方法,以强联网为主
            if (levelInfo == undefined || levelInfo == "" || levelInfo == null) {
                this.oldReadData(retryCount);
            }
            //新的读取数据设置方法，以本地为主
            else {
                this.newReadData();
            }
            console.log("即将读取体力值");
            cc.fx.GameTool.getHealth(function (data) {
                console.log("体力值完成进入游戏");
                _this.load5 = true;
            });
        }
        else {
            this.load3 = true;
            this.load4 = true;
            this.load5 = true;
            cc.fx.GameTool.getHealth(null);
        }
        // 存储用户数据
    };
    GameManager.prototype.readMusicConfig = function () {
        var audioInfo = cc.fx.StorageMessage.getStorage("music");
        if (audioInfo == undefined || audioInfo == "" || audioInfo == null) {
            audioInfo = {
                "musicOpen": true,
                "effectOpen": true,
                "vibrateOpen": true,
            };
            cc.fx.StorageMessage.setStorage("music", audioInfo);
        }
        else {
            cc.fx.GameConfig.GM_INFO.musicOpen = audioInfo.musicOpen;
            cc.fx.GameConfig.GM_INFO.effectOpen = audioInfo.effectOpen;
            cc.fx.GameConfig.GM_INFO.vibrateOpen = audioInfo.vibrateOpen;
        }
    };
    //新用户，有本地缓存读取配置
    GameManager.prototype.newReadData = function () {
        var _this = this;
        console.log("读取新信息");
        var openid = cc.fx.StorageMessage.getStorage("openid");
        if (openid == null || openid == "" || openid == undefined) {
            console.log("没有openid");
            //@ts-ignore
            wx.cloud.callFunction({
                name: 'userData',
                data: {
                    action: 'read'
                },
                success: function (res) {
                    console.log('读取用户数据成功', res.result);
                    if (res.result.code == 404 && res.result.message == "未找到用户数据") {
                    }
                    else if (res.result.code == 200) {
                        if (res.result.data) {
                            cc.fx.GameConfig.GM_INFO.openid = res.result.openid;
                            cc.fx.GameConfig.GM_INFO.username = res.result.data.username;
                            cc.fx.GameConfig.GM_INFO.useravatar = res.result.data.useravatar;
                            var register_time = res.result.data.register_time;
                            MiniGameSdk_1.MiniGameSdk.API.shushu_userSet(register_time);
                            cc.fx.StorageMessage.setStorage("openid", cc.fx.GameConfig.GM_INFO.openid);
                        }
                    }
                },
                fail: function (err) {
                    console.error('读取用户数据失败', err);
                }
            });
        }
        else {
            if (openid)
                cc.fx.GameConfig.GM_INFO.openid = openid;
        }
        //等级信息
        cc.fx.GameTool.getUserLevel(function (data) {
            var timestamp = Date.now();
            var levelInfo = cc.fx.StorageMessage.getStorage("level");
            if (data.result.code == 404 && data.result.message == "未找到关卡数据") {
                // console.log("没有等级信息，从用户接口拿到数据");
                if (levelInfo.level) {
                    cc.fx.GameConfig.GM_INFO.level = levelInfo.level;
                }
                _this.load4 = true;
                cc.fx.GameTool.setUserLevel(function (data) {
                });
            }
            else if (data.result.code == 200) {
                // console.log("有等级信息，从关卡接口拿到数据",data.result.data);
                //游戏前端存储 新于服务器端,以游戏前端信息为主，放服务器存储
                var temp = data.result.timestamp - levelInfo.timestamp;
                console.log("等级时间差:", temp);
                if ((data.result.timestamp - levelInfo.timestamp) < 10000) {
                    if (levelInfo.level) {
                        console.log("以游戏前端等级为准", data.result.data);
                        cc.fx.GameConfig.GM_INFO.level = levelInfo.level;
                        // console.log("等级为:",cc.fx.GameConfig.GM_INFO.level);
                        cc.fx.GameTool.setUserLevel(function (data) {
                        });
                    }
                }
                //服务器端存储时间新于游戏端，以服务器端为主,往前端存储
                else {
                    console.log("以服务器等级为准", data.result.data);
                    cc.fx.GameConfig.GM_INFO.level = data.result.data;
                    levelInfo.level = cc.fx.GameConfig.GM_INFO.level;
                    levelInfo.timestamp = timestamp;
                    // console.log("1111111存储关卡数据:",cc.fx.GameConfig.GM_INFO.level);
                    cc.fx.StorageMessage.setStorage("level", levelInfo);
                }
                _this.load4 = true;
            }
        });
        //金币信息
        cc.fx.GameTool.getUserCoin(function (data) {
            var timestamp = Date.now();
            var coinInfo = cc.fx.StorageMessage.getStorage("coin");
            if (data.result.code == 404 && data.result.message == "未找到金币数据") {
                if (coinInfo.coin)
                    cc.fx.GameConfig.GM_INFO.coin = coinInfo.coin;
                console.log("没有金币信息，从用户接口拿到数据", cc.fx.GameConfig.GM_INFO.coin);
                _this.load3 = true;
                cc.fx.GameTool.setUserCoin(function (data) {
                });
            }
            else if (data.result.code == 200) {
                // console.log("有金币信息，从金币接口拿到数据",data.result.data);
                //游戏前端存储 新于服务器端,以游戏前端信息为主，放服务器存储
                var temp = data.result.timestamp - coinInfo.timestamp;
                console.log("金币时间差:", temp);
                if ((data.result.timestamp - coinInfo.timestamp) < 10000) {
                    console.log("以前端金幣为准:", coinInfo);
                    if (coinInfo.coin)
                        cc.fx.GameConfig.GM_INFO.coin = coinInfo.coin;
                    else {
                        cc.fx.GameConfig.GM_INFO.coin = data.result.data;
                        coinInfo.coin = cc.fx.GameConfig.GM_INFO.coin;
                        coinInfo.timestamp = timestamp;
                        console.log("11111111111");
                        cc.fx.StorageMessage.setStorage("coin", coinInfo);
                    }
                    console.log("改变后金币:", cc.fx.GameConfig.GM_INFO.coin);
                    cc.fx.GameTool.setUserCoin(function (data) {
                    });
                }
                //服务器端存储时间新于游戏端，以服务器端为主,往前端存储
                else {
                    console.log("以服务器金幣为准:", data.result.data);
                    cc.fx.GameConfig.GM_INFO.coin = data.result.data;
                    coinInfo.coin = cc.fx.GameConfig.GM_INFO.coin;
                    coinInfo.timestamp = timestamp;
                    console.log("2222222222");
                    cc.fx.StorageMessage.setStorage("coin", coinInfo);
                }
                _this.load3 = true;
            }
        });
        //道具信息
        cc.fx.GameTool.getUserProp(function (data) {
            var timestamp = Date.now();
            var propInfo = cc.fx.StorageMessage.getStorage("prop");
            if (data.result.code == 404 && data.result.message == "未找到道具数据") {
                console.log("没有道具信息，从用户接口拿到数据", propInfo);
                if (propInfo.freezeAmount == undefined || propInfo.hammerAmount == undefined || propInfo.magicAmount == undefined) {
                    console.log("2222222道具数据异常");
                    cc.fx.GameConfig.GM_INFO.freezeAmount = 0;
                    cc.fx.GameConfig.GM_INFO.hammerAmount = 0;
                    cc.fx.GameConfig.GM_INFO.magicAmoun = 0;
                    var propInfoNew = {
                        "freezeAmount": cc.fx.GameConfig.GM_INFO.freezeAmount,
                        "hammerAmount": cc.fx.GameConfig.GM_INFO.hammerAmount,
                        "magicAmount": cc.fx.GameConfig.GM_INFO.magicAmoun,
                        "timestamp": timestamp
                    };
                    console.log("1111111上传道具信息:", propInfoNew);
                    cc.fx.StorageMessage.setStorage("prop", propInfoNew);
                }
                else {
                    cc.fx.GameConfig.GM_INFO.freezeAmount = data.result.data.freeze;
                    cc.fx.GameConfig.GM_INFO.hammerAmount = data.result.data.hammer;
                    cc.fx.GameConfig.GM_INFO.magicAmount = data.result.data.magic_wand;
                }
                cc.fx.GameConfig.GM_INFO.freezeAmount = propInfo.freezeAmount;
                cc.fx.GameConfig.GM_INFO.hammerAmount = propInfo.hammerAmount;
                cc.fx.GameConfig.GM_INFO.magicAmount = propInfo.magicAmount;
                cc.fx.GameTool.setUserProp(0, 0, function (data) {
                });
            }
            else if (data.result.code == 200) {
                // console.log("本地时间戳",propInfo.timestamp,"服务器时间戳",data.result.timestamp);
                if ((data.result.timestamp - propInfo.timestamp) < 10000) {
                    console.log("以前端道具为主:", propInfo);
                    if (propInfo.freezeAmount == undefined || propInfo.hammerAmount == undefined || propInfo.magicAmount == undefined) {
                        console.log("111111道具数据异常", data.result.data);
                        cc.fx.GameConfig.GM_INFO.freezeAmount = data.result.data.freeze;
                        cc.fx.GameConfig.GM_INFO.hammerAmount = data.result.data.hammer;
                        cc.fx.GameConfig.GM_INFO.magicAmount = data.result.data.magic_wand;
                        var propInfoNew = {
                            "freezeAmount": cc.fx.GameConfig.GM_INFO.freezeAmount,
                            "hammerAmount": cc.fx.GameConfig.GM_INFO.hammerAmount,
                            "magicAmount": cc.fx.GameConfig.GM_INFO.magicAmount,
                            "timestamp": timestamp
                        };
                        console.log("333333上传道具信息:", propInfoNew);
                        cc.fx.StorageMessage.setStorage("prop", propInfoNew);
                    }
                    else {
                        console.log("道具数据正常");
                        cc.fx.GameConfig.GM_INFO.freezeAmount = propInfo.freezeAmount;
                        cc.fx.GameConfig.GM_INFO.hammerAmount = propInfo.hammerAmount;
                        cc.fx.GameConfig.GM_INFO.magicAmount = propInfo.magicAmount;
                        cc.fx.GameTool.setUserProp(0, 0, function (data) {
                        });
                    }
                }
                else {
                    cc.fx.GameConfig.GM_INFO.freezeAmount = data.result.data.freeze;
                    cc.fx.GameConfig.GM_INFO.hammerAmount = data.result.data.hammer;
                    cc.fx.GameConfig.GM_INFO.magicAmount = data.result.data.magic_wand;
                    var propInfoNew = {
                        "freezeAmount": cc.fx.GameConfig.GM_INFO.freezeAmount,
                        "hammerAmount": cc.fx.GameConfig.GM_INFO.hammerAmount,
                        "magicAmount": cc.fx.GameConfig.GM_INFO.magicAmount,
                        "timestamp": timestamp
                    };
                    console.log("22222222上传道具信息:", propInfoNew, data.result);
                    cc.fx.StorageMessage.setStorage("prop", propInfoNew);
                }
            }
        });
    };
    //旧用户，无本地缓存读取配置
    GameManager.prototype.oldReadData = function (retryCount) {
        var _this = this;
        console.log("读取旧信息");
        var MAX_RETRIES = 15;
        var timestamp = Date.now();
        // 读取用户数据
        //@ts-ignore
        wx.cloud.callFunction({
            name: 'userData',
            data: {
                action: 'read'
            },
            success: function (res) {
                console.log('读取用户数据成功', res.result);
                if (res.result.code == 404 && res.result.message == "未找到用户数据") {
                    if (res.result.openid) {
                        cc.fx.GameConfig.GM_INFO.openid = res.result.openid;
                    }
                    cc.fx.GameConfig.GM_INFO.first = true;
                    _this.load3 = true;
                    _this.load4 = true;
                    var levelInfo = { "level": 0, "timestamp": timestamp };
                    cc.fx.StorageMessage.setStorage("level", levelInfo);
                    var coinInfo = { "coin": 0, "timestamp": timestamp };
                    console.log("33333333333");
                    cc.fx.StorageMessage.setStorage("coin", coinInfo);
                    var propInfo = {
                        "freezeAmount": 0,
                        "hammerAmount": 0,
                        "magicAmount": 0,
                        "timestamp": timestamp,
                    };
                    cc.fx.StorageMessage.setStorage("prop", propInfo);
                    cc.fx.GameTool.setUserInfo(function (data) {
                        if (data.result.code == 200) {
                            console.log("上传用户信息成功", data);
                            //@ts-ignore
                            wx.cloud.callFunction({
                                name: 'userData',
                                data: {
                                    action: 'read'
                                },
                                success: function (res) {
                                    console.log("上传后，读取用户信息，为上报注册时间");
                                    if (res.result.code == 200) {
                                        var time = res.result.data.register_time;
                                        MiniGameSdk_1.MiniGameSdk.API.shushu_userSet(time);
                                    }
                                }
                            });
                        }
                    });
                    console.log("服务器也没有金币信息", cc.fx.GameConfig.GM_INFO.coin);
                    cc.fx.GameTool.setUserCoin(cc.fx.GameConfig.GM_INFO.coin, function (data) {
                    });
                    cc.fx.GameTool.setUserLevel(function (data) {
                    });
                    setTimeout(function () {
                        cc.fx.GameConfig.GM_INFO.freezeAmount = 0;
                        cc.fx.GameConfig.GM_INFO.hammerAmount = 0;
                        cc.fx.GameConfig.GM_INFO.magicAmount = 0;
                        cc.fx.GameTool.setUserProp(0, 0, function (data) {
                            if (data.result.code == 200) {
                                console.log("上传道具信息成功", data);
                            }
                            else {
                                MiniGameSdk_1.MiniGameSdk.API.showToast("网络异常，正在努力加载");
                                setTimeout(function () {
                                    _this.oldReadData(0);
                                }, 1000);
                            }
                        });
                    }, 0);
                }
                else if (res.result.code == 200) {
                    if (res.result.data) {
                        cc.fx.GameConfig.GM_INFO.openid = res.result.openid;
                        cc.fx.GameConfig.GM_INFO.level = res.result.data.level;
                        cc.fx.GameConfig.GM_INFO.coin = res.result.data.coinAmount;
                        cc.fx.GameConfig.GM_INFO.freezeAmount = res.result.data.freezeAmount;
                        cc.fx.GameConfig.GM_INFO.hammerAmount = res.result.data.hammerAmount;
                        cc.fx.GameConfig.GM_INFO.magicAmount = res.result.data.magicAmount;
                        cc.fx.GameConfig.GM_INFO.username = res.result.data.username;
                        cc.fx.GameConfig.GM_INFO.useravatar = res.result.data.useravatar;
                        cc.fx.StorageMessage.setStorage("openid", cc.fx.GameConfig.GM_INFO.openid);
                        var register_time = res.result.data.register_time;
                        MiniGameSdk_1.MiniGameSdk.API.shushu_userSet(register_time);
                    }
                    setTimeout(function () {
                        cc.fx.GameTool.getUserCoin(function (data) {
                            if (data.result.code == 404 && data.result.message == "未找到金币数据") {
                                var coinInfo = { "coin": 0, "timestamp": timestamp };
                                cc.fx.GameConfig.GM_INFO.coin = 0;
                                cc.fx.StorageMessage.setStorage("coin", coinInfo);
                                console.log("没有金币信息，从用户接口拿到数据", cc.fx.GameConfig.GM_INFO.coin);
                                cc.fx.GameTool.setUserCoin(function (data) {
                                    // console.log("上传",data);
                                    _this.load3 = true;
                                });
                            }
                            else if (data.result.code == 200) {
                                // console.log("有金币信息，从金币接口拿到数据",data.result.data);
                                cc.fx.GameConfig.GM_INFO.coin = data.result.data;
                                var coinInfo = { "coin": cc.fx.GameConfig.GM_INFO.coin, "timestamp": timestamp };
                                console.log("存储金币信息:", cc.fx.GameConfig.GM_INFO.coin);
                                console.log("4444444444");
                                cc.fx.StorageMessage.setStorage("coin", coinInfo);
                                _this.load3 = true;
                            }
                        });
                    }, 500);
                    cc.fx.GameTool.getUserLevel(function (data) {
                        if (data.result.code == 404 && data.result.message == "未找到关卡数据") {
                            console.log("没有等级信息，从用户接口拿到数据");
                            var levelInfo = { "level": 0, "timestamp": timestamp };
                            // console.log("333333存储关卡数据:",levelInfo);
                            cc.fx.GameConfig.GM_INFO.level = 0;
                            cc.fx.StorageMessage.setStorage("level", levelInfo);
                            cc.fx.GameTool.setUserLevel(function (data) {
                                console.log("拿到的数据", data);
                                _this.load4 = true;
                            });
                        }
                        else if (data.result.code == 200) {
                            console.log("有等级信息，从关卡接口拿到数据", data.result.data);
                            cc.fx.GameConfig.GM_INFO.level = data.result.data;
                            var levelInfo = { "level": cc.fx.GameConfig.GM_INFO.level, "timestamp": timestamp };
                            // console.log("444444存储关卡信息:",levelInfo);
                            cc.fx.StorageMessage.setStorage("level", levelInfo);
                            _this.load4 = true;
                        }
                    });
                    setTimeout(function () {
                        cc.fx.GameTool.getUserProp(function (data) {
                            if (data.result.code == 404 && data.result.message == "未找到道具数据") {
                                console.log("没有道具信息，从用户接口拿到数据");
                                cc.fx.GameConfig.GM_INFO.freezeAmount = 0;
                                cc.fx.GameConfig.GM_INFO.hammerAmount = 0;
                                cc.fx.GameConfig.GM_INFO.magicAmount = 0;
                                var propInfo = {
                                    "freezeAmount": 0,
                                    "hammerAmount": 0,
                                    "magicAmount": 0,
                                    "timestamp": timestamp,
                                };
                                console.log("上传道具信息:", propInfo);
                                cc.fx.StorageMessage.setStorage("prop", propInfo);
                                cc.fx.GameTool.setUserProp(0, 0, function (data) {
                                });
                            }
                            else if (data.result.code == 200) {
                                console.log("有道具信息，从道具接口拿到数据", data.result.data);
                                cc.fx.GameConfig.GM_INFO.freezeAmount = data.result.data.freeze || 0;
                                cc.fx.GameConfig.GM_INFO.hammerAmount = data.result.data.hammer || 0;
                                cc.fx.GameConfig.GM_INFO.magicAmount = data.result.data.magic_wand || 0;
                                var propInfo = {
                                    "freezeAmount": cc.fx.GameConfig.GM_INFO.freezeAmount,
                                    "hammerAmount": cc.fx.GameConfig.GM_INFO.hammerAmount,
                                    "magicAmount": cc.fx.GameConfig.GM_INFO.magicAmount,
                                    "timestamp": timestamp,
                                };
                                console.log("上传道具信息:", propInfo);
                                cc.fx.StorageMessage.setStorage("prop", propInfo);
                            }
                        });
                    }, 0);
                }
            },
            fail: function (err) {
                console.error('读取用户数据失败', err);
                if (retryCount < MAX_RETRIES) {
                    console.error("\u8BFB\u53D6\u7528\u6237\u6570\u636E\u5931\u8D25\uFF0C\u7B2C " + (retryCount + 1) + " \u6B21\u91CD\u8BD5\uFF0C\u9519\u8BEF\u4FE1\u606F:", err);
                    // 延迟 2 秒后重试
                    setTimeout(function () {
                        _this.readUserData(retryCount + 1);
                    }, 2000);
                }
                else {
                    console.error('读取用户数据失败，达到最大重试次数，退出游戏', err);
                    // 退出游戏
                    cc.game.end();
                }
            }
        });
    };
    GameManager.prototype.setUserData = function () {
        cc.fx.GameConfig.GameTool(function (data) {
            console.log("上传", data);
        });
    };
    GameManager.prototype.startTimeCutDown = function () {
        this.scheduleCallback = function () {
            if (this.timeNumber <= 0) {
                this.stopTimeCutDown();
            }
            else {
                this.timeNumber -= 1;
            }
        }.bind(this);
        this.schedule(this.scheduleCallback, 1);
    };
    GameManager.prototype.stopTimeCutDown = function () {
        if (this.scheduleCallback) {
            this.unschedule(this.scheduleCallback);
        }
    };
    GameManager.prototype.update = function (dt) {
        if (this.load1 && this.load2 && this.load3 && this.load4 && this.load5 && this.timeNumber <= 0) {
            this.load1 = this.load2 = false;
            MiniGameSdk_1.MiniGameSdk.API.shushu_Init();
            this.startGame();
        }
    };
    var GameManager_1;
    GameManager._instance = null;
    __decorate([
        property(cc.Label)
    ], GameManager.prototype, "label", void 0);
    __decorate([
        property
    ], GameManager.prototype, "text", void 0);
    __decorate([
        property({ type: [cc.Prefab], tooltip: "方块数组" })
    ], GameManager.prototype, "Block_Array", void 0);
    __decorate([
        property({ type: [cc.Prefab], tooltip: "墙壁数组" })
    ], GameManager.prototype, "Wall_Prefab", void 0);
    __decorate([
        property({ type: [cc.SpriteAtlas], tooltip: "方块颜色" })
    ], GameManager.prototype, "Block_Color", void 0);
    GameManager = GameManager_1 = __decorate([
        ccclass
    ], GameManager);
    return GameManager;
}(cc.Component));
exports.default = GameManager;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 75536 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/Pause.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'aca4aut33NCvIC0yg3JmY0h', 'Pause');
// Script/Pause.ts

"use strict";
// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var Pause = /** @class */ (function (_super) {
    __extends(Pause, _super);
    function Pause() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.time = 0;
        _this.music = null;
        _this.effect = null;
        _this.vibrate = null;
        _this.open = null;
        _this.close = null;
        // mapInfo: number[][] = [];
        _this.musicState = true;
        _this.effectState = true;
        _this.vibrateState = true;
        return _this;
        // update (dt) {}
    }
    Pause.prototype.onLoad = function () {
        if (cc.fx.GameConfig.GM_INFO.musicOpen) {
            this.music.getComponent(cc.Sprite).spriteFrame = this.open;
            this.music.x = 278;
        }
        else {
            this.music.getComponent(cc.Sprite).spriteFrame = this.close;
            this.music.x = 161;
        }
        if (cc.fx.GameConfig.GM_INFO.effectOpen) {
            this.effect.getComponent(cc.Sprite).spriteFrame = this.open;
            this.effect.x = 278;
        }
        else {
            this.effect.getComponent(cc.Sprite).spriteFrame = this.close;
            this.effect.x = 161;
        }
        if (cc.fx.GameConfig.GM_INFO.vibrateOpen) {
            this.vibrate.getComponent(cc.Sprite).spriteFrame = this.open;
            this.vibrate.x = 278;
        }
        else {
            this.vibrate.getComponent(cc.Sprite).spriteFrame = this.close;
            this.vibrate.x = 161;
        }
        this.musicState = cc.fx.GameConfig.GM_INFO.musicOpen;
        this.effectState = cc.fx.GameConfig.GM_INFO.effectOpen;
        this.vibrateState = cc.fx.GameConfig.GM_INFO.vibrateOpen;
    };
    Pause.prototype.start = function () {
    };
    Pause.prototype.init = function (time) {
    };
    Pause.prototype.clickMusic = function () {
        var _this = this;
        if (this.musicState) {
            this.musicState = false;
            cc.fx.GameConfig.GM_INFO.musicOpen = this.musicState;
            this.setMusicConfig();
            this.music.runAction(cc.sequence(cc.spawn(cc.moveTo(0.05, cc.v2(161, this.music.y)), cc.fadeOut(0.05)), cc.callFunc(function () {
                _this.music.getComponent(cc.Sprite).spriteFrame = _this.close;
            }), cc.fadeIn(0.1)));
            cc.fx.AudioManager._instance.stopMusic();
        }
        else {
            this.musicState = true;
            cc.fx.GameConfig.GM_INFO.musicOpen = this.musicState;
            this.setMusicConfig();
            this.music.runAction(cc.sequence(cc.spawn(cc.moveTo(0.05, cc.v2(278, this.music.y)), cc.fadeOut(0.05)), cc.callFunc(function () {
                _this.music.getComponent(cc.Sprite).spriteFrame = _this.open;
            }), cc.fadeIn(0.1)));
            cc.fx.AudioManager._instance.playMusicGame();
        }
    };
    Pause.prototype.setMusicConfig = function () {
        var audioInfo = {
            "musicOpen": cc.fx.GameConfig.GM_INFO.musicOpen,
            "effectOpen": cc.fx.GameConfig.GM_INFO.effectOpen,
            "vibrateOpen": cc.fx.GameConfig.GM_INFO.vibrateOpen,
        };
        cc.fx.StorageMessage.setStorage("music", audioInfo);
    };
    Pause.prototype.clickEffect = function () {
        var _this = this;
        if (this.effectState) {
            this.effectState = false;
            cc.fx.GameConfig.GM_INFO.effectOpen = this.effectState;
            this.setMusicConfig();
            this.effect.runAction(cc.sequence(cc.spawn(cc.moveTo(0.05, cc.v2(161, this.effect.y)), cc.fadeOut(0.05)), cc.callFunc(function () {
                _this.effect.getComponent(cc.Sprite).spriteFrame = _this.close;
            }), cc.fadeIn(0.1)));
        }
        else {
            this.effectState = true;
            cc.fx.GameConfig.GM_INFO.effectOpen = this.effectState;
            this.setMusicConfig();
            this.effect.runAction(cc.sequence(cc.spawn(cc.moveTo(0.05, cc.v2(278, this.effect.y)), cc.fadeOut(0.05)), cc.callFunc(function () {
                _this.effect.getComponent(cc.Sprite).spriteFrame = _this.open;
            }), cc.fadeIn(0.1)));
        }
    };
    Pause.prototype.clickVibrate = function () {
        var _this = this;
        if (this.vibrateState) {
            this.vibrateState = false;
            cc.fx.GameConfig.GM_INFO.vibrateOpen = this.vibrateState;
            this.setMusicConfig();
            this.vibrate.runAction(cc.sequence(cc.spawn(cc.moveTo(0.05, cc.v2(161, this.vibrate.y)), cc.fadeOut(0.05)), cc.callFunc(function () {
                _this.vibrate.getComponent(cc.Sprite).spriteFrame = _this.close;
            }), cc.fadeIn(0.1)));
        }
        else {
            this.vibrateState = true;
            cc.fx.GameConfig.GM_INFO.vibrateOpen = this.vibrateState;
            this.setMusicConfig();
            this.vibrate.runAction(cc.sequence(cc.spawn(cc.moveTo(0.05, cc.v2(278, this.vibrate.y)), cc.fadeOut(0.05)), cc.callFunc(function () {
                _this.vibrate.getComponent(cc.Sprite).spriteFrame = _this.open;
            }), cc.fadeIn(0.1)));
        }
    };
    __decorate([
        property(cc.Node)
    ], Pause.prototype, "music", void 0);
    __decorate([
        property(cc.Node)
    ], Pause.prototype, "effect", void 0);
    __decorate([
        property(cc.Node)
    ], Pause.prototype, "vibrate", void 0);
    __decorate([
        property(cc.SpriteFrame)
    ], Pause.prototype, "open", void 0);
    __decorate([
        property(cc.SpriteFrame)
    ], Pause.prototype, "close", void 0);
    Pause = __decorate([
        ccclass
    ], Pause);
    return Pause;
}(cc.Component));
exports.default = Pause;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 15744 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/peizhi.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '7d800jRKkRGfqSS3fhSet26', 'peizhi');
// Script/peizhi.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property, requireComponent = _a.requireComponent;
var NewClass = /** @class */ (function (_super) {
    __extends(NewClass, _super);
    function NewClass() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.node1 = null;
        _this.node2 = null;
        _this.node3 = null;
        _this.localTest = false;
        _this.clientTestVersion = "1.0.0";
        _this.testVersion = null;
        return _this;
        //     3月17日 - 3月21日 工作完成内容
        // 1：游戏框架搭建
        // 2：制作18个基础方块预制体 (方块可编辑颜色与道具和状态)
        // 3：完成地图的搭建，可配置8*8以内，任意组合，包括可缺口和障碍物配置
        // 4：完成地图墙面建立，根据 ↑3上面构建的地图自动生成墙体。
        // 5：做完方块的基础移动，跟随手指，遇到方块或者墙壁或者障碍物阻碍移动。
        // 6：方块的自动落点做完11个基础方块的（未做完还差11个）
        // 3月24日 - 3月28日 预计完成目标
        // 1：完成全部方块的落点。
        // 2：完成门的搭建，门可选颜色，可选开关或者星星等特殊状态
        // 3：完成方块通过门的游戏逻辑，使游戏可以最基础运行玩起来
        // 4：出5关版本，配合小白备案审核。
        // 5：根据方块，地图，以及道具，制作地图编辑器 (方块和地图制作的时候都已经考虑到编辑器的需求了) 
        // 	优先制作，后续开发拓展玩法功能时，小白可同步进行制作关卡。
    }
    NewClass.prototype.start = function () {
        // cc.fx.AudioManager.Instance.init();
        // this.testVersion.string = this.clientTestVersion;
        // cc.director.loadScene("GameScene");
        // cc.director.preloadScene("GameScene", ()=>{
        //     // debugger;
        // })
    };
    //判断来源
    NewClass.prototype.containsTrain = function (str) {
        return /from=train/i.test(str);
    };
    //开始游戏，跳转至引导页面
    NewClass.prototype.startGame = function () {
        cc.director.loadScene("GameScene");
        // cc.director.loadScene("GuideScene");
    };
    //备用，用来测试跳转 指定关卡
    NewClass.prototype.clickBtn = function (event, data) {
        cc.fx.GameConfig.GM_INFO.custom = parseInt(data);
        cc.director.loadScene("GameScene");
    };
    //打开排行榜
    NewClass.prototype.openRank = function () {
        cc.director.loadScene("RankScene");
    };
    NewClass.prototype.update = function (dt) {
    };
    __decorate([
        property(cc.Node)
    ], NewClass.prototype, "node1", void 0);
    __decorate([
        property(cc.Node)
    ], NewClass.prototype, "node2", void 0);
    __decorate([
        property(cc.Node)
    ], NewClass.prototype, "node3", void 0);
    __decorate([
        property(false)
    ], NewClass.prototype, "localTest", void 0);
    __decorate([
        property("")
    ], NewClass.prototype, "clientTestVersion", void 0);
    __decorate([
        property(cc.Label)
    ], NewClass.prototype, "testVersion", void 0);
    NewClass = __decorate([
        ccclass
    ], NewClass);
    return NewClass;
}(cc.Component));
exports.default = NewClass;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 5700 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/Window.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '3bad2uyOw5MzLq3b5g9aHn2', 'Window');
// Script/Window.ts

"use strict";
// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var NewClass = /** @class */ (function (_super) {
    __extends(NewClass, _super);
    function NewClass() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    // LIFE-CYCLE CALLBACKS:
    NewClass.prototype.onLoad = function () {
        this.can_Touch = false;
    };
    NewClass.prototype.start = function () {
    };
    NewClass.prototype.init = function (data) {
        var _this = this;
        this.can_Touch = false;
        this.node.getChildByName("win").active = false;
        this.node.getChildByName("lose").active = false;
        this.node.getChildByName("finishi").active = false;
        this.node.getChildByName(data.result).active = true;
        if (data.result == "lose") {
            this.setErrLabel(data.code);
        }
        var target = this.node.getChildByName(data.result);
        target.getChildByName("btn").active = false;
        target.opacity = 0;
        target.scale = 2;
        target.getChildByName("tip").opacity = 0;
        if (data.result == "win") {
            var lianXi = false;
            if (cc.fx.GameConfig.GM_INFO.level == 2)
                lianXi = true;
            target.getChildByName("yes").active = !lianXi;
            target.getChildByName("start").active = lianXi;
        }
        cc.tween(target)
            .delay(0.1)
            .to(0.25, { opacity: 255, scale: 1 })
            .delay(0.3)
            .call(function () {
            if (target.name == "lose") {
                cc.tween(target.getChildByName("tip"))
                    .to(0.5, { opacity: 255 })
                    .delay(0.5)
                    .call(function () {
                    _this.can_Touch = true;
                    target.getChildByName("btn").active = true;
                })
                    .start();
            }
            else {
                _this.can_Touch = true;
                target.getChildByName("btn").active = true;
            }
        })
            .start();
    };
    NewClass.prototype.setErrLabel = function (code) {
        var tip = this.node.getChildByName("lose").getChildByName("tip").getComponent(cc.Label);
        tip.string = cc.fx.GameConfig.TIP_ERR[code];
    };
    NewClass.prototype.click_Next = function () {
        var _this = this;
        if (!this.can_Touch) {
            return;
        }
        this.can_Touch = false;
        cc.tween(this.node)
            .to(0.3, { opacity: 0 })
            .call(function () {
            _this.node.active = false;
            cc.director.loadScene("GameScene");
        })
            .start();
    };
    NewClass = __decorate([
        ccclass
    ], NewClass);
    return NewClass;
}(cc.Component));
exports.default = NewClass;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 7604 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/JiaZai.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '1dc93b4fehOrpGgTkihBH4g', 'JiaZai');
// Script/JiaZai.ts

"use strict";
// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var GameManager_1 = require("./GameManager");
var NumberToImage_1 = require("./NumberToImage");
var MiniGameSdk_1 = require("./Sdk/MiniGameSdk");
var lq_collide_system_1 = require("./lq_collide_system/lq_collide_system");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var NewClass = /** @class */ (function (_super) {
    __extends(NewClass, _super);
    function NewClass() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.node1 = null;
        _this.node2 = null;
        _this.node3 = null;
        _this.Block_Color = [];
        _this.custom = null;
        _this.level = null;
        _this.coin = null;
        _this.Stamina = null;
        return _this;
        // update (dt) {}
    }
    // LIFE-CYCLE CALLBACKS:
    NewClass.prototype.onLoad = function () {
        cc.game.setFrameRate(63);
        lq_collide_system_1.LQCollideSystem.is_enable = true;
        // console.log("加载关卡配置2");
        // window.initMgr();
        GameManager_1.default._instance.Block_Color = this.Block_Color;
        if (cc.fx.GameConfig.GM_INFO.first) {
            console.log("————————准备注册事件", cc.fx.GameConfig.GM_INFO.openid);
            if (cc.fx.GameConfig.GM_INFO.openid != "") {
                console.log("————————发送注册事件");
                cc.fx.GameTool.shushu_Track("register");
            }
            cc.fx.AudioManager._instance.playEffect("zhuan1", null);
            this.node.getChildByName("zhuanchang").active = true;
            this.node.getChildByName("zhuanchang").getComponent(sp.Skeleton).setAnimation(1, "up", false);
            setTimeout(function () {
                cc.fx.GameConfig.GM_INFO.first = false;
                cc.director.loadScene("GameScene");
            }, 1000);
        }
    };
    NewClass.prototype.start = function () {
        // console.log("已经进入Home界面");
        // console.log("金币",cc.fx.GameConfig.GM_INFO.coin);
        // console.log("关卡",cc.fx.GameConfig.GM_INFO.level+1);
        var _this = this;
        cc.fx.GameTool.getHealth(null);
        // cc.fx.GameConfig.LEVEL_INFO_init(false,0);
        setTimeout(function () {
            NumberToImage_1.default.numberToImageNodes((cc.fx.GameConfig.GM_INFO.level + 1), 25, 15, "big_", _this.level, false);
            NumberToImage_1.default.numberToImageNodes(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "coin_", _this.coin, true);
            _this.setHealthInfo();
        }, 0);
        if (cc.fx.GameConfig.GM_INFO.gameState) {
            this.node.getChildByName("zhuanchang").active = true;
            setTimeout(function () {
                cc.fx.AudioManager._instance.playEffect("zhuan2", null);
                _this.node.getChildByName("zhuanchang").getComponent(sp.Skeleton).setAnimation(1, "down", false);
                _this.node.getChildByName("zhuanchang").getComponent(sp.Skeleton).setCompleteListener(function (entry) {
                    if (entry.animation.name === "down" && !cc.fx.GameConfig.GM_INFO.first) {
                        // 动画播放结束后执行的逻辑
                        _this.node.getChildByName("zhuanchang").active = false;
                    }
                });
            }, 500);
        }
        else {
            if (!cc.fx.GameConfig.GM_INFO.first)
                this.node.getChildByName("zhuanchang").active = false;
        }
    };
    //开始倒计时
    NewClass.prototype.startTimeCutDown = function () {
        this.scheduleCallback = function () {
            var _this = this;
            if (this.pause)
                return;
            if (cc.fx.GameConfig.GM_INFO.min_Time <= 0) {
                this.stopTimeCutDown();
                var timeTemp = cc.fx.GameTool.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time);
                this.Stamina.getChildByName("time").getComponent(cc.Label).string = timeTemp;
                cc.fx.GameTool.setUserHealth(1, function (data) {
                    cc.fx.GameTool.getHealth(null);
                    _this.setHealthInfo();
                });
            }
            else {
                cc.fx.GameConfig.GM_INFO.min_Time -= 1;
                var timeTemp = cc.fx.GameTool.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time);
                this.Stamina.getChildByName("time").getComponent(cc.Label).string = timeTemp;
            }
        }.bind(this);
        this.schedule(this.scheduleCallback, 1);
    };
    // 停止倒计时
    NewClass.prototype.stopTimeCutDown = function () {
        if (this.scheduleCallback) {
            this.unschedule(this.scheduleCallback);
        }
    };
    NewClass.prototype.setHealthInfo = function () {
        if (cc.fx.GameConfig.GM_INFO.hp == 5) {
            this.Stamina.getChildByName("man").active = true;
            this.Stamina.getChildByName("health").active = false;
            this.Stamina.getChildByName("time").active = false;
        }
        else {
            this.Stamina.getChildByName("man").active = false;
            this.Stamina.getChildByName("health").active = true;
            NumberToImage_1.default.numberToImageNodes((cc.fx.GameConfig.GM_INFO.hp), 25, 15, "coin_", this.Stamina.getChildByName("health"), false);
            this.Stamina.getChildByName("time").active = true;
            if (cc.fx.GameConfig.GM_INFO.min_Time != 0) {
                var time = cc.fx.GameTool.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time);
                this.Stamina.getChildByName("time").getComponent(cc.Label).string = time;
                this.startTimeCutDown();
            }
        }
    };
    NewClass.prototype.startGame = function () {
        cc.fx.AudioManager._instance.playEffect("anniu_Big", null);
        if (cc.fx.GameConfig.GM_INFO.hp < 1) {
            MiniGameSdk_1.MiniGameSdk.API.showToast("体力值不足");
            return;
        }
        if (this.node.getChildByName("Load").getChildByName("startBtn").getComponent("btnControl")._touch) {
            this.node.getChildByName("Load").getChildByName("startBtn").getComponent("btnControl").setTouch(false);
            // if(this.custom.string != ""){
            //     cc.fx.GameConfig.GM_INFO.level = parseInt(this.custom.string) - 1;
            //     // cc.fx.StorageMessage.setStorage("level",cc.fx.GameConfig.GM_INFO.level.toString()); 
            //     cc.fx.GameConfig.LEVEL_INFO_init(true);
            // }
            // else{
            cc.fx.AudioManager._instance.playEffect("zhuan1", null);
            this.node.getChildByName("zhuanchang").active = true;
            this.node.getChildByName("zhuanchang").getComponent(sp.Skeleton).setAnimation(1, "up", false);
            cc.fx.GameConfig.LEVEL_INFO_init(true, 1000);
            // }
        }
    };
    //打开商店
    NewClass.prototype.openShop = function () {
        var _this = this;
        // 加载 shop  bundle
        cc.assetManager.loadBundle('shop', function (err, bundle) {
            bundle.load('prefab/shop', cc.Prefab, function (err, prefab) {
                if (err) {
                    cc.error(err.message || err);
                    return;
                }
                if (prefab) {
                    var shopNode = cc.instantiate(prefab);
                    _this.node.addChild(shopNode);
                    console.log("shopNode parent:", shopNode.parent);
                }
            });
        });
    };
    NewClass.prototype.closeRank = function () {
        this.node.getChildByName("Rank").active = false;
    };
    NewClass.prototype.openRank = function () {
        this.node.getChildByName("Rank").active = true;
    };
    NewClass.prototype.openReward = function () {
        this.node.getChildByName("Reward").active = true;
    };
    NewClass.prototype.clickShop = function () {
        // 假设已经获取到了 userId 和 productId
        var userId = cc.fx.GameConfig.GM_INFO.openid;
        var productId = '1';
        console.log("即将创建createorder");
        //@ts-ignore
        wx.cloud.callFunction({
            name: "createOrder",
            data: {
                "userId": userId,
                "productId": productId,
            },
            success: function (res) {
                // 取得云函数返回的订单信息
                console.log("createOrder结果:", res.result);
                var payment = res.result.paymentResult.payment;
                console.log("payment:", payment);
                // 调起微信客户端支付
                //@ts-ignore
                // 调起微信客户端支付
                //@ts-ignore
                wx.requestPayment({
                    // 时间戳，从 1970 年 1 月 1 日 00:00:00 至今的秒数，即当前的时间
                    timeStamp: payment.timeStamp,
                    // 随机字符串，长度为32个字符以下
                    nonceStr: payment.nonceStr,
                    // 统一下单接口返回的 prepay_id 参数值
                    package: payment.package,
                    // 签名算法，暂支持 MD5、HMAC-SHA256
                    signType: payment.signType || 'MD5',
                    // 支付签名
                    paySign: payment.paySign,
                    success: function (res) {
                        /* 成功回调 */
                        console.log("支付成功", res);
                    },
                    fail: function (res) {
                        /* 失败回调 */
                        console.log("支付失败", res);
                    },
                    complete: function (res) {
                        console.log("支付完成", res);
                    }
                });
            },
        });
    };
    NewClass.prototype.openPause = function () {
        cc.fx.AudioManager._instance.playEffect("anniu_little", null);
        console.log(cc.fx.GameConfig.GM_INFO);
        if (cc.fx.GameConfig.GM_INFO.openid == undefined) {
            console.log(cc.fx.GameConfig.GM_INFO.openid);
            cc.fx.GameConfig.GM_INFO.openid = "";
        }
        this.node.getChildByName("Pause").active = true;
        this.node.getChildByName("Pause").getChildByName("openID").getComponent(cc.Label).string = cc.fx.GameConfig.GM_INFO.openid;
    };
    NewClass.prototype.closePause = function () {
        cc.fx.AudioManager._instance.playEffect("anniu_little", null);
        this.node.getChildByName("Pause").active = false;
    };
    NewClass.prototype.closeReward = function () {
        this.node.getChildByName("Reward").active = false;
    };
    NewClass.prototype.openStamina = function () {
        this.node.getChildByName("Stamina").active = true;
    };
    NewClass.prototype.closeStamina = function () {
        this.node.getChildByName("Stamina").active = false;
    };
    __decorate([
        property(cc.Node)
    ], NewClass.prototype, "node1", void 0);
    __decorate([
        property(cc.Node)
    ], NewClass.prototype, "node2", void 0);
    __decorate([
        property(cc.Node)
    ], NewClass.prototype, "node3", void 0);
    __decorate([
        property({ type: [cc.SpriteAtlas], tooltip: "方块颜色" })
    ], NewClass.prototype, "Block_Color", void 0);
    __decorate([
        property(cc.EditBox)
    ], NewClass.prototype, "custom", void 0);
    __decorate([
        property(cc.Node)
    ], NewClass.prototype, "level", void 0);
    __decorate([
        property(cc.Node)
    ], NewClass.prototype, "coin", void 0);
    __decorate([
        property(cc.Node)
    ], NewClass.prototype, "Stamina", void 0);
    NewClass = __decorate([
        ccclass
    ], NewClass);
    return NewClass;
}(cc.Component));
exports.default = NewClass;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 28572 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/NumberToImage.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '669f4SuSl9ORqawBcbwCNpG', 'NumberToImage');
// Script/NumberToImage.ts

"use strict";
// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var NumberToImage = /** @class */ (function (_super) {
    __extends(NumberToImage, _super);
    function NumberToImage() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.fontUI = null;
        return _this;
        // static calculateAndConvert(num1: number, num2: number, operator: '+' | '-' | '*' | '/', spriteFrames: SpriteFrame[]): Node[] {
        //     let result: number;
        //     switch (operator) {
        //         case '+':
        //             result = num1 + num2;
        //             break;
        //         case '-':
        //             result = num1 - num2;
        //             break;
        //         case '*':
        //             result = num1 * num2;
        //             break;
        //         case '/':
        //             result = num1 / num2;
        //             break;
        //         default:
        //             throw new Error('不支持的运算符');
        //     }
        //     // 处理结果为小数的情况，这里简单取整
        //     result = Math.floor(result);
        //     return this.numberToImageNodes(result, spriteFrames);
        // }
        // update (dt) {}
    }
    NumberToImage_1 = NumberToImage;
    // LIFE-CYCLE CALLBACKS:
    NumberToImage.prototype.onLoad = function () {
        if (this.fontUI != null) {
            NumberToImage_1.font = this.fontUI;
        }
    };
    //第一个参数  数字， 第二个参数  数字间距  第三个参数 占位宽度  第四个参数 目标节点
    NumberToImage.numberToImageNodes = function (number, width, posX, name, targetNode, middle) {
        if (middle === void 0) { middle = false; }
        var numStr = number.toString();
        var cha = 0;
        if (number > 99)
            cha = -posX;
        else if (number < 10)
            cha = posX;
        if (targetNode.children.length > 0)
            targetNode.removeAllChildren();
        for (var i = 0; i < numStr.length; i++) {
            var digit = parseInt(numStr[i], 10);
            var node = new cc.Node();
            var sprite = node.addComponent(cc.Sprite);
            // debugger;
            sprite.spriteFrame = this.font._spriteFrames[name + digit + ""];
            // 将节点添加到目标节点下
            node.x = i * width + cha;
            node.parent = targetNode;
        }
        if (middle) {
            targetNode.x = targetNode.x - targetNode.children.length * (width - 15) / 2;
        }
    };
    NumberToImage.getTimeMargin = function (number, width, name, targetNode) {
        var timeArr = [];
        var total = 0;
        total = number;
        var hour = 0;
        hour = parseInt((total / 3600) + ""); //计算整数小时数
        var afterHour = total - hour * 60 * 60; //取得算出小时数后剩余的秒数
        var min = parseInt((afterHour / 60) + ""); //计算整数分
        var m = "" + min;
        if (min < 10)
            m = "0" + min;
        var afterMin = total - hour * 60 * 60 - min * 60; //取得算出分后剩余的秒数
        var miao = afterMin + "";
        if (afterMin < 10)
            miao = "0" + afterMin;
        var result = m + miao;
        for (var i = 0; i < result.length; i++) {
            var digit = parseInt(result[i], 10);
            timeArr.push(digit);
        }
        if (targetNode.children.length > 0) {
            for (var i = 0; i < targetNode.children.length; i++) {
                targetNode.children[i].getComponent(cc.Sprite).spriteFrame = this.font._spriteFrames[name + timeArr[i] + ""];
            }
        }
        else {
            for (var i = 0; i < 4; i++) {
                var node = new cc.Node();
                var sprite = node.addComponent(cc.Sprite);
                var digit = timeArr[i];
                // debugger;
                sprite.spriteFrame = this.font._spriteFrames[name + digit + ""];
                // 将节点添加到目标节点下
                node.x = i * width;
                if (i > 1)
                    node.x += 35;
                node.parent = targetNode;
            }
        }
    };
    var NumberToImage_1;
    NumberToImage.font = null;
    __decorate([
        property(cc.SpriteAtlas)
    ], NumberToImage.prototype, "fontUI", void 0);
    NumberToImage = NumberToImage_1 = __decorate([
        ccclass
    ], NumberToImage);
    return NumberToImage;
}(cc.Component));
exports.default = NumberToImage;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 11064 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/Wall.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '87a44m5f/pPAKIrsyArSr/V', 'Wall');
// Script/Wall.ts

"use strict";
// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.WallColor = exports.WallType = exports.WallSpecial = void 0;
var Map_1 = require("./Map");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var WallSpecial;
(function (WallSpecial) {
    /*普通门*/
    WallSpecial[WallSpecial["\u666E\u901A\u95E8"] = 0] = "\u666E\u901A\u95E8";
    /*星星门*/
    WallSpecial[WallSpecial["\u661F\u661F\u95E8"] = 1] = "\u661F\u661F\u95E8";
    /*开关门*/
    WallSpecial[WallSpecial["\u5F00\u5173\u95E8"] = 2] = "\u5F00\u5173\u95E8";
    /*冻结门 */
    WallSpecial[WallSpecial["\u51BB\u7ED3\u95E8"] = 3] = "\u51BB\u7ED3\u95E8";
})(WallSpecial = exports.WallSpecial || (exports.WallSpecial = {}));
var WallType;
(function (WallType) {
    /*普通地块 */
    WallType[WallType["\u95E8\u6A2A\u5411\u4E0B"] = 0] = "\u95E8\u6A2A\u5411\u4E0B";
    /*起点地块 */
    WallType[WallType["\u95E8\u6A2A\u5411\u4E0A"] = 1] = "\u95E8\u6A2A\u5411\u4E0A";
    /*湿地 */
    WallType[WallType["\u95E8\u7AD6\u5411\u53F3"] = 2] = "\u95E8\u7AD6\u5411\u53F3";
    /*山峰 */
    WallType[WallType["\u95E8\u7AD6\u5411\u5DE6"] = 3] = "\u95E8\u7AD6\u5411\u5DE6";
    /*终点地块 */
    WallType[WallType["\u5899\u6A2A\u5411\u4E0B"] = 4] = "\u5899\u6A2A\u5411\u4E0B";
    /*息壤 */
    WallType[WallType["\u5899\u6A2A\u5411\u4E0A"] = 5] = "\u5899\u6A2A\u5411\u4E0A";
    /*加固 */
    WallType[WallType["\u5899\u7AD6\u5411\u53F3"] = 6] = "\u5899\u7AD6\u5411\u53F3";
    /*加固 */
    WallType[WallType["\u5899\u7AD6\u5411\u5DE6"] = 7] = "\u5899\u7AD6\u5411\u5DE6";
})(WallType = exports.WallType || (exports.WallType = {}));
var WallColor;
(function (WallColor) {
    /*普通地块 */
    WallColor[WallColor["\u7D2B\u8272"] = 0] = "\u7D2B\u8272";
    /*湿地 */
    WallColor[WallColor["\u9EC4\u8272"] = 1] = "\u9EC4\u8272";
    /*山峰 */
    WallColor[WallColor["\u7EFF\u8272"] = 2] = "\u7EFF\u8272";
    /*终点地块 */
    WallColor[WallColor["\u84DD\u8272"] = 3] = "\u84DD\u8272";
    /*息壤 */
    WallColor[WallColor["\u7C89\u8272"] = 4] = "\u7C89\u8272";
    /*加固 */
    WallColor[WallColor["\u6A58\u9EC4\u8272"] = 5] = "\u6A58\u9EC4\u8272";
    /*加固 */
    WallColor[WallColor["\u9752\u8272"] = 6] = "\u9752\u8272";
    /*加固 */
    WallColor[WallColor["\u767D\u8272"] = 7] = "\u767D\u8272";
    /*普通地块 */
    WallColor[WallColor["\u7EA2\u8272"] = 8] = "\u7EA2\u8272";
    /*普通地块 */
    WallColor[WallColor["\u7070\u8272"] = 9] = "\u7070\u8272";
})(WallColor = exports.WallColor || (exports.WallColor = {}));
var Wall = /** @class */ (function (_super) {
    __extends(Wall, _super);
    function Wall() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.number = null;
        _this.type = WallType.墙横向下;
        _this.special = WallSpecial.普通门;
        _this.color = WallColor.紫色;
        _this.wall_SpriteFrames = null;
        _this.down_SpriteFrames = null;
        return _this;
        // update (dt) {}
    }
    // LIFE-CYCLE CALLBACKS:
    // onLoad () {}
    Wall.prototype.start = function () {
        // console.log(this.type);
    };
    Wall.prototype.jsonDeepClone = function (obj) {
        return JSON.parse(JSON.stringify(obj));
    };
    Wall.prototype.init = function (wall_Info, posX, posY, direction) {
        this.wall_Info = this.jsonDeepClone(wall_Info);
        // this.open = true;
        if (wall_Info == null) {
            this.posX = posX;
            this.posY = posY;
            if (direction)
                this.direction = direction;
            // console.log("门方向赋值",direction);
            if (direction == "up") {
                this.node.parent.zIndex = 100 + this.posX - this.posY * 3;
            }
            else if (direction == "down" || direction == "right" ||
                direction == "rightdown" || direction == "downright"
                || direction == "rightup" || direction == "upright") {
                this.node.parent.zIndex = 30 + this.posX - this.posY * 3;
            }
            else if (direction == "left" || direction == "leftdown" || direction == "downleft") {
                this.node.parent.zIndex = 70 + this.posX - this.posY * 3;
            }
            else
                this.node.parent.zIndex = 70 + this.posX - this.posY * 3;
            Map_1.default._instance.mapBlocksWall[this.posX][this.posY].getComponent("MapBlock").block_Id = "Wall";
            //console.log(this.posX,this.posY,MapConroler._instance.mapBlocksWall[this.posX][this.posY].getComponent("MapBlock").block_Id);
            // console.log(this.posX,this.posY,this.node.zIndex);
            //this.node.getChildByName("num").getComponent(cc.Label).string = direction;
            //this.node.getChildByName("num").getComponent(cc.Label).string = ":" + this.node.parent.zIndex;
        }
        if (wall_Info != null) {
            this.color = wall_Info.color;
            this.special = wall_Info.special;
            this.initType();
            if (wall_Info.length > 0) {
                this.initColor(wall_Info.length);
            }
            else
                this.node.removeComponent("cc.Sprite");
            if (this.posX != null) {
                Map_1.default._instance.mapBlocksWall[this.posX][this.posY].getComponent("MapBlock").block_Id = "Wall";
                //console.log(this.posX,this.posY,MapConroler._instance.mapBlocksWall[this.posX][this.posY].getComponent("MapBlock").block_Id);
            }
        }
        // setTimeout(() => {
        //     this.node.getChildByName("num").getComponent(cc.Label).string = ":" + this.node.parent.zIndex;
        // }, 1000);
    };
    //创建门的颜色
    Wall.prototype.initColor = function (length) {
        var direction = this.node.parent.name;
        var double = 0;
        if (direction == "left" || direction == "right") {
            double = 3;
        }
        // debugger;
        if (this.wall_SpriteFrames) {
            var name = this.color + "color" + (length + double);
            var spriteFrame = this.wall_SpriteFrames._spriteFrames[name];
            this.node.getComponent(cc.Sprite).spriteFrame = spriteFrame;
        }
        if (this.down_SpriteFrames) {
            var name2 = this.color + "down" + (length + double);
            var downFrame = this.down_SpriteFrames._spriteFrames[name2];
            this.node.parent.getChildByName("down").getComponent(cc.Sprite).spriteFrame = downFrame;
        }
    };
    //创建特殊类型门
    Wall.prototype.initType = function () {
        switch (this.special) {
            case WallSpecial.星星门:
                var star = cc.instantiate(Map_1.default._instance.Block_Prop[this.special]);
                star.parent = this.node.parent;
                // console.log("门的方向",this.direction,"长度",this.wall_Info.length);
                // star.scaleX = star.scaleY = 0.5;
                if (this.wall_Info.length > 0) {
                    if (this.direction == "right" || this.direction == "left") {
                        star.children[this.wall_Info.length + 2].active = true;
                    }
                    else if (this.direction == "up" || this.direction == "down") {
                        star.children[this.wall_Info.length - 1].active = true;
                    }
                }
                star.setPosition(this.node.width / 2 + this.node.x, this.node.height / 2 + this.node.y);
                break;
            case WallSpecial.开关门:
                var name = "open" + this.wall_Info.length;
                this.openNode = this.node.parent.getChildByName("open").getChildByName(name);
                this.openNode.active = true;
                if (this.wall_Info.lock == false) {
                    this.open = true;
                    this.openNode.children[0].scaleX *= 0.01;
                    this.openNode.children[1].scaleX *= 0.01;
                }
                else {
                    this.open = false;
                }
                break;
            case WallSpecial.冻结门:
                var freeze = "freeze" + this.wall_Info.length;
                this.freezeNode = this.node.parent.getChildByName("freeze").getChildByName(freeze);
                this.freezeNode.active = true;
                if (this.wall_Info.freeze) {
                    this.freezeNode.getChildByName("num").getComponent(cc.Label).string = this.wall_Info.freeze + "";
                }
                break;
        }
    };
    //播放星星门通过
    Wall.prototype.playStarDoor = function () {
        if (this.node.parent.getChildByName("star")) {
            var star = this.node.parent.getChildByName("star");
            for (var i = 0; i < star.children.length; i++) {
                if (star.children[i].active == true) {
                    var starChild = star.children[i];
                    for (var j = 0; j < starChild.children.length; j++) {
                        starChild.children[j].active = true;
                        starChild.children[j].getComponent(sp.Skeleton).setAnimation(1, "taopao1", false);
                    }
                }
            }
        }
    };
    //改变开关门状态
    Wall.prototype.changeLock = function () {
        this.open = !this.open;
        console.log("开关门状态改变", this.open);
        if (!this.openNode.active) {
            this.openNode.active = true;
        }
        var fill = this.openNode.children[0].scaleX == 1 ? 0.01 : 1;
        if (this.openNode.children[0].scaleX < 0)
            fill = -fill;
        // console.log("目标",fill);
        cc.tween(this.openNode.children[0])
            .to(0.3, { scaleX: this.openNode.children[0].scaleX < 0 ? -fill : fill })
            .call(function () {
            // console.log("左边完成");
        })
            .start();
        cc.tween(this.openNode.children[1])
            .to(0.3, { scaleX: this.openNode.children[1].scaleX < 0 ? -fill : fill })
            .call(function () {
            // console.log("右边完成");
        })
            .start();
    };
    Wall.prototype.changeFreeze = function () {
        var numStr = this.freezeNode.getChildByName("num").getComponent(cc.Label);
        var num = parseInt(numStr.string);
        num -= 1;
        this.freezeNode.getChildByName("num").getComponent(cc.Label).string = num + "";
        if (num == 0) {
            this.freezeNode.parent.active = false;
        }
    };
    Wall.prototype.downDoor = function () {
        if (this.openNode) {
            if (this.openNode.children[0].scaleX == 1)
                return;
        }
        if (this.freezeNode) {
            if (this.freezeNode.active == true)
                return;
        }
        this.node.opacity = 0;
        if (this.special == WallSpecial.星星门) {
            this.node.parent.getChildByName("star").y -= 10;
        }
        this.node.parent.getChildByName("down").active = true;
    };
    Wall.prototype.upDoor = function () {
        if (this.special == WallSpecial.星星门) {
            this.node.parent.getChildByName("star").y += 10;
        }
        this.node.parent.getChildByName("down").active = false;
        this.node.opacity = 250;
    };
    __decorate([
        property(cc.Label)
    ], Wall.prototype, "number", void 0);
    __decorate([
        property({
            tooltip: '墙或者门的方向',
            type: cc.Enum(WallType),
        })
    ], Wall.prototype, "type", void 0);
    __decorate([
        property({
            tooltip: '墙或者门的方向',
            type: cc.Enum(WallSpecial),
        })
    ], Wall.prototype, "special", void 0);
    __decorate([
        property({
            tooltip: '门的颜色',
            type: cc.Enum(WallColor),
        })
    ], Wall.prototype, "color", void 0);
    __decorate([
        property(cc.SpriteAtlas)
    ], Wall.prototype, "wall_SpriteFrames", void 0);
    __decorate([
        property(cc.SpriteAtlas)
    ], Wall.prototype, "down_SpriteFrames", void 0);
    Wall = __decorate([
        ccclass
    ], Wall);
    return Wall;
}(cc.Component));
exports.default = Wall;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 27512 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/lq_collide_system/lq_collide_config.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '4bd21i88J9KfoWB6fqk7oW1', 'lq_collide_config');
// Script/lq_collide_system/lq_collide_config.ts

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LQCollideConfig = exports.LQCollideInfoList = void 0;
var LQCollideInfoList;
(function (LQCollideInfoList) {
    LQCollideInfoList[LQCollideInfoList["default"] = 0] = "default";
    LQCollideInfoList[LQCollideInfoList["role"] = 1] = "role";
    LQCollideInfoList[LQCollideInfoList["role_bullet"] = 2] = "role_bullet";
    LQCollideInfoList[LQCollideInfoList["enemy"] = 3] = "enemy";
    LQCollideInfoList[LQCollideInfoList["enemy_bullet"] = 4] = "enemy_bullet";
    LQCollideInfoList[LQCollideInfoList["prop"] = 5] = "prop";
})(LQCollideInfoList = exports.LQCollideInfoList || (exports.LQCollideInfoList = {}));
var LQCollideConfig = /** @class */ (function () {
    function LQCollideConfig() {
    }
    LQCollideConfig.switch_auto_run = true;
    LQCollideConfig.switch_print_log = true;
    LQCollideConfig.switch_quad_tree = false;
    LQCollideConfig.max_node_len = 10;
    LQCollideConfig.per_frame = 60;
    LQCollideConfig.max_node_level = 4;
    LQCollideConfig.active_area_x = 0;
    LQCollideConfig.active_area_y = 0;
    LQCollideConfig.active_area_width = 1000;
    LQCollideConfig.active_area_height = 1000;
    LQCollideConfig.collide_group_map = {
        "default": { id: 1, category: 1, index: 0, mask: 1 },
        "role": { id: 2, category: 2, index: 1, mask: 56 },
        "role_bullet": { id: 3, category: 4, index: 2, mask: 8 },
        "enemy": { id: 4, category: 8, index: 3, mask: 6 },
        "enemy_bullet": { id: 5, category: 16, index: 4, mask: 2 },
        "prop": { id: 6, category: 32, index: 5, mask: 2 },
    };
    return LQCollideConfig;
}());
exports.LQCollideConfig = LQCollideConfig;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcU2NyaXB0XFxscV9jb2xsaWRlX3N5c3RlbVxcbHFfY29sbGlkZV9jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsSUFBWSxpQkFFWDtBQUZELFdBQVksaUJBQWlCO0lBQ3pCLCtEQUFPLENBQUE7SUFBRSx5REFBSSxDQUFBO0lBQUUsdUVBQVcsQ0FBQTtJQUFFLDJEQUFLLENBQUE7SUFBRSx5RUFBWSxDQUFBO0lBQUUseURBQUksQ0FBQTtBQUN6RCxDQUFDLEVBRlcsaUJBQWlCLEdBQWpCLHlCQUFpQixLQUFqQix5QkFBaUIsUUFFNUI7QUFFRDtJQUFBO0lBbUJBLENBQUM7SUFsQmlCLCtCQUFlLEdBQVksSUFBSSxDQUFDO0lBQ2hDLGdDQUFnQixHQUFZLElBQUksQ0FBQztJQUNqQyxnQ0FBZ0IsR0FBWSxLQUFLLENBQUM7SUFDbEMsNEJBQVksR0FBVyxFQUFFLENBQUM7SUFDMUIseUJBQVMsR0FBVyxFQUFFLENBQUM7SUFDdkIsOEJBQWMsR0FBVyxDQUFDLENBQUM7SUFDM0IsNkJBQWEsR0FBVyxDQUFDLENBQUM7SUFDMUIsNkJBQWEsR0FBVyxDQUFDLENBQUM7SUFDMUIsaUNBQWlCLEdBQVcsSUFBSSxDQUFDO0lBQ2pDLGtDQUFrQixHQUFXLElBQUksQ0FBQztJQUNsQyxpQ0FBaUIsR0FBRztRQUM5QixTQUFTLEVBQUUsRUFBQyxFQUFFLEVBQUUsQ0FBQyxFQUFFLFFBQVEsRUFBRSxDQUFDLEVBQUUsS0FBSyxFQUFFLENBQUMsRUFBRSxJQUFJLEVBQUUsQ0FBQyxFQUFDO1FBQ2xELE1BQU0sRUFBRSxFQUFDLEVBQUUsRUFBRSxDQUFDLEVBQUUsUUFBUSxFQUFFLENBQUMsRUFBRSxLQUFLLEVBQUUsQ0FBQyxFQUFFLElBQUksRUFBRSxFQUFFLEVBQUM7UUFDaEQsYUFBYSxFQUFFLEVBQUMsRUFBRSxFQUFFLENBQUMsRUFBRSxRQUFRLEVBQUUsQ0FBQyxFQUFFLEtBQUssRUFBRSxDQUFDLEVBQUUsSUFBSSxFQUFFLENBQUMsRUFBQztRQUN0RCxPQUFPLEVBQUUsRUFBQyxFQUFFLEVBQUUsQ0FBQyxFQUFFLFFBQVEsRUFBRSxDQUFDLEVBQUUsS0FBSyxFQUFFLENBQUMsRUFBRSxJQUFJLEVBQUUsQ0FBQyxFQUFDO1FBQ2hELGNBQWMsRUFBRSxFQUFDLEVBQUUsRUFBRSxDQUFDLEVBQUUsUUFBUSxFQUFFLEVBQUUsRUFBRSxLQUFLLEVBQUUsQ0FBQyxFQUFFLElBQUksRUFBRSxDQUFDLEVBQUM7UUFDeEQsTUFBTSxFQUFFLEVBQUMsRUFBRSxFQUFFLENBQUMsRUFBRSxRQUFRLEVBQUUsRUFBRSxFQUFFLEtBQUssRUFBRSxDQUFDLEVBQUUsSUFBSSxFQUFFLENBQUMsRUFBQztLQUNuRCxDQUFBO0lBQ0wsc0JBQUM7Q0FuQkQsQUFtQkMsSUFBQTtBQW5CWSwwQ0FBZSIsImZpbGUiOiIiLCJzb3VyY2VSb290IjoiLyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBlbnVtIExRQ29sbGlkZUluZm9MaXN0IHtcclxuICAgIGRlZmF1bHQsIHJvbGUsIHJvbGVfYnVsbGV0LCBlbmVteSwgZW5lbXlfYnVsbGV0LCBwcm9wXHJcbn1cclxuXHJcbmV4cG9ydCBjbGFzcyBMUUNvbGxpZGVDb25maWcge1xyXG4gICAgcHVibGljIHN0YXRpYyBzd2l0Y2hfYXV0b19ydW46IGJvb2xlYW4gPSB0cnVlO1xyXG4gICAgcHVibGljIHN0YXRpYyBzd2l0Y2hfcHJpbnRfbG9nOiBib29sZWFuID0gdHJ1ZTtcclxuICAgIHB1YmxpYyBzdGF0aWMgc3dpdGNoX3F1YWRfdHJlZTogYm9vbGVhbiA9IGZhbHNlO1xyXG4gICAgcHVibGljIHN0YXRpYyBtYXhfbm9kZV9sZW46IG51bWJlciA9IDEwO1xyXG4gICAgcHVibGljIHN0YXRpYyBwZXJfZnJhbWU6IG51bWJlciA9IDYwO1xyXG4gICAgcHVibGljIHN0YXRpYyBtYXhfbm9kZV9sZXZlbDogbnVtYmVyID0gNDtcclxuICAgIHB1YmxpYyBzdGF0aWMgYWN0aXZlX2FyZWFfeDogbnVtYmVyID0gMDtcclxuICAgIHB1YmxpYyBzdGF0aWMgYWN0aXZlX2FyZWFfeTogbnVtYmVyID0gMDtcclxuICAgIHB1YmxpYyBzdGF0aWMgYWN0aXZlX2FyZWFfd2lkdGg6IG51bWJlciA9IDEwMDA7XHJcbiAgICBwdWJsaWMgc3RhdGljIGFjdGl2ZV9hcmVhX2hlaWdodDogbnVtYmVyID0gMTAwMDtcclxuICAgIHB1YmxpYyBzdGF0aWMgY29sbGlkZV9ncm91cF9tYXAgPSB7XHJcbiAgICAgICAgXCJkZWZhdWx0XCI6IHtpZDogMSwgY2F0ZWdvcnk6IDEsIGluZGV4OiAwLCBtYXNrOiAxfSxcclxuICAgICAgICBcInJvbGVcIjoge2lkOiAyLCBjYXRlZ29yeTogMiwgaW5kZXg6IDEsIG1hc2s6IDU2fSxcclxuICAgICAgICBcInJvbGVfYnVsbGV0XCI6IHtpZDogMywgY2F0ZWdvcnk6IDQsIGluZGV4OiAyLCBtYXNrOiA4fSxcclxuICAgICAgICBcImVuZW15XCI6IHtpZDogNCwgY2F0ZWdvcnk6IDgsIGluZGV4OiAzLCBtYXNrOiA2fSxcclxuICAgICAgICBcImVuZW15X2J1bGxldFwiOiB7aWQ6IDUsIGNhdGVnb3J5OiAxNiwgaW5kZXg6IDQsIG1hc2s6IDJ9LFxyXG4gICAgICAgIFwicHJvcFwiOiB7aWQ6IDYsIGNhdGVnb3J5OiAzMiwgaW5kZXg6IDUsIG1hc2s6IDJ9LFxyXG4gICAgfVxyXG59Il19
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/position.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'e0e34n/+FRF5JdkULm6vdT0', 'position');
// Script/position.ts

var _PROP_INFO = [{ "pos1": { "x": -60, "y": 60, "z": 0 }, "pos2": { "x": -16.442, "y": 30, "z": 0 }, "pos3": { "x": -34.362, "y": 13.246, "z": 0 }, "pos4": { "x": -17, "y": 12, "z": 0 } }, { "pos1": { "x": -126, "y": 63, "z": 0 }, "pos2": { "x": -25.792, "y": 34.675, "z": 0 }, "pos3": { "x": -94.792, "y": 21.675, "z": 0 }, "pos4": { "x": -20, "y": 13, "z": 0 } }, { "pos1": { "x": -60, "y": 125, "z": 0 }, "pos2": { "x": -12.792, "y": 92.675, "z": 0 }, "pos3": { "x": -27.792, "y": 23.675, "z": 0 }, "pos4": { "x": -14, "y": 24, "z": 0 } }, { "pos1": { "x": -185, "y": 63, "z": 0 }, "pos2": { "x": -34.792, "y": 37.675, "z": 0 }, "pos3": { "x": -154.792, "y": 23.675, "z": 0 }, "pos4": { "x": -22, "y": 16, "z": 0 } }, { "pos1": { "x": -57, "y": 178, "z": 0 }, "pos2": { "x": -17.792, "y": 166.675, "z": 0 }, "pos3": { "x": -31.792, "y": 33.675, "z": 0 }, "pos4": { "x": -14, "y": 37, "z": 0 } }, { "pos1": { "x": -123, "y": 127, "z": 0 }, "pos2": { "x": -25.792, "y": 99.675, "z": 0 }, "pos3": { "x": -97.792, "y": 27.675, "z": 0 }, "pos4": { "x": -27, "y": 19, "z": 0 } }, { "pos1": { "x": -62, "y": 181, "z": 0 }, "pos2": { "x": -24.792, "y": 275.675, "z": 0 }, "pos3": { "x": -31.792, "y": 35.675, "z": 0 }, "pos4": { "x": -7, "y": 39, "z": 0 } }, { "pos1": { "x": -181, "y": 180, "z": 0 }, "pos2": { "x": -31.792, "y": 163.675, "z": 0 }, "pos3": { "x": -33.792, "y": 34.675, "z": 0 }, "pos4": { "x": -18, "y": 25, "z": 0 } }, { "pos1": { "x": -182, "y": 182, "z": 0 }, "pos2": { "x": -25.792, "y": 38.675, "z": 0 }, "pos3": { "x": -153.792, "y": 34.675, "z": 0 }, "pos4": { "x": -23, "y": 14, "z": 0 } }, { "pos1": { "x": -186, "y": 61, "z": 0 }, "pos2": { "x": -37.792, "y": 37.675, "z": 0 }, "pos3": { "x": -36.792, "y": 26.675, "z": 0 }, "pos4": { "x": -24, "y": 17, "z": 0 } }, { "pos1": { "x": -62, "y": 177, "z": 0 }, "pos2": { "x": 93.208, "y": 276.675, "z": 0 }, "pos3": { "x": -33.792, "y": 34.675, "z": 0 }, "pos4": { "x": 3, "y": 31, "z": 0 } }, { "pos1": { "x": 58, "y": 179, "z": 0 }, "pos2": { "x": 205.225, "y": 154.034, "z": 0 }, "pos3": { "x": -29.642, "y": 25.691, "z": 0 }, "pos4": { "x": 7.218, "y": 29.765, "z": 0 } }, { "pos1": { "x": -57, "y": 182, "z": 0 }, "pos2": { "x": -25.792, "y": 37.675, "z": 0 }, "pos3": { "x": -35.792, "y": 33.675, "z": 0 }, "pos4": { "x": -14, "y": 12, "z": 0 } }, { "pos1": { "x": -180, "y": 62, "z": 0 }, "pos2": { "x": -35.792, "y": 36.675, "z": 0 }, "pos3": { "x": -271.792, "y": 24.675, "z": 0 }, "pos4": { "x": -17, "y": 20, "z": 0 } }, { "pos1": { "x": -62, "y": 178, "z": 0 }, "pos2": { "x": 87.208, "y": 164.675, "z": 0 }, "pos3": { "x": -31.792, "y": 35.675, "z": 0 }, "pos4": { "x": -6, "y": 24, "z": 0 } }, { "pos1": { "x": -176, "y": 60, "z": 0 }, "pos2": { "x": -33.792, "y": 38.675, "z": 0 }, "pos3": { "x": -154.792, "y": 29.675, "z": 0 }, "pos4": { "x": -29, "y": 16, "z": 0 } }, { "pos1": { "x": -60, "y": 181, "z": 0 }, "pos2": { "x": 95.208, "y": 155.675, "z": 0 }, "pos3": { "x": -30.792, "y": 36.675, "z": 0 }, "pos4": { "x": -12, "y": 32, "z": 0 } }, { "pos1": { "x": -63, "y": 178, "z": 0 }, "pos2": { "x": -21.792, "y": 156.675, "z": 0 }, "pos3": { "x": -31.792, "y": 37.675, "z": 0 }, "pos4": { "x": -12, "y": 32, "z": 0 } }, { "pos1": { "x": -60, "y": 183, "z": 0 }, "pos2": { "x": 88.208, "y": 162.675, "z": 0 }, "pos3": { "x": -29.792, "y": 41.675, "z": 0 }, "pos4": { "x": -12, "y": 18, "z": 0 } }, { "pos1": { "x": -64, "y": 58, "z": 0 }, "pos2": { "x": -26.792, "y": 32.675, "z": 0 }, "pos3": { "x": -34.792, "y": 23.675, "z": 0 }, "pos4": { "x": -12, "y": 18, "z": 0 } }, { "pos1": { "x": -184, "y": 62, "z": 0 }, "pos2": { "x": -25.792, "y": 34.675, "z": 0 }, "pos3": { "x": -155.792, "y": 25.675, "z": 0 }, "pos4": { "x": -18, "y": 26, "z": 0 } }, { "pos1": { "x": -57, "y": 190, "z": 0 }, "pos2": { "x": 95.208, "y": 158.675, "z": 0 }, "pos3": { "x": -33.792, "y": 29.675, "z": 0 }, "pos4": { "x": -18, "y": 26, "z": 0 } }, { "pos1": { "x": -71, "y": 184, "z": 0 }, "pos2": { "x": -25.792, "y": 156.675, "z": 0 }, "pos3": { "x": -35.792, "y": 27.675, "z": 0 }, "pos4": { "x": -25, "y": 40, "z": 0 } }];

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 16676 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/migration/use_v2.1-2.2.1_cc.Toggle_event_1.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'c9ad1iUTB1PyqJ3cmtMGJ31', 'use_v2.1-2.2.1_cc.Toggle_event_1');
// migration/use_v2.1-2.2.1_cc.Toggle_event_1.js

"use strict";

/*
 * This script is automatically generated by Cocos Creator and is only used for projects compatible with the v2.1.0 ～ 2.2.1 version.
 * You do not need to manually add this script in any other project.
 * If you don't use cc.Toggle in your project, you can delete this script directly.
 * If your project is hosted in VCS such as git, submit this script together.
 *
 * 此脚本由 Cocos Creator 自动生成，仅用于兼容 v2.1.0 ~ 2.2.1 版本的工程，
 * 你无需在任何其它项目中手动添加此脚本。
 * 如果你的项目中没用到 Toggle，可直接删除该脚本。
 * 如果你的项目有托管于 git 等版本库，请将此脚本一并上传。
 */

if (cc.Toggle) {
  // Whether to trigger 'toggle' and 'checkEvents' events when modifying 'toggle.isChecked' in the code
  // 在代码中修改 'toggle.isChecked' 时是否触发 'toggle' 与 'checkEvents' 事件
  cc.Toggle._triggerEventInScript_isChecked = true;
}

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcbWlncmF0aW9uXFx1c2VfdjIuMS0yLjIuMV9jYy5Ub2dnbGVfZXZlbnRfMS5qcyJdLCJuYW1lcyI6WyJjYyIsIlRvZ2dsZSIsIl90cmlnZ2VyRXZlbnRJblNjcmlwdF9pc0NoZWNrZWQiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSxJQUFJQSxFQUFFLENBQUNDLE1BQU0sRUFBRTtFQUNYO0VBQ0E7RUFDQUQsRUFBRSxDQUFDQyxNQUFNLENBQUNDLCtCQUErQixHQUFHLElBQUk7QUFDcEQiLCJzb3VyY2VSb290IjoiLyIsInNvdXJjZXNDb250ZW50IjpbIi8qXHJcbiAqIFRoaXMgc2NyaXB0IGlzIGF1dG9tYXRpY2FsbHkgZ2VuZXJhdGVkIGJ5IENvY29zIENyZWF0b3IgYW5kIGlzIG9ubHkgdXNlZCBmb3IgcHJvamVjdHMgY29tcGF0aWJsZSB3aXRoIHRoZSB2Mi4xLjAg772eIDIuMi4xIHZlcnNpb24uXHJcbiAqIFlvdSBkbyBub3QgbmVlZCB0byBtYW51YWxseSBhZGQgdGhpcyBzY3JpcHQgaW4gYW55IG90aGVyIHByb2plY3QuXHJcbiAqIElmIHlvdSBkb24ndCB1c2UgY2MuVG9nZ2xlIGluIHlvdXIgcHJvamVjdCwgeW91IGNhbiBkZWxldGUgdGhpcyBzY3JpcHQgZGlyZWN0bHkuXHJcbiAqIElmIHlvdXIgcHJvamVjdCBpcyBob3N0ZWQgaW4gVkNTIHN1Y2ggYXMgZ2l0LCBzdWJtaXQgdGhpcyBzY3JpcHQgdG9nZXRoZXIuXHJcbiAqXHJcbiAqIOatpOiEmuacrOeUsSBDb2NvcyBDcmVhdG9yIOiHquWKqOeUn+aIkO+8jOS7heeUqOS6juWFvOWuuSB2Mi4xLjAgfiAyLjIuMSDniYjmnKznmoTlt6XnqIvvvIxcclxuICog5L2g5peg6ZyA5Zyo5Lu75L2V5YW25a6D6aG555uu5Lit5omL5Yqo5re75Yqg5q2k6ISa5pys44CCXHJcbiAqIOWmguaenOS9oOeahOmhueebruS4reayoeeUqOWIsCBUb2dnbGXvvIzlj6/nm7TmjqXliKDpmaTor6XohJrmnKzjgIJcclxuICog5aaC5p6c5L2g55qE6aG555uu5pyJ5omY566h5LqOIGdpdCDnrYnniYjmnKzlupPvvIzor7flsIbmraTohJrmnKzkuIDlubbkuIrkvKDjgIJcclxuICovXHJcblxyXG5pZiAoY2MuVG9nZ2xlKSB7XHJcbiAgICAvLyBXaGV0aGVyIHRvIHRyaWdnZXIgJ3RvZ2dsZScgYW5kICdjaGVja0V2ZW50cycgZXZlbnRzIHdoZW4gbW9kaWZ5aW5nICd0b2dnbGUuaXNDaGVja2VkJyBpbiB0aGUgY29kZVxyXG4gICAgLy8g5Zyo5Luj56CB5Lit5L+u5pS5ICd0b2dnbGUuaXNDaGVja2VkJyDml7bmmK/lkKbop6blj5EgJ3RvZ2dsZScg5LiOICdjaGVja0V2ZW50cycg5LqL5Lu2XHJcbiAgICBjYy5Ub2dnbGUuX3RyaWdnZXJFdmVudEluU2NyaXB0X2lzQ2hlY2tlZCA9IHRydWU7XHJcbn1cclxuIl19
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/Sdk/MiniGameManager.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '0d272pXVChFDqi5FXTD2JlR', 'MiniGameManager');
// Script/Sdk/MiniGameManager.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.MiniGameManager = void 0;
var MiniGameSdk_1 = require("./MiniGameSdk");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var EWechatAD;
(function (EWechatAD) {
    EWechatAD["CUMSTOM_01"] = "adunit-f7c2417eb2c2e473";
})(EWechatAD || (EWechatAD = {}));
var MiniGameManager = /** @class */ (function (_super) {
    __extends(MiniGameManager, _super);
    function MiniGameManager() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.entranceView = null;
        return _this;
    }
    MiniGameManager_1 = MiniGameManager;
    Object.defineProperty(MiniGameManager, "instance", {
        get: function () {
            if (!MiniGameManager_1._instance) {
                MiniGameManager_1._instance = new MiniGameManager_1();
            }
            return MiniGameManager_1._instance;
        },
        enumerable: false,
        configurable: true
    });
    MiniGameManager.prototype.start = function () {
        // 禁用游戏入口视图
        // this.entranceView.active = false;
        // MiniGameSdk.API.getUserProfile(this.setUserId);
        // cc.fx.GameTool.setUserInfo("");
        this.onGetLoginCode();
        // 尝试获取游戏入口按钮，如果存在则直接返回，不进行后续操作
        // let buttonEntrance = this.node.getChildByName('Btns')?.getChildByName('Button_EntranceView');
        // if (buttonEntrance) {
        //     return;
        // }
        // 如果是字节跳动小游戏环境，检查侧边栏是否存在
        if (MiniGameSdk_1.MiniGameSdk.isBytedance()) {
            //抖音环境，检测侧边栏存在
            MiniGameSdk_1.MiniGameSdk.BytedanceSidebar.checkSideBar(function (success) {
                // 根据侧边栏存在性激活或禁用游戏入口按钮
                // buttonEntrance.active = success;
            });
        }
        else {
            // 非抖音小游戏环境，直接激活游戏入口按钮
            // 非抖音环境，正常显示按钮
            // buttonEntrance.active = true;
        }
        // 设置监听器，以处理来自侧边栏的交互事件
        MiniGameSdk_1.MiniGameSdk.BytedanceSidebar.listenFromSidebar(function (success) {
            // 如果交互成功，显示奖励提示
            if (success) {
                MiniGameSdk_1.MiniGameSdk.API.showToast('侧边栏奖励', 5);
            }
        });
    };
    MiniGameManager.prototype.update = function (deltaTime) {
    };
    /**
     * 弹出广告横幅。
     * 此方法用于加载并显示广告横幅。它首先加载指定广告位的横幅广告，然后显示广告。
     * 加载广告和显示广告是通过MiniGameSdk.AdvertManager的实例方法来实现的。
     *
     * @remarks
     * 此方法提供了两种显示横幅广告的方式：
     * 1. 默认方式：调用showBanner方法显示广告，系统会自动选择显示位置。
     * 2. 指定位置方式：可以通过传入额外的参数来指定广告显示在屏幕的顶部或底部，或者通过坐标指定显示位置。
     *
     * 示例代码中注释掉了两种显示广告的具体方法，可以根据实际需求选择使用。
     */
    MiniGameManager.prototype.onShowBanner = function () {
        // 加载指定广告位的横幅广告。
        MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.loadBanner('adunit-4e7ef467e3eaab51');
        // 默认方式显示横幅广告。
        // 方法1：默认调用
        MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.showBanner();
        // 示例：指定屏幕底部正中显示横幅广告。
        // 方法2：指定屏幕顶部或底部正中
        // MiniGameSdk.AdvertManager.instance.showBanner('adunit-4e7ef467e3eaab51', MiniGameSdk.EAdBannerLocation.BOTTOM); 
        // 示例：通过坐标指定位置显示横幅广告。
        // 方法2：指定坐标
        // MiniGameSdk.AdvertManager.instance.showBanner('adunit-4e7ef467e3eaab51', { top: 10, left: 10 }); 
    };
    /**
     * 隐藏广告横幅的函数。
     *
     * 该函数调用MiniGameSdk.AdvertManager实例的方法，用于隐藏广告横幅。
     * 当需要暂时停止展示广告或用户主动请求隐藏广告时，可以调用此函数。
     *
     * @remarks
     * 此函数不接受任何参数，也不返回任何值。
     * 它单纯地触发广告横幅的隐藏操作，具体实现依赖于AdvertManager的实现。
     */
    MiniGameManager.prototype.onHideBanner = function () {
        MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.hideBanner();
    };
    /**
     * 显示插屏广告的函数。
     *
     * 此函数调用MiniGameSdk.AdvertManager实例的方法，以显示一个指定的插屏广告。
     * 它使用了硬编码的广告单元标识符，这意味着它专为特定的广告位设计。
     * 在实际应用中，可能需要根据应用的配置或用户的特定条件来动态选择广告单元标识符。
     */
    MiniGameManager.prototype.onShowInterstitial = function () {
        MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.showInterstitial('adunit-eadd67851d3050ad');
    };
    /**
     * 调用广告管理器加载并展示自定义广告。
     * 此方法首先通过广告管理器的实例加载指定的自定义广告单元，然后展示这个自定义广告。
     * 加载和展示广告是广告管理系统中的常见操作，这里通过两步分别完成加载和展示的过程，
     * 以确保广告在展示前正确且充分地被加载。
     */
    MiniGameManager.prototype.onShowCustom = function () {
        // 加载指定的自定义广告单元。
        MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.loadCustom(EWechatAD.CUMSTOM_01);
        // 展示已加载的自定义广告。
        MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.showCustom(EWechatAD.CUMSTOM_01);
    };
    /**
     * 隐藏自定义广告。
     *
     * 本函数调用MiniGameSdk.AdvertManager.instance.hideCustom()来隐藏自定义广告。
     * 这是对接广告管理系统的一部分，用于控制广告的显示与隐藏。
     * 在需要隐藏自定义广告的场景下，调用此函数即可实现相应功能。
     */
    MiniGameManager.prototype.onHideCustom = function () {
        MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.hideCustom(EWechatAD.CUMSTOM_01);
    };
    /**
     * 触发显示视频广告的函数。
     * 通过调用MiniGameSdk.AdvertManager.instance.showVideo方法，显示一个视频广告，并根据用户观看广告的情况执行相应的逻辑。
     *
     * @remarks
     * 此函数首先传入一个广告单元ID，用于标识要显示的视频广告。然后传入一个回调函数，该回调函数在用户观看广告后被调用，无论用户是完成了观看、拒绝了观看还是观看过程中发生了错误。
     * 回调函数接收两个参数：一个是用户观看广告的结果，另一个是用户观看的广告数量。根据观看结果的不同，显示不同的提示信息。
     */
    MiniGameManager.prototype.onShowVideo = function () {
        // 广告单元ID，用于标识要显示的视频广告
        // 广告单元ID的样例
        //抖音形如: 1re3nfqkmy81m4m8ge
        //微信形如: adunit-a7718f6e195e42fe
        MiniGameSdk_1.MiniGameSdk.AdvertManager.instance.showVideo('1re3nfqkmy81m4m8ge', function (res, count) {
            // 输出用户观看的广告数量
            console.log('用户看的视频广告个数是:', count);
            // 根据用户观看广告的结果，执行不同的逻辑
            switch (res) {
                case MiniGameSdk_1.MiniGameSdk.EAdVideoResult.ACCEPT:
                    // 用户完成了广告观看，显示奖励提示
                    MiniGameSdk_1.MiniGameSdk.API.showToast('用户看完广告，可以奖励');
                    break;
                case MiniGameSdk_1.MiniGameSdk.EAdVideoResult.REJECT:
                    // 用户拒绝了广告观看，显示不奖励提示
                    MiniGameSdk_1.MiniGameSdk.API.showToast('用户拒绝掉广告，不奖励');
                    break;
                case MiniGameSdk_1.MiniGameSdk.EAdVideoResult.ERROR:
                    // 广告播放发生错误，显示错误提示
                    MiniGameSdk_1.MiniGameSdk.API.showToast('播放广告发生错误，不奖励');
                    break;
                default:
                    // 其他情况，不作处理
                    break;
            }
        });
    };
    /**
     * 引导用户分享应用给朋友。
     *
     * 通过调用MiniGameSdk的API分享功能，向用户的朋友圈发送邀请，邀请他们一起玩游戏。
     * 这是一个重要的推广手段，可以增加应用的曝光度和用户量。
     *
     * @remarks
     * 此方法中调用的API依赖于特定的小游戏平台，因此在不同的平台上可能需要不同的实现。
     */
    MiniGameManager.prototype.onShare = function () {
        MiniGameSdk_1.MiniGameSdk.API.shareAppToFriends('来玩游戏吧');
    };
    /**
     * 显示一个toast提示。
     *
     * 通过调用MiniGameSdk的API方法来显示一个简短的提示信息。toast是一种轻量级的提示方式，用于在界面上短暂地展示一些信息，不影响用户操作。
     * 这里使用了固定的提示文本 '这是一个toast'，在实际应用中，可以根据需要动态设置提示文本。
     */
    MiniGameManager.prototype.onShowToast = function () {
        MiniGameSdk_1.MiniGameSdk.API.showToast('这是一个toast');
    };
    /**
     * 触发设备振动功能。
     *
     * 该方法用于调用MiniGameSdk提供的API，以实现设备的振动功能。当需要提醒用户或提供触觉反馈时，可以调用此方法。
     * 例如，在游戏或应用中，当用户完成特定操作或发生特定事件时，可以通过振动给予用户反馈。
     *
     * @remarks
     * 此方法无参数，也不返回任何值。
     */
    MiniGameManager.prototype.onVirbrate = function () {
        MiniGameSdk_1.MiniGameSdk.API.vibrate();
    };
    /**
     * 重新启动游戏实例。
     *
     * 此函数调用MiniGameSdk中的API重新启动游戏。重新启动操作可能是为了初始化游戏环境、重置游戏状态或处理其他需要重启的场景。
     * 调用此函数后，游戏将会重新开始，当前的游戏状态将会被清除。
     *
     * @remarks
     * 此函数不接受任何参数。
     *
     * @returns 无返回值。
     */
    MiniGameManager.prototype.onReboot = function () {
        MiniGameSdk_1.MiniGameSdk.API.reboot();
    };
    /**
     * 当前函数用于在迷你游戏中实现退出功能。
     * 它调用了MiniGameSdk提供的API方法来触发退出操作。
     * 该方法通常在需要结束当前迷你游戏或返回到上一级菜单时被调用。
     */
    MiniGameManager.prototype.onExit = function () {
        MiniGameSdk_1.MiniGameSdk.API.exit();
    };
    /**
     * 显示分享菜单。
     *
     * 通过调用MiniGameSdk的API方法，触发显示分享菜单的操作。此函数旨在提供一个统一的入口，
     * 以便在需要时轻松调用分享功能，而无需直接与具体的SDK接口交互。
     *
     * @remarks
     * 此方法不接受任何参数，也不返回任何值。
     */
    MiniGameManager.prototype.onShowShareMenu = function () {
        MiniGameSdk_1.MiniGameSdk.API.showShareMenu();
    };
    /**
     * 导航到指定的小游戏。
     *
     * 本函数用于触发导航到一个特定的小游戏。这需要提供目标小游戏的ID，
     * 以便系统能够正确地将用户重定向到目标小游戏。
     *
     * 注意：这里的'xxx'是占位符，实际使用时需要替换为具体的小游戏ID。
     */
    MiniGameManager.prototype.onNavigate = function () {
        MiniGameSdk_1.MiniGameSdk.API.navigateTo('xxx'); // xxx替换为你的小游戏id
    };
    /**
     * 激活字节跳动入口视图。
     *
     * 此方法用于将字节跳动入口视图设置为活跃状态。当需要在用户界面中显示字节跳动的入口时，
     * 可以调用此方法来激活相应的视图元素，使其对用户可见。
     */
    MiniGameManager.prototype.onBytedanceEntranceView = function () {
        // this.entranceView.active = true;
    };
    /**
     * 请求登录代码
     *
     * 本函数用于触发小程序的登录流程，获取微信或头条等第三方平台的登录代码。
     * 这些代码可以用于后续的用户身份验证和数据同步流程。
     */
    MiniGameManager.prototype.onGetLoginCode = function () {
        // 调用MiniGameSdk的API登录方法，传入一个回调函数处理登录结果
        MiniGameSdk_1.MiniGameSdk.API.login(function (code, anonymousCode) {
            // 打印微信或头条的登录代码
            console.log('Wechat Or Bytedance Code:', code);
            // 打印头条的匿名登录代码
            // console.log('Bytedance Anonymous Code:', anonymousCode);
            if (code) {
                // cc.fx.GameTool.getUserId(code, data => this.setUserId(data)); 
            }
        });
    };
    // setUserId(data){
    //     cc.fx.GameConfig.GM_INFO.userId = data.data.userId;
    //     MiniGameSdk.API.getUserInfo(this.setUserInfo);
    // }
    // setUserInfo(data){
    //     console.log("获取到的用户信息",data.userInfo);
    //     var useData = {
    //         "gameId": cc.fx.GameConfig.GM_INFO.gameId,
    //         "userId": cc.fx.GameConfig.GM_INFO.userId,
    //         "nickName":data.userInfo.nickName,
    //         "pic": data.userInfo.avatarUrl
    //     }
    //     console.log("即将上传的用户信息:",cc.fx.GameConfig.GM_INFO.userId,data.userInfo.nickName,data.userInfo.avatarUrl);
    //     console.log("Post数据:",useData);
    //     cc.fx.GameTool.setUserInfo(useData,(res)=>{
    //         console.log("上传成功:",res);
    //     });
    // }
    /**
     * 创建并显示游戏圈按钮
     *
     * 本函数通过调用MiniGameSdk的GameClub实例方法，实现游戏俱乐部的创建和显示。
     * 它首先配置俱乐部的图标类型和位置大小，然后创建俱乐部，最后显示俱乐部。
     * 这样做是为了在小游戏内创建并展示一个游戏俱乐部的图标，供玩家加入或互动。
     */
    MiniGameManager.prototype.onCreateClub = function () {
        // 配置俱乐部图标为绿色，设置图标的位置为顶部200像素，左侧0像素
        MiniGameSdk_1.MiniGameSdk.GameClub.instance.create(MiniGameSdk_1.MiniGameSdk.EGameClubIcon.GREEN, { top: 200, left: 0 }, { width: 50, height: 50 });
        // 显示游戏俱乐部图标
        MiniGameSdk_1.MiniGameSdk.GameClub.instance.show();
    };
    var MiniGameManager_1;
    __decorate([
        property(cc.Node)
    ], MiniGameManager.prototype, "entranceView", void 0);
    MiniGameManager = MiniGameManager_1 = __decorate([
        ccclass
    ], MiniGameManager);
    return MiniGameManager;
}(cc.Component));
exports.MiniGameManager = MiniGameManager;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 26284 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/Barrier.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '90c37YHUUVPsY0mlNmom67u', 'Barrier');
// Script/Barrier.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var Map_1 = require("./Map");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var Block = /** @class */ (function (_super) {
    __extends(Block, _super);
    function Block() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        // 新增缓存变量
        _this.selfBoxColliders = [];
        _this.allBoxColliders = [];
        // @property({
        //     tooltip: '碰撞形状，None就是无敌，不参与碰撞',
        //     type: cc.Enum(BlockType),
        //     // default: BlockType.Nomal,
        //     displayName: '碰撞形状'
        // })
        // LIFE-CYCLE CALLBACKS:
        // @property(cc.SpriteAtlas)
        // UI: cc.SpriteAtlas = null;
        _this.initialTouchOffset = null;
        _this.offsetTolerance = 100; // 偏移容忍度; 
        _this.touchPoint = null; //触摸点
        _this.isTouch = false; //是否触摸
        _this.posX = 0; //地图块的X坐标
        _this.posY = 0; //地图块的Y坐标
        _this.moveLeft = true; //是否可以左移;
        _this.moveRight = true; //是否可以右移;
        _this.moveUp = true; //是否可以上移;
        _this.moveDown = true; //是否可以下移;
        _this.moveCorner = 0; //是否碰撞角落
        _this.moveY = 0; //是否可以上下移动;
        _this.moveX = 0; //是否可以左右移动;
        _this.touchPointX = 0; //触摸点X坐标;
        _this.touchPointY = 0; //触摸点Y坐标;
        _this.blockId = 0; //方块ID;
        _this.level = 0; //叠加方块层数;
        _this.pz = false;
        return _this;
    }
    Block.prototype.onLoad = function () {
        // this.node.on(cc.Node.EventType.TOUCH_START, this.touchStart, this);
        // this.node.on(cc.Node.EventType.TOUCH_MOVE, this.touchMove, this);  
        // this.node.on(cc.Node.EventType.TOUCH_CANCEL, this.touchEnd, this);  
        // this.node.on(cc.Node.EventType.TOUCH_END, this.touchEnd, this);  
        this.pz = false;
        this.stacking = cc.v2(0, 0);
        // this.selfBoxColliders = this.node.getComponentsInChildren(cc.BoxCollider)
        // .filter(collider => collider.tag < 4);
    };
    Block.prototype.start = function () {
    };
    Block.prototype.jsonDeepClone = function (obj) {
        return JSON.parse(JSON.stringify(obj));
    };
    Block.prototype.init = function (block_Info, posX, posY, node) {
        this.block_Info = this.jsonDeepClone(block_Info);
        var mapInfo = Map_1.default._instance.mapInfo;
        console.log("block_Info", this.block_Info);
        for (var i = 0; i < mapInfo.length; i++) {
            var blockRect = mapInfo[i].getBoundingBox();
            // 使用 cc.Intersection.pointInRect 方法判断点是否在矩形范围内
            var point = cc.v2(this.node.position.x - 5, this.node.position.y + 10);
            if (blockRect.contains(point)) {
                this.posX = mapInfo[i].getComponent("MapBlock").posX;
                this.posY = mapInfo[i].getComponent("MapBlock").posY;
                this.level = 50 + this.posX - this.posY * 3;
                this.node.zIndex = this.level;
                this.node.x = mapInfo[i].x + 65;
                this.node.y = mapInfo[i].y - 60;
                i = 10000;
                break;
            }
        }
    };
    Block = __decorate([
        ccclass
    ], Block);
    return Block;
}(cc.Component));
exports.default = Block;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 8660 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/prop/Freeze.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'ad8cbbzCohCR5uifssdRTf+', 'Freeze');
// Script/prop/Freeze.ts

"use strict";
// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var NumberToImage_1 = require("../NumberToImage");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var Freeze = /** @class */ (function (_super) {
    __extends(Freeze, _super);
    function Freeze() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.time = 60;
        _this.freeze = null;
        return _this;
        // update (dt) {}
    }
    // mapInfo: number[][] = [];
    Freeze.prototype.onLoad = function () {
    };
    Freeze.prototype.start = function () {
    };
    Freeze.prototype.init = function (time, type) {
        if (time)
            this.time = time;
        this.node.getChildByName("time").active = true;
        NumberToImage_1.default.numberToImageNodes(this.time, 40, 25, "ice_", this.node.getChildByName("time"), false);
        // this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString();
    };
    Freeze.prototype.reduce = function (number) {
        var _this = this;
        this.time -= number;
        if (this.time <= 0)
            this.time = 0;
        NumberToImage_1.default.numberToImageNodes(this.time, 40, 25, "ice_", this.node.getChildByName("time"), false);
        // this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString();
        if (this.time <= 0) {
            this.node.getChildByName("bingkuai").active = true;
            var skeleton = this.node.getChildByName("bingkuai").getComponent(sp.Skeleton);
            skeleton.setAnimation(1, "bingkuai", false);
            this.node.getChildByName("icon").active = true;
            this.node.getChildByName("time").active = false;
            cc.tween(this.node.getChildByName("icon"))
                .to(0.5, { opacity: 0 })
                .start();
            // this.node.getChildByName("icon").getComponent(cc.Sprite).setMaterial(0,this.freeze);
            // this.node.children.forEach(element => {
            //     element.destroy();
            // });
            setTimeout(function () {
                _this.node.parent.getComponent("Block").resetFreeze();
                _this.node.destroy();
                _this.node.removeFromParent();
            }, 600);
        }
    };
    __decorate([
        property(cc.Material)
    ], Freeze.prototype, "freeze", void 0);
    Freeze = __decorate([
        ccclass
    ], Freeze);
    return Freeze;
}(cc.Component));
exports.default = Freeze;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 6132 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/prop/Key.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '92465qnUTJDw5STq1t7oelo', 'Key');
// Script/prop/Key.ts

"use strict";
// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var Map_1 = require("../Map");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var Key = /** @class */ (function (_super) {
    __extends(Key, _super);
    function Key() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.time = 60;
        return _this;
        // update (dt) {}
    }
    // mapInfo: number[][] = [];
    Key.prototype.onLoad = function () {
    };
    Key.prototype.start = function () {
    };
    Key.prototype.init = function (time) {
        if (time)
            this.time = time;
        this.node.getChildByName("time").active = true;
        this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString();
        this.schedule(this.updateTime, 1);
    };
    Key.prototype.updateTime = function () {
        this.time--;
        this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString();
        if (this.time <= 0) {
            this.unschedule(this.updateTime);
            this.node.destroy();
            Map_1.default._instance.failLevel();
            // this.node.destroy();
        }
    };
    Key = __decorate([
        ccclass
    ], Key);
    return Key;
}(cc.Component));
exports.default = Key;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcU2NyaXB0XFxwcm9wXFxLZXkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLG9CQUFvQjtBQUNwQix3RUFBd0U7QUFDeEUsbUJBQW1CO0FBQ25CLGtGQUFrRjtBQUNsRiw4QkFBOEI7QUFDOUIsa0ZBQWtGOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFFbEYsOEJBQWlDO0FBRTNCLElBQUEsS0FBc0IsRUFBRSxDQUFDLFVBQVUsRUFBbEMsT0FBTyxhQUFBLEVBQUUsUUFBUSxjQUFpQixDQUFDO0FBSzFDO0lBQWlDLHVCQUFZO0lBQTdDO1FBQUEscUVBaUNDO1FBL0JHLFVBQUksR0FBVyxFQUFFLENBQUM7O1FBOEJsQixpQkFBaUI7SUFDckIsQ0FBQztJQTdCRyw0QkFBNEI7SUFFNUIsb0JBQU0sR0FBTjtJQUVBLENBQUM7SUFFRCxtQkFBSyxHQUFMO0lBQ0EsQ0FBQztJQUVELGtCQUFJLEdBQUosVUFBSyxJQUFJO1FBQ0wsSUFBRyxJQUFJO1lBQUUsSUFBSSxDQUFDLElBQUksR0FBRyxJQUFJLENBQUM7UUFDMUIsSUFBSSxDQUFDLElBQUksQ0FBQyxjQUFjLENBQUMsTUFBTSxDQUFDLENBQUMsTUFBTSxHQUFHLElBQUksQ0FBQztRQUMvQyxJQUFJLENBQUMsSUFBSSxDQUFDLGNBQWMsQ0FBQyxNQUFNLENBQUMsQ0FBQyxZQUFZLENBQUMsRUFBRSxDQUFDLEtBQUssQ0FBQyxDQUFDLE1BQU0sR0FBRyxJQUFJLENBQUMsSUFBSSxDQUFDLFFBQVEsRUFBRSxDQUFDO1FBQ3RGLElBQUksQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDLFVBQVUsRUFBRSxDQUFDLENBQUMsQ0FBQztJQUN0QyxDQUFDO0lBR0Qsd0JBQVUsR0FBVjtRQUNJLElBQUksQ0FBQyxJQUFJLEVBQUcsQ0FBQztRQUNiLElBQUksQ0FBQyxJQUFJLENBQUMsY0FBYyxDQUFDLE1BQU0sQ0FBQyxDQUFDLFlBQVksQ0FBQyxFQUFFLENBQUMsS0FBSyxDQUFDLENBQUMsTUFBTSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsUUFBUSxFQUFFLENBQUM7UUFDdEYsSUFBRyxJQUFJLENBQUMsSUFBSSxJQUFJLENBQUMsRUFBQztZQUNkLElBQUksQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLFVBQVUsQ0FBQyxDQUFDO1lBQ2pDLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTyxFQUFFLENBQUM7WUFDcEIsYUFBVyxDQUFDLFNBQVMsQ0FBQyxTQUFTLEVBQUUsQ0FBQztZQUNsQyx1QkFBdUI7U0FDMUI7SUFDTCxDQUFDO0lBOUJnQixHQUFHO1FBRHZCLE9BQU87T0FDYSxHQUFHLENBaUN2QjtJQUFELFVBQUM7Q0FqQ0QsQUFpQ0MsQ0FqQ2dDLEVBQUUsQ0FBQyxTQUFTLEdBaUM1QztrQkFqQ29CLEdBQUciLCJmaWxlIjoiIiwic291cmNlUm9vdCI6Ii8iLCJzb3VyY2VzQ29udGVudCI6WyIvLyBMZWFybiBUeXBlU2NyaXB0OlxyXG4vLyAgLSBodHRwczovL2RvY3MuY29jb3MuY29tL2NyZWF0b3IvbWFudWFsL2VuL3NjcmlwdGluZy90eXBlc2NyaXB0Lmh0bWxcclxuLy8gTGVhcm4gQXR0cmlidXRlOlxyXG4vLyAgLSBodHRwczovL2RvY3MuY29jb3MuY29tL2NyZWF0b3IvbWFudWFsL2VuL3NjcmlwdGluZy9yZWZlcmVuY2UvYXR0cmlidXRlcy5odG1sXHJcbi8vIExlYXJuIGxpZmUtY3ljbGUgY2FsbGJhY2tzOlxyXG4vLyAgLSBodHRwczovL2RvY3MuY29jb3MuY29tL2NyZWF0b3IvbWFudWFsL2VuL3NjcmlwdGluZy9saWZlLWN5Y2xlLWNhbGxiYWNrcy5odG1sXHJcblxyXG5pbXBvcnQgTWFwQ29ucm9sZXIgZnJvbSBcIi4uL01hcFwiO1xyXG5cclxuY29uc3Qge2NjY2xhc3MsIHByb3BlcnR5fSA9IGNjLl9kZWNvcmF0b3I7XHJcblxyXG5cclxuXHJcbkBjY2NsYXNzXHJcbmV4cG9ydCBkZWZhdWx0IGNsYXNzIEtleSBleHRlbmRzIGNjLkNvbXBvbmVudCB7XHJcbiAgICBzdGF0aWMgX2luc3RhbmNlOiBhbnk7XHJcbiAgICB0aW1lOiBudW1iZXIgPSA2MDtcclxuXHJcbiAgICAvLyBtYXBJbmZvOiBudW1iZXJbXVtdID0gW107XHJcblxyXG4gICAgb25Mb2FkICgpIHtcclxuXHJcbiAgICB9IFxyXG5cclxuICAgIHN0YXJ0ICgpIHtcclxuICAgIH1cclxuXHJcbiAgICBpbml0KHRpbWUpe1xyXG4gICAgICAgIGlmKHRpbWUpIHRoaXMudGltZSA9IHRpbWU7XHJcbiAgICAgICAgdGhpcy5ub2RlLmdldENoaWxkQnlOYW1lKFwidGltZVwiKS5hY3RpdmUgPSB0cnVlO1xyXG4gICAgICAgIHRoaXMubm9kZS5nZXRDaGlsZEJ5TmFtZShcInRpbWVcIikuZ2V0Q29tcG9uZW50KGNjLkxhYmVsKS5zdHJpbmcgPSB0aGlzLnRpbWUudG9TdHJpbmcoKTtcclxuICAgICAgICB0aGlzLnNjaGVkdWxlKHRoaXMudXBkYXRlVGltZSwgMSk7XHJcbiAgICB9XHJcblxyXG4gICAgXHJcbiAgICB1cGRhdGVUaW1lKCl7XHJcbiAgICAgICAgdGhpcy50aW1lIC0tO1xyXG4gICAgICAgIHRoaXMubm9kZS5nZXRDaGlsZEJ5TmFtZShcInRpbWVcIikuZ2V0Q29tcG9uZW50KGNjLkxhYmVsKS5zdHJpbmcgPSB0aGlzLnRpbWUudG9TdHJpbmcoKTtcclxuICAgICAgICBpZih0aGlzLnRpbWUgPD0gMCl7XHJcbiAgICAgICAgICAgIHRoaXMudW5zY2hlZHVsZSh0aGlzLnVwZGF0ZVRpbWUpO1xyXG4gICAgICAgICAgICB0aGlzLm5vZGUuZGVzdHJveSgpO1xyXG4gICAgICAgICAgICBNYXBDb25yb2xlci5faW5zdGFuY2UuZmFpbExldmVsKCk7XHJcbiAgICAgICAgICAgIC8vIHRoaXMubm9kZS5kZXN0cm95KCk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIC8vIHVwZGF0ZSAoZHQpIHt9XHJcbn1cclxuIl19
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/lq_collide_system/lq_collide_system.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '81314mE3BdESr87SAFK9cqv', 'lq_collide_system');
// Script/lq_collide_system/lq_collide_system.js

/*Obfuscated by JShaman.com*/'use strict';

exports['__esModule'] = !![];
exports['LQCollideSystem'] = void 0x0;
var lq_const_1 = require('../lq_base/data/lq_const');
var lq_math_util_1 = require('../lq_base/util/lq_math_util');
var lq_collide_config_1 = require('./lq_collide_config');
var lq_data_1 = require('../lq_base/data/lq_data');
var Vec2 = cc['Vec2'];
var game = cc['game'];
var director = cc['director'];
var Scheduler = cc['Scheduler'];
var misc = cc['misc'];
var LQQuadTree = function () {
  function _0x56565e(_0x3d3a0e, _0x3fb055, _0x20ce04, _0x406033) {
    this['collide_arr'] = [];
    this['node_arr'] = [];
    this['max_object'] = _0x3fb055 || 0xa;
    this['max_level'] = _0x20ce04 || 0x4;
    this['level'] = _0x406033 || 0x0;
    this['rect'] = _0x3d3a0e;
    this['collide_arr'] = [];
    this['node_arr'] = [];
  }
  _0x56565e['prototype']['split'] = function () {
    var _0x32a9cb = this['level'] + 0x1;
    var _0x178d81 = this['rect']['width'] * 0.5;
    var _0x1d1d97 = this['rect']['height'] * 0.5;
    var _0x5f5093 = this['rect']['x'];
    var _0x3269c2 = this['rect']['y'];
    this['node_arr'][0x0] = new _0x56565e(new lq_data_1['LQRect'](_0x5f5093 + _0x178d81, _0x3269c2, _0x178d81, _0x1d1d97), this['max_object'], this['max_level'], _0x32a9cb);
    this['node_arr'][0x1] = new _0x56565e(new lq_data_1['LQRect'](_0x5f5093, _0x3269c2, _0x178d81, _0x1d1d97), this['max_object'], this['max_level'], _0x32a9cb);
    this['node_arr'][0x2] = new _0x56565e(new lq_data_1['LQRect'](_0x5f5093, _0x3269c2 + _0x1d1d97, _0x178d81, _0x1d1d97), this['max_object'], this['max_level'], _0x32a9cb);
    this['node_arr'][0x3] = new _0x56565e(new lq_data_1['LQRect'](_0x5f5093 + _0x178d81, _0x3269c2 + _0x1d1d97, _0x178d81, _0x1d1d97), this['max_object'], this['max_level'], _0x32a9cb);
  };
  _0x56565e['prototype']['get_index'] = function (_0x59d6ec) {
    var _0x1dc547 = [];
    var _0x2ea7cd = this['rect']['x'] + this['rect']['half_width'];
    var _0x5e97b7 = this['rect']['y'] + this['rect']['half_height'];
    var _0x241f59 = _0x59d6ec['world_rect']['y'] + _0x59d6ec['world_rect']['half_height'] > _0x5e97b7;
    var _0x437790 = _0x59d6ec['world_rect']['x'] - _0x59d6ec['world_rect']['half_width'] < _0x2ea7cd;
    var _0x5e6619 = _0x59d6ec['world_rect']['x'] + _0x59d6ec['world_rect']['half_width'] > _0x2ea7cd;
    var _0x3b42aa = _0x59d6ec['world_rect']['y'] - _0x59d6ec['world_rect']['half_height'] < _0x5e97b7;
    if (_0x5e6619 && _0x241f59) {
      _0x1dc547['push'](0x0);
    }
    if (_0x437790 && _0x241f59) {
      _0x1dc547['push'](0x1);
    }
    if (_0x437790 && _0x3b42aa) {
      _0x1dc547['push'](0x2);
    }
    if (_0x3b42aa && _0x5e6619) {
      _0x1dc547['push'](0x3);
    }
    return _0x1dc547;
  };
  ;
  _0x56565e['prototype']['insert'] = function (_0x32f23a) {
    var _0x3850fe;
    if (this['node_arr']['length']) {
      _0x3850fe = this['get_index'](_0x32f23a);
      for (var _0x4856cf = 0x0; _0x4856cf < _0x3850fe['length']; _0x4856cf++) {
        this['node_arr'][_0x3850fe[_0x4856cf]]['insert'](_0x32f23a);
      }
      return;
    }
    this['collide_arr']['push'](_0x32f23a);
    if (this['collide_arr']['length'] > this['max_object'] && this['level'] < this['max_level']) {
      if (!this['node_arr']['length']) {
        this['split']();
      }
      for (var _0x4856cf = 0x0; _0x4856cf < this['collide_arr']['length']; _0x4856cf++) {
        var _0x2d136c = this['collide_arr'][_0x4856cf];
        _0x3850fe = this['get_index'](_0x2d136c);
        for (var _0x1e9f35 = 0x0; _0x1e9f35 < _0x3850fe['length']; _0x1e9f35++) {
          this['node_arr'][_0x3850fe[_0x1e9f35]]['insert'](_0x2d136c);
        }
      }
      this['collide_arr'] = [];
    }
  };
  ;
  _0x56565e['prototype']['retrieve'] = function (_0x77a71) {
    var _0xaa8c7a;
    var _0x42264c = this['get_index'](_0x77a71);
    if (this['collide_arr']['length']) {
      (_0xaa8c7a = _0x56565e['temp_collide_arr'])['push']['apply'](_0xaa8c7a, this['collide_arr']);
    }
    if (this['node_arr']['length']) {
      for (var _0x4c3497 = 0x0; _0x4c3497 < _0x42264c['length']; _0x4c3497++) {
        this['node_arr'][_0x42264c[_0x4c3497]]['retrieve'](_0x77a71);
      }
    }
  };
  ;
  _0x56565e['prototype']['get_all_area'] = function () {
    if (this['collide_arr']['length']) {
      _0x56565e['all_collide_arr']['push'](this['collide_arr']);
    }
    if (this['node_arr']['length']) {
      for (var _0x3d5c9f = 0x0; _0x3d5c9f < 0x4; _0x3d5c9f++) {
        this['node_arr'][_0x3d5c9f]['get_all_area']();
      }
    }
  };
  _0x56565e['prototype']['clear'] = function () {
    this['collide_arr'] = [];
    for (var _0x170eca = 0x0; _0x170eca < this['node_arr']['length']; _0x170eca++) {
      if (this['node_arr']['length']) {
        this['node_arr'][_0x170eca]['clear']();
      }
    }
    this['node_arr'] = [];
  };
  ;
  _0x56565e['temp_collide_arr'] = [];
  _0x56565e['all_collide_arr'] = [];
  return _0x56565e;
}();
var LQCollideSystem = function () {
  function _0x9bf60e() {}
  _0x9bf60e['cache_polygon'] = function (_0xbc3d22) {
    if (_0xbc3d22['_collide_shape'] === lq_const_1['LQCollideShape']['Rect']) {
      _0xbc3d22['cache_polygon_points'] = [];
      var _0x53235e = _0xbc3d22['world_rect']['top_left']();
      _0xbc3d22['cache_polygon_points']['push'](_0x53235e['x']);
      _0xbc3d22['cache_polygon_points']['push'](_0x53235e['y']);
      _0x53235e = _0xbc3d22['world_rect']['bottom_left']();
      _0xbc3d22['cache_polygon_points']['push'](_0x53235e['x']);
      _0xbc3d22['cache_polygon_points']['push'](_0x53235e['y']);
      _0x53235e = _0xbc3d22['world_rect']['bottom_right']();
      _0xbc3d22['cache_polygon_points']['push'](_0x53235e['x']);
      _0xbc3d22['cache_polygon_points']['push'](_0x53235e['y']);
      _0x53235e = _0xbc3d22['world_rect']['top_right']();
      _0xbc3d22['cache_polygon_points']['push'](_0x53235e['x']);
      _0xbc3d22['cache_polygon_points']['push'](_0x53235e['y']);
    } else if (_0xbc3d22['_collide_shape'] === lq_const_1['LQCollideShape']['Polygon']) {
      _0xbc3d22['cache_polygon_points'] = [];
      if (_0xbc3d22['node']['angle'] == 0x0) {
        for (var _0x2f1e6c = 0x0; _0x2f1e6c < _0xbc3d22['_polygon_points']['length']; _0x2f1e6c++) {
          var _0x53235e = _0xbc3d22['world_rect']['add'](_0xbc3d22['_polygon_points'][_0x2f1e6c]);
          _0xbc3d22['cache_polygon_points']['push'](_0x53235e['x']);
          _0xbc3d22['cache_polygon_points']['push'](_0x53235e['y']);
        }
      } else {
        var _0x1be630 = misc['degreesToRadians'](_0xbc3d22['node']['angle']);
        var _0x1a0598 = Math['sin'](_0x1be630);
        var _0x25967e = Math['cos'](_0x1be630);
        var _0xfbf241 = function _0xfbf241(_0x5ed3a5) {
          return new Vec2(_0x5ed3a5['x'] * _0x25967e - _0x5ed3a5['y'] * _0x1a0598 + _0xbc3d22['world_rect']['x'], _0x5ed3a5['x'] * _0x1a0598 + _0x5ed3a5['y'] * _0x25967e + _0xbc3d22['world_rect']['y']);
        };
        for (var _0x2f1e6c = 0x0; _0x2f1e6c < _0xbc3d22['_polygon_points']['length']; _0x2f1e6c++) {
          var _0x53235e = _0xfbf241(_0xbc3d22['_polygon_points'][_0x2f1e6c]);
          _0xbc3d22['cache_polygon_points']['push'](_0x53235e['x']);
          _0xbc3d22['cache_polygon_points']['push'](_0x53235e['y']);
        }
      }
    }
  };
  _0x9bf60e['_updateWorldMatrix'] = function (_0x296a1a) {
    if (_0x296a1a['_parent']) {
      _0x9bf60e['_updateWorldMatrix'](_0x296a1a['_parent']);
    }
    if (_0x296a1a['_worldMatDirty']) {
      this['tmp_bool'] = !![];
      _0x296a1a['_calculWorldMatrix']();
      var _0x3d1ca2 = _0x296a1a['_children'];
      for (var _0x2b4ec9 = 0x0, _0x600367 = _0x3d1ca2['length']; _0x2b4ec9 < _0x600367; _0x2b4ec9++) {
        _0x3d1ca2[_0x2b4ec9]['_worldMatDirty'] = !![];
      }
    }
  };
  _0x9bf60e['transformMat4'] = function (_0x5d68b5, _0x2c4dd0, _0x190f88) {
    var _0x523dc8 = _0x190f88['m'];
    _0x5d68b5['x'] = _0x523dc8[0x0] * _0x2c4dd0['x'] + _0x523dc8[0x4] * _0x2c4dd0['y'] + _0x523dc8[0xc];
    _0x5d68b5['y'] = _0x523dc8[0x1] * _0x2c4dd0['x'] + _0x523dc8[0x5] * _0x2c4dd0['y'] + _0x523dc8[0xd];
    return _0x5d68b5;
  };
  _0x9bf60e['update_world_rect'] = function (_0x264b72) {
    if (!_0x264b72['world_rect']) {
      return;
    }
    this['tmp_bool'] = ![];
    this['_updateWorldMatrix'](_0x264b72['node']);
    if (this['tmp_bool']) {
      _0x264b72['cache_polygon_points'] = undefined;
    }
    _0x9bf60e['transformMat4'](_0x264b72['world_rect'], _0x264b72['_offset'], _0x264b72['node']['_worldMatrix']);
  };
  _0x9bf60e['update_collide_logic'] = function (_0x1b9a2c) {
    if (_0x1b9a2c['is_open_func']) {
      for (var _0x1d8d8c in _0x1b9a2c['collide_map']) {
        var _0x1406b5 = _0x1b9a2c['collide_map'][_0x1d8d8c];
        if (_0x1406b5['status'] === 0x1) {
          _0x1406b5['status'] = 0x2;
        } else {
          delete _0x1b9a2c['collide_map'][_0x1d8d8c];
          _0x1b9a2c['on_exit'](_0x1406b5['collide']);
        }
      }
    }
    _0x1b9a2c['update_lq_collide']();
  };
  _0x9bf60e['collide_other'] = function (_0x64f064, _0x3becdd) {
    if (_0x64f064['is_open_func']) {
      var _0x45b029 = _0x64f064['collide_map'][_0x3becdd['collide_id']];
      if (_0x45b029) {
        _0x45b029['status'] = 0x1;
      } else {
        _0x64f064['collide_map'][_0x3becdd['collide_id']] = {
          'collide': _0x3becdd,
          'status': 0x1
        };
        _0x64f064['on_enter'](_0x3becdd);
      }
    }
    if (_0x3becdd['is_open_func']) {
      var _0x544a5c = _0x3becdd['collide_map'][_0x64f064['collide_id']];
      if (_0x544a5c) {
        _0x544a5c['status'] = 0x1;
      } else {
        _0x3becdd['collide_map'][_0x64f064['collide_id']] = {
          'collide': _0x64f064,
          'status': 0x1
        };
        _0x3becdd['on_enter'](_0x64f064);
      }
    }
    _0x64f064['on_collide'](_0x3becdd);
    _0x3becdd['on_collide'](_0x64f064);
  };
  _0x9bf60e['add_collide'] = function (_0x2e897d) {
    this['update_world_rect'](_0x2e897d);
    this['collide_arr']['push'](_0x2e897d);
  };
  _0x9bf60e['remove_collide'] = function (_0x416298) {
    for (var _0x12059a = this['collide_arr']['length'] - 0x1; _0x12059a >= 0x0; _0x12059a--) {
      if (this['collide_arr'][_0x12059a]['collide_id'] === _0x416298['collide_id']) {
        this['collide_arr']['splice'](_0x12059a, 0x1);
        break;
      }
    }
  };
  _0x9bf60e['line_point'] = function (_0x4a7370, _0x24c7a1, _0x4e18ee, _0x122356, _0x2bd713, _0x2d3b6e) {
    return Math['abs'](this['distanceSquared'](_0x4a7370, _0x24c7a1, _0x4e18ee, _0x122356) - (this['distanceSquared'](_0x4a7370, _0x24c7a1, _0x2bd713, _0x2d3b6e) + this['distanceSquared'](_0x4e18ee, _0x122356, _0x2bd713, _0x2d3b6e))) <= 0x1;
  };
  _0x9bf60e['distanceSquared'] = function (_0x5cca3b, _0x11b678, _0x1f0b63, _0x52cec7) {
    return Math['sqrt'](Math['pow'](_0x5cca3b - _0x1f0b63, 0x2) + Math['pow'](_0x11b678 - _0x52cec7, 0x2));
  };
  _0x9bf60e['polygon_point'] = function (_0x4236c0, _0x12e825, _0x5cd4dd) {
    var _0xbd6fd0 = _0x4236c0['length'];
    var _0x1f4fbc = ![];
    var _0x267b58, _0x4a1bae;
    for (_0x267b58 = 0x0, _0x4a1bae = _0xbd6fd0 - 0x2; _0x267b58 < _0xbd6fd0; _0x267b58 += 0x2) {
      if (_0x4236c0[_0x267b58 + 0x1] > _0x5cd4dd !== _0x4236c0[_0x4a1bae + 0x1] > _0x5cd4dd && _0x12e825 < (_0x4236c0[_0x4a1bae] - _0x4236c0[_0x267b58]) * (_0x5cd4dd - _0x4236c0[_0x267b58 + 0x1]) / (_0x4236c0[_0x4a1bae + 0x1] - _0x4236c0[_0x267b58 + 0x1]) + _0x4236c0[_0x267b58]) {
        _0x1f4fbc = !_0x1f4fbc;
      }
      _0x4a1bae = _0x267b58;
    }
    if (_0x1f4fbc) {
      return !![];
    }
    for (_0x267b58 = 0x0; _0x267b58 < _0xbd6fd0; _0x267b58 += 0x2) {
      var _0x574e3e = _0x4236c0[_0x267b58];
      var _0x4b92d8 = _0x4236c0[_0x267b58 + 0x1];
      var _0x5d39d4 = void 0x0,
        _0x124e9c = void 0x0;
      if (_0x267b58 === _0xbd6fd0 - 0x2) {
        _0x5d39d4 = _0x4236c0[0x0];
        _0x124e9c = _0x4236c0[0x1];
      } else {
        _0x5d39d4 = _0x4236c0[_0x267b58 + 0x2];
        _0x124e9c = _0x4236c0[_0x267b58 + 0x3];
      }
      if (this['line_point'](_0x574e3e, _0x4b92d8, _0x5d39d4, _0x124e9c, _0x12e825, _0x5cd4dd)) {
        return !![];
      }
    }
    return ![];
  };
  _0x9bf60e['polygon_circle'] = function (_0x387188, _0x611012, _0x3707e8, _0x2432e1) {
    if (this['polygon_point'](_0x387188, _0x611012, _0x3707e8)) {
      return !![];
    }
    var _0x197657 = _0x387188['length'];
    for (var _0x3df6fc = 0x0; _0x3df6fc < _0x197657 - 0x2; _0x3df6fc += 0x2) {
      if (this['line_circle'](_0x387188[_0x3df6fc], _0x387188[_0x3df6fc + 0x1], _0x387188[_0x3df6fc + 0x2], _0x387188[_0x3df6fc + 0x3], _0x611012, _0x3707e8, _0x2432e1)) {
        return !![];
      }
    }
    return this['line_circle'](_0x387188[0x0], _0x387188[0x1], _0x387188[_0x197657 - 0x2], _0x387188[_0x197657 - 0x1], _0x611012, _0x3707e8, _0x2432e1);
  };
  _0x9bf60e['line_circle'] = function (_0x12bba1, _0x321290, _0x136703, _0x537e0e, _0x3ad147, _0x559a7d, _0x48a834) {
    var _0x3bfd94 = [_0x3ad147 - _0x12bba1, _0x559a7d - _0x321290];
    var _0x6da620 = [_0x136703 - _0x12bba1, _0x537e0e - _0x321290];
    var _0x1feda4 = this['dot'](_0x6da620, _0x6da620);
    var _0x53913d = this['dot'](_0x3bfd94, _0x6da620);
    var _0x3674f5 = _0x53913d / _0x1feda4;
    _0x3674f5 = _0x3674f5 < 0x0 ? 0x0 : _0x3674f5;
    _0x3674f5 = _0x3674f5 > 0x1 ? 0x1 : _0x3674f5;
    var _0x150033 = [_0x6da620[0x0] * _0x3674f5 + _0x12bba1 - _0x3ad147, _0x6da620[0x1] * _0x3674f5 + _0x321290 - _0x559a7d];
    var _0x442af1 = this['dot'](_0x150033, _0x150033);
    return _0x442af1 <= _0x48a834 * _0x48a834;
  };
  _0x9bf60e['dot'] = function (_0x1e79a5, _0x179c92) {
    return _0x1e79a5[0x0] * _0x179c92[0x0] + _0x1e79a5[0x1] * _0x179c92[0x1];
  };
  _0x9bf60e['update_logic'] = function (_0xb17278) {
    if (!this['is_enable']) {
      return;
    }
    if (lq_collide_config_1['LQCollideConfig']['switch_quad_tree']) {
      this['quad_tree']['clear']();
      for (var _0x1337bd = this['collide_arr']['length'] - 0x1; _0x1337bd >= 0x0; _0x1337bd--) {
        var _0x20181e = this['collide_arr'][_0x1337bd];
        if (!_0x20181e) {
          return;
        }
        if (!_0x20181e['isValid']) {
          this['collide_arr']['splice'](_0x1337bd, 0x1);
          continue;
        }
        this['update_collide_logic'](_0x20181e);
        if (_0x20181e['is_enable']) {
          this['update_world_rect'](_0x20181e);
          this['quad_tree']['insert'](_0x20181e);
        }
      }
      LQQuadTree['all_collide_arr'] = [];
      this['quad_tree']['get_all_area']();
      for (var _0x4af6ff = 0x0; _0x4af6ff < LQQuadTree['all_collide_arr']['length']; _0x4af6ff++) {
        var _0x5cac71 = LQQuadTree['all_collide_arr'][_0x4af6ff];
        for (var _0x1337bd = 0x0; _0x1337bd < _0x5cac71['length']; _0x1337bd++) {
          var _0x549a66 = _0x5cac71[_0x1337bd];
          for (var _0x5793ff = _0x1337bd + 0x1; _0x5793ff < _0x5cac71['length']; _0x5793ff++) {
            var _0x4740fe = _0x5cac71[_0x5793ff];
            if (_0x549a66['collide_category'] & _0x4740fe['collide_mask'] && _0x549a66 !== _0x4740fe) {
              if (_0x549a66['_collide_shape'] === 0x1 && _0x4740fe['_collide_shape'] === 0x1) {
                if (lq_math_util_1['LQMathUtil']['intersects_rect'](_0x549a66['world_rect'], _0x4740fe['world_rect'])) {
                  this['collide_other'](_0x549a66, _0x4740fe);
                }
              } else if (_0x549a66['_collide_shape'] === 0x1 && _0x4740fe['_collide_shape'] === 0x2) {
                if (lq_math_util_1['LQMathUtil']['intersects_circle_rect'](_0x4740fe['world_rect'], _0x4740fe['radius'], _0x549a66['world_rect'])) {
                  this['collide_other'](_0x549a66, _0x4740fe);
                }
              } else if (_0x549a66['_collide_shape'] === 0x2 && _0x4740fe['_collide_shape'] === 0x1) {
                if (lq_math_util_1['LQMathUtil']['intersects_circle_rect'](_0x549a66['world_rect'], _0x549a66['radius'], _0x4740fe['world_rect'])) {
                  this['collide_other'](_0x549a66, _0x4740fe);
                }
              } else if (_0x549a66['_collide_shape'] === 0x2 && _0x4740fe['_collide_shape'] === 0x2) {
                if (lq_math_util_1['LQMathUtil']['intersects_circle'](_0x549a66['world_rect'], _0x549a66['radius'], _0x4740fe['world_rect'], _0x4740fe['radius'])) {
                  this['collide_other'](_0x549a66, _0x4740fe);
                }
              } else if (_0x549a66['_collide_shape'] == 0x3 && _0x4740fe['_collide_shape'] == 0x2) {
                if (!_0x549a66['cache_polygon_points']) {
                  this['cache_polygon'](_0x549a66);
                }
                if (this['polygon_circle'](_0x549a66['cache_polygon_points'], _0x4740fe['world_rect']['x'], _0x4740fe['world_rect']['y'], _0x4740fe['radius'])) {
                  this['collide_other'](_0x549a66, _0x4740fe);
                }
              } else if (_0x549a66['_collide_shape'] == 0x2 && _0x4740fe['_collide_shape'] == 0x3) {
                if (!_0x4740fe['cache_polygon_points']) {
                  this['cache_polygon'](_0x4740fe);
                }
                if (this['polygon_circle'](_0x4740fe['cache_polygon_points'], _0x549a66['world_rect']['x'], _0x549a66['world_rect']['y'], _0x549a66['radius'])) {
                  this['collide_other'](_0x549a66, _0x4740fe);
                }
              } else {
                if (!_0x549a66['cache_polygon_points']) {
                  this['cache_polygon'](_0x549a66);
                }
                if (!_0x4740fe['cache_polygon_points']) {
                  this['cache_polygon'](_0x4740fe);
                }
                if (this['polygon_polygon'](_0x549a66['cache_polygon_points'], _0x4740fe['cache_polygon_points'])) {
                  this['collide_other'](_0x549a66, _0x4740fe);
                }
              }
            }
          }
        }
      }
    } else {
      var _0x5cac71 = [];
      for (var _0x1337bd = this['collide_arr']['length'] - 0x1; _0x1337bd >= 0x0; _0x1337bd--) {
        var _0x20181e = this['collide_arr'][_0x1337bd];
        if (!_0x20181e) {
          return;
        }
        if (!_0x20181e['isValid']) {
          this['collide_arr']['splice'](_0x1337bd, 0x1);
          continue;
        }
        this['update_collide_logic'](_0x20181e);
        if (_0x20181e['is_enable']) {
          this['update_world_rect'](_0x20181e);
          _0x5cac71['push'](_0x20181e);
        }
      }
      var _0x4f3337 = _0x5cac71['length'];
      for (var _0x1337bd = 0x0; _0x1337bd < _0x4f3337; _0x1337bd++) {
        var _0x549a66 = _0x5cac71[_0x1337bd];
        for (var _0x5793ff = _0x1337bd + 0x1; _0x5793ff < _0x4f3337; _0x5793ff++) {
          var _0x4740fe = _0x5cac71[_0x5793ff];
          if (_0x549a66['collide_category'] & _0x4740fe['collide_mask']) {
            if (_0x549a66['_collide_shape'] === 0x1 && _0x4740fe['_collide_shape'] === 0x1) {
              if (lq_math_util_1['LQMathUtil']['intersects_rect'](_0x549a66['world_rect'], _0x4740fe['world_rect'])) {
                this['collide_other'](_0x549a66, _0x4740fe);
              }
            } else if (_0x549a66['_collide_shape'] === 0x1 && _0x4740fe['_collide_shape'] === 0x2) {
              if (lq_math_util_1['LQMathUtil']['intersects_circle_rect'](_0x4740fe['world_rect'], _0x4740fe['radius'], _0x549a66['world_rect'])) {
                this['collide_other'](_0x549a66, _0x4740fe);
              }
            } else if (_0x549a66['_collide_shape'] === 0x2 && _0x4740fe['_collide_shape'] === 0x1) {
              if (lq_math_util_1['LQMathUtil']['intersects_circle_rect'](_0x549a66['world_rect'], _0x549a66['radius'], _0x4740fe['world_rect'])) {
                this['collide_other'](_0x549a66, _0x4740fe);
              }
            } else if (_0x549a66['_collide_shape'] === 0x2 && _0x4740fe['_collide_shape'] === 0x2) {
              if (lq_math_util_1['LQMathUtil']['intersects_circle'](_0x549a66['world_rect'], _0x549a66['radius'], _0x4740fe['world_rect'], _0x4740fe['radius'])) {
                this['collide_other'](_0x549a66, _0x4740fe);
              }
            } else if (_0x549a66['_collide_shape'] == 0x3 && _0x4740fe['_collide_shape'] == 0x2) {
              if (!_0x549a66['cache_polygon_points']) {
                this['cache_polygon'](_0x549a66);
              }
              if (this['polygon_circle'](_0x549a66['cache_polygon_points'], _0x4740fe['world_rect']['x'], _0x4740fe['world_rect']['y'], _0x4740fe['radius'])) {
                this['collide_other'](_0x549a66, _0x4740fe);
              }
            } else if (_0x549a66['_collide_shape'] == 0x2 && _0x4740fe['_collide_shape'] == 0x3) {
              if (!_0x4740fe['cache_polygon_points']) {
                this['cache_polygon'](_0x4740fe);
              }
              if (this['polygon_circle'](_0x4740fe['cache_polygon_points'], _0x549a66['world_rect']['x'], _0x549a66['world_rect']['y'], _0x549a66['radius'])) {
                this['collide_other'](_0x549a66, _0x4740fe);
              }
            } else {
              if (!_0x549a66['cache_polygon_points']) {
                this['cache_polygon'](_0x549a66);
              }
              if (!_0x4740fe['cache_polygon_points']) {
                this['cache_polygon'](_0x4740fe);
              }
              if (this['polygon_polygon'](_0x549a66['cache_polygon_points'], _0x4740fe['cache_polygon_points'])) {
                this['collide_other'](_0x549a66, _0x4740fe);
              }
            }
          }
        }
      }
    }
  };
  _0x9bf60e['polygon_polygon'] = function (_0x1a152c, _0x484cd2) {
    var _0x173f61 = _0x1a152c;
    var _0x3fccda = _0x484cd2;
    var _0x22eef9 = [_0x173f61, _0x3fccda];
    var _0x3662ed, _0x10bbdb, _0x29133c, _0x5ce192, _0x8011c7, _0xdfe8bc;
    for (var _0x3aee8c = 0x0; _0x3aee8c < _0x22eef9['length']; _0x3aee8c++) {
      var _0x1ce8fd = _0x22eef9[_0x3aee8c];
      for (var _0x2ab2ff = 0x0; _0x2ab2ff < _0x1ce8fd['length']; _0x2ab2ff += 0x2) {
        var _0x373bd2 = (_0x2ab2ff + 0x2) % _0x1ce8fd['length'];
        var _0x4b64a4 = {
          'x': _0x1ce8fd[_0x373bd2 + 0x1] - _0x1ce8fd[_0x2ab2ff + 0x1],
          'y': _0x1ce8fd[_0x2ab2ff] - _0x1ce8fd[_0x373bd2]
        };
        _0x3662ed = null;
        _0x10bbdb = null;
        for (_0xdfe8bc = 0x0; _0xdfe8bc < _0x173f61['length']; _0xdfe8bc += 0x2) {
          _0x29133c = _0x4b64a4['x'] * _0x173f61[_0xdfe8bc] + _0x4b64a4['y'] * _0x173f61[_0xdfe8bc + 0x1];
          if (_0x3662ed === null || _0x29133c < _0x3662ed) {
            _0x3662ed = _0x29133c;
          }
          if (_0x10bbdb === null || _0x29133c > _0x10bbdb) {
            _0x10bbdb = _0x29133c;
          }
        }
        _0x5ce192 = null;
        _0x8011c7 = null;
        for (_0xdfe8bc = 0x0; _0xdfe8bc < _0x3fccda['length']; _0xdfe8bc += 0x2) {
          _0x29133c = _0x4b64a4['x'] * _0x3fccda[_0xdfe8bc] + _0x4b64a4['y'] * _0x3fccda[_0xdfe8bc + 0x1];
          if (_0x5ce192 === null || _0x29133c < _0x5ce192) {
            _0x5ce192 = _0x29133c;
          }
          if (_0x8011c7 === null || _0x29133c > _0x8011c7) {
            _0x8011c7 = _0x29133c;
          }
        }
        if (_0x10bbdb < _0x5ce192 || _0x8011c7 < _0x3662ed) {
          return ![];
        }
      }
    }
    return !![];
  };
  _0x9bf60e['get_group_by_index'] = function (_0x40e2f1) {
    for (var _0xfca8d1 in lq_collide_config_1['LQCollideConfig']['collide_group_map']) {
      var _0x5ac815 = lq_collide_config_1['LQCollideConfig']['collide_group_map'][_0xfca8d1];
      if (_0x5ac815['index'] === _0x40e2f1) {
        return _0x5ac815;
      }
    }
    return undefined;
  };
  _0x9bf60e['get_info_by_id'] = function (_0xffbcdc) {
    var _0x308325;
    for (var _0x149f5e in lq_collide_config_1['LQCollideConfig']['collide_group_map']) {
      var _0x12150f = lq_collide_config_1['LQCollideConfig']['collide_group_map'][_0x149f5e];
      if (_0x12150f['id'] === _0xffbcdc) {
        return _0x12150f;
      }
      if (!_0x308325) {
        _0x308325 = _0x12150f;
      }
    }
    return _0x308325;
  };
  _0x9bf60e['find_nearest_collide'] = function (_0x308082) {
    var _0x3131c5 = [];
    for (var _0xc3c380 = _0x9bf60e['collide_arr']['length'] - 0x1; _0xc3c380 >= 0x0; _0xc3c380--) {
      var _0x585f4f = _0x9bf60e['collide_arr'][_0xc3c380];
      if (_0x308082 === _0x585f4f || !_0x585f4f['is_enable']) {
        continue;
      }
      if (_0x308082['follow_target_category']) {
        if (_0x585f4f['collide_category'] === _0x308082['follow_target_category']) {
          _0x3131c5['push'](_0x585f4f);
        }
      } else if ((_0x585f4f['collide_category'] & _0x308082['collide_mask']) !== 0x0) {
        _0x3131c5['push'](_0x585f4f);
      }
    }
    _0x3131c5['sort'](function (_0x3ddb83, _0x3ccf74) {
      return _0x308082['world_rect']['sub'](_0x3ddb83['world_rect'])['magSqr']() - _0x308082['world_rect']['sub'](_0x3ccf74['world_rect'])['magSqr']();
    });
    return _0x3131c5[0x0];
  };
  _0x9bf60e['clear'] = function (_0x4cf6a6) {
    if (_0x4cf6a6 === void 0x0) {
      _0x4cf6a6 = ![];
    }
    if (_0x4cf6a6) {
      for (var _0x537b2d = this['collide_arr']['length'] - 0x1; _0x537b2d >= 0x0; _0x537b2d--) {
        var _0x197d2f = this['collide_arr'][_0x537b2d];
        if (_0x197d2f['isValid']) {
          _0x197d2f['node']['destroy']();
        }
      }
    }
    this['collide_arr'] = [];
  };
  _0x9bf60e['check_collide'] = function (_0x183de2) {
    var _0x25cea1 = [];
    var _0xa7b05;
    if (lq_collide_config_1['LQCollideConfig']['switch_quad_tree']) {
      LQQuadTree['temp_collide_arr'] = [];
      this['quad_tree']['retrieve'](_0x183de2);
      _0xa7b05 = LQQuadTree['temp_collide_arr'];
    } else {
      _0xa7b05 = this['collide_arr'];
    }
    for (var _0x381af2 = 0x0; _0x381af2 < _0xa7b05['length']; _0x381af2++) {
      var _0x5db7b3 = _0xa7b05[_0x381af2];
      if (_0x183de2 === _0x5db7b3) {
        continue;
      }
      if (_0x183de2['collide_category'] & _0x5db7b3['collide_mask']) {
        if (_0x183de2['_collide_shape'] === 0x1 && _0x5db7b3['_collide_shape'] === 0x1) {
          if (lq_math_util_1['LQMathUtil']['intersects_rect'](_0x183de2['world_rect'], _0x5db7b3['world_rect'])) {
            _0x25cea1['push'](_0x5db7b3);
          }
        } else if (_0x183de2['_collide_shape'] === 0x1 && _0x5db7b3['_collide_shape'] === 0x2) {
          if (lq_math_util_1['LQMathUtil']['intersects_circle_rect'](_0x5db7b3['world_rect'], _0x5db7b3['radius'], _0x183de2['world_rect'])) {
            _0x25cea1['push'](_0x5db7b3);
          }
        } else if (_0x183de2['_collide_shape'] === 0x2 && _0x5db7b3['_collide_shape'] === 0x1) {
          if (lq_math_util_1['LQMathUtil']['intersects_circle_rect'](_0x183de2['world_rect'], _0x183de2['radius'], _0x5db7b3['world_rect'])) {
            _0x25cea1['push'](_0x5db7b3);
          }
        } else if (_0x183de2['_collide_shape'] === 0x2 && _0x5db7b3['_collide_shape'] === 0x2) {
          if (lq_math_util_1['LQMathUtil']['intersects_circle'](_0x183de2['world_rect'], _0x183de2['radius'], _0x5db7b3['world_rect'], _0x5db7b3['radius'])) {
            _0x25cea1['push'](_0x5db7b3);
          }
        } else if (this['polygon_polygon'](_0x183de2, _0x5db7b3)) {
          _0x25cea1['push'](_0x5db7b3);
        }
      }
    }
    return _0x25cea1;
  };
  _0x9bf60e['is_enable'] = ![];
  _0x9bf60e['collide_arr'] = [];
  _0x9bf60e['quad_tree'] = new LQQuadTree(new lq_data_1['LQRect'](lq_collide_config_1['LQCollideConfig']['active_area_x'], lq_collide_config_1['LQCollideConfig']['active_area_y'], lq_collide_config_1['LQCollideConfig']['active_area_width'], lq_collide_config_1['LQCollideConfig']['active_area_height']), lq_collide_config_1['LQCollideConfig']['max_node_len'], lq_collide_config_1['LQCollideConfig']['max_node_level']);
  return _0x9bf60e;
}();
exports['LQCollideSystem'] = LQCollideSystem;
var AutoRun = function () {
  function _0xf5b087() {
    this['flag'] = !![];
  }
  _0xf5b087['prototype']['update'] = function (_0x365e55) {
    if (lq_collide_config_1['LQCollideConfig']['per_frame'] === 0x3c) {
      LQCollideSystem['update_logic'](_0x365e55);
    } else {
      if (this['flag']) {
        this['flag'] = ![];
        LQCollideSystem['update_logic'](_0x365e55);
      } else {
        this['flag'] = !![];
      }
    }
  };
  return _0xf5b087;
}();
game['on'](game['EVENT_GAME_INITED'], function () {
  if (lq_collide_config_1['LQCollideConfig']['switch_auto_run'] && !CC_EDITOR) {
    var _0x287f86 = new AutoRun();
    director['getScheduler']()['enableForTarget'](_0x287f86);
    director['getScheduler']()['scheduleUpdate'](_0x287f86, Scheduler['PRIORITY_SYSTEM'], ![]);
  }
});

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 71536 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/Block.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'c58deN2u1NGZL8nJwvnu1PR', 'Block');
// Script/Block.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.PathType = exports.BlockColor = exports.BlockType = void 0;
var lq_collide_system_1 = require("./lq_collide_system/lq_collide_system");
var Map_1 = require("./Map");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var BlockType;
(function (BlockType) {
    /*普通地块 */
    BlockType[BlockType["\u666E\u901A\u5757"] = 0] = "\u666E\u901A\u5757";
    /*起点地块 */
    BlockType[BlockType["\u53E0\u52A0\u5757\u4E0B"] = 1] = "\u53E0\u52A0\u5757\u4E0B";
    /*湿地 */
    BlockType[BlockType["\u94A5\u5319\u5757"] = 2] = "\u94A5\u5319\u5757";
    /*山峰 */
    BlockType[BlockType["\u4E0A\u9501\u5757"] = 3] = "\u4E0A\u9501\u5757";
    /*终点地块 */
    BlockType[BlockType["\u51BB\u7ED3\u5757"] = 4] = "\u51BB\u7ED3\u5757";
    /*息壤 */
    BlockType[BlockType["\u661F\u661F\u5757"] = 5] = "\u661F\u661F\u5757";
    /*加固 */
    BlockType[BlockType["\u70B8\u5F39\u5757"] = 6] = "\u70B8\u5F39\u5757";
    /*加固 */
    BlockType[BlockType["\u6C34\u5E73\u5757"] = 7] = "\u6C34\u5E73\u5757";
    /*加固 */
    BlockType[BlockType["\u5782\u76F4\u5757"] = 8] = "\u5782\u76F4\u5757";
    /*加固 */
    BlockType[BlockType["\u7C98\u5408\u5757"] = 9] = "\u7C98\u5408\u5757";
    /*加固 */
    BlockType[BlockType["\u53E0\u52A0\u5757\u4E0A"] = 10] = "\u53E0\u52A0\u5757\u4E0A";
})(BlockType = exports.BlockType || (exports.BlockType = {}));
var BlockColor;
(function (BlockColor) {
    /*起点地块 */
    BlockColor[BlockColor["\u7D2B\u8272"] = 0] = "\u7D2B\u8272";
    /*湿地 */
    BlockColor[BlockColor["\u9EC4\u8272"] = 1] = "\u9EC4\u8272";
    /*山峰 */
    BlockColor[BlockColor["\u7EFF\u8272"] = 2] = "\u7EFF\u8272";
    /*终点地块 */
    BlockColor[BlockColor["\u84DD\u8272"] = 3] = "\u84DD\u8272";
    /*息壤 */
    BlockColor[BlockColor["\u7C89\u8272"] = 4] = "\u7C89\u8272";
    /*加固 */
    BlockColor[BlockColor["\u6A58\u9EC4\u8272"] = 5] = "\u6A58\u9EC4\u8272";
    /*加固 */
    BlockColor[BlockColor["\u9752\u8272"] = 6] = "\u9752\u8272";
    /*加固 */
    BlockColor[BlockColor["\u767D\u8272"] = 7] = "\u767D\u8272";
    /*加固 */
    BlockColor[BlockColor["\u7EA2\u8272"] = 8] = "\u7EA2\u8272";
    /*加固 */
    BlockColor[BlockColor["\u7070\u8272"] = 9] = "\u7070\u8272";
})(BlockColor = exports.BlockColor || (exports.BlockColor = {}));
var PathType;
(function (PathType) {
    PathType["err"] = "err";
    PathType["up"] = "up";
    PathType["down"] = "down";
    PathType["left"] = "left";
    PathType["right"] = "right";
    PathType["up_left"] = "up_left";
    PathType["up_right"] = "up_right";
    PathType["down_left"] = "down_left";
    PathType["down_right"] = "down_right";
    PathType["left_up"] = "left_up";
    PathType["left_down"] = "left_down";
    PathType["right_up"] = "right_up";
    PathType["right_down"] = "right_down";
})(PathType = exports.PathType || (exports.PathType = {}));
var Block = /** @class */ (function (_super) {
    __extends(Block, _super);
    function Block() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        // 新增缓存变量
        _this.moveInterval = 0; // 约 60 FPS 
        _this.lastMoveTime = 0; // 上下两个值来调节跟手，一个是时间轴，一个是距离轴
        _this.maxSpeed = 300; //  最大移动距离
        // private otherCollider: cc.Collider = null;
        // @property({
        //     tooltip: '碰撞形状，None就是无敌，不参与碰撞',
        //     type: cc.Enum(BlockType),
        //     // default: BlockType.Nomal,
        //     displayName: '碰撞形状'
        // })
        _this.type = BlockType.普通块;
        _this.color = BlockColor.紫色;
        _this.heng = 1;
        _this.shu = 1;
        _this.ice_SpriteFrame = null;
        // LIFE-CYCLE CALLBACKS:
        // @property(cc.SpriteAtlas)
        // UI: cc.SpriteAtlas = null;
        _this.initialTouchOffset = null;
        _this.offsetTolerance = 100; // 偏移容忍度; 
        _this.touchPoint = null; //触摸点
        _this.isTouch = false; //是否触摸
        _this.posX = 0; //地图块的X坐标
        _this.posY = 0; //地图块的Y坐标
        _this.moveLeft = true; //是否可以左移;
        _this.moveRight = true; //是否可以右移;
        _this.moveUp = true; //是否可以上移;
        _this.moveDown = true; //是否可以下移;
        _this.moveCorner = 0; //是否碰撞角落
        _this.moveY = 0; //是否可以上下移动;
        _this.moveX = 0; //是否可以左右移动;
        _this.touchPointX = 0; //触摸点X坐标;
        _this.touchPointY = 0; //触摸点Y坐标;
        _this.blockId = 0; //方块ID;
        _this.level = 0; //叠加方块层数;
        _this.pz = false;
        _this.over = false; //方块是否失效已消失
        _this.touchDelta = cc.v2(0, 0);
        _this.checkCollision = false;
        return _this;
    }
    Block.prototype.onLoad = function () {
        this.pz = false;
        this.stacking = cc.v2(0, 0);
        this.adhesive = cc.v2(0, 0);
        this.adhesiveNode = [];
        this.collider = this.node.getComponent(cc.PolygonCollider);
        this.over = false;
        this.checkCollision = false;
    };
    Block.prototype.start = function () {
    };
    Block.prototype.jsonDeepClone = function (obj) {
        return JSON.parse(JSON.stringify(obj));
    };
    //createAd 为是否创建粘合快图片
    Block.prototype.init = function (block_Info, posX, posY, node, createAd) {
        var _this = this;
        this.block_Info = this.jsonDeepClone(block_Info);
        if (node)
            this.block_Info.node = node;
        this.type = block_Info.type;
        this.color = block_Info.color;
        this.blockId = block_Info.id;
        // if(posX&&posY){
        //     this.posX = posX;
        //     this.posY = posY;
        // }
        // console.log("方块层级",this.node.zIndex);
        this.initColor();
        this.initType();
        this.initBlocks();
        if (this.type != BlockType.叠加块上) {
            this.node.on(cc.Node.EventType.TOUCH_START, this.touchStart, this);
            this.node.on(cc.Node.EventType.TOUCH_MOVE, this.touchMove, this);
            this.node.on(cc.Node.EventType.TOUCH_CANCEL, this.touchEnd, this);
            this.node.on(cc.Node.EventType.TOUCH_END, this.touchEnd, this);
            this.node['_touchListener'].setSwallowTouches(false);
            setTimeout(function () {
                if (_this.type == BlockType.粘合块) {
                    // 计算位置偏移
                    var posOffset_1 = cc.v2(_this.node.x - _this.block_Info.node.x, _this.node.y - _this.block_Info.node.y);
                    if (createAd) {
                        if (_this.node.zIndex >= _this.block_Info.node.zIndex)
                            _this.createAdhesive();
                        else
                            _this.block_Info.node.getComponent("Block").createAdhesive();
                    }
                    var targetNames_1 = ['top', 'down', 'left', 'right'];
                    _this.block_Info.node.children.forEach(function (child) {
                        if (child instanceof cc.Node && targetNames_1.includes(child.name) && child.getComponent("lq_collide").data_string != "-1") {
                            var clonedChild = cc.instantiate(child);
                            clonedChild.getComponent("lq_collide").data_string = "-1";
                            clonedChild.parent = _this.node;
                            // 获取子节点相对于父节点的位置
                            var relativePos = child.getPosition();
                            // 调整子节点位置以保证相对位置不变
                            clonedChild.setPosition(relativePos.x - posOffset_1.x, relativePos.y - posOffset_1.y);
                        }
                    });
                    _this.adhesive = posOffset_1;
                }
            }, 100);
            var mapInfo = Map_1.default._instance.mapInfo;
            for (var i = 0; i < mapInfo.length; i++) {
                var blockRect = mapInfo[i].getBoundingBox();
                // 使用 cc.Intersection.pointInRect 方法判断点是否在矩形范围内
                var point = cc.v2(this.node.position.x - 5, this.node.position.y + 10);
                if (blockRect.contains(point)) {
                    this.posX = mapInfo[i].getComponent("MapBlock").posX;
                    this.posY = mapInfo[i].getComponent("MapBlock").posY;
                    this.setMapBlock();
                    this.level = 50 + this.posX - this.posY * 3;
                    this.node.zIndex = this.level;
                    this.node.x = mapInfo[i].x + 65;
                    this.node.y = mapInfo[i].y - 60;
                    i = 10000;
                    this.hit = new cc.Node();
                    this.hit.addComponent(cc.Sprite);
                    this.hit.parent = this.node;
                    var name = "xz_" + this.block_Info.block;
                    this.hit.getComponent(cc.Sprite).spriteFrame = this.ice_SpriteFrame._spriteFrames[name];
                    this.hit.setAnchorPoint(this.node.anchorX, this.node.anchorY);
                    this.hit.setPosition(13, -11);
                    if (this.hit.anchorX == 0.5)
                        this.hit.setPosition(0, -11);
                    else if (this.hit.anchorX == 0.33)
                        this.hit.setPosition(-13, -11);
                    else if (this.hit.anchorX == 0.66)
                        this.hit.setPosition(2, -9);
                    // this.hit.opacity = 0;
                    this.hit.active = false;
                    break;
                }
            }
        }
    };
    //初始化方块类型
    Block.prototype.initType = function () {
        var _a;
        var posConfig = cc.fx.GameConfig.PROP_INFO[this.block_Info.block];
        switch (this.type) {
            case BlockType.炸弹块:
                var boom = cc.instantiate(Map_1.default._instance.Block_Prop[this.type]);
                boom.parent = this.node;
                boom.setPosition(posConfig.pos1.x, posConfig.pos1.y);
                if ((_a = this.block_Info) === null || _a === void 0 ? void 0 : _a.boomTime)
                    boom.getComponent("Boom").init(this.block_Info.boomTime);
                break;
            case BlockType.星星块:
                var star = cc.instantiate(Map_1.default._instance.Block_Prop[this.type]);
                star.anchorX = this.node.anchorX;
                star.anchorY = this.node.anchorY;
                star.getComponent(cc.Sprite).spriteFrame = star.getComponent("Star").star_SpriteFrame.getSpriteFrame("star_" + this.block_Info.block);
                star.parent = this.node;
                star.setPosition(posConfig.pos4.x - 10, posConfig.pos4.y);
            case BlockType.钥匙块:
                var key = cc.instantiate(Map_1.default._instance.Block_Prop[this.type]);
                key.parent = this.node;
                key.setPosition(posConfig.pos1.x, posConfig.pos1.y);
                break;
            case BlockType.上锁块:
                var lock = cc.instantiate(Map_1.default._instance.Block_Prop[this.type]);
                lock.parent = this.node;
                lock.setPosition(posConfig.pos1.x, posConfig.pos1.y);
                lock.getComponent("Lock").init(this.block_Info.lockTime);
                break;
            case BlockType.冻结块:
                var freeze = cc.instantiate(Map_1.default._instance.Block_Prop[this.type]);
                freeze.parent = this.node;
                var name = "ice_" + this.block_Info.block;
                var spriteFrame = this.ice_SpriteFrame._spriteFrames[name];
                freeze.getChildByName("icon").getComponent(cc.Sprite).spriteFrame = spriteFrame;
                var freezeX = posConfig.pos6.x - (this.node.width * (this.node.anchorX - 0.5));
                var freezeY = posConfig.pos6.y + this.node.height / 2;
                freeze.setPosition(freezeX, freezeY);
                freeze.getComponent("Freeze").init(this.block_Info.freezeTime);
                freeze.getChildByName("time").setPosition(posConfig.pos5.x - 10 - freezeX, posConfig.pos5.y - 2 - freezeY);
                break;
            case BlockType.水平块:
                var horizontal = cc.instantiate(Map_1.default._instance.Block_Prop[this.type]);
                horizontal.parent = this.node;
                var heng = "heng" + this.heng;
                horizontal.getChildByName(heng).active = true;
                horizontal.setPosition(posConfig.pos2.x - 3, posConfig.pos2.y);
                break;
            case BlockType.垂直块:
                var vertical = cc.instantiate(Map_1.default._instance.Block_Prop[this.type]);
                vertical.parent = this.node;
                var shu = "shu" + this.shu;
                vertical.getChildByName(shu).active = true;
                vertical.setPosition(posConfig.pos3.x, posConfig.pos3.y);
                break;
            case BlockType.叠加块上:
                this.moveStack = false;
                this.node.off(cc.Node.EventType.TOUCH_START);
                this.node.off(cc.Node.EventType.TOUCH_MOVE);
                this.node.off(cc.Node.EventType.TOUCH_CANCEL);
                this.node.off(cc.Node.EventType.TOUCH_END);
                // this.selfBoxColliders = [];
                this.node.zIndex = 201;
                var pos = this.getStackingPos();
                this.node.setPosition(this.node.x + pos.x, this.node.y + pos.y);
                this.stacking = cc.v2(this.node.x - this.block_Info.node.x, this.node.y - this.block_Info.node.y);
                this.block_Info.node.getComponent("Block").block_Info.node = this.node;
                this.node.scaleX *= 0.7;
                this.node.scaleY *= 0.7;
                for (var i = 0; i < this.node.children.length; i++) {
                    if (this.node.children[i].name == "left" || this.node.children[i].name == "right" || this.node.children[i].name == "top" || this.node.children[i].name == "down")
                        this.node.children[i].active = false;
                }
                break;
        }
    };
    //初始化方块颜色
    Block.prototype.initColor = function () {
        var name = this.color + "color" + this.block_Info.block;
        var number = Math.floor((this.color - 1) / 2);
        var blockSpriteFrame = Map_1.default._instance.Block_Color[number]._spriteFrames;
        var spriteFrame = blockSpriteFrame[name];
        // if(this.type == BlockType.冻结块){
        //     name = "ice_"+this.block_Info.block;
        //     spriteFrame = this.ice_SpriteFrame._spriteFrames[name];
        // }
        this.node.getChildByName("icon").getComponent(cc.Sprite).spriteFrame = spriteFrame;
    };
    //创建粘合快连接处
    Block.prototype.createAdhesive = function () {
        var box = [];
        for (var i = 0; i < this.allBlocks.length; i++) {
            box.push(cc.v2(this.allBlocks[i].x + this.posX, this.allBlocks[i].y + this.posY));
        }
        var otherBox = [];
        for (var i = 0; i < this.block_Info.node.getComponent("Block").allBlocks.length; i++) {
            otherBox.push(cc.v2(this.block_Info.node.getComponent("Block").allBlocks[i].x + this.block_Info.node.getComponent("Block").posX, this.block_Info.node.getComponent("Block").allBlocks[i].y + this.block_Info.node.getComponent("Block").posY));
        }
        for (var k = 0; k < box.length; k++) {
            for (var j = 0; j < otherBox.length; j++) {
                if ((box[k].x == otherBox[j].x + 1 || box[k].x == otherBox[j].x - 1) && (box[k].y == otherBox[j].y)) {
                    //在X轴 相邻
                    var left = box[k].x == otherBox[j].x + 1 ? "left" : "right";
                    this.addAdhesive(left, box[k]);
                    otherBox.splice(j, 1);
                    j--; // 调整索引
                    if (j < 0)
                        break;
                }
                if ((box[k].y == otherBox[j].y + 1 || box[k].y == otherBox[j].y - 1) && (box[k].x == otherBox[j].x)) {
                    //在Y轴 相邻
                    var down = box[k].y == otherBox[j].y + 1 ? "down" : "up";
                    this.addAdhesive(down, box[k]);
                    otherBox.splice(j, 1);
                    j--; // 调整索引
                    if (j < 0)
                        break;
                }
            }
        }
        // let adhesive = cc.instantiate(MapConroler._instance.Block_Prop[this.type]);
    };
    //具体添加粘合快锁链方法
    Block.prototype.addAdhesive = function (diraction, box) {
        var pos = cc.v2(box.x - this.posX, box.y - this.posY);
        var adhesive = cc.instantiate(Map_1.default._instance.Block_Prop[10]);
        adhesive.parent = this.node.parent.getChildByName("Adhesive");
        // adhesive.parent = this.node.getChildByName("adhesive");
        adhesive.setPosition(120 * pos.x - 65 + this.node.x, 120 * pos.y + 60 + this.node.y);
        if (diraction == "left" || diraction == "right") {
            adhesive.getChildByName("heng").active = true;
            adhesive.getChildByName("heng").x = -60;
            if (diraction == "right")
                adhesive.getChildByName("heng").x = 60;
            adhesive.getChildByName("heng").x += 9;
            adhesive.getChildByName("heng").y += 7;
        }
        else {
            adhesive.getChildByName("shu").active = true;
            adhesive.getChildByName("shu").y = -60;
            if (diraction == "up")
                adhesive.getChildByName("shu").y = 60;
        }
        adhesive.getComponent("Adhesive").init(this.node);
        this.adhesiveNode.push(adhesive);
    };
    Block.prototype.removeAdhesive = function () {
        if (this.adhesiveNode.length > 0) {
            for (var i = 0; i < this.adhesiveNode.length; i++) {
                var adhesive = this.adhesiveNode[i];
                adhesive.getComponent("Adhesive").remove();
            }
        }
    };
    //方块落点
    Block.prototype.blockFall = function (point) {
        if (this.over == true)
            return;
        // // 假设 MapConroler 有网格信息，这里简单示例
        var mapWidth = Map_1.default._instance.mapWidth;
        var mapHeight = Map_1.default._instance.mapHeight;
        var cellSize = 120; // 每个格子的大小，根据实际情况调整
        // 计算点所在的网格坐标
        var gridX = Math.floor((point.x + (mapWidth * cellSize / 2)) / cellSize);
        var gridY = Math.floor((point.y + (mapHeight * cellSize / 2)) / cellSize);
        // 检查网格坐标是否越界
        if (gridX >= 0 && gridX < mapWidth && gridY >= 0 && gridY < mapHeight) {
            var mapBlock = Map_1.default._instance.mapBlocksWall[gridX][gridY];
            var blockRect = mapBlock.getBoundingBox();
            // 使用 cc.Intersection.pointInRect 方法判断点是否在矩形范围内
            if (blockRect.contains(point)) {
                //寻找落点
                this.removeMapBlock();
                this.posX = mapBlock.getComponent("MapBlock").posX;
                this.posY = mapBlock.getComponent("MapBlock").posY;
                this.setMapBlock();
                this.level = 50 + this.posX - this.posY * 3;
                this.node.zIndex = this.level;
                // console.log("方块层级",this.node.zIndex);
                this.node.x = mapBlock.x + 65;
                this.node.y = mapBlock.y - 60;
                if (this.type == 9) {
                    if (this.block_Info.node) {
                        this.block_Info.node.x = this.node.x - this.adhesive.x;
                        this.block_Info.node.y = this.node.y - this.adhesive.y;
                    }
                }
                else if (this.type == 1) {
                    this.block_Info.node.getComponent("Block").moveStack = false;
                    this.block_Info.node.x = this.node.x + this.block_Info.node.getComponent("Block").stacking.x;
                    this.block_Info.node.y = this.node.y + this.block_Info.node.getComponent("Block").stacking.y;
                }
            }
        }
        var jg = Map_1.default._instance.checkPass(this.node, this.allBlocks);
        if (jg >= 0) {
            this.over = true;
            Map_1.default._instance.changeState();
            this.removeBoxCollider();
            this.removeMapBlock();
            this.removeAction(jg);
        }
        else {
            Map_1.default._instance.upDoor(this.color);
            this.setVibrate("medium", 1);
            //@ts-ignore
        }
    };
    Block.prototype.removeBoxCollider = function () {
        for (var i = 0; i < this.node.children.length; i++) {
            if (this.node.children[i].name == "left" || this.node.children[i].name == "right" || this.node.children[i].name == "top" || this.node.children[i].name == "down")
                this.node.children[i].destroy();
        }
    };
    Block.prototype.removeAction = function (diraction) {
        var _this = this;
        this.node.off(cc.Node.EventType.TOUCH_START);
        this.node.off(cc.Node.EventType.TOUCH_MOVE);
        this.node.off(cc.Node.EventType.TOUCH_CANCEL);
        this.node.off(cc.Node.EventType.TOUCH_END);
        this.node.addComponent(cc.Mask);
        var self = this;
        var pos = this.node.getPosition();
        if (this.type == BlockType.叠加块下) {
            var scaleX = this.node.scaleX;
            var scaleY = this.node.scaleY;
            this.block_Info.node.getComponent("Block").restoreNomal(this.posX, this.posY, true);
            cc.tween(this.block_Info.node)
                .to(0.3, { position: pos, scaleX: scaleX > 0 ? 1 : -1, scaleY: scaleY > 0 ? 1 : -1 })
                .start();
        }
        else if (this.type == BlockType.粘合块) {
            this.removeAdhesive();
            this.block_Info.node.getComponent("Block").removeAdhesive();
            this.block_Info.node.getComponent("Block").restoreNomal(this.block_Info.node.getComponent("Block").posX, this.block_Info.node.getComponent("Block").posY, false);
            this.block_Info.node = null;
        }
        else if (this.type == BlockType.炸弹块) {
            this.node.getChildByName("boom").getComponent("Boom").stopBoom();
        }
        var time = 0.33;
        // this.node.zIndex = 0;
        var width = Math.floor(this.node.width / 120);
        var height = Math.floor(this.node.height / 120);
        setTimeout(function () {
            cc.fx.AudioManager._instance.playEffect("xiaochu", null);
        }, 300);
        this.setVibrate("light", 3);
        if (diraction == 0) {
            time = 0.33 * height;
            // time = 0.99;
            for (var i = 0; i < this.node.children.length; i++) {
                cc.tween(this.node.children[i])
                    .to(time, { y: this.node.children[i].y + this.node.children[0].height })
                    .start();
            }
        }
        else if (diraction == 1) {
            time = 0.33 * height;
            // time = 0.99
            for (var i = 0; i < this.node.children.length; i++) {
                cc.tween(this.node.children[i])
                    .to(time, { y: this.node.children[i].y - this.node.children[0].height })
                    .start();
            }
        }
        else if (diraction == 2) {
            time = 0.33 * width;
            // time = 0.99
            for (var i = 0; i < this.node.children.length; i++) {
                cc.tween(this.node.children[i])
                    .to(time, { x: this.node.children[i].x - this.node.children[0].width })
                    .start();
            }
        }
        else if (diraction == 3) {
            time = 0.33 * width;
            // time = 0.99
            for (var i = 0; i < this.node.children.length; i++) {
                cc.tween(this.node.children[i])
                    .to(time, { x: this.node.children[i].x + this.node.children[0].width })
                    .start();
            }
        }
        setTimeout(function () {
            var tempColor = _this.color;
            setTimeout(function () {
                Map_1.default._instance.upDoor(tempColor);
            }, 250);
            Map_1.default._instance.nextLevel();
            _this.node.active = false;
            _this.node.removeFromParent();
            // this.node.active = false;
            // this.node.removeFromParent();
        }, time * 1000);
    };
    Block.prototype.touchStart = function (event) {
        if (this.over || Map_1.default._instance.gameOver)
            return;
        // 返回世界坐标
        var touchLoc = event.getLocation();
        // https://docs.cocos.com/creator/api/zh/classes/Intersection.html 检测辅助类
        // let pos = this.collider.world.points
        if (!this.collider.world) {
            return;
        }
        // 判断触摸点是否在多边形内
        if (cc.Intersection.pointInPolygon(touchLoc, this.collider.world.points)) {
            if (Map_1.default._instance.hammer) {
                this.eliminate();
                this.isTouch = false;
                Map_1.default._instance.hammerMask.active = false;
                Map_1.default._instance.node.parent.getChildByName("Bottom").getChildByName("destroyBtn").getComponent("btnControl").setTouch(true);
                return false;
            }
            if (this.type != BlockType.上锁块 && this.type != BlockType.冻结块) {
                Map_1.default._instance.startUpdate();
                cc.fx.AudioManager._instance.playEffect("hit", null);
                this.node.zIndex = 200;
                if (this.type == 9) {
                    if (this.block_Info.node) {
                        this.block_Info.node.zIndex = 200;
                        this.block_Info.node.getComponent("Block").hit.active = true;
                        Map_1.default._instance.downDoor(this.block_Info.node.getComponent("Block").color, this.block_Info.node.getComponent("Block").type);
                    }
                }
                else if (this.type == 1) {
                    this.block_Info.node.getComponent("Block").moveStack = true;
                }
                var touchPoint = event.getLocation();
                var local = this.node.parent.convertToNodeSpaceAR(touchPoint);
                this.touchPointX = local.x;
                this.touchPointY = local.y;
                this.moveLeft = this.moveRight = this.moveUp = this.moveDown = true;
                this.isTouch = true;
                this.moveCorner = 0;
                this.relative_Position = cc.v2(this.node.x - local.x, this.node.y - local.y);
                Map_1.default._instance.changeRiseFall(this.color, true);
                Map_1.default._instance.downDoor(this.color, this.type);
                this.setVibrate("light", 1);
                if (this.hit)
                    this.hit.active = true;
                return true;
            }
            else {
                this.isTouch = false;
                return false;
            }
        }
        else {
            this.isTouch = false;
            return false;
        }
    };
    Block.prototype.touchEnd = function (event) {
        if (Map_1.default._instance.gameOver)
            return;
        if (this.isTouch) {
            this.touchDelta = cc.v2(0, 0);
            this.checkCollision = false;
            Map_1.default._instance.changeRiseFall(this.color, false);
            cc.fx.AudioManager._instance.playEffect("down", null);
            Map_1.default._instance.removeOneBlock();
            this.isTouch = false;
            this.node.zIndex = this.level;
            this.hit.active = false;
            if (this.type == 9) {
                if (this.block_Info.node) {
                    this.block_Info.node.getComponent("Block").hit.active = false;
                    // this.block_Info.node.getComponent("Block").isTouch = false;
                }
            }
            this.touchPoint = event.getLocation();
            var local = cc.v2(this.node.x - 50, this.node.y + 50);
            if (this.type != 10) {
                //@ts-ignore
                this.blockFall(local);
                if (this.type == 9) {
                    if (this.block_Info.node) {
                        var localTemp = cc.v2(this.block_Info.node.x - 50, this.block_Info.node.y + 50);
                        this.block_Info.node.getComponent("Block").blockFall(localTemp);
                    }
                }
            }
            this.moveLeft = this.moveRight = this.moveUp = this.moveDown = true;
        }
    };
    Block.prototype.touchMove = function (event) {
        if (Map_1.default._instance.gameOver)
            return;
        // const currentTime = Date.now();
        // // 如果距离上次移动时间小于间隔时间，直接返回
        // if (currentTime - this.lastMoveTime < this.moveInterval) {
        //     return;
        // }
        // this.lastMoveTime = currentTime;
        if (this.isTouch) {
            var delta = event.getDelta();
            var touchPoint = event.getLocation();
            var local = this.node.parent.convertToNodeSpaceAR(touchPoint);
            this.touchPointX = local.x;
            this.touchPointY = local.y;
            delta.x = this.touchPointX - this.node.x + this.relative_Position.x;
            delta.y = this.touchPointY - this.node.y + this.relative_Position.y;
            // 限制移动速度
            this.touchPointX = local.x;
            this.touchPointY = local.y;
            delta.x = this.touchPointX - this.node.x + this.relative_Position.x;
            delta.y = this.touchPointY - this.node.y + this.relative_Position.y;
            // 限制移动速度
            delta.x = Math.max(-this.maxSpeed, Math.min(this.maxSpeed, delta.x));
            delta.y = Math.max(-this.maxSpeed, Math.min(this.maxSpeed, delta.y));
            // 记录触摸移动的增量
            this.touchDelta = delta;
        }
    };
    //超出限制判断
    Block.prototype.exceeds = function (stepx, stepy) {
    };
    Block.prototype.eliminate = function () {
        var _this = this;
        //锤子状态消失
        Map_1.default._instance.pause = true;
        Map_1.default._instance.hammer = false;
        //如果方块是有特殊状态，则特殊处理
        if (this.type == BlockType.冻结块) {
            this.node.getChildByName("freeze").getComponent("Freeze").reduce(2);
            return;
        }
        else if (this.type == BlockType.上锁块) {
            this.node.getChildByName("lock").getComponent("Lock").reduce();
            return;
        }
        //如果方块可以消除
        Map_1.default._instance.blockNum -= 1;
        Map_1.default._instance.special_Treatment(this.node);
        var self = this;
        this.removeMapBlock();
        setTimeout(function () {
            var pos = _this.node.getPosition();
            if (self.type == BlockType.叠加块下) {
                var scaleX = self.node.scaleX;
                var scaleY = self.node.scaleY;
                self.block_Info.node.getComponent("Block").restoreNomal(_this.posX, _this.posY, true);
                cc.tween(self.block_Info.node)
                    .to(0.1, { position: pos, scaleX: scaleX > 0 ? 1 : -1, scaleY: scaleY > 0 ? 1 : -1 })
                    .start();
            }
            else if (self.type == BlockType.粘合块) {
                self.block_Info.node.getComponent("Block").restoreNomal(self.block_Info.node.getComponent("Block").posX, self.block_Info.node.getComponent("Block").posY, false);
            }
            else if (self.type == BlockType.炸弹块) {
                _this.node.getChildByName("boom").getComponent("Boom").stopBoom();
            }
            Map_1.default._instance.nextLevel();
            _this.node.active = false;
            _this.node.removeFromParent();
        }, 200);
    };
    Block.prototype.setVibrate = function (type, count) {
        // return;
        if (!cc.fx.GameConfig.GM_INFO.vibrateOpen) {
            return;
        }
        if (count == 1) {
            //@ts-ignore
            if (typeof wx !== 'undefined' && wx !== null) { // 判断是否在微信环境
                //@ts-ignore
                wx.vibrateShort({
                    type: type,
                    success: function () {
                    },
                    fail: function (err) {
                    }
                });
            }
            else {
            }
            return;
        }
        var time = 150;
        for (var i = 0; i < 4; i++) {
            setTimeout(function () {
                //@ts-ignore
                if (typeof wx !== 'undefined' && wx !== null) { // 判断是否在微信环境
                    //@ts-ignore
                    wx.vibrateShort({
                        type: type,
                        success: function () {
                        },
                        fail: function (err) {
                        }
                    });
                }
                else {
                }
            }, time * i);
        }
    };
    Block.prototype.setMoveCorner = function (diraction) {
        return;
    };
    Block.prototype.cmupdate = function () {
        var cm = cc.director.getCollisionManager();
        cm.update();
    };
    Block.prototype.restoreNomal = function (posX, posY, type) {
        this.type = 0;
        this.block_Info.node = null;
        this.moveStack = false;
        this.posX = posX;
        this.posY = posY;
        this.setMapBlock();
        this.level = 50 + this.posX - this.posY * 3;
        this.node.zIndex = this.level;
        var j = 1000;
        for (var i = 0; i < this.node.children.length; i++) {
            if (this.node.children[i].name == "New Node") {
                j = i;
            }
            if (i > j) {
                this.node.children[i].active = false;
            }
        }
        if (type) {
            for (var i = 0; i < this.node.children.length; i++) {
                if (this.node.children[i].name == "left" || this.node.children[i].name == "right" || this.node.children[i].name == "top" || this.node.children[i].name == "down")
                    this.node.children[i].active = true;
            }
        }
        this.node.on(cc.Node.EventType.TOUCH_START, this.touchStart, this);
        this.node.on(cc.Node.EventType.TOUCH_MOVE, this.touchMove, this);
        this.node.on(cc.Node.EventType.TOUCH_CANCEL, this.touchEnd, this);
        this.node.on(cc.Node.EventType.TOUCH_END, this.touchEnd, this);
        this.node['_touchListener'].setSwallowTouches(false);
        this.hit = new cc.Node();
        this.hit.addComponent(cc.Sprite);
        this.hit.parent = this.node;
        var name = "xz_" + this.block_Info.block;
        this.hit.getComponent(cc.Sprite).spriteFrame = this.ice_SpriteFrame._spriteFrames[name];
        this.hit.setAnchorPoint(this.node.anchorX, this.node.anchorY);
        this.hit.setPosition(13, -11);
        if (this.hit.anchorX == 0.5)
            this.hit.setPosition(0, -11);
        else if (this.hit.anchorX == 0.33)
            this.hit.setPosition(-13, -11);
        else if (this.hit.anchorX == 0.66)
            this.hit.setPosition(2, -9);
        this.hit.active = false;
    };
    //冻结状态恢复为常规状态
    Block.prototype.resetFreeze = function () {
        this.type = 0;
        this.block_Info.type = 0;
        var name = this.color + "color" + this.block_Info.block;
        var number = Math.floor((this.color - 1) / 2);
        var blockSpriteFrame = Map_1.default._instance.Block_Color[number]._spriteFrames;
        var spriteFrame = blockSpriteFrame[name];
        this.node.getChildByName("icon").getComponent(cc.Sprite).spriteFrame = spriteFrame;
    };
    Block.prototype.initBlocks = function () {
        this.allBlocks = [];
        switch (this.block_Info.block) {
            case 0:
                var pos = cc.v2(0, 0);
                this.allBlocks = [pos];
                break;
            case 1:
                var pos1 = cc.v2(0, 0);
                var pos2 = cc.v2(-1, 0);
                this.allBlocks = [pos1, pos2];
                break;
            case 2:
                var pos3 = cc.v2(0, 0);
                var pos4 = cc.v2(0, 1);
                this.allBlocks = [pos3, pos4];
                break;
            case 3:
                var pos5 = cc.v2(0, 0);
                var pos6 = cc.v2(-1, 0);
                var pos7 = cc.v2(-2, 0);
                this.allBlocks = [pos5, pos6, pos7];
                break;
            case 4:
                var pos8 = cc.v2(0, 0);
                var pos9 = cc.v2(0, 1);
                var pos10 = cc.v2(0, 2);
                this.allBlocks = [pos8, pos9, pos10];
                break;
            case 5:
                var pos11 = cc.v2(0, 0);
                var pos12 = cc.v2(-1, 0);
                var pos13 = cc.v2(-1, 1);
                var pos14 = cc.v2(0, 1);
                this.allBlocks = [pos11, pos12, pos13, pos14];
                break;
            case 6:
                var pos15 = cc.v2(0, 0);
                var pos16 = cc.v2(0, 1);
                var pos17 = cc.v2(0, 2);
                var pos18 = cc.v2(-1, 2);
                this.allBlocks = [pos15, pos16, pos17, pos18];
                break;
            case 7:
                var pos19 = cc.v2(0, 0);
                var pos20 = cc.v2(0, 1);
                var pos21 = cc.v2(-1, 1);
                var pos22 = cc.v2(-2, 1);
                this.allBlocks = [pos19, pos20, pos21, pos22];
                break;
            case 8:
                var pos23 = cc.v2(0, 0);
                var pos24 = cc.v2(-1, 0);
                var pos25 = cc.v2(-1, 1);
                var pos26 = cc.v2(-1, 2);
                this.allBlocks = [pos23, pos24, pos25, pos26];
                break;
            case 9:
                var pos27 = cc.v2(0, 0);
                var pos28 = cc.v2(-1, 0);
                var pos29 = cc.v2(-2, 0);
                var pos30 = cc.v2(0, 1);
                this.allBlocks = [pos27, pos28, pos29, pos30];
                break;
            case 10:
                var pos31 = cc.v2(0, 0);
                var pos32 = cc.v2(1, 2);
                var pos33 = cc.v2(0, 1);
                var pos34 = cc.v2(0, 2);
                this.allBlocks = [pos31, pos32, pos33, pos34];
                break;
            case 11:
                var pos35 = cc.v2(0, 0);
                var pos36 = cc.v2(2, 1);
                var pos37 = cc.v2(1, 1);
                var pos38 = cc.v2(0, 1);
                this.allBlocks = [pos35, pos36, pos37, pos38];
                break;
            case 12:
                var pos39 = cc.v2(0, 0);
                var pos40 = cc.v2(0, 1);
                var pos41 = cc.v2(0, 2);
                var pos42 = cc.v2(-1, 0);
                this.allBlocks = [pos39, pos40, pos41, pos42];
                break;
            case 13:
                var pos43 = cc.v2(0, 0);
                var pos44 = cc.v2(-1, 0);
                var pos45 = cc.v2(-2, 0);
                var pos46 = cc.v2(-2, 1);
                this.allBlocks = [pos43, pos44, pos45, pos46];
                break;
            case 14:
                var pos47 = cc.v2(0, 0);
                var pos48 = cc.v2(0, 1);
                var pos49 = cc.v2(-1, 1);
                var pos50 = cc.v2(1, 1);
                this.allBlocks = [pos47, pos48, pos49, pos50];
                break;
            case 15:
                var pos51 = cc.v2(0, 0);
                var pos52 = cc.v2(-1, 0);
                var pos53 = cc.v2(-2, 0);
                var pos54 = cc.v2(-1, 1);
                this.allBlocks = [pos51, pos52, pos53, pos54];
                break;
            case 16:
                var pos55 = cc.v2(0, 0);
                var pos56 = cc.v2(1, 1);
                var pos57 = cc.v2(0, 1);
                var pos58 = cc.v2(0, 2);
                this.allBlocks = [pos55, pos56, pos57, pos58];
                break;
            case 17:
                var pos59 = cc.v2(0, 0);
                var pos60 = cc.v2(0, 1);
                var pos61 = cc.v2(0, 2);
                var pos62 = cc.v2(-1, 1);
                this.allBlocks = [pos59, pos60, pos61, pos62];
                break;
            case 18:
                var pos63 = cc.v2(0, 0);
                var pos64 = cc.v2(0, 1);
                var pos65 = cc.v2(0, 2);
                var pos66 = cc.v2(1, 1);
                var pos67 = cc.v2(-1, 1);
                this.allBlocks = [pos63, pos64, pos65, pos66, pos67];
                break;
            case 19:
                var pos68 = cc.v2(0, 0);
                var pos69 = cc.v2(0, 1);
                var pos70 = cc.v2(-1, 0);
                this.allBlocks = [pos68, pos69, pos70];
                break;
            case 20:
                var pos71 = cc.v2(0, 0);
                var pos72 = cc.v2(-1, 0);
                var pos73 = cc.v2(-1, 1);
                this.allBlocks = [pos71, pos72, pos73];
                break;
            case 21:
                var pos74 = cc.v2(0, 0);
                var pos75 = cc.v2(0, 1);
                var pos76 = cc.v2(1, 1);
                this.allBlocks = [pos74, pos75, pos76];
                break;
            case 22:
                var pos77 = cc.v2(0, 0);
                var pos78 = cc.v2(0, 1);
                var pos79 = cc.v2(-1, 1);
                this.allBlocks = [pos77, pos78, pos79];
                break;
        }
    };
    Block.prototype.setMapBlock = function () {
        if (this.allBlocks.length > 0) {
            for (var i = 0; i < this.allBlocks.length; i++) {
                var pos = this.allBlocks[i];
                var x = this.posX + pos.x;
                var y = this.posY + pos.y;
                Map_1.default._instance.mapBlocksWall[x][y].getComponent("MapBlock").block_Id = this.node.uuid;
            }
        }
    };
    Block.prototype.removeMapBlock = function () {
        if (this.posX == 0 && this.posY == 0) {
            return;
        }
        if (this.allBlocks) {
            if (this.allBlocks.length > 0) {
                for (var i = 0; i < this.allBlocks.length; i++) {
                    if (this.allBlocks[i]) {
                        var pos = this.allBlocks[i];
                        var x = this.posX + pos.x;
                        var y = this.posY + pos.y;
                        if (Map_1.default._instance.mapBlocksWall[x][y]) {
                            if (Map_1.default._instance.mapBlocksWall[x][y].getComponent("MapBlock"))
                                Map_1.default._instance.mapBlocksWall[x][y].getComponent("MapBlock").block_Id = "";
                        }
                    }
                }
            }
        }
    };
    //叠加块，位置差异，校准位置
    Block.prototype.getStackingPos = function () {
        switch (this.node.name) {
            case "block0":
                return cc.v2(-21, 22);
            case "block1":
                return cc.v2(-36, 23);
            case "block2":
                return cc.v2(-18, 40);
            case "block3":
                return cc.v2(-59, 25);
            case "block4":
                return cc.v2(-19, 57);
            case "block5":
                return cc.v2(-36, 38);
            case "block6":
                return cc.v2(-19, 97);
            case "block7":
                return cc.v2(-19, 61);
            case "block8":
                return cc.v2(-55, 24);
            case "block9":
                return cc.v2(-20, 24);
            case "block10":
                return cc.v2(-17, 96);
            case "block11":
                return cc.v2(-17, 58);
            case "block12":
                return cc.v2(-20, 24);
            case "block13":
                return cc.v2(-92, 25);
            case "block14":
                return cc.v2(-18, 60);
            case "block15":
                return cc.v2(-58, 24);
            case "block16":
                return cc.v2(-20, 60);
            case "block17":
                return cc.v2(-17, 60);
            case "block18":
                return cc.v2(-17, 60);
            case "block19":
                return cc.v2(-20, 24);
            case "block20":
                return cc.v2(-54, 25);
            case "block21":
                return cc.v2(-17, 60);
            case "block22":
                return cc.v2(-17, 60);
        }
    };
    Block.prototype.update = function (dt) {
        if (this.isTouch && this.touchDelta.mag() > 0) {
            //this.moveLeft = this.moveRight = this.moveUp = this.moveDown = true;
            var delta = this.touchDelta;
            var newX = this.node.x + delta.x;
            var newY = this.node.y + delta.y;
            var distance = Math.sqrt(Math.pow(newX - this.node.x, 2) + Math.pow(newY - this.node.y, 2));
            var mag = Math.round(delta.mag());
            if (this.moveY === 1) {
                if (this.touchPointY <= this.node.y + this.node.height / 2) {
                    this.moveY = 0;
                }
            }
            else if (this.moveY === -1) {
                if (this.touchPointY >= this.node.y + this.node.height / 2) {
                    this.moveY = 0;
                }
            }
            if (this.moveX === 1) {
                if (this.touchPointX <= this.node.x - this.node.width / 2) {
                    this.moveX = 0;
                }
                else {
                }
            }
            else if (this.moveX === -1) {
                if (this.touchPointX >= this.node.x - this.node.width / 2) {
                    this.moveX = 0;
                }
                else {
                }
            }
            if (distance > 100) {
                mag = 10;
                var speedScale = 0.5;
                delta.x *= speedScale;
                delta.y *= speedScale;
            }
            else {
                if (mag > 5) {
                    mag = Math.floor(mag / 5);
                }
            }
            // mag = 2;
            var stepx = delta.x / mag;
            var stepy = delta.y / mag;
            for (var index = 0; index < mag; index++) {
                this.moveCorner = 0;
                var tempX = this.node.x + stepx;
                var tempY = this.node.y + stepy;
                if (!this.checkCollision) {
                    if (this.type !== 8 && this.type !== 10) {
                        this.node.x = Math.round(tempX);
                    }
                    if (this.type !== 7 && this.type !== 10) {
                        this.node.y = Math.round(tempY);
                    }
                }
                else {
                    var isXMain = Math.abs(stepx) > Math.abs(stepy);
                    if (isXMain) {
                        if (this.node.x > tempX) {
                            if (this.moveLeft && this.moveX === 0 && this.type !== 8 && this.type !== 10) {
                                this.node.x = tempX;
                            }
                            if (this.moveX !== 0) {
                                this.moveX = 0;
                            }
                        }
                        else if (this.node.x <= tempX) {
                            if (this.moveRight && this.moveX === 0 && this.type !== 8 && this.type !== 10) {
                                this.node.x = tempX;
                            }
                            if (this.moveX !== 0) {
                                this.moveX = 0;
                            }
                        }
                        if (this.node.y > tempY) {
                            if (this.moveDown && this.moveY === 0 && this.type !== 7 && this.type !== 10) {
                                this.node.y = tempY;
                            }
                            if (this.moveY !== 0) {
                                this.moveY = 0;
                            }
                        }
                        else if (this.node.y <= tempY) {
                            if (this.moveUp && this.moveY === 0 && this.type !== 7 && this.type !== 10) {
                                this.node.y = tempY;
                            }
                            if (this.moveY !== 0) {
                                this.moveY = 0;
                            }
                        }
                    }
                    else {
                        if (this.node.y > tempY) {
                            if (this.moveDown && this.moveY === 0 && this.type !== 7 && this.type !== 10) {
                                this.node.y = tempY;
                            }
                            if (this.moveY !== 0) {
                                this.moveY = 0;
                            }
                        }
                        else if (this.node.y <= tempY) {
                            if (this.moveUp && this.moveY === 0 && this.type !== 7 && this.type !== 10) {
                                this.node.y = tempY;
                            }
                            if (this.moveY !== 0) {
                                this.moveY = 0;
                            }
                        }
                        if (this.node.x > tempX) {
                            if (this.moveLeft && this.moveX === 0 && this.type !== 8 && this.type !== 10) {
                                this.node.x = tempX;
                            }
                            if (this.moveX !== 0) {
                                this.moveX = 0;
                            }
                        }
                        else if (this.node.x <= tempX) {
                            if (this.moveRight && this.moveX === 0 && this.type !== 8 && this.type !== 10) {
                                this.node.x = tempX;
                            }
                            if (this.moveX !== 0) {
                                this.moveX = 0;
                            }
                        }
                    }
                }
                lq_collide_system_1.LQCollideSystem.update_logic(dt);
            }
            // 移动完成后重置触摸增量
            this.touchDelta = cc.v2(0, 0);
        }
        if (this.type == BlockType.叠加块上 && this.moveStack == true) {
            if (this.stacking.x != 0 || this.stacking.y != 0) {
                this.node.x = this.block_Info.node.x + this.stacking.x;
                this.node.y = this.block_Info.node.y + this.stacking.y;
            }
        }
        if (this.block_Info) {
            if (this.block_Info.node != null) {
                if (this.type == BlockType.粘合块) {
                    if (this.adhesive.x != 0 && this.adhesive.y != 0 && this.block_Info.node != null) {
                        this.block_Info.node.x = this.node.x - this.adhesive.x;
                        this.block_Info.node.y = this.node.y - this.adhesive.y;
                    }
                    if (this.isTouch == true && this.block_Info.node.getComponent("Block").isTouch == false) {
                        lq_collide_system_1.LQCollideSystem.update_logic(dt);
                        this.block_Info.node.x = this.node.x - this.adhesive.x;
                        this.block_Info.node.y = this.node.y - this.adhesive.y;
                    }
                }
            }
        }
    };
    __decorate([
        property({
            tooltip: '碰撞形状，None就是无敌，不参与碰撞',
            type: cc.Enum(BlockType),
        })
    ], Block.prototype, "type", void 0);
    __decorate([
        property({
            tooltip: '碰撞形状，None就是无敌，不参与碰撞',
            type: cc.Enum(BlockColor),
        })
    ], Block.prototype, "color", void 0);
    __decorate([
        property({
            tooltip: '横向长度',
            type: cc.Integer,
        })
    ], Block.prototype, "heng", void 0);
    __decorate([
        property({
            tooltip: '竖向长度',
            type: cc.Integer,
        })
    ], Block.prototype, "shu", void 0);
    __decorate([
        property(cc.SpriteAtlas)
    ], Block.prototype, "ice_SpriteFrame", void 0);
    Block = __decorate([
        ccclass
    ], Block);
    return Block;
}(cc.Component));
exports.default = Block;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 142856 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/prop/Adhesive.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '5fc5bz1aV5PKIBJQh99jpm2', 'Adhesive');
// Script/prop/Adhesive.ts

"use strict";
// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var Adhesive = /** @class */ (function (_super) {
    __extends(Adhesive, _super);
    function Adhesive() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.time = 60;
        _this.pos = { x: 0, y: 0 };
        return _this;
    }
    Adhesive.prototype.onLoad = function () {
        this.pos.x = this.pos.y = 0;
        this.target = null;
    };
    Adhesive.prototype.start = function () {
    };
    Adhesive.prototype.init = function (node) {
        this.pos.x = node.x - this.node.x;
        this.pos.y = node.y - this.node.y;
        this.target = node;
    };
    Adhesive.prototype.remove = function () {
        var _this = this;
        this.target = null;
        for (var j = 0; j < this.node.children.length; j++) {
            if (this.node.children[j].active == true) {
                this.node.children[j].getComponent(sp.Skeleton).setAnimation(0, "animation", false);
            }
        }
        setTimeout(function () {
            _this.node.active = false;
        }, 2000);
    };
    Adhesive.prototype.update = function (dt) {
        if (this.target != null) {
            this.node.x = this.target.x - this.pos.x;
            this.node.y = this.target.y - this.pos.y;
        }
    };
    Adhesive = __decorate([
        ccclass
    ], Adhesive);
    return Adhesive;
}(cc.Component));
exports.default = Adhesive;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 4320 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/Sdk/DouyinEntranceView.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '8a024+q5K9MrpxcaTvucSDB', 'DouyinEntranceView');
// Script/Sdk/DouyinEntranceView.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DouyinEntranceView = void 0;
var MiniGameSdk_1 = require("./MiniGameSdk");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var DouyinEntranceView = /** @class */ (function (_super) {
    __extends(DouyinEntranceView, _super);
    function DouyinEntranceView() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    DouyinEntranceView.prototype.start = function () {
    };
    DouyinEntranceView.prototype.update = function (deltaTime) {
    };
    DouyinEntranceView.prototype.onCloseClick = function () {
        this.node.active = false;
    };
    DouyinEntranceView.prototype.onNavigateToDouyinClick = function () {
        MiniGameSdk_1.MiniGameSdk.BytedanceSidebar.navigateToSidebar(function (success) {
            if (success) {
                console.log('跳转成功');
            }
            else {
                console.log('跳转失败');
            }
        });
    };
    DouyinEntranceView = __decorate([
        ccclass
    ], DouyinEntranceView);
    return DouyinEntranceView;
}(cc.Component));
exports.DouyinEntranceView = DouyinEntranceView;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcU2NyaXB0XFxTZGtcXERvdXlpbkVudHJhbmNlVmlldy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsNkNBQTRDO0FBQ3RDLElBQUEsS0FBd0IsRUFBRSxDQUFDLFVBQVUsRUFBbkMsT0FBTyxhQUFBLEVBQUUsUUFBUSxjQUFrQixDQUFDO0FBSTVDO0lBQXdDLHNDQUFZO0lBQXBEOztJQXVCQSxDQUFDO0lBdEJHLGtDQUFLLEdBQUw7SUFFQSxDQUFDO0lBRUQsbUNBQU0sR0FBTixVQUFPLFNBQWlCO0lBRXhCLENBQUM7SUFFRCx5Q0FBWSxHQUFaO1FBQ0ksSUFBSSxDQUFDLElBQUksQ0FBQyxNQUFNLEdBQUcsS0FBSyxDQUFDO0lBQzdCLENBQUM7SUFFRCxvREFBdUIsR0FBdkI7UUFFSSx5QkFBVyxDQUFDLGdCQUFnQixDQUFDLGlCQUFpQixDQUFDLFVBQUMsT0FBZ0I7WUFDNUQsSUFBSSxPQUFPLEVBQUU7Z0JBQ1QsT0FBTyxDQUFDLEdBQUcsQ0FBQyxNQUFNLENBQUMsQ0FBQzthQUN2QjtpQkFBTTtnQkFDSCxPQUFPLENBQUMsR0FBRyxDQUFDLE1BQU0sQ0FBQyxDQUFDO2FBQ3ZCO1FBQ0wsQ0FBQyxDQUFDLENBQUM7SUFDUCxDQUFDO0lBdEJRLGtCQUFrQjtRQUQ5QixPQUFPO09BQ0ssa0JBQWtCLENBdUI5QjtJQUFELHlCQUFDO0NBdkJELEFBdUJDLENBdkJ1QyxFQUFFLENBQUMsU0FBUyxHQXVCbkQ7QUF2QlksZ0RBQWtCIiwiZmlsZSI6IiIsInNvdXJjZVJvb3QiOiIvIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgTWluaUdhbWVTZGsgfSBmcm9tIFwiLi9NaW5pR2FtZVNka1wiO1xyXG5jb25zdCB7IGNjY2xhc3MsIHByb3BlcnR5IH0gPSBjYy5fZGVjb3JhdG9yO1xyXG5cclxuXHJcbkBjY2NsYXNzXHJcbmV4cG9ydCBjbGFzcyBEb3V5aW5FbnRyYW5jZVZpZXcgZXh0ZW5kcyBjYy5Db21wb25lbnQge1xyXG4gICAgc3RhcnQoKSB7XHJcblxyXG4gICAgfVxyXG5cclxuICAgIHVwZGF0ZShkZWx0YVRpbWU6IG51bWJlcikge1xyXG5cclxuICAgIH1cclxuXHJcbiAgICBvbkNsb3NlQ2xpY2soKSB7XHJcbiAgICAgICAgdGhpcy5ub2RlLmFjdGl2ZSA9IGZhbHNlO1xyXG4gICAgfVxyXG5cclxuICAgIG9uTmF2aWdhdGVUb0RvdXlpbkNsaWNrKCkge1xyXG5cclxuICAgICAgICBNaW5pR2FtZVNkay5CeXRlZGFuY2VTaWRlYmFyLm5hdmlnYXRlVG9TaWRlYmFyKChzdWNjZXNzOiBib29sZWFuKSA9PiB7IC8vIOi3s+i9rOWIsOaKlumfs+S+p+i+ueagj1xyXG4gICAgICAgICAgICBpZiAoc3VjY2Vzcykge1xyXG4gICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+i3s+i9rOaIkOWKnycpO1xyXG4gICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgY29uc29sZS5sb2coJ+i3s+i9rOWksei0pScpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcbn1cclxuIl19
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/prop/Star.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'd773dbWW6tAz6F+Z0L3IXUx', 'Star');
// Script/prop/Star.ts

"use strict";
// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var Map_1 = require("../Map");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var Star = /** @class */ (function (_super) {
    __extends(Star, _super);
    function Star() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.time = 60;
        // mapInfo: number[][] = [];
        _this.star_SpriteFrame = null;
        return _this;
        // update (dt) {}
    }
    Star.prototype.onLoad = function () {
    };
    Star.prototype.start = function () {
    };
    Star.prototype.init = function (time) {
        if (time)
            this.time = time;
        this.node.getChildByName("time").active = true;
        this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString();
        this.schedule(this.updateTime, 1);
    };
    Star.prototype.updateTime = function () {
        this.time--;
        this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString();
        if (this.time <= 0) {
            this.unschedule(this.updateTime);
            this.node.destroy();
            Map_1.default._instance.failLevel();
            // this.node.destroy();
        }
    };
    __decorate([
        property(cc.SpriteAtlas)
    ], Star.prototype, "star_SpriteFrame", void 0);
    Star = __decorate([
        ccclass
    ], Star);
    return Star;
}(cc.Component));
exports.default = Star;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcU2NyaXB0XFxwcm9wXFxTdGFyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxvQkFBb0I7QUFDcEIsd0VBQXdFO0FBQ3hFLG1CQUFtQjtBQUNuQixrRkFBa0Y7QUFDbEYsOEJBQThCO0FBQzlCLGtGQUFrRjs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBRWxGLDhCQUFpQztBQUUzQixJQUFBLEtBQXNCLEVBQUUsQ0FBQyxVQUFVLEVBQWxDLE9BQU8sYUFBQSxFQUFFLFFBQVEsY0FBaUIsQ0FBQztBQUsxQztJQUFrQyx3QkFBWTtJQUE5QztRQUFBLHFFQW1DQztRQWpDRyxVQUFJLEdBQVcsRUFBRSxDQUFDO1FBRWxCLDRCQUE0QjtRQUU1QixzQkFBZ0IsR0FBbUIsSUFBSSxDQUFDOztRQTRCeEMsaUJBQWlCO0lBQ3JCLENBQUM7SUEzQkcscUJBQU0sR0FBTjtJQUVBLENBQUM7SUFFRCxvQkFBSyxHQUFMO0lBQ0EsQ0FBQztJQUVELG1CQUFJLEdBQUosVUFBSyxJQUFJO1FBQ0wsSUFBRyxJQUFJO1lBQUUsSUFBSSxDQUFDLElBQUksR0FBRyxJQUFJLENBQUM7UUFDMUIsSUFBSSxDQUFDLElBQUksQ0FBQyxjQUFjLENBQUMsTUFBTSxDQUFDLENBQUMsTUFBTSxHQUFHLElBQUksQ0FBQztRQUMvQyxJQUFJLENBQUMsSUFBSSxDQUFDLGNBQWMsQ0FBQyxNQUFNLENBQUMsQ0FBQyxZQUFZLENBQUMsRUFBRSxDQUFDLEtBQUssQ0FBQyxDQUFDLE1BQU0sR0FBRyxJQUFJLENBQUMsSUFBSSxDQUFDLFFBQVEsRUFBRSxDQUFDO1FBQ3RGLElBQUksQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDLFVBQVUsRUFBRSxDQUFDLENBQUMsQ0FBQztJQUN0QyxDQUFDO0lBR0QseUJBQVUsR0FBVjtRQUNJLElBQUksQ0FBQyxJQUFJLEVBQUcsQ0FBQztRQUNiLElBQUksQ0FBQyxJQUFJLENBQUMsY0FBYyxDQUFDLE1BQU0sQ0FBQyxDQUFDLFlBQVksQ0FBQyxFQUFFLENBQUMsS0FBSyxDQUFDLENBQUMsTUFBTSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsUUFBUSxFQUFFLENBQUM7UUFDdEYsSUFBRyxJQUFJLENBQUMsSUFBSSxJQUFJLENBQUMsRUFBQztZQUNkLElBQUksQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLFVBQVUsQ0FBQyxDQUFDO1lBQ2pDLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTyxFQUFFLENBQUM7WUFDcEIsYUFBVyxDQUFDLFNBQVMsQ0FBQyxTQUFTLEVBQUUsQ0FBQztZQUNsQyx1QkFBdUI7U0FDMUI7SUFDTCxDQUFDO0lBMUJEO1FBREMsUUFBUSxDQUFDLEVBQUUsQ0FBQyxXQUFXLENBQUM7a0RBQ2U7SUFOdkIsSUFBSTtRQUR4QixPQUFPO09BQ2EsSUFBSSxDQW1DeEI7SUFBRCxXQUFDO0NBbkNELEFBbUNDLENBbkNpQyxFQUFFLENBQUMsU0FBUyxHQW1DN0M7a0JBbkNvQixJQUFJIiwiZmlsZSI6IiIsInNvdXJjZVJvb3QiOiIvIiwic291cmNlc0NvbnRlbnQiOlsiLy8gTGVhcm4gVHlwZVNjcmlwdDpcclxuLy8gIC0gaHR0cHM6Ly9kb2NzLmNvY29zLmNvbS9jcmVhdG9yL21hbnVhbC9lbi9zY3JpcHRpbmcvdHlwZXNjcmlwdC5odG1sXHJcbi8vIExlYXJuIEF0dHJpYnV0ZTpcclxuLy8gIC0gaHR0cHM6Ly9kb2NzLmNvY29zLmNvbS9jcmVhdG9yL21hbnVhbC9lbi9zY3JpcHRpbmcvcmVmZXJlbmNlL2F0dHJpYnV0ZXMuaHRtbFxyXG4vLyBMZWFybiBsaWZlLWN5Y2xlIGNhbGxiYWNrczpcclxuLy8gIC0gaHR0cHM6Ly9kb2NzLmNvY29zLmNvbS9jcmVhdG9yL21hbnVhbC9lbi9zY3JpcHRpbmcvbGlmZS1jeWNsZS1jYWxsYmFja3MuaHRtbFxyXG5cclxuaW1wb3J0IE1hcENvbnJvbGVyIGZyb20gXCIuLi9NYXBcIjtcclxuXHJcbmNvbnN0IHtjY2NsYXNzLCBwcm9wZXJ0eX0gPSBjYy5fZGVjb3JhdG9yO1xyXG5cclxuXHJcblxyXG5AY2NjbGFzc1xyXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBTdGFyIGV4dGVuZHMgY2MuQ29tcG9uZW50IHtcclxuICAgIHN0YXRpYyBfaW5zdGFuY2U6IGFueTtcclxuICAgIHRpbWU6IG51bWJlciA9IDYwO1xyXG5cclxuICAgIC8vIG1hcEluZm86IG51bWJlcltdW10gPSBbXTtcclxuICAgIEBwcm9wZXJ0eShjYy5TcHJpdGVBdGxhcylcclxuICAgIHN0YXJfU3ByaXRlRnJhbWU6IGNjLlNwcml0ZUF0bGFzID0gbnVsbDtcclxuXHJcbiAgICBvbkxvYWQgKCkge1xyXG5cclxuICAgIH0gXHJcblxyXG4gICAgc3RhcnQgKCkge1xyXG4gICAgfVxyXG5cclxuICAgIGluaXQodGltZSl7XHJcbiAgICAgICAgaWYodGltZSkgdGhpcy50aW1lID0gdGltZTtcclxuICAgICAgICB0aGlzLm5vZGUuZ2V0Q2hpbGRCeU5hbWUoXCJ0aW1lXCIpLmFjdGl2ZSA9IHRydWU7XHJcbiAgICAgICAgdGhpcy5ub2RlLmdldENoaWxkQnlOYW1lKFwidGltZVwiKS5nZXRDb21wb25lbnQoY2MuTGFiZWwpLnN0cmluZyA9IHRoaXMudGltZS50b1N0cmluZygpO1xyXG4gICAgICAgIHRoaXMuc2NoZWR1bGUodGhpcy51cGRhdGVUaW1lLCAxKTtcclxuICAgIH1cclxuXHJcbiAgICBcclxuICAgIHVwZGF0ZVRpbWUoKXtcclxuICAgICAgICB0aGlzLnRpbWUgLS07XHJcbiAgICAgICAgdGhpcy5ub2RlLmdldENoaWxkQnlOYW1lKFwidGltZVwiKS5nZXRDb21wb25lbnQoY2MuTGFiZWwpLnN0cmluZyA9IHRoaXMudGltZS50b1N0cmluZygpO1xyXG4gICAgICAgIGlmKHRoaXMudGltZSA8PSAwKXtcclxuICAgICAgICAgICAgdGhpcy51bnNjaGVkdWxlKHRoaXMudXBkYXRlVGltZSk7XHJcbiAgICAgICAgICAgIHRoaXMubm9kZS5kZXN0cm95KCk7XHJcbiAgICAgICAgICAgIE1hcENvbnJvbGVyLl9pbnN0YW5jZS5mYWlsTGV2ZWwoKTtcclxuICAgICAgICAgICAgLy8gdGhpcy5ub2RlLmRlc3Ryb3koKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcblxyXG4gICAgLy8gdXBkYXRlIChkdCkge31cclxufVxyXG4iXX0=
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/lq_collide_system/lq_collide.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'd2addiRqXVKQ4YEp6sK5d6R', 'lq_collide');
// Script/lq_collide_system/lq_collide.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.LQCollide = void 0;
var ccclass = cc._decorator.ccclass;
var property = cc._decorator.property;
var requireComponent = cc._decorator.requireComponent;
var menu = cc._decorator.menu;
var Component = cc.Component;
var Enum = cc.Enum;
var Size = cc.Size;
var Vec2 = cc.Vec2;
var Graphics = cc.Graphics;
var Node = cc.Node;
var macro = cc.macro;
var Color = cc.Color;
var lq_const_1 = require("../lq_base/data/lq_const");
var lq_collide_config_1 = require("./lq_collide_config");
var lq_collide_system_1 = require("./lq_collide_system");
var lq_data_1 = require("../lq_base/data/lq_data");
var lq_collide_base_1 = require("./lq_collide_base");
var lq_game_util_1 = require("../lq_base/util/lq_game_util");
var Map_1 = require("../Map");
var LQCollide = /** @class */ (function (_super) {
    __extends(LQCollide, _super);
    function LQCollide() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this._draw_collide = true;
        _this.can_move = true;
        _this._collide_shape = lq_const_1.LQCollideShape.Rect;
        _this._collide_group_index = -1;
        _this.collide_group_id = 0;
        _this.collide_scle = 1;
        _this._radius = 50;
        _this._size = new Size(100, 100);
        _this._polygon_points = [new Vec2(-45, -45), new Vec2(45, -45), new Vec2(60, 40), new Vec2(0, 70), new Vec2(-60, 40)];
        //collide碰撞位置偏移
        _this._offset = new Vec2(0, 0);
        _this.data_string = '';
        //每个collide的id唯一
        _this.collide_id = 0;
        //状态
        _this.collide_status = lq_const_1.LQCollideStatus.Idle;
        //是否可碰撞
        _this.is_enable = true;
        //是否开启碰撞前后的函数
        _this.is_open_func = true;
        //碰撞类别
        _this.collide_category = 0;
        //碰撞筛选
        _this.collide_mask = 0;
        _this.collide_map = {};
        return _this;
    }
    LQCollide_1 = LQCollide;
    Object.defineProperty(LQCollide.prototype, "draw_collide", {
        get: function () {
            return this._draw_collide;
        },
        set: function (value) {
            this._draw_collide = value;
            this.draw_shape();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(LQCollide.prototype, "collide_shape", {
        get: function () {
            return this._collide_shape;
        },
        set: function (value) {
            this._collide_shape = value;
            this.draw_shape();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(LQCollide.prototype, "collide_group_index", {
        get: function () {
            if (this._collide_group_index === -1) {
                this._collide_group_index = lq_collide_system_1.LQCollideSystem.get_info_by_id(this.collide_group_id).index;
            }
            return this._collide_group_index;
        },
        set: function (value) {
            if (this._collide_group_index === value) {
                return;
            }
            this._collide_group_index = value;
            this.collide_group_id = lq_collide_system_1.LQCollideSystem.get_group_by_index(value).id;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(LQCollide.prototype, "radius", {
        get: function () {
            return this._radius;
        },
        set: function (value) {
            this._radius = value;
            this.draw_shape();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(LQCollide.prototype, "size", {
        // 物体速度
        // public velocity: Vec2 = new Vec2(0, 0);
        get: function () {
            return this._size;
        },
        set: function (value) {
            this._size = value;
            if (this.world_rect) {
                this.world_rect.width = value.width;
                this.world_rect.height = value.height;
                this.world_rect.half_width = value.width * 0.5;
                this.world_rect.half_height = value.height * 0.5;
            }
            this.draw_shape();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(LQCollide.prototype, "offset", {
        get: function () {
            return this._offset;
        },
        set: function (value) {
            this._offset = value;
            this.draw_shape();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(LQCollide.prototype, "polygon_points", {
        get: function () {
            return this._polygon_points;
        },
        set: function (value) {
            this._polygon_points = value;
            this.draw_shape();
        },
        enumerable: false,
        configurable: true
    });
    //检测绘制组件是否添加
    LQCollide.prototype.checkDebugDrawValid = function () {
        if (!this._debugDrawer || !this._debugDrawer.isValid) {
            var node = this.node.getChildByName('Collide');
            if (!node) {
                node = new Node('Collide');
                node.zIndex = macro.MAX_ZINDEX;
                this.node.addChild(node);
                // @ts-ignore
                node._objFlags = 1096;
                this._debugDrawer = node.addComponent(Graphics);
                this._debugDrawer.lineWidth = 3;
                this._debugDrawer.strokeColor = new Color(255, 0, 0);
                this._debugDrawer.fillColor = new Color(255, 0, 0);
            }
            else {
                this._debugDrawer = node.getComponent(Graphics);
            }
        }
    };
    //绘制形状
    LQCollide.prototype.draw_shape = function () {
        if (!this._draw_collide) {
            if (this._debugDrawer) {
                this._debugDrawer.clear();
            }
            return;
        }
        this.checkDebugDrawValid();
        this._debugDrawer.clear();
        var o1 = { key: 'scaleX', value: this.node.scale };
        var o2 = { key: 'scaleY', value: this.node.scale };
        lq_game_util_1.LQGameUtil.recursion_node_property(this.node, o1);
        lq_game_util_1.LQGameUtil.recursion_node_property(this.node, o2);
        if (o1.value === 0 || o2.value === 0) {
            return;
        }
        this._debugDrawer.node.scaleX = 1 / o1.value;
        this._debugDrawer.node.scaleY = 1 / o2.value;
        switch (this._collide_shape) {
            case lq_const_1.LQCollideShape.Circle:
                this._debugDrawer.circle(+this._offset.x, +this._offset.y, this._radius);
                this._debugDrawer.stroke();
                break;
            case lq_const_1.LQCollideShape.Rect:
                this._debugDrawer.moveTo(-this._size.width * 0.5 + this._offset.x, -this._size.height * 0.5 + this._offset.y);
                this._debugDrawer.lineTo(-this._size.width * 0.5 + this._offset.x, +this._size.height * 0.5 + this._offset.y);
                this._debugDrawer.lineTo(this._size.width * 0.5 + this._offset.x, +this._size.height * 0.5 + this._offset.y);
                this._debugDrawer.lineTo(this._size.width * 0.5 + this._offset.x, -this._size.height * 0.5 + this._offset.y);
                this._debugDrawer.lineTo(-this._size.width * 0.5 + this._offset.x, -this._size.height * 0.5 + this._offset.y);
                this._debugDrawer.stroke();
                break;
            case lq_const_1.LQCollideShape.Polygon:
                this._debugDrawer.moveTo(this._polygon_points[0].x + this._offset.x, this._polygon_points[0].y + this._offset.y);
                for (var i = 1; i < this._polygon_points.length; i++) {
                    this._debugDrawer.lineTo(this._polygon_points[i].x + this._offset.x, this._polygon_points[i].y + this._offset.y);
                }
                this._debugDrawer.lineTo(this._polygon_points[0].x + this._offset.x, this._polygon_points[0].y + this._offset.y);
                this._debugDrawer.stroke();
                break;
        }
    };
    //仅用于矩形
    LQCollide.prototype.update_size = function (width, height) {
        this._size.width = width;
        this.world_rect.width = width;
        this.world_rect.half_width = width * 0.5;
        this._size.height = height;
        this.world_rect.height = height;
        this.world_rect.half_height = height * 0.5;
        this.draw_shape();
    };
    LQCollide.prototype.init_lq_collide = function () {
        this.world_rect = new lq_data_1.LQRect(0, 0, this._size.width, this._size.height);
        this.draw_shape();
        var info = lq_collide_system_1.LQCollideSystem.get_info_by_id(this.collide_group_id);
        this.collide_mask = info.mask;
        this.collide_category = info.category;
        this.collide_id = LQCollide_1.id_maker++;
        this.updateCollisionArea();
    };
    LQCollide.prototype.updateCollisionArea = function () {
        if (this._size.width == 0 || this._size.height == 0 || Map_1.default._instance == undefined) {
            return;
        }
        if (Map_1.default._instance.node.scale) {
            var scaleX_1 = Map_1.default._instance.node.scale;
            var scaleY_1 = Map_1.default._instance.node.scale;
            if (scaleX_1 === 0 || scaleX_1 == undefined || scaleX_1 == null || scaleX_1 == 1) {
                return;
            }
            switch (this._collide_shape) {
                case lq_const_1.LQCollideShape.Circle:
                    // 圆形碰撞区域半径更新
                    this._radius = this._radius * Math.max(scaleX_1, scaleY_1);
                    break;
                case lq_const_1.LQCollideShape.Rect:
                    // 矩形碰撞区域尺寸更新
                    // console.log(this.data_string);
                    if (this._size.width !== 10 && this.data_string != "-1") {
                        // if(this._size.width == 105 || this._size.height == 105){}
                        this._size.width = this._size.width * scaleX_1;
                        //  console.log("放大倍数",scaleX);
                    }
                    if (this._size.height !== 10 && this.data_string != "-1") {
                        // if(this._size.width == 105 || this._size.height == 105){}
                        this._size.height = this._size.height * scaleY_1;
                        // console.log("放大倍数",scaleY);
                    }
                    // this._size.width = this._size.width * scaleX;
                    // this._size.height = this._size.height * scaleY;
                    if (this.world_rect) {
                        this.world_rect.width = this._size.width;
                        this.world_rect.height = this._size.height;
                        this.world_rect.half_width = this._size.width * 0.5;
                        this.world_rect.half_height = this._size.height * 0.5;
                    }
                    break;
                case lq_const_1.LQCollideShape.Polygon:
                    // 多边形碰撞点坐标更新
                    this._polygon_points = this._polygon_points.map(function (point) {
                        return new Vec2(point.x * scaleX_1, point.y * scaleY_1);
                    });
                    break;
            }
            this.draw_shape();
        }
    };
    LQCollide.prototype.enable_lq_collide = function () {
        if (this.collide_status === lq_const_1.LQCollideStatus.Live) {
            console.warn(this.node.name + '重复添加');
            return;
        }
        this.is_enable = true;
        this.collide_status = lq_const_1.LQCollideStatus.Live;
        lq_collide_system_1.LQCollideSystem.add_collide(this);
    };
    LQCollide.prototype.disable_lq_collide = function () {
        if (this.collide_status !== lq_const_1.LQCollideStatus.Live) {
            return;
        }
        this.is_enable = false;
        this.collide_status = lq_const_1.LQCollideStatus.Idle;
        lq_collide_system_1.LQCollideSystem.remove_collide(this);
    };
    LQCollide.prototype.update_lq_collide = function () {
    };
    // @ts-ignore
    // public on_collide(collide: LQCollide): void {
    //     if(collide.node.parent.uuid == this.node.parent.uuid){
    //         return;
    //     }
    //     if (LQCollideConfig.switch_print_log) {
    //         if(this.node.parent.getComponent("Block")){
    //             let block = this.node.parent.getComponent("Block");
    //             if(block.isTouch){
    //                 block.checkCollision = true;
    //                 // console.log("碰撞",this.node.name);
    //                 if(this.node.name == "top" ){
    //                     console.log("碰到上边缘");
    //                     block.moveUp = false;
    //                     if(block.touchPointY > (this.node.parent.y+this.node.height)){
    //                         block.moveY = 1;
    //                     }
    //                 }
    //                 if(this.node.name === "down"){
    //                     block.moveDown = false;
    //                     console.log("碰到下边缘");
    //                     if(block.touchPointY < (this.node.parent.y )){
    //                         block.moveY = -1;
    //                     }
    //                 }
    //                 if(this.node.name === "left" ){
    //                     block.moveLeft = false;
    //                     console.log("碰到左边缘");
    //                     if(block.touchPointX < (this.node.parent.x - this.node.parent.width)){
    //                         block.moveX = -1;
    //                     }
    //                 }
    //                 if(this.node.name === "right"){
    //                     block.moveRight = false;
    //                     console.log("碰到右边缘");
    //                     if(block.touchPointX > (this.node.parent.x)){
    //                         block.moveX = 1;
    //                     }
    //                 }
    //             }
    //         }
    //     }
    // }
    //@ts-ignore
    LQCollide.prototype.on_enter = function (collide) {
        if (this.disableCollider(collide)) {
            return;
        }
        // if (LQCollideConfig.switch_print_log) {
        //     console.log(this.node.name + ' on_enter');
        // }
    };
    //@ts-ignore
    LQCollide.prototype.on_exit = function (collide) {
        if (this.disableCollider(collide)) {
            return;
        }
        if (lq_collide_config_1.LQCollideConfig.switch_print_log) {
            if (this.node.parent.getComponent("Block")) {
                var block = this.node.parent.getComponent("Block");
                // if(!block.isTouch){
                //     return;
                // }
                block.checkCollision = false;
                if (this.node.name == "top") {
                    block.moveUp = true;
                }
                if (this.node.name === "down") {
                    block.moveDown = true;
                }
                if (this.node.name === "left") {
                    block.moveLeft = true;
                }
                if (this.node.name === "right") {
                    block.moveRight = true;
                }
            }
        }
    };
    LQCollide.prototype.on_collide = function (collide) {
        if (this.disableCollider(collide)) {
            return;
        }
        if (lq_collide_config_1.LQCollideConfig.switch_print_log) {
            if (this.node.parent.getComponent("Block")) {
                var block = this.node.parent.getComponent("Block");
                var jg = false;
                if (block.isTouch) {
                    block.checkCollision = true;
                    // console.log("碰撞",this.node.name);
                    if (this.node.name == "top") {
                        // console.log(collide.node.parent.name);
                        block.moveUp = false;
                        if (block.touchPointY > (this.node.parent.y + this.node.parent.height)) {
                            block.moveY = 1;
                        }
                        // console.log("碰到上边缘");
                    }
                    if (this.node.name === "down") {
                        block.moveDown = false;
                        if (block.touchPointY < (this.node.parent.y)) {
                            block.moveY = -1;
                        }
                        // console.log("碰到下边缘");
                    }
                    if (this.node.name === "left") {
                        block.moveLeft = false;
                        if (block.touchPointX < (this.node.parent.x - this.node.parent.width)) {
                            block.moveX = -1;
                        }
                    }
                    if (this.node.name === "right") {
                        block.moveRight = false;
                        if (block.touchPointX > (this.node.parent.x)) {
                            block.moveX = 1;
                        }
                    }
                }
            }
        }
    };
    LQCollide.prototype.disableCollider = function (collide) {
        var jg = false;
        if (collide.node && this.node) {
            if (collide.node.parent && this.node.parent) {
                if (collide.node.parent.uuid == this.node.parent.uuid) {
                    jg = true;
                }
                if (this.node.parent.getComponent("Block")) {
                    var block = this.node.parent.getComponent("Block");
                    if (block.type == 1 || block.type == 10 || block.type == 9) {
                        if (collide.node.parent == block.block_Info.node) {
                            jg = true;
                        }
                    }
                }
            }
        }
        return jg;
    };
    var LQCollide_1;
    LQCollide.id_maker = 1;
    __decorate([
        property({ displayName: '绘制形状' })
    ], LQCollide.prototype, "draw_collide", null);
    __decorate([
        property
    ], LQCollide.prototype, "_draw_collide", void 0);
    __decorate([
        property({ tooltip: '能否移动' })
    ], LQCollide.prototype, "can_move", void 0);
    __decorate([
        property({
            tooltip: '碰撞形状，None就是无敌，不参与碰撞',
            type: Enum(lq_const_1.LQCollideShape),
            displayName: '碰撞形状'
        })
    ], LQCollide.prototype, "collide_shape", null);
    __decorate([
        property()
    ], LQCollide.prototype, "_collide_shape", void 0);
    __decorate([
        property({
            type: Enum(lq_collide_config_1.LQCollideInfoList), tooltip: '碰撞类别',
            displayName: '碰撞类别'
        })
    ], LQCollide.prototype, "collide_group_index", null);
    __decorate([
        property({ serializable: false })
    ], LQCollide.prototype, "_collide_group_index", void 0);
    __decorate([
        property({ visible: false })
    ], LQCollide.prototype, "collide_group_id", void 0);
    __decorate([
        property({ visible: false })
    ], LQCollide.prototype, "collide_scle", void 0);
    __decorate([
        property({
            tooltip: 'collide半径',
            visible: function () {
                // @ts-ignore
                return this._collide_shape === lq_const_1.LQCollideShape.Circle;
            },
            displayName: '半径'
        })
    ], LQCollide.prototype, "radius", null);
    __decorate([
        property()
    ], LQCollide.prototype, "_radius", void 0);
    __decorate([
        property({
            tooltip: 'collide长宽',
            visible: function () {
                // @ts-ignore
                return this._collide_shape === lq_const_1.LQCollideShape.Rect;
            },
            displayName: '长宽'
        })
    ], LQCollide.prototype, "size", null);
    __decorate([
        property()
    ], LQCollide.prototype, "_size", void 0);
    __decorate([
        property({ displayName: '位置偏移' })
    ], LQCollide.prototype, "offset", null);
    __decorate([
        property({
            type: Vec2,
            visible: function () {
                // @ts-ignore
                return this._collide_shape === lq_const_1.LQCollideShape.Polygon;
            },
            displayName: '多边形碰撞点'
        })
    ], LQCollide.prototype, "polygon_points", null);
    __decorate([
        property()
    ], LQCollide.prototype, "_polygon_points", void 0);
    __decorate([
        property()
    ], LQCollide.prototype, "_offset", void 0);
    __decorate([
        property({ displayName: '自定义字符串' })
    ], LQCollide.prototype, "data_string", void 0);
    LQCollide = LQCollide_1 = __decorate([
        ccclass,
        requireComponent(lq_collide_base_1.LQCollideBase),
        menu("lq/collide")
    ], LQCollide);
    return LQCollide;
}(Component));
exports.LQCollide = LQCollide;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 46216 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/lq_base/data/lq_data.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'a54702UNV9NA7pYgQd6eA5/', 'lq_data');
// Script/lq_base/data/lq_data.ts

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LQPlatformData = exports.LQShareData = exports.LQNativeComponent = exports.LQRect = void 0;
var Vec2 = cc.Vec2;
var Rect = cc.Rect;
var LQRect = /** @class */ (function () {
    function LQRect(x, y, width, height) {
        this.x = x;
        this.y = y;
        this.width = width;
        this.height = height;
        this.half_width = width * 0.5;
        this.half_height = height * 0.5;
    }
    LQRect.prototype.top_left = function () {
        return new Vec2(this.x - this.half_width, this.y + this.half_height);
    };
    LQRect.prototype.top_right = function () {
        return new Vec2(this.x + this.half_width, this.y + this.half_height);
    };
    LQRect.prototype.bottom_left = function () {
        return new Vec2(this.x - this.half_width, this.y - this.half_height);
    };
    LQRect.prototype.bottom_right = function () {
        return new Vec2(this.x + this.half_width, this.y - this.half_height);
    };
    LQRect.prototype.pos = function () {
        return new Vec2(this.x, this.y);
    };
    LQRect.prototype.sub = function (pos) {
        return new Vec2(pos.x - this.x, pos.y - this.y);
    };
    LQRect.prototype.add = function (pos) {
        return new Vec2(pos.x + this.x, pos.y + this.y);
    };
    LQRect.prototype.to_cocos_rect = function () {
        return new Rect(this.x - this.half_width, this.y - this.half_height, this.width, this.height);
    };
    return LQRect;
}());
exports.LQRect = LQRect;
var LQNativeComponent = /** @class */ (function () {
    function LQNativeComponent() {
        this.node_btn_arr = [];
    }
    return LQNativeComponent;
}());
exports.LQNativeComponent = LQNativeComponent;
var LQShareData = /** @class */ (function () {
    function LQShareData(obj) {
        if (obj.title) {
            this.title = obj.title;
        }
        if (obj.remote_url) {
            this.remote_url = obj.remote_url;
        }
        if (obj.url_id) {
            this.url_id = obj.url_id;
        }
        if (obj.query) {
            this.query = obj.query;
        }
        if (obj.content) {
            this.content = obj.content;
        }
        if (obj.extra) {
            this.extra = obj.extra;
        }
        if (obj.type) {
            this.type = obj.type;
        }
    }
    return LQShareData;
}());
exports.LQShareData = LQShareData;
var LQPlatformData = /** @class */ (function () {
    function LQPlatformData() {
    }
    return LQPlatformData;
}());
exports.LQPlatformData = LQPlatformData;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 8076 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/lq_base/util/lq_game_util.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '63c53CB9dhL/phFOPtTeuF7', 'lq_game_util');
// Script/lq_base/util/lq_game_util.ts

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LQGameUtil = void 0;
var director = cc.director;
var tween = cc.tween;
var visibleRect = cc.visibleRect;
var find = cc.find;
var LQGameUtil = /** @class */ (function () {
    function LQGameUtil() {
    }
    LQGameUtil.get_image = function (url, callback, cache) {
        if (cache === void 0) { cache = true; }
        if (!url || url === '') {
            callback(false, undefined);
            return;
        }
        if (this.image_cache[url]) {
            callback(true, this.image_cache[url]);
            return;
        }
        // cc.loader.load(
        //     {url: url, type: 'png'},
        //     (err: string, texture: Texture2D | undefined) => {
        //         if (err) {
        //             // console.error('err:' + err);
        //             callback(false, undefined);
        //             return;
        //         }
        //         const frame = new SpriteFrame(texture);
        //         callback(true, frame);
        //         if (cache) {
        //             this.image_cache[url] = frame;
        //         }
        //     });
    };
    LQGameUtil.canvas_policy = function (c, width, height) {
        // @ts-ignore
        var ratio = visibleRect.height / visibleRect.width;
        if (ratio > height / width) {
            c.fitHeight = false;
            c.fitWidth = true;
        }
        else {
            c.fitHeight = true;
            c.fitWidth = false;
        }
        return c.fitHeight;
    };
    LQGameUtil.recursion_node_property = function (node, p) {
        if (node.parent) {
            // @ts-ignore
            p.value *= node.parent[p.key];
            this.recursion_node_property(node.parent, p);
        }
    };
    /**
     *
     * @param path
     * eg.'Canvas>node_main>btn_start'
     */
    LQGameUtil.find_node = function (path) {
        if (!path || path.length <= 0) {
            console.warn('路径不正确');
            return undefined;
        }
        var arr = path.split('/');
        var root = find(arr[0]);
        if (!root) {
            console.warn('没找到节点:' + arr[0]);
            return undefined;
        }
        var node = root;
        for (var i = 1; i < arr.length; i++) {
            var temp = node.getChildByName(arr[i]);
            if (!temp) {
                console.warn('没找到节点:' + arr[i]);
                return undefined;
            }
            node = temp;
        }
        return node;
    };
    LQGameUtil.wait = function (time) {
        return new Promise(function (resolve) {
            tween(director.getScene()).delay(time).call(function () {
                resolve();
            }).start();
        });
    };
    LQGameUtil.set_clip = function (clip, off, flip_x, flip_y) {
        var s = function (arr) {
            for (var i = 0; i < arr.length; i++) {
                if (i % 2 === 0) {
                    if (flip_x) {
                        arr[i] = -arr[i];
                    }
                    arr[i] += off.x;
                }
                else {
                    if (flip_y) {
                        arr[i] = -arr[i];
                    }
                    arr[i] += off.y;
                }
            }
        };
        var pos_arr = clip.curveData.props.position;
        for (var i = 0; i < pos_arr.length; i++) {
            var motionPath = pos_arr[i].motionPath;
            var value = pos_arr[i].value;
            if (motionPath) {
                for (var i_1 = 0; i_1 < motionPath.length; i_1++) {
                    s(motionPath[i_1]);
                }
            }
            s(value);
        }
    };
    LQGameUtil.scroll_layout = function (layout, speed) {
        if (speed === void 0) { speed = 50; }
        layout.updateLayout();
        var len = layout.type === cc.Layout.Type.HORIZONTAL ? layout.node.width : layout.node.height;
        var time = len / speed;
        if (layout.type === cc.Layout.Type.HORIZONTAL) {
            var offset_1 = layout.node.anchorX === 1 ? layout.node.width * 0.5 : -layout.node.width * 0.5;
            layout.node.runAction(cc.repeatForever(cc.sequence(cc.moveBy(time, cc.v2(offset_1, 0)), cc.callFunc(function () {
                layout.node.x -= offset_1;
            }))));
        }
        else if (layout.type === cc.Layout.Type.VERTICAL || layout.type === cc.Layout.Type.GRID) {
            var offset_2 = layout.node.anchorY === 1 ? layout.node.height * 0.5 : -layout.node.height * 0.5;
            layout.node.runAction(cc.repeatForever(cc.sequence(cc.moveBy(time, cc.v2(0, offset_2)), cc.callFunc(function () {
                layout.node.y -= offset_2;
            }))));
        }
    };
    LQGameUtil.image_cache = {};
    return LQGameUtil;
}());
exports.LQGameUtil = LQGameUtil;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 13648 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/lq_base/util/lq_pool_util.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '984882e2dpD17LvCQnTDykE', 'lq_pool_util');
// Script/lq_base/util/lq_pool_util.ts

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LQPoolUtil = void 0;
var Animation = cc.Animation;
var ParticleSystem = cc.ParticleSystem;
var instantiate = cc.instantiate;
var LQPoolUtil = /** @class */ (function () {
    function LQPoolUtil() {
    }
    LQPoolUtil.reset_ani = function (node) {
        var ani = node.getComponent(Animation);
        if (ani) {
            var clip = ani.currentClip ? ani.currentClip : ani.defaultClip;
            if (!clip) {
                return;
            }
            if (ani.playOnLoad && clip && clip.wrapMode === cc.WrapMode.Normal) {
                ani.play(clip.name);
            }
        }
        else {
            var ani_1 = node.getComponent(sp.Skeleton);
            if (ani_1 && !ani_1.loop) {
                ani_1.setAnimation(0, ani_1.animation, false);
            }
        }
        for (var i = 0; i < node.childrenCount; i++) {
            var child = node.children[i];
            this.reset_ani(child);
        }
    };
    LQPoolUtil.recursion_stop_particle = function (node, obj) {
        var p = node.getComponent(ParticleSystem);
        if (p) {
            p.stopSystem();
            obj.has = true;
            p.node.opacity = 0;
        }
        for (var i = 0; i < node.childrenCount; i++) {
            var child = node.children[i];
            this.recursion_stop_particle(child, obj);
        }
    };
    LQPoolUtil.recursion_reset_particle = function (node) {
        if (!node.isValid) {
            return;
        }
        var p = node.getComponent(ParticleSystem);
        if (p) {
            p.resetSystem();
            p.node.opacity = 255;
        }
        for (var i = 0; i < node.childrenCount; i++) {
            var child = node.children[i];
            this.recursion_reset_particle(child);
        }
    };
    LQPoolUtil.get_node_from_pool = function (node_parent, prefab) {
        var arr = this.any_pool[prefab.uuid];
        if (!arr) {
            this.any_pool[prefab.uuid] = [];
            arr = [];
        }
        var node = arr.pop();
        if (!node || !node.isValid) {
            node = instantiate(prefab);
            //@ts-ignore
            node.recovery_uuid = prefab.uuid;
            //@ts-ignore
            node.is_from_pool = false;
            node_parent.addChild(node);
        }
        else {
            node.active = true;
            //@ts-ignore
            node.is_from_pool = true;
            this.reset_ani(node);
        }
        return node;
    };
    LQPoolUtil.check_pool_push = function (arr, node) {
        for (var i = 0; i < arr.length; i++) {
            if (arr[i] === node) {
                //@ts-ignore
                console.warn("\u6C60\u5B50\u4E0D\u80FD\u91CD\u590D\u6DFB\u52A0\u8282\u70B9", node.name, node.recovery_uuid);
                return;
            }
        }
        node.active = false;
        arr.push(node);
    };
    LQPoolUtil.push_node_to_pool = function (node) {
        var _this = this;
        //@ts-ignore
        if (!node.recovery_uuid || !this.any_pool[node.recovery_uuid]) {
            if (node.isValid) {
                node.destroy();
            }
            return;
        }
        var obj = { has: false };
        this.recursion_stop_particle(node, obj);
        if (obj.has) {
            var old_opacity_1 = node.opacity;
            node.opacity = 0;
            setTimeout(function () {
                _this.recursion_reset_particle(node);
                node.opacity = old_opacity_1;
                //@ts-ignore
                _this.check_pool_push(_this.any_pool[node.recovery_uuid], node);
            }, 500);
        }
        else {
            //@ts-ignore
            this.check_pool_push(this.any_pool[node.recovery_uuid], node);
        }
    };
    LQPoolUtil.any_pool = {};
    return LQPoolUtil;
}());
exports.LQPoolUtil = LQPoolUtil;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 10540 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/lq_base/util/lq_platform_util.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '35875T0lsRL3rzhNkUdX4/G', 'lq_platform_util');
// Script/lq_base/util/lq_platform_util.ts

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LQPlatformUtil = void 0;
var lq_const_1 = require("../data/lq_const");
var LQPlatformUtil = /** @class */ (function () {
    function LQPlatformUtil() {
    }
    LQPlatformUtil.init = function () {
        if (typeof qq !== 'undefined') {
            this.platform_type = lq_const_1.LQPlatformType.qq;
        }
        else if (typeof swan !== 'undefined') {
            this.platform_type = lq_const_1.LQPlatformType.baidu;
        }
        else if (typeof tt !== 'undefined') {
            this.platform_type = lq_const_1.LQPlatformType.tt;
            var info = tt.getSystemInfoSync();
            switch (info.appName) {
                case 'Toutiao':
                    this.byte_dance_type = lq_const_1.LQByteDanceType.tt;
                    break;
                case 'news_article_lite':
                    this.byte_dance_type = lq_const_1.LQByteDanceType.tt_lite;
                    break;
                case 'Douyin':
                    this.byte_dance_type = lq_const_1.LQByteDanceType.douyin;
                    break;
                case 'douyin_lite':
                    this.byte_dance_type = lq_const_1.LQByteDanceType.douyin_lite;
                    break;
                case 'PPX':
                    this.byte_dance_type = lq_const_1.LQByteDanceType.ppx;
                    break;
                case 'devtools':
                    this.byte_dance_type = lq_const_1.LQByteDanceType.devtools;
                    break;
            }
        }
        else if (typeof qg !== 'undefined') {
            if (!!qg.getBattle) {
                this.platform_type = lq_const_1.LQPlatformType.oppo;
            }
            else {
                this.platform_type = lq_const_1.LQPlatformType.vivo;
            }
        }
        else if (typeof wx !== 'undefined') {
            this.platform_type = lq_const_1.LQPlatformType.wx;
        }
        else if (typeof jsb !== 'undefined') {
            if (cc.sys.os === cc.sys.OS_ANDROID) {
                this.platform_type = lq_const_1.LQPlatformType.android;
            }
            else if (cc.sys.os === cc.sys.OS_IOS) {
                this.platform_type = lq_const_1.LQPlatformType.ios;
            }
            else {
                this.platform_type = lq_const_1.LQPlatformType.unknown;
            }
        }
        else if (cc.sys.isBrowser) {
            this.platform_type = lq_const_1.LQPlatformType.browser;
        }
    };
    LQPlatformUtil.get_platform = function () {
        return this.platform_type;
    };
    LQPlatformUtil.get_byte_dance = function () {
        return this.byte_dance_type;
    };
    LQPlatformUtil.is_wx = function () {
        return this.platform_type === lq_const_1.LQPlatformType.wx;
    };
    LQPlatformUtil.is_tt = function () {
        return this.platform_type === lq_const_1.LQPlatformType.tt;
    };
    LQPlatformUtil.is_oppo = function () {
        return this.platform_type === lq_const_1.LQPlatformType.oppo;
    };
    LQPlatformUtil.is_vivo = function () {
        return this.platform_type === lq_const_1.LQPlatformType.vivo;
    };
    LQPlatformUtil.is_ov = function () {
        return this.platform_type === lq_const_1.LQPlatformType.oppo || this.platform_type === lq_const_1.LQPlatformType.vivo;
    };
    LQPlatformUtil.is_browser = function () {
        return this.platform_type === lq_const_1.LQPlatformType.browser;
    };
    LQPlatformUtil.is_android = function () {
        return this.platform_type === lq_const_1.LQPlatformType.android;
    };
    LQPlatformUtil.is_ios = function () {
        return this.platform_type === lq_const_1.LQPlatformType.ios;
    };
    LQPlatformUtil.is_native = function () {
        return this.platform_type === lq_const_1.LQPlatformType.android || this.platform_type === lq_const_1.LQPlatformType.ios;
    };
    LQPlatformUtil.is_qq = function () {
        return this.platform_type === lq_const_1.LQPlatformType.qq;
    };
    LQPlatformUtil.is_baidu = function () {
        return this.platform_type === lq_const_1.LQPlatformType.baidu;
    };
    LQPlatformUtil.is_kwaigame = function () {
        return this.platform_type === lq_const_1.LQPlatformType.kwaigame;
    };
    return LQPlatformUtil;
}());
exports.LQPlatformUtil = LQPlatformUtil;
LQPlatformUtil.init();
if (LQPlatformUtil.is_tt()) {
    // console.log('---------当前平台:' + LQPlatformUtil.get_byte_dance());
}
else {
    // console.log('---------当前平台:' + LQPlatformUtil.get_platform());
}

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 9720 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/module/RankList/List.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'd5421HgLShFKIjj5f18m1mi', 'List');
// Script/module/RankList/List.ts

"use strict";
// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.StartAxisType = exports.ListType = void 0;
var ItemRender_1 = require("./ItemRender");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
/**列表排列方式 */
var ListType;
(function (ListType) {
    /**水平排列 */
    ListType[ListType["Horizontal"] = 1] = "Horizontal";
    /**垂直排列 */
    ListType[ListType["Vertical"] = 2] = "Vertical";
    /**网格排列 */
    ListType[ListType["Grid"] = 3] = "Grid";
})(ListType = exports.ListType || (exports.ListType = {}));
/**网格布局中的方向 */
var StartAxisType;
(function (StartAxisType) {
    /**水平排列 */
    StartAxisType[StartAxisType["Horizontal"] = 1] = "Horizontal";
    /**垂直排列 */
    StartAxisType[StartAxisType["Vertical"] = 2] = "Vertical";
})(StartAxisType = exports.StartAxisType || (exports.StartAxisType = {}));
/**
 * 列表
 * 根据cocos_example的listView改动而来
 * @author chenkai 2020.7.8
 * @example
 *  1.创建cocos的ScrollView组件，添加List，设置List属性即可
 *
 */
var List = /** @class */ (function (_super) {
    __extends(List, _super);
    function List() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        //==================== 属性面板 =========================
        /**列表选项 */
        _this.itemRender = null;
        /**排列方式 */
        _this.type = ListType.Vertical;
        /**网格布局中的方向 */
        _this.startAxis = StartAxisType.Horizontal;
        /**列表项之间X间隔 */
        _this.spaceX = 0;
        /**列表项之间Y间隔 */
        _this.spaceY = 0;
        /**上间距 */
        _this.padding_top = 0;
        /**下间距 */
        _this.padding_buttom = 0;
        /**左间距 */
        _this.padding_left = 0;
        _this._padding = 0;
        /**右间距 */
        _this.padding_right = 0;
        //====================== 滚动容器 ===============================
        /**列表滚动容器 */
        _this.scrollView = null;
        /**scrollView的内容容器 */
        _this.content = null;
        //======================== 列表项 ===========================
        /**列表项数据 */
        _this.itemDataList = [];
        /**应创建的实例数量 */
        _this.spawnCount = 0;
        /**存放列表项实例的数组 */
        _this.itemList = [];
        /**item的高度 */
        _this.itemHeight = 0;
        /**item的宽度 */
        _this.itemWidth = 0;
        /**存放不再使用中的列表项 */
        _this.itemPool = [];
        //======================= 计算参数 ==========================
        /**距离scrollView中心点的距离，超过这个距离的item会被重置，一般设置为 scrollVIew.height/2 + item.heigt/2 + space，因为这个距离item正好超出scrollView显示范围 */
        _this.halfScrollView = 0;
        /**上一次content的X值，用于和现在content的X值比较，得出是向左还是向右滚动 */
        _this.lastContentPosX = 0;
        /**上一次content的Y值，用于和现在content的Y值比较，得出是向上还是向下滚动 */
        _this.lastContentPosY = 0;
        /**网格行数 */
        _this.gridRow = 0;
        /**网格列数 */
        _this.gridCol = 0;
        /**刷新时间，单位s */
        _this.updateTimer = 0;
        /**刷新间隔，单位s */
        _this.updateInterval = 0.1;
        /**是否滚动容器 */
        _this.bScrolling = false;
        /**刷新的函数 */
        _this.updateFun = function () { };
        return _this;
    }
    List.prototype.onLoad = function () {
        this.itemHeight = this.itemRender.height;
        this.itemWidth = this.itemRender.width;
        this.scrollView = this.node.getComponent(cc.ScrollView);
        this.content = this.scrollView.content;
        this.content.anchorX = 0;
        this.content.anchorY = 1;
        this.content.removeAllChildren();
        this.scrollView.node.on("scrolling", this.onScrolling, this);
    };
    /**
     * 列表数据 (列表数据复制使用，如果列表数据改变，则需要重新设置一遍数据)
     * @param itemDataList item数据列表
     */
    List.prototype.setData = function (itemDataList) {
        this.itemDataList = itemDataList.slice();
        this.updateContent();
    };
    /**计算列表的各项参数 */
    List.prototype.countListParam = function () {
        var dataLen = this.itemDataList.length;
        if (this.type == ListType.Vertical) {
            this.scrollView.horizontal = false;
            this.scrollView.vertical = true;
            this.content.width = this.content.parent.width;
            this.content.height = dataLen * this.itemHeight + (dataLen - 1) * this.spaceY + this.padding_top + this.padding_buttom;
            this.spawnCount = Math.round(this.scrollView.node.height / (this.itemHeight + this.spaceY)) + 2; //计算创建的item实例数量，比当前scrollView容器能放下的item数量再加上2个
            this.halfScrollView = this.scrollView.node.height / 2 + this.itemHeight / 2 + this.spaceY; //计算bufferZone，item的显示范围
            this.updateFun = this.updateV;
        }
        else if (this.type == ListType.Horizontal) {
            this.scrollView.horizontal = true;
            this.scrollView.vertical = false;
            this.content.width = dataLen * this.itemWidth + (dataLen - 1) * this.spaceX + this.padding_left + this.padding_right;
            this.content.height = this.content.parent.height;
            this.spawnCount = Math.round(this.scrollView.node.width / (this.itemWidth + this.spaceX)) + 2;
            this.halfScrollView = this.scrollView.node.width / 2 + this.itemWidth / 2 + this.spaceX;
            this.updateFun = this.udpateH;
        }
        else if (this.type == ListType.Grid) {
            if (this.startAxis == StartAxisType.Vertical) {
                this.scrollView.horizontal = false;
                this.scrollView.vertical = true;
                this.content.width = this.content.parent.width;
                //如果left和right间隔过大，导致放不下一个item，则left和right都设置为0，相当于不生效
                if (this.padding_left + this.padding_right + this.itemWidth + this.spaceX > this.content.width) {
                    this.padding_left = 0;
                    this.padding_right = 0;
                    console.error("padding_left或padding_right过大");
                }
                this.gridCol = Math.floor((this.content.width - this.padding_left - this.padding_right) / (this.itemWidth + this.spaceX));
                this.gridRow = Math.ceil(dataLen / this.gridCol);
                this.content.height = this.gridRow * this.itemHeight + (this.gridRow - 1) * this.spaceY + this.padding_top + this.padding_buttom;
                this.spawnCount = Math.round(this.scrollView.node.height / (this.itemHeight + this.spaceY)) * this.gridCol + this.gridCol * 2;
                this.halfScrollView = this.scrollView.node.height / 2 + this.itemHeight / 2 + this.spaceY;
                this.updateFun = this.updateGrid_V;
            }
            else if (this.startAxis == StartAxisType.Horizontal) {
                this.scrollView.horizontal = true;
                this.scrollView.vertical = false;
                //计算高间隔
                this.content.height = this.content.parent.height;
                //如果left和right间隔过大，导致放不下一个item，则left和right都设置为0，相当于不生效
                if (this.padding_top + this.padding_buttom + this.itemHeight + this.spaceY > this.content.height) {
                    this.padding_top = 0;
                    this.padding_buttom = 0;
                    console.error("padding_top或padding_buttom过大");
                }
                this.gridRow = Math.floor((this.content.height - this.padding_top - this.padding_buttom) / (this.itemHeight + this.spaceY));
                this.gridCol = Math.ceil(dataLen / this.gridRow);
                this.content.width = this.gridCol * this.itemWidth + (this.gridCol - 1) * this.spaceX + this.padding_left + this.padding_right;
                this.spawnCount = Math.round(this.scrollView.node.width / (this.itemWidth + this.spaceX)) * this.gridRow + this.gridRow * 2;
                this.halfScrollView = this.scrollView.node.width / 2 + this.itemWidth / 2 + this.spaceX;
                this.updateFun = this.updateGrid_H;
            }
        }
    };
    /**
     * 创建列表
     * @param startIndex 起始显示的数据索引 0表示第一项
     * @param offset     scrollView偏移量
     */
    List.prototype.createList = function (startIndex, offset) {
        //当需要显示的数据长度 > 虚拟列表长度， 删除最末尾几个数据时，列表需要重置位置到scrollView最底端
        if (this.itemDataList.length > this.spawnCount && (startIndex + this.spawnCount - 1) >= this.itemDataList.length) {
            startIndex = this.itemDataList.length - this.spawnCount;
            offset = this.scrollView.getMaxScrollOffset();
            //当需要显示的数据长度 <= 虚拟列表长度， 隐藏多余的虚拟列表项 
        }
        else if (this.itemDataList.length <= this.spawnCount) {
            startIndex = 0;
        }
        for (var i = 0; i < this.spawnCount; i++) {
            var item = void 0;
            //需要显示的数据索引在数据范围内，则item实例显示出来
            if (i + startIndex < this.itemDataList.length) {
                if (this.itemList[i] == null) {
                    item = this.getItem();
                    this.itemList.push(item);
                    item.parent = this.content;
                }
                else {
                    item = this.itemList[i];
                }
                //需要显示的数据索引超过了数据范围，则item实例隐藏起来
            }
            else {
                //item实例数量 > 需要显示的数据量
                if (this.itemList.length > (this.itemDataList.length - startIndex)) {
                    item = this.itemList.pop();
                    item.removeFromParent();
                    this.itemPool.push(item);
                }
                continue;
            }
            var itemRender = item.getComponent(ItemRender_1.default);
            itemRender.itemIndex = i + startIndex;
            itemRender.data = this.itemDataList[i + startIndex];
            itemRender.dataChanged();
            if (this.type == ListType.Vertical) {
                //因为content的锚点X是0，所以item的x值是content.with/2表示居中，锚点Y是1，所以item的y值从content顶部向下是0到负无穷。所以item.y= -item.height/2时，是在content的顶部。
                item.setPosition(this.content.width / 2, -item.height * (0.5 + i + startIndex) - this.spaceY * (i + startIndex) - this.padding_top);
            }
            else if (this.type == ListType.Horizontal) {
                item.setPosition(item.width * (0.5 + i + startIndex) + this.spaceX * (i + startIndex) + this.padding_left, -this.content.height / 2);
            }
            else if (this.type == ListType.Grid) {
                if (this.startAxis == StartAxisType.Vertical) {
                    var row = Math.floor((i + startIndex) / this.gridCol);
                    var col = (i + startIndex) % this.gridCol;
                    item.setPosition(item.width * (0.5 + col) + this.spaceX * col + this.padding_left, -item.height * (0.5 + row) - this.spaceY * row - this.padding_top);
                    item.opacity = 255;
                }
                else if (this.startAxis == StartAxisType.Horizontal) {
                    var row = (i + startIndex) % this.gridRow;
                    var col = Math.floor((i + startIndex) / this.gridRow);
                    item.setPosition(item.width * (0.5 + col) + this.spaceX * col + this.padding_left, -item.height * (0.5 + row) - this.spaceY * row - this.padding_top);
                    item.opacity = 255;
                }
            }
        }
        this.scrollView.scrollToOffset(offset);
    };
    /**获取一个列表项 */
    List.prototype.getItem = function () {
        if (this.itemPool.length == 0) {
            return cc.instantiate(this.itemRender);
        }
        else {
            return this.itemPool.pop();
        }
    };
    List.prototype.update = function (dt) {
        if (this.bScrolling == false) {
            return;
        }
        this.updateTimer += dt;
        if (this.updateTimer < this.updateInterval) {
            return;
        }
        this.updateTimer = 0;
        this.bScrolling = false;
        this.updateFun();
    };
    List.prototype.onScrolling = function () {
        this.bScrolling = true;
    };
    /**垂直排列 */
    List.prototype.updateV = function () {
        var items = this.itemList;
        var item;
        var bufferZone = this.halfScrollView;
        var isUp = this.scrollView.content.y > this.lastContentPosY;
        var offset = (this.itemHeight + this.spaceY) * items.length;
        for (var i = 0; i < items.length; i++) {
            item = items[i];
            var viewPos = this.getPositionInView(item);
            if (isUp) {
                //item上滑时，超出了scrollView上边界，将item移动到下方复用，item移动到下方的位置必须不超过content的下边界
                if (viewPos.y > bufferZone && item.y - offset - this.padding_buttom > -this.content.height) {
                    var itemRender = item.getComponent(ItemRender_1.default);
                    var itemIndex = itemRender.itemIndex + items.length;
                    itemRender.itemIndex = itemIndex;
                    itemRender.data = this.itemDataList[itemIndex];
                    itemRender.dataChanged();
                    item.y = item.y - offset;
                }
            }
            else {
                //item下滑时，超出了scrollView下边界，将item移动到上方复用，item移动到上方的位置必须不超过content的上边界
                if (viewPos.y < -bufferZone && item.y + offset + this.padding_top < 0) {
                    var itemRender = item.getComponent(ItemRender_1.default);
                    var itemIndex = itemRender.itemIndex - items.length;
                    itemRender.itemIndex = itemIndex;
                    itemRender.data = this.itemDataList[itemIndex];
                    itemRender.dataChanged();
                    item.y = item.y + offset;
                }
            }
        }
        this.lastContentPosY = this.scrollView.content.y;
    };
    /**水平排列 */
    List.prototype.udpateH = function () {
        var items = this.itemList;
        var item;
        var bufferZone = this.halfScrollView;
        var isRight = this.scrollView.content.x > this.lastContentPosX;
        var offset = (this.itemWidth + this.spaceX) * items.length;
        for (var i = 0; i < items.length; i++) {
            item = items[i];
            var viewPos = this.getPositionInView(item);
            if (isRight) {
                //item右滑时，超出了scrollView右边界，将item移动到左方复用，item移动到左方的位置必须不超过content的左边界
                if (viewPos.x > bufferZone && item.x - offset - this.padding_left > 0) {
                    var itemRender = item.getComponent(ItemRender_1.default);
                    var itemIndex = itemRender.itemIndex - items.length;
                    itemRender.itemIndex = itemIndex;
                    itemRender.data = this.itemDataList[itemIndex];
                    itemRender.dataChanged();
                    item.x = item.x - offset;
                }
            }
            else {
                //item左滑时，超出了scrollView左边界，将item移动到右方复用，item移动到右方的位置必须不超过content的右边界
                if (viewPos.x < -bufferZone && item.x + offset + this.padding_right < this.content.width) {
                    var itemRender = item.getComponent(ItemRender_1.default);
                    var itemIndex = itemRender.itemIndex + items.length;
                    itemRender.itemIndex = itemIndex;
                    itemRender.data = this.itemDataList[itemIndex];
                    itemRender.dataChanged();
                    item.x = item.x + offset;
                }
            }
        }
        this.lastContentPosX = this.scrollView.content.x;
    };
    /**网格垂直排列 */
    List.prototype.updateGrid_V = function () {
        var items = this.itemList;
        var item;
        var bufferZone = this.halfScrollView;
        var isUp = this.scrollView.content.y > this.lastContentPosY;
        var offset = (this.itemHeight + this.spaceY) * (this.spawnCount / this.gridCol);
        for (var i = 0; i < items.length; i++) {
            item = items[i];
            var viewPos = this.getPositionInView(item);
            if (isUp) {
                //item上滑时，超出了scrollView上边界，将item移动到下方复用，item移动到下方的位置必须不超过content的下边界
                if (viewPos.y > bufferZone && item.y - offset - this.padding_buttom > -this.content.height) {
                    var itemRender = item.getComponent(ItemRender_1.default);
                    var itemIndex = itemRender.itemIndex + (this.spawnCount / this.gridCol) * this.gridCol;
                    if (this.itemDataList[itemIndex] != null) {
                        item.y = item.y - offset;
                        itemRender.itemIndex = itemIndex;
                        itemRender.data = this.itemDataList[itemIndex];
                        itemRender.dataChanged();
                        item.opacity = 255;
                    }
                    else {
                        item.y = item.y - offset;
                        itemRender.itemIndex = itemIndex;
                        item.opacity = 0;
                    }
                }
            }
            else { //item下滑时，超出了scrollView下边界，将item移动到上方复用，item移动到上方的位置必须不超过content的上边界
                if (viewPos.y < -bufferZone && item.y + offset + this.padding_top < 0) {
                    var itemRender = item.getComponent(ItemRender_1.default);
                    var itemIndex = itemRender.itemIndex - (this.spawnCount / this.gridCol) * this.gridCol;
                    if (this.itemDataList[itemIndex] != null) {
                        item.y = item.y + offset;
                        itemRender.itemIndex = itemIndex;
                        itemRender.data = this.itemDataList[itemIndex];
                        itemRender.dataChanged();
                        item.opacity = 255;
                    }
                    else {
                        item.y = item.y + offset;
                        itemRender.itemIndex = itemIndex;
                        item.opacity = 0;
                    }
                }
            }
        }
        this.lastContentPosY = this.scrollView.content.y;
    };
    /**网格水平排列 */
    List.prototype.updateGrid_H = function () {
        var items = this.itemList;
        var item;
        var bufferZone = this.halfScrollView;
        var isRight = this.scrollView.content.x > this.lastContentPosX;
        var offset = (this.itemWidth + this.spaceX) * (this.spawnCount / this.gridRow);
        for (var i = 0; i < items.length; i++) {
            item = items[i];
            var viewPos = this.getPositionInView(item);
            if (isRight) {
                //item右滑时，超出了scrollView右边界，将item移动到左方复用，item移动到左方的位置必须不超过content的左边界
                if (viewPos.x > bufferZone && item.x - offset - this.padding_left > 0) {
                    var itemRender = item.getComponent(ItemRender_1.default);
                    var itemIndex = itemRender.itemIndex - (this.spawnCount / this.gridRow) * this.gridRow;
                    if (this.itemDataList[itemIndex] != null) {
                        item.x = item.x - offset;
                        itemRender.itemIndex = itemIndex;
                        itemRender.data = this.itemDataList[itemIndex];
                        itemRender.dataChanged();
                        item.opacity = 255;
                    }
                    else {
                        item.x = item.x - offset;
                        itemRender.itemIndex = itemIndex;
                        item.opacity = 0;
                    }
                }
            }
            else {
                //item左滑时，超出了scrollView左边界，将item移动到右方复用，item移动到右方的位置必须不超过content的右边界
                if (viewPos.x < -bufferZone && item.x + offset + this.padding_right < this.content.width) {
                    var itemRender = item.getComponent(ItemRender_1.default);
                    var itemIndex = itemRender.itemIndex + (this.spawnCount / this.gridRow) * this.gridRow;
                    if (this.itemDataList[itemIndex] != null) {
                        item.x = item.x + offset;
                        itemRender.itemIndex = itemIndex;
                        itemRender.data = this.itemDataList[itemIndex];
                        itemRender.dataChanged();
                        item.opacity = 255;
                    }
                    else {
                        item.x = item.x + offset;
                        itemRender.itemIndex = itemIndex;
                        item.opacity = 0;
                    }
                }
            }
        }
        this.lastContentPosX = this.scrollView.content.x;
    };
    /**获取item在scrollView的局部坐标 */
    List.prototype.getPositionInView = function (item) {
        var worldPos = item.parent.convertToWorldSpaceAR(item.position);
        var viewPos = this.scrollView.node.convertToNodeSpaceAR(worldPos);
        return viewPos;
    };
    /**获取列表数据 */
    List.prototype.getListData = function () {
        return this.itemDataList;
    };
    /**
     * 增加一项数据到列表的末尾
     * @param data 数据
     */
    List.prototype.addItem = function (data) {
        this.itemDataList.push(data);
        this.updateContent();
    };
    /**
     * 增加一项数据到列表指定位置
     * @param index   位置，0表示第1项
     * @param data  数据
     */
    List.prototype.addItemAt = function (index, data) {
        if (this.itemDataList[index] != null || this.itemDataList.length == index) {
            this.itemDataList.splice(index, 1, data);
            this.updateContent();
        }
    };
    /**
     * 删除一项数据
     * @param index 删除项的位置 ,0表示第1项
     */
    List.prototype.deleteItem = function (index) {
        if (this.itemDataList[index] != null) {
            this.itemDataList.splice(index, 1);
            this.updateContent();
        }
    };
    /**
     * 改变一项数据
     * @param index   位置,0表示第1项
     * @param data  替换的数据
     */
    List.prototype.changeItem = function (index, data) {
        if (this.itemDataList[index] != null) {
            this.itemDataList[index] = data;
            this.updateContent();
        }
    };
    /**获取第一个Item的位置 */
    List.prototype.updateContent = function () {
        //显示列表实例为0个
        if (this.itemList.length == 0) {
            this.countListParam();
            this.createList(0, new cc.Vec2(0, 0));
            //显示列表的实例不为0个，则需要重新排列item实例数组
        }
        else {
            if (this.type == ListType.Vertical) {
                this.itemList.sort(function (a, b) {
                    return b.y - a.y;
                });
            }
            else if (this.type == ListType.Horizontal) {
                this.itemList.sort(function (a, b) {
                    return a.x - b.x;
                });
            }
            else if (this.type == ListType.Grid) {
                if (this.startAxis == StartAxisType.Vertical) {
                    this.itemList.sort(function (a, b) {
                        return a.x - b.x;
                    });
                    this.itemList.sort(function (a, b) {
                        return b.y - a.y;
                    });
                }
                else if (this.startAxis == StartAxisType.Horizontal) {
                    this.itemList.sort(function (a, b) {
                        return b.y - a.y;
                    });
                    this.itemList.sort(function (a, b) {
                        return a.x - b.x;
                    });
                }
            }
            this.countListParam();
            //获取第一个item实例需要显示的数据索引
            var startIndex = this.itemList[0].getComponent(ItemRender_1.default).itemIndex;
            if (this.type == ListType.Grid && this.startAxis == StartAxisType.Vertical) {
                startIndex += (startIndex + this.spawnCount) % this.gridCol;
            }
            else if (this.type == ListType.Grid && this.startAxis == StartAxisType.Horizontal) {
                startIndex += (startIndex + this.spawnCount) % this.gridRow;
            }
            //getScrollOffset()和scrollToOffset()的x值是相反的
            var offset = this.scrollView.getScrollOffset();
            offset.x = -offset.x;
            this.createList(startIndex, offset);
        }
    };
    /**销毁 */
    List.prototype.onDestroy = function () {
        //清理列表项
        var len = this.itemList.length;
        for (var i = 0; i < len; i++) {
            if (cc.isValid(this.itemList[i], true)) {
                this.itemList[i].destroy();
            }
        }
        this.itemList.length = 0;
        //清理对象池
        len = this.itemPool.length;
        for (var i = 0; i < len; i++) {
            if (cc.isValid(this.itemPool[i], true)) {
                this.itemPool[i].destroy();
            }
        }
        this.itemPool.length = 0;
        //清理列表数据
        this.itemDataList.length = 0;
    };
    __decorate([
        property({ type: cc.Node, tooltip: "列表项" })
    ], List.prototype, "itemRender", void 0);
    __decorate([
        property({ type: cc.Enum(ListType), tooltip: "排列方式" })
    ], List.prototype, "type", void 0);
    __decorate([
        property({ type: cc.Enum(StartAxisType), tooltip: "网格布局中的方向", visible: function () { return this.type == ListType.Grid; } })
    ], List.prototype, "startAxis", void 0);
    __decorate([
        property({ type: cc.Integer, tooltip: "列表项X间隔", visible: function () { return (this.type == ListType.Horizontal || this.type == ListType.Grid); } })
    ], List.prototype, "spaceX", void 0);
    __decorate([
        property({ type: cc.Integer, tooltip: "列表项Y间隔", visible: function () { return this.type == ListType.Vertical || this.type == ListType.Grid; } })
    ], List.prototype, "spaceY", void 0);
    __decorate([
        property({ type: cc.Integer, tooltip: "上间距", visible: function () { return (this.type == ListType.Vertical || this.type == ListType.Grid); } })
    ], List.prototype, "padding_top", void 0);
    __decorate([
        property({ type: cc.Integer, tooltip: "下间距", visible: function () { return (this.type == ListType.Vertical || this.type == ListType.Grid); } })
    ], List.prototype, "padding_buttom", void 0);
    __decorate([
        property({ type: cc.Integer, tooltip: "左间距", visible: function () { return (this.type == ListType.Horizontal || this.type == ListType.Grid); } })
    ], List.prototype, "padding_left", void 0);
    __decorate([
        property(cc.Integer)
    ], List.prototype, "_padding", void 0);
    __decorate([
        property({ type: cc.Integer, tooltip: "右间距", visible: function () { return (this.type == ListType.Horizontal || this.type == ListType.Grid); } })
    ], List.prototype, "padding_right", void 0);
    List = __decorate([
        ccclass
    ], List);
    return List;
}(cc.Component));
exports.default = List;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 68832 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/prop/Boom.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '3c749iEEwlAMKPyjGEkwU2l', 'Boom');
// Script/prop/Boom.ts

"use strict";
// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var Map_1 = require("../Map");
var NumberToImage_1 = require("../NumberToImage");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var Boom = /** @class */ (function (_super) {
    __extends(Boom, _super);
    function Boom() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.time = 60;
        return _this;
        // update (dt) {}
    }
    // mapInfo: number[][] = [];
    Boom.prototype.onLoad = function () {
    };
    Boom.prototype.start = function () {
    };
    Boom.prototype.init = function (time) {
        if (time)
            this.time = time;
        this.node.getChildByName("time").active = true;
        NumberToImage_1.default.numberToImageNodes(this.time, 20, 8, "lock_", this.node.getChildByName("time"), false);
        // this.node.getChildByName("time").getComponent(cc.Label).string = this.time.toString();
    };
    Boom.prototype.startBoom = function () {
        this.schedule(this.updateTime, 1);
    };
    Boom.prototype.stopBoom = function () {
        this.unschedule(this.updateTime);
        this.node.parent.getComponent("Block").resetFreeze();
        this.node.destroy();
    };
    Boom.prototype.updateTime = function () {
        var _this = this;
        this.time--;
        NumberToImage_1.default.numberToImageNodes(this.time, 20, 8, "lock_", this.node.getChildByName("time"), false);
        if (this.time <= 0) {
            this.unschedule(this.updateTime);
            this.node.getChildByName("zhandan").active = true;
            var skeleton = this.node.getChildByName("zhandan").getComponent(sp.Skeleton);
            skeleton.setAnimation(1, "eff", false);
            // 监听动画完成事件
            skeleton.setCompleteListener(function () {
                // 动画播放完成后销毁节点
                _this.node.destroy();
            });
            Map_1.default._instance.failLevel("boom");
            // this.node.destroy();
        }
    };
    Boom = __decorate([
        ccclass
    ], Boom);
    return Boom;
}(cc.Component));
exports.default = Boom;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 5408 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/lq_base/util/lq_base_util.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'cd21fuTZY5LOoiXtN66R7wx', 'lq_base_util');
// Script/lq_base/util/lq_base_util.ts

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LQBaseUtil = void 0;
var lq_platform_util_1 = require("./lq_platform_util");
var lq_const_1 = require("../data/lq_const");
var view = cc.view;
var LQBaseUtil = /** @class */ (function () {
    function LQBaseUtil() {
    }
    // public static readonly unit_arr = ['K', 'M', 'B', 'T'];
    LQBaseUtil.has_value = function (arr, v) {
        var has = false;
        for (var i = 0; i < arr.length; i++) {
            if (arr[i] === v) {
                has = true;
                break;
            }
        }
        return has;
    };
    LQBaseUtil.get_value_by_duration = function (percent, timeline) {
        if (timeline.length === 0) {
            return 1;
        }
        var end_index = -1;
        for (var i = 1; i < timeline.length; i++) {
            if (timeline[i].x > percent) {
                end_index = i;
                break;
            }
        }
        if (end_index === -1) {
            return timeline[timeline.length - 1].y;
        }
        var start_index = end_index - 1;
        return timeline[start_index].y + (timeline[end_index].y - timeline[start_index].y) * ((percent - timeline[start_index].x) / (timeline[end_index].x - timeline[start_index].x));
    };
    LQBaseUtil.number_to_counting = function (num) {
        if (num < 1000) {
            return num + '';
        }
        else if (num < 1000000) {
            return Math.floor(num / 1000) + 'K';
        }
        else if (num < 1000000000) {
            return Math.floor(num / 1000000) + 'M';
        }
        else if (num < 1000000000000) {
            return Math.floor(num / 1000000000) + 'B';
        }
        else if (num < 1000000000000000) {
            return Math.floor(num / 1000000000000) + 'T';
        }
        return Math.floor(num / 1000000000000) + 'T';
    };
    LQBaseUtil.number_to_time = function (time) {
        var t = Math.floor(time / (60 * 60));
        time = time - t * 60 * 60;
        var hour = t.toString();
        var min = Math.floor(time / 60).toString();
        var sec = (time % 60).toString();
        if (hour.length === 1) {
            hour = '0' + hour;
        }
        if (min.length === 1) {
            min = '0' + min;
        }
        if (sec.length === 1) {
            sec = '0' + sec;
        }
        return [hour, min, sec];
    };
    LQBaseUtil.set_normal_angle = function (angle) {
        while (angle > 360) {
            angle -= 360;
        }
        while (angle < 0) {
            angle += 360;
        }
        return angle;
    };
    LQBaseUtil.compare_version = function (v1, v2) {
        var v1_arr = v1.split('.');
        var v2_arr = v2.split('.');
        var len = Math.max(v1_arr.length, v2_arr.length);
        while (v1_arr.length < len) {
            v1_arr.push('0');
        }
        while (v2_arr.length < len) {
            v2_arr.push('0');
        }
        for (var i = 0; i < len; i++) {
            var num1 = parseInt(v1_arr[i]);
            var num2 = parseInt(v2_arr[i]);
            if (num1 > num2) {
                return 1;
            }
            else if (num1 < num2) {
                return -1;
            }
        }
        return 0;
    };
    LQBaseUtil.is_today = function (date) {
        var d1 = new Date();
        var d2;
        if (date && date !== '') {
            d2 = new Date(date);
        }
        else {
            d2 = new Date();
            d2.setDate(d2.getDate() - 1);
        }
        return d1.getFullYear() === d2.getFullYear() && d1.getMonth() === d2.getMonth() && d1.getDate() === d2.getDate();
    };
    LQBaseUtil.is_safe_area = function () {
        var cb = function (width, height) {
            return (width === 2280 && height === 1080) || (width === 1792 && height === 828) || (width === 2436 && height === 1125) || (width === 2688 && height === 1242);
        };
        switch (lq_platform_util_1.LQPlatformUtil.get_platform()) {
            case lq_const_1.LQPlatformType.baidu:
                var sys_info_swan = swan.getSystemInfoSync();
                return cb(sys_info_swan.pixelRatio * sys_info_swan.screenWidth, sys_info_swan.pixelRatio * sys_info_swan.screenHeight);
            case lq_const_1.LQPlatformType.qq:
                var sys_info_qq = qq.getSystemInfoSync();
                return cb(sys_info_qq.pixelRatio * sys_info_qq.screenWidth, sys_info_qq.pixelRatio * sys_info_qq.screenHeight);
            case lq_const_1.LQPlatformType.tt:
                var sys_info_tt = tt.getSystemInfoSync();
                return cb(sys_info_tt.pixelRatio * sys_info_tt.screenWidth, sys_info_tt.pixelRatio * sys_info_tt.screenHeight);
            case lq_const_1.LQPlatformType.oppo:
            case lq_const_1.LQPlatformType.vivo:
                var sys_info_vivo = qg.getSystemInfoSync();
                return cb(sys_info_vivo.pixelRatio * sys_info_vivo.screenWidth, sys_info_vivo.pixelRatio * sys_info_vivo.screenHeight);
            case lq_const_1.LQPlatformType.wx:
                var sys_info_wx = wx.getSystemInfoSync();
                return cb(sys_info_wx.pixelRatio * sys_info_wx.screenWidth, sys_info_wx.pixelRatio * sys_info_wx.screenHeight);
            case lq_const_1.LQPlatformType.android:
                break;
            case lq_const_1.LQPlatformType.ios:
                var size = view.getFrameSize();
                return cb(size.width, size.height);
        }
        return false;
    };
    LQBaseUtil.deep_clone = function (obj) {
        if (typeof obj !== 'object') {
            return obj;
        }
        var new_obj = (obj instanceof Array ? [] : {});
        for (var key in obj) {
            if (typeof obj[key] === 'object') {
                new_obj[key] = this.deep_clone(obj[key]);
            }
            else {
                new_obj[key] = obj[key];
            }
        }
        return new_obj;
    };
    return LQBaseUtil;
}());
exports.LQBaseUtil = LQBaseUtil;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 16232 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/shop/script/item.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'de906iE/HVHpI6VO7IMvKaI', 'item');
// shop/script/item.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var NewClass = /** @class */ (function (_super) {
    __extends(NewClass, _super);
    function NewClass() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.label = null;
        _this.text = 'hello';
        return _this;
        // update (dt) {}
    }
    // LIFE-CYCLE CALLBACKS:
    // onLoad () {}
    NewClass.prototype.start = function () {
    };
    //购买商品道具
    NewClass.prototype.buyProp = function (propName) {
        // if(cc.fx.GameConfig.GM_INFO.coin < 1500){
        //     MiniGameSdk.API.showToast("金币不足，无法购买道具");
        //     return;
        // }
        // let propWindow = this.node.parent.parent.getChildByName("propWindow");
        // propWindow.active = false;
        // cc.fx.GameConfig.GM_INFO.coin -= 1500;
    };
    __decorate([
        property(cc.Label)
    ], NewClass.prototype, "label", void 0);
    __decorate([
        property
    ], NewClass.prototype, "text", void 0);
    NewClass = __decorate([
        ccclass
    ], NewClass);
    return NewClass;
}(cc.Component));
exports.default = NewClass;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0c1xcc2hvcFxcc2NyaXB0XFxpdGVtLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUVNLElBQUEsS0FBd0IsRUFBRSxDQUFDLFVBQVUsRUFBbkMsT0FBTyxhQUFBLEVBQUUsUUFBUSxjQUFrQixDQUFDO0FBRzVDO0lBQXNDLDRCQUFZO0lBQWxEO1FBQUEscUVBMkJDO1FBeEJHLFdBQUssR0FBYSxJQUFJLENBQUM7UUFHdkIsVUFBSSxHQUFXLE9BQU8sQ0FBQzs7UUFvQnZCLGlCQUFpQjtJQUNyQixDQUFDO0lBcEJHLHdCQUF3QjtJQUV4QixlQUFlO0lBRWYsd0JBQUssR0FBTDtJQUVBLENBQUM7SUFFRCxRQUFRO0lBQ1IsMEJBQU8sR0FBUCxVQUFRLFFBQVE7UUFDWiw0Q0FBNEM7UUFDNUMsZ0RBQWdEO1FBQ2hELGNBQWM7UUFDZCxJQUFJO1FBQ0oseUVBQXlFO1FBQ3pFLDZCQUE2QjtRQUM3Qix5Q0FBeUM7SUFDN0MsQ0FBQztJQXJCRDtRQURDLFFBQVEsQ0FBQyxFQUFFLENBQUMsS0FBSyxDQUFDOzJDQUNJO0lBR3ZCO1FBREMsUUFBUTswQ0FDYztJQU5OLFFBQVE7UUFENUIsT0FBTztPQUNhLFFBQVEsQ0EyQjVCO0lBQUQsZUFBQztDQTNCRCxBQTJCQyxDQTNCcUMsRUFBRSxDQUFDLFNBQVMsR0EyQmpEO2tCQTNCb0IsUUFBUSIsImZpbGUiOiIiLCJzb3VyY2VSb290IjoiLyIsInNvdXJjZXNDb250ZW50IjpbIlxuXG5jb25zdCB7IGNjY2xhc3MsIHByb3BlcnR5IH0gPSBjYy5fZGVjb3JhdG9yO1xuXG5AY2NjbGFzc1xuZXhwb3J0IGRlZmF1bHQgY2xhc3MgTmV3Q2xhc3MgZXh0ZW5kcyBjYy5Db21wb25lbnQge1xuXG4gICAgQHByb3BlcnR5KGNjLkxhYmVsKVxuICAgIGxhYmVsOiBjYy5MYWJlbCA9IG51bGw7XG5cbiAgICBAcHJvcGVydHlcbiAgICB0ZXh0OiBzdHJpbmcgPSAnaGVsbG8nO1xuICAgIC8vIExJRkUtQ1lDTEUgQ0FMTEJBQ0tTOlxuXG4gICAgLy8gb25Mb2FkICgpIHt9XG5cbiAgICBzdGFydCgpIHtcblxuICAgIH1cblxuICAgIC8v6LSt5Lmw5ZWG5ZOB6YGT5YW3XG4gICAgYnV5UHJvcChwcm9wTmFtZSkge1xuICAgICAgICAvLyBpZihjYy5meC5HYW1lQ29uZmlnLkdNX0lORk8uY29pbiA8IDE1MDApe1xuICAgICAgICAvLyAgICAgTWluaUdhbWVTZGsuQVBJLnNob3dUb2FzdChcIumHkeW4geS4jei2s++8jOaXoOazlei0reS5sOmBk+WFt1wiKTtcbiAgICAgICAgLy8gICAgIHJldHVybjtcbiAgICAgICAgLy8gfVxuICAgICAgICAvLyBsZXQgcHJvcFdpbmRvdyA9IHRoaXMubm9kZS5wYXJlbnQucGFyZW50LmdldENoaWxkQnlOYW1lKFwicHJvcFdpbmRvd1wiKTtcbiAgICAgICAgLy8gcHJvcFdpbmRvdy5hY3RpdmUgPSBmYWxzZTtcbiAgICAgICAgLy8gY2MuZnguR2FtZUNvbmZpZy5HTV9JTkZPLmNvaW4gLT0gMTUwMDtcbiAgICB9XG5cbiAgICAvLyB1cGRhdGUgKGR0KSB7fVxufVxuIl19
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/tiledmap-optimize-resource/Script/TmoObjectGroup.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '30e2eSQWDNKI69FbaYfN62j', 'TmoObjectGroup');
// Script/TmoObjectGroup.js

"use strict";

exports.__esModule = true;
exports["default"] = void 0;
// Learn cc.Class:
//  - https://docs.cocos.com/creator/manual/en/scripting/class.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

var TmoSprite = require("./TmoSprite");
var _default = cc.Class({
  "extends": cc.TiledObjectGroup,
  _init: function _init(groupInfo, mapInfo, texGrids, tiledMap) {
    var TiledMap = cc.TiledMap;
    var TMXObjectType = TiledMap.TMXObjectType;
    var Orientation = TiledMap.Orientation;
    var StaggerAxis = TiledMap.StaggerAxis;
    var TileFlag = TiledMap.TileFlag;
    var FLIPPED_MASK = TileFlag.FLIPPED_MASK;
    var FLAG_HORIZONTAL = TileFlag.HORIZONTAL;
    var FLAG_VERTICAL = TileFlag.VERTICAL;
    this._groupName = groupInfo.name;
    this._positionOffset = groupInfo.offset;
    this._mapInfo = mapInfo;
    this._properties = groupInfo.getProperties();
    this._offset = cc.v2(groupInfo.offset.x, -groupInfo.offset.y);
    this._opacity = groupInfo._opacity;
    var mapSize = mapInfo._mapSize;
    var tileSize = mapInfo._tileSize;
    var width = 0,
      height = 0;
    if (mapInfo.orientation === Orientation.HEX) {
      if (mapInfo.getStaggerAxis() === StaggerAxis.STAGGERAXIS_X) {
        height = tileSize.height * (mapSize.height + 0.5);
        width = (tileSize.width + mapInfo.getHexSideLength()) * Math.floor(mapSize.width / 2) + tileSize.width * (mapSize.width % 2);
      } else {
        width = tileSize.width * (mapSize.width + 0.5);
        height = (tileSize.height + mapInfo.getHexSideLength()) * Math.floor(mapSize.height / 2) + tileSize.height * (mapSize.height % 2);
      }
    } else if (mapInfo.orientation === Orientation.ISO) {
      var wh = mapSize.width + mapSize.height;
      width = tileSize.width * 0.5 * wh;
      height = tileSize.height * 0.5 * wh;
    } else {
      width = mapSize.width * tileSize.width;
      height = mapSize.height * tileSize.height;
    }
    this.node.setContentSize(width, height);
    var leftTopX = width * this.node.anchorX;
    var leftTopY = height * (1 - this.node.anchorY);
    var objects = groupInfo._objects;
    var aliveNodes = {};

    // 生成映射Map   { Texture2D: textureIndex }
    var textureIndexMap = new Map();
    var objectTextures = tiledMap.getObjectTextures();
    objectTextures.forEach(function (texture, idx) {
      return textureIndexMap.set(texture, idx);
    });
    for (var i = 0, l = objects.length; i < l; i++) {
      var object = objects[i];
      var objType = object.type;
      object.offset = cc.v2(object.x, object.y);
      var points = object.points || object.polylinePoints;
      if (points) {
        for (var pi = 0; pi < points.length; pi++) {
          points[pi].y *= -1;
        }
      }
      if (Orientation.ISO !== mapInfo.orientation) {
        object.y = height - object.y;
      } else {
        var posIdxX = object.x / tileSize.height;
        var posIdxY = object.y / tileSize.height;
        object.x = tileSize.width * 0.5 * (mapSize.height + posIdxX - posIdxY);
        object.y = tileSize.height * 0.5 * (mapSize.width + mapSize.height - posIdxX - posIdxY);
      }
      if (objType === TMXObjectType.TEXT) {
        var textName = "text" + object.id;
        aliveNodes[textName] = true;
        var textNode = this.node.getChildByName(textName);
        if (!textNode) {
          textNode = new cc.Node();
        }
        textNode.active = object.visible;
        textNode.anchorX = 0;
        textNode.anchorY = 1;
        textNode.angle = -object.rotation;
        textNode.x = object.x - leftTopX;
        textNode.y = object.y - leftTopY;
        textNode.name = textName;
        textNode.parent = this.node;
        textNode.color = object.color;
        textNode.opacity = this._opacity;
        textNode.setSiblingIndex(i);
        var label = textNode.getComponent(cc.Label);
        if (!label) {
          label = textNode.addComponent(cc.Label);
        }
        label.overflow = cc.Label.Overflow.SHRINK;
        label.lineHeight = object.height;
        label.string = object.text;
        label.horizontalAlign = object.halign;
        label.verticalAlign = object.valign;
        label.fontSize = object.pixelsize;
        textNode.width = object.width;
        textNode.height = object.height;
      }
      if (objType === TMXObjectType.IMAGE) {
        var gid = object.gid;
        var grid = texGrids[(gid & FLIPPED_MASK) >>> 0];
        if (!grid) continue;
        var tileset = grid.tileset;
        var imgName = "img" + object.id;
        aliveNodes[imgName] = true;
        var imgNode = this.node.getChildByName(imgName);
        var imgWidth = object.width || grid.width;
        var imgHeight = object.height || grid.height;
        var tileOffsetX = tileset.tileOffset.x;
        var tileOffsetY = tileset.tileOffset.y;

        // Delete image nodes implemented as private nodes
        // Use cc.Node to implement node-level requirements
        if (imgNode instanceof cc.PrivateNode) {
          imgNode.removeFromParent();
          imgNode.destroy();
          imgNode = null;
        }
        if (!imgNode) {
          imgNode = new cc.Node();
        }
        if (Orientation.ISO == mapInfo.orientation) {
          imgNode.anchorX = 0.5 + tileOffsetX / imgWidth;
          imgNode.anchorY = tileOffsetY / imgHeight;
        } else {
          imgNode.anchorX = tileOffsetX / imgWidth;
          imgNode.anchorY = tileOffsetY / imgHeight;
        }
        imgNode.active = object.visible;
        imgNode.angle = -object.rotation;
        imgNode.x = object.x - leftTopX;
        imgNode.y = object.y - leftTopY;
        imgNode.name = imgName;
        imgNode.parent = this.node;
        imgNode.opacity = this._opacity;
        imgNode.setSiblingIndex(i);
        imgNode._tiledMap = tiledMap;
        var sp = imgNode.getComponent(TmoSprite);
        if (!sp) {
          sp = imgNode.addComponent(TmoSprite);
        }
        var spf = sp.spriteFrame;
        if (!spf) {
          spf = new cc.SpriteFrame();
        }
        if ((gid & FLAG_HORIZONTAL) >>> 0) {
          spf.setFlipX(true);
        } else {
          spf.setFlipX(false);
        }
        if ((gid & FLAG_VERTICAL) >>> 0) {
          spf.setFlipY(true);
        } else {
          spf.setFlipY(false);
        }
        var sourceImage = grid.tileset.sourceImage;
        spf.setTexture(sourceImage, cc.rect(grid));
        sp.spriteFrame = spf;
        sp.setVertsDirty();

        // object group may has no width or height info
        imgNode.width = imgWidth;
        imgNode.height = imgHeight;

        // 收集图集 更新textureIndexMap
        if (!textureIndexMap.has(sourceImage)) {
          textureIndexMap.set(sourceImage, objectTextures.length);
          objectTextures.push(sourceImage);
        }

        // 设置textureIndex
        var textureIndex = textureIndexMap.get(sourceImage);
        sp.setTextureIdx(textureIndex + 1);
      }
    }
    this._objects = objects;

    // destroy useless node
    var children = this.node.children;
    var uselessExp = /^(?:img|text)\d+$/;
    for (var _i = 0, n = children.length; _i < n; _i++) {
      var c = children[_i];
      var cName = c._name;
      var isUseless = uselessExp.test(cName);
      if (isUseless && !aliveNodes[cName]) c.destroy();
    }
  }
});
exports["default"] = _default;
module.exports = exports["default"];

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 25516 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/tiledmap-optimize-resource/Script/TmoSprite.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '4fa6cO05aBKGoM+5EX9zhkC', 'TmoSprite');
// Script/TmoSprite.js

"use strict";

exports.__esModule = true;
exports["default"] = void 0;
var _TmoAssembler = require("./TmoAssembler");
var _default = cc.Class({
  "extends": cc.Sprite,
  /**
   * 设置TextureIndex
   */
  setTextureIdx: function setTextureIdx(idx) {
    this._textureIdx = idx;
    this.setVertsDirty();
  },
  _getDefaultMaterial: function _getDefaultMaterial() {
    // 从TiledMap取得默认的材质
    return this._getTiledMap().getObjectMaterial();
  },
  _updateMaterial: function _updateMaterial() {
    // make sure material is belong to self.
    var material = this.getMaterial(0);
    if (material) {
      if (material.getDefine('USE_TEXTURE') !== undefined) {
        material.define('USE_TEXTURE', true);
      }
      // 手动设置哈希值，避免无法合批
      material.updateHash(999999);

      // 增加WITH_COLOR宏定义
      var noColor = this.isNoColor();
      material.define('WITH_COLOR', !noColor);
    }
    cc.BlendFunc.prototype._updateMaterial.call(this);
  },
  _resetAssembler: function _resetAssembler() {
    // 修改默认Assembler
    var assembler = this._assembler = new _TmoAssembler.TmoAssembler();
    assembler.init(this);
    this._updateColor();
    this.setVertsDirty();
  },
  _getTiledMap: function _getTiledMap() {
    return this.node._tiledMap;
  },
  isNoColor: function isNoColor() {
    return this._getTiledMap().isNoColor();
  }
});
exports["default"] = _default;
module.exports = exports["default"];

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 4360 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/module/Crypto/crypto-js.min.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'e64e1qXyT9CV6s0gDQdj/ed', 'crypto-js.min');
// Script/module/Crypto/crypto-js.min.js

"use strict";

!function (t, r) {
  "object" == typeof exports ? module.exports = exports = r() : "function" == typeof define && define.amd ? define([], r) : t.CryptoJS = r();
}(void 0, function () {
  var t = t || function (t, r) {
    var e = Object.create || function () {
        function t() {}
        return function (r) {
          var e;
          return t.prototype = r, e = new t(), t.prototype = null, e;
        };
      }(),
      i = {},
      n = i.lib = {},
      o = n.Base = function () {
        return {
          extend: function extend(t) {
            var r = e(this);
            return t && r.mixIn(t), r.hasOwnProperty("init") && this.init !== r.init || (r.init = function () {
              r.$super.init.apply(this, arguments);
            }), r.init.prototype = r, r.$super = this, r;
          },
          create: function create() {
            var t = this.extend();
            return t.init.apply(t, arguments), t;
          },
          init: function init() {},
          mixIn: function mixIn(t) {
            for (var r in t) t.hasOwnProperty(r) && (this[r] = t[r]);
            t.hasOwnProperty("toString") && (this.toString = t.toString);
          },
          clone: function clone() {
            return this.init.prototype.extend(this);
          }
        };
      }(),
      s = n.WordArray = o.extend({
        init: function init(t, e) {
          t = this.words = t || [], e != r ? this.sigBytes = e : this.sigBytes = 4 * t.length;
        },
        toString: function toString(t) {
          return (t || c).stringify(this);
        },
        concat: function concat(t) {
          var r = this.words,
            e = t.words,
            i = this.sigBytes,
            n = t.sigBytes;
          if (this.clamp(), i % 4) for (var o = 0; o < n; o++) {
            var s = e[o >>> 2] >>> 24 - o % 4 * 8 & 255;
            r[i + o >>> 2] |= s << 24 - (i + o) % 4 * 8;
          } else for (var o = 0; o < n; o += 4) r[i + o >>> 2] = e[o >>> 2];
          return this.sigBytes += n, this;
        },
        clamp: function clamp() {
          var r = this.words,
            e = this.sigBytes;
          r[e >>> 2] &= 4294967295 << 32 - e % 4 * 8, r.length = t.ceil(e / 4);
        },
        clone: function clone() {
          var t = o.clone.call(this);
          return t.words = this.words.slice(0), t;
        },
        random: function random(r) {
          for (var e, i = [], n = function n(r) {
              var r = r,
                e = 987654321,
                i = 4294967295;
              return function () {
                e = 36969 * (65535 & e) + (e >> 16) & i, r = 18e3 * (65535 & r) + (r >> 16) & i;
                var n = (e << 16) + r & i;
                return n /= 4294967296, n += .5, n * (t.random() > .5 ? 1 : -1);
              };
            }, o = 0; o < r; o += 4) {
            var a = n(4294967296 * (e || t.random()));
            e = 987654071 * a(), i.push(4294967296 * a() | 0);
          }
          return new s.init(i, r);
        }
      }),
      a = i.enc = {},
      c = a.Hex = {
        stringify: function stringify(t) {
          for (var r = t.words, e = t.sigBytes, i = [], n = 0; n < e; n++) {
            var o = r[n >>> 2] >>> 24 - n % 4 * 8 & 255;
            i.push((o >>> 4).toString(16)), i.push((15 & o).toString(16));
          }
          return i.join("");
        },
        parse: function parse(t) {
          for (var r = t.length, e = [], i = 0; i < r; i += 2) e[i >>> 3] |= parseInt(t.substr(i, 2), 16) << 24 - i % 8 * 4;
          return new s.init(e, r / 2);
        }
      },
      h = a.Latin1 = {
        stringify: function stringify(t) {
          for (var r = t.words, e = t.sigBytes, i = [], n = 0; n < e; n++) {
            var o = r[n >>> 2] >>> 24 - n % 4 * 8 & 255;
            i.push(String.fromCharCode(o));
          }
          return i.join("");
        },
        parse: function parse(t) {
          for (var r = t.length, e = [], i = 0; i < r; i++) e[i >>> 2] |= (255 & t.charCodeAt(i)) << 24 - i % 4 * 8;
          return new s.init(e, r);
        }
      },
      l = a.Utf8 = {
        stringify: function stringify(t) {
          try {
            return decodeURIComponent(escape(h.stringify(t)));
          } catch (t) {
            throw new Error("Malformed UTF-8 data");
          }
        },
        parse: function parse(t) {
          return h.parse(unescape(encodeURIComponent(t)));
        }
      },
      f = n.BufferedBlockAlgorithm = o.extend({
        reset: function reset() {
          this._data = new s.init(), this._nDataBytes = 0;
        },
        _append: function _append(t) {
          "string" == typeof t && (t = l.parse(t)), this._data.concat(t), this._nDataBytes += t.sigBytes;
        },
        _process: function _process(r) {
          var e = this._data,
            i = e.words,
            n = e.sigBytes,
            o = this.blockSize,
            a = 4 * o,
            c = n / a;
          c = r ? t.ceil(c) : t.max((0 | c) - this._minBufferSize, 0);
          var h = c * o,
            l = t.min(4 * h, n);
          if (h) {
            for (var f = 0; f < h; f += o) this._doProcessBlock(i, f);
            var u = i.splice(0, h);
            e.sigBytes -= l;
          }
          return new s.init(u, l);
        },
        clone: function clone() {
          var t = o.clone.call(this);
          return t._data = this._data.clone(), t;
        },
        _minBufferSize: 0
      }),
      u = (n.Hasher = f.extend({
        cfg: o.extend(),
        init: function init(t) {
          this.cfg = this.cfg.extend(t), this.reset();
        },
        reset: function reset() {
          f.reset.call(this), this._doReset();
        },
        update: function update(t) {
          return this._append(t), this._process(), this;
        },
        finalize: function finalize(t) {
          t && this._append(t);
          var r = this._doFinalize();
          return r;
        },
        blockSize: 16,
        _createHelper: function _createHelper(t) {
          return function (r, e) {
            return new t.init(e).finalize(r);
          };
        },
        _createHmacHelper: function _createHmacHelper(t) {
          return function (r, e) {
            return new u.HMAC.init(t, e).finalize(r);
          };
        }
      }), i.algo = {});
    return i;
  }(Math);
  return function () {
    function r(t, r, e) {
      for (var i = [], o = 0, s = 0; s < r; s++) if (s % 4) {
        var a = e[t.charCodeAt(s - 1)] << s % 4 * 2,
          c = e[t.charCodeAt(s)] >>> 6 - s % 4 * 2;
        i[o >>> 2] |= (a | c) << 24 - o % 4 * 8, o++;
      }
      return n.create(i, o);
    }
    var e = t,
      i = e.lib,
      n = i.WordArray,
      o = e.enc;
    o.Base64 = {
      stringify: function stringify(t) {
        var r = t.words,
          e = t.sigBytes,
          i = this._map;
        t.clamp();
        for (var n = [], o = 0; o < e; o += 3) for (var s = r[o >>> 2] >>> 24 - o % 4 * 8 & 255, a = r[o + 1 >>> 2] >>> 24 - (o + 1) % 4 * 8 & 255, c = r[o + 2 >>> 2] >>> 24 - (o + 2) % 4 * 8 & 255, h = s << 16 | a << 8 | c, l = 0; l < 4 && o + .75 * l < e; l++) n.push(i.charAt(h >>> 6 * (3 - l) & 63));
        var f = i.charAt(64);
        if (f) for (; n.length % 4;) n.push(f);
        return n.join("");
      },
      parse: function parse(t) {
        var e = t.length,
          i = this._map,
          n = this._reverseMap;
        if (!n) {
          n = this._reverseMap = [];
          for (var o = 0; o < i.length; o++) n[i.charCodeAt(o)] = o;
        }
        var s = i.charAt(64);
        if (s) {
          var a = t.indexOf(s);
          a !== -1 && (e = a);
        }
        return r(t, e, n);
      },
      _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
    };
  }(), function (r) {
    function e(t, r, e, i, n, o, s) {
      var a = t + (r & e | ~r & i) + n + s;
      return (a << o | a >>> 32 - o) + r;
    }
    function i(t, r, e, i, n, o, s) {
      var a = t + (r & i | e & ~i) + n + s;
      return (a << o | a >>> 32 - o) + r;
    }
    function n(t, r, e, i, n, o, s) {
      var a = t + (r ^ e ^ i) + n + s;
      return (a << o | a >>> 32 - o) + r;
    }
    function o(t, r, e, i, n, o, s) {
      var a = t + (e ^ (r | ~i)) + n + s;
      return (a << o | a >>> 32 - o) + r;
    }
    var s = t,
      a = s.lib,
      c = a.WordArray,
      h = a.Hasher,
      l = s.algo,
      f = [];
    !function () {
      for (var t = 0; t < 64; t++) f[t] = 4294967296 * r.abs(r.sin(t + 1)) | 0;
    }();
    var u = l.MD5 = h.extend({
      _doReset: function _doReset() {
        this._hash = new c.init([1732584193, 4023233417, 2562383102, 271733878]);
      },
      _doProcessBlock: function _doProcessBlock(t, r) {
        for (var s = 0; s < 16; s++) {
          var a = r + s,
            c = t[a];
          t[a] = 16711935 & (c << 8 | c >>> 24) | 4278255360 & (c << 24 | c >>> 8);
        }
        var h = this._hash.words,
          l = t[r + 0],
          u = t[r + 1],
          d = t[r + 2],
          v = t[r + 3],
          p = t[r + 4],
          _ = t[r + 5],
          y = t[r + 6],
          g = t[r + 7],
          B = t[r + 8],
          w = t[r + 9],
          k = t[r + 10],
          S = t[r + 11],
          m = t[r + 12],
          x = t[r + 13],
          b = t[r + 14],
          H = t[r + 15],
          z = h[0],
          A = h[1],
          C = h[2],
          D = h[3];
        z = e(z, A, C, D, l, 7, f[0]), D = e(D, z, A, C, u, 12, f[1]), C = e(C, D, z, A, d, 17, f[2]), A = e(A, C, D, z, v, 22, f[3]), z = e(z, A, C, D, p, 7, f[4]), D = e(D, z, A, C, _, 12, f[5]), C = e(C, D, z, A, y, 17, f[6]), A = e(A, C, D, z, g, 22, f[7]), z = e(z, A, C, D, B, 7, f[8]), D = e(D, z, A, C, w, 12, f[9]), C = e(C, D, z, A, k, 17, f[10]), A = e(A, C, D, z, S, 22, f[11]), z = e(z, A, C, D, m, 7, f[12]), D = e(D, z, A, C, x, 12, f[13]), C = e(C, D, z, A, b, 17, f[14]), A = e(A, C, D, z, H, 22, f[15]), z = i(z, A, C, D, u, 5, f[16]), D = i(D, z, A, C, y, 9, f[17]), C = i(C, D, z, A, S, 14, f[18]), A = i(A, C, D, z, l, 20, f[19]), z = i(z, A, C, D, _, 5, f[20]), D = i(D, z, A, C, k, 9, f[21]), C = i(C, D, z, A, H, 14, f[22]), A = i(A, C, D, z, p, 20, f[23]), z = i(z, A, C, D, w, 5, f[24]), D = i(D, z, A, C, b, 9, f[25]), C = i(C, D, z, A, v, 14, f[26]), A = i(A, C, D, z, B, 20, f[27]), z = i(z, A, C, D, x, 5, f[28]), D = i(D, z, A, C, d, 9, f[29]), C = i(C, D, z, A, g, 14, f[30]), A = i(A, C, D, z, m, 20, f[31]), z = n(z, A, C, D, _, 4, f[32]), D = n(D, z, A, C, B, 11, f[33]), C = n(C, D, z, A, S, 16, f[34]), A = n(A, C, D, z, b, 23, f[35]), z = n(z, A, C, D, u, 4, f[36]), D = n(D, z, A, C, p, 11, f[37]), C = n(C, D, z, A, g, 16, f[38]), A = n(A, C, D, z, k, 23, f[39]), z = n(z, A, C, D, x, 4, f[40]), D = n(D, z, A, C, l, 11, f[41]), C = n(C, D, z, A, v, 16, f[42]), A = n(A, C, D, z, y, 23, f[43]), z = n(z, A, C, D, w, 4, f[44]), D = n(D, z, A, C, m, 11, f[45]), C = n(C, D, z, A, H, 16, f[46]), A = n(A, C, D, z, d, 23, f[47]), z = o(z, A, C, D, l, 6, f[48]), D = o(D, z, A, C, g, 10, f[49]), C = o(C, D, z, A, b, 15, f[50]), A = o(A, C, D, z, _, 21, f[51]), z = o(z, A, C, D, m, 6, f[52]), D = o(D, z, A, C, v, 10, f[53]), C = o(C, D, z, A, k, 15, f[54]), A = o(A, C, D, z, u, 21, f[55]), z = o(z, A, C, D, B, 6, f[56]), D = o(D, z, A, C, H, 10, f[57]), C = o(C, D, z, A, y, 15, f[58]), A = o(A, C, D, z, x, 21, f[59]), z = o(z, A, C, D, p, 6, f[60]), D = o(D, z, A, C, S, 10, f[61]), C = o(C, D, z, A, d, 15, f[62]), A = o(A, C, D, z, w, 21, f[63]), h[0] = h[0] + z | 0, h[1] = h[1] + A | 0, h[2] = h[2] + C | 0, h[3] = h[3] + D | 0;
      },
      _doFinalize: function _doFinalize() {
        var t = this._data,
          e = t.words,
          i = 8 * this._nDataBytes,
          n = 8 * t.sigBytes;
        e[n >>> 5] |= 128 << 24 - n % 32;
        var o = r.floor(i / 4294967296),
          s = i;
        e[(n + 64 >>> 9 << 4) + 15] = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8), e[(n + 64 >>> 9 << 4) + 14] = 16711935 & (s << 8 | s >>> 24) | 4278255360 & (s << 24 | s >>> 8), t.sigBytes = 4 * (e.length + 1), this._process();
        for (var a = this._hash, c = a.words, h = 0; h < 4; h++) {
          var l = c[h];
          c[h] = 16711935 & (l << 8 | l >>> 24) | 4278255360 & (l << 24 | l >>> 8);
        }
        return a;
      },
      clone: function clone() {
        var t = h.clone.call(this);
        return t._hash = this._hash.clone(), t;
      }
    });
    s.MD5 = h._createHelper(u), s.HmacMD5 = h._createHmacHelper(u);
  }(Math), function () {
    var r = t,
      e = r.lib,
      i = e.WordArray,
      n = e.Hasher,
      o = r.algo,
      s = [],
      a = o.SHA1 = n.extend({
        _doReset: function _doReset() {
          this._hash = new i.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);
        },
        _doProcessBlock: function _doProcessBlock(t, r) {
          for (var e = this._hash.words, i = e[0], n = e[1], o = e[2], a = e[3], c = e[4], h = 0; h < 80; h++) {
            if (h < 16) s[h] = 0 | t[r + h];else {
              var l = s[h - 3] ^ s[h - 8] ^ s[h - 14] ^ s[h - 16];
              s[h] = l << 1 | l >>> 31;
            }
            var f = (i << 5 | i >>> 27) + c + s[h];
            f += h < 20 ? (n & o | ~n & a) + 1518500249 : h < 40 ? (n ^ o ^ a) + 1859775393 : h < 60 ? (n & o | n & a | o & a) - 1894007588 : (n ^ o ^ a) - 899497514, c = a, a = o, o = n << 30 | n >>> 2, n = i, i = f;
          }
          e[0] = e[0] + i | 0, e[1] = e[1] + n | 0, e[2] = e[2] + o | 0, e[3] = e[3] + a | 0, e[4] = e[4] + c | 0;
        },
        _doFinalize: function _doFinalize() {
          var t = this._data,
            r = t.words,
            e = 8 * this._nDataBytes,
            i = 8 * t.sigBytes;
          return r[i >>> 5] |= 128 << 24 - i % 32, r[(i + 64 >>> 9 << 4) + 14] = Math.floor(e / 4294967296), r[(i + 64 >>> 9 << 4) + 15] = e, t.sigBytes = 4 * r.length, this._process(), this._hash;
        },
        clone: function clone() {
          var t = n.clone.call(this);
          return t._hash = this._hash.clone(), t;
        }
      });
    r.SHA1 = n._createHelper(a), r.HmacSHA1 = n._createHmacHelper(a);
  }(), function (r) {
    var e = t,
      i = e.lib,
      n = i.WordArray,
      o = i.Hasher,
      s = e.algo,
      a = [],
      c = [];
    !function () {
      function t(t) {
        for (var e = r.sqrt(t), i = 2; i <= e; i++) if (!(t % i)) return !1;
        return !0;
      }
      function e(t) {
        return 4294967296 * (t - (0 | t)) | 0;
      }
      for (var i = 2, n = 0; n < 64;) t(i) && (n < 8 && (a[n] = e(r.pow(i, .5))), c[n] = e(r.pow(i, 1 / 3)), n++), i++;
    }();
    var h = [],
      l = s.SHA256 = o.extend({
        _doReset: function _doReset() {
          this._hash = new n.init(a.slice(0));
        },
        _doProcessBlock: function _doProcessBlock(t, r) {
          for (var e = this._hash.words, i = e[0], n = e[1], o = e[2], s = e[3], a = e[4], l = e[5], f = e[6], u = e[7], d = 0; d < 64; d++) {
            if (d < 16) h[d] = 0 | t[r + d];else {
              var v = h[d - 15],
                p = (v << 25 | v >>> 7) ^ (v << 14 | v >>> 18) ^ v >>> 3,
                _ = h[d - 2],
                y = (_ << 15 | _ >>> 17) ^ (_ << 13 | _ >>> 19) ^ _ >>> 10;
              h[d] = p + h[d - 7] + y + h[d - 16];
            }
            var g = a & l ^ ~a & f,
              B = i & n ^ i & o ^ n & o,
              w = (i << 30 | i >>> 2) ^ (i << 19 | i >>> 13) ^ (i << 10 | i >>> 22),
              k = (a << 26 | a >>> 6) ^ (a << 21 | a >>> 11) ^ (a << 7 | a >>> 25),
              S = u + k + g + c[d] + h[d],
              m = w + B;
            u = f, f = l, l = a, a = s + S | 0, s = o, o = n, n = i, i = S + m | 0;
          }
          e[0] = e[0] + i | 0, e[1] = e[1] + n | 0, e[2] = e[2] + o | 0, e[3] = e[3] + s | 0, e[4] = e[4] + a | 0, e[5] = e[5] + l | 0, e[6] = e[6] + f | 0, e[7] = e[7] + u | 0;
        },
        _doFinalize: function _doFinalize() {
          var t = this._data,
            e = t.words,
            i = 8 * this._nDataBytes,
            n = 8 * t.sigBytes;
          return e[n >>> 5] |= 128 << 24 - n % 32, e[(n + 64 >>> 9 << 4) + 14] = r.floor(i / 4294967296), e[(n + 64 >>> 9 << 4) + 15] = i, t.sigBytes = 4 * e.length, this._process(), this._hash;
        },
        clone: function clone() {
          var t = o.clone.call(this);
          return t._hash = this._hash.clone(), t;
        }
      });
    e.SHA256 = o._createHelper(l), e.HmacSHA256 = o._createHmacHelper(l);
  }(Math), function () {
    function r(t) {
      return t << 8 & 4278255360 | t >>> 8 & 16711935;
    }
    var e = t,
      i = e.lib,
      n = i.WordArray,
      o = e.enc;
    o.Utf16 = o.Utf16BE = {
      stringify: function stringify(t) {
        for (var r = t.words, e = t.sigBytes, i = [], n = 0; n < e; n += 2) {
          var o = r[n >>> 2] >>> 16 - n % 4 * 8 & 65535;
          i.push(String.fromCharCode(o));
        }
        return i.join("");
      },
      parse: function parse(t) {
        for (var r = t.length, e = [], i = 0; i < r; i++) e[i >>> 1] |= t.charCodeAt(i) << 16 - i % 2 * 16;
        return n.create(e, 2 * r);
      }
    };
    o.Utf16LE = {
      stringify: function stringify(t) {
        for (var e = t.words, i = t.sigBytes, n = [], o = 0; o < i; o += 2) {
          var s = r(e[o >>> 2] >>> 16 - o % 4 * 8 & 65535);
          n.push(String.fromCharCode(s));
        }
        return n.join("");
      },
      parse: function parse(t) {
        for (var e = t.length, i = [], o = 0; o < e; o++) i[o >>> 1] |= r(t.charCodeAt(o) << 16 - o % 2 * 16);
        return n.create(i, 2 * e);
      }
    };
  }(), function () {
    if ("function" == typeof ArrayBuffer) {
      var r = t,
        e = r.lib,
        i = e.WordArray,
        n = i.init,
        o = i.init = function (t) {
          if (t instanceof ArrayBuffer && (t = new Uint8Array(t)), (t instanceof Int8Array || "undefined" != typeof Uint8ClampedArray && t instanceof Uint8ClampedArray || t instanceof Int16Array || t instanceof Uint16Array || t instanceof Int32Array || t instanceof Uint32Array || t instanceof Float32Array || t instanceof Float64Array) && (t = new Uint8Array(t.buffer, t.byteOffset, t.byteLength)), t instanceof Uint8Array) {
            for (var r = t.byteLength, e = [], i = 0; i < r; i++) e[i >>> 2] |= t[i] << 24 - i % 4 * 8;
            n.call(this, e, r);
          } else n.apply(this, arguments);
        };
      o.prototype = i;
    }
  }(), function (r) {
    function e(t, r, e) {
      return t ^ r ^ e;
    }
    function i(t, r, e) {
      return t & r | ~t & e;
    }
    function n(t, r, e) {
      return (t | ~r) ^ e;
    }
    function o(t, r, e) {
      return t & e | r & ~e;
    }
    function s(t, r, e) {
      return t ^ (r | ~e);
    }
    function a(t, r) {
      return t << r | t >>> 32 - r;
    }
    var c = t,
      h = c.lib,
      l = h.WordArray,
      f = h.Hasher,
      u = c.algo,
      d = l.create([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]),
      v = l.create([5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]),
      p = l.create([11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]),
      _ = l.create([8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]),
      y = l.create([0, 1518500249, 1859775393, 2400959708, 2840853838]),
      g = l.create([1352829926, 1548603684, 1836072691, 2053994217, 0]),
      B = u.RIPEMD160 = f.extend({
        _doReset: function _doReset() {
          this._hash = l.create([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);
        },
        _doProcessBlock: function _doProcessBlock(t, r) {
          for (var c = 0; c < 16; c++) {
            var h = r + c,
              l = t[h];
            t[h] = 16711935 & (l << 8 | l >>> 24) | 4278255360 & (l << 24 | l >>> 8);
          }
          var f,
            u,
            B,
            w,
            k,
            S,
            m,
            x,
            b,
            H,
            z = this._hash.words,
            A = y.words,
            C = g.words,
            D = d.words,
            R = v.words,
            E = p.words,
            M = _.words;
          S = f = z[0], m = u = z[1], x = B = z[2], b = w = z[3], H = k = z[4];
          for (var F, c = 0; c < 80; c += 1) F = f + t[r + D[c]] | 0, F += c < 16 ? e(u, B, w) + A[0] : c < 32 ? i(u, B, w) + A[1] : c < 48 ? n(u, B, w) + A[2] : c < 64 ? o(u, B, w) + A[3] : s(u, B, w) + A[4], F |= 0, F = a(F, E[c]), F = F + k | 0, f = k, k = w, w = a(B, 10), B = u, u = F, F = S + t[r + R[c]] | 0, F += c < 16 ? s(m, x, b) + C[0] : c < 32 ? o(m, x, b) + C[1] : c < 48 ? n(m, x, b) + C[2] : c < 64 ? i(m, x, b) + C[3] : e(m, x, b) + C[4], F |= 0, F = a(F, M[c]), F = F + H | 0, S = H, H = b, b = a(x, 10), x = m, m = F;
          F = z[1] + B + b | 0, z[1] = z[2] + w + H | 0, z[2] = z[3] + k + S | 0, z[3] = z[4] + f + m | 0, z[4] = z[0] + u + x | 0, z[0] = F;
        },
        _doFinalize: function _doFinalize() {
          var t = this._data,
            r = t.words,
            e = 8 * this._nDataBytes,
            i = 8 * t.sigBytes;
          r[i >>> 5] |= 128 << 24 - i % 32, r[(i + 64 >>> 9 << 4) + 14] = 16711935 & (e << 8 | e >>> 24) | 4278255360 & (e << 24 | e >>> 8), t.sigBytes = 4 * (r.length + 1), this._process();
          for (var n = this._hash, o = n.words, s = 0; s < 5; s++) {
            var a = o[s];
            o[s] = 16711935 & (a << 8 | a >>> 24) | 4278255360 & (a << 24 | a >>> 8);
          }
          return n;
        },
        clone: function clone() {
          var t = f.clone.call(this);
          return t._hash = this._hash.clone(), t;
        }
      });
    c.RIPEMD160 = f._createHelper(B), c.HmacRIPEMD160 = f._createHmacHelper(B);
  }(Math), function () {
    var r = t,
      e = r.lib,
      i = e.Base,
      n = r.enc,
      o = n.Utf8,
      s = r.algo;
    s.HMAC = i.extend({
      init: function init(t, r) {
        t = this._hasher = new t.init(), "string" == typeof r && (r = o.parse(r));
        var e = t.blockSize,
          i = 4 * e;
        r.sigBytes > i && (r = t.finalize(r)), r.clamp();
        for (var n = this._oKey = r.clone(), s = this._iKey = r.clone(), a = n.words, c = s.words, h = 0; h < e; h++) a[h] ^= 1549556828, c[h] ^= 909522486;
        n.sigBytes = s.sigBytes = i, this.reset();
      },
      reset: function reset() {
        var t = this._hasher;
        t.reset(), t.update(this._iKey);
      },
      update: function update(t) {
        return this._hasher.update(t), this;
      },
      finalize: function finalize(t) {
        var r = this._hasher,
          e = r.finalize(t);
        r.reset();
        var i = r.finalize(this._oKey.clone().concat(e));
        return i;
      }
    });
  }(), function () {
    var r = t,
      e = r.lib,
      i = e.Base,
      n = e.WordArray,
      o = r.algo,
      s = o.SHA1,
      a = o.HMAC,
      c = o.PBKDF2 = i.extend({
        cfg: i.extend({
          keySize: 4,
          hasher: s,
          iterations: 1
        }),
        init: function init(t) {
          this.cfg = this.cfg.extend(t);
        },
        compute: function compute(t, r) {
          for (var e = this.cfg, i = a.create(e.hasher, t), o = n.create(), s = n.create([1]), c = o.words, h = s.words, l = e.keySize, f = e.iterations; c.length < l;) {
            var u = i.update(r).finalize(s);
            i.reset();
            for (var d = u.words, v = d.length, p = u, _ = 1; _ < f; _++) {
              p = i.finalize(p), i.reset();
              for (var y = p.words, g = 0; g < v; g++) d[g] ^= y[g];
            }
            o.concat(u), h[0]++;
          }
          return o.sigBytes = 4 * l, o;
        }
      });
    r.PBKDF2 = function (t, r, e) {
      return c.create(e).compute(t, r);
    };
  }(), function () {
    var r = t,
      e = r.lib,
      i = e.Base,
      n = e.WordArray,
      o = r.algo,
      s = o.MD5,
      a = o.EvpKDF = i.extend({
        cfg: i.extend({
          keySize: 4,
          hasher: s,
          iterations: 1
        }),
        init: function init(t) {
          this.cfg = this.cfg.extend(t);
        },
        compute: function compute(t, r) {
          for (var e = this.cfg, i = e.hasher.create(), o = n.create(), s = o.words, a = e.keySize, c = e.iterations; s.length < a;) {
            h && i.update(h);
            var h = i.update(t).finalize(r);
            i.reset();
            for (var l = 1; l < c; l++) h = i.finalize(h), i.reset();
            o.concat(h);
          }
          return o.sigBytes = 4 * a, o;
        }
      });
    r.EvpKDF = function (t, r, e) {
      return a.create(e).compute(t, r);
    };
  }(), function () {
    var r = t,
      e = r.lib,
      i = e.WordArray,
      n = r.algo,
      o = n.SHA256,
      s = n.SHA224 = o.extend({
        _doReset: function _doReset() {
          this._hash = new i.init([3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428]);
        },
        _doFinalize: function _doFinalize() {
          var t = o._doFinalize.call(this);
          return t.sigBytes -= 4, t;
        }
      });
    r.SHA224 = o._createHelper(s), r.HmacSHA224 = o._createHmacHelper(s);
  }(), function (r) {
    var e = t,
      i = e.lib,
      n = i.Base,
      o = i.WordArray,
      s = e.x64 = {};
    s.Word = n.extend({
      init: function init(t, r) {
        this.high = t, this.low = r;
      }
    }), s.WordArray = n.extend({
      init: function init(t, e) {
        t = this.words = t || [], e != r ? this.sigBytes = e : this.sigBytes = 8 * t.length;
      },
      toX32: function toX32() {
        for (var t = this.words, r = t.length, e = [], i = 0; i < r; i++) {
          var n = t[i];
          e.push(n.high), e.push(n.low);
        }
        return o.create(e, this.sigBytes);
      },
      clone: function clone() {
        for (var t = n.clone.call(this), r = t.words = this.words.slice(0), e = r.length, i = 0; i < e; i++) r[i] = r[i].clone();
        return t;
      }
    });
  }(), function (r) {
    var e = t,
      i = e.lib,
      n = i.WordArray,
      o = i.Hasher,
      s = e.x64,
      a = s.Word,
      c = e.algo,
      h = [],
      l = [],
      f = [];
    !function () {
      for (var t = 1, r = 0, e = 0; e < 24; e++) {
        h[t + 5 * r] = (e + 1) * (e + 2) / 2 % 64;
        var i = r % 5,
          n = (2 * t + 3 * r) % 5;
        t = i, r = n;
      }
      for (var t = 0; t < 5; t++) for (var r = 0; r < 5; r++) l[t + 5 * r] = r + (2 * t + 3 * r) % 5 * 5;
      for (var o = 1, s = 0; s < 24; s++) {
        for (var c = 0, u = 0, d = 0; d < 7; d++) {
          if (1 & o) {
            var v = (1 << d) - 1;
            v < 32 ? u ^= 1 << v : c ^= 1 << v - 32;
          }
          128 & o ? o = o << 1 ^ 113 : o <<= 1;
        }
        f[s] = a.create(c, u);
      }
    }();
    var u = [];
    !function () {
      for (var t = 0; t < 25; t++) u[t] = a.create();
    }();
    var d = c.SHA3 = o.extend({
      cfg: o.cfg.extend({
        outputLength: 512
      }),
      _doReset: function _doReset() {
        for (var t = this._state = [], r = 0; r < 25; r++) t[r] = new a.init();
        this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;
      },
      _doProcessBlock: function _doProcessBlock(t, r) {
        for (var e = this._state, i = this.blockSize / 2, n = 0; n < i; n++) {
          var o = t[r + 2 * n],
            s = t[r + 2 * n + 1];
          o = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8), s = 16711935 & (s << 8 | s >>> 24) | 4278255360 & (s << 24 | s >>> 8);
          var a = e[n];
          a.high ^= s, a.low ^= o;
        }
        for (var c = 0; c < 24; c++) {
          for (var d = 0; d < 5; d++) {
            for (var v = 0, p = 0, _ = 0; _ < 5; _++) {
              var a = e[d + 5 * _];
              v ^= a.high, p ^= a.low;
            }
            var y = u[d];
            y.high = v, y.low = p;
          }
          for (var d = 0; d < 5; d++) for (var g = u[(d + 4) % 5], B = u[(d + 1) % 5], w = B.high, k = B.low, v = g.high ^ (w << 1 | k >>> 31), p = g.low ^ (k << 1 | w >>> 31), _ = 0; _ < 5; _++) {
            var a = e[d + 5 * _];
            a.high ^= v, a.low ^= p;
          }
          for (var S = 1; S < 25; S++) {
            var a = e[S],
              m = a.high,
              x = a.low,
              b = h[S];
            if (b < 32) var v = m << b | x >>> 32 - b,
              p = x << b | m >>> 32 - b;else var v = x << b - 32 | m >>> 64 - b,
              p = m << b - 32 | x >>> 64 - b;
            var H = u[l[S]];
            H.high = v, H.low = p;
          }
          var z = u[0],
            A = e[0];
          z.high = A.high, z.low = A.low;
          for (var d = 0; d < 5; d++) for (var _ = 0; _ < 5; _++) {
            var S = d + 5 * _,
              a = e[S],
              C = u[S],
              D = u[(d + 1) % 5 + 5 * _],
              R = u[(d + 2) % 5 + 5 * _];
            a.high = C.high ^ ~D.high & R.high, a.low = C.low ^ ~D.low & R.low;
          }
          var a = e[0],
            E = f[c];
          a.high ^= E.high, a.low ^= E.low;
        }
      },
      _doFinalize: function _doFinalize() {
        var t = this._data,
          e = t.words,
          i = (8 * this._nDataBytes, 8 * t.sigBytes),
          o = 32 * this.blockSize;
        e[i >>> 5] |= 1 << 24 - i % 32, e[(r.ceil((i + 1) / o) * o >>> 5) - 1] |= 128, t.sigBytes = 4 * e.length, this._process();
        for (var s = this._state, a = this.cfg.outputLength / 8, c = a / 8, h = [], l = 0; l < c; l++) {
          var f = s[l],
            u = f.high,
            d = f.low;
          u = 16711935 & (u << 8 | u >>> 24) | 4278255360 & (u << 24 | u >>> 8), d = 16711935 & (d << 8 | d >>> 24) | 4278255360 & (d << 24 | d >>> 8), h.push(d), h.push(u);
        }
        return new n.init(h, a);
      },
      clone: function clone() {
        for (var t = o.clone.call(this), r = t._state = this._state.slice(0), e = 0; e < 25; e++) r[e] = r[e].clone();
        return t;
      }
    });
    e.SHA3 = o._createHelper(d), e.HmacSHA3 = o._createHmacHelper(d);
  }(Math), function () {
    function r() {
      return s.create.apply(s, arguments);
    }
    var e = t,
      i = e.lib,
      n = i.Hasher,
      o = e.x64,
      s = o.Word,
      a = o.WordArray,
      c = e.algo,
      h = [r(1116352408, 3609767458), r(1899447441, 602891725), r(3049323471, 3964484399), r(3921009573, 2173295548), r(961987163, 4081628472), r(1508970993, 3053834265), r(2453635748, 2937671579), r(2870763221, 3664609560), r(3624381080, 2734883394), r(310598401, 1164996542), r(607225278, 1323610764), r(1426881987, 3590304994), r(1925078388, 4068182383), r(2162078206, 991336113), r(2614888103, 633803317), r(3248222580, 3479774868), r(3835390401, 2666613458), r(4022224774, 944711139), r(264347078, 2341262773), r(604807628, 2007800933), r(770255983, 1495990901), r(1249150122, 1856431235), r(1555081692, 3175218132), r(1996064986, 2198950837), r(2554220882, 3999719339), r(2821834349, 766784016), r(2952996808, 2566594879), r(3210313671, 3203337956), r(3336571891, 1034457026), r(3584528711, 2466948901), r(113926993, 3758326383), r(338241895, 168717936), r(666307205, 1188179964), r(773529912, 1546045734), r(1294757372, 1522805485), r(1396182291, 2643833823), r(1695183700, 2343527390), r(1986661051, 1014477480), r(2177026350, 1206759142), r(2456956037, 344077627), r(2730485921, 1290863460), r(2820302411, 3158454273), r(3259730800, 3505952657), r(3345764771, 106217008), r(3516065817, 3606008344), r(3600352804, 1432725776), r(4094571909, 1467031594), r(275423344, 851169720), r(430227734, 3100823752), r(506948616, 1363258195), r(659060556, 3750685593), r(883997877, 3785050280), r(958139571, 3318307427), r(1322822218, 3812723403), r(1537002063, 2003034995), r(1747873779, 3602036899), r(1955562222, 1575990012), r(2024104815, 1125592928), r(2227730452, 2716904306), r(2361852424, 442776044), r(2428436474, 593698344), r(2756734187, 3733110249), r(3204031479, 2999351573), r(3329325298, 3815920427), r(3391569614, 3928383900), r(3515267271, 566280711), r(3940187606, 3454069534), r(4118630271, 4000239992), r(116418474, 1914138554), r(174292421, 2731055270), r(289380356, 3203993006), r(460393269, 320620315), r(685471733, 587496836), r(852142971, 1086792851), r(1017036298, 365543100), r(1126000580, 2618297676), r(1288033470, 3409855158), r(1501505948, 4234509866), r(1607167915, 987167468), r(1816402316, 1246189591)],
      l = [];
    !function () {
      for (var t = 0; t < 80; t++) l[t] = r();
    }();
    var f = c.SHA512 = n.extend({
      _doReset: function _doReset() {
        this._hash = new a.init([new s.init(1779033703, 4089235720), new s.init(3144134277, 2227873595), new s.init(1013904242, 4271175723), new s.init(2773480762, 1595750129), new s.init(1359893119, 2917565137), new s.init(2600822924, 725511199), new s.init(528734635, 4215389547), new s.init(1541459225, 327033209)]);
      },
      _doProcessBlock: function _doProcessBlock(t, r) {
        for (var e = this._hash.words, i = e[0], n = e[1], o = e[2], s = e[3], a = e[4], c = e[5], f = e[6], u = e[7], d = i.high, v = i.low, p = n.high, _ = n.low, y = o.high, g = o.low, B = s.high, w = s.low, k = a.high, S = a.low, m = c.high, x = c.low, b = f.high, H = f.low, z = u.high, A = u.low, C = d, D = v, R = p, E = _, M = y, F = g, P = B, W = w, O = k, U = S, I = m, K = x, X = b, L = H, j = z, N = A, T = 0; T < 80; T++) {
          var Z = l[T];
          if (T < 16) var q = Z.high = 0 | t[r + 2 * T],
            G = Z.low = 0 | t[r + 2 * T + 1];else {
            var J = l[T - 15],
              $ = J.high,
              Q = J.low,
              V = ($ >>> 1 | Q << 31) ^ ($ >>> 8 | Q << 24) ^ $ >>> 7,
              Y = (Q >>> 1 | $ << 31) ^ (Q >>> 8 | $ << 24) ^ (Q >>> 7 | $ << 25),
              tt = l[T - 2],
              rt = tt.high,
              et = tt.low,
              it = (rt >>> 19 | et << 13) ^ (rt << 3 | et >>> 29) ^ rt >>> 6,
              nt = (et >>> 19 | rt << 13) ^ (et << 3 | rt >>> 29) ^ (et >>> 6 | rt << 26),
              ot = l[T - 7],
              st = ot.high,
              at = ot.low,
              ct = l[T - 16],
              ht = ct.high,
              lt = ct.low,
              G = Y + at,
              q = V + st + (G >>> 0 < Y >>> 0 ? 1 : 0),
              G = G + nt,
              q = q + it + (G >>> 0 < nt >>> 0 ? 1 : 0),
              G = G + lt,
              q = q + ht + (G >>> 0 < lt >>> 0 ? 1 : 0);
            Z.high = q, Z.low = G;
          }
          var ft = O & I ^ ~O & X,
            ut = U & K ^ ~U & L,
            dt = C & R ^ C & M ^ R & M,
            vt = D & E ^ D & F ^ E & F,
            pt = (C >>> 28 | D << 4) ^ (C << 30 | D >>> 2) ^ (C << 25 | D >>> 7),
            _t = (D >>> 28 | C << 4) ^ (D << 30 | C >>> 2) ^ (D << 25 | C >>> 7),
            yt = (O >>> 14 | U << 18) ^ (O >>> 18 | U << 14) ^ (O << 23 | U >>> 9),
            gt = (U >>> 14 | O << 18) ^ (U >>> 18 | O << 14) ^ (U << 23 | O >>> 9),
            Bt = h[T],
            wt = Bt.high,
            kt = Bt.low,
            St = N + gt,
            mt = j + yt + (St >>> 0 < N >>> 0 ? 1 : 0),
            St = St + ut,
            mt = mt + ft + (St >>> 0 < ut >>> 0 ? 1 : 0),
            St = St + kt,
            mt = mt + wt + (St >>> 0 < kt >>> 0 ? 1 : 0),
            St = St + G,
            mt = mt + q + (St >>> 0 < G >>> 0 ? 1 : 0),
            xt = _t + vt,
            bt = pt + dt + (xt >>> 0 < _t >>> 0 ? 1 : 0);
          j = X, N = L, X = I, L = K, I = O, K = U, U = W + St | 0, O = P + mt + (U >>> 0 < W >>> 0 ? 1 : 0) | 0, P = M, W = F, M = R, F = E, R = C, E = D, D = St + xt | 0, C = mt + bt + (D >>> 0 < St >>> 0 ? 1 : 0) | 0;
        }
        v = i.low = v + D, i.high = d + C + (v >>> 0 < D >>> 0 ? 1 : 0), _ = n.low = _ + E, n.high = p + R + (_ >>> 0 < E >>> 0 ? 1 : 0), g = o.low = g + F, o.high = y + M + (g >>> 0 < F >>> 0 ? 1 : 0), w = s.low = w + W, s.high = B + P + (w >>> 0 < W >>> 0 ? 1 : 0), S = a.low = S + U, a.high = k + O + (S >>> 0 < U >>> 0 ? 1 : 0), x = c.low = x + K, c.high = m + I + (x >>> 0 < K >>> 0 ? 1 : 0), H = f.low = H + L, f.high = b + X + (H >>> 0 < L >>> 0 ? 1 : 0), A = u.low = A + N, u.high = z + j + (A >>> 0 < N >>> 0 ? 1 : 0);
      },
      _doFinalize: function _doFinalize() {
        var t = this._data,
          r = t.words,
          e = 8 * this._nDataBytes,
          i = 8 * t.sigBytes;
        r[i >>> 5] |= 128 << 24 - i % 32, r[(i + 128 >>> 10 << 5) + 30] = Math.floor(e / 4294967296), r[(i + 128 >>> 10 << 5) + 31] = e, t.sigBytes = 4 * r.length, this._process();
        var n = this._hash.toX32();
        return n;
      },
      clone: function clone() {
        var t = n.clone.call(this);
        return t._hash = this._hash.clone(), t;
      },
      blockSize: 32
    });
    e.SHA512 = n._createHelper(f), e.HmacSHA512 = n._createHmacHelper(f);
  }(), function () {
    var r = t,
      e = r.x64,
      i = e.Word,
      n = e.WordArray,
      o = r.algo,
      s = o.SHA512,
      a = o.SHA384 = s.extend({
        _doReset: function _doReset() {
          this._hash = new n.init([new i.init(3418070365, 3238371032), new i.init(1654270250, 914150663), new i.init(2438529370, 812702999), new i.init(355462360, 4144912697), new i.init(1731405415, 4290775857), new i.init(2394180231, 1750603025), new i.init(3675008525, 1694076839), new i.init(1203062813, 3204075428)]);
        },
        _doFinalize: function _doFinalize() {
          var t = s._doFinalize.call(this);
          return t.sigBytes -= 16, t;
        }
      });
    r.SHA384 = s._createHelper(a), r.HmacSHA384 = s._createHmacHelper(a);
  }(), t.lib.Cipher || function (r) {
    var e = t,
      i = e.lib,
      n = i.Base,
      o = i.WordArray,
      s = i.BufferedBlockAlgorithm,
      a = e.enc,
      c = (a.Utf8, a.Base64),
      h = e.algo,
      l = h.EvpKDF,
      f = i.Cipher = s.extend({
        cfg: n.extend(),
        createEncryptor: function createEncryptor(t, r) {
          return this.create(this._ENC_XFORM_MODE, t, r);
        },
        createDecryptor: function createDecryptor(t, r) {
          return this.create(this._DEC_XFORM_MODE, t, r);
        },
        init: function init(t, r, e) {
          this.cfg = this.cfg.extend(e), this._xformMode = t, this._key = r, this.reset();
        },
        reset: function reset() {
          s.reset.call(this), this._doReset();
        },
        process: function process(t) {
          return this._append(t), this._process();
        },
        finalize: function finalize(t) {
          t && this._append(t);
          var r = this._doFinalize();
          return r;
        },
        keySize: 4,
        ivSize: 4,
        _ENC_XFORM_MODE: 1,
        _DEC_XFORM_MODE: 2,
        _createHelper: function () {
          function t(t) {
            return "string" == typeof t ? m : w;
          }
          return function (r) {
            return {
              encrypt: function encrypt(e, i, n) {
                return t(i).encrypt(r, e, i, n);
              },
              decrypt: function decrypt(e, i, n) {
                return t(i).decrypt(r, e, i, n);
              }
            };
          };
        }()
      }),
      u = (i.StreamCipher = f.extend({
        _doFinalize: function _doFinalize() {
          var t = this._process(!0);
          return t;
        },
        blockSize: 1
      }), e.mode = {}),
      d = i.BlockCipherMode = n.extend({
        createEncryptor: function createEncryptor(t, r) {
          return this.Encryptor.create(t, r);
        },
        createDecryptor: function createDecryptor(t, r) {
          return this.Decryptor.create(t, r);
        },
        init: function init(t, r) {
          this._cipher = t, this._iv = r;
        }
      }),
      v = u.CBC = function () {
        function t(t, e, i) {
          var n = this._iv;
          if (n) {
            var o = n;
            this._iv = r;
          } else var o = this._prevBlock;
          for (var s = 0; s < i; s++) t[e + s] ^= o[s];
        }
        var e = d.extend();
        return e.Encryptor = e.extend({
          processBlock: function processBlock(r, e) {
            var i = this._cipher,
              n = i.blockSize;
            t.call(this, r, e, n), i.encryptBlock(r, e), this._prevBlock = r.slice(e, e + n);
          }
        }), e.Decryptor = e.extend({
          processBlock: function processBlock(r, e) {
            var i = this._cipher,
              n = i.blockSize,
              o = r.slice(e, e + n);
            i.decryptBlock(r, e), t.call(this, r, e, n), this._prevBlock = o;
          }
        }), e;
      }(),
      p = e.pad = {},
      _ = p.Pkcs7 = {
        pad: function pad(t, r) {
          for (var e = 4 * r, i = e - t.sigBytes % e, n = i << 24 | i << 16 | i << 8 | i, s = [], a = 0; a < i; a += 4) s.push(n);
          var c = o.create(s, i);
          t.concat(c);
        },
        unpad: function unpad(t) {
          var r = 255 & t.words[t.sigBytes - 1 >>> 2];
          t.sigBytes -= r;
        }
      },
      y = (i.BlockCipher = f.extend({
        cfg: f.cfg.extend({
          mode: v,
          padding: _
        }),
        reset: function reset() {
          f.reset.call(this);
          var t = this.cfg,
            r = t.iv,
            e = t.mode;
          if (this._xformMode == this._ENC_XFORM_MODE) var i = e.createEncryptor;else {
            var i = e.createDecryptor;
            this._minBufferSize = 1;
          }
          this._mode && this._mode.__creator == i ? this._mode.init(this, r && r.words) : (this._mode = i.call(e, this, r && r.words), this._mode.__creator = i);
        },
        _doProcessBlock: function _doProcessBlock(t, r) {
          this._mode.processBlock(t, r);
        },
        _doFinalize: function _doFinalize() {
          var t = this.cfg.padding;
          if (this._xformMode == this._ENC_XFORM_MODE) {
            t.pad(this._data, this.blockSize);
            var r = this._process(!0);
          } else {
            var r = this._process(!0);
            t.unpad(r);
          }
          return r;
        },
        blockSize: 4
      }), i.CipherParams = n.extend({
        init: function init(t) {
          this.mixIn(t);
        },
        toString: function toString(t) {
          return (t || this.formatter).stringify(this);
        }
      })),
      g = e.format = {},
      B = g.OpenSSL = {
        stringify: function stringify(t) {
          var r = t.ciphertext,
            e = t.salt;
          if (e) var i = o.create([1398893684, 1701076831]).concat(e).concat(r);else var i = r;
          return i.toString(c);
        },
        parse: function parse(t) {
          var r = c.parse(t),
            e = r.words;
          if (1398893684 == e[0] && 1701076831 == e[1]) {
            var i = o.create(e.slice(2, 4));
            e.splice(0, 4), r.sigBytes -= 16;
          }
          return y.create({
            ciphertext: r,
            salt: i
          });
        }
      },
      w = i.SerializableCipher = n.extend({
        cfg: n.extend({
          format: B
        }),
        encrypt: function encrypt(t, r, e, i) {
          i = this.cfg.extend(i);
          var n = t.createEncryptor(e, i),
            o = n.finalize(r),
            s = n.cfg;
          return y.create({
            ciphertext: o,
            key: e,
            iv: s.iv,
            algorithm: t,
            mode: s.mode,
            padding: s.padding,
            blockSize: t.blockSize,
            formatter: i.format
          });
        },
        decrypt: function decrypt(t, r, e, i) {
          i = this.cfg.extend(i), r = this._parse(r, i.format);
          var n = t.createDecryptor(e, i).finalize(r.ciphertext);
          return n;
        },
        _parse: function _parse(t, r) {
          return "string" == typeof t ? r.parse(t, this) : t;
        }
      }),
      k = e.kdf = {},
      S = k.OpenSSL = {
        execute: function execute(t, r, e, i) {
          i || (i = o.random(8));
          var n = l.create({
              keySize: r + e
            }).compute(t, i),
            s = o.create(n.words.slice(r), 4 * e);
          return n.sigBytes = 4 * r, y.create({
            key: n,
            iv: s,
            salt: i
          });
        }
      },
      m = i.PasswordBasedCipher = w.extend({
        cfg: w.cfg.extend({
          kdf: S
        }),
        encrypt: function encrypt(t, r, e, i) {
          i = this.cfg.extend(i);
          var n = i.kdf.execute(e, t.keySize, t.ivSize);
          i.iv = n.iv;
          var o = w.encrypt.call(this, t, r, n.key, i);
          return o.mixIn(n), o;
        },
        decrypt: function decrypt(t, r, e, i) {
          i = this.cfg.extend(i), r = this._parse(r, i.format);
          var n = i.kdf.execute(e, t.keySize, t.ivSize, r.salt);
          i.iv = n.iv;
          var o = w.decrypt.call(this, t, r, n.key, i);
          return o;
        }
      });
  }(), t.mode.CFB = function () {
    function r(t, r, e, i) {
      var n = this._iv;
      if (n) {
        var o = n.slice(0);
        this._iv = void 0;
      } else var o = this._prevBlock;
      i.encryptBlock(o, 0);
      for (var s = 0; s < e; s++) t[r + s] ^= o[s];
    }
    var e = t.lib.BlockCipherMode.extend();
    return e.Encryptor = e.extend({
      processBlock: function processBlock(t, e) {
        var i = this._cipher,
          n = i.blockSize;
        r.call(this, t, e, n, i), this._prevBlock = t.slice(e, e + n);
      }
    }), e.Decryptor = e.extend({
      processBlock: function processBlock(t, e) {
        var i = this._cipher,
          n = i.blockSize,
          o = t.slice(e, e + n);
        r.call(this, t, e, n, i), this._prevBlock = o;
      }
    }), e;
  }(), t.mode.ECB = function () {
    var r = t.lib.BlockCipherMode.extend();
    return r.Encryptor = r.extend({
      processBlock: function processBlock(t, r) {
        this._cipher.encryptBlock(t, r);
      }
    }), r.Decryptor = r.extend({
      processBlock: function processBlock(t, r) {
        this._cipher.decryptBlock(t, r);
      }
    }), r;
  }(), t.pad.AnsiX923 = {
    pad: function pad(t, r) {
      var e = t.sigBytes,
        i = 4 * r,
        n = i - e % i,
        o = e + n - 1;
      t.clamp(), t.words[o >>> 2] |= n << 24 - o % 4 * 8, t.sigBytes += n;
    },
    unpad: function unpad(t) {
      var r = 255 & t.words[t.sigBytes - 1 >>> 2];
      t.sigBytes -= r;
    }
  }, t.pad.Iso10126 = {
    pad: function pad(r, e) {
      var i = 4 * e,
        n = i - r.sigBytes % i;
      r.concat(t.lib.WordArray.random(n - 1)).concat(t.lib.WordArray.create([n << 24], 1));
    },
    unpad: function unpad(t) {
      var r = 255 & t.words[t.sigBytes - 1 >>> 2];
      t.sigBytes -= r;
    }
  }, t.pad.Iso97971 = {
    pad: function pad(r, e) {
      r.concat(t.lib.WordArray.create([2147483648], 1)), t.pad.ZeroPadding.pad(r, e);
    },
    unpad: function unpad(r) {
      t.pad.ZeroPadding.unpad(r), r.sigBytes--;
    }
  }, t.mode.OFB = function () {
    var r = t.lib.BlockCipherMode.extend(),
      e = r.Encryptor = r.extend({
        processBlock: function processBlock(t, r) {
          var e = this._cipher,
            i = e.blockSize,
            n = this._iv,
            o = this._keystream;
          n && (o = this._keystream = n.slice(0), this._iv = void 0), e.encryptBlock(o, 0);
          for (var s = 0; s < i; s++) t[r + s] ^= o[s];
        }
      });
    return r.Decryptor = e, r;
  }(), t.pad.NoPadding = {
    pad: function pad() {},
    unpad: function unpad() {}
  }, function (r) {
    var e = t,
      i = e.lib,
      n = i.CipherParams,
      o = e.enc,
      s = o.Hex,
      a = e.format;
    a.Hex = {
      stringify: function stringify(t) {
        return t.ciphertext.toString(s);
      },
      parse: function parse(t) {
        var r = s.parse(t);
        return n.create({
          ciphertext: r
        });
      }
    };
  }(), function () {
    var r = t,
      e = r.lib,
      i = e.BlockCipher,
      n = r.algo,
      o = [],
      s = [],
      a = [],
      c = [],
      h = [],
      l = [],
      f = [],
      u = [],
      d = [],
      v = [];
    !function () {
      for (var t = [], r = 0; r < 256; r++) r < 128 ? t[r] = r << 1 : t[r] = r << 1 ^ 283;
      for (var e = 0, i = 0, r = 0; r < 256; r++) {
        var n = i ^ i << 1 ^ i << 2 ^ i << 3 ^ i << 4;
        n = n >>> 8 ^ 255 & n ^ 99, o[e] = n, s[n] = e;
        var p = t[e],
          _ = t[p],
          y = t[_],
          g = 257 * t[n] ^ 16843008 * n;
        a[e] = g << 24 | g >>> 8, c[e] = g << 16 | g >>> 16, h[e] = g << 8 | g >>> 24, l[e] = g;
        var g = 16843009 * y ^ 65537 * _ ^ 257 * p ^ 16843008 * e;
        f[n] = g << 24 | g >>> 8, u[n] = g << 16 | g >>> 16, d[n] = g << 8 | g >>> 24, v[n] = g, e ? (e = p ^ t[t[t[y ^ p]]], i ^= t[t[i]]) : e = i = 1;
      }
    }();
    var p = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54],
      _ = n.AES = i.extend({
        _doReset: function _doReset() {
          if (!this._nRounds || this._keyPriorReset !== this._key) {
            for (var t = this._keyPriorReset = this._key, r = t.words, e = t.sigBytes / 4, i = this._nRounds = e + 6, n = 4 * (i + 1), s = this._keySchedule = [], a = 0; a < n; a++) if (a < e) s[a] = r[a];else {
              var c = s[a - 1];
              a % e ? e > 6 && a % e == 4 && (c = o[c >>> 24] << 24 | o[c >>> 16 & 255] << 16 | o[c >>> 8 & 255] << 8 | o[255 & c]) : (c = c << 8 | c >>> 24, c = o[c >>> 24] << 24 | o[c >>> 16 & 255] << 16 | o[c >>> 8 & 255] << 8 | o[255 & c], c ^= p[a / e | 0] << 24), s[a] = s[a - e] ^ c;
            }
            for (var h = this._invKeySchedule = [], l = 0; l < n; l++) {
              var a = n - l;
              if (l % 4) var c = s[a];else var c = s[a - 4];
              l < 4 || a <= 4 ? h[l] = c : h[l] = f[o[c >>> 24]] ^ u[o[c >>> 16 & 255]] ^ d[o[c >>> 8 & 255]] ^ v[o[255 & c]];
            }
          }
        },
        encryptBlock: function encryptBlock(t, r) {
          this._doCryptBlock(t, r, this._keySchedule, a, c, h, l, o);
        },
        decryptBlock: function decryptBlock(t, r) {
          var e = t[r + 1];
          t[r + 1] = t[r + 3], t[r + 3] = e, this._doCryptBlock(t, r, this._invKeySchedule, f, u, d, v, s);
          var e = t[r + 1];
          t[r + 1] = t[r + 3], t[r + 3] = e;
        },
        _doCryptBlock: function _doCryptBlock(t, r, e, i, n, o, s, a) {
          for (var c = this._nRounds, h = t[r] ^ e[0], l = t[r + 1] ^ e[1], f = t[r + 2] ^ e[2], u = t[r + 3] ^ e[3], d = 4, v = 1; v < c; v++) {
            var p = i[h >>> 24] ^ n[l >>> 16 & 255] ^ o[f >>> 8 & 255] ^ s[255 & u] ^ e[d++],
              _ = i[l >>> 24] ^ n[f >>> 16 & 255] ^ o[u >>> 8 & 255] ^ s[255 & h] ^ e[d++],
              y = i[f >>> 24] ^ n[u >>> 16 & 255] ^ o[h >>> 8 & 255] ^ s[255 & l] ^ e[d++],
              g = i[u >>> 24] ^ n[h >>> 16 & 255] ^ o[l >>> 8 & 255] ^ s[255 & f] ^ e[d++];
            h = p, l = _, f = y, u = g;
          }
          var p = (a[h >>> 24] << 24 | a[l >>> 16 & 255] << 16 | a[f >>> 8 & 255] << 8 | a[255 & u]) ^ e[d++],
            _ = (a[l >>> 24] << 24 | a[f >>> 16 & 255] << 16 | a[u >>> 8 & 255] << 8 | a[255 & h]) ^ e[d++],
            y = (a[f >>> 24] << 24 | a[u >>> 16 & 255] << 16 | a[h >>> 8 & 255] << 8 | a[255 & l]) ^ e[d++],
            g = (a[u >>> 24] << 24 | a[h >>> 16 & 255] << 16 | a[l >>> 8 & 255] << 8 | a[255 & f]) ^ e[d++];
          t[r] = p, t[r + 1] = _, t[r + 2] = y, t[r + 3] = g;
        },
        keySize: 8
      });
    r.AES = i._createHelper(_);
  }(), function () {
    function r(t, r) {
      var e = (this._lBlock >>> t ^ this._rBlock) & r;
      this._rBlock ^= e, this._lBlock ^= e << t;
    }
    function e(t, r) {
      var e = (this._rBlock >>> t ^ this._lBlock) & r;
      this._lBlock ^= e, this._rBlock ^= e << t;
    }
    var i = t,
      n = i.lib,
      o = n.WordArray,
      s = n.BlockCipher,
      a = i.algo,
      c = [57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4],
      h = [14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32],
      l = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28],
      f = [{
        0: 8421888,
        268435456: 32768,
        536870912: 8421378,
        805306368: 2,
        1073741824: 512,
        1342177280: 8421890,
        1610612736: 8389122,
        1879048192: 8388608,
        2147483648: 514,
        2415919104: 8389120,
        2684354560: 33280,
        2952790016: 8421376,
        3221225472: 32770,
        3489660928: 8388610,
        3758096384: 0,
        4026531840: 33282,
        134217728: 0,
        402653184: 8421890,
        671088640: 33282,
        939524096: 32768,
        1207959552: 8421888,
        1476395008: 512,
        1744830464: 8421378,
        2013265920: 2,
        2281701376: 8389120,
        2550136832: 33280,
        2818572288: 8421376,
        3087007744: 8389122,
        3355443200: 8388610,
        3623878656: 32770,
        3892314112: 514,
        4160749568: 8388608,
        1: 32768,
        268435457: 2,
        536870913: 8421888,
        805306369: 8388608,
        1073741825: 8421378,
        1342177281: 33280,
        1610612737: 512,
        1879048193: 8389122,
        2147483649: 8421890,
        2415919105: 8421376,
        2684354561: 8388610,
        2952790017: 33282,
        3221225473: 514,
        3489660929: 8389120,
        3758096385: 32770,
        4026531841: 0,
        134217729: 8421890,
        402653185: 8421376,
        671088641: 8388608,
        939524097: 512,
        1207959553: 32768,
        1476395009: 8388610,
        1744830465: 2,
        2013265921: 33282,
        2281701377: 32770,
        2550136833: 8389122,
        2818572289: 514,
        3087007745: 8421888,
        3355443201: 8389120,
        3623878657: 0,
        3892314113: 33280,
        4160749569: 8421378
      }, {
        0: 1074282512,
        16777216: 16384,
        33554432: 524288,
        50331648: 1074266128,
        67108864: 1073741840,
        83886080: 1074282496,
        100663296: 1073758208,
        117440512: 16,
        134217728: 540672,
        150994944: 1073758224,
        167772160: 1073741824,
        184549376: 540688,
        201326592: 524304,
        218103808: 0,
        234881024: 16400,
        251658240: 1074266112,
        8388608: 1073758208,
        25165824: 540688,
        41943040: 16,
        58720256: 1073758224,
        75497472: 1074282512,
        92274688: 1073741824,
        109051904: 524288,
        125829120: 1074266128,
        142606336: 524304,
        159383552: 0,
        176160768: 16384,
        192937984: 1074266112,
        209715200: 1073741840,
        226492416: 540672,
        243269632: 1074282496,
        260046848: 16400,
        268435456: 0,
        285212672: 1074266128,
        301989888: 1073758224,
        318767104: 1074282496,
        335544320: 1074266112,
        352321536: 16,
        369098752: 540688,
        385875968: 16384,
        402653184: 16400,
        419430400: 524288,
        436207616: 524304,
        452984832: 1073741840,
        469762048: 540672,
        486539264: 1073758208,
        503316480: 1073741824,
        520093696: 1074282512,
        276824064: 540688,
        293601280: 524288,
        310378496: 1074266112,
        327155712: 16384,
        343932928: 1073758208,
        360710144: 1074282512,
        377487360: 16,
        394264576: 1073741824,
        411041792: 1074282496,
        427819008: 1073741840,
        444596224: 1073758224,
        461373440: 524304,
        478150656: 0,
        494927872: 16400,
        511705088: 1074266128,
        528482304: 540672
      }, {
        0: 260,
        1048576: 0,
        2097152: 67109120,
        3145728: 65796,
        4194304: 65540,
        5242880: 67108868,
        6291456: 67174660,
        7340032: 67174400,
        8388608: 67108864,
        9437184: 67174656,
        10485760: 65792,
        11534336: 67174404,
        12582912: 67109124,
        13631488: 65536,
        14680064: 4,
        15728640: 256,
        524288: 67174656,
        1572864: 67174404,
        2621440: 0,
        3670016: 67109120,
        4718592: 67108868,
        5767168: 65536,
        6815744: 65540,
        7864320: 260,
        8912896: 4,
        9961472: 256,
        11010048: 67174400,
        12058624: 65796,
        13107200: 65792,
        14155776: 67109124,
        15204352: 67174660,
        16252928: 67108864,
        16777216: 67174656,
        17825792: 65540,
        18874368: 65536,
        19922944: 67109120,
        20971520: 256,
        22020096: 67174660,
        23068672: 67108868,
        24117248: 0,
        25165824: 67109124,
        26214400: 67108864,
        27262976: 4,
        28311552: 65792,
        29360128: 67174400,
        30408704: 260,
        31457280: 65796,
        32505856: 67174404,
        17301504: 67108864,
        18350080: 260,
        19398656: 67174656,
        20447232: 0,
        21495808: 65540,
        22544384: 67109120,
        23592960: 256,
        24641536: 67174404,
        25690112: 65536,
        26738688: 67174660,
        27787264: 65796,
        28835840: 67108868,
        29884416: 67109124,
        30932992: 67174400,
        31981568: 4,
        33030144: 65792
      }, {
        0: 2151682048,
        65536: 2147487808,
        131072: 4198464,
        196608: 2151677952,
        262144: 0,
        327680: 4198400,
        393216: 2147483712,
        458752: 4194368,
        524288: 2147483648,
        589824: 4194304,
        655360: 64,
        720896: 2147487744,
        786432: 2151678016,
        851968: 4160,
        917504: 4096,
        983040: 2151682112,
        32768: 2147487808,
        98304: 64,
        163840: 2151678016,
        229376: 2147487744,
        294912: 4198400,
        360448: 2151682112,
        425984: 0,
        491520: 2151677952,
        557056: 4096,
        622592: 2151682048,
        688128: 4194304,
        753664: 4160,
        819200: 2147483648,
        884736: 4194368,
        950272: 4198464,
        1015808: 2147483712,
        1048576: 4194368,
        1114112: 4198400,
        1179648: 2147483712,
        1245184: 0,
        1310720: 4160,
        1376256: 2151678016,
        1441792: 2151682048,
        1507328: 2147487808,
        1572864: 2151682112,
        1638400: 2147483648,
        1703936: 2151677952,
        1769472: 4198464,
        1835008: 2147487744,
        1900544: 4194304,
        1966080: 64,
        2031616: 4096,
        1081344: 2151677952,
        1146880: 2151682112,
        1212416: 0,
        1277952: 4198400,
        1343488: 4194368,
        1409024: 2147483648,
        1474560: 2147487808,
        1540096: 64,
        1605632: 2147483712,
        1671168: 4096,
        1736704: 2147487744,
        1802240: 2151678016,
        1867776: 4160,
        1933312: 2151682048,
        1998848: 4194304,
        2064384: 4198464
      }, {
        0: 128,
        4096: 17039360,
        8192: 262144,
        12288: 536870912,
        16384: 537133184,
        20480: 16777344,
        24576: 553648256,
        28672: 262272,
        32768: 16777216,
        36864: 537133056,
        40960: 536871040,
        45056: 553910400,
        49152: 553910272,
        53248: 0,
        57344: 17039488,
        61440: 553648128,
        2048: 17039488,
        6144: 553648256,
        10240: 128,
        14336: 17039360,
        18432: 262144,
        22528: 537133184,
        26624: 553910272,
        30720: 536870912,
        34816: 537133056,
        38912: 0,
        43008: 553910400,
        47104: 16777344,
        51200: 536871040,
        55296: 553648128,
        59392: 16777216,
        63488: 262272,
        65536: 262144,
        69632: 128,
        73728: 536870912,
        77824: 553648256,
        81920: 16777344,
        86016: 553910272,
        90112: 537133184,
        94208: 16777216,
        98304: 553910400,
        102400: 553648128,
        106496: 17039360,
        110592: 537133056,
        114688: 262272,
        118784: 536871040,
        122880: 0,
        126976: 17039488,
        67584: 553648256,
        71680: 16777216,
        75776: 17039360,
        79872: 537133184,
        83968: 536870912,
        88064: 17039488,
        92160: 128,
        96256: 553910272,
        100352: 262272,
        104448: 553910400,
        108544: 0,
        112640: 553648128,
        116736: 16777344,
        120832: 262144,
        124928: 537133056,
        129024: 536871040
      }, {
        0: 268435464,
        256: 8192,
        512: 270532608,
        768: 270540808,
        1024: 268443648,
        1280: 2097152,
        1536: 2097160,
        1792: 268435456,
        2048: 0,
        2304: 268443656,
        2560: 2105344,
        2816: 8,
        3072: 270532616,
        3328: 2105352,
        3584: 8200,
        3840: 270540800,
        128: 270532608,
        384: 270540808,
        640: 8,
        896: 2097152,
        1152: 2105352,
        1408: 268435464,
        1664: 268443648,
        1920: 8200,
        2176: 2097160,
        2432: 8192,
        2688: 268443656,
        2944: 270532616,
        3200: 0,
        3456: 270540800,
        3712: 2105344,
        3968: 268435456,
        4096: 268443648,
        4352: 270532616,
        4608: 270540808,
        4864: 8200,
        5120: 2097152,
        5376: 268435456,
        5632: 268435464,
        5888: 2105344,
        6144: 2105352,
        6400: 0,
        6656: 8,
        6912: 270532608,
        7168: 8192,
        7424: 268443656,
        7680: 270540800,
        7936: 2097160,
        4224: 8,
        4480: 2105344,
        4736: 2097152,
        4992: 268435464,
        5248: 268443648,
        5504: 8200,
        5760: 270540808,
        6016: 270532608,
        6272: 270540800,
        6528: 270532616,
        6784: 8192,
        7040: 2105352,
        7296: 2097160,
        7552: 0,
        7808: 268435456,
        8064: 268443656
      }, {
        0: 1048576,
        16: 33555457,
        32: 1024,
        48: 1049601,
        64: 34604033,
        80: 0,
        96: 1,
        112: 34603009,
        128: 33555456,
        144: 1048577,
        160: 33554433,
        176: 34604032,
        192: 34603008,
        208: 1025,
        224: 1049600,
        240: 33554432,
        8: 34603009,
        24: 0,
        40: 33555457,
        56: 34604032,
        72: 1048576,
        88: 33554433,
        104: 33554432,
        120: 1025,
        136: 1049601,
        152: 33555456,
        168: 34603008,
        184: 1048577,
        200: 1024,
        216: 34604033,
        232: 1,
        248: 1049600,
        256: 33554432,
        272: 1048576,
        288: 33555457,
        304: 34603009,
        320: 1048577,
        336: 33555456,
        352: 34604032,
        368: 1049601,
        384: 1025,
        400: 34604033,
        416: 1049600,
        432: 1,
        448: 0,
        464: 34603008,
        480: 33554433,
        496: 1024,
        264: 1049600,
        280: 33555457,
        296: 34603009,
        312: 1,
        328: 33554432,
        344: 1048576,
        360: 1025,
        376: 34604032,
        392: 33554433,
        408: 34603008,
        424: 0,
        440: 34604033,
        456: 1049601,
        472: 1024,
        488: 33555456,
        504: 1048577
      }, {
        0: 134219808,
        1: 131072,
        2: 134217728,
        3: 32,
        4: 131104,
        5: 134350880,
        6: 134350848,
        7: 2048,
        8: 134348800,
        9: 134219776,
        10: 133120,
        11: 134348832,
        12: 2080,
        13: 0,
        14: 134217760,
        15: 133152,
        2147483648: 2048,
        2147483649: 134350880,
        2147483650: 134219808,
        2147483651: 134217728,
        2147483652: 134348800,
        2147483653: 133120,
        2147483654: 133152,
        2147483655: 32,
        2147483656: 134217760,
        2147483657: 2080,
        2147483658: 131104,
        2147483659: 134350848,
        2147483660: 0,
        2147483661: 134348832,
        2147483662: 134219776,
        2147483663: 131072,
        16: 133152,
        17: 134350848,
        18: 32,
        19: 2048,
        20: 134219776,
        21: 134217760,
        22: 134348832,
        23: 131072,
        24: 0,
        25: 131104,
        26: 134348800,
        27: 134219808,
        28: 134350880,
        29: 133120,
        30: 2080,
        31: 134217728,
        2147483664: 131072,
        2147483665: 2048,
        2147483666: 134348832,
        2147483667: 133152,
        2147483668: 32,
        2147483669: 134348800,
        2147483670: 134217728,
        2147483671: 134219808,
        2147483672: 134350880,
        2147483673: 134217760,
        2147483674: 134219776,
        2147483675: 0,
        2147483676: 133120,
        2147483677: 2080,
        2147483678: 131104,
        2147483679: 134350848
      }],
      u = [4160749569, 528482304, 33030144, 2064384, 129024, 8064, 504, 2147483679],
      d = a.DES = s.extend({
        _doReset: function _doReset() {
          for (var t = this._key, r = t.words, e = [], i = 0; i < 56; i++) {
            var n = c[i] - 1;
            e[i] = r[n >>> 5] >>> 31 - n % 32 & 1;
          }
          for (var o = this._subKeys = [], s = 0; s < 16; s++) {
            for (var a = o[s] = [], f = l[s], i = 0; i < 24; i++) a[i / 6 | 0] |= e[(h[i] - 1 + f) % 28] << 31 - i % 6, a[4 + (i / 6 | 0)] |= e[28 + (h[i + 24] - 1 + f) % 28] << 31 - i % 6;
            a[0] = a[0] << 1 | a[0] >>> 31;
            for (var i = 1; i < 7; i++) a[i] = a[i] >>> 4 * (i - 1) + 3;
            a[7] = a[7] << 5 | a[7] >>> 27;
          }
          for (var u = this._invSubKeys = [], i = 0; i < 16; i++) u[i] = o[15 - i];
        },
        encryptBlock: function encryptBlock(t, r) {
          this._doCryptBlock(t, r, this._subKeys);
        },
        decryptBlock: function decryptBlock(t, r) {
          this._doCryptBlock(t, r, this._invSubKeys);
        },
        _doCryptBlock: function _doCryptBlock(t, i, n) {
          this._lBlock = t[i], this._rBlock = t[i + 1], r.call(this, 4, 252645135), r.call(this, 16, 65535), e.call(this, 2, 858993459), e.call(this, 8, 16711935), r.call(this, 1, 1431655765);
          for (var o = 0; o < 16; o++) {
            for (var s = n[o], a = this._lBlock, c = this._rBlock, h = 0, l = 0; l < 8; l++) h |= f[l][((c ^ s[l]) & u[l]) >>> 0];
            this._lBlock = c, this._rBlock = a ^ h;
          }
          var d = this._lBlock;
          this._lBlock = this._rBlock, this._rBlock = d, r.call(this, 1, 1431655765), e.call(this, 8, 16711935), e.call(this, 2, 858993459), r.call(this, 16, 65535), r.call(this, 4, 252645135), t[i] = this._lBlock, t[i + 1] = this._rBlock;
        },
        keySize: 2,
        ivSize: 2,
        blockSize: 2
      });
    i.DES = s._createHelper(d);
    var v = a.TripleDES = s.extend({
      _doReset: function _doReset() {
        var t = this._key,
          r = t.words;
        this._des1 = d.createEncryptor(o.create(r.slice(0, 2))), this._des2 = d.createEncryptor(o.create(r.slice(2, 4))), this._des3 = d.createEncryptor(o.create(r.slice(4, 6)));
      },
      encryptBlock: function encryptBlock(t, r) {
        this._des1.encryptBlock(t, r), this._des2.decryptBlock(t, r), this._des3.encryptBlock(t, r);
      },
      decryptBlock: function decryptBlock(t, r) {
        this._des3.decryptBlock(t, r), this._des2.encryptBlock(t, r), this._des1.decryptBlock(t, r);
      },
      keySize: 6,
      ivSize: 2,
      blockSize: 2
    });
    i.TripleDES = s._createHelper(v);
  }(), function () {
    function r() {
      for (var t = this._S, r = this._i, e = this._j, i = 0, n = 0; n < 4; n++) {
        r = (r + 1) % 256, e = (e + t[r]) % 256;
        var o = t[r];
        t[r] = t[e], t[e] = o, i |= t[(t[r] + t[e]) % 256] << 24 - 8 * n;
      }
      return this._i = r, this._j = e, i;
    }
    var e = t,
      i = e.lib,
      n = i.StreamCipher,
      o = e.algo,
      s = o.RC4 = n.extend({
        _doReset: function _doReset() {
          for (var t = this._key, r = t.words, e = t.sigBytes, i = this._S = [], n = 0; n < 256; n++) i[n] = n;
          for (var n = 0, o = 0; n < 256; n++) {
            var s = n % e,
              a = r[s >>> 2] >>> 24 - s % 4 * 8 & 255;
            o = (o + i[n] + a) % 256;
            var c = i[n];
            i[n] = i[o], i[o] = c;
          }
          this._i = this._j = 0;
        },
        _doProcessBlock: function _doProcessBlock(t, e) {
          t[e] ^= r.call(this);
        },
        keySize: 8,
        ivSize: 0
      });
    e.RC4 = n._createHelper(s);
    var a = o.RC4Drop = s.extend({
      cfg: s.cfg.extend({
        drop: 192
      }),
      _doReset: function _doReset() {
        s._doReset.call(this);
        for (var t = this.cfg.drop; t > 0; t--) r.call(this);
      }
    });
    e.RC4Drop = n._createHelper(a);
  }(), t.mode.CTRGladman = function () {
    function r(t) {
      if (255 === (t >> 24 & 255)) {
        var r = t >> 16 & 255,
          e = t >> 8 & 255,
          i = 255 & t;
        255 === r ? (r = 0, 255 === e ? (e = 0, 255 === i ? i = 0 : ++i) : ++e) : ++r, t = 0, t += r << 16, t += e << 8, t += i;
      } else t += 1 << 24;
      return t;
    }
    function e(t) {
      return 0 === (t[0] = r(t[0])) && (t[1] = r(t[1])), t;
    }
    var i = t.lib.BlockCipherMode.extend(),
      n = i.Encryptor = i.extend({
        processBlock: function processBlock(t, r) {
          var i = this._cipher,
            n = i.blockSize,
            o = this._iv,
            s = this._counter;
          o && (s = this._counter = o.slice(0), this._iv = void 0), e(s);
          var a = s.slice(0);
          i.encryptBlock(a, 0);
          for (var c = 0; c < n; c++) t[r + c] ^= a[c];
        }
      });
    return i.Decryptor = n, i;
  }(), function () {
    function r() {
      for (var t = this._X, r = this._C, e = 0; e < 8; e++) a[e] = r[e];
      r[0] = r[0] + 1295307597 + this._b | 0, r[1] = r[1] + 3545052371 + (r[0] >>> 0 < a[0] >>> 0 ? 1 : 0) | 0, r[2] = r[2] + 886263092 + (r[1] >>> 0 < a[1] >>> 0 ? 1 : 0) | 0, r[3] = r[3] + 1295307597 + (r[2] >>> 0 < a[2] >>> 0 ? 1 : 0) | 0, r[4] = r[4] + 3545052371 + (r[3] >>> 0 < a[3] >>> 0 ? 1 : 0) | 0, r[5] = r[5] + 886263092 + (r[4] >>> 0 < a[4] >>> 0 ? 1 : 0) | 0, r[6] = r[6] + 1295307597 + (r[5] >>> 0 < a[5] >>> 0 ? 1 : 0) | 0, r[7] = r[7] + 3545052371 + (r[6] >>> 0 < a[6] >>> 0 ? 1 : 0) | 0, this._b = r[7] >>> 0 < a[7] >>> 0 ? 1 : 0;
      for (var e = 0; e < 8; e++) {
        var i = t[e] + r[e],
          n = 65535 & i,
          o = i >>> 16,
          s = ((n * n >>> 17) + n * o >>> 15) + o * o,
          h = ((4294901760 & i) * i | 0) + ((65535 & i) * i | 0);
        c[e] = s ^ h;
      }
      t[0] = c[0] + (c[7] << 16 | c[7] >>> 16) + (c[6] << 16 | c[6] >>> 16) | 0, t[1] = c[1] + (c[0] << 8 | c[0] >>> 24) + c[7] | 0, t[2] = c[2] + (c[1] << 16 | c[1] >>> 16) + (c[0] << 16 | c[0] >>> 16) | 0, t[3] = c[3] + (c[2] << 8 | c[2] >>> 24) + c[1] | 0, t[4] = c[4] + (c[3] << 16 | c[3] >>> 16) + (c[2] << 16 | c[2] >>> 16) | 0, t[5] = c[5] + (c[4] << 8 | c[4] >>> 24) + c[3] | 0, t[6] = c[6] + (c[5] << 16 | c[5] >>> 16) + (c[4] << 16 | c[4] >>> 16) | 0, t[7] = c[7] + (c[6] << 8 | c[6] >>> 24) + c[5] | 0;
    }
    var e = t,
      i = e.lib,
      n = i.StreamCipher,
      o = e.algo,
      s = [],
      a = [],
      c = [],
      h = o.Rabbit = n.extend({
        _doReset: function _doReset() {
          for (var t = this._key.words, e = this.cfg.iv, i = 0; i < 4; i++) t[i] = 16711935 & (t[i] << 8 | t[i] >>> 24) | 4278255360 & (t[i] << 24 | t[i] >>> 8);
          var n = this._X = [t[0], t[3] << 16 | t[2] >>> 16, t[1], t[0] << 16 | t[3] >>> 16, t[2], t[1] << 16 | t[0] >>> 16, t[3], t[2] << 16 | t[1] >>> 16],
            o = this._C = [t[2] << 16 | t[2] >>> 16, 4294901760 & t[0] | 65535 & t[1], t[3] << 16 | t[3] >>> 16, 4294901760 & t[1] | 65535 & t[2], t[0] << 16 | t[0] >>> 16, 4294901760 & t[2] | 65535 & t[3], t[1] << 16 | t[1] >>> 16, 4294901760 & t[3] | 65535 & t[0]];
          this._b = 0;
          for (var i = 0; i < 4; i++) r.call(this);
          for (var i = 0; i < 8; i++) o[i] ^= n[i + 4 & 7];
          if (e) {
            var s = e.words,
              a = s[0],
              c = s[1],
              h = 16711935 & (a << 8 | a >>> 24) | 4278255360 & (a << 24 | a >>> 8),
              l = 16711935 & (c << 8 | c >>> 24) | 4278255360 & (c << 24 | c >>> 8),
              f = h >>> 16 | 4294901760 & l,
              u = l << 16 | 65535 & h;
            o[0] ^= h, o[1] ^= f, o[2] ^= l, o[3] ^= u, o[4] ^= h, o[5] ^= f, o[6] ^= l, o[7] ^= u;
            for (var i = 0; i < 4; i++) r.call(this);
          }
        },
        _doProcessBlock: function _doProcessBlock(t, e) {
          var i = this._X;
          r.call(this), s[0] = i[0] ^ i[5] >>> 16 ^ i[3] << 16, s[1] = i[2] ^ i[7] >>> 16 ^ i[5] << 16, s[2] = i[4] ^ i[1] >>> 16 ^ i[7] << 16, s[3] = i[6] ^ i[3] >>> 16 ^ i[1] << 16;
          for (var n = 0; n < 4; n++) s[n] = 16711935 & (s[n] << 8 | s[n] >>> 24) | 4278255360 & (s[n] << 24 | s[n] >>> 8), t[e + n] ^= s[n];
        },
        blockSize: 4,
        ivSize: 2
      });
    e.Rabbit = n._createHelper(h);
  }(), t.mode.CTR = function () {
    var r = t.lib.BlockCipherMode.extend(),
      e = r.Encryptor = r.extend({
        processBlock: function processBlock(t, r) {
          var e = this._cipher,
            i = e.blockSize,
            n = this._iv,
            o = this._counter;
          n && (o = this._counter = n.slice(0), this._iv = void 0);
          var s = o.slice(0);
          e.encryptBlock(s, 0), o[i - 1] = o[i - 1] + 1 | 0;
          for (var a = 0; a < i; a++) t[r + a] ^= s[a];
        }
      });
    return r.Decryptor = e, r;
  }(), function () {
    function r() {
      for (var t = this._X, r = this._C, e = 0; e < 8; e++) a[e] = r[e];
      r[0] = r[0] + 1295307597 + this._b | 0, r[1] = r[1] + 3545052371 + (r[0] >>> 0 < a[0] >>> 0 ? 1 : 0) | 0, r[2] = r[2] + 886263092 + (r[1] >>> 0 < a[1] >>> 0 ? 1 : 0) | 0, r[3] = r[3] + 1295307597 + (r[2] >>> 0 < a[2] >>> 0 ? 1 : 0) | 0, r[4] = r[4] + 3545052371 + (r[3] >>> 0 < a[3] >>> 0 ? 1 : 0) | 0, r[5] = r[5] + 886263092 + (r[4] >>> 0 < a[4] >>> 0 ? 1 : 0) | 0, r[6] = r[6] + 1295307597 + (r[5] >>> 0 < a[5] >>> 0 ? 1 : 0) | 0, r[7] = r[7] + 3545052371 + (r[6] >>> 0 < a[6] >>> 0 ? 1 : 0) | 0, this._b = r[7] >>> 0 < a[7] >>> 0 ? 1 : 0;
      for (var e = 0; e < 8; e++) {
        var i = t[e] + r[e],
          n = 65535 & i,
          o = i >>> 16,
          s = ((n * n >>> 17) + n * o >>> 15) + o * o,
          h = ((4294901760 & i) * i | 0) + ((65535 & i) * i | 0);
        c[e] = s ^ h;
      }
      t[0] = c[0] + (c[7] << 16 | c[7] >>> 16) + (c[6] << 16 | c[6] >>> 16) | 0, t[1] = c[1] + (c[0] << 8 | c[0] >>> 24) + c[7] | 0, t[2] = c[2] + (c[1] << 16 | c[1] >>> 16) + (c[0] << 16 | c[0] >>> 16) | 0, t[3] = c[3] + (c[2] << 8 | c[2] >>> 24) + c[1] | 0, t[4] = c[4] + (c[3] << 16 | c[3] >>> 16) + (c[2] << 16 | c[2] >>> 16) | 0, t[5] = c[5] + (c[4] << 8 | c[4] >>> 24) + c[3] | 0, t[6] = c[6] + (c[5] << 16 | c[5] >>> 16) + (c[4] << 16 | c[4] >>> 16) | 0, t[7] = c[7] + (c[6] << 8 | c[6] >>> 24) + c[5] | 0;
    }
    var e = t,
      i = e.lib,
      n = i.StreamCipher,
      o = e.algo,
      s = [],
      a = [],
      c = [],
      h = o.RabbitLegacy = n.extend({
        _doReset: function _doReset() {
          var t = this._key.words,
            e = this.cfg.iv,
            i = this._X = [t[0], t[3] << 16 | t[2] >>> 16, t[1], t[0] << 16 | t[3] >>> 16, t[2], t[1] << 16 | t[0] >>> 16, t[3], t[2] << 16 | t[1] >>> 16],
            n = this._C = [t[2] << 16 | t[2] >>> 16, 4294901760 & t[0] | 65535 & t[1], t[3] << 16 | t[3] >>> 16, 4294901760 & t[1] | 65535 & t[2], t[0] << 16 | t[0] >>> 16, 4294901760 & t[2] | 65535 & t[3], t[1] << 16 | t[1] >>> 16, 4294901760 & t[3] | 65535 & t[0]];
          this._b = 0;
          for (var o = 0; o < 4; o++) r.call(this);
          for (var o = 0; o < 8; o++) n[o] ^= i[o + 4 & 7];
          if (e) {
            var s = e.words,
              a = s[0],
              c = s[1],
              h = 16711935 & (a << 8 | a >>> 24) | 4278255360 & (a << 24 | a >>> 8),
              l = 16711935 & (c << 8 | c >>> 24) | 4278255360 & (c << 24 | c >>> 8),
              f = h >>> 16 | 4294901760 & l,
              u = l << 16 | 65535 & h;
            n[0] ^= h, n[1] ^= f, n[2] ^= l, n[3] ^= u, n[4] ^= h, n[5] ^= f, n[6] ^= l, n[7] ^= u;
            for (var o = 0; o < 4; o++) r.call(this);
          }
        },
        _doProcessBlock: function _doProcessBlock(t, e) {
          var i = this._X;
          r.call(this), s[0] = i[0] ^ i[5] >>> 16 ^ i[3] << 16, s[1] = i[2] ^ i[7] >>> 16 ^ i[5] << 16, s[2] = i[4] ^ i[1] >>> 16 ^ i[7] << 16, s[3] = i[6] ^ i[3] >>> 16 ^ i[1] << 16;
          for (var n = 0; n < 4; n++) s[n] = 16711935 & (s[n] << 8 | s[n] >>> 24) | 4278255360 & (s[n] << 24 | s[n] >>> 8), t[e + n] ^= s[n];
        },
        blockSize: 4,
        ivSize: 2
      });
    e.RabbitLegacy = n._createHelper(h);
  }(), t.pad.ZeroPadding = {
    pad: function pad(t, r) {
      var e = 4 * r;
      t.clamp(), t.sigBytes += e - (t.sigBytes % e || e);
    },
    unpad: function unpad(t) {
      for (var r = t.words, e = t.sigBytes - 1; !(r[e >>> 2] >>> 24 - e % 4 * 8 & 255);) e--;
      t.sigBytes = e + 1;
    }
  }, t;
});

cc._RF.pop();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 245444 characters]
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 245456 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/lq_base/data/lq_const.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '98309gPXUxEF6zBe9e75Knb', 'lq_const');
// Script/lq_base/data/lq_const.ts

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LQConst = exports.LQOperateType = exports.LQLevelStatus = exports.LQAdErrStr = exports.LQCallAd = exports.LQCallBase = exports.LQAnalysisTag = exports.LQByteDanceType = exports.LQPlatformType = exports.LQHttpDataType = exports.LQHttpRequestType = exports.LQEasing = exports.LQCollideStatus = exports.LQFollowTargetMode = exports.LQCollideShape = exports.LQBulletEmitterStatus = exports.LQRecordStatus = void 0;
var Vec2 = cc.Vec2;
var LQRecordStatus;
(function (LQRecordStatus) {
    LQRecordStatus[LQRecordStatus["Idle"] = 0] = "Idle";
    LQRecordStatus[LQRecordStatus["Start"] = 1] = "Start";
    LQRecordStatus[LQRecordStatus["Pause"] = 2] = "Pause";
})(LQRecordStatus = exports.LQRecordStatus || (exports.LQRecordStatus = {}));
var LQBulletEmitterStatus;
(function (LQBulletEmitterStatus) {
    LQBulletEmitterStatus[LQBulletEmitterStatus["Idle"] = 0] = "Idle";
    LQBulletEmitterStatus[LQBulletEmitterStatus["Start"] = 1] = "Start";
    LQBulletEmitterStatus[LQBulletEmitterStatus["End"] = 2] = "End";
})(LQBulletEmitterStatus = exports.LQBulletEmitterStatus || (exports.LQBulletEmitterStatus = {}));
var LQCollideShape;
(function (LQCollideShape) {
    LQCollideShape[LQCollideShape["Rect"] = 1] = "Rect";
    LQCollideShape[LQCollideShape["Circle"] = 2] = "Circle";
    LQCollideShape[LQCollideShape["Polygon"] = 3] = "Polygon";
})(LQCollideShape = exports.LQCollideShape || (exports.LQCollideShape = {}));
var LQFollowTargetMode;
(function (LQFollowTargetMode) {
    LQFollowTargetMode[LQFollowTargetMode["Always"] = 0] = "Always";
    LQFollowTargetMode[LQFollowTargetMode["Once"] = 1] = "Once";
    LQFollowTargetMode[LQFollowTargetMode["Pass"] = 2] = "Pass";
})(LQFollowTargetMode = exports.LQFollowTargetMode || (exports.LQFollowTargetMode = {}));
var LQCollideStatus;
(function (LQCollideStatus) {
    LQCollideStatus[LQCollideStatus["Idle"] = 0] = "Idle";
    LQCollideStatus[LQCollideStatus["Live"] = 1] = "Live";
})(LQCollideStatus = exports.LQCollideStatus || (exports.LQCollideStatus = {}));
var LQEasing;
(function (LQEasing) {
    LQEasing["BackIn"] = "backIn";
    LQEasing["BackOut"] = "backOut";
    LQEasing["quadIn"] = "quadIn";
    LQEasing["quadOut"] = "quadOut";
    LQEasing["quadInOut"] = "quadInOut";
    LQEasing["cubicIn"] = "cubicIn";
    LQEasing["expoOut"] = "expoOut";
})(LQEasing = exports.LQEasing || (exports.LQEasing = {}));
var LQHttpRequestType;
(function (LQHttpRequestType) {
    LQHttpRequestType["Get"] = "get";
    LQHttpRequestType["Post"] = "post";
})(LQHttpRequestType = exports.LQHttpRequestType || (exports.LQHttpRequestType = {}));
var LQHttpDataType;
(function (LQHttpDataType) {
    LQHttpDataType[LQHttpDataType["Text"] = 0] = "Text";
    LQHttpDataType[LQHttpDataType["Binary"] = 1] = "Binary";
})(LQHttpDataType = exports.LQHttpDataType || (exports.LQHttpDataType = {}));
var LQPlatformType;
(function (LQPlatformType) {
    LQPlatformType["unknown"] = "\u672A\u77E5\u5E73\u53F0";
    LQPlatformType["all"] = "\u5168\u5E73\u53F0";
    LQPlatformType["wx"] = "\u5FAE\u4FE1";
    LQPlatformType["tt"] = "\u5B57\u8282\u8DF3\u52A8";
    LQPlatformType["oppo"] = "oppo";
    LQPlatformType["vivo"] = "vivo";
    LQPlatformType["qq"] = "qq";
    LQPlatformType["baidu"] = "\u767E\u5EA6";
    LQPlatformType["kwaigame"] = "\u5FEB\u624B";
    LQPlatformType["android"] = "\u5B89\u5353";
    LQPlatformType["ios"] = "\u82F9\u679C";
    LQPlatformType["browser"] = "\u6D4F\u89C8\u5668";
})(LQPlatformType = exports.LQPlatformType || (exports.LQPlatformType = {}));
var LQByteDanceType;
(function (LQByteDanceType) {
    LQByteDanceType["tt"] = "\u5934\u6761";
    LQByteDanceType["tt_lite"] = "\u5934\u6761\u6781\u901F\u7248";
    LQByteDanceType["douyin"] = "\u6296\u97F3";
    LQByteDanceType["douyin_lite"] = "\u6296\u97F3\u6781\u901F\u7248";
    LQByteDanceType["ppx"] = "\u76AE\u76AE\u867E";
    LQByteDanceType["devtools"] = "\u5B57\u8282\u5F00\u53D1\u5DE5\u5177";
})(LQByteDanceType = exports.LQByteDanceType || (exports.LQByteDanceType = {}));
var LQAnalysisTag;
(function (LQAnalysisTag) {
    LQAnalysisTag["VideoComplete"] = "video_complete";
    LQAnalysisTag["VideoBegin"] = "video_begin";
    LQAnalysisTag["VideoInterrupt"] = "video_interrupt";
    LQAnalysisTag["InterstitialShow"] = "interstitial_show";
    LQAnalysisTag["BannerShow"] = "banner_show";
    LQAnalysisTag["ExportShow"] = "export_show";
    LQAnalysisTag["NativeShow"] = "native_show";
    LQAnalysisTag["NativeClick"] = "native_show";
})(LQAnalysisTag = exports.LQAnalysisTag || (exports.LQAnalysisTag = {}));
var LQCallBase;
(function (LQCallBase) {
    LQCallBase[LQCallBase["InitSdk"] = 0] = "InitSdk";
    LQCallBase[LQCallBase["KeepScreenOn"] = 1] = "KeepScreenOn";
    LQCallBase[LQCallBase["Vibrate"] = 2] = "Vibrate";
    LQCallBase[LQCallBase["GetVersionCode"] = 3] = "GetVersionCode";
    LQCallBase[LQCallBase["GetVersionName"] = 4] = "GetVersionName";
    LQCallBase[LQCallBase["OpenUrl"] = 5] = "OpenUrl";
    LQCallBase[LQCallBase["DeleteDir"] = 6] = "DeleteDir";
    LQCallBase[LQCallBase["DeleteFile"] = 7] = "DeleteFile";
})(LQCallBase = exports.LQCallBase || (exports.LQCallBase = {}));
var LQCallAd;
(function (LQCallAd) {
    LQCallAd[LQCallAd["ShowBanner"] = 0] = "ShowBanner";
    LQCallAd[LQCallAd["HideBanner"] = 1] = "HideBanner";
    LQCallAd[LQCallAd["ShowVideo"] = 2] = "ShowVideo";
    LQCallAd[LQCallAd["ShowInterstitial"] = 3] = "ShowInterstitial";
    LQCallAd[LQCallAd["ShowNative"] = 4] = "ShowNative";
    LQCallAd[LQCallAd["CacheAd"] = 5] = "CacheAd";
})(LQCallAd = exports.LQCallAd || (exports.LQCallAd = {}));
var LQAdErrStr;
(function (LQAdErrStr) {
    LQAdErrStr["Unsupported"] = "\u4E0D\u652F\u6301";
    LQAdErrStr["NoParameters"] = "\u6CA1\u6709\u914D\u7F6E\u53C2\u6570";
    LQAdErrStr["NoAD"] = "\u6682\u65E0\u5E7F\u544A";
    LQAdErrStr["VersionOld"] = "\u7248\u672C\u8FC7\u4F4E";
    LQAdErrStr["VideoInterrupt"] = "\u4E2D\u65AD\u64AD\u653E";
    LQAdErrStr["InstanceErr"] = "\u5B9E\u4F8B\u4E3A\u7A7A";
    LQAdErrStr["AlreadyExist"] = "\u5DF2\u7ECF\u5B58\u5728";
    LQAdErrStr["IntervalTooShort"] = "\u95F4\u9694\u592A\u77ED";
})(LQAdErrStr = exports.LQAdErrStr || (exports.LQAdErrStr = {}));
var LQLevelStatus;
(function (LQLevelStatus) {
    LQLevelStatus[LQLevelStatus["Begin"] = 0] = "Begin";
    LQLevelStatus[LQLevelStatus["Failed"] = 1] = "Failed";
    LQLevelStatus[LQLevelStatus["Complete"] = 2] = "Complete";
})(LQLevelStatus = exports.LQLevelStatus || (exports.LQLevelStatus = {}));
var LQOperateType;
(function (LQOperateType) {
    LQOperateType[LQOperateType["ClickNode"] = 0] = "ClickNode";
    LQOperateType[LQOperateType["ClickScreen"] = 1] = "ClickScreen";
    LQOperateType[LQOperateType["Move"] = 2] = "Move";
    LQOperateType[LQOperateType["Null"] = 3] = "Null";
})(LQOperateType = exports.LQOperateType || (exports.LQOperateType = {}));
var LQConst = /** @class */ (function () {
    function LQConst() {
    }
    LQConst.VEC_ZERO = Vec2.ZERO;
    return LQConst;
}());
exports.LQConst = LQConst;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 6868 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/tiledmap-optimize-resource/Script/TmoAssembler.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '18d1c5ObBtCeaysyO5bMIgb', 'TmoAssembler');
// Script/TmoAssembler.js

"use strict";

exports.__esModule = true;
exports.TmoAssembler = void 0;
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
var gfx = cc.gfx;
// 颜色去除 + 物件图集合批
var vfmtPosUvIndex = new gfx.VertexFormat([{
  name: gfx.ATTR_POSITION,
  type: gfx.ATTR_TYPE_FLOAT32,
  num: 2
}, {
  name: gfx.ATTR_UV0,
  type: gfx.ATTR_TYPE_FLOAT32,
  num: 2
}, {
  name: "a_texture_idx",
  type: gfx.ATTR_TYPE_FLOAT32,
  num: 1
}]);

// 仅物件图集合批
var vfmtPosUvColorIndex = new gfx.VertexFormat([{
  name: gfx.ATTR_POSITION,
  type: gfx.ATTR_TYPE_FLOAT32,
  num: 2
}, {
  name: gfx.ATTR_UV0,
  type: gfx.ATTR_TYPE_FLOAT32,
  num: 2
}, {
  name: "a_texture_idx",
  type: gfx.ATTR_TYPE_FLOAT32,
  num: 1
}, {
  name: gfx.ATTR_COLOR,
  type: gfx.ATTR_TYPE_UINT8,
  num: 4,
  normalize: true
}]);
var TmoAssembler = /*#__PURE__*/function (_cc$Assembler) {
  _inheritsLoose(TmoAssembler, _cc$Assembler);
  function TmoAssembler() {
    return _cc$Assembler.apply(this, arguments) || this;
  }
  var _proto = TmoAssembler.prototype;
  _proto.init = function init(comp) {
    _cc$Assembler.prototype.init.call(this, comp);
    this._noColor = comp.isNoColor();
    this.updateColor = this._noColor ? undefined : this.updateColorFunc;
    this.uvOffset = 2;
    this.colorOffset = 5;
    this.textureIndexOffset = 4;
    this.floatsPerVert = this._noColor ? 5 : 6;
    this.indicesCount = 6;
    this.verticesCount = 4;
    this._renderData = new cc.RenderData();
    this._renderData.init(this);
    this.initLocal();
    this.initData();
  };
  _proto.initLocal = function initLocal() {
    this._local = [];
    this._local.length = 4;
  };
  _proto.initData = function initData() {
    var data = this._renderData;
    data.createFlexData(0, this.verticesCount, this.indicesCount, this.getVfmt());

    // 填充顶点索引信息
    var indices = data.iDatas[0];
    var count = indices.length / 6;
    for (var i = 0, idx = 0; i < count; i++) {
      var vertextID = i * 4;
      indices[idx++] = vertextID;
      indices[idx++] = vertextID + 1;
      indices[idx++] = vertextID + 2;
      indices[idx++] = vertextID + 1;
      indices[idx++] = vertextID + 3;
      indices[idx++] = vertextID + 2;
    }
  };
  _proto.getBuffer = function getBuffer() {
    return cc.renderer._handle.getBuffer("mesh", this.getVfmt());
  };
  _proto.getVfmt = function getVfmt() {
    return this._noColor ? vfmtPosUvIndex : vfmtPosUvColorIndex;
  };
  _proto.updateRenderData = function updateRenderData(sprite) {
    this.packToDynamicAtlas(sprite, sprite._spriteFrame);
    if (sprite._vertsDirty) {
      this.updateUVs(sprite);
      this.updateVerts(sprite);
      this.updateTextureIdx(sprite);
      sprite._vertsDirty = false;
    }
  }

  /**
   * 填充textureIndex数据
   * @param {cc.Sprite} sprite 
   */;
  _proto.updateTextureIdx = function updateTextureIdx(sprite) {
    var textureIdx = sprite._textureIdx;
    var verts = this._renderData.vDatas[0];
    var verticesCount = this.verticesCount;
    var floatsPerVert = this.floatsPerVert;
    var textureIndexOffset = this.textureIndexOffset;
    for (var i = 0; i < verticesCount; i++) {
      var index = i * floatsPerVert + textureIndexOffset;
      verts[index] = textureIdx;
    }
  };
  _proto.updateUVs = function updateUVs(sprite) {
    var uv = sprite._spriteFrame.uv;
    var uvOffset = this.uvOffset;
    var floatsPerVert = this.floatsPerVert;
    var verts = this._renderData.vDatas[0];
    for (var i = 0; i < 4; i++) {
      var srcOffset = i * 2;
      var dstOffset = floatsPerVert * i + uvOffset;
      verts[dstOffset] = uv[srcOffset];
      verts[dstOffset + 1] = uv[srcOffset + 1];
    }
  };
  _proto.updateVerts = function updateVerts(sprite) {
    var node = sprite.node,
      cw = node.width,
      ch = node.height,
      appx = node.anchorX * cw,
      appy = node.anchorY * ch,
      l,
      b,
      r,
      t;
    if (sprite.trim) {
      l = -appx;
      b = -appy;
      r = cw - appx;
      t = ch - appy;
    } else {
      var frame = sprite.spriteFrame,
        ow = frame._originalSize.width,
        oh = frame._originalSize.height,
        rw = frame._rect.width,
        rh = frame._rect.height,
        offset = frame._offset,
        scaleX = cw / ow,
        scaleY = ch / oh;
      var trimLeft = offset.x + (ow - rw) / 2;
      var trimRight = offset.x - (ow - rw) / 2;
      var trimBottom = offset.y + (oh - rh) / 2;
      var trimTop = offset.y - (oh - rh) / 2;
      l = trimLeft * scaleX - appx;
      b = trimBottom * scaleY - appy;
      r = cw + trimRight * scaleX - appx;
      t = ch + trimTop * scaleY - appy;
    }
    var local = this._local;
    local[0] = l;
    local[1] = b;
    local[2] = r;
    local[3] = t;
    this.updateWorldVerts(sprite);
  };
  _proto.updateColorFunc = function updateColorFunc(comp, color) {
    var uintVerts = this._renderData.uintVDatas[0];
    if (!uintVerts) return;
    color = color != null ? color : comp.node.color._val;
    var floatsPerVert = this.floatsPerVert;
    var colorOffset = this.colorOffset;
    for (var i = colorOffset, l = uintVerts.length; i < l; i += floatsPerVert) {
      uintVerts[i] = color;
    }
  };
  _proto.updateWorldVerts = function updateWorldVerts(comp) {
    if (CC_NATIVERENDERER) {
      // 原生平台兼容代码 复制于jsb-engine.js中的cc.Assembler2D.prototype.updateWorldVerts
      var local = this._local;
      var verts = this._renderData.vDatas[0];
      var vl = local[0],
        vr = local[2],
        vb = local[1],
        vt = local[3];
      var floatsPerVert = this.floatsPerVert;
      var vertexOffset = 0; // left bottom

      verts[vertexOffset] = vl;
      verts[vertexOffset + 1] = vb;
      vertexOffset += floatsPerVert; // right bottom

      verts[vertexOffset] = vr;
      verts[vertexOffset + 1] = vb;
      vertexOffset += floatsPerVert; // left top

      verts[vertexOffset] = vl;
      verts[vertexOffset + 1] = vt;
      vertexOffset += floatsPerVert; // right top

      verts[vertexOffset] = vr;
      verts[vertexOffset + 1] = vt;
    } else {
      var _local = this._local;
      var _verts = this._renderData.vDatas[0];
      var matrix = comp.node._worldMatrix;
      var matrixm = matrix.m,
        a = matrixm[0],
        b = matrixm[1],
        c = matrixm[4],
        d = matrixm[5],
        tx = matrixm[12],
        ty = matrixm[13];
      var _vl = _local[0],
        _vr = _local[2],
        _vb = _local[1],
        _vt = _local[3];
      var _floatsPerVert = this.floatsPerVert;
      var _vertexOffset = 0;
      var justTranslate = a === 1 && b === 0 && c === 0 && d === 1;
      if (justTranslate) {
        // left bottom
        _verts[_vertexOffset] = _vl + tx;
        _verts[_vertexOffset + 1] = _vb + ty;
        _vertexOffset += _floatsPerVert;
        // right bottom
        _verts[_vertexOffset] = _vr + tx;
        _verts[_vertexOffset + 1] = _vb + ty;
        _vertexOffset += _floatsPerVert;
        // left top
        _verts[_vertexOffset] = _vl + tx;
        _verts[_vertexOffset + 1] = _vt + ty;
        _vertexOffset += _floatsPerVert;
        // right top
        _verts[_vertexOffset] = _vr + tx;
        _verts[_vertexOffset + 1] = _vt + ty;
      } else {
        var al = a * _vl,
          ar = a * _vr,
          bl = b * _vl,
          br = b * _vr,
          cb = c * _vb,
          ct = c * _vt,
          db = d * _vb,
          dt = d * _vt;

        // left bottom
        _verts[_vertexOffset] = al + cb + tx;
        _verts[_vertexOffset + 1] = bl + db + ty;
        _vertexOffset += _floatsPerVert;
        // right bottom
        _verts[_vertexOffset] = ar + cb + tx;
        _verts[_vertexOffset + 1] = br + db + ty;
        _vertexOffset += _floatsPerVert;
        // left top
        _verts[_vertexOffset] = al + ct + tx;
        _verts[_vertexOffset + 1] = bl + dt + ty;
        _vertexOffset += _floatsPerVert;
        // right top
        _verts[_vertexOffset] = ar + ct + tx;
        _verts[_vertexOffset + 1] = br + dt + ty;
      }
    }
  };
  _proto.fillBuffers = function fillBuffers(comp, renderer) {
    if (renderer.worldMatDirty) {
      this.updateWorldVerts(comp);
    }
    var renderData = this._renderData;
    var vData = renderData.vDatas[0];
    var iData = renderData.iDatas[0];
    var buffer = this.getBuffer(renderer);
    var offsetInfo = buffer.request(this.verticesCount, this.indicesCount);

    // buffer data may be realloc, need get reference after request.

    // fill vertices
    var vertexOffset = offsetInfo.byteOffset >> 2,
      vbuf = buffer._vData;
    if (vData.length + vertexOffset > vbuf.length) {
      vbuf.set(vData.subarray(0, vbuf.length - vertexOffset), vertexOffset);
    } else {
      vbuf.set(vData, vertexOffset);
    }

    // fill indices
    var ibuf = buffer._iData,
      indiceOffset = offsetInfo.indiceOffset,
      vertexId = offsetInfo.vertexOffset;
    for (var i = 0, l = iData.length; i < l; i++) {
      ibuf[indiceOffset++] = vertexId + iData[i];
    }
  };
  _proto.packToDynamicAtlas = function packToDynamicAtlas(comp, frame) {
    if (CC_TEST) return;
    if (!frame._original && cc.dynamicAtlasManager && frame._texture.packable) {
      var packedFrame = cc.dynamicAtlasManager.insertSpriteFrame(frame);
      if (packedFrame) {
        frame._setDynamicAtlasFrame(packedFrame);
      }
    }
    var material = comp._materials[0];
    if (!material) return;
    if (material.getProperty('texture') !== frame._texture) {
      // texture was packed to dynamic atlas, should update uvs
      comp._vertsDirty = true;
      comp._updateMaterial();
    }
  };
  _createClass(TmoAssembler, [{
    key: "verticesFloats",
    get: function get() {
      return this.verticesCount * this.floatsPerVert;
    }
  }]);
  return TmoAssembler;
}(cc.Assembler);
exports.TmoAssembler = TmoAssembler;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 32132 characters]
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/tiledmap-optimize-resource/Script/TmoTiledMap.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '0b9eetmSUdJRZCQS91TYCw/', 'TmoTiledMap');
// Script/TmoTiledMap.js

"use strict";

// Learn cc.Class:
//  - https://docs.cocos.com/creator/manual/en/scripting/class.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
var TmoTiledLayer = require("./TmoTiledLayer");
var TmoObjectGroup = require("./TmoObjectGroup");
cc.Class({
  "extends": cc.TiledMap,
  properties: {
    objectMaterial: cc.Material,
    noColor: true,
    singleTexture: true,
    _objectTextures: []
  },
  _applyFile: function _applyFile() {
    if (!this.objectMaterial) {
      cc.error("TiledmapOptimize: 未设置objectMaterial!");
      return;
    }
    this._super();
  },
  _buildLayerAndGroup: function _buildLayerAndGroup() {
    var tilesets = this._tilesets;
    var texGrids = this._texGrids;
    var animations = this._animations;
    texGrids.length = 0;
    for (var i = 0, l = tilesets.length; i < l; ++i) {
      var tilesetInfo = tilesets[i];
      if (!tilesetInfo) continue;
      cc.TiledMap.fillTextureGrids(tilesetInfo, texGrids, i);
    }
    this._fillAniGrids(texGrids, animations);
    var layers = this._layers;
    var groups = this._groups;
    var images = this._images;
    var oldNodeNames = {};
    for (var _i = 0, n = layers.length; _i < n; _i++) {
      oldNodeNames[layers[_i].node._name] = true;
    }
    for (var _i2 = 0, _n = groups.length; _i2 < _n; _i2++) {
      oldNodeNames[groups[_i2].node._name] = true;
    }
    for (var _i3 = 0, _n2 = images.length; _i3 < _n2; _i3++) {
      oldNodeNames[images[_i3]._name] = true;
    }
    layers = this._layers = [];
    groups = this._groups = [];
    images = this._images = [];
    var mapInfo = this._mapInfo;
    var node = this.node;
    var layerInfos = mapInfo.getAllChildren();
    var textures = this._textures;
    var maxWidth = 0;
    var maxHeight = 0;
    this._objectTextures = [];
    var firstTmxLayer = null;
    if (layerInfos && layerInfos.length > 0) {
      for (var _i4 = 0, len = layerInfos.length; _i4 < len; _i4++) {
        var layerInfo = layerInfos[_i4];
        var name = layerInfo.name;
        var child = this.node.getChildByName(name);
        oldNodeNames[name] = false;
        if (!child) {
          child = new cc.Node();
          child.name = name;
          node.addChild(child);
        }
        child.setSiblingIndex(_i4);
        child.active = layerInfo.visible;
        if (layerInfo instanceof cc.TMXLayerInfo) {
          // 此处修改 改为创建MyTiledLayer
          var layer = child.getComponent(TmoTiledLayer);
          if (!layer) {
            layer = child.addComponent(TmoTiledLayer);
          }
          // 修改结束
          // 此处修改 传递firstTmxLayer 记录firstTmxLayer
          layer._init(layerInfo, mapInfo, tilesets, textures, texGrids, this, firstTmxLayer);
          firstTmxLayer = firstTmxLayer || layer;
          // 修改结束

          // tell the layerinfo to release the ownership of the tiles map.
          layerInfo.ownTiles = false;
          layers.push(layer);
        } else if (layerInfo instanceof cc.TMXObjectGroupInfo) {
          var group = child.getComponent(TmoObjectGroup);
          if (!group) {
            group = child.addComponent(TmoObjectGroup);
          }
          group._init(layerInfo, mapInfo, texGrids, this);
          groups.push(group);
        } else if (layerInfo instanceof cc.TMXImageLayerInfo) {
          var texture = layerInfo.sourceImage;
          child.opacity = layerInfo.opacity;
          child.layerInfo = layerInfo;
          child._offset = cc.v2(layerInfo.offset.x, -layerInfo.offset.y);
          var image = child.getComponent(cc.Sprite);
          if (!image) {
            image = child.addComponent(cc.Sprite);
          }
          var spf = image.spriteFrame || new cc.SpriteFrame();
          spf.setTexture(texture);
          image.spriteFrame = spf;
          child.width = texture.width;
          child.height = texture.height;
          images.push(child);
        }
        maxWidth = Math.max(maxWidth, child.width);
        maxHeight = Math.max(maxHeight, child.height);
      }
    }

    // 设置材质的texture属性
    var objectTextures = this._objectTextures;
    for (var _i5 = 0; _i5 < objectTextures.length; _i5++) {
      var idx = _i5 === 0 ? '' : _i5;
      this.objectMaterial.setProperty("texture" + idx, objectTextures[_i5], 0);
    }
    var children = node.children;
    for (var _i6 = 0, _n3 = children.length; _i6 < _n3; _i6++) {
      var c = children[_i6];
      if (oldNodeNames[c._name]) {
        c.destroy();
      }
    }
    this.node.width = maxWidth;
    this.node.height = maxHeight;
    this._syncAnchorPoint();
  },
  getObjectMaterial: function getObjectMaterial() {
    return this.objectMaterial;
  },
  isNoColor: function isNoColor() {
    return this.noColor;
  },
  isSingleTexture: function isSingleTexture() {
    return this.singleTexture;
  },
  getObjectTextures: function getObjectTextures() {
    return this._objectTextures;
  }
});

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 17224 characters]
//------QC-SOURCE-SPLIT------
