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

  var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, Component, sys, _decorator, GameConst, Data, WindowManager, levelsData, _dec, _class, _crd, ccclass, property, DebugTools;

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

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

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

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

  return {
    setters: [function (_unresolved_) {
      _reporterNs = _unresolved_;
    }, function (_cc) {
      _cclegacy = _cc.cclegacy;
      __checkObsolete__ = _cc.__checkObsolete__;
      __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
      Component = _cc.Component;
      sys = _cc.sys;
      _decorator = _cc._decorator;
    }, function (_unresolved_2) {
      GameConst = _unresolved_2.default;
    }, function (_unresolved_3) {
      Data = _unresolved_3.default;
    }, function (_unresolved_4) {
      WindowManager = _unresolved_4.default;
    }, function (_unresolved_5) {
      levelsData = _unresolved_5.default;
    }],
    execute: function () {
      _crd = true;

      _cclegacy._RF.push({}, "12146UverlP74Y/Ujkyi5Ir", "DebugTools", undefined);

      __checkObsolete__(['Component', 'sys', '_decorator']);

      ({
        ccclass,
        property
      } = _decorator);

      _export("default", DebugTools = (_dec = ccclass('DebugTools'), _dec(_class = class DebugTools extends Component {
        start() {
          if (sys.platform === sys.Platform.DESKTOP_BROWSER) {
            return;
          }

          this.addBtn("清除数据", () => {
            localStorage.setItem((_crd && GameConst === void 0 ? (_reportPossibleCrUseOfGameConst({
              error: Error()
            }), GameConst) : GameConst).local_data_key, "");
          });
          this.addBtn("金币+100", () => {
            (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
              error: Error()
            }), Data) : Data).user.coin += 100;
          });
          this.addBtn("Star+100", () => {
            (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
              error: Error()
            }), Data) : Data).user.star += 100;
            var OpenItems = (_crd && levelsData === void 0 ? (_reportPossibleCrUseOflevelsData({
              error: Error()
            }), levelsData) : levelsData).getNormModelDatas();

            if ((_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
              error: Error()
            }), Data) : Data).user.openIndex < OpenItems.length - 1) {
              //解锁新物品
              (_crd && WindowManager === void 0 ? (_reportPossibleCrUseOfWindowManager({
                error: Error()
              }), WindowManager) : WindowManager).ins.open("NewPackOpenedLayer", (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
                error: Error()
              }), Data) : Data).user.openIndex);
            }
          });
          this.addBtn("LV++", () => {
            (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
              error: Error()
            }), Data) : Data).user.lv++;
          });
        }

        addBtn(name, callback) {
          var toolbar = document.getElementsByClassName("toolbar")[0];
          if (!toolbar) return;
          var div = document.createElement("div");
          div.className = "item";
          div.innerHTML = "<button id='" + name + "'>" + name + "</button>";
          toolbar.appendChild(div);

          document.getElementById(name).onclick = () => {
            callback();
          };
        }

      }) || _class));

      _cclegacy._RF.pop();

      _crd = false;
    }
  };
});
//# sourceMappingURL=148318a9f77c9c538200115a4d5266d412841ef1.js.map