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 s = t("App"), o = t("GameText"), a = t("EffectUtils"), n = t("UIImage"), r = t("NotificationConst"), l = t("SystemOpenConst"), {ccclass: h, property: c} = cc._decorator; t = class extends cc.Component { constructor() { super(...arguments), (this.ani = null), (this.icon = null), (this.desc = null), (this.boxAni = null), (this.isPlaying = !1), (this.isMove = !1), (this.isMoveFinish = !1), (this.tw = null), (this.endPosList = []), (this.NowItemType = null); } onLoad() { (this.icon.node.x = 0), (this.icon.node.y = 0), (this.icon.node.scaleX = this.icon.node.scaleY = 1), (this.boxAni = this.ani.getComponent(cc.Animation)), this.node.on(cc.Node.EventType.TOUCH_END, this.onTouchTap, this), this.boxAni.on(cc.Animation.EventType.FINISHED, this.onAnimCompleted, this); } onAnimCompleted() { this.isPlaying && ((this.isPlaying = !1), this.playMoveIcon()); } onTouchTap() { this.isPlaying || (this.isMove || this.isMoveFinish ? this.isMove && !this.isMoveFinish ? (this.tw && (this.tw.stop(), this.tw.removeSelf(), (this.tw = null)), (this.icon.node.x = this.data.pos.x), (this.icon.node.y = this.data.pos.y), this.moveCb()) : this.close() : (s.default.TimerManager.remove(this.playMoveIcon, this), this.playMoveIcon())); } close() { this.tw && (this.tw.stop(), this.tw.removeSelf(), (this.tw = null)), this.node.parent && this.node.removeFromParent(!1), (this.isMoveFinish = !1), (this.isMove = !1), (this.isPlaying = !1), (this.data = null), (this.desc.string = ""), (this.icon.node.x = 0), (this.icon.node.y = 0), (this.icon.node.scaleX = this.icon.node.scaleY = 1), a.default.instance.queueExecutor.finishFunc(); } playMoveIcon() { (this.isMove = !0), (this.tw = cc .tween(this.icon.node) .to(1, {x: this.data.pos.x, y: this.data.pos.y, scaleX: 0.2, scaleY: 0.2}, {easing: cc.easing.quadIn}) .call(() => { this.moveCb(); }) .start()); } moveCb() { (this.isMove = !1), (this.isMoveFinish = !0), this.data.func && this.data.func.apply(this.data.obj), this.data.event && s.default.NotificationCenter.dispatch(this.data.event, this.data.param), s.default.NotificationCenter.dispatch(r.NotificationConst.SYS_OPEN_END, l.OpenTypeConst[this.data.id]), this.close(); } play(t) { (this.data = t), (this.icon.source = t.icon), (this.desc.string = o.GameText.getTextByStr("system_title_" + t.id)), this.boxAni.play("work"), (this.isPlaying = !0); } }; e([c(cc.Node)], t.prototype, "ani", void 0), e([c(n.UIImage)], t.prototype, "icon", void 0), e([c(cc.Label)], t.prototype, "desc", void 0), (t = e([h], t)), (i.default = t);