@k8ts/instruments 0.2.1 → 0.4.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 (161) hide show
  1. package/dist/_embedder/base.js +3 -2
  2. package/dist/_embedder/index.js +0 -1
  3. package/dist/_string/index.js +0 -1
  4. package/dist/_string/markers.d.ts +2 -2
  5. package/dist/_string/markers.d.ts.map +1 -1
  6. package/dist/_string/markers.js +26 -11
  7. package/dist/_string/post-processor.js +1 -4
  8. package/dist/_string/pretty-objects.js +51 -50
  9. package/dist/_string/pretty-print.js +0 -1
  10. package/dist/_string/super-script.js +0 -1
  11. package/dist/api-kind/index.js +3 -1
  12. package/dist/cmd/cli-command.js +3 -1
  13. package/dist/cmd/cli-term.js +5 -1
  14. package/dist/cmd/index.js +0 -1
  15. package/dist/cmd/types.js +0 -1
  16. package/dist/data-sources/index.d.ts +37 -0
  17. package/dist/data-sources/index.d.ts.map +1 -0
  18. package/dist/data-sources/index.js +104 -0
  19. package/dist/displayers/displayers.js +2 -5
  20. package/dist/displayers/index.js +0 -1
  21. package/dist/env/env.js +1 -1
  22. package/dist/env/index.js +0 -1
  23. package/dist/env/types.js +0 -1
  24. package/dist/env/validate-name.js +0 -1
  25. package/dist/error.js +0 -1
  26. package/dist/forward-exports/delayed-exports.js +12 -18
  27. package/dist/forward-exports/index.js +0 -1
  28. package/dist/graph/base-node.d.ts +6 -4
  29. package/dist/graph/base-node.d.ts.map +1 -1
  30. package/dist/graph/base-node.js +60 -51
  31. package/dist/graph/base-origin-entity.js +15 -30
  32. package/dist/graph/dependencies.d.ts +2 -2
  33. package/dist/graph/dependencies.d.ts.map +1 -1
  34. package/dist/graph/dependencies.js +16 -19
  35. package/dist/graph/index.js +0 -1
  36. package/dist/graph/origin-node.d.ts +1 -1
  37. package/dist/graph/origin-node.d.ts.map +1 -1
  38. package/dist/graph/origin-node.js +33 -34
  39. package/dist/graph/relations.d.ts +2 -2
  40. package/dist/graph/relations.d.ts.map +1 -1
  41. package/dist/graph/relations.js +1 -4
  42. package/dist/graph/resource-node.d.ts +1 -1
  43. package/dist/graph/resource-node.d.ts.map +1 -1
  44. package/dist/graph/resource-node.js +16 -18
  45. package/dist/image/family.d.ts +10 -6
  46. package/dist/image/family.d.ts.map +1 -1
  47. package/dist/image/family.js +160 -44
  48. package/dist/image/index.js +0 -1
  49. package/dist/index.d.ts +1 -0
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +1 -1
  52. package/dist/kind-map/index.js +2 -1
  53. package/dist/manifest/index.js +0 -1
  54. package/dist/manifest/manifest-builder.d.ts +7 -11
  55. package/dist/manifest/manifest-builder.d.ts.map +1 -1
  56. package/dist/manifest/manifest-builder.js +3 -6
  57. package/dist/ports/error.js +1 -2
  58. package/dist/ports/index.js +0 -1
  59. package/dist/ports/map.js +1 -1
  60. package/dist/ports/set.d.ts +2 -2
  61. package/dist/ports/set.d.ts.map +1 -1
  62. package/dist/ports/set.js +16 -2
  63. package/dist/ports/tools/entry.js +0 -1
  64. package/dist/ports/tools/parse.js +0 -1
  65. package/dist/ports/types.d.ts +2 -2
  66. package/dist/ports/types.d.ts.map +1 -1
  67. package/dist/ports/types.js +0 -1
  68. package/dist/producer/index.js +0 -1
  69. package/dist/producer/producer.js +0 -1
  70. package/dist/ref-key/index.js +0 -1
  71. package/dist/ref-key/ref-key.js +2 -1
  72. package/dist/reference/forward-ref.js +13 -27
  73. package/dist/reference/index.js +0 -1
  74. package/dist/reference/refable.js +0 -1
  75. package/dist/resources/index.js +0 -1
  76. package/dist/resources/objects.js +4 -1
  77. package/dist/resources/parser.js +0 -1
  78. package/dist/resources/types.js +0 -1
  79. package/dist/src.tsbuildinfo +1 -1
  80. package/dist/tracing/git.js +1 -1
  81. package/dist/tracing/index.js +0 -1
  82. package/dist/tracing/trace.js +1 -1
  83. package/dist/tracing/traced.js +0 -1
  84. package/dist/units/index.js +0 -1
  85. package/dist/units/unit-parser.js +16 -11
  86. package/dist/units/units.js +0 -1
  87. package/package.json +3 -3
  88. package/src/_embedder/base.ts +1 -1
  89. package/src/_string/markers.ts +28 -9
  90. package/src/data-sources/index.ts +126 -0
  91. package/src/graph/base-node.ts +20 -10
  92. package/src/graph/dependencies.ts +2 -2
  93. package/src/graph/origin-node.ts +5 -5
  94. package/src/graph/relations.ts +2 -2
  95. package/src/graph/resource-node.ts +3 -3
  96. package/src/image/family.ts +45 -29
  97. package/src/index.ts +1 -0
  98. package/src/manifest/manifest-builder.ts +6 -5
  99. package/src/ports/set.ts +17 -3
  100. package/src/ports/types.ts +5 -3
  101. package/src/tsconfig.json +5 -0
  102. package/dist/_embedder/base.js.map +0 -1
  103. package/dist/_embedder/index.js.map +0 -1
  104. package/dist/_string/index.js.map +0 -1
  105. package/dist/_string/markers.js.map +0 -1
  106. package/dist/_string/post-processor.js.map +0 -1
  107. package/dist/_string/pretty-objects.js.map +0 -1
  108. package/dist/_string/pretty-print.js.map +0 -1
  109. package/dist/_string/super-script.js.map +0 -1
  110. package/dist/api-kind/index.js.map +0 -1
  111. package/dist/cmd/cli-command.js.map +0 -1
  112. package/dist/cmd/cli-term.js.map +0 -1
  113. package/dist/cmd/index.js.map +0 -1
  114. package/dist/cmd/types.js.map +0 -1
  115. package/dist/displayers/displayers.js.map +0 -1
  116. package/dist/displayers/index.js.map +0 -1
  117. package/dist/env/env.js.map +0 -1
  118. package/dist/env/index.js.map +0 -1
  119. package/dist/env/types.js.map +0 -1
  120. package/dist/env/validate-name.js.map +0 -1
  121. package/dist/error.js.map +0 -1
  122. package/dist/forward-exports/delayed-exports.js.map +0 -1
  123. package/dist/forward-exports/index.js.map +0 -1
  124. package/dist/graph/base-node.js.map +0 -1
  125. package/dist/graph/base-origin-entity.js.map +0 -1
  126. package/dist/graph/dependencies.js.map +0 -1
  127. package/dist/graph/index.js.map +0 -1
  128. package/dist/graph/origin-node.js.map +0 -1
  129. package/dist/graph/relations.js.map +0 -1
  130. package/dist/graph/resource-node.js.map +0 -1
  131. package/dist/image/family.js.map +0 -1
  132. package/dist/image/index.js.map +0 -1
  133. package/dist/index.js.map +0 -1
  134. package/dist/kind-map/index.js.map +0 -1
  135. package/dist/manifest/index.js.map +0 -1
  136. package/dist/manifest/manifest-builder.js.map +0 -1
  137. package/dist/ports/error.js.map +0 -1
  138. package/dist/ports/index.js.map +0 -1
  139. package/dist/ports/map.js.map +0 -1
  140. package/dist/ports/set.js.map +0 -1
  141. package/dist/ports/tools/entry.js.map +0 -1
  142. package/dist/ports/tools/parse.js.map +0 -1
  143. package/dist/ports/types.js.map +0 -1
  144. package/dist/producer/index.js.map +0 -1
  145. package/dist/producer/producer.js.map +0 -1
  146. package/dist/ref-key/index.js.map +0 -1
  147. package/dist/ref-key/ref-key.js.map +0 -1
  148. package/dist/reference/forward-ref.js.map +0 -1
  149. package/dist/reference/index.js.map +0 -1
  150. package/dist/reference/refable.js.map +0 -1
  151. package/dist/resources/index.js.map +0 -1
  152. package/dist/resources/objects.js.map +0 -1
  153. package/dist/resources/parser.js.map +0 -1
  154. package/dist/resources/types.js.map +0 -1
  155. package/dist/tracing/git.js.map +0 -1
  156. package/dist/tracing/index.js.map +0 -1
  157. package/dist/tracing/trace.js.map +0 -1
  158. package/dist/tracing/traced.js.map +0 -1
  159. package/dist/units/index.js.map +0 -1
  160. package/dist/units/unit-parser.js.map +0 -1
  161. package/dist/units/units.js.map +0 -1
@@ -1,9 +1,4 @@
1
1
  "use strict";
2
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
- };
7
2
  Object.defineProperty(exports, "__esModule", { value: true });
8
3
  exports.FutureExports = void 0;
9
4
  const doddle_1 = require("doddle");
@@ -11,22 +6,24 @@ const error_1 = require("../error");
11
6
  const reference_1 = require("../reference");
12
7
  var FutureExports;
13
8
  (function (FutureExports) {
14
- var _Handler_instances, _Handler_createImmutableError, _Handler_isValidReferant;
15
9
  function make(props) {
16
10
  const handler = new Handler(props);
17
11
  return new Proxy(props.actual, handler);
18
12
  }
19
13
  FutureExports.make = make;
20
14
  class Handler {
15
+ _props;
21
16
  constructor(_props) {
22
- _Handler_instances.add(this);
23
17
  this._props = _props;
24
18
  }
19
+ #createImmutableError(action) {
20
+ return new error_1.ProxyOperationError(`Tried to ${action} an the exports constructs of ${this._props.origin}, but it is immutable.`);
21
+ }
25
22
  defineProperty(_, property, __) {
26
- throw __classPrivateFieldGet(this, _Handler_instances, "m", _Handler_createImmutableError).call(this, `define property ${String(property)} on`);
23
+ throw this.#createImmutableError(`define property ${String(property)} on`);
27
24
  }
28
25
  deleteProperty(_, property) {
29
- throw __classPrivateFieldGet(this, _Handler_instances, "m", _Handler_createImmutableError).call(this, `delete property ${String(property)} from`);
26
+ throw this.#createImmutableError(`delete property ${String(property)} from`);
30
27
  }
31
28
  getPrototypeOf(_) {
32
29
  return Reflect.getPrototypeOf(this._target);
@@ -34,6 +31,9 @@ var FutureExports;
34
31
  get seq() {
35
32
  return (0, doddle_1.seq)(this._props.exports);
36
33
  }
34
+ #isValidReferant(prop) {
35
+ return this._props.origin.resourceKinds.tryParse(prop) != null;
36
+ }
37
37
  get _target() {
38
38
  return this._props.actual;
39
39
  }
@@ -70,7 +70,7 @@ var FutureExports;
70
70
  if (Reflect.has(this._target, p)) {
71
71
  return true;
72
72
  }
73
- if (!__classPrivateFieldGet(this, _Handler_instances, "m", _Handler_isValidReferant).call(this, p)) {
73
+ if (!this.#isValidReferant(p)) {
74
74
  return false;
75
75
  }
76
76
  return true;
@@ -85,10 +85,10 @@ var FutureExports;
85
85
  throw new error_1.ProxyOperationError(`Cannot list all keys of a dynamic exports construct for ${this._props.origin}.`);
86
86
  }
87
87
  set(target, p, newValue, receiver) {
88
- throw __classPrivateFieldGet(this, _Handler_instances, "m", _Handler_createImmutableError).call(this, `set property ${String(p)} on`);
88
+ throw this.#createImmutableError(`set property ${String(p)} on`);
89
89
  }
90
90
  setPrototypeOf(target, v) {
91
- throw __classPrivateFieldGet(this, _Handler_instances, "m", _Handler_createImmutableError).call(this, `set prototype of`);
91
+ throw this.#createImmutableError(`set prototype of`);
92
92
  }
93
93
  _tryTargetDescriptor(p) {
94
94
  return Object.getOwnPropertyDescriptor(this._target, p);
@@ -110,10 +110,4 @@ var FutureExports;
110
110
  };
111
111
  }
112
112
  }
113
- _Handler_instances = new WeakSet(), _Handler_createImmutableError = function _Handler_createImmutableError(action) {
114
- return new error_1.ProxyOperationError(`Tried to ${action} an the exports constructs of ${this._props.origin}, but it is immutable.`);
115
- }, _Handler_isValidReferant = function _Handler_isValidReferant(prop) {
116
- return this._props.origin.resourceKinds.tryParse(prop) != null;
117
- };
118
113
  })(FutureExports || (exports.FutureExports = FutureExports = {}));
119
- //# sourceMappingURL=delayed-exports.js.map
@@ -15,4 +15,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./delayed-exports"), exports);
18
- //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  import { Seq } from "doddle";
2
2
  import { Kind } from "../api-kind";
3
3
  import { RefKey } from "../ref-key";
4
- import { NeedsEdge } from "./dependencies";
4
+ import { Relation } from "./dependencies";
5
5
  export interface BaseEntity<Node extends BaseNode<Node>> {
6
6
  readonly node: Node;
7
7
  readonly shortFqn: string;
@@ -10,10 +10,11 @@ export interface BaseEntity<Node extends BaseNode<Node>> {
10
10
  }
11
11
  export declare abstract class BaseNode<Node extends BaseNode<Node, Entity>, Entity extends BaseEntity<Node> = BaseEntity<Node>> {
12
12
  readonly _entity: Entity;
13
+ private _eqProxy;
13
14
  abstract readonly key: RefKey;
14
15
  get kind(): Kind.Identifier<string, Kind.IdentParent | null>;
15
16
  abstract readonly kids: Seq<Node>;
16
- abstract readonly needs: Seq<NeedsEdge<Node>>;
17
+ abstract readonly relations: Seq<Relation<Node>>;
17
18
  abstract readonly parent: Node | null;
18
19
  protected get _asNode(): Node;
19
20
  constructor(_entity: Entity);
@@ -27,8 +28,9 @@ export declare abstract class BaseNode<Node extends BaseNode<Node, Entity>, Enti
27
28
  readonly descendants: Seq<Node>;
28
29
  isParentOf(other: Node): boolean;
29
30
  isChildOf(other: Node): boolean;
30
- isNeeding(other: Node): boolean;
31
- readonly needsGraph: Seq<NeedsEdge<Node>>;
31
+ hasRelationTo(other: Node): boolean;
32
+ readonly recursiveRelationsSubtree: Seq<Relation<Node>>;
33
+ readonly recursiveRelations: Seq<Relation<Node>>;
32
34
  }
33
35
  export type Formats = "short" | "fqn" | "shortFqn";
34
36
  //# sourceMappingURL=base-node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base-node.d.ts","sourceRoot":"","sources":["../../src/graph/base-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAO,MAAM,QAAQ,CAAA;AAEjC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,WAAW,UAAU,CAAC,IAAI,SAAS,QAAQ,CAAC,IAAI,CAAC;IACnD,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;IAEnB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAA;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACxB;AAED,8BAAsB,QAAQ,CAC1B,IAAI,SAAS,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,EACnC,MAAM,SAAS,UAAU,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,IAAI,CAA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kBAAkB,sBAmBzB;CACL;AACD,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,KAAK,GAAG,UAAU,CAAA"}
@@ -6,6 +6,8 @@ const immutable_1 = require("immutable");
6
6
  const reference_1 = require("../reference");
7
7
  const dependencies_1 = require("./dependencies");
8
8
  class BaseNode {
9
+ _entity;
10
+ _eqProxy = {};
9
11
  get kind() {
10
12
  return this.key.kind;
11
13
  }
@@ -14,52 +16,6 @@ class BaseNode {
14
16
  }
15
17
  constructor(_entity) {
16
18
  this._entity = _entity;
17
- this.ancestors = (0, doddle_1.seq)(() => {
18
- const seen = (0, immutable_1.Set)();
19
- const recurse = function* (from) {
20
- const parent = from.parent;
21
- if (parent && !seen.has(parent)) {
22
- seen.add(parent);
23
- yield parent;
24
- yield* recurse(parent);
25
- }
26
- };
27
- return (0, doddle_1.seq)(recurse.bind(null, this._asNode));
28
- }).cache();
29
- this.descendants = (0, doddle_1.seq)(() => {
30
- const self = this;
31
- let seen = (0, immutable_1.Set)();
32
- const recurse = function* (from) {
33
- for (const kid of from.kids) {
34
- if (seen.has(kid)) {
35
- continue;
36
- }
37
- seen = seen.add(kid);
38
- yield kid;
39
- yield* recurse(kid);
40
- }
41
- };
42
- return (0, doddle_1.seq)(recurse.bind(null, self._asNode));
43
- }).cache();
44
- this.needsGraph = (0, doddle_1.seq)(() => {
45
- let resources = (0, immutable_1.Set)();
46
- const recurseIntoDependency = function* (root) {
47
- yield root;
48
- if (resources.has(root.needed)) {
49
- return;
50
- }
51
- resources = resources.add(root.needed);
52
- const ownDeps = root.needed.needs;
53
- for (const needsEdge of ownDeps) {
54
- yield* recurseIntoDependency(needsEdge);
55
- }
56
- };
57
- return (0, doddle_1.seq)(recurseIntoDependency.bind(null, new dependencies_1.NeedsEdge("self", this._asNode)))
58
- .after(() => {
59
- resources = (0, immutable_1.Set)();
60
- })
61
- .cache();
62
- });
63
19
  }
64
20
  get shortFqn() {
65
21
  return `${this.kind.name}/${this.name}`;
@@ -71,10 +27,10 @@ class BaseNode {
71
27
  return this.key.name;
72
28
  }
73
29
  get isRoot() {
74
- return this.parent === null;
30
+ return this.parent === null && this._entity.kind.name !== "PodTemplate";
75
31
  }
76
32
  hashCode() {
77
- return (0, immutable_1.hash)(this);
33
+ return (0, immutable_1.hash)(this._eqProxy);
78
34
  }
79
35
  equals(other) {
80
36
  if (reference_1.ForwardRef.is(other)) {
@@ -82,6 +38,33 @@ class BaseNode {
82
38
  }
83
39
  return this === other;
84
40
  }
41
+ ancestors = (0, doddle_1.seq)(() => {
42
+ const seen = (0, immutable_1.Set)();
43
+ const recurse = function* (from) {
44
+ const parent = from.parent;
45
+ if (parent && !seen.has(parent)) {
46
+ seen.add(parent);
47
+ yield parent;
48
+ yield* recurse(parent);
49
+ }
50
+ };
51
+ return (0, doddle_1.seq)(recurse.bind(null, this._asNode));
52
+ }).cache();
53
+ descendants = (0, doddle_1.seq)(() => {
54
+ const self = this;
55
+ let seen = (0, immutable_1.Set)();
56
+ const recurse = function* (from) {
57
+ for (const kid of from.kids) {
58
+ if (seen.has(kid)) {
59
+ continue;
60
+ }
61
+ seen = seen.add(kid);
62
+ yield kid;
63
+ yield* recurse(kid);
64
+ }
65
+ };
66
+ return (0, doddle_1.seq)(recurse.bind(null, self._asNode));
67
+ }).cache();
85
68
  isParentOf(other) {
86
69
  if (reference_1.ForwardRef.is(other)) {
87
70
  return other.isChildOf(this._asNode);
@@ -94,9 +77,35 @@ class BaseNode {
94
77
  }
95
78
  return this.equals(other) || (0, immutable_1.Set)(this.ancestors).has(other._asNode);
96
79
  }
97
- isNeeding(other) {
98
- return this.needsGraph.some(x => x.needed.equals(other)).pull();
80
+ hasRelationTo(other) {
81
+ return this.recursiveRelations.some(x => x.needed.equals(other)).pull();
99
82
  }
83
+ recursiveRelationsSubtree = (0, doddle_1.seq)(() => {
84
+ const self = this;
85
+ return (0, doddle_1.seq)(function* () {
86
+ for (const child of [self, ...self.descendants]) {
87
+ yield* child.recursiveRelations;
88
+ }
89
+ });
90
+ });
91
+ recursiveRelations = (0, doddle_1.seq)(() => {
92
+ let resources = (0, immutable_1.Set)();
93
+ const recurseIntoDependency = function* (root) {
94
+ yield root;
95
+ if (resources.has(root.needed)) {
96
+ return;
97
+ }
98
+ resources = resources.add(root.needed);
99
+ const ownDeps = root.needed.relations;
100
+ for (const needsEdge of ownDeps) {
101
+ yield* recurseIntoDependency(needsEdge);
102
+ }
103
+ };
104
+ return (0, doddle_1.seq)(recurseIntoDependency.bind(null, new dependencies_1.Relation("self", this._asNode)))
105
+ .after(() => {
106
+ resources = (0, immutable_1.Set)();
107
+ })
108
+ .cache();
109
+ });
100
110
  }
101
111
  exports.BaseNode = BaseNode;
102
- //# sourceMappingURL=base-node.js.map
@@ -33,21 +33,6 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
33
33
  }
34
34
  return useValue ? value : void 0;
35
35
  };
36
- var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
37
- if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
38
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
39
- };
40
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
41
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
42
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
43
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
44
- };
45
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
46
- if (kind === "m") throw new TypeError("Private method is not writable");
47
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
48
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
49
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
50
- };
51
36
  var __importDefault = (this && this.__importDefault) || function (mod) {
52
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
53
38
  };
@@ -60,7 +45,6 @@ const displayers_1 = require("../displayers");
60
45
  const ref_key_1 = require("../ref-key");
61
46
  const origin_node_1 = require("./origin-node");
62
47
  let BaseOriginEntity = (() => {
63
- var _BaseOriginEntity_node;
64
48
  let _classDecorators = [(0, displayers_1.displayers)({
65
49
  simple: x => `[${x.shortFqn}]`,
66
50
  pretty(origin) {
@@ -72,34 +56,35 @@ let BaseOriginEntity = (() => {
72
56
  let _classDescriptor;
73
57
  let _classExtraInitializers = [];
74
58
  let _classThis;
75
- var BaseOriginEntity = _classThis = class {
59
+ var BaseOriginEntity = class {
60
+ static { _classThis = this; }
61
+ static {
62
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
63
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
64
+ BaseOriginEntity = _classThis = _classDescriptor.value;
65
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
66
+ __runInitializers(_classThis, _classExtraInitializers);
67
+ }
68
+ name;
69
+ props;
70
+ #node;
71
+ meta;
76
72
  get alias() {
77
73
  return this.props.alias ?? undefined;
78
74
  }
79
75
  get node() {
80
- return __classPrivateFieldGet(this, _BaseOriginEntity_node, "f").pull();
76
+ return this.#node.pull();
81
77
  }
82
78
  constructor(name, props, parent) {
83
79
  this.name = name;
84
80
  this.props = props;
85
- _BaseOriginEntity_node.set(this, void 0);
86
- __classPrivateFieldSet(this, _BaseOriginEntity_node, (0, doddle_1.doddle)(() => new origin_node_1.Origin(parent, this, ref_key_1.RefKey.make(this.kind, name))), "f");
81
+ this.#node = (0, doddle_1.doddle)(() => new origin_node_1.Origin(parent, this, ref_key_1.RefKey.make(this.kind, name)));
87
82
  this.meta = metadata_1.Meta.make(props.meta);
88
83
  }
89
84
  get shortFqn() {
90
85
  return this.node.shortFqn;
91
86
  }
92
87
  };
93
- _BaseOriginEntity_node = new WeakMap();
94
- __setFunctionName(_classThis, "BaseOriginEntity");
95
- (() => {
96
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
97
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
98
- BaseOriginEntity = _classThis = _classDescriptor.value;
99
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
100
- __runInitializers(_classThis, _classExtraInitializers);
101
- })();
102
88
  return BaseOriginEntity = _classThis;
103
89
  })();
104
90
  exports.BaseOriginEntity = BaseOriginEntity;
105
- //# sourceMappingURL=base-origin-entity.js.map
@@ -3,8 +3,8 @@ import { ResourceEntity } from "./resource-node";
3
3
  export declare namespace Dependencies {
4
4
  type Input = Record<string, ResourceEntity>;
5
5
  }
6
- export declare function dependencies(record: Dependencies.Input): NeedsEdge<import("./resource-node").ResourceNode>[];
7
- export declare class NeedsEdge<Node extends BaseNode<Node>> {
6
+ export declare function dependencies(record: Dependencies.Input): Relation<import("./resource-node").ResourceNode>[];
7
+ export declare class Relation<Node extends BaseNode<Node>> {
8
8
  readonly why: string;
9
9
  readonly needed: Node;
10
10
  constructor(why: string, needed: Node);
@@ -1 +1 @@
1
- {"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../../src/graph/dependencies.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,yBAAiB,YAAY,CAAC;IAC1B,KAAY,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;CACrD;AACD,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,CAAC,KAAK,uDAItD;AACD,qBAOa,SAAS,CAAC,IAAI,SAAS,QAAQ,CAAC,IAAI,CAAC;IAE1C,QAAQ,CAAC,GAAG,EAAE,MAAM;IACpB,QAAQ,CAAC,MAAM,EAAE,IAAI;gBADZ,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,IAAI;CAE5B"}
1
+ {"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../../src/graph/dependencies.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,yBAAiB,YAAY,CAAC;IAC1B,KAAY,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;CACrD;AACD,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,CAAC,KAAK,sDAItD;AACD,qBAOa,QAAQ,CAAC,IAAI,SAAS,QAAQ,CAAC,IAAI,CAAC;IAEzC,QAAQ,CAAC,GAAG,EAAE,MAAM;IACpB,QAAQ,CAAC,MAAM,EAAE,IAAI;gBADZ,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,IAAI;CAE5B"}
@@ -33,25 +33,21 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
33
33
  }
34
34
  return useValue ? value : void 0;
35
35
  };
36
- var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
37
- if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
38
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
39
- };
40
36
  var __importDefault = (this && this.__importDefault) || function (mod) {
41
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
42
38
  };
43
39
  Object.defineProperty(exports, "__esModule", { value: true });
44
- exports.NeedsEdge = void 0;
40
+ exports.Relation = void 0;
45
41
  exports.dependencies = dependencies;
46
42
  const chalk_1 = __importDefault(require("chalk"));
47
43
  const _string_1 = require("../_string");
48
44
  const displayers_1 = require("../displayers");
49
45
  function dependencies(record) {
50
46
  return Object.entries(record).map(([key, value]) => {
51
- return new NeedsEdge(key, value.node);
47
+ return new Relation(key, value.node);
52
48
  });
53
49
  }
54
- let NeedsEdge = (() => {
50
+ let Relation = (() => {
55
51
  let _classDecorators = [(0, displayers_1.displayers)({
56
52
  simple: s => [s.why, "-->", s.needed],
57
53
  pretty: (dep, format) => {
@@ -62,21 +58,22 @@ let NeedsEdge = (() => {
62
58
  let _classDescriptor;
63
59
  let _classExtraInitializers = [];
64
60
  let _classThis;
65
- var NeedsEdge = _classThis = class {
61
+ var Relation = class {
62
+ static { _classThis = this; }
63
+ static {
64
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
65
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
66
+ Relation = _classThis = _classDescriptor.value;
67
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
68
+ __runInitializers(_classThis, _classExtraInitializers);
69
+ }
70
+ why;
71
+ needed;
66
72
  constructor(why, needed) {
67
73
  this.why = why;
68
74
  this.needed = needed;
69
75
  }
70
76
  };
71
- __setFunctionName(_classThis, "NeedsEdge");
72
- (() => {
73
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
74
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
75
- NeedsEdge = _classThis = _classDescriptor.value;
76
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
77
- __runInitializers(_classThis, _classExtraInitializers);
78
- })();
79
- return NeedsEdge = _classThis;
77
+ return Relation = _classThis;
80
78
  })();
81
- exports.NeedsEdge = NeedsEdge;
82
- //# sourceMappingURL=dependencies.js.map
79
+ exports.Relation = Relation;
@@ -20,4 +20,3 @@ __exportStar(require("./dependencies"), exports);
20
20
  __exportStar(require("./origin-node"), exports);
21
21
  __exportStar(require("./relations"), exports);
22
22
  __exportStar(require("./resource-node"), exports);
23
- //# sourceMappingURL=index.js.map
@@ -16,7 +16,7 @@ export declare class Origin extends BaseNode<Origin, OriginEntity> implements It
16
16
  get resourceKinds(): KindMap;
17
17
  private _kindMap;
18
18
  private _attached;
19
- get needs(): Seq<never>;
19
+ get relations(): Seq<never>;
20
20
  [Symbol.iterator](): ArrayIterator<ResourceNode>;
21
21
  readonly attachedTree: Seq<ResourceNode>;
22
22
  get resources(): ResourceNode[];
@@ -1 +1 @@
1
- {"version":3,"file":"origin-node.d.ts","sourceRoot":"","sources":["../../src/graph/origin-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAErC,OAAO,EAAe,GAAG,EAAE,MAAM,QAAQ,CAAA;AAIzC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAGnC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,qBAgBa,MAAO,SAAQ,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAE,YAAW,QAAQ,CAAC,YAAY,CAAC;IAcpF,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAE9B,QAAQ,CAAC,GAAG,EAAE,MAAM;IAfxB,OAAO,CAAC,KAAK,CAAiB;IAC9B,IAAI,IAAI,gBAEP;IACD,IAAI,IAAI,cAEP;IACD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAGjB;gBAEI,MAAM,EAAE,MAAM,GAAG,IAAI,EAC9B,MAAM,EAAE,YAAY,EACX,GAAG,EAAE,MAAM;IAMxB,IAAI,aAAa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AAC,QAAQ,CAAC,SAAS,CAGjB;gBAEI,MAAM,EAAE,MAAM,GAAG,IAAI,EAC9B,MAAM,EAAE,YAAY,EACX,GAAG,EAAE,MAAM;IAMxB,IAAI,aAAa,YAEhB;IACD,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,SAAS,CAAuB;IAExC,IAAI,SAAS,eAEZ;IACD,CAAC,MAAM,CAAC,QAAQ,CAAC;IAGjB,QAAQ,CAAC,YAAY,EAAE,GAAG,CAAC,YAAY,CAAC,CAS9B;IAEV,IAAI,SAAS,mBAEZ;IACD,MAAM,CAAC,kBAAkB,CAAC,CAAC,SAAS,QAAQ,EAAE,IAAI,EAAE,CAAC;IAyBrD,OAAO,CAAC,gBAAgB;IAIxB,OAAO,CAAC,mBAAmB;CAM9B;AACD,MAAM,WAAW,YAAa,SAAQ,UAAU,CAAC,MAAM,CAAC;IACpD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,IAAI,CAAA;CACb;AAED,eAAO,MAAM,aAAa,kCAA4B,CAAA"}
@@ -33,10 +33,6 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
33
33
  }
34
34
  return useValue ? value : void 0;
35
35
  };
36
- var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
37
- if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
38
- return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
39
- };
40
36
  var __importDefault = (this && this.__importDefault) || function (mod) {
41
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
42
38
  };
@@ -57,60 +53,72 @@ let Origin = (() => {
57
53
  simple: s => `[${s.shortFqn}]`,
58
54
  prefix: s => {
59
55
  if (s.name === "EXTERNAL") {
60
- return "🌐";
56
+ return (0, _string_1.getMarkerForExternal)();
61
57
  }
62
- return (0, _string_1.getMarkerForIndex)(s.index, s._entity.alias ?? (0, _string_1.toSuperScript)(s.index));
58
+ return (0, _string_1.getMarkerForIndex)(s.index);
63
59
  },
64
60
  pretty(origin, format) {
65
61
  const kindName = chalk_1.default.greenBright.bold(origin.kind.name);
66
62
  const resourceName = chalk_1.default.cyan(origin.name);
67
63
  const pref = this.prefix();
68
- return `${kindName}:${resourceName} (${pref})`;
64
+ return chalk_1.default.underline(`${pref}${kindName}:${resourceName}`);
69
65
  }
70
66
  })];
71
67
  let _classDescriptor;
72
68
  let _classExtraInitializers = [];
73
69
  let _classThis;
74
70
  let _classSuper = base_node_1.BaseNode;
75
- var Origin = _classThis = class extends _classSuper {
71
+ var Origin = class extends _classSuper {
72
+ static { _classThis = this; }
73
+ static {
74
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
75
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
76
+ Origin = _classThis = _classDescriptor.value;
77
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
78
+ __runInitializers(_classThis, _classExtraInitializers);
79
+ }
80
+ parent;
81
+ key;
82
+ _kids = [];
76
83
  get kids() {
77
84
  return (0, doddle_1.seq)(this._kids);
78
85
  }
79
86
  get meta() {
80
87
  return this._entity.meta;
81
88
  }
89
+ index;
90
+ _getIndex = (0, doddle_1.doddle)(() => {
91
+ let index = 1;
92
+ return () => index++;
93
+ }).pull();
82
94
  constructor(parent, entity, key) {
83
95
  super(entity);
84
96
  this.parent = parent;
85
97
  this.key = key;
86
- this._kids = [];
87
- this._getIndex = (0, doddle_1.doddle)(() => {
88
- let index = 1;
89
- return () => index++;
90
- }).pull();
91
- this._attached = [];
92
- this.attachedTree = (0, doddle_1.seq)(() => {
93
- const self = this;
94
- const desc = self.descendants.prepend(this).concatMap(function* (x) {
95
- yield* self.resources;
96
- for (const kid of self.kids) {
97
- yield* kid.resources;
98
- }
99
- });
100
- return desc;
101
- }).cache();
102
98
  this.index = parent?._getIndex() ?? 0;
103
99
  this._kindMap = new kind_map_1.KindMap(undefined, parent?._kindMap);
104
100
  }
105
101
  get resourceKinds() {
106
102
  return this._kindMap;
107
103
  }
108
- get needs() {
104
+ _kindMap;
105
+ _attached = [];
106
+ get relations() {
109
107
  return doddle_1.seq.empty();
110
108
  }
111
109
  [Symbol.iterator]() {
112
110
  return this.resources[Symbol.iterator]();
113
111
  }
112
+ attachedTree = (0, doddle_1.seq)(() => {
113
+ const self = this;
114
+ const desc = self.descendants.prepend(this).concatMap(function* (x) {
115
+ yield* self.resources;
116
+ for (const kid of self.kids) {
117
+ yield* kid.resources;
118
+ }
119
+ });
120
+ return desc;
121
+ }).cache();
114
122
  get resources() {
115
123
  return this._attached;
116
124
  }
@@ -146,16 +154,7 @@ let Origin = (() => {
146
154
  }
147
155
  }
148
156
  };
149
- __setFunctionName(_classThis, "Origin");
150
- (() => {
151
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
152
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
153
- Origin = _classThis = _classDescriptor.value;
154
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
155
- __runInitializers(_classThis, _classExtraInitializers);
156
- })();
157
157
  return Origin = _classThis;
158
158
  })();
159
159
  exports.Origin = Origin;
160
160
  exports.auto_register = Origin.registerWithOrigin;
161
- //# sourceMappingURL=origin-node.js.map
@@ -1,8 +1,8 @@
1
- import { Dependencies, NeedsEdge } from "./dependencies";
1
+ import { Dependencies, Relation } from "./dependencies";
2
2
  import { ResourceEntity, ResourceNode } from "./resource-node";
3
3
  export declare namespace Relations {
4
4
  interface Out {
5
- needs: () => Iterable<NeedsEdge<ResourceNode>>;
5
+ needs: () => Iterable<Relation<ResourceNode>>;
6
6
  parent: () => ResourceNode | null;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,EAAE,GAAG,EAAE,KAAK,cAAc,EACrD,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC,cAAc,CAAC;IASvC,GAAG,CAAC,MAAM,EAAE,cAAc,GAAG,SAAS,CAAC,GAAG;IAU1C,IAAI,SAAS,KAEL,MAAM,SAAS,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,cAAc,EAC9D,IAAI,SAAS,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,EAEjE,OAAO,IAAI,MAEH,MAAM,MAAM,YAK3B;CACJ;AACD,eAAO,MAAM,SAAS,kBAAyB,CAAA;AAC/C,eAAO,MAAM,SAAS,GAbV,MAAM,gCAAgC,GAAG,EAAE,KAAK,cAAc,EAC9D,IAAI,gFAII,YAAY,WAQY,CAAA"}
@@ -4,9 +4,7 @@ exports.relations = exports.Relations = void 0;
4
4
  const base_1 = require("../_embedder/base");
5
5
  const dependencies_1 = require("./dependencies");
6
6
  class RelationsService {
7
- constructor() {
8
- this._system = new base_1.Embedder("relations");
9
- }
7
+ _system = new base_1.Embedder("relations");
10
8
  implement(ctor, input) {
11
9
  const existing = this._system.tryGet(ctor.prototype);
12
10
  if (existing) {
@@ -35,4 +33,3 @@ class RelationsService {
35
33
  exports.Relations = new RelationsService();
36
34
  exports.relations = exports.Relations.decorator;
37
35
  // writing the decorator itself
38
- //# sourceMappingURL=relations.js.map
@@ -6,7 +6,7 @@ export declare class ResourceNode extends BaseNode<ResourceNode, ResourceEntity>
6
6
  readonly origin: Origin;
7
7
  readonly entity: ResourceEntity;
8
8
  readonly key: RefKey;
9
- get needs(): import("doddle").Seq<import("./dependencies").NeedsEdge<ResourceNode>>;
9
+ get relations(): import("doddle").Seq<import("./dependencies").Relation<ResourceNode>>;
10
10
  get trace(): import("../tracing").Trace;
11
11
  get isExported(): string | false;
12
12
  get meta(): import("@k8ts/metadata").Meta.MutableMeta | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"resource-node.d.ts","sourceRoot":"","sources":["../../src/graph/resource-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAI5C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAEnC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAGtC,qBAqBa,YAAa,SAAQ,QAAQ,CAAC,YAAY,EAAE,cAAc,CAAC;IA8DhE,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,QAAQ,CAAC,MAAM,EAAE,cAAc;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM;IA/DxB,IAAI,KAAK,2EAER;IAED,IAAI,KAAK,+BAER;IAED,IAAI,UAAU,mBAEb;IAED,IAAI,IAAI,0DAEP;IAED,IAAI,UAAU,YAEb;IAED,IAAI,OAAO,iCASV;IAED,IAAI,IAAI,uCAEP;IAED,IAAI,MAAM,wBAET;IAED,IAAa,QAAQ,WAEpB;IAED,IAAI,SAAS,0BAEZ;IAED,MAAM,CAAC,MAAM,EAAE,OAAO;IAUtB,OAAO,KAAK,UAAU,GAErB;gBAEY,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,MAAM;CAI3B;AACD,MAAM,WAAW,cAAe,SAAQ,UAAU,CAAC,YAAY,CAAC;IAC5D,IAAI,EAAE,WAAW,CAAA;CACpB;AACD,MAAM,WAAW,cAAe,SAAQ,UAAU,CAAC,YAAY,CAAC;CAAG"}
1
+ {"version":3,"file":"resource-node.d.ts","sourceRoot":"","sources":["../../src/graph/resource-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAI5C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAEnC,OAAO,EAAE,UAAU,EA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