System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2", "__unresolved_3", "__unresolved_4", "__unresolved_5", "__unresolved_6", "__unresolved_7"], function (_export, _context) {
  "use strict";

  var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, ITEM_MAGENT_LV, ITEM_TIME_LV, ITEM_TYPE, BasePanel, Data, WindowManager, Main, audioManager, constants, _dec, _class, _crd, ccclass, property, LevelLayer;

  function _reportPossibleCrUseOfITEM_MAGENT_LV(extras) {
    _reporterNs.report("ITEM_MAGENT_LV", "../../../core/common/GameConst", _context.meta, extras);
  }

  function _reportPossibleCrUseOfITEM_TIME_LV(extras) {
    _reporterNs.report("ITEM_TIME_LV", "../../../core/common/GameConst", _context.meta, extras);
  }

  function _reportPossibleCrUseOfITEM_TYPE(extras) {
    _reporterNs.report("ITEM_TYPE", "../../../core/common/GameConst", _context.meta, extras);
  }

  function _reportPossibleCrUseOfBasePanel(extras) {
    _reporterNs.report("BasePanel", "../../../core/component/BasePanel", _context.meta, extras);
  }

  function _reportPossibleCrUseOfData(extras) {
    _reporterNs.report("Data", "../../../core/manager/Data", _context.meta, extras);
  }

  function _reportPossibleCrUseOfWindowManager(extras) {
    _reporterNs.report("WindowManager", "../../../core/manager/WindowManager", _context.meta, extras);
  }

  function _reportPossibleCrUseOfMain(extras) {
    _reporterNs.report("Main", "../Main", _context.meta, extras);
  }

  function _reportPossibleCrUseOfBuyItemLayer(extras) {
    _reporterNs.report("BuyItemLayer", "./BuyItemLayer", _context.meta, extras);
  }

  function _reportPossibleCrUseOfaudioManager(extras) {
    _reporterNs.report("audioManager", "db://assets/manager/audioManager", _context.meta, extras);
  }

  function _reportPossibleCrUseOfconstants(extras) {
    _reporterNs.report("constants", "db://assets/data/constants", _context.meta, extras);
  }

  return {
    setters: [function (_unresolved_) {
      _reporterNs = _unresolved_;
    }, function (_cc) {
      _cclegacy = _cc.cclegacy;
      __checkObsolete__ = _cc.__checkObsolete__;
      __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
      _decorator = _cc._decorator;
    }, function (_unresolved_2) {
      ITEM_MAGENT_LV = _unresolved_2.ITEM_MAGENT_LV;
      ITEM_TIME_LV = _unresolved_2.ITEM_TIME_LV;
      ITEM_TYPE = _unresolved_2.ITEM_TYPE;
    }, function (_unresolved_3) {
      BasePanel = _unresolved_3.default;
    }, function (_unresolved_4) {
      Data = _unresolved_4.default;
    }, function (_unresolved_5) {
      WindowManager = _unresolved_5.default;
    }, function (_unresolved_6) {
      Main = _unresolved_6.Main;
    }, function (_unresolved_7) {
      audioManager = _unresolved_7.default;
    }, function (_unresolved_8) {
      constants = _unresolved_8.constants;
    }],
    execute: function () {
      _crd = true;

      _cclegacy._RF.push({}, "72e80Oh5tdJWJfsfdb8Okk8", "LevelLayer", undefined);

      __checkObsolete__(['_decorator', 'director']);

      ({
        ccclass,
        property
      } = _decorator);

      _export("LevelLayer", LevelLayer = (_dec = ccclass('LevelLayer'), _dec(_class = class LevelLayer extends (_crd && BasePanel === void 0 ? (_reportPossibleCrUseOfBasePanel({
        error: Error()
      }), BasePanel) : BasePanel) {
        start() {
          this.GetGameObject("lock1").active = (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.lv < (_crd && ITEM_MAGENT_LV === void 0 ? (_reportPossibleCrUseOfITEM_MAGENT_LV({
            error: Error()
          }), ITEM_MAGENT_LV) : ITEM_MAGENT_LV);
          this.GetGameObject("icon1").active = (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.lv >= (_crd && ITEM_MAGENT_LV === void 0 ? (_reportPossibleCrUseOfITEM_MAGENT_LV({
            error: Error()
          }), ITEM_MAGENT_LV) : ITEM_MAGENT_LV);
          this.GetGameObject("lock2").active = (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.lv < (_crd && ITEM_TIME_LV === void 0 ? (_reportPossibleCrUseOfITEM_TIME_LV({
            error: Error()
          }), ITEM_TIME_LV) : ITEM_TIME_LV);
          this.GetGameObject("icon2").active = (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.lv >= (_crd && ITEM_TIME_LV === void 0 ? (_reportPossibleCrUseOfITEM_TIME_LV({
            error: Error()
          }), ITEM_TIME_LV) : ITEM_TIME_LV);
          this.SetText("lbl_item_magent_lv", (_crd && ITEM_MAGENT_LV === void 0 ? (_reportPossibleCrUseOfITEM_MAGENT_LV({
            error: Error()
          }), ITEM_MAGENT_LV) : ITEM_MAGENT_LV) + "级解锁");
          this.SetText("lbl_item_time_lv", (_crd && ITEM_TIME_LV === void 0 ? (_reportPossibleCrUseOfITEM_TIME_LV({
            error: Error()
          }), ITEM_TIME_LV) : ITEM_TIME_LV) + "级解锁");

          if ((_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.magnet > 0) {
            this.SetText("lbl_item1_num", (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
              error: Error()
            }), Data) : Data).user.magnet + "");
          } else {
            this.SetText("lbl_item1_num", "+");
          }

          if ((_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.time > 0) {
            this.SetText("lbl_item2_num", (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
              error: Error()
            }), Data) : Data).user.time + "");
          } else {
            this.SetText("lbl_item2_num", "+");
          }

          this.SetText("lbl_lvv", "关卡" + (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.lv);
        }

        onBtnClicked(event, customEventData) {
          (_crd && audioManager === void 0 ? (_reportPossibleCrUseOfaudioManager({
            error: Error()
          }), audioManager) : audioManager).playOneShot((_crd && constants === void 0 ? (_reportPossibleCrUseOfconstants({
            error: Error()
          }), constants) : constants).audios.btnclick);
          var btnName = event.target.name;

          switch (btnName) {
            case "btn_close":
              this.close();
              break;

            case "btn_item_1":
              if ((_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
                error: Error()
              }), Data) : Data).user.lv < (_crd && ITEM_MAGENT_LV === void 0 ? (_reportPossibleCrUseOfITEM_MAGENT_LV({
                error: Error()
              }), ITEM_MAGENT_LV) : ITEM_MAGENT_LV)) return;

              if ((_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
                error: Error()
              }), Data) : Data).user.magnet == 0) {
                (_crd && WindowManager === void 0 ? (_reportPossibleCrUseOfWindowManager({
                  error: Error()
                }), WindowManager) : WindowManager).ins.open("BuyItemLayer").then(com => {
                  com.setItemType((_crd && ITEM_TYPE === void 0 ? (_reportPossibleCrUseOfITEM_TYPE({
                    error: Error()
                  }), ITEM_TYPE) : ITEM_TYPE).Magnet);
                });
                this.close();
              } else {
                this.GetGameObject("choose_item1").active = !this.GetGameObject("choose_item1").active;
              }

              break;

            case "btn_item_2":
              if ((_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
                error: Error()
              }), Data) : Data).user.lv < (_crd && ITEM_TIME_LV === void 0 ? (_reportPossibleCrUseOfITEM_TIME_LV({
                error: Error()
              }), ITEM_TIME_LV) : ITEM_TIME_LV)) return;

              if ((_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
                error: Error()
              }), Data) : Data).user.time == 0) {
                (_crd && WindowManager === void 0 ? (_reportPossibleCrUseOfWindowManager({
                  error: Error()
                }), WindowManager) : WindowManager).ins.open("BuyItemLayer").then(com => {
                  com.setItemType((_crd && ITEM_TYPE === void 0 ? (_reportPossibleCrUseOfITEM_TYPE({
                    error: Error()
                  }), ITEM_TYPE) : ITEM_TYPE).Time);
                });
                this.close();
              } else {
                this.GetGameObject("choose_item2").active = !this.GetGameObject("choose_item2").active;
              }

              break;

            case "btn_play":
              (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
                error: Error()
              }), Data) : Data).user.useMagnet = this.GetGameObject("choose_item1").active;
              (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
                error: Error()
              }), Data) : Data).user.useTime = this.GetGameObject("choose_item2").active;
              this.close();
              (_crd && Main === void 0 ? (_reportPossibleCrUseOfMain({
                error: Error()
              }), Main) : Main).Instance().play();
              break;

            case "btn_back":
              this.close();
              break;
          }
        }

      }) || _class));

      _cclegacy._RF.pop();

      _crd = false;
    }
  };
});
//# sourceMappingURL=6e691a0ff9bfa5451b093ebbd374078a89b02930.js.map