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

  var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, BasePanel, Data, Utils, audioMgr, platformSystem, GameConst, ITEM_TYPE, _dec, _class, _crd, ccclass, property, BuyCoinLayer;

  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 _reportPossibleCrUseOfUtils(extras) {
    _reporterNs.report("Utils", "../core/utils/Utils", _context.meta, extras);
  }

  function _reportPossibleCrUseOfaudioMgr(extras) {
    _reporterNs.report("audioMgr", "../core/manager/AudioManager", _context.meta, extras);
  }

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

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

  function _reportPossibleCrUseOfITEM_TYPE(extras) {
    _reporterNs.report("ITEM_TYPE", "../core/common/GameConst", _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) {
      BasePanel = _unresolved_2.default;
    }, function (_unresolved_3) {
      Data = _unresolved_3.default;
    }, function (_unresolved_4) {
      Utils = _unresolved_4.default;
    }, function (_unresolved_5) {
      audioMgr = _unresolved_5.audioMgr;
    }, function (_unresolved_6) {
      platformSystem = _unresolved_6.default;
    }, function (_unresolved_7) {
      GameConst = _unresolved_7.GameConst;
      ITEM_TYPE = _unresolved_7.ITEM_TYPE;
    }],
    execute: function () {
      _crd = true;

      _cclegacy._RF.push({}, "ed0c2pOm6tKoKudRX+iKoEf", "BuyCoinLayer", undefined);

      __checkObsolete__(['_decorator']);

      ({
        ccclass,
        property
      } = _decorator);

      _export("BuyCoinLayer", BuyCoinLayer = (_dec = ccclass('BuyCoinLayer'), _dec(_class = class BuyCoinLayer extends (_crd && BasePanel === void 0 ? (_reportPossibleCrUseOfBasePanel({
        error: Error()
      }), BasePanel) : BasePanel) {
        start() {
          this.SetText("lbl_coin", (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.coin + "");
        }

        onBtnClicked(event, customEventData) {
          (_crd && audioMgr === void 0 ? (_reportPossibleCrUseOfaudioMgr({
            error: Error()
          }), audioMgr) : audioMgr).playOneShot((_crd && GameConst === void 0 ? (_reportPossibleCrUseOfGameConst({
            error: Error()
          }), GameConst) : GameConst).audios.btnclick);
          var btnName = event.target.name;

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

            case "btn_ad":
              this.GetGameObject("btn_close").active = false;
              (_crd && platformSystem === void 0 ? (_reportPossibleCrUseOfplatformSystem({
                error: Error()
              }), platformSystem) : platformSystem).platform.showRewardVideo(b => {
                if (b) {
                  (_crd && Utils === void 0 ? (_reportPossibleCrUseOfUtils({
                    error: Error()
                  }), Utils) : Utils).flyAnim((_crd && ITEM_TYPE === void 0 ? (_reportPossibleCrUseOfITEM_TYPE({
                    error: Error()
                  }), ITEM_TYPE) : ITEM_TYPE).Coin, this.GetNode("btn_ad"), this.GetNodeFromCanvas("coin-icon"), 5, 50, b => {
                    if (b) {
                      (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
                        error: Error()
                      }), Data) : Data).user.coin += 100;
                      (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
                        error: Error()
                      }), Data) : Data).save();
                      this.close();
                    }
                  });
                } else {
                  this.GetGameObject("btn_close").active = true;
                }
              });
              break;
          }
        }

      }) || _class));

      _cclegacy._RF.pop();

      _crd = false;
    }
  };
});
//# sourceMappingURL=65fa03f5010b1ad451bd33d3558cf5cc6b62c617.js.map