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

  var _reporterNs, _cclegacy, _decorator, instantiate, UICoordinateTrackerComponent, EventHandler, OTWFlagComponent, _dec, _class, _crd, ccclass, property, OTWTroopFlagComponent;

  function _reportPossibleCrUseOfIMap(extras) {
    _reporterNs.report("IMap", "../../shared/gameClient/games/OccupationTheWarModels", _context.meta, extras);
  }

  function _reportPossibleCrUseOfITroop(extras) {
    _reporterNs.report("ITroop", "../../shared/gameClient/games/OccupationTheWarModels", _context.meta, extras);
  }

  function _reportPossibleCrUseOfOTWFlagComponent(extras) {
    _reporterNs.report("OTWFlagComponent", "./OTWFlagComponent", _context.meta, extras);
  }

  return {
    setters: [function (_unresolved_) {
      _reporterNs = _unresolved_;
    }, function (_cc) {
      _cclegacy = _cc.cclegacy;
      _decorator = _cc._decorator;
      instantiate = _cc.instantiate;
      UICoordinateTrackerComponent = _cc.UICoordinateTrackerComponent;
      EventHandler = _cc.EventHandler;
    }, function (_unresolved_2) {
      OTWFlagComponent = _unresolved_2.OTWFlagComponent;
    }],
    execute: function () {
      _crd = true;

      _cclegacy._RF.push({}, "7f3b589R5NBYqBUG9E2NveA", "OTWTroopFlagComponent", undefined);

      ({
        ccclass,
        property
      } = _decorator);

      _export("OTWTroopFlagComponent", OTWTroopFlagComponent = (_dec = ccclass('OTWTroopFlagComponent'), _dec(_class = class OTWTroopFlagComponent extends (_crd && OTWFlagComponent === void 0 ? (_reportPossibleCrUseOfOTWFlagComponent({
        error: Error()
      }), OTWFlagComponent) : OTWFlagComponent) {
        static createFlagNode(getMap, troop, areaFlagPrefab, objNode, mainCamera, gameMgrNode, handlerFnName) {
          var flag = instantiate(areaFlagPrefab);
          flag.name = objNode.name;
          var flagComp = flag.getComponent(OTWTroopFlagComponent);
          flagComp.getMap = getMap;
          flagComp.countryId = troop.countryId;
          flagComp.troopIndex = troop.troopIndex;
          flagComp.updateShow();
          var c = objNode.addComponent(UICoordinateTrackerComponent);
          c.target = flag;
          c.camera = mainCamera;
          var ev = new EventHandler();
          ev.target = gameMgrNode;
          ev.component = "OTWGameManager";
          ev.handler = handlerFnName;
          ev.customEventData = troop.troopIndex.toString();
          c.syncEvents.push(ev);
          return flag;
        }

        updateShow() {
          var troop = this.getMap().allAttackingTroop[this.troopIndex];
          this.Text.string = ` ${troop.troopsCount}`;
        }

      }) || _class));

      _cclegacy._RF.pop();

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