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, MeshRenderer, instantiate, BasePanel, Data, levelsData, platformSystem, audioManager, constants, _dec, _class, _crd, ccclass, property, NewPackOpenedLayer;

  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 _reportPossibleCrUseOflevelsData(extras) {
    _reporterNs.report("levelsData", "db://assets/data/levelsData", _context.meta, extras);
  }

  function _reportPossibleCrUseOfplatformSystem(extras) {
    _reporterNs.report("platformSystem", "db://assets/platform/platformSystem", _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;
      MeshRenderer = _cc.MeshRenderer;
      instantiate = _cc.instantiate;
    }, function (_unresolved_2) {
      BasePanel = _unresolved_2.default;
    }, function (_unresolved_3) {
      Data = _unresolved_3.default;
    }, function (_unresolved_4) {
      levelsData = _unresolved_4.default;
    }, function (_unresolved_5) {
      platformSystem = _unresolved_5.default;
    }, function (_unresolved_6) {
      audioManager = _unresolved_6.default;
    }, function (_unresolved_7) {
      constants = _unresolved_7.constants;
    }],
    execute: function () {
      _crd = true;

      _cclegacy._RF.push({}, "95f086kzGRB7ZwROVD6GqqD", "NewPackOpenedLayer", undefined);

      __checkObsolete__(['_decorator', 'Component', 'Node', 'MeshRenderer', 'instantiate']);

      ({
        ccclass,
        property
      } = _decorator);

      _export("NewPackOpenedLayer", NewPackOpenedLayer = (_dec = ccclass('NewPackOpenedLayer'), _dec(_class = class NewPackOpenedLayer extends (_crd && BasePanel === void 0 ? (_reportPossibleCrUseOfBasePanel({
        error: Error()
      }), BasePanel) : BasePanel) {
        onBtnClicked(event, customEventData) {
          (_crd && audioManager === void 0 ? (_reportPossibleCrUseOfaudioManager({
            error: Error()
          }), audioManager) : audioManager).playOneShot((_crd && constants === void 0 ? (_reportPossibleCrUseOfconstants({
            error: Error()
          }), constants) : constants).audios.btnclick);
          this.close();
        }

        show() {
          (_crd && platformSystem === void 0 ? (_reportPossibleCrUseOfplatformSystem({
            error: Error()
          }), platformSystem) : platformSystem).platform.showInterstitialAd();
          let node_items = this.GetGameObject("node_items");
          node_items.children.map(a => a.active = false);
          let ids = [];
          let OpenItems = (_crd && levelsData === void 0 ? (_reportPossibleCrUseOflevelsData({
            error: Error()
          }), levelsData) : levelsData).getNormModelDatas();

          for (var i = (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.openIndex; i < (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.openIndex + 8 && i < OpenItems.length; ++i) {
            ids.push(OpenItems[i]);
          }

          for (var i = 0; i < node_items.children.length; ++i) {
            let child = node_items.children[i];
            child.active = true;
            this.setMesh(child, ids[i]);
          }

          (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.openIndex += 8;
          (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.openIndex = Math.min((_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).user.openIndex, OpenItems.length - 1);
          (_crd && Data === void 0 ? (_reportPossibleCrUseOfData({
            error: Error()
          }), Data) : Data).save();
        }

        setMesh(node, name) {
          (_crd && levelsData === void 0 ? (_reportPossibleCrUseOflevelsData({
            error: Error()
          }), levelsData) : levelsData).LoadItemPrefabByName(name).then(res => {
            let tmp = instantiate(res);
            let render = tmp.getComponentInChildren(MeshRenderer);
            let mesh = render.mesh;
            node.scale = render.node.scale.multiplyScalar(100);
            node.getComponent(MeshRenderer).mesh = mesh;
            tmp.destroy();
          });
        }

      }) || _class));

      _cclegacy._RF.pop();

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