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, tween, v3, BasePanel, WindowManager, GameConst, Main, platformSystem, constants, audioManager, _dec, _class, _crd, ccclass, property, OutOfBoxLayer;

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

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

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

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

  function _reportPossibleCrUseOfplatformSystem(extras) {
    _reporterNs.report("platformSystem", "db://assets/platform/platformSystem", _context.meta, extras);
  }

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

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

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

      _cclegacy._RF.push({}, "9ac6aLLMndCu5E85jDiIYvn", "OutOfBoxLayer", undefined);

      __checkObsolete__(['_decorator', 'Component', 'Node', 'tween', 'v3']);

      ({
        ccclass,
        property
      } = _decorator);

      _export("OutOfBoxLayer", OutOfBoxLayer = (_dec = ccclass('OutOfBoxLayer'), _dec(_class = class OutOfBoxLayer extends (_crd && BasePanel === void 0 ? (_reportPossibleCrUseOfBasePanel({
        error: Error()
      }), BasePanel) : BasePanel) {
        start() {
          let btn_clear = this.GetGameObject("btn_clear");
          tween(btn_clear).sequence(tween(btn_clear).to(1, {
            scale: v3(0.8, 0.8, 0.8)
          }), tween(btn_clear).to(1, {
            scale: v3(1, 1, 1)
          })).repeatForever().start();
          this.SetText("lbl_coll_star", (_crd && Main === void 0 ? (_reportPossibleCrUseOfMain({
            error: Error()
          }), Main) : Main).Instance()._GameUI.star + "");
          this.GetGameObject("one-more-chance-bg").active = false;
          (_crd && Main === void 0 ? (_reportPossibleCrUseOfMain({
            error: Error()
          }), Main) : Main).Instance()._GameUI.pasue = true;
          (_crd && audioManager === void 0 ? (_reportPossibleCrUseOfaudioManager({
            error: Error()
          }), audioManager) : audioManager).playOneShot((_crd && constants === void 0 ? (_reportPossibleCrUseOfconstants({
            error: Error()
          }), constants) : constants).audios.softFail);
        }

        onDestroy() {
          super.onDestroy();
          (_crd && Main === void 0 ? (_reportPossibleCrUseOfMain({
            error: Error()
          }), Main) : Main).Instance()._GameUI.pasue = false;
        }

        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":
              if (this.GetGameObject("one-more-chance-bg").active == false && (_crd && Main === void 0 ? (_reportPossibleCrUseOfMain({
                error: Error()
              }), Main) : Main).Instance()._GameUI.star > 0) {
                this.GetGameObject("one-more-chance-bg").active = true;
                tween(this.GetGameObject("one-more-chance-bg")).to(1, {
                  position: v3(0, 372, 0)
                }).start();
                return;
              }

              this.close();
              (_crd && WindowManager === void 0 ? (_reportPossibleCrUseOfWindowManager({
                error: Error()
              }), WindowManager) : WindowManager).ins.open("FailLayer");
              break;

            case "btn_clear":
              (_crd && platformSystem === void 0 ? (_reportPossibleCrUseOfplatformSystem({
                error: Error()
              }), platformSystem) : platformSystem).platform.showRewardVideo(b => {
                if (b == 0) {
                  this.dispatch((_crd && GameConst === void 0 ? (_reportPossibleCrUseOfGameConst({
                    error: Error()
                  }), GameConst) : GameConst).CLEAR_ALL_BOX);
                  this.close();
                } else if (b == -2) {
                  (_crd && platformSystem === void 0 ? (_reportPossibleCrUseOfplatformSystem({
                    error: Error()
                  }), platformSystem) : platformSystem).platform.shareAppMessage(bol => {
                    if (bol) {
                      this.dispatch((_crd && GameConst === void 0 ? (_reportPossibleCrUseOfGameConst({
                        error: Error()
                      }), GameConst) : GameConst).CLEAR_ALL_BOX);
                      this.close();
                    }
                  });
                }
              });
              break;
          }
        }

      }) || _class));

      _cclegacy._RF.pop();

      _crd = false;
    }
  };
});
//# sourceMappingURL=4d98189ca27e7f79f74d33d36bcf147746e91186.js.map