@civ-clone/base-unit-lifecycle 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/.gitattributes +4 -0
  2. package/.github/workflows/build-on-push.yml +39 -0
  3. package/.prettierrc +4 -0
  4. package/LICENSE +21 -0
  5. package/README.md +61 -2
  6. package/lib/activate.d.ts +15 -0
  7. package/lib/activate.js +27 -0
  8. package/lib/activate.js.map +1 -0
  9. package/lib/activate.ts +47 -0
  10. package/lib/canStow.d.ts +8 -0
  11. package/lib/canStow.js +17 -0
  12. package/lib/canStow.js.map +1 -0
  13. package/lib/canStow.ts +25 -0
  14. package/lib/created.d.ts +9 -0
  15. package/lib/created.js +19 -0
  16. package/lib/created.js.map +1 -0
  17. package/lib/created.ts +24 -0
  18. package/lib/defeated.d.ts +25 -0
  19. package/lib/defeated.js +33 -0
  20. package/lib/defeated.js.map +1 -0
  21. package/lib/defeated.ts +55 -0
  22. package/lib/destroyed.d.ts +37 -0
  23. package/lib/destroyed.js +74 -0
  24. package/lib/destroyed.js.map +1 -0
  25. package/lib/destroyed.ts +106 -0
  26. package/lib/detonatedRules.d.ts +56 -0
  27. package/lib/detonatedRules.js +95 -0
  28. package/lib/detonatedRules.js.map +1 -0
  29. package/lib/detonatedRules.ts +196 -0
  30. package/lib/diplomatRules.d.ts +27 -0
  31. package/lib/diplomatRules.js +41 -0
  32. package/lib/diplomatRules.js.map +1 -0
  33. package/lib/diplomatRules.ts +83 -0
  34. package/lib/halted.d.ts +6 -0
  35. package/lib/halted.js +10 -0
  36. package/lib/halted.js.map +1 -0
  37. package/lib/halted.ts +11 -0
  38. package/lib/impassable.d.ts +8 -0
  39. package/lib/impassable.js +15 -0
  40. package/lib/impassable.js.map +1 -0
  41. package/lib/impassable.ts +19 -0
  42. package/lib/lifecycleRules.d.ts +118 -0
  43. package/lib/lifecycleRules.js +126 -0
  44. package/lib/lifecycleRules.js.map +1 -0
  45. package/lib/lifecycleRules.ts +378 -0
  46. package/lib/lostAtSea.d.ts +12 -0
  47. package/lib/lostAtSea.js +26 -0
  48. package/lib/lostAtSea.js.map +1 -0
  49. package/lib/lostAtSea.ts +37 -0
  50. package/lib/movedRules.d.ts +44 -0
  51. package/lib/movedRules.js +126 -0
  52. package/lib/movedRules.js.map +1 -0
  53. package/lib/movedRules.ts +300 -0
  54. package/lib/playerAction.d.ts +22 -0
  55. package/lib/playerAction.js +28 -0
  56. package/lib/playerAction.js.map +1 -0
  57. package/lib/playerAction.ts +64 -0
  58. package/lib/stowed.d.ts +2 -0
  59. package/lib/stowed.js +8 -0
  60. package/lib/stowed.js.map +1 -0
  61. package/lib/stowed.ts +6 -0
  62. package/lib/treatyPartner.d.ts +26 -0
  63. package/lib/treatyPartner.js +38 -0
  64. package/lib/treatyPartner.js.map +1 -0
  65. package/lib/treatyPartner.ts +78 -0
  66. package/lib/unsupported.d.ts +6 -0
  67. package/lib/unsupported.js +9 -0
  68. package/lib/unsupported.js.map +1 -0
  69. package/lib/unsupported.ts +10 -0
  70. package/lib/validateMove.d.ts +11 -0
  71. package/lib/validateMove.js +26 -0
  72. package/lib/validateMove.js.map +1 -0
  73. package/lib/validateMove.ts +36 -0
  74. package/package.json +61 -4
  75. package/tests/fixtures/civ1-unit-rules.json +89 -0
  76. package/tests/lifecycle.test.ts +657 -0
  77. package/tests/movedRules.test.ts +256 -0
  78. package/tests/rules.test.ts +434 -0
  79. package/tsconfig.json +16 -0
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.impassable = exports.toPartnersLand = exports.fromLand = void 0;
4
+ // What a ruleset's `Impassable` rules ask, so that routes (a GoTo, a computer player's route) go round a treaty
5
+ // partner's land and following one never breaks a treaty by accident.
6
+ // The step starts on land.
7
+ const fromLand = (unit, to, from) => from.isLand();
8
+ exports.fromLand = fromLand;
9
+ // `to` is a treaty partner's land: `partnerOf` is the ruleset's territory model.
10
+ const toPartnersLand = (partnerOf) => (unit, to) => partnerOf(unit, to) !== null;
11
+ exports.toPartnersLand = toPartnersLand;
12
+ // The tile is impassable.
13
+ const impassable = () => true;
14
+ exports.impassable = impassable;
15
+ //# sourceMappingURL=impassable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"impassable.js","sourceRoot":"","sources":["impassable.ts"],"names":[],"mappings":";;;AAIA,gHAAgH;AAChH,uEAAuE;AAEvE,2BAA2B;AACpB,MAAM,QAAQ,GAAG,CAAC,IAAU,EAAE,EAAQ,EAAE,IAAU,EAAW,EAAE,CACpE,IAAI,CAAC,MAAM,EAAE,CAAC;AADH,QAAA,QAAQ,YACL;AAEhB,iFAAiF;AAC1E,MAAM,cAAc,GACzB,CAAC,SAAoB,EAAE,EAAE,CACzB,CAAC,IAAU,EAAE,EAAQ,EAAW,EAAE,CAChC,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC;AAHpB,QAAA,cAAc,kBAGM;AAEjC,0BAA0B;AACnB,MAAM,UAAU,GAAG,GAAY,EAAE,CAAC,IAAI,CAAC;AAAjC,QAAA,UAAU,cAAuB"}
@@ -0,0 +1,19 @@
1
+ import { PartnerOf } from '@civ-clone/base-unit-action-rules/lib/criteria/partners';
2
+ import Tile from '@civ-clone/core-world/Tile';
3
+ import Unit from '@civ-clone/core-unit/Unit';
4
+
5
+ // What a ruleset's `Impassable` rules ask, so that routes (a GoTo, a computer player's route) go round a treaty
6
+ // partner's land and following one never breaks a treaty by accident.
7
+
8
+ // The step starts on land.
9
+ export const fromLand = (unit: Unit, to: Tile, from: Tile): boolean =>
10
+ from.isLand();
11
+
12
+ // `to` is a treaty partner's land: `partnerOf` is the ruleset's territory model.
13
+ export const toPartnersLand =
14
+ (partnerOf: PartnerOf) =>
15
+ (unit: Unit, to: Tile): boolean =>
16
+ partnerOf(unit, to) !== null;
17
+
18
+ // The tile is impassable.
19
+ export const impassable = (): boolean => true;
@@ -0,0 +1,118 @@
1
+ import { CityRegistry } from '@civ-clone/core-city/CityRegistry';
2
+ import { Engine } from '@civ-clone/core-engine/Engine';
3
+ import { RuleRegistry } from '@civ-clone/core-rule/RuleRegistry';
4
+ import { TransportRegistry } from '@civ-clone/core-unit-transport/TransportRegistry';
5
+ import { UnitImprovementRegistry } from '@civ-clone/core-unit-improvement/UnitImprovementRegistry';
6
+ import { UnitLossRegistry } from '@civ-clone/core-unit/UnitLossRegistry';
7
+ import { UnitPlayerActionType } from './playerAction';
8
+ import { UnitRegistry } from '@civ-clone/core-unit/UnitRegistry';
9
+ import Action from '@civ-clone/core-player/Rules/Action';
10
+ import Activate from '@civ-clone/core-unit/Rules/Activate';
11
+ import CanStow from '@civ-clone/core-unit-transport/Rules/CanStow';
12
+ import Created from '@civ-clone/core-unit/Rules/Created';
13
+ import Defeated from '@civ-clone/core-unit/Rules/Defeated';
14
+ import Destroyed from '@civ-clone/core-unit/Rules/Destroyed';
15
+ import ExpectedMovementCost from '@civ-clone/core-world-path/Rules/ExpectedMovementCost';
16
+ import Halted from '@civ-clone/base-unit-action-goto/Rules/Halted';
17
+ import Impassable from '@civ-clone/core-world-path/Rules/Impassable';
18
+ import LostAtSea from '@civ-clone/core-unit-transport/Rules/LostAtSea';
19
+ import Player from '@civ-clone/core-player/Player';
20
+ import PlayerAction from '@civ-clone/core-player/PlayerAction';
21
+ import Stowed from '@civ-clone/core-unit-transport/Rules/Stowed';
22
+ import Tile from '@civ-clone/core-world/Tile';
23
+ import Transferred from '@civ-clone/core-unit/Rules/Transferred';
24
+ import Unit from '@civ-clone/core-unit/Unit';
25
+ import UnitImprovement from '@civ-clone/core-unit-improvement/UnitImprovement';
26
+ import Unsupported from '@civ-clone/core-unit/Rules/Unsupported';
27
+ import ValidateMove from '@civ-clone/core-unit/Rules/ValidateMove';
28
+ export interface LifecycleDependencies {
29
+ cityRegistry?: CityRegistry;
30
+ engine?: Engine;
31
+ randomNumberGenerator?: () => number;
32
+ ruleRegistry?: RuleRegistry;
33
+ transportRegistry?: TransportRegistry;
34
+ unitImprovementRegistry?: UnitImprovementRegistry;
35
+ unitLossRegistry?: UnitLossRegistry;
36
+ unitRegistry?: UnitRegistry;
37
+ }
38
+ export interface LifecycleBaseOptions {
39
+ ActiveUnit: UnitPlayerActionType<PlayerAction>;
40
+ InactiveUnit: UnitPlayerActionType<PlayerAction>;
41
+ removedOnActivate: (typeof UnitImprovement)[];
42
+ stowable: (typeof Unit)[];
43
+ partnerOf?: (unit: Unit, tile: Tile) => Player | null;
44
+ }
45
+ /**
46
+ * How a unit short of a step's moves fares: Civ1's `shortfallFactor` (`spendShort`), or a ruleset's own `shortStep`,
47
+ * which then needs no factor.
48
+ */
49
+ export type LifecycleOptions = LifecycleBaseOptions &
50
+ (
51
+ | {
52
+ shortfallFactor: number;
53
+ shortStep?: undefined;
54
+ }
55
+ | {
56
+ shortfallFactor?: number;
57
+ shortStep: ShortStep;
58
+ }
59
+ );
60
+ /**
61
+ * A ruleset's own short step: whether `unit`, with `remaining` of its `movement` moves, gets onto a square costing
62
+ * `cost` (one draw of `randomNumberGenerator` at most), and what such a step is worth on average to route planning.
63
+ * The unit's moves are spent either way.
64
+ */
65
+ export interface ShortStep {
66
+ succeeds: (
67
+ unit: Unit,
68
+ remaining: number,
69
+ movement: number,
70
+ cost: number,
71
+ randomNumberGenerator: () => number
72
+ ) => boolean;
73
+ expectedCost: (movement: number, cost: number) => number;
74
+ }
75
+ /**
76
+ * A ruleset's unit lifecycle rules, by the rule type they are, in the order each type's rules run. Their ids are
77
+ * `<prefix>:unit/<type>/<name>` (`<prefix>:player/action/<name>` for the player actions), as civ1-unit's are, so a
78
+ * ruleset registers each list where it wants it and keeps the ids another package may name.
79
+ */
80
+ export declare const lifecycleRules: (
81
+ prefix: string,
82
+ {
83
+ cityRegistry,
84
+ engine,
85
+ randomNumberGenerator,
86
+ ruleRegistry,
87
+ transportRegistry,
88
+ unitImprovementRegistry,
89
+ unitLossRegistry,
90
+ unitRegistry,
91
+ }: LifecycleDependencies,
92
+ {
93
+ ActiveUnit,
94
+ InactiveUnit,
95
+ removedOnActivate,
96
+ stowable,
97
+ partnerOf,
98
+ shortfallFactor,
99
+ shortStep,
100
+ }: LifecycleOptions
101
+ ) => {
102
+ activate: Activate[];
103
+ canStow: CanStow[];
104
+ created: Created[];
105
+ defeated: Defeated[];
106
+ destroyed: Destroyed[];
107
+ expectedMovementCost: ExpectedMovementCost[];
108
+ halted: Halted[];
109
+ impassable: Impassable[];
110
+ lostAtSea: LostAtSea[];
111
+ playerAction: Action[];
112
+ stowed: Stowed[];
113
+ transferred: Transferred[];
114
+ unsupported: Unsupported[];
115
+ validateMove: ValidateMove[];
116
+ };
117
+ export type LifecycleRules = ReturnType<typeof lifecycleRules>;
118
+ export default lifecycleRules;
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.lifecycleRules = void 0;
4
+ const CityRegistry_1 = require("@civ-clone/core-city/CityRegistry");
5
+ const Engine_1 = require("@civ-clone/core-engine/Engine");
6
+ const RuleRegistry_1 = require("@civ-clone/core-rule/RuleRegistry");
7
+ const TransportRegistry_1 = require("@civ-clone/core-unit-transport/TransportRegistry");
8
+ const UnitImprovementRegistry_1 = require("@civ-clone/core-unit-improvement/UnitImprovementRegistry");
9
+ const UnitLossRegistry_1 = require("@civ-clone/core-unit/UnitLossRegistry");
10
+ const playerAction_1 = require("./playerAction");
11
+ const UnitRegistry_1 = require("@civ-clone/core-unit/UnitRegistry");
12
+ const created_1 = require("./created");
13
+ const destroyed_1 = require("./destroyed");
14
+ const canStow_1 = require("./canStow");
15
+ const activate_1 = require("./activate");
16
+ const lostAtSea_1 = require("./lostAtSea");
17
+ const defeated_1 = require("./defeated");
18
+ const impassable_1 = require("./impassable");
19
+ const validateMove_1 = require("./validateMove");
20
+ const Action_1 = require("@civ-clone/core-player/Rules/Action");
21
+ const Activate_1 = require("@civ-clone/core-unit/Rules/Activate");
22
+ const CanStow_1 = require("@civ-clone/core-unit-transport/Rules/CanStow");
23
+ const Created_1 = require("@civ-clone/core-unit/Rules/Created");
24
+ const Criterion_1 = require("@civ-clone/core-rule/Criterion");
25
+ const Defeated_1 = require("@civ-clone/core-unit/Rules/Defeated");
26
+ const Destroyed_1 = require("@civ-clone/core-unit/Rules/Destroyed");
27
+ const Effect_1 = require("@civ-clone/core-rule/Effect");
28
+ const ExpectedMovementCost_1 = require("@civ-clone/core-world-path/Rules/ExpectedMovementCost");
29
+ const Halted_1 = require("@civ-clone/base-unit-action-goto/Rules/Halted");
30
+ const Impassable_1 = require("@civ-clone/core-world-path/Rules/Impassable");
31
+ const LostAtSea_1 = require("@civ-clone/core-unit-transport/Rules/LostAtSea");
32
+ const Stowed_1 = require("@civ-clone/core-unit-transport/Rules/Stowed");
33
+ const Transferred_1 = require("@civ-clone/core-unit/Rules/Transferred");
34
+ const Unsupported_1 = require("@civ-clone/core-unit/Rules/Unsupported");
35
+ const ValidateMove_1 = require("@civ-clone/core-unit/Rules/ValidateMove");
36
+ const halted_1 = require("./halted");
37
+ const unsupported_1 = require("./unsupported");
38
+ const moveShortfall_1 = require("@civ-clone/base-unit-action-rules/lib/moveShortfall");
39
+ const core_random_1 = require("@civ-clone/core-random");
40
+ const stowed_1 = require("./stowed");
41
+ /**
42
+ * A ruleset's unit lifecycle rules, by the rule type they are, in the order each type's rules run. Their ids are
43
+ * `<prefix>:unit/<type>/<name>` (`<prefix>:player/action/<name>` for the player actions), as civ1-unit's are, so a
44
+ * ruleset registers each list where it wants it and keeps the ids another package may name.
45
+ */
46
+ const lifecycleRules = (prefix, { cityRegistry = CityRegistry_1.instance, engine = Engine_1.instance, randomNumberGenerator = core_random_1.instance, ruleRegistry = RuleRegistry_1.instance, transportRegistry = TransportRegistry_1.instance, unitImprovementRegistry = UnitImprovementRegistry_1.instance, unitLossRegistry = UnitLossRegistry_1.instance, unitRegistry = UnitRegistry_1.instance, }, { ActiveUnit, InactiveUnit, removedOnActivate, stowable, partnerOf, shortfallFactor, shortStep, }) => {
47
+ const id = (name) => `${prefix}:unit/${name}`;
48
+ return {
49
+ activate: [
50
+ new Activate_1.default(id('activate/has-moves'), new Criterion_1.default(activate_1.hasMoves), new Effect_1.default(activate_1.setActive)),
51
+ new Activate_1.default(id('activate/clear-busy'), new Criterion_1.default(activate_1.isBusy), new Effect_1.default(activate_1.clearBusy)),
52
+ ...removedOnActivate.map((UnitImprovementType) => new Activate_1.default(id(`activate/remove-improvement/${UnitImprovementType.name}`), new Criterion_1.default((0, activate_1.hasImprovement)(unitImprovementRegistry, UnitImprovementType)), new Effect_1.default((0, activate_1.removeImprovement)(unitImprovementRegistry, UnitImprovementType)))),
53
+ ],
54
+ canStow: stowable.map((StowableUnitType) => new CanStow_1.default(id(`can-stow/${StowableUnitType.name}`), new Criterion_1.default((0, canStow_1.carriesDomain)(StowableUnitType)), new Effect_1.default((0, canStow_1.carriesUnit)(StowableUnitType)))),
55
+ created: [
56
+ new Created_1.default(id('created/register'), new Effect_1.default((0, created_1.registerUnit)(unitRegistry))),
57
+ new Created_1.default(id('created/apply-visibility'), new Effect_1.default(created_1.applyVisibility)),
58
+ new Created_1.default(id('created/set-moves'), new Effect_1.default(created_1.setMoves)),
59
+ new Created_1.default(id('created/emit'), new Effect_1.default((0, created_1.emitCreated)(engine))),
60
+ ],
61
+ defeated: [
62
+ new Defeated_1.default(id('defeated/emit-and-destroy'), new Effect_1.default((0, defeated_1.emitAndDestroy)(engine, ruleRegistry))),
63
+ new Defeated_1.default(
64
+ // `Attack` processes `Defeated` for a losing attacker too; only a defeated defender takes its stack with it.
65
+ id('defeated/destroy-stack'), new Criterion_1.default(defeated_1.defended), new Criterion_1.default((0, defeated_1.notInCity)(cityRegistry)), new Criterion_1.default((0, defeated_1.hasStack)(unitRegistry)), new Effect_1.default((0, defeated_1.destroyStack)(unitRegistry, ruleRegistry))),
66
+ ],
67
+ destroyed: [
68
+ new Destroyed_1.default(id('destroyed/emit'), new Effect_1.default((0, destroyed_1.emitDestroyed)(engine))),
69
+ new Destroyed_1.default(
70
+ // A loss, once, for a unit another player destroyed.
71
+ id('destroyed/count-loss'), new Criterion_1.default(destroyed_1.destroyedByAnother), new Criterion_1.default(destroyed_1.notYetDestroyed), new Effect_1.default((0, destroyed_1.countLoss)(unitLossRegistry))),
72
+ new Destroyed_1.default(id('destroyed/deactivate'), new Effect_1.default(destroyed_1.deactivate)),
73
+ new Destroyed_1.default(id('destroyed/remove-improvements'), new Effect_1.default((0, destroyed_1.removeImprovements)(unitImprovementRegistry))),
74
+ new Destroyed_1.default(id('destroyed/lose-cargo'), new Criterion_1.default((0, destroyed_1.carriesCargo)(transportRegistry)), new Effect_1.default((0, destroyed_1.loseCargo)(transportRegistry))),
75
+ new Destroyed_1.default(id('destroyed/leave-transport'), new Criterion_1.default((0, destroyed_1.isAboard)(transportRegistry)), new Effect_1.default((0, destroyed_1.leaveOwnTransport)(transportRegistry))),
76
+ ],
77
+ expectedMovementCost: [
78
+ new ExpectedMovementCost_1.default(
79
+ // A step costing more than the unit's full moves is worth `max(m, c × shortfallFactor)` on average.
80
+ id('expected-movement-cost/shortfall'), new Criterion_1.default((unit, movementCost, movement) => movement > 0), new Effect_1.default((unit, movementCost, movement) => shortStep === undefined
81
+ ? (0, moveShortfall_1.expectedCost)(movement, movementCost, shortfallFactor)
82
+ : shortStep.expectedCost(movement, movementCost))),
83
+ ],
84
+ halted: [new Halted_1.default(id('halted/emit'), new Effect_1.default((0, halted_1.emitHalted)(engine)))],
85
+ impassable: partnerOf === undefined
86
+ ? []
87
+ : [
88
+ new Impassable_1.default(
89
+ // Routes go round a treaty partner's land, so following one never breaks a treaty by accident.
90
+ id('impassable/treaty-partners-land'), new Criterion_1.default(impassable_1.fromLand), new Criterion_1.default((0, impassable_1.toPartnersLand)(partnerOf)), new Effect_1.default(impassable_1.impassable)),
91
+ ],
92
+ lostAtSea: [
93
+ new LostAtSea_1.default(id('lost-at-sea/emit'), new Effect_1.default((0, lostAtSea_1.emitLostAtSea)(engine))),
94
+ new LostAtSea_1.default(
95
+ // Before `destroy`, while the manifests still say what's aboard.
96
+ id('lost-at-sea/count-loss'), new Effect_1.default((0, lostAtSea_1.countLosses)(unitLossRegistry, transportRegistry))),
97
+ new LostAtSea_1.default(id('lost-at-sea/destroy'), new Effect_1.default(lostAtSea_1.sink)),
98
+ ],
99
+ playerAction: [
100
+ new Action_1.default(`${prefix}:player/action/active-units`, new Criterion_1.default((0, playerAction_1.hasActiveUnits)(unitRegistry)), new Effect_1.default((0, playerAction_1.activeUnits)(unitRegistry, ActiveUnit))),
101
+ new Action_1.default(`${prefix}:player/action/inactive-units`, new Criterion_1.default((0, playerAction_1.hasInactiveUnits)(unitRegistry)), new Effect_1.default((0, playerAction_1.inactiveUnits)(unitRegistry, InactiveUnit))),
102
+ ],
103
+ stowed: [new Stowed_1.default(id('stowed/sleep'), new Effect_1.default(stowed_1.sleepAboard))],
104
+ transferred: [
105
+ new Transferred_1.default(id('transferred/emit'), new Effect_1.default((unit, player, previousPlayer) => {
106
+ engine.emit('unit:transferred', unit, player, previousPlayer);
107
+ })),
108
+ ],
109
+ unsupported: [
110
+ new Unsupported_1.default(id('unsupported/emit'), new Effect_1.default((0, unsupported_1.emitUnsupported)(engine))),
111
+ ],
112
+ validateMove: [
113
+ new ValidateMove_1.default(id('validate-move/enough-moves'), new Criterion_1.default(validateMove_1.hasMovesFor), new Effect_1.default(validateMove_1.spendMoves)),
114
+ new ValidateMove_1.default(id('validate-move/not-enough-moves'), new Criterion_1.default(validateMove_1.shortOfMovesFor), new Effect_1.default(shortStep === undefined
115
+ ? (0, validateMove_1.spendShort)(shortfallFactor, randomNumberGenerator)
116
+ : (unit, movementCost) => {
117
+ const remaining = unit.moves().value(), movement = unit.movement().value();
118
+ unit.moves().set(0);
119
+ return shortStep.succeeds(unit, remaining, movement, movementCost, randomNumberGenerator);
120
+ })),
121
+ ],
122
+ };
123
+ };
124
+ exports.lifecycleRules = lifecycleRules;
125
+ exports.default = exports.lifecycleRules;
126
+ //# sourceMappingURL=lifecycleRules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycleRules.js","sourceRoot":"","sources":["lifecycleRules.ts"],"names":[],"mappings":";;;AAAA,oEAG2C;AAC3C,0DAGuC;AACvC,oEAG2C;AAC3C,wFAG0D;AAC1D,sGAGkE;AAClE,4EAG+C;AAC/C,iDAMwB;AACxB,oEAG2C;AAC3C,uCAKmB;AACnB,2CAWqB;AACrB,uCAAuD;AACvD,yCAOoB;AACpB,2CAA+D;AAC/D,yCAMoB;AACpB,6CAAoE;AACpE,iDAKwB;AACxB,gEAAyD;AACzD,kEAA2D;AAC3D,0EAAmE;AACnE,gEAAyD;AACzD,8DAAuD;AACvD,kEAA2D;AAC3D,oEAA6D;AAC7D,wDAAiD;AACjD,gGAAyF;AACzF,0EAAmE;AACnE,4EAAqE;AACrE,8EAAuE;AAGvE,wEAAiE;AAEjE,wEAAiE;AAGjE,wEAAiE;AACjE,0EAAmE;AACnE,qCAAsC;AACtC,+CAAgD;AAChD,uFAAmF;AACnF,wDAAiE;AACjE,qCAAuC;AAmDvC;;;;GAIG;AACI,MAAM,cAAc,GAAG,CAC5B,MAAc,EACd,EACE,YAAY,GAAG,uBAAoB,EACnC,MAAM,GAAG,iBAAc,EACvB,qBAAqB,GAAG,sBAAW,EACnC,YAAY,GAAG,uBAAoB,EACnC,iBAAiB,GAAG,4BAAyB,EAC7C,uBAAuB,GAAG,kCAA+B,EACzD,gBAAgB,GAAG,2BAAwB,EAC3C,YAAY,GAAG,uBAAoB,GACb,EACxB,EACE,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,QAAQ,EACR,SAAS,EACT,eAAe,EACf,SAAS,GACQ,EACnB,EAAE;IACF,MAAM,EAAE,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,GAAG,MAAM,SAAS,IAAI,EAAE,CAAC;IAE9D,OAAO;QACL,QAAQ,EAAE;YACR,IAAI,kBAAQ,CACV,EAAE,CAAC,oBAAoB,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