@player-tools/fluent 0.12.1--canary.241.6077

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 (134) hide show
  1. package/dist/cjs/index.cjs +2396 -0
  2. package/dist/cjs/index.cjs.map +1 -0
  3. package/dist/index.legacy-esm.js +2276 -0
  4. package/dist/index.mjs +2276 -0
  5. package/dist/index.mjs.map +1 -0
  6. package/package.json +38 -0
  7. package/src/core/base-builder/__tests__/fluent-builder-base.test.ts +2423 -0
  8. package/src/core/base-builder/__tests__/fluent-partial.test.ts +179 -0
  9. package/src/core/base-builder/__tests__/id-generator.test.ts +658 -0
  10. package/src/core/base-builder/__tests__/registry.test.ts +534 -0
  11. package/src/core/base-builder/__tests__/resolution-mixed-arrays.test.ts +319 -0
  12. package/src/core/base-builder/__tests__/resolution-pipeline.test.ts +416 -0
  13. package/src/core/base-builder/__tests__/resolution-switches.test.ts +468 -0
  14. package/src/core/base-builder/__tests__/resolution-templates.test.ts +255 -0
  15. package/src/core/base-builder/__tests__/switch.test.ts +815 -0
  16. package/src/core/base-builder/__tests__/template.test.ts +596 -0
  17. package/src/core/base-builder/__tests__/value-extraction.test.ts +200 -0
  18. package/src/core/base-builder/__tests__/value-storage.test.ts +459 -0
  19. package/src/core/base-builder/conditional/index.ts +64 -0
  20. package/src/core/base-builder/context.ts +152 -0
  21. package/src/core/base-builder/errors.ts +69 -0
  22. package/src/core/base-builder/fluent-builder-base.ts +308 -0
  23. package/src/core/base-builder/guards.ts +137 -0
  24. package/src/core/base-builder/id/generator.ts +290 -0
  25. package/src/core/base-builder/id/registry.ts +152 -0
  26. package/src/core/base-builder/index.ts +72 -0
  27. package/src/core/base-builder/resolution/path-resolver.ts +116 -0
  28. package/src/core/base-builder/resolution/pipeline.ts +103 -0
  29. package/src/core/base-builder/resolution/steps/__tests__/nested-asset-wrappers.test.ts +206 -0
  30. package/src/core/base-builder/resolution/steps/asset-id.ts +77 -0
  31. package/src/core/base-builder/resolution/steps/asset-wrappers.ts +64 -0
  32. package/src/core/base-builder/resolution/steps/builders.ts +84 -0
  33. package/src/core/base-builder/resolution/steps/mixed-arrays.ts +95 -0
  34. package/src/core/base-builder/resolution/steps/nested-asset-wrappers.ts +124 -0
  35. package/src/core/base-builder/resolution/steps/static-values.ts +35 -0
  36. package/src/core/base-builder/resolution/steps/switches.ts +71 -0
  37. package/src/core/base-builder/resolution/steps/templates.ts +40 -0
  38. package/src/core/base-builder/resolution/value-resolver.ts +333 -0
  39. package/src/core/base-builder/storage/auxiliary-storage.ts +82 -0
  40. package/src/core/base-builder/storage/value-storage.ts +282 -0
  41. package/src/core/base-builder/types.ts +266 -0
  42. package/src/core/base-builder/utils.ts +10 -0
  43. package/src/core/flow/__tests__/index.test.ts +292 -0
  44. package/src/core/flow/index.ts +118 -0
  45. package/src/core/index.ts +8 -0
  46. package/src/core/mocks/generated/action.builder.ts +92 -0
  47. package/src/core/mocks/generated/choice-item.builder.ts +120 -0
  48. package/src/core/mocks/generated/choice.builder.ts +134 -0
  49. package/src/core/mocks/generated/collection.builder.ts +93 -0
  50. package/src/core/mocks/generated/field-collection.builder.ts +86 -0
  51. package/src/core/mocks/generated/index.ts +10 -0
  52. package/src/core/mocks/generated/info.builder.ts +64 -0
  53. package/src/core/mocks/generated/input.builder.ts +63 -0
  54. package/src/core/mocks/generated/overview-collection.builder.ts +65 -0
  55. package/src/core/mocks/generated/splash-collection.builder.ts +93 -0
  56. package/src/core/mocks/generated/text.builder.ts +47 -0
  57. package/src/core/mocks/index.ts +1 -0
  58. package/src/core/mocks/types/action.ts +92 -0
  59. package/src/core/mocks/types/choice.ts +129 -0
  60. package/src/core/mocks/types/collection.ts +140 -0
  61. package/src/core/mocks/types/info.ts +7 -0
  62. package/src/core/mocks/types/input.ts +7 -0
  63. package/src/core/mocks/types/text.ts +5 -0
  64. package/src/core/schema/__tests__/index.test.ts +127 -0
  65. package/src/core/schema/index.ts +195 -0
  66. package/src/core/schema/types.ts +7 -0
  67. package/src/core/switch/__tests__/index.test.ts +156 -0
  68. package/src/core/switch/index.ts +81 -0
  69. package/src/core/tagged-template/README.md +448 -0
  70. package/src/core/tagged-template/__tests__/extract-bindings-from-schema.test.ts +207 -0
  71. package/src/core/tagged-template/__tests__/index.test.ts +190 -0
  72. package/src/core/tagged-template/__tests__/schema-std-integration.test.ts +580 -0
  73. package/src/core/tagged-template/binding.ts +95 -0
  74. package/src/core/tagged-template/expression.ts +92 -0
  75. package/src/core/tagged-template/extract-bindings-from-schema.ts +120 -0
  76. package/src/core/tagged-template/index.ts +5 -0
  77. package/src/core/tagged-template/std.ts +472 -0
  78. package/src/core/tagged-template/types.ts +123 -0
  79. package/src/core/template/__tests__/index.test.ts +380 -0
  80. package/src/core/template/index.ts +196 -0
  81. package/src/core/utils/index.ts +160 -0
  82. package/src/fp/README.md +411 -0
  83. package/src/fp/__tests__/index.test.ts +1178 -0
  84. package/src/fp/index.ts +386 -0
  85. package/src/gen/common.ts +15 -0
  86. package/src/index.ts +5 -0
  87. package/src/types.ts +203 -0
  88. package/types/core/base-builder/conditional/index.d.ts +21 -0
  89. package/types/core/base-builder/context.d.ts +39 -0
  90. package/types/core/base-builder/errors.d.ts +45 -0
  91. package/types/core/base-builder/fluent-builder-base.d.ts +147 -0
  92. package/types/core/base-builder/guards.d.ts +58 -0
  93. package/types/core/base-builder/id/generator.d.ts +69 -0
  94. package/types/core/base-builder/id/registry.d.ts +93 -0
  95. package/types/core/base-builder/index.d.ts +9 -0
  96. package/types/core/base-builder/resolution/path-resolver.d.ts +15 -0
  97. package/types/core/base-builder/resolution/pipeline.d.ts +27 -0
  98. package/types/core/base-builder/resolution/steps/asset-id.d.ts +14 -0
  99. package/types/core/base-builder/resolution/steps/asset-wrappers.d.ts +14 -0
  100. package/types/core/base-builder/resolution/steps/builders.d.ts +14 -0
  101. package/types/core/base-builder/resolution/steps/mixed-arrays.d.ts +14 -0
  102. package/types/core/base-builder/resolution/steps/nested-asset-wrappers.d.ts +14 -0
  103. package/types/core/base-builder/resolution/steps/static-values.d.ts +14 -0
  104. package/types/core/base-builder/resolution/steps/switches.d.ts +15 -0
  105. package/types/core/base-builder/resolution/steps/templates.d.ts +14 -0
  106. package/types/core/base-builder/resolution/value-resolver.d.ts +62 -0
  107. package/types/core/base-builder/storage/auxiliary-storage.d.ts +50 -0
  108. package/types/core/base-builder/storage/value-storage.d.ts +82 -0
  109. package/types/core/base-builder/types.d.ts +183 -0
  110. package/types/core/base-builder/utils.d.ts +2 -0
  111. package/types/core/flow/index.d.ts +23 -0
  112. package/types/core/index.d.ts +8 -0
  113. package/types/core/mocks/index.d.ts +2 -0
  114. package/types/core/mocks/types/action.d.ts +58 -0
  115. package/types/core/mocks/types/choice.d.ts +95 -0
  116. package/types/core/mocks/types/collection.d.ts +102 -0
  117. package/types/core/mocks/types/info.d.ts +7 -0
  118. package/types/core/mocks/types/input.d.ts +7 -0
  119. package/types/core/mocks/types/text.d.ts +5 -0
  120. package/types/core/schema/index.d.ts +34 -0
  121. package/types/core/schema/types.d.ts +5 -0
  122. package/types/core/switch/index.d.ts +21 -0
  123. package/types/core/tagged-template/binding.d.ts +19 -0
  124. package/types/core/tagged-template/expression.d.ts +11 -0
  125. package/types/core/tagged-template/extract-bindings-from-schema.d.ts +7 -0
  126. package/types/core/tagged-template/index.d.ts +6 -0
  127. package/types/core/tagged-template/std.d.ts +174 -0
  128. package/types/core/tagged-template/types.d.ts +69 -0
  129. package/types/core/template/index.d.ts +97 -0
  130. package/types/core/utils/index.d.ts +47 -0
  131. package/types/fp/index.d.ts +149 -0
  132. package/types/gen/common.d.ts +6 -0
  133. package/types/index.d.ts +3 -0
  134. package/types/types.d.ts +163 -0
package/dist/index.mjs ADDED
@@ -0,0 +1,2276 @@
1
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/base-builder/types.ts
2
+ var FLUENT_BUILDER_SYMBOL = Symbol.for("fluent-builder");
3
+ var BranchTypes = {
4
+ SLOT: "slot",
5
+ ARRAY_ITEM: "array-item",
6
+ TEMPLATE: "template",
7
+ SWITCH: "switch",
8
+ CUSTOM: "custom"
9
+ };
10
+ var StorageKeys = {
11
+ TEMPLATES: "__templates__",
12
+ SWITCHES: "__switches__"
13
+ };
14
+ var PropertyKeys = {
15
+ ID: "id",
16
+ TYPE: "type",
17
+ VALUE: "value",
18
+ BINDING: "binding"
19
+ };
20
+
21
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/base-builder/guards.ts
22
+ function isFluentBuilder(value) {
23
+ if (value === null || typeof value !== "object") {
24
+ return false;
25
+ }
26
+ if (!(FLUENT_BUILDER_SYMBOL in value)) {
27
+ return false;
28
+ }
29
+ const obj = value;
30
+ return obj[FLUENT_BUILDER_SYMBOL] === true && typeof obj.build === "function";
31
+ }
32
+ function isBuilderArray(value) {
33
+ return Array.isArray(value) && value.every(isFluentBuilder);
34
+ }
35
+ function isPlainObject(value) {
36
+ if (!value || typeof value !== "object") return false;
37
+ const proto = Object.getPrototypeOf(value);
38
+ return proto === Object.prototype || proto === null;
39
+ }
40
+ function isAsset(value) {
41
+ if (!value || typeof value !== "object") return false;
42
+ const obj = value;
43
+ return "type" in obj && typeof obj.type === "string";
44
+ }
45
+ function isAssetWrapper(value) {
46
+ if (!value || typeof value !== "object") return false;
47
+ const obj = value;
48
+ return "asset" in obj && typeof obj.asset === "object" && obj.asset !== null;
49
+ }
50
+ function isAssetWrapperWithAsset(value) {
51
+ return isAssetWrapper(value) && isAsset(value.asset);
52
+ }
53
+ function isAssetWrapperValue(value) {
54
+ return typeof value === "object" && value !== null && "asset" in value && Object.keys(value).length === 1;
55
+ }
56
+ function needsAssetWrapper(value) {
57
+ if (isAssetWrapper(value)) return false;
58
+ if (isFluentBuilder(value)) return false;
59
+ return isAsset(value);
60
+ }
61
+ function isSwitchResult(value) {
62
+ if (typeof value !== "object" || value === null) {
63
+ return false;
64
+ }
65
+ const obj = value;
66
+ return "staticSwitch" in obj || "dynamicSwitch" in obj;
67
+ }
68
+ function isStringOrUndefined(value) {
69
+ return value === void 0 || typeof value === "string";
70
+ }
71
+
72
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/base-builder/id/registry.ts
73
+ var IDRegistry = class {
74
+ usedIds;
75
+ isEnabled;
76
+ constructor(enabled = true) {
77
+ this.usedIds = /* @__PURE__ */ new Set();
78
+ this.isEnabled = enabled;
79
+ }
80
+ /**
81
+ * Ensures the given ID is unique, modifying it if necessary.
82
+ * If the ID already exists, appends a numeric suffix (-1, -2, etc.)
83
+ * until a unique ID is found.
84
+ *
85
+ * Special handling for template placeholders:
86
+ * - IDs ending with `_index_`, `_row_`, etc. are allowed as duplicates
87
+ * - IDs with placeholders followed by segments (e.g., `_index_.field`) enforce uniqueness
88
+ *
89
+ * @param baseId - The desired ID
90
+ * @returns A unique ID (either the original or modified with suffix)
91
+ *
92
+ * @example
93
+ * ```typescript
94
+ * const registry = new IDRegistry();
95
+ * registry.ensureUnique("my-id"); // "my-id"
96
+ * registry.ensureUnique("my-id"); // "my-id-1"
97
+ * registry.ensureUnique("list-_index_"); // "list-_index_" (allowed duplicate)
98
+ * registry.ensureUnique("list-_index_"); // "list-_index_" (allowed duplicate)
99
+ * ```
100
+ */
101
+ ensureUnique(baseId) {
102
+ if (!this.isEnabled) {
103
+ return baseId;
104
+ }
105
+ if (this.isTemplatePlaceholderID(baseId)) {
106
+ return baseId;
107
+ }
108
+ if (!this.usedIds.has(baseId)) {
109
+ this.usedIds.add(baseId);
110
+ return baseId;
111
+ }
112
+ let counter = 1;
113
+ let uniqueId = `${baseId}-${counter}`;
114
+ while (this.usedIds.has(uniqueId)) {
115
+ counter++;
116
+ uniqueId = `${baseId}-${counter}`;
117
+ }
118
+ this.usedIds.add(uniqueId);
119
+ return uniqueId;
120
+ }
121
+ /**
122
+ * Checks if an ID has already been used.
123
+ *
124
+ * @param id - The ID to check
125
+ * @returns true if the ID has been used, false otherwise
126
+ */
127
+ has(id) {
128
+ return this.usedIds.has(id);
129
+ }
130
+ /**
131
+ * Clears all registered IDs from the registry.
132
+ * Useful for resetting state between test runs or separate flows.
133
+ */
134
+ reset() {
135
+ this.usedIds.clear();
136
+ }
137
+ /**
138
+ * Enables or disables the uniqueness checking.
139
+ * When disabled, all IDs pass through unchanged.
140
+ *
141
+ * @param enabled - Whether to enable uniqueness checking
142
+ */
143
+ setEnabled(enabled) {
144
+ this.isEnabled = enabled;
145
+ }
146
+ /**
147
+ * Returns the number of unique IDs currently registered.
148
+ *
149
+ * @returns The count of registered IDs
150
+ */
151
+ size() {
152
+ return this.usedIds.size;
153
+ }
154
+ /**
155
+ * Returns a snapshot of all registered IDs.
156
+ * Useful for debugging and testing.
157
+ *
158
+ * @returns An array of all registered IDs
159
+ */
160
+ getRegisteredIds() {
161
+ return Array.from(this.usedIds);
162
+ }
163
+ /**
164
+ * Checks if an ID contains template placeholders that should be exempt from uniqueness checks.
165
+ * Template placeholders are patterns like `_index_`, `_index1_`, `_row_` that are replaced at runtime.
166
+ *
167
+ * IDs ending with just a placeholder (e.g., "parent-_index_") are allowed as duplicates.
168
+ * IDs with placeholders followed by additional segments (e.g., "parent-_index_-field") are not.
169
+ *
170
+ * @param id - The ID to check
171
+ * @returns true if the ID should be exempt from uniqueness checks
172
+ */
173
+ isTemplatePlaceholderID(id) {
174
+ const templatePlaceholderPattern = /_(?:index|row|item)\d*_$/;
175
+ return templatePlaceholderPattern.test(id);
176
+ }
177
+ };
178
+ var globalIdRegistry = new IDRegistry();
179
+ function createIdRegistry(enabled = true) {
180
+ return new IDRegistry(enabled);
181
+ }
182
+
183
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/base-builder/id/generator.ts
184
+ var resetGlobalIdSet = () => {
185
+ globalIdRegistry.reset();
186
+ };
187
+ var _generateBaseId = (context, functionName) => {
188
+ if (!context) {
189
+ throw new Error(
190
+ `${functionName}: Context is undefined. Please provide a valid BaseBuildContext object.`
191
+ );
192
+ }
193
+ const { parentId, branch } = context;
194
+ let baseId;
195
+ if (!branch) {
196
+ baseId = parentId || "";
197
+ } else {
198
+ switch (branch.type) {
199
+ case "custom":
200
+ baseId = parentId || "";
201
+ break;
202
+ case "slot":
203
+ if (!branch.name) {
204
+ throw new Error(
205
+ `${functionName}: Slot branch requires a 'name' property. Context: ${JSON.stringify(context)}`
206
+ );
207
+ }
208
+ baseId = `${parentId ? `${parentId}-` : ""}${branch.name}`;
209
+ break;
210
+ case "array-item":
211
+ if (typeof branch.index !== "number") {
212
+ throw new Error(
213
+ `${functionName}: Array-item branch requires a numeric 'index' property. Got: ${typeof branch.index}. Context: ${JSON.stringify(context)}`
214
+ );
215
+ }
216
+ if (branch.index < 0) {
217
+ throw new Error(
218
+ `${functionName}: Array-item index must be non-negative. Got: ${branch.index}. Context: ${JSON.stringify(context)}`
219
+ );
220
+ }
221
+ baseId = `${parentId}-${branch.index}`;
222
+ break;
223
+ case "template":
224
+ if (branch.depth !== void 0 && branch.depth < 0) {
225
+ throw new Error(
226
+ `${functionName}: Template depth must be non-negative. Got: ${branch.depth}. Context: ${JSON.stringify(context)}`
227
+ );
228
+ }
229
+ baseId = `${parentId}-_index${branch.depth || ""}_`;
230
+ break;
231
+ case "switch":
232
+ if (typeof branch.index !== "number") {
233
+ throw new Error(
234
+ `${functionName}: Switch branch requires a numeric 'index' property. Got: ${typeof branch.index}. Context: ${JSON.stringify(context)}`
235
+ );
236
+ }
237
+ if (branch.index < 0) {
238
+ throw new Error(
239
+ `${functionName}: Switch index must be non-negative. Got: ${branch.index}. Context: ${JSON.stringify(context)}`
240
+ );
241
+ }
242
+ if (!branch.kind || !["static", "dynamic"].includes(branch.kind)) {
243
+ throw new Error(
244
+ `${functionName}: Switch branch requires 'kind' to be 'static' or 'dynamic'. Got: ${branch.kind}. Context: ${JSON.stringify(context)}`
245
+ );
246
+ }
247
+ baseId = `${parentId}-${branch.kind}Switch-${branch.index}`;
248
+ break;
249
+ default: {
250
+ const exhaustiveCheck = branch;
251
+ throw new Error(
252
+ `${functionName}: Unhandled branch type: ${JSON.stringify(exhaustiveCheck)}`
253
+ );
254
+ }
255
+ }
256
+ }
257
+ return baseId;
258
+ };
259
+ var peekId = (context) => {
260
+ return _generateBaseId(context, "peekId");
261
+ };
262
+ var genId = (context) => {
263
+ const baseId = _generateBaseId(context, "genId");
264
+ const { parentId, branch } = context;
265
+ if (process.env.NODE_ENV !== "production" && !parentId && !branch) {
266
+ console.warn(
267
+ "genId: Context appears incomplete (no parentId or branch). This may result in an empty or invalid ID. Consider using context helper functions from 'fluent/utils/context'."
268
+ );
269
+ }
270
+ if (process.env.NODE_ENV !== "production" && parentId === "") {
271
+ console.warn(
272
+ "genId: parentId is an empty string. This may indicate a missing or improperly initialized context."
273
+ );
274
+ }
275
+ const uniqueId = globalIdRegistry.ensureUnique(baseId);
276
+ if (process.env.NODE_ENV !== "production" && uniqueId !== baseId) {
277
+ console.warn(
278
+ `genId: ID collision detected. Original: "${baseId}", Modified to: "${uniqueId}". Consider providing more specific IDs to avoid collisions.`
279
+ );
280
+ }
281
+ return uniqueId;
282
+ };
283
+ function determineSlotName(parameterName, assetMetadata) {
284
+ if (!assetMetadata) {
285
+ return parameterName;
286
+ }
287
+ const { type, binding: binding2, value } = assetMetadata;
288
+ if (type === "action" && value) {
289
+ const cleanValue = value.replace(/^\{\{|\}\}$/g, "");
290
+ const segments = cleanValue.split(".");
291
+ const lastSegment = segments[segments.length - 1];
292
+ return lastSegment ? `${type}-${lastSegment}` : type;
293
+ }
294
+ if (type !== "action" && binding2) {
295
+ const cleanBinding = binding2.replace(/^\{\{|\}\}$/g, "");
296
+ const segments = cleanBinding.split(".");
297
+ const lastSegment = segments[segments.length - 1];
298
+ if (lastSegment) {
299
+ return `${type || parameterName}-${lastSegment}`;
300
+ }
301
+ }
302
+ return type || parameterName;
303
+ }
304
+ function generateAssetId(params) {
305
+ const {
306
+ context,
307
+ parameterName = "asset",
308
+ assetMetadata,
309
+ explicitId
310
+ } = params;
311
+ if (explicitId) {
312
+ return explicitId;
313
+ }
314
+ if (context && "parentId" in context) {
315
+ const slotName2 = determineSlotName(parameterName, assetMetadata);
316
+ if (context.branch) {
317
+ const baseId = genId(context);
318
+ return genId({
319
+ ...context,
320
+ parentId: baseId,
321
+ branch: { type: BranchTypes.SLOT, name: slotName2 }
322
+ });
323
+ }
324
+ if (context.parentId) {
325
+ return genId({
326
+ ...context,
327
+ branch: { type: BranchTypes.SLOT, name: slotName2 }
328
+ });
329
+ }
330
+ }
331
+ const slotName = determineSlotName(parameterName, assetMetadata);
332
+ return slotName;
333
+ }
334
+
335
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/base-builder/context.ts
336
+ function buildContextParams(parentContext, parameterName, index) {
337
+ const params = {
338
+ parentContext,
339
+ parameterName
340
+ };
341
+ if (index !== void 0) {
342
+ return { ...params, index };
343
+ }
344
+ return params;
345
+ }
346
+ function createNestedContext({
347
+ parentContext,
348
+ parameterName,
349
+ index,
350
+ assetMetadata
351
+ }) {
352
+ if (parentContext.nestedContextGenerator) {
353
+ const contextParams = buildContextParams(
354
+ parentContext,
355
+ parameterName,
356
+ index
357
+ );
358
+ const generated = parentContext.nestedContextGenerator(contextParams);
359
+ return generated;
360
+ }
361
+ const slotName = determineSlotName(parameterName, assetMetadata);
362
+ let generatedId;
363
+ let branch;
364
+ if (parentContext && "parentId" in parentContext) {
365
+ if (index !== void 0) {
366
+ generatedId = peekId({
367
+ parentId: parentContext.parentId,
368
+ branch: { type: BranchTypes.SLOT, name: slotName }
369
+ });
370
+ branch = { type: BranchTypes.ARRAY_ITEM, index };
371
+ } else {
372
+ generatedId = genId({
373
+ parentId: parentContext.parentId,
374
+ branch: { type: BranchTypes.SLOT, name: slotName }
375
+ });
376
+ }
377
+ }
378
+ const newContext = index !== void 0 ? {
379
+ ...parentContext,
380
+ parameterName,
381
+ index,
382
+ ...generatedId ? { parentId: generatedId } : {},
383
+ ...assetMetadata ? { assetMetadata } : {},
384
+ ...branch ? { branch } : {}
385
+ } : {
386
+ ...parentContext,
387
+ parameterName,
388
+ ...generatedId ? { parentId: generatedId } : {},
389
+ ...assetMetadata ? { assetMetadata } : {}
390
+ };
391
+ return newContext;
392
+ }
393
+ function createTemplateContext({
394
+ parentContext,
395
+ depth = 0
396
+ }) {
397
+ const parentId = genId(parentContext);
398
+ const templateContext = {
399
+ ...parentContext,
400
+ parentId,
401
+ branch: {
402
+ type: BranchTypes.TEMPLATE,
403
+ depth
404
+ }
405
+ };
406
+ return templateContext;
407
+ }
408
+ function createSwitchContext({
409
+ parentContext,
410
+ index,
411
+ kind
412
+ }) {
413
+ const switchContext = {
414
+ ...parentContext,
415
+ branch: {
416
+ type: BranchTypes.SWITCH,
417
+ index,
418
+ kind
419
+ }
420
+ };
421
+ return switchContext;
422
+ }
423
+
424
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/tagged-template/types.ts
425
+ var TaggedTemplateValueSymbol = Symbol(
426
+ "TaggedTemplateValue"
427
+ );
428
+ function isTaggedTemplateValue(value) {
429
+ return typeof value === "object" && value !== null && TaggedTemplateValueSymbol in value;
430
+ }
431
+
432
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/tagged-template/binding.ts
433
+ function binding(strings, ...expressions) {
434
+ let indexCounter = 0;
435
+ const processValue = (val) => {
436
+ if (!val.includes("_index_")) return val;
437
+ return val.replace(/_index_/g, () => {
438
+ const suffix = indexCounter > 0 ? indexCounter : "";
439
+ indexCounter++;
440
+ return `_index${suffix}_`;
441
+ });
442
+ };
443
+ let result = "";
444
+ const len = strings.length;
445
+ for (let i = 0; i < len; i++) {
446
+ result += processValue(strings[i]);
447
+ if (i < expressions.length) {
448
+ const expr = expressions[i];
449
+ if (isTaggedTemplateValue(expr)) {
450
+ const refStr = expr.toRefString();
451
+ if (refStr.startsWith("@[")) {
452
+ result += expr.toRefString({ nestedContext: "binding" });
453
+ } else {
454
+ result += expr.toString();
455
+ }
456
+ } else if (typeof expr === "string") {
457
+ result += processValue(expr);
458
+ } else {
459
+ result += String(expr);
460
+ }
461
+ }
462
+ }
463
+ const templateValue = {
464
+ [TaggedTemplateValueSymbol]: true,
465
+ _phantomType: void 0,
466
+ toValue() {
467
+ return result;
468
+ },
469
+ toRefString(options) {
470
+ if (options?.nestedContext === "binding") {
471
+ return result;
472
+ }
473
+ return `{{${result}}}`;
474
+ },
475
+ toString() {
476
+ return `{{${result}}}`;
477
+ }
478
+ };
479
+ return templateValue;
480
+ }
481
+
482
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/tagged-template/expression.ts
483
+ function expression(strings, ...expressions) {
484
+ const validateSyntax = (expr) => {
485
+ let openParens = 0;
486
+ let position = 0;
487
+ for (const char of expr) {
488
+ if (char === "(") openParens++;
489
+ if (char === ")") openParens--;
490
+ position++;
491
+ if (openParens < 0) {
492
+ throw new Error(
493
+ `Error: Unexpected ) at character ${position} in expression:
494
+ ${expr.slice(
495
+ 0,
496
+ position
497
+ )}\u2588${expr.slice(position)}`
498
+ );
499
+ }
500
+ }
501
+ if (openParens > 0) {
502
+ throw new Error(
503
+ `Error: Expected ) at character ${position} in expression:
504
+ ${expr}\u2588`
505
+ );
506
+ }
507
+ };
508
+ let result = "";
509
+ const len = strings.length;
510
+ for (let i = 0; i < len; i++) {
511
+ result += strings[i];
512
+ if (i < expressions.length) {
513
+ const expr = expressions[i];
514
+ if (isTaggedTemplateValue(expr)) {
515
+ result += expr.toRefString({ nestedContext: "expression" });
516
+ } else {
517
+ result += String(expr);
518
+ }
519
+ }
520
+ }
521
+ validateSyntax(result);
522
+ return {
523
+ [TaggedTemplateValueSymbol]: true,
524
+ toValue() {
525
+ return result;
526
+ },
527
+ toRefString(options) {
528
+ if (options?.nestedContext === "binding") {
529
+ return `\`${result}\``;
530
+ } else if (options?.nestedContext === "expression") {
531
+ return result;
532
+ }
533
+ return `@[${result}]@`;
534
+ },
535
+ toString() {
536
+ return `@[${result}]@`;
537
+ }
538
+ };
539
+ }
540
+
541
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/tagged-template/extract-bindings-from-schema.ts
542
+ function extractBindingsFromSchema(schema) {
543
+ const primitiveTypes = /* @__PURE__ */ new Set(["StringType", "NumberType", "BooleanType"]);
544
+ const isPrimitive = (typeName) => {
545
+ return primitiveTypes.has(typeName);
546
+ };
547
+ const createBinding = (typeName, path) => {
548
+ if (typeName === "StringType") {
549
+ return binding`${path}`;
550
+ }
551
+ if (typeName === "NumberType") {
552
+ return binding`${path}`;
553
+ }
554
+ if (typeName === "BooleanType") {
555
+ return binding`${path}`;
556
+ }
557
+ return binding`${path}`;
558
+ };
559
+ const processDataType = (dataType, schema2, path, visited = /* @__PURE__ */ new Set()) => {
560
+ const typeName = dataType.type;
561
+ if (visited.has(typeName)) {
562
+ return createBinding("StringType", path);
563
+ }
564
+ if ("isArray" in dataType && dataType.isArray) {
565
+ const arrayPath = path ? `${path}._current_` : "_current_";
566
+ if (isPrimitive(typeName)) {
567
+ if (typeName === "StringType") {
568
+ return { name: createBinding(typeName, arrayPath) };
569
+ } else {
570
+ return { value: createBinding(typeName, arrayPath) };
571
+ }
572
+ } else {
573
+ const typeNode2 = schema2[typeName];
574
+ if (typeNode2) {
575
+ const newVisited = new Set(visited);
576
+ newVisited.add(typeName);
577
+ return processNode(
578
+ typeNode2,
579
+ schema2,
580
+ arrayPath,
581
+ newVisited
582
+ );
583
+ }
584
+ return createBinding("StringType", arrayPath);
585
+ }
586
+ }
587
+ if ("isRecord" in dataType && dataType.isRecord) {
588
+ const typeNode2 = schema2[typeName];
589
+ if (typeNode2) {
590
+ const newVisited = new Set(visited);
591
+ newVisited.add(typeName);
592
+ return processNode(typeNode2, schema2, path, newVisited);
593
+ }
594
+ return createBinding("StringType", path);
595
+ }
596
+ if (isPrimitive(typeName)) {
597
+ return createBinding(typeName, path);
598
+ }
599
+ const typeNode = schema2[typeName];
600
+ if (typeNode) {
601
+ const newVisited = new Set(visited);
602
+ newVisited.add(typeName);
603
+ return processNode(typeNode, schema2, path, newVisited);
604
+ }
605
+ return createBinding("StringType", path);
606
+ };
607
+ const processNode = (node, schema2, basePath, visited = /* @__PURE__ */ new Set()) => {
608
+ const result = {};
609
+ Object.entries(node).forEach(([key, dataType]) => {
610
+ const path = basePath ? `${basePath}.${key}` : key;
611
+ result[key] = processDataType(dataType, schema2, path, visited);
612
+ });
613
+ return result;
614
+ };
615
+ return processNode(schema.ROOT, schema, "");
616
+ }
617
+
618
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/tagged-template/std.ts
619
+ function and(...args) {
620
+ const expressions = args.map((arg) => {
621
+ if (isTaggedTemplateValue(arg)) {
622
+ const expr = arg.toRefString({ nestedContext: "expression" });
623
+ if (expr.includes(" || ") && !expr.startsWith("(")) {
624
+ return `(${expr})`;
625
+ }
626
+ return expr;
627
+ }
628
+ return String(arg);
629
+ });
630
+ return expression`${expressions.join(" && ")}`;
631
+ }
632
+ function or(...args) {
633
+ const expressions = args.map((arg) => {
634
+ if (isTaggedTemplateValue(arg)) {
635
+ return arg.toRefString({ nestedContext: "expression" });
636
+ }
637
+ return String(arg);
638
+ });
639
+ return expression`${expressions.join(" || ")}`;
640
+ }
641
+ function not(value) {
642
+ const expr = isTaggedTemplateValue(value) ? value.toRefString({ nestedContext: "expression" }) : String(value);
643
+ return expression`!${expr}`;
644
+ }
645
+ function nor(...args) {
646
+ return not(or(...args));
647
+ }
648
+ function nand(...args) {
649
+ return not(and(...args));
650
+ }
651
+ function xor(left, right) {
652
+ const leftExpr = isTaggedTemplateValue(left) ? left.toRefString({ nestedContext: "expression" }) : String(left);
653
+ const rightExpr = isTaggedTemplateValue(right) ? right.toRefString({ nestedContext: "expression" }) : String(right);
654
+ return expression`(${leftExpr} && !${rightExpr}) || (!${leftExpr} && ${rightExpr})`;
655
+ }
656
+ function equal(left, right) {
657
+ const leftExpr = isTaggedTemplateValue(left) ? left.toRefString({ nestedContext: "expression" }) : JSON.stringify(left);
658
+ const rightExpr = isTaggedTemplateValue(right) ? right.toRefString({ nestedContext: "expression" }) : JSON.stringify(right);
659
+ return expression`${leftExpr} == ${rightExpr}`;
660
+ }
661
+ function strictEqual(left, right) {
662
+ const leftExpr = isTaggedTemplateValue(left) ? left.toRefString({ nestedContext: "expression" }) : JSON.stringify(left);
663
+ const rightExpr = isTaggedTemplateValue(right) ? right.toRefString({ nestedContext: "expression" }) : JSON.stringify(right);
664
+ return expression`${leftExpr} === ${rightExpr}`;
665
+ }
666
+ function notEqual(left, right) {
667
+ const leftExpr = isTaggedTemplateValue(left) ? left.toRefString({ nestedContext: "expression" }) : JSON.stringify(left);
668
+ const rightExpr = isTaggedTemplateValue(right) ? right.toRefString({ nestedContext: "expression" }) : JSON.stringify(right);
669
+ return expression`${leftExpr} != ${rightExpr}`;
670
+ }
671
+ function strictNotEqual(left, right) {
672
+ const leftExpr = isTaggedTemplateValue(left) ? left.toRefString({ nestedContext: "expression" }) : JSON.stringify(left);
673
+ const rightExpr = isTaggedTemplateValue(right) ? right.toRefString({ nestedContext: "expression" }) : JSON.stringify(right);
674
+ return expression`${leftExpr} !== ${rightExpr}`;
675
+ }
676
+ function greaterThan(left, right) {
677
+ const leftExpr = isTaggedTemplateValue(left) ? left.toRefString({ nestedContext: "expression" }) : JSON.stringify(left);
678
+ const rightExpr = isTaggedTemplateValue(right) ? right.toRefString({ nestedContext: "expression" }) : JSON.stringify(right);
679
+ return expression`${leftExpr} > ${rightExpr}`;
680
+ }
681
+ function greaterThanOrEqual(left, right) {
682
+ const leftExpr = isTaggedTemplateValue(left) ? left.toRefString({ nestedContext: "expression" }) : JSON.stringify(left);
683
+ const rightExpr = isTaggedTemplateValue(right) ? right.toRefString({ nestedContext: "expression" }) : JSON.stringify(right);
684
+ return expression`${leftExpr} >= ${rightExpr}`;
685
+ }
686
+ function lessThan(left, right) {
687
+ const leftExpr = isTaggedTemplateValue(left) ? left.toRefString({ nestedContext: "expression" }) : JSON.stringify(left);
688
+ const rightExpr = isTaggedTemplateValue(right) ? right.toRefString({ nestedContext: "expression" }) : JSON.stringify(right);
689
+ return expression`${leftExpr} < ${rightExpr}`;
690
+ }
691
+ function lessThanOrEqual(left, right) {
692
+ const leftExpr = isTaggedTemplateValue(left) ? left.toRefString({ nestedContext: "expression" }) : JSON.stringify(left);
693
+ const rightExpr = isTaggedTemplateValue(right) ? right.toRefString({ nestedContext: "expression" }) : JSON.stringify(right);
694
+ return expression`${leftExpr} <= ${rightExpr}`;
695
+ }
696
+ function add(...args) {
697
+ const expressions = args.map((arg) => {
698
+ if (isTaggedTemplateValue(arg)) {
699
+ return arg.toRefString({ nestedContext: "expression" });
700
+ }
701
+ return String(arg);
702
+ });
703
+ return expression`${expressions.join(" + ")}`;
704
+ }
705
+ function subtract(left, right) {
706
+ const leftExpr = isTaggedTemplateValue(left) ? left.toRefString({ nestedContext: "expression" }) : String(left);
707
+ const rightExpr = isTaggedTemplateValue(right) ? right.toRefString({ nestedContext: "expression" }) : String(right);
708
+ return expression`${leftExpr} - ${rightExpr}`;
709
+ }
710
+ function multiply(...args) {
711
+ const expressions = args.map((arg) => {
712
+ if (isTaggedTemplateValue(arg)) {
713
+ return arg.toRefString({ nestedContext: "expression" });
714
+ }
715
+ return String(arg);
716
+ });
717
+ return expression`${expressions.join(" * ")}`;
718
+ }
719
+ function divide(left, right) {
720
+ const leftExpr = isTaggedTemplateValue(left) ? left.toRefString({ nestedContext: "expression" }) : String(left);
721
+ const rightExpr = isTaggedTemplateValue(right) ? right.toRefString({ nestedContext: "expression" }) : String(right);
722
+ return expression`${leftExpr} / ${rightExpr}`;
723
+ }
724
+ function modulo(left, right) {
725
+ const leftExpr = isTaggedTemplateValue(left) ? left.toRefString({ nestedContext: "expression" }) : String(left);
726
+ const rightExpr = isTaggedTemplateValue(right) ? right.toRefString({ nestedContext: "expression" }) : String(right);
727
+ return expression`${leftExpr} % ${rightExpr}`;
728
+ }
729
+ function conditional(condition, ifTrue, ifFalse) {
730
+ const conditionExpr = isTaggedTemplateValue(condition) ? condition.toRefString({ nestedContext: "expression" }) : String(condition);
731
+ const trueExpr = isTaggedTemplateValue(ifTrue) ? ifTrue.toRefString({ nestedContext: "expression" }) : JSON.stringify(ifTrue);
732
+ const falseExpr = isTaggedTemplateValue(ifFalse) ? ifFalse.toRefString({ nestedContext: "expression" }) : JSON.stringify(ifFalse);
733
+ return expression`${conditionExpr} ? ${trueExpr} : ${falseExpr}`;
734
+ }
735
+ function call(functionName, ...args) {
736
+ const argExpressions = args.map((arg) => {
737
+ if (isTaggedTemplateValue(arg)) {
738
+ return arg.toRefString({
739
+ nestedContext: "expression"
740
+ });
741
+ }
742
+ return JSON.stringify(arg);
743
+ });
744
+ return expression`${functionName}(${argExpressions.join(", ")})`;
745
+ }
746
+ function literal(value) {
747
+ return expression`${JSON.stringify(value)}`;
748
+ }
749
+
750
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/base-builder/resolution/value-resolver.ts
751
+ function extractObject(value, options) {
752
+ const visited = options.visited ?? /* @__PURE__ */ new WeakSet();
753
+ if (visited.has(value)) {
754
+ return value;
755
+ }
756
+ visited.add(value);
757
+ const result = {};
758
+ for (const [key, val] of Object.entries(value)) {
759
+ result[key] = extractValue(val, { propertyKey: key, visited });
760
+ }
761
+ return result;
762
+ }
763
+ function extractValue(value, options = {}) {
764
+ const { propertyKey, visited = /* @__PURE__ */ new WeakSet() } = options;
765
+ if (isTaggedTemplateValue(value)) {
766
+ if (propertyKey === "data" || propertyKey === "binding") {
767
+ return value.toValue();
768
+ }
769
+ return value.toString();
770
+ }
771
+ if (Array.isArray(value)) {
772
+ if (visited.has(value)) {
773
+ return value;
774
+ }
775
+ visited.add(value);
776
+ return value.map((item) => extractValue(item, { visited }));
777
+ }
778
+ if (isPlainObject(value) && !isFluentBuilder(value) && !isAssetWrapper(value)) {
779
+ return extractObject(value, { visited });
780
+ }
781
+ return value;
782
+ }
783
+ function wrapAsset(asset, context, slotName) {
784
+ if (!context) {
785
+ return { asset };
786
+ }
787
+ if (asset.id) {
788
+ return { asset: { ...asset } };
789
+ }
790
+ const parentId = peekId(context);
791
+ const slotCtx = {
792
+ parentId,
793
+ branch: { type: BranchTypes.SLOT, name: slotName }
794
+ };
795
+ return {
796
+ asset: {
797
+ ...asset,
798
+ id: genId(slotCtx)
799
+ }
800
+ };
801
+ }
802
+ function resolveValue(value, options = {}) {
803
+ const { context, propertyName, visited = /* @__PURE__ */ new WeakSet() } = options;
804
+ if (isTaggedTemplateValue(value)) {
805
+ if (propertyName === "data" || propertyName === "binding") {
806
+ return value.toValue();
807
+ }
808
+ return value.toString();
809
+ }
810
+ if (value === null || value === void 0) {
811
+ return value;
812
+ }
813
+ if (isFluentBuilder(value)) {
814
+ return value.build(context);
815
+ }
816
+ if (isAssetWrapper(value)) {
817
+ if (visited.has(value)) return value;
818
+ visited.add(value);
819
+ const innerAsset = value.asset;
820
+ const resolvedAsset = resolveValue(innerAsset, {
821
+ context,
822
+ propertyName,
823
+ visited
824
+ });
825
+ return { asset: resolvedAsset };
826
+ }
827
+ if (Array.isArray(value)) {
828
+ if (visited.has(value)) return value;
829
+ visited.add(value);
830
+ return value.filter((item) => item !== null && item !== void 0).map((item, index) => {
831
+ const arrayContext = context ? createNestedContext({
832
+ parentContext: context,
833
+ parameterName: propertyName || "array",
834
+ index
835
+ }) : void 0;
836
+ return resolveValue(item, {
837
+ context: arrayContext,
838
+ propertyName: String(index),
839
+ visited
840
+ });
841
+ });
842
+ }
843
+ if (isPlainObject(value) && !isAsset(value)) {
844
+ if (visited.has(value)) return value;
845
+ visited.add(value);
846
+ const resolved = {};
847
+ for (const [key, val] of Object.entries(value)) {
848
+ const nestedContext = context ? createNestedContext({ parentContext: context, parameterName: key }) : void 0;
849
+ resolved[key] = resolveValue(val, {
850
+ context: nestedContext,
851
+ propertyName: key,
852
+ visited
853
+ });
854
+ }
855
+ return resolved;
856
+ }
857
+ return value;
858
+ }
859
+ function resolveAndWrapAsset(value, options) {
860
+ const { context, slotName, visited = /* @__PURE__ */ new WeakSet() } = options;
861
+ if (value === null || value === void 0) {
862
+ return value;
863
+ }
864
+ if (isAssetWrapper(value)) {
865
+ if (visited.has(value)) return value;
866
+ visited.add(value);
867
+ const resolvedAsset = resolveValue(value.asset, {
868
+ context,
869
+ propertyName: slotName,
870
+ visited
871
+ });
872
+ return { asset: resolvedAsset };
873
+ }
874
+ if (isFluentBuilder(value)) {
875
+ if (!context) {
876
+ const built2 = value.build(void 0);
877
+ if (isAssetWrapper(built2)) {
878
+ return built2;
879
+ }
880
+ if (isAsset(built2)) {
881
+ return { asset: built2 };
882
+ }
883
+ return built2;
884
+ }
885
+ const parentId = peekId(context);
886
+ const slotContext = {
887
+ ...context,
888
+ parentId,
889
+ branch: { type: BranchTypes.SLOT, name: slotName }
890
+ };
891
+ const built = value.build(slotContext);
892
+ if (isAssetWrapper(built)) {
893
+ return built;
894
+ }
895
+ if (isAsset(built)) {
896
+ return { asset: built };
897
+ }
898
+ return built;
899
+ }
900
+ if (isAsset(value)) {
901
+ return wrapAsset(value, context, slotName);
902
+ }
903
+ return resolveValue(value, { context, propertyName: slotName, visited });
904
+ }
905
+
906
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/base-builder/storage/value-storage.ts
907
+ var ValueStorage = class _ValueStorage {
908
+ values = {};
909
+ builders = /* @__PURE__ */ new Map();
910
+ mixedArrays = /* @__PURE__ */ new Map();
911
+ constructor(initial) {
912
+ if (initial) {
913
+ Object.entries(initial).forEach(([key, value]) => {
914
+ this.set(key, value);
915
+ });
916
+ }
917
+ }
918
+ /**
919
+ * Sets a property value, intelligently routing it to the appropriate storage
920
+ *
921
+ * This method performs runtime type checking to determine how to store the value:
922
+ * - FluentBuilder instances → builders Map
923
+ * - Arrays with builders → mixedArrays Map
924
+ * - Objects with builders → builders Map
925
+ * - Everything else → values (static storage)
926
+ */
927
+ set(key, value) {
928
+ const keyStr = String(key);
929
+ if (isFluentBuilder(value)) {
930
+ this.builders.set(keyStr, value);
931
+ delete this.values[key];
932
+ this.mixedArrays.delete(keyStr);
933
+ } else if (Array.isArray(value)) {
934
+ this.handleArrayValue(key, keyStr, value);
935
+ } else if (typeof value === "object" && value !== null && this.containsBuilder(value)) {
936
+ this.builders.set(keyStr, value);
937
+ delete this.values[key];
938
+ this.mixedArrays.delete(keyStr);
939
+ } else {
940
+ this.setStaticValue(key, keyStr, value);
941
+ }
942
+ }
943
+ /**
944
+ * Handles array value storage, detecting mixed arrays with builders
945
+ */
946
+ handleArrayValue(key, keyStr, value) {
947
+ const builderIndices = /* @__PURE__ */ new Set();
948
+ const objectIndices = /* @__PURE__ */ new Set();
949
+ value.forEach((item, index) => {
950
+ if (isFluentBuilder(item)) {
951
+ builderIndices.add(index);
952
+ } else if (typeof item === "object" && item !== null && this.containsBuilder(item)) {
953
+ objectIndices.add(index);
954
+ }
955
+ });
956
+ const hasBuilders = builderIndices.size > 0 || objectIndices.size > 0;
957
+ if (hasBuilders) {
958
+ this.mixedArrays.set(keyStr, {
959
+ array: value,
960
+ builderIndices,
961
+ objectIndices
962
+ });
963
+ delete this.values[key];
964
+ } else {
965
+ this.setStaticValue(key, keyStr, value);
966
+ this.mixedArrays.delete(keyStr);
967
+ }
968
+ this.builders.delete(keyStr);
969
+ }
970
+ /**
971
+ * Sets a static value with proper type handling
972
+ */
973
+ setStaticValue(key, keyStr, value) {
974
+ this.values[key] = value;
975
+ this.builders.delete(keyStr);
976
+ this.mixedArrays.delete(keyStr);
977
+ }
978
+ /**
979
+ * Checks if an object contains any builders recursively
980
+ * Handles circular references gracefully
981
+ */
982
+ containsBuilder(obj, visited = /* @__PURE__ */ new WeakSet()) {
983
+ if (isFluentBuilder(obj)) return true;
984
+ if (!obj || typeof obj !== "object") return false;
985
+ if (visited.has(obj)) return false;
986
+ visited.add(obj);
987
+ if (Array.isArray(obj)) {
988
+ return obj.some((item) => this.containsBuilder(item, visited));
989
+ }
990
+ const proto = Object.getPrototypeOf(obj);
991
+ if (proto === Object.prototype || proto === null) {
992
+ return Object.values(obj).some(
993
+ (val) => this.containsBuilder(val, visited)
994
+ );
995
+ }
996
+ return false;
997
+ }
998
+ /**
999
+ * Checks if a property has been set
1000
+ */
1001
+ has(key) {
1002
+ const keyStr = String(key);
1003
+ return key in this.values || this.builders.has(keyStr) || this.mixedArrays.has(keyStr);
1004
+ }
1005
+ /**
1006
+ * Peeks at a property value without resolving builders
1007
+ * Returns the raw value if it's static, the array if it's mixed, or undefined if it's a builder
1008
+ */
1009
+ peek(key) {
1010
+ const keyStr = String(key);
1011
+ const mixedArray = this.mixedArrays.get(keyStr);
1012
+ if (mixedArray) {
1013
+ return mixedArray.array;
1014
+ }
1015
+ if (this.builders.has(keyStr)) {
1016
+ return void 0;
1017
+ }
1018
+ return this.values[key];
1019
+ }
1020
+ /**
1021
+ * Gets builder for a property if one is set
1022
+ */
1023
+ peekBuilder(key) {
1024
+ const keyStr = String(key);
1025
+ const entry = this.builders.get(keyStr);
1026
+ if (!entry) return void 0;
1027
+ if (isFluentBuilder(entry)) {
1028
+ return entry;
1029
+ }
1030
+ return void 0;
1031
+ }
1032
+ /**
1033
+ * Gets the type of value stored for a property
1034
+ */
1035
+ getValueType(key) {
1036
+ const keyStr = String(key);
1037
+ if (this.mixedArrays.has(keyStr)) {
1038
+ return "mixed-array";
1039
+ }
1040
+ if (this.builders.has(keyStr)) {
1041
+ return "builder";
1042
+ }
1043
+ if (key in this.values) {
1044
+ return "static";
1045
+ }
1046
+ return "unset";
1047
+ }
1048
+ /**
1049
+ * Gets all static values for the build pipeline
1050
+ */
1051
+ getValues() {
1052
+ return this.values;
1053
+ }
1054
+ /**
1055
+ * Gets all builder entries for the build pipeline
1056
+ */
1057
+ getBuilders() {
1058
+ return this.builders;
1059
+ }
1060
+ /**
1061
+ * Gets all mixed array entries for the build pipeline
1062
+ */
1063
+ getMixedArrays() {
1064
+ return this.mixedArrays;
1065
+ }
1066
+ /**
1067
+ * Unsets a property, removing it from storage
1068
+ */
1069
+ unset(key) {
1070
+ const keyStr = String(key);
1071
+ delete this.values[key];
1072
+ this.builders.delete(keyStr);
1073
+ this.mixedArrays.delete(keyStr);
1074
+ }
1075
+ /**
1076
+ * Clears all properties from storage
1077
+ */
1078
+ clear() {
1079
+ this.values = {};
1080
+ this.builders.clear();
1081
+ this.mixedArrays.clear();
1082
+ }
1083
+ /**
1084
+ * Clones the storage, creating an independent copy
1085
+ */
1086
+ clone() {
1087
+ const cloned = new _ValueStorage();
1088
+ cloned.values = { ...this.values };
1089
+ cloned.builders = new Map(this.builders);
1090
+ cloned.mixedArrays = new Map(
1091
+ Array.from(this.mixedArrays.entries()).map(([key, metadata]) => [
1092
+ key,
1093
+ {
1094
+ array: metadata.array,
1095
+ builderIndices: new Set(metadata.builderIndices),
1096
+ objectIndices: new Set(metadata.objectIndices)
1097
+ }
1098
+ ])
1099
+ );
1100
+ return cloned;
1101
+ }
1102
+ };
1103
+
1104
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/base-builder/storage/auxiliary-storage.ts
1105
+ var AuxiliaryStorage = class _AuxiliaryStorage {
1106
+ data = /* @__PURE__ */ new Map();
1107
+ /**
1108
+ * Sets auxiliary data with a given key
1109
+ */
1110
+ set(key, value) {
1111
+ this.data.set(key, value);
1112
+ }
1113
+ /**
1114
+ * Gets auxiliary data with type assertion
1115
+ * The caller is responsible for knowing the correct type
1116
+ */
1117
+ get(key) {
1118
+ const value = this.data.get(key);
1119
+ return value;
1120
+ }
1121
+ /**
1122
+ * Pushes an item to an auxiliary data array
1123
+ * Creates the array if it doesn't exist
1124
+ */
1125
+ push(key, item) {
1126
+ const existing = this.data.get(key);
1127
+ if (Array.isArray(existing)) {
1128
+ existing.push(item);
1129
+ } else {
1130
+ this.data.set(key, [item]);
1131
+ }
1132
+ }
1133
+ /**
1134
+ * Gets an auxiliary data array
1135
+ * Returns empty array if doesn't exist or isn't an array
1136
+ */
1137
+ getArray(key) {
1138
+ const existing = this.data.get(key);
1139
+ return Array.isArray(existing) ? existing : [];
1140
+ }
1141
+ /**
1142
+ * Checks if auxiliary data exists for a key
1143
+ */
1144
+ has(key) {
1145
+ return this.data.has(key);
1146
+ }
1147
+ /**
1148
+ * Deletes auxiliary data for a key
1149
+ */
1150
+ delete(key) {
1151
+ return this.data.delete(key);
1152
+ }
1153
+ /**
1154
+ * Clears all auxiliary data
1155
+ */
1156
+ clear() {
1157
+ this.data.clear();
1158
+ }
1159
+ /**
1160
+ * Clones the auxiliary storage, creating an independent copy
1161
+ */
1162
+ clone() {
1163
+ const cloned = new _AuxiliaryStorage();
1164
+ cloned.data = new Map(this.data);
1165
+ return cloned;
1166
+ }
1167
+ };
1168
+
1169
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/base-builder/resolution/steps/static-values.ts
1170
+ function resolveStaticValues(storage, result, context) {
1171
+ const values = storage.getValues();
1172
+ for (const [key, value] of Object.entries(values)) {
1173
+ if (!isAssetWrapperValue(value)) {
1174
+ const extracted = extractValue(value, { propertyKey: key });
1175
+ result[key] = resolveValue(extracted, { context, propertyName: key });
1176
+ } else {
1177
+ result[key] = value;
1178
+ }
1179
+ }
1180
+ }
1181
+
1182
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/base-builder/resolution/steps/asset-id.ts
1183
+ function generateAssetIdForBuilder(storage, result, context) {
1184
+ const hasIdSet = storage.has("id");
1185
+ const hasType = storage.has("type") || "type" in result;
1186
+ const hasIdField = "id" in result;
1187
+ if (!hasIdSet && hasType) {
1188
+ const typeValue = result.type;
1189
+ const assetValue = result.value;
1190
+ const assetBinding = result.binding;
1191
+ if (!isStringOrUndefined(typeValue)) {
1192
+ return;
1193
+ }
1194
+ if (!isStringOrUndefined(assetValue)) {
1195
+ return;
1196
+ }
1197
+ if (!isStringOrUndefined(assetBinding)) {
1198
+ return;
1199
+ }
1200
+ const assetMetadata = {
1201
+ type: typeValue,
1202
+ ...assetValue ? { value: assetValue } : {},
1203
+ ...assetBinding ? { binding: assetBinding } : {}
1204
+ };
1205
+ const generatedId = generateAssetId({
1206
+ context,
1207
+ parameterName: typeValue,
1208
+ assetMetadata,
1209
+ explicitId: void 0
1210
+ });
1211
+ if (generatedId) {
1212
+ result.id = generatedId;
1213
+ }
1214
+ } else if (!hasIdSet && hasIdField && !hasType && context && context.branch) {
1215
+ const generatedId = generateAssetId({
1216
+ context,
1217
+ parameterName: "item",
1218
+ assetMetadata: void 0,
1219
+ explicitId: void 0
1220
+ });
1221
+ if (generatedId) {
1222
+ result.id = generatedId;
1223
+ }
1224
+ }
1225
+ }
1226
+
1227
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/base-builder/resolution/steps/asset-wrappers.ts
1228
+ function resolveAssetWrappers(storage, result, nestedParentContext) {
1229
+ if (!nestedParentContext) {
1230
+ return;
1231
+ }
1232
+ const values = storage.getValues();
1233
+ for (const key of Object.keys(values)) {
1234
+ const value = values[key];
1235
+ if (isAssetWrapperValue(value)) {
1236
+ const unwrapped = value.asset;
1237
+ if (Array.isArray(unwrapped)) {
1238
+ result[key] = resolveAssetWrapperArray(
1239
+ unwrapped,
1240
+ nestedParentContext,
1241
+ key
1242
+ );
1243
+ } else {
1244
+ result[key] = resolveAndWrapAsset(unwrapped, {
1245
+ context: nestedParentContext,
1246
+ slotName: key
1247
+ });
1248
+ }
1249
+ }
1250
+ }
1251
+ }
1252
+ function resolveAssetWrapperArray(array, context, key) {
1253
+ return array.filter((item) => item !== null && item !== void 0).map((item, index) => {
1254
+ const slotName = `${key}-${index}`;
1255
+ return resolveAndWrapAsset(item, { context, slotName });
1256
+ });
1257
+ }
1258
+
1259
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/base-builder/resolution/steps/mixed-arrays.ts
1260
+ function resolveMixedArrays(storage, result, nestedParentContext) {
1261
+ const mixedArrays = storage.getMixedArrays();
1262
+ mixedArrays.forEach((metadata, key) => {
1263
+ const { array, builderIndices, objectIndices } = metadata;
1264
+ const currentValue = result[key];
1265
+ if (isAssetWrapperValue(currentValue)) {
1266
+ resolveMixedArrayAsAssetWrapper(
1267
+ result,
1268
+ key,
1269
+ currentValue,
1270
+ nestedParentContext
1271
+ );
1272
+ } else {
1273
+ resolveMixedArrayNormal(
1274
+ result,
1275
+ key,
1276
+ array,
1277
+ builderIndices,
1278
+ objectIndices,
1279
+ nestedParentContext
1280
+ );
1281
+ }
1282
+ });
1283
+ }
1284
+ function resolveMixedArrayAsAssetWrapper(result, key, wrapperValue, nestedParentContext) {
1285
+ const unwrappedArray = wrapperValue.asset;
1286
+ if (Array.isArray(unwrappedArray)) {
1287
+ result[key] = unwrappedArray.filter((item) => item !== null && item !== void 0).map((item, index) => {
1288
+ const slotName = `${key}-${index}`;
1289
+ return resolveAndWrapAsset(item, {
1290
+ context: nestedParentContext,
1291
+ slotName
1292
+ });
1293
+ });
1294
+ }
1295
+ }
1296
+ function resolveMixedArrayNormal(result, key, array, builderIndices, objectIndices, nestedParentContext) {
1297
+ result[key] = array.filter((item) => item !== null && item !== void 0).map((item, index) => {
1298
+ const slotName = `${key}-${index}`;
1299
+ return resolveAndWrapAsset(item, {
1300
+ context: nestedParentContext,
1301
+ slotName
1302
+ });
1303
+ });
1304
+ }
1305
+
1306
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/base-builder/resolution/steps/builders.ts
1307
+ function resolveBuilders(storage, result, nestedParentContext) {
1308
+ const builders = storage.getBuilders();
1309
+ builders.forEach((value, key) => {
1310
+ if (isAssetWrapperValue(value)) {
1311
+ resolveBuilderAsAssetWrapper(result, key, value, nestedParentContext);
1312
+ } else {
1313
+ resolveBuilderNormal(result, key, value, nestedParentContext);
1314
+ }
1315
+ });
1316
+ }
1317
+ function resolveBuilderAsAssetWrapper(result, key, wrapperValue, nestedParentContext) {
1318
+ const unwrapped = wrapperValue.asset;
1319
+ if (nestedParentContext) {
1320
+ if (Array.isArray(unwrapped)) {
1321
+ result[key] = unwrapped.filter((item) => item !== null && item !== void 0).map((item, index) => {
1322
+ const slotName = `${key}-${index}`;
1323
+ return resolveAndWrapAsset(item, {
1324
+ context: nestedParentContext,
1325
+ slotName
1326
+ });
1327
+ });
1328
+ } else {
1329
+ result[key] = resolveAndWrapAsset(unwrapped, {
1330
+ context: nestedParentContext,
1331
+ slotName: key
1332
+ });
1333
+ }
1334
+ } else {
1335
+ result[key] = resolveValue(wrapperValue, {});
1336
+ }
1337
+ }
1338
+ function resolveBuilderNormal(result, key, value, nestedParentContext) {
1339
+ result[key] = resolveAndWrapAsset(value, {
1340
+ context: nestedParentContext,
1341
+ slotName: key
1342
+ });
1343
+ }
1344
+
1345
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/base-builder/resolution/path-resolver.ts
1346
+ function asRecordOrEmpty(value) {
1347
+ return isPlainObject(value) ? value : {};
1348
+ }
1349
+ function setValueAtPath(obj, path, value) {
1350
+ if (path.length === 0) return;
1351
+ if (path.length === 1) {
1352
+ obj[path[0]] = value;
1353
+ return;
1354
+ }
1355
+ const [currentKey, ...restPath] = path;
1356
+ const nextKey = restPath[0];
1357
+ const currentValue = obj[currentKey];
1358
+ const isAssetWrapperWithArray = isAssetWrapperValue(currentValue) && Array.isArray(currentValue.asset);
1359
+ if (isAssetWrapperWithArray && typeof nextKey === "number") {
1360
+ setValueInAssetWrapperArray(
1361
+ obj,
1362
+ currentKey,
1363
+ currentValue,
1364
+ nextKey,
1365
+ restPath,
1366
+ value
1367
+ );
1368
+ } else if (Array.isArray(currentValue) && typeof nextKey === "number") {
1369
+ setValueInArray(obj, currentKey, currentValue, nextKey, restPath, value);
1370
+ } else {
1371
+ setValueInObject(obj, currentKey, restPath, value);
1372
+ }
1373
+ }
1374
+ function setValueInAssetWrapperArray(obj, currentKey, wrappedArray, nextKey, restPath, value) {
1375
+ const arrayResult = [...wrappedArray.asset];
1376
+ if (restPath.length === 1) {
1377
+ arrayResult[nextKey] = value;
1378
+ } else {
1379
+ const nestedObj = asRecordOrEmpty(arrayResult[nextKey]);
1380
+ setValueAtPath(nestedObj, restPath.slice(1), value);
1381
+ arrayResult[nextKey] = nestedObj;
1382
+ }
1383
+ obj[currentKey] = { asset: arrayResult };
1384
+ }
1385
+ function setValueInArray(obj, currentKey, array, nextKey, restPath, value) {
1386
+ const arrayResult = [...array];
1387
+ if (restPath.length === 1) {
1388
+ arrayResult[nextKey] = value;
1389
+ } else {
1390
+ const nestedObj = asRecordOrEmpty(arrayResult[nextKey]);
1391
+ setValueAtPath(nestedObj, restPath.slice(1), value);
1392
+ arrayResult[nextKey] = nestedObj;
1393
+ }
1394
+ obj[currentKey] = arrayResult;
1395
+ }
1396
+ function setValueInObject(obj, currentKey, restPath, value) {
1397
+ const nestedObj = asRecordOrEmpty(obj[currentKey]);
1398
+ setValueAtPath(nestedObj, restPath, value);
1399
+ obj[currentKey] = nestedObj;
1400
+ }
1401
+
1402
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/base-builder/resolution/steps/switches.ts
1403
+ function resolveSwitches(auxiliaryStorage, result, nestedParentContext, arrayProperties) {
1404
+ const switches = auxiliaryStorage.getArray(
1405
+ StorageKeys.SWITCHES
1406
+ );
1407
+ if (switches.length === 0 || !nestedParentContext) {
1408
+ return;
1409
+ }
1410
+ let globalCaseIndex = 0;
1411
+ switches.forEach(({ path, switchFn }) => {
1412
+ const propertyName = String(path[0]);
1413
+ const switchParentId = nestedParentContext.parentId ? `${nestedParentContext.parentId}-${propertyName}` : propertyName;
1414
+ const switchContext = {
1415
+ ...nestedParentContext,
1416
+ parentId: switchParentId,
1417
+ branch: void 0
1418
+ };
1419
+ let switchResult = switchFn(switchContext, globalCaseIndex);
1420
+ if (isSwitchResult(switchResult)) {
1421
+ const switchCases = switchResult.staticSwitch ?? switchResult.dynamicSwitch;
1422
+ if (Array.isArray(switchCases)) {
1423
+ globalCaseIndex += switchCases.length;
1424
+ }
1425
+ }
1426
+ if (arrayProperties.has(propertyName) && path.length === 1) {
1427
+ switchResult = [switchResult];
1428
+ }
1429
+ setValueAtPath(result, path, switchResult);
1430
+ });
1431
+ }
1432
+
1433
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/base-builder/resolution/steps/templates.ts
1434
+ function resolveTemplates(auxiliaryStorage, result, context) {
1435
+ const templateFns = auxiliaryStorage.getArray(StorageKeys.TEMPLATES);
1436
+ if (templateFns.length === 0) {
1437
+ return;
1438
+ }
1439
+ if (!context) {
1440
+ if (process.env.NODE_ENV !== "production") {
1441
+ console.warn(
1442
+ `resolveTemplates: ${templateFns.length} template(s) exist but no context provided. Templates will be ignored. Pass a build context to .build() to enable template resolution.`
1443
+ );
1444
+ }
1445
+ return;
1446
+ }
1447
+ const templates = templateFns.map((fn) => fn(context));
1448
+ result.template = templates;
1449
+ }
1450
+
1451
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/base-builder/resolution/steps/nested-asset-wrappers.ts
1452
+ function resolveNestedAssetWrappers(result, context, assetWrapperPaths) {
1453
+ if (assetWrapperPaths.length === 0) {
1454
+ return;
1455
+ }
1456
+ for (const path of assetWrapperPaths) {
1457
+ if (path.length === 0) {
1458
+ continue;
1459
+ }
1460
+ if (path.length < 2) {
1461
+ continue;
1462
+ }
1463
+ resolvePathInResult(result, path, context);
1464
+ }
1465
+ }
1466
+ function resolvePathInResult(result, path, context) {
1467
+ let current = result;
1468
+ for (let i = 0; i < path.length - 1; i++) {
1469
+ const key = path[i];
1470
+ if (!isPlainObject(current)) {
1471
+ return;
1472
+ }
1473
+ let next = current[key];
1474
+ if (next === void 0 || next === null) {
1475
+ return;
1476
+ }
1477
+ if (isFluentBuilder(next)) {
1478
+ next = resolveValue(next, { context, propertyName: key });
1479
+ current[key] = next;
1480
+ }
1481
+ current = next;
1482
+ }
1483
+ const finalKey = path[path.length - 1];
1484
+ if (!isPlainObject(current)) {
1485
+ return;
1486
+ }
1487
+ const parent = current;
1488
+ const value = parent[finalKey];
1489
+ if (value === void 0 || value === null) {
1490
+ return;
1491
+ }
1492
+ if (isAssetWrapper(value)) {
1493
+ return;
1494
+ }
1495
+ const slotName = path.join("-");
1496
+ if (Array.isArray(value)) {
1497
+ parent[finalKey] = value.filter((item) => item !== null && item !== void 0).map((item, index) => {
1498
+ if (isAssetWrapper(item)) {
1499
+ return item;
1500
+ }
1501
+ return resolveAndWrapAsset(item, {
1502
+ context,
1503
+ slotName: `${slotName}-${index}`
1504
+ });
1505
+ });
1506
+ return;
1507
+ }
1508
+ if (isFluentBuilder(value) || isAsset(value)) {
1509
+ parent[finalKey] = resolveAndWrapAsset(value, {
1510
+ context,
1511
+ slotName
1512
+ });
1513
+ }
1514
+ }
1515
+
1516
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/base-builder/resolution/pipeline.ts
1517
+ function createNestedParentContext(result, context) {
1518
+ if (!context) {
1519
+ return void 0;
1520
+ }
1521
+ const parentId = "id" in result && typeof result.id === "string" ? result.id : void 0;
1522
+ return {
1523
+ ...context,
1524
+ parentId,
1525
+ branch: void 0
1526
+ };
1527
+ }
1528
+ function executeBuildPipeline(valueStorage, auxiliaryStorage, defaults, context, arrayProperties, assetWrapperPaths = []) {
1529
+ const result = defaults ? { ...defaults } : {};
1530
+ resolveStaticValues(valueStorage, result, context);
1531
+ generateAssetIdForBuilder(valueStorage, result, context);
1532
+ const nestedParentContext = createNestedParentContext(result, context);
1533
+ resolveAssetWrappers(valueStorage, result, nestedParentContext);
1534
+ resolveMixedArrays(valueStorage, result, nestedParentContext);
1535
+ resolveBuilders(valueStorage, result, nestedParentContext);
1536
+ resolveNestedAssetWrappers(result, nestedParentContext, assetWrapperPaths);
1537
+ resolveSwitches(
1538
+ auxiliaryStorage,
1539
+ result,
1540
+ nestedParentContext,
1541
+ arrayProperties
1542
+ );
1543
+ resolveTemplates(auxiliaryStorage, result, context);
1544
+ return result;
1545
+ }
1546
+
1547
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/base-builder/conditional/index.ts
1548
+ function resolveValueOrFunction(value) {
1549
+ if (typeof value === "function" && !isFluentBuilder(value)) {
1550
+ return value();
1551
+ }
1552
+ return value;
1553
+ }
1554
+ function shouldWrapInAssetWrapper(value) {
1555
+ if (isAssetWrapperValue(value)) {
1556
+ return false;
1557
+ }
1558
+ if (isFluentBuilder(value)) {
1559
+ return true;
1560
+ }
1561
+ if (isAsset(value)) {
1562
+ return true;
1563
+ }
1564
+ if (Array.isArray(value) && value.length > 0) {
1565
+ const firstItem = value[0];
1566
+ return isFluentBuilder(firstItem) || isAsset(firstItem);
1567
+ }
1568
+ return false;
1569
+ }
1570
+ function maybeWrapAsset(value) {
1571
+ if (shouldWrapInAssetWrapper(value)) {
1572
+ return { asset: value };
1573
+ }
1574
+ return value;
1575
+ }
1576
+
1577
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/switch/index.ts
1578
+ function processCaseExpression(exp) {
1579
+ if (typeof exp === "boolean") {
1580
+ return exp;
1581
+ }
1582
+ if (isTaggedTemplateValue(exp)) {
1583
+ return exp.toString();
1584
+ }
1585
+ return String(exp);
1586
+ }
1587
+ var switch_ = ({
1588
+ cases,
1589
+ isDynamic = false
1590
+ }) => (ctx, caseOffset = 0) => {
1591
+ const switchType = isDynamic ? "dynamic" : "static";
1592
+ return {
1593
+ [`${switchType}Switch`]: cases.map((c, index) => {
1594
+ const caseParentCtx = {
1595
+ ...ctx,
1596
+ parentId: ctx.parentId,
1597
+ branch: {
1598
+ type: BranchTypes.SWITCH,
1599
+ kind: switchType,
1600
+ index: caseOffset + index
1601
+ }
1602
+ };
1603
+ const asset = isFluentBuilder(c.asset) && "build" in c.asset ? c.asset.build(caseParentCtx) : c.asset;
1604
+ return {
1605
+ case: processCaseExpression(c.case),
1606
+ asset: {
1607
+ ...asset,
1608
+ id: asset.id ?? genId(caseParentCtx)
1609
+ }
1610
+ };
1611
+ })
1612
+ };
1613
+ };
1614
+
1615
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/base-builder/fluent-builder-base.ts
1616
+ var FluentBuilderBase = class {
1617
+ [FLUENT_BUILDER_SYMBOL] = true;
1618
+ valueStorage;
1619
+ auxiliaryStorage;
1620
+ context;
1621
+ /**
1622
+ * Creates a new builder instance
1623
+ * @param initial - Optional initial values (accepts FluentPartial for TaggedTemplateValue support)
1624
+ */
1625
+ constructor(initial) {
1626
+ this.valueStorage = new ValueStorage(initial);
1627
+ this.auxiliaryStorage = new AuxiliaryStorage();
1628
+ }
1629
+ /**
1630
+ * Accessor for generated builders to access values
1631
+ * This maintains backward compatibility with generated code
1632
+ */
1633
+ get values() {
1634
+ return this.valueStorage.getValues();
1635
+ }
1636
+ /**
1637
+ * Setter for generated builders to set values in bulk
1638
+ * Used by withAdditionalProperties() in generated builders
1639
+ */
1640
+ set values(newValues) {
1641
+ Object.entries(newValues).forEach(([key, value]) => {
1642
+ this.valueStorage.set(key, value);
1643
+ });
1644
+ }
1645
+ /**
1646
+ * Sets additional properties in bulk that may not be defined in the type schema
1647
+ * Useful for extensibility and forward compatibility
1648
+ */
1649
+ withAdditionalProperties(values) {
1650
+ this.values = values;
1651
+ return this;
1652
+ }
1653
+ /**
1654
+ * Sets a property value, intelligently routing it to the appropriate storage
1655
+ * @param key - The property key to set
1656
+ * @param value - The value to set
1657
+ * @returns This builder instance for chaining
1658
+ */
1659
+ set(key, value) {
1660
+ this.valueStorage.set(key, value);
1661
+ return this;
1662
+ }
1663
+ /**
1664
+ * Builds the final object with defaults and nested builder resolution
1665
+ * Executes the complete 8-step build pipeline
1666
+ *
1667
+ * @param defaults - Optional default values
1668
+ * @param context - Optional build context
1669
+ */
1670
+ buildWithDefaults(defaults, context) {
1671
+ const arrayProperties = this.getArrayPropertiesMetadata();
1672
+ const assetWrapperPaths = this.getAssetWrapperPathsMetadata();
1673
+ return executeBuildPipeline(
1674
+ this.valueStorage,
1675
+ this.auxiliaryStorage,
1676
+ defaults,
1677
+ context,
1678
+ arrayProperties,
1679
+ assetWrapperPaths
1680
+ );
1681
+ }
1682
+ /**
1683
+ * Gets array property metadata from the builder class
1684
+ * Generated builders include a static __arrayProperties__ set
1685
+ */
1686
+ getArrayPropertiesMetadata() {
1687
+ const constructor = this.constructor;
1688
+ return constructor.__arrayProperties__ ?? /* @__PURE__ */ new Set();
1689
+ }
1690
+ /**
1691
+ * Gets asset wrapper paths metadata from the builder class.
1692
+ * Generated builders include a static __assetWrapperPaths__ array of paths.
1693
+ * Each path is an array of property names leading to an AssetWrapper.
1694
+ */
1695
+ getAssetWrapperPathsMetadata() {
1696
+ const constructor = this.constructor;
1697
+ return constructor.__assetWrapperPaths__ ?? [];
1698
+ }
1699
+ /**
1700
+ * Conditionally sets a property based on a predicate
1701
+ *
1702
+ * Accepts unwrapped Asset builders and automatically wraps them in AssetWrapper format.
1703
+ *
1704
+ * @param predicate - Function to determine if the property should be set
1705
+ * @param property - The property key
1706
+ * @param value - The value, builder, or function returning either
1707
+ *
1708
+ * @example
1709
+ * action()
1710
+ * .if(() => showLabel, "label", text().withValue("Submit"))
1711
+ */
1712
+ if(predicate, property, value) {
1713
+ if (predicate(this)) {
1714
+ const resolved = resolveValueOrFunction(value);
1715
+ const wrapped = maybeWrapAsset(resolved);
1716
+ this.set(property, wrapped);
1717
+ }
1718
+ return this;
1719
+ }
1720
+ /**
1721
+ * Conditionally sets a property choosing between two values
1722
+ *
1723
+ * Accepts unwrapped Asset builders and automatically wraps them in AssetWrapper format.
1724
+ *
1725
+ * @param predicate - Function to determine which value to use
1726
+ * @param property - The property key
1727
+ * @param trueValue - Value to use if predicate is true
1728
+ * @param falseValue - Value to use if predicate is false
1729
+ *
1730
+ * @example
1731
+ * action()
1732
+ * .ifElse(
1733
+ * () => isActive,
1734
+ * "label",
1735
+ * text().withValue("Deactivate"),
1736
+ * text().withValue("Activate")
1737
+ * )
1738
+ */
1739
+ ifElse(predicate, property, trueValue, falseValue) {
1740
+ const valueToUse = predicate(this) ? trueValue : falseValue;
1741
+ const resolved = resolveValueOrFunction(valueToUse);
1742
+ const wrapped = maybeWrapAsset(resolved);
1743
+ this.set(property, wrapped);
1744
+ return this;
1745
+ }
1746
+ /**
1747
+ * Checks if a property has been set
1748
+ */
1749
+ has(key) {
1750
+ return this.valueStorage.has(key);
1751
+ }
1752
+ /**
1753
+ * Peeks at a property value without resolving builders
1754
+ */
1755
+ peek(key) {
1756
+ return this.valueStorage.peek(key);
1757
+ }
1758
+ /**
1759
+ * Gets builder for a property if one is set
1760
+ */
1761
+ peekBuilder(key) {
1762
+ return this.valueStorage.peekBuilder(key);
1763
+ }
1764
+ /**
1765
+ * Gets the type of value stored for a property
1766
+ */
1767
+ getValueType(key) {
1768
+ return this.valueStorage.getValueType(key);
1769
+ }
1770
+ /**
1771
+ * Clones the builder, creating an independent copy with the same state.
1772
+ *
1773
+ * Note: This method requires that the builder class has a constructor that
1774
+ * accepts an optional `initial` parameter (like all generated builders do).
1775
+ * If your custom builder has required constructor parameters, you must
1776
+ * override this method.
1777
+ */
1778
+ clone() {
1779
+ const BuilderClass = this.constructor;
1780
+ let cloned;
1781
+ try {
1782
+ cloned = new BuilderClass();
1783
+ } catch (error) {
1784
+ throw new Error(
1785
+ `clone() failed: Builder class "${this.constructor.name}" requires constructor arguments. Override clone() in your subclass to handle this case.`
1786
+ );
1787
+ }
1788
+ cloned.valueStorage = this.valueStorage.clone();
1789
+ cloned.auxiliaryStorage = this.auxiliaryStorage.clone();
1790
+ if (this.context) {
1791
+ cloned.context = this.context;
1792
+ }
1793
+ return cloned;
1794
+ }
1795
+ /**
1796
+ * Unsets a property, removing it from the builder
1797
+ */
1798
+ unset(key) {
1799
+ this.valueStorage.unset(key);
1800
+ return this;
1801
+ }
1802
+ /**
1803
+ * Clears all properties from the builder, resetting it to initial state
1804
+ */
1805
+ clear() {
1806
+ this.valueStorage.clear();
1807
+ return this;
1808
+ }
1809
+ /**
1810
+ * Adds a template to this builder
1811
+ */
1812
+ template(templateFn) {
1813
+ this.auxiliaryStorage.push(StorageKeys.TEMPLATES, templateFn);
1814
+ return this;
1815
+ }
1816
+ /**
1817
+ * Adds a switch to this builder at a specific path
1818
+ */
1819
+ switch(path, switchFnArgs) {
1820
+ this.auxiliaryStorage.push(StorageKeys.SWITCHES, {
1821
+ path,
1822
+ switchFn: switch_(switchFnArgs)
1823
+ });
1824
+ return this;
1825
+ }
1826
+ };
1827
+
1828
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/base-builder/utils.ts
1829
+ function createInspectMethod(builderName, properties) {
1830
+ return `${builderName} { properties: ${JSON.stringify(
1831
+ properties,
1832
+ null,
1833
+ 2
1834
+ )} }`;
1835
+ }
1836
+
1837
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/base-builder/errors.ts
1838
+ var ErrorCodes = {
1839
+ /** Context is missing when required */
1840
+ MISSING_CONTEXT: "FLUENT_MISSING_CONTEXT",
1841
+ /** Invalid branch type in ID generation */
1842
+ INVALID_BRANCH: "FLUENT_INVALID_BRANCH",
1843
+ /** Template produced no output */
1844
+ TEMPLATE_NO_OUTPUT: "FLUENT_TEMPLATE_NO_OUTPUT",
1845
+ /** Invalid path in value resolution */
1846
+ INVALID_PATH: "FLUENT_INVALID_PATH"
1847
+ };
1848
+ var FluentError = class _FluentError extends Error {
1849
+ code;
1850
+ context;
1851
+ constructor(code, message, context) {
1852
+ const contextStr = context ? ` Context: ${JSON.stringify(context)}` : "";
1853
+ super(`[${code}] ${message}${contextStr}`);
1854
+ this.name = "FluentError";
1855
+ this.code = code;
1856
+ this.context = context;
1857
+ if (Error.captureStackTrace) {
1858
+ Error.captureStackTrace(this, _FluentError);
1859
+ }
1860
+ }
1861
+ };
1862
+ function createFluentError(code, message, context) {
1863
+ return new FluentError(code, message, context);
1864
+ }
1865
+
1866
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/template/index.ts
1867
+ var TEMPLATE_MARKER = Symbol.for("fluent-builder-template");
1868
+ function isTemplate(fn) {
1869
+ return typeof fn === "function" && TEMPLATE_MARKER in fn;
1870
+ }
1871
+ var template = ({
1872
+ data,
1873
+ output,
1874
+ value,
1875
+ dynamic = false
1876
+ }) => {
1877
+ const templateFn = (parentCtx) => {
1878
+ const resolvedOutput = output || inferOutputFromContext(parentCtx);
1879
+ if (!resolvedOutput) {
1880
+ throw new Error(
1881
+ "Template output must be provided or inferrable from context. When using template in asset arrays, ensure the array property can be inferred (e.g., collection().withValues([template(...)]) infers 'values' as output)."
1882
+ );
1883
+ }
1884
+ const templateValueCtx = {
1885
+ parentId: genId(parentCtx),
1886
+ branch: {
1887
+ type: BranchTypes.TEMPLATE,
1888
+ depth: 0
1889
+ }
1890
+ };
1891
+ let resolvedAsset;
1892
+ if (isFluentBuilder(value)) {
1893
+ resolvedAsset = value.build(templateValueCtx);
1894
+ } else if (typeof value === "function") {
1895
+ const builderResult = value(templateValueCtx);
1896
+ if (typeof builderResult === "function") {
1897
+ resolvedAsset = builderResult(
1898
+ templateValueCtx
1899
+ );
1900
+ } else {
1901
+ resolvedAsset = builderResult;
1902
+ }
1903
+ } else {
1904
+ if (typeof value === "object" && value !== null) {
1905
+ resolvedAsset = { ...value };
1906
+ } else {
1907
+ resolvedAsset = value;
1908
+ }
1909
+ }
1910
+ return {
1911
+ data: isTaggedTemplateValue(data) ? data.toString() : data,
1912
+ output: resolvedOutput,
1913
+ value: {
1914
+ asset: resolvedAsset
1915
+ },
1916
+ ...dynamic && { dynamic }
1917
+ };
1918
+ };
1919
+ templateFn[TEMPLATE_MARKER] = true;
1920
+ return templateFn;
1921
+ };
1922
+ function inferOutputFromContext(parentCtx) {
1923
+ if (parentCtx.branch?.type === "slot") {
1924
+ const slotName = parentCtx.branch.name;
1925
+ const match = slotName.match(/^([a-zA-Z_][a-zA-Z0-9_]*)-\d+$/);
1926
+ if (match) {
1927
+ return match[1];
1928
+ }
1929
+ if (/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(slotName)) {
1930
+ return slotName;
1931
+ }
1932
+ }
1933
+ return void 0;
1934
+ }
1935
+
1936
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/flow/index.ts
1937
+ function isBuilder(value) {
1938
+ return typeof value === "object" && value !== null && "build" in value && typeof value.build === "function";
1939
+ }
1940
+ function isBuilderFunction(value) {
1941
+ return typeof value === "function";
1942
+ }
1943
+ function flow(options) {
1944
+ const flowId = options.id || "root";
1945
+ const viewsNamespace = `${flowId}-views`;
1946
+ const processedViews = (() => {
1947
+ const processViews = () => {
1948
+ const results = [];
1949
+ for (let index = 0; index < options.views.length; index++) {
1950
+ const viewOrFn = options.views[index];
1951
+ const ctx = {
1952
+ parentId: viewsNamespace,
1953
+ branch: {
1954
+ type: BranchTypes.ARRAY_ITEM,
1955
+ index
1956
+ },
1957
+ ...options.context ?? {}
1958
+ };
1959
+ if (isBuilder(viewOrFn)) {
1960
+ results.push(viewOrFn.build(ctx));
1961
+ } else if (isBuilderFunction(viewOrFn)) {
1962
+ results.push(viewOrFn(ctx));
1963
+ } else {
1964
+ results.push(viewOrFn);
1965
+ }
1966
+ }
1967
+ return results;
1968
+ };
1969
+ return processViews();
1970
+ })();
1971
+ const { views: _views, context: _context, ...restOptions } = options;
1972
+ return {
1973
+ ...restOptions,
1974
+ id: flowId,
1975
+ views: processedViews,
1976
+ ...options.data && { data: options.data },
1977
+ ...options.schema && { schema: options.schema },
1978
+ navigation: options.navigation
1979
+ };
1980
+ }
1981
+
1982
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/schema/index.ts
1983
+ import { SyncWaterfallHook } from "tapable-ts";
1984
+ import { dequal } from "dequal";
1985
+ var SchemaTypeName = Symbol.for("Schema Rename");
1986
+ var isTypeDef = (property) => {
1987
+ return property.type !== void 0;
1988
+ };
1989
+ var SchemaGenerator = class {
1990
+ children = [];
1991
+ generatedDataTypes = /* @__PURE__ */ new Map();
1992
+ typeNameCache = /* @__PURE__ */ new Map();
1993
+ logger;
1994
+ hooks = {
1995
+ createSchemaNode: new SyncWaterfallHook()
1996
+ };
1997
+ constructor(logger) {
1998
+ this.logger = logger ?? console;
1999
+ }
2000
+ /**
2001
+ * Converts an object to a `Schema.Schema` representation
2002
+ * Optimized to minimize object operations and memory allocations
2003
+ */
2004
+ toSchema = (schema) => {
2005
+ this.children.length = 0;
2006
+ this.generatedDataTypes.clear();
2007
+ this.typeNameCache.clear();
2008
+ const newSchema = {
2009
+ ROOT: {}
2010
+ };
2011
+ const rootKeys = Object.keys(schema);
2012
+ for (let i = 0; i < rootKeys.length; i++) {
2013
+ const property = rootKeys[i];
2014
+ const subType = schema[property];
2015
+ newSchema.ROOT[property] = this.hooks.createSchemaNode.call(
2016
+ this.processChild(property, subType),
2017
+ subType
2018
+ );
2019
+ }
2020
+ while (this.children.length > 0) {
2021
+ const { name, child } = this.children.pop();
2022
+ const typeDef = {};
2023
+ const childKeys = Object.keys(child);
2024
+ for (let i = 0; i < childKeys.length; i++) {
2025
+ const property = childKeys[i];
2026
+ const subType = child[property];
2027
+ typeDef[property] = this.hooks.createSchemaNode.call(
2028
+ this.processChild(property, subType),
2029
+ subType
2030
+ );
2031
+ }
2032
+ newSchema[name] = typeDef;
2033
+ }
2034
+ return newSchema;
2035
+ };
2036
+ processChild(property, subType) {
2037
+ if (isTypeDef(subType)) {
2038
+ return subType;
2039
+ }
2040
+ let intermediateType;
2041
+ let child;
2042
+ if (Array.isArray(subType)) {
2043
+ if (subType.length > 1) {
2044
+ this.logger.warn(
2045
+ `Type ${property} has multiple types in array, should only contain one top level object type. Only taking first defined type`
2046
+ );
2047
+ }
2048
+ const subTypeName = subType[0][SchemaTypeName] ?? property;
2049
+ intermediateType = this.makePlaceholderArrayType(subTypeName);
2050
+ child = subType[0];
2051
+ } else {
2052
+ const subTypeName = subType[SchemaTypeName] ?? property;
2053
+ intermediateType = this.makePlaceholderType(subTypeName);
2054
+ child = subType;
2055
+ }
2056
+ const typeName = intermediateType.type;
2057
+ if (this.generatedDataTypes.has(typeName)) {
2058
+ const generatedType = this.generatedDataTypes.get(typeName);
2059
+ if (!dequal(child, this.generatedDataTypes.get(typeName)?.node)) {
2060
+ generatedType.count += 1;
2061
+ const newTypeName = `${typeName}${generatedType.count}`;
2062
+ intermediateType = {
2063
+ ...intermediateType,
2064
+ type: newTypeName
2065
+ };
2066
+ this.logger.warn(
2067
+ `WARNING: Generated two intermediate types with the name: ${typeName} that are of different shapes, using artificial type ${newTypeName}`
2068
+ );
2069
+ this.generatedDataTypes.set(newTypeName, {
2070
+ node: subType,
2071
+ count: 1
2072
+ });
2073
+ this.children.push({ name: newTypeName, child });
2074
+ return intermediateType;
2075
+ }
2076
+ } else {
2077
+ this.generatedDataTypes.set(typeName, {
2078
+ node: subType,
2079
+ count: 1
2080
+ });
2081
+ }
2082
+ this.children.push({ name: intermediateType.type, child });
2083
+ return intermediateType;
2084
+ }
2085
+ /**
2086
+ * Cached type name generation
2087
+ */
2088
+ makePlaceholderType = (typeName) => {
2089
+ let cachedName = this.typeNameCache.get(typeName);
2090
+ if (!cachedName) {
2091
+ cachedName = `${typeName}Type`;
2092
+ this.typeNameCache.set(typeName, cachedName);
2093
+ }
2094
+ return { type: cachedName };
2095
+ };
2096
+ /**
2097
+ * Cached array type name generation
2098
+ */
2099
+ makePlaceholderArrayType(typeName) {
2100
+ let cachedName = this.typeNameCache.get(typeName);
2101
+ if (!cachedName) {
2102
+ cachedName = `${typeName}Type`;
2103
+ this.typeNameCache.set(typeName, cachedName);
2104
+ }
2105
+ return {
2106
+ type: cachedName,
2107
+ isArray: true
2108
+ };
2109
+ }
2110
+ };
2111
+
2112
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/dsl/fluent/src/core/utils/index.ts
2113
+ function safeToString(value) {
2114
+ if (isTaggedTemplateValue(value)) {
2115
+ return value.toString();
2116
+ }
2117
+ return String(value);
2118
+ }
2119
+ function safeToBoolean(value) {
2120
+ if (isTaggedTemplateValue(value)) {
2121
+ return value.toString() === "true";
2122
+ }
2123
+ return Boolean(value);
2124
+ }
2125
+ function safeToNumber(value) {
2126
+ if (isTaggedTemplateValue(value)) {
2127
+ return Number(value.toString());
2128
+ }
2129
+ return Number(value);
2130
+ }
2131
+ function safeToArray(value) {
2132
+ if (isTaggedTemplateValue(value)) {
2133
+ return [value.toString()];
2134
+ }
2135
+ if (Array.isArray(value)) {
2136
+ return value.map((item) => {
2137
+ if (isTaggedTemplateValue(item)) {
2138
+ return item.toString();
2139
+ } else if (Array.isArray(item)) {
2140
+ return safeToArray(item);
2141
+ } else if (item && typeof item === "object" && !isTaggedTemplateValue(item)) {
2142
+ return safeToObject(item);
2143
+ }
2144
+ return item;
2145
+ });
2146
+ }
2147
+ return [value];
2148
+ }
2149
+ function safeToObject(value) {
2150
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
2151
+ return value;
2152
+ }
2153
+ return Object.fromEntries(
2154
+ Object.entries(value).map(([key, val]) => {
2155
+ if (isTaggedTemplateValue(val)) {
2156
+ return [key, val.toString()];
2157
+ } else if (Array.isArray(val)) {
2158
+ return [key, safeToArray(val)];
2159
+ } else if (val && typeof val === "object" && !isTaggedTemplateValue(val)) {
2160
+ return [key, safeToObject(val)];
2161
+ }
2162
+ return [key, val];
2163
+ })
2164
+ );
2165
+ }
2166
+ function safeFromMixedType(value) {
2167
+ if (isTaggedTemplateValue(value)) {
2168
+ return value.toString();
2169
+ }
2170
+ if (value && typeof value === "object" && !Array.isArray(value)) {
2171
+ return safeToObject(
2172
+ value
2173
+ );
2174
+ }
2175
+ if (Array.isArray(value)) {
2176
+ return safeToArray(value);
2177
+ }
2178
+ return value;
2179
+ }
2180
+ export {
2181
+ and as AND,
2182
+ BranchTypes,
2183
+ ErrorCodes,
2184
+ FLUENT_BUILDER_SYMBOL,
2185
+ FluentBuilderBase,
2186
+ FluentError,
2187
+ IDRegistry,
2188
+ nand as NAND,
2189
+ nor as NOR,
2190
+ not as NOT,
2191
+ or as OR,
2192
+ PropertyKeys,
2193
+ SchemaGenerator,
2194
+ SchemaTypeName,
2195
+ StorageKeys,
2196
+ TEMPLATE_MARKER,
2197
+ TaggedTemplateValueSymbol,
2198
+ xor as XOR,
2199
+ add,
2200
+ and,
2201
+ binding,
2202
+ call,
2203
+ conditional,
2204
+ createFluentError,
2205
+ createIdRegistry,
2206
+ createInspectMethod,
2207
+ createNestedContext,
2208
+ createSwitchContext,
2209
+ createTemplateContext,
2210
+ determineSlotName,
2211
+ divide as div,
2212
+ divide,
2213
+ equal as eq,
2214
+ equal,
2215
+ expression,
2216
+ extractBindingsFromSchema,
2217
+ extractValue,
2218
+ flow,
2219
+ genId,
2220
+ generateAssetId,
2221
+ globalIdRegistry,
2222
+ greaterThan,
2223
+ greaterThanOrEqual,
2224
+ greaterThan as gt,
2225
+ greaterThanOrEqual as gte,
2226
+ conditional as ifElse,
2227
+ isAsset,
2228
+ isAssetWrapper,
2229
+ isAssetWrapperValue,
2230
+ isAssetWrapperWithAsset,
2231
+ isBuilderArray,
2232
+ isFluentBuilder,
2233
+ isPlainObject,
2234
+ isStringOrUndefined,
2235
+ isSwitchResult,
2236
+ isTaggedTemplateValue,
2237
+ isTemplate,
2238
+ lessThan,
2239
+ lessThanOrEqual,
2240
+ literal,
2241
+ lessThan as lt,
2242
+ lessThanOrEqual as lte,
2243
+ subtract as minus,
2244
+ modulo as mod,
2245
+ modulo,
2246
+ multiply,
2247
+ nand,
2248
+ needsAssetWrapper,
2249
+ notEqual as neq,
2250
+ nor,
2251
+ not,
2252
+ notEqual,
2253
+ or,
2254
+ peekId,
2255
+ add as plus,
2256
+ resetGlobalIdSet,
2257
+ resolveAndWrapAsset,
2258
+ resolveValue,
2259
+ safeFromMixedType,
2260
+ safeToArray,
2261
+ safeToBoolean,
2262
+ safeToNumber,
2263
+ safeToObject,
2264
+ safeToString,
2265
+ strictEqual as strictEq,
2266
+ strictEqual,
2267
+ strictNotEqual as strictNeq,
2268
+ strictNotEqual,
2269
+ subtract,
2270
+ switch_,
2271
+ template,
2272
+ conditional as ternary,
2273
+ multiply as times,
2274
+ xor
2275
+ };
2276
+ //# sourceMappingURL=index.mjs.map