var t = require; var e = module; var i = exports; e = (this && this.__decorate) || function(t, e, i, s) { var o, a = arguments.length, n = a < 3 ? e : null === s ? (s = Object.getOwnPropertyDescriptor(e, i)) : s; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, s); else for (var r = t.length - 1; 0 <= r; r--) (o = t[r]) && (n = (a < 3 ? o(n) : 3 < a ? o(e, i, n) : o(e, i)) || n); return 3 < a && n && Object.defineProperty(e, i, n), n; }; Object.defineProperty(i, "__esModule", { value: !0 }); const o = t("App"), s = t("BaseView"), a = t("NotificationConst"), n = t("StageUpgradeService"), r = t("StageUpgradeViewItem"), { ccclass: l, property: h, menu: c } = cc._decorator; t = class extends s.default { constructor() { super(...arguments), (this.content = null), (this.scrollView = null), (this.itemPre = null), (this.empty = null), (this.items = null), (this.bgType = 1); } open() { super.open(); } initUI() { super.initUI(), this.initItem(); } onDisable() { o.default.NotificationCenter.removeListener(a.NotificationConst.STAGE_UPGRADE_UPDATE, this.updateUI, this); } updateUI(t) { this.empty.active = !t; } initItem() { var s = n.default.ins.datas; for (let i = 0; i < s.length; i++) { let t = cc.instantiate(this.itemPre); this.content.addChild(t); let e = t.getComponent(r.default); if ((e.setData(s[i]), i < 6 && e.show(), 50 <= i)) break; } s.length ? o.default.NotificationCenter.addListener(a.NotificationConst.STAGE_UPGRADE_UPDATE, this.updateUI, this) : (this.empty.active = !0); } updateItem() { for (const t of this.content.getComponentsInChildren(r.default)) t.updtaeBtnState(); } onTouchScrollView() { var t = this.content.getComponentsInChildren(r.default), e = this.scrollView.getContentPosition().y; for (const o of t) { var i = o.node.y + e, s = o.node.y - o.node.height + e; i < -525 || -47 < s ? o.hide() : o.show(); } } }; e([h(cc.Node)], t.prototype, "content", void 0), e([h(cc.ScrollView)], t.prototype, "scrollView", void 0), e([h(cc.Prefab)], t.prototype, "itemPre", void 0), e([h(cc.Node)], t.prototype, "empty", void 0), (t = e([l], t)), (i.default = t);