System.register(["cc", "cc/env"], function (_export, _context) {
  "use strict";

  var _cclegacy, _decorator, Component, Color, director, log, Director, EDITOR, _dec, _dec2, _dec3, _class, _class2, _descriptor, _temp, _crd, ccclass, property, Test;

  function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }

  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }

  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }

  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

  function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }

  function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }

  function EVENT_AFTER_SCENE_LAUNCH() {
    if (EDITOR) console.log("EDITOR::EVENT_AFTER_SCENE_LAUNCH " + new Date().getTime());else console.log("RT::EVENT_AFTER_SCENE_LAUNCH " + new Date().getTime());
  }

  return {
    setters: [function (_cc) {
      _cclegacy = _cc.cclegacy;
      _decorator = _cc._decorator;
      Component = _cc.Component;
      Color = _cc.Color;
      director = _cc.director;
      log = _cc.log;
      Director = _cc.Director;
    }, function (_ccEnv) {
      EDITOR = _ccEnv.EDITOR;
    }],
    execute: function () {
      _crd = true;

      _cclegacy._RF.push({}, "4c8c0X7y+dEfaSCwWqQpvzv", "test", undefined);

      ccclass = _decorator.ccclass;
      property = _decorator.property;

      if (director.hasEventListener(Director.EVENT_AFTER_SCENE_LAUNCH, EVENT_AFTER_SCENE_LAUNCH)) {
        director.off(Director.EVENT_AFTER_SCENE_LAUNCH, EVENT_AFTER_SCENE_LAUNCH);
      }

      director.on(Director.EVENT_AFTER_SCENE_LAUNCH, EVENT_AFTER_SCENE_LAUNCH);
      /**
       * Predefined variables
       * Name = Test
       * DateTime = Thu Dec 16 2021 17:50:51 GMT+0800 (中国标准时间)
       * Author = linruimin
       * FileBasename = test.ts
       * FileBasenameNoExtension = test
       * URL = db://assets/test.ts
       * ManualUrl = https://docs.cocos.com/creator/3.3/manual/zh/
       *
       */

      _export("Test", Test = (_dec = ccclass('Test'), _dec2 = property(Color), _dec3 = property(Color), _dec(_class = (_class2 = (_temp = /*#__PURE__*/function (_Component) {
        _inheritsLoose(Test, _Component);

        function Test() {
          var _this;

          for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }

          _this = _Component.call.apply(_Component, [this].concat(args)) || this;

          _initializerDefineProperty(_assertThisInitialized(_this), "_color", _descriptor, _assertThisInitialized(_this));

          _defineProperty(_assertThisInitialized(_this), "count", 0);

          return _this;
        }

        var _proto = Test.prototype;

        _proto.delayInit = function delayInit() {
          if (this.count == 5) {
            director.emit('fire');
          }

          this.count++;
          console.log('aa');
          var that = this;
          director.off('fire');
          director.on('fire', function () {
            log("fire in the hole" + that.count);
          }, this.node);
        };

        _proto.onDirect = function onDirect() {} // update (deltaTime: number) {
        //     // [4]
        // }
        ;

        _createClass(Test, [{
          key: "color",
          get: function get() {
            return this._color;
          },
          set: function set(value) {
            this._color = value;
            this.delayInit();
          }
        }]);

        return Test;
      }(Component), _temp), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "_color", [_dec2], {
        configurable: true,
        enumerable: true,
        writable: true,
        initializer: function initializer() {
          return new Color().fromHEX('0xffffff');
        }
      }), _applyDecoratedDescriptor(_class2.prototype, "color", [_dec3], Object.getOwnPropertyDescriptor(_class2.prototype, "color"), _class2.prototype)), _class2)) || _class));
      /**
       * [1] Class member could be defined like this.
       * [2] Use `property` decorator if your want the member to be serializable.
       * [3] Your initialization goes here.
       * [4] Your update function goes here.
       *
       * Learn more about scripting: https://docs.cocos.com/creator/3.3/manual/zh/scripting/
       * Learn more about CCClass: https://docs.cocos.com/creator/3.3/manual/zh/scripting/ccclass.html
       * Learn more about life-cycle callbacks: https://docs.cocos.com/creator/3.3/manual/zh/scripting/life-cycle-callbacks.html
       */


      _cclegacy._RF.pop();

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