react-semaphor 0.1.414 → 0.1.416

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.
@@ -1,18 +1,18 @@
1
- import { S as hn, a as Sn, i as wn, v as $n } from "../chunks/analyze-result-contract-DPjm6btg.js";
2
- import { c as Fe, G as me, a as be, b as Ve } from "../chunks/update-policy-BnEbPhHW.js";
3
- import { C as Fn, e as bn, R as Vn, f as kn, g as Rn, h as Mn, i as Nn, j as xn, v as Cn, d as On } from "../chunks/update-policy-BnEbPhHW.js";
1
+ import { S as wn, a as $n, i as In, v as Fn } from "../chunks/analyze-result-contract-DPjm6btg.js";
2
+ import { c as Ve, G as me, a as ke, b as Re } from "../chunks/update-policy-BnEbPhHW.js";
3
+ import { C as Vn, e as kn, R as Rn, f as Mn, g as Nn, h as xn, i as Cn, j as On, v as Gn, d as Kn } from "../chunks/update-policy-BnEbPhHW.js";
4
4
  import { createHash as fe } from "node:crypto";
5
- const mn = "src/semaphor/generated", v = `// Generated by Semaphor Agent Plugin. Do not hand-edit analytics wiring here.
5
+ const yn = "src/semaphor/generated", H = `// Generated by Semaphor Agent Plugin. Do not hand-edit analytics wiring here.
6
6
  // Regenerate from the accepted semaphor_plan_data_app codegenSummary when the plan changes.
7
7
  `;
8
- function fn(e, n = {}) {
9
- Fe(e);
10
- const r = ke(e);
8
+ function gn(e, n = {}) {
9
+ Ve(e);
10
+ const r = Me(e);
11
11
  if (r.views.length === 0 && !n.allowEmpty)
12
12
  throw new Error(
13
13
  "Contract generation produced zero executable views. Stop and ask for a different domain/goal or semantic model improvement; pass --allow-empty only for an explicit model-gap report."
14
14
  );
15
- const o = Me(r), t = Ne({
15
+ const o = xe(r), t = Ce({
16
16
  contract: r,
17
17
  files: o,
18
18
  generatorName: n.generatorName || "react-semaphor/data-app-codegen/node",
@@ -27,7 +27,7 @@ function fn(e, n = {}) {
27
27
  files: a,
28
28
  manifest: t,
29
29
  contentHash: String(t.generatedContentHash || ""),
30
- usageExample: Oe(r),
30
+ usageExample: Ke(r),
31
31
  warnings: r.warnings,
32
32
  stats: {
33
33
  inputCount: r.inputs.length,
@@ -38,17 +38,17 @@ function fn(e, n = {}) {
38
38
  }
39
39
  };
40
40
  }
41
- function ke(e) {
42
- var c, u, d, m, l, w, b, F, x, G, V, M;
41
+ function Me(e) {
42
+ var l, u, d, m, c, w, b, F, x, G, V, M;
43
43
  const n = [], r = [];
44
44
  for (const s of e.inputs) {
45
45
  g(r, s.fieldRef);
46
46
  for (const S of s.bindings || [])
47
47
  g(r, S.fieldRef);
48
- g(r, (c = s.optionQuery) == null ? void 0 : c.valueFieldRef), g(r, (u = s.optionQuery) == null ? void 0 : u.labelFieldRef), g(r, (d = s.optionQuery) == null ? void 0 : d.filterFieldRef), T(r, (m = s.optionQuery) == null ? void 0 : m.spec);
48
+ g(r, (l = s.optionQuery) == null ? void 0 : l.valueFieldRef), g(r, (u = s.optionQuery) == null ? void 0 : u.labelFieldRef), g(r, (d = s.optionQuery) == null ? void 0 : d.filterFieldRef), T(r, (m = s.optionQuery) == null ? void 0 : m.spec);
49
49
  }
50
50
  for (const s of e.filterContracts) {
51
- g(r, s.fieldRef), g(r, (l = s.optionQuery) == null ? void 0 : l.valueFieldRef), g(r, (w = s.optionQuery) == null ? void 0 : w.labelFieldRef), g(r, (b = s.optionQuery) == null ? void 0 : b.filterFieldRef), T(r, (F = s.optionQuery) == null ? void 0 : F.spec);
51
+ g(r, s.fieldRef), g(r, (c = s.optionQuery) == null ? void 0 : c.valueFieldRef), g(r, (w = s.optionQuery) == null ? void 0 : w.labelFieldRef), g(r, (b = s.optionQuery) == null ? void 0 : b.filterFieldRef), T(r, (F = s.optionQuery) == null ? void 0 : F.spec);
52
52
  for (const S of s.bindings || [])
53
53
  g(r, S.fieldRef);
54
54
  }
@@ -63,24 +63,24 @@ function ke(e) {
63
63
  g(r, S.fieldRef), g(r, S.optionValueField), g(r, S.optionLabelField);
64
64
  for (const s of o.requiredInputOptions || [])
65
65
  g(r, s.visibleLabelField), g(r, s.optionValueField), g(r, s.runtimeFilterField);
66
- const t = on(
66
+ const t = an(
67
67
  [
68
68
  ...e.sources.map((s) => ({
69
69
  raw: s,
70
- key: Se(s),
71
- aliases: we(s),
70
+ key: we(s),
71
+ aliases: $e(s),
72
72
  name: ""
73
73
  })),
74
- ...r.map((s) => nn(s)).filter(O)
74
+ ...r.map((s) => tn(s)).filter(O)
75
75
  ]
76
76
  );
77
- H(t, (s) => {
77
+ v(t, (s) => {
78
78
  const S = $(s.raw);
79
79
  return Q(
80
80
  s.raw.label || (S == null ? void 0 : S.datasetName) || (S == null ? void 0 : S.datasetId) || (S == null ? void 0 : S.name) || s.raw.kind || "source"
81
81
  );
82
82
  });
83
- const a = sn(t), p = X(
83
+ const a = un(t), p = X(
84
84
  r.filter((s) => s.name).map((s) => ({
85
85
  raw: s,
86
86
  key: D(s),
@@ -88,10 +88,10 @@ function ke(e) {
88
88
  })),
89
89
  (s) => s.key
90
90
  );
91
- H(
91
+ v(
92
92
  p,
93
93
  (s) => Q([
94
- s.raw.sourceKey ? ln(s.raw.sourceKey) : "",
94
+ s.raw.sourceKey ? cn(s.raw.sourceKey) : "",
95
95
  s.raw.aggregate ? s.raw.aggregate.toLowerCase() : "",
96
96
  s.raw.name
97
97
  ].filter(Boolean).join("_"))
@@ -100,15 +100,15 @@ function ke(e) {
100
100
  raw: s,
101
101
  name: Q(s.id || s.label || "input")
102
102
  }));
103
- H(h, (s) => s.name);
103
+ v(h, (s) => s.name);
104
104
  const y = h.filter((s) => !!s.raw.optionQuery).map((s) => ({
105
105
  input: s,
106
106
  name: `${s.name}Options`,
107
107
  raw: s.raw.optionQuery
108
108
  }));
109
- H(y, (s) => s.name);
109
+ v(y, (s) => s.name);
110
110
  for (const s of y)
111
- rn(s.raw.labelFieldRef, s.raw.valueFieldRef) && tn(s.raw.valueFieldRef) && n.push(
111
+ on(s.raw.labelFieldRef, s.raw.valueFieldRef) && sn(s.raw.valueFieldRef) && n.push(
112
112
  `Input option query ${((G = s.raw.spec) == null ? void 0 : G.inputId) || s.input.raw.id || s.name} uses identifier field ${s.raw.valueFieldRef.name} as both label and value. It can execute, but the UI will show key values unless the semantic model exposes a human-readable label through a modeled relationship.`
113
113
  );
114
114
  const i = e.views.filter(
@@ -120,11 +120,11 @@ function ke(e) {
120
120
  raw: s,
121
121
  name: Q(s.id || s.title || "query")
122
122
  }));
123
- H(i, (s) => s.name);
124
- const I = e.views.filter((s) => ce(s) && !("sdkSpec" in s)).map((s) => en(s));
123
+ v(i, (s) => s.name);
124
+ const I = e.views.filter((s) => ce(s) && !("sdkSpec" in s)).map((s) => rn(s));
125
125
  for (const s of e.views)
126
126
  (!("sdkSpec" in s) || !((V = s.sdkSpec) != null && V.builder) || !((M = s.sdkSpec) != null && M.spec)) && !ce(s) && n.push(`Skipped view ${s.id || s.title || "unknown"} because it has no sdkSpec.`);
127
- return Re({
127
+ return Ne({
128
128
  inputs: h,
129
129
  views: i,
130
130
  filterContracts: e.filterContracts
@@ -144,7 +144,7 @@ function ke(e) {
144
144
  warnings: n
145
145
  };
146
146
  }
147
- function Re({
147
+ function Ne({
148
148
  inputs: e,
149
149
  views: n,
150
150
  filterContracts: r
@@ -180,44 +180,44 @@ function Re({
180
180
  }
181
181
  }
182
182
  }
183
- function Me(e) {
183
+ function xe(e) {
184
184
  return {
185
- "sources.ts": Ee(e),
186
- "fields.ts": He(e),
187
- "inputs.ts": Ae(e),
188
- "queries.ts": je(e),
189
- "bindings.ts": Pe(e),
190
- "accessors.ts": Ue(e),
191
- "metadata.ts": Je(e),
192
- "index.ts": ze()
185
+ "sources.ts": ve(e),
186
+ "fields.ts": Ae(e),
187
+ "inputs.ts": je(e),
188
+ "queries.ts": Qe(e),
189
+ "bindings.ts": Ue(e),
190
+ "accessors.ts": Je(e),
191
+ "metadata.ts": Ye(e),
192
+ "index.ts": We()
193
193
  };
194
194
  }
195
- function Ne({
195
+ function Ce({
196
196
  contract: e,
197
197
  files: n,
198
198
  generatorName: r,
199
199
  generatorVersion: o
200
200
  }) {
201
201
  return {
202
- schemaVersion: Ve,
202
+ schemaVersion: Re,
203
203
  generatedContractSchemaVersion: me,
204
204
  generator: {
205
205
  name: r,
206
206
  version: o
207
207
  },
208
- generatedContentHash: xe(n),
209
- codegenSummaryValidatorVersion: be,
210
- codegenSummaryHash: Ce(e.summary),
208
+ generatedContentHash: Oe(n),
209
+ codegenSummaryValidatorVersion: ke,
210
+ codegenSummaryHash: Ge(e.summary),
211
211
  codegenSummary: e.summary
212
212
  };
213
213
  }
214
- function xe(e) {
214
+ function Oe(e) {
215
215
  const n = fe("sha256");
216
216
  for (const r of Object.keys(e).sort())
217
217
  n.update(r), n.update("\0"), n.update(e[r]), n.update("\0");
218
218
  return `sha256:${n.digest("hex")}`;
219
219
  }
220
- function Ce(e) {
220
+ function Ge(e) {
221
221
  return `sha256:${fe("sha256").update(ae(e)).digest("hex")}`;
222
222
  }
223
223
  function ae(e) {
@@ -228,7 +228,7 @@ function ae(e) {
228
228
  const n = e;
229
229
  return `{${Object.keys(n).sort().filter((o) => n[o] !== void 0).map((o) => `${JSON.stringify(o)}:${ae(n[o])}`).join(",")}}`;
230
230
  }
231
- function Oe(e) {
231
+ function Ke(e) {
232
232
  const n = e.views.find(
233
233
  (y) => K(y) && E(y)
234
234
  );
@@ -291,7 +291,7 @@ function Oe(e) {
291
291
  `);
292
292
  const a = e.views.find((y) => {
293
293
  var i;
294
- return un((i = y.raw.sdkSpec) == null ? void 0 : i.builder);
294
+ return pn((i = y.raw.sdkSpec) == null ? void 0 : i.builder);
295
295
  });
296
296
  if (a)
297
297
  return [
@@ -303,7 +303,7 @@ function Oe(e) {
303
303
  "const presentationViews = semaphorGeneratedContractMetadata.presentationViews;"
304
304
  ].join(`
305
305
  `);
306
- const p = e.views.find((y) => Ge(y));
306
+ const p = e.views.find((y) => Ee(y));
307
307
  if (p)
308
308
  return [
309
309
  'import { appInputSpecs, createInputHandleMap, metricValuesForView, queries, queryOptionsForView, semaphorGeneratedContractMetadata } from "./semaphor/generated";',
@@ -328,7 +328,7 @@ function W(e) {
328
328
  var n;
329
329
  return B((n = e.raw.sdkSpec) == null ? void 0 : n.builder) === "records";
330
330
  }
331
- function Ge(e) {
331
+ function Ee(e) {
332
332
  var n;
333
333
  return B((n = e.raw.sdkSpec) == null ? void 0 : n.builder) === "metric";
334
334
  }
@@ -344,24 +344,24 @@ function E(e) {
344
344
  var n, r, o;
345
345
  return ((o = (r = (n = e.raw.visualSpec) == null ? void 0 : n.tableBehavior) == null ? void 0 : r.pagination) == null ? void 0 : o.mode) === "server";
346
346
  }
347
- function Ke(e) {
347
+ function He(e) {
348
348
  return W(e) && (E(e) || K(e)) || ue(e) && E(e);
349
349
  }
350
- function Ee(e) {
350
+ function ve(e) {
351
351
  const n = e.sources.map(({ name: o, raw: t }) => {
352
- const a = ve(t);
352
+ const a = qe(t);
353
353
  return ` ${o}: ${a},`;
354
354
  }).join(`
355
355
  `), r = e.sources.some((o) => o.raw.kind === "semantic") ? `import { semaphor } from "react-semaphor/data-app-sdk";
356
356
 
357
357
  ` : "";
358
- return `${v}
358
+ return `${H}
359
359
  ${r}export const sources = {
360
360
  ${n}
361
361
  } as const;
362
362
  `;
363
363
  }
364
- function ve(e) {
364
+ function qe(e) {
365
365
  if (e.kind === "semantic") {
366
366
  const n = {
367
367
  domainId: e.domainId,
@@ -373,28 +373,28 @@ function ve(e) {
373
373
  }
374
374
  return `${k(A({ ...e, sourceKey: void 0 }))} as const`;
375
375
  }
376
- function He(e) {
376
+ function Ae(e) {
377
377
  const n = e.fields.map(({ name: o, raw: t }) => {
378
- const a = qe(t, e);
378
+ const a = Be(t, e);
379
379
  return ` ${o}: ${a},`;
380
380
  }).join(`
381
381
  `), r = n.includes("sources.") ? `import { sources } from "./sources";
382
382
 
383
383
  ` : "";
384
- return `${v}
384
+ return `${H}
385
385
  ${r}export const fields = {
386
386
  ${n}
387
387
  } as const;
388
388
  `;
389
389
  }
390
- function qe(e, n) {
390
+ function Be(e, n) {
391
391
  const r = {
392
392
  name: e.name,
393
393
  label: e.label,
394
394
  role: e.role,
395
395
  dataType: e.dataType,
396
396
  aggregate: e.aggregate
397
- }, o = an(e), t = o ? n.sourceNameByKey.get(o) : void 0;
397
+ }, o = dn(e), t = o ? n.sourceNameByKey.get(o) : void 0;
398
398
  if (o && !t)
399
399
  throw new Error(
400
400
  `Field ${e.name} references source ${o}, but that source is not renderable. Include the source in codegenSummary.sources or provide field.source.`
@@ -402,19 +402,19 @@ function qe(e, n) {
402
402
  const a = Object.entries(A(r)).map(([p, f]) => `${JSON.stringify(p)}: ${C(f, n)}`);
403
403
  return t && a.push(`"source": sources.${t}`), `{ ${a.join(", ")} }`;
404
404
  }
405
- function Ae(e) {
405
+ function je(e) {
406
406
  const n = e.inputs.map((d) => {
407
- const m = R(d.raw.fieldRef, e), l = [
407
+ const m = R(d.raw.fieldRef, e), c = [
408
408
  `id: ${JSON.stringify(d.raw.id)}`,
409
409
  `label: ${JSON.stringify(d.raw.label || d.raw.id)}`,
410
- `operator: ${JSON.stringify(dn(d.raw))}`
410
+ `operator: ${JSON.stringify(ln(d.raw))}`
411
411
  ];
412
- if (m && l.push(`field: fields.${m}`), d.raw.relationshipHint && l.push(`relationshipHint: ${k(d.raw.relationshipHint)}`), !m)
412
+ if (m && c.push(`field: fields.${m}`), d.raw.relationshipHint && c.push(`relationshipHint: ${k(d.raw.relationshipHint)}`), !m)
413
413
  throw new Error(`Input ${d.raw.id || d.name} is missing a generated field reference.`);
414
- return ` ${d.name}: semaphor.filter({ ${l.join(", ")} }),`;
414
+ return ` ${d.name}: semaphor.filter({ ${c.join(", ")} }),`;
415
415
  }).join(`
416
416
  `), r = e.inputs.map((d) => `filterSpecs.${d.name}`).join(", "), o = e.inputs.map((d) => JSON.stringify(d.raw.id)).join(", "), t = e.optionQueries.map((d) => {
417
- const m = d.input.raw, l = d.raw, w = $(l.spec) || {}, {
417
+ const m = d.input.raw, c = d.raw, w = $(c.spec) || {}, {
418
418
  id: b,
419
419
  inputId: F,
420
420
  source: x,
@@ -425,24 +425,24 @@ function Ae(e) {
425
425
  dependencies: S,
426
426
  limit: j,
427
427
  ...ee
428
- } = w, U = l.sourceKey ? { sourceKey: l.sourceKey } : l.source || x || (typeof G == "string" ? { sourceKey: G } : void 0), ne = he(U, e), re = R(l.valueFieldRef, e), te = R(l.labelFieldRef, e), oe = {
428
+ } = w, U = c.sourceKey ? { sourceKey: c.sourceKey } : c.source || x || (typeof G == "string" ? { sourceKey: G } : void 0), ne = Se(U, e), re = R(c.valueFieldRef, e), te = R(c.labelFieldRef, e), oe = ye(d), se = {
429
429
  ...ee,
430
- id: l.id || w.id || `${m.id}-options`,
430
+ id: c.id || w.id || `${m.id}-options`,
431
431
  inputId: m.id,
432
432
  source: U,
433
- valueField: l.valueFieldRef,
434
- labelField: l.labelFieldRef,
435
- population: l.population || s,
436
- dependencies: l.dependencies || S,
437
- limit: l.limit || j || 100
433
+ valueField: c.valueFieldRef,
434
+ labelField: c.labelFieldRef,
435
+ population: c.population || s,
436
+ dependencies: oe,
437
+ limit: c.limit || j || 100
438
438
  };
439
439
  if (!ne || !re || !te)
440
- throw new Error(`Input option query ${l.id || `${m.id}-options`} is missing source, valueField, or labelField.`);
441
- const se = Object.entries(A(oe)).map(([$e, Ie]) => `${JSON.stringify($e)}: ${C(Ie, e)}`);
442
- return ` ${d.name}: semaphor.inputOptions({ ${se.join(", ")} }),`;
440
+ throw new Error(`Input option query ${c.id || `${m.id}-options`} is missing source, valueField, or labelField.`);
441
+ const Ie = Object.entries(A(se)).map(([Fe, be]) => `${JSON.stringify(Fe)}: ${C(be, e)}`);
442
+ return ` ${d.name}: semaphor.inputOptions({ ${Ie.join(", ")} }),`;
443
443
  }).join(`
444
444
  `), a = e.optionQueries.map((d) => {
445
- const l = Be(e, d).map((w) => {
445
+ const c = Te(e, d).map((w) => {
446
446
  const b = R(w.raw.fieldRef, e);
447
447
  if (!b)
448
448
  throw new Error(
@@ -456,7 +456,7 @@ function Ae(e) {
456
456
  `);
457
457
  return ` ${d.name}(inputHandles: SemaphorGeneratedInputHandleMap): SemaphorInputReference[] {
458
458
  const inputs: SemaphorInputReference[] = [];
459
- ${l}
459
+ ${c}
460
460
  return inputs;
461
461
  },`;
462
462
  }).join(`
@@ -469,19 +469,19 @@ ${l}
469
469
 
470
470
  `), f = e.optionQueries.map((d) => ` case ${JSON.stringify(d.raw.id || `${d.input.raw.id}-options`)}:
471
471
  return queryOptionsForInputOptionQuery.${d.name}(inputHandles);`).join(`
472
- `), h = e.inputs.length > 0, y = e.optionQueries.length > 0, i = y ? "inputOptionQueryId" : "_inputOptionQueryId", I = y ? "inputHandles" : "_inputHandles", c = [
472
+ `), h = e.inputs.length > 0, y = e.optionQueries.length > 0, i = y ? "inputOptionQueryId" : "_inputOptionQueryId", I = y ? "inputHandles" : "_inputHandles", l = [
473
473
  "SemaphorInputHandle",
474
474
  y ? "SemaphorInputReference" : void 0,
475
475
  "SemaphorQueryRuntimeOptions"
476
476
  ].filter(O).join(", "), u = [
477
477
  h || y ? 'import { semaphor } from "react-semaphor/data-app-sdk";' : void 0,
478
- `import type { ${c} } from "react-semaphor/data-app-sdk";`,
478
+ `import type { ${l} } from "react-semaphor/data-app-sdk";`,
479
479
  h || y ? 'import { fields } from "./fields";' : void 0,
480
480
  y ? 'import { sources } from "./sources";' : void 0,
481
481
  'import type { SemaphorGeneratedInputId, SemaphorGeneratedInputOptionQueryId } from "./metadata";'
482
482
  ].filter(O).join(`
483
483
  `);
484
- return `${v}
484
+ return `${H}
485
485
  ${u}
486
486
 
487
487
  export const filterSpecs = {
@@ -520,27 +520,33 @@ ${f}
520
520
  }
521
521
  `;
522
522
  }
523
- function Be(e, n) {
524
- const r = n.raw.dependencies;
525
- if ((r == null ? void 0 : r.mode) === "independent")
523
+ function Te(e, n) {
524
+ const r = ye(n);
525
+ if (!r || r.mode === "independent")
526
+ return [];
527
+ if (r.mode !== "explicit")
526
528
  return [];
527
- const o = /* @__PURE__ */ new Set([
529
+ const o = new Set(r.includeInputIds || []), t = /* @__PURE__ */ new Set([
528
530
  n.input.raw.id,
529
- ...(r == null ? void 0 : r.excludeInputIds) || []
530
- ]), t = (r == null ? void 0 : r.mode) === "explicit" ? new Set(r.includeInputIds || []) : void 0;
531
- return e.inputs.filter((a) => o.has(a.raw.id) ? !1 : t ? t.has(a.raw.id) : !!a.raw.fieldRef);
531
+ ...r.excludeInputIds || []
532
+ ]);
533
+ return e.inputs.filter((a) => t.has(a.raw.id) ? !1 : o.has(a.raw.id));
532
534
  }
533
- function je(e) {
535
+ function ye(e) {
536
+ var n;
537
+ return e.raw.dependencies || ((n = e.raw.spec) == null ? void 0 : n.dependencies);
538
+ }
539
+ function Qe(e) {
534
540
  const n = e.views.map((u) => {
535
- var l, w, b, F, x, G;
536
- const d = B(u.raw.sdkSpec.builder), m = Te(u);
537
- if (W(u) && Ke(u)) {
538
- const V = (l = u.raw.visualSpec) == null ? void 0 : l.tableBehavior, M = $(m.pagination), s = E(u), S = K(u), j = ((w = V == null ? void 0 : V.pagination) == null ? void 0 : w.pageSize) || J(M == null ? void 0 : M.pageSize) || J(m.limit) || 100, ee = S ? z(u, e) : [], U = S ? Qe({
541
+ var c, w, b, F, x, G;
542
+ const d = B(u.raw.sdkSpec.builder), m = _e(u);
543
+ if (W(u) && He(u)) {
544
+ const V = (c = u.raw.visualSpec) == null ? void 0 : c.tableBehavior, M = $(m.pagination), s = E(u), S = K(u), j = ((w = V == null ? void 0 : V.pagination) == null ? void 0 : w.pageSize) || J(M == null ? void 0 : M.pageSize) || J(m.limit) || 100, ee = S ? z(u, e) : [], U = S ? Pe({
539
545
  view: u,
540
546
  contract: e,
541
547
  sortFields: ee,
542
548
  defaultField: (b = V == null ? void 0 : V.sorting) == null ? void 0 : b.defaultField
543
- }) : void 0, ne = S ? (F = V == null ? void 0 : V.sorting) == null ? void 0 : F.defaultDirection : void 0, re = _e({
549
+ }) : void 0, ne = S ? (F = V == null ? void 0 : V.sorting) == null ? void 0 : F.defaultDirection : void 0, re = De({
544
550
  viewName: u.name,
545
551
  supportsPagination: s,
546
552
  supportsSort: S
@@ -575,14 +581,14 @@ ${oe}${se} });
575
581
  return ` ${u.name}: () => semaphor.${d}(${C(m, e)}),`;
576
582
  }).join(`
577
583
  `), r = e.views.filter((u) => K(u)).map((u) => {
578
- const m = z(u, e).map((l) => ` ${JSON.stringify(l.key)}: fields.${l.fieldName},`).join(`
584
+ const m = z(u, e).map((c) => ` ${JSON.stringify(c.key)}: fields.${c.fieldName},`).join(`
579
585
  `);
580
586
  return ` ${u.name}: {
581
587
  ${m}
582
588
  },`;
583
589
  }).join(`
584
590
  `), o = e.views.filter((u) => K(u)).map((u) => {
585
- const m = z(u, e).map((l) => ` { key: ${JSON.stringify(l.key)}, label: ${JSON.stringify(l.label)}, field: fields.${l.fieldName} },`).join(`
591
+ const m = z(u, e).map((c) => ` { key: ${JSON.stringify(c.key)}, label: ${JSON.stringify(c.label)}, field: fields.${c.fieldName} },`).join(`
586
592
  `);
587
593
  return ` ${u.name}: [
588
594
  ${m}
@@ -596,7 +602,7 @@ ${m}
596
602
  p.includes("sources.") ? 'import { sources } from "./sources";' : void 0
597
603
  ].filter(O).join(`
598
604
  `);
599
- return `${v}
605
+ return `${H}
600
606
  ${f}
601
607
  ${t ? `export type SemaphorGeneratedRecordsSortDirection = "asc" | "desc";
602
608
 
@@ -661,7 +667,7 @@ ${a ? `function resolveServerTablePagination(
661
667
  ` : ""}
662
668
  `;
663
669
  }
664
- function Te(e) {
670
+ function _e(e) {
665
671
  var a, p;
666
672
  const n = $((a = e.raw.sdkSpec) == null ? void 0 : a.spec) || {}, { kind: r, id: o, ...t } = n;
667
673
  return {
@@ -690,7 +696,7 @@ function z(e, n) {
690
696
  (f) => f.key
691
697
  );
692
698
  }
693
- function Qe({
699
+ function Pe({
694
700
  view: e,
695
701
  contract: n,
696
702
  sortFields: r,
@@ -706,39 +712,39 @@ function Qe({
706
712
  const p = $((h = e.raw.sdkSpec) == null ? void 0 : h.spec), f = R((y = $(p == null ? void 0 : p.orderBy)) == null ? void 0 : y.field, n);
707
713
  return f && t.has(f) ? f : void 0;
708
714
  }
709
- function _e({
715
+ function De({
710
716
  viewName: e,
711
717
  supportsPagination: n,
712
718
  supportsSort: r
713
719
  }) {
714
720
  return n && r ? `SemaphorGeneratedRecordsQueryParams<Extract<keyof typeof recordsSortFieldsForView.${e}, string>>` : r ? `SemaphorGeneratedRecordsSortParams<Extract<keyof typeof recordsSortFieldsForView.${e}, string>>` : "SemaphorGeneratedServerPaginationParams";
715
721
  }
716
- function Pe(e) {
722
+ function Ue(e) {
717
723
  const n = e.views.map((i) => {
718
- const c = De(e, i.raw.id).map((u) => {
724
+ const l = Le(e, i.raw.id).map((u) => {
719
725
  const d = u.inputId, m = R(u.fieldRef, e);
720
726
  if (!d || !m)
721
727
  return "";
722
- const l = [`field: fields.${m}`];
728
+ const c = [`field: fields.${m}`];
723
729
  if (u.relationshipHint)
724
- l.push(`relationshipHint: ${k(u.relationshipHint)}`);
730
+ c.push(`relationshipHint: ${k(u.relationshipHint)}`);
725
731
  else if (Array.isArray(u.relationshipsUsed) && u.relationshipsUsed.length > 0) {
726
732
  const b = u.relationshipsUsed.map((F) => {
727
733
  var x;
728
734
  return (x = $(F)) == null ? void 0 : x.id;
729
735
  }).filter((F) => typeof F == "string" && F.length > 0);
730
- b.length > 0 && l.push(`relationshipHint: ${k({ relationshipIds: b })}`);
736
+ b.length > 0 && c.push(`relationshipHint: ${k({ relationshipIds: b })}`);
731
737
  }
732
738
  const w = `inputHandles[${JSON.stringify(d)}]`;
733
739
  return ` if (${w}) {
734
- inputs.push(semaphor.bindInput(${w}, { ${l.join(", ")} }));
740
+ inputs.push(semaphor.bindInput(${w}, { ${c.join(", ")} }));
735
741
  }`;
736
742
  }).filter(Boolean).join(`
737
743
  `);
738
- return { view: i, renderedBindings: c };
744
+ return { view: i, renderedBindings: l };
739
745
  }), r = n.some((i) => i.renderedBindings.length > 0), o = n.map(({ view: i, renderedBindings: I }) => {
740
- const c = I ? "inputHandles" : "_inputHandles";
741
- return ` ${i.name}(${c}: SemaphorGeneratedInputHandleMap): SemaphorInputReference[] {
746
+ const l = I ? "inputHandles" : "_inputHandles";
747
+ return ` ${i.name}(${l}: SemaphorGeneratedInputHandleMap): SemaphorInputReference[] {
742
748
  const inputs: SemaphorInputReference[] = [];
743
749
  ${I}
744
750
  return inputs;
@@ -765,7 +771,7 @@ ${I}
765
771
  'import type { SemaphorGeneratedQueryViewId } from "./metadata";'
766
772
  ].filter(O).join(`
767
773
  `);
768
- return `${v}
774
+ return `${H}
769
775
  ${y}
770
776
 
771
777
  export const inputsForView = {
@@ -797,7 +803,7 @@ ${p}
797
803
  }
798
804
  `;
799
805
  }
800
- function De(e, n) {
806
+ function Le(e, n) {
801
807
  return e.filterContracts.flatMap(
802
808
  (r) => (r.bindings || []).filter((o) => o.viewId === n).map((o) => ({
803
809
  inputId: r.inputId,
@@ -807,60 +813,60 @@ function De(e, n) {
807
813
  }))
808
814
  );
809
815
  }
810
- function Ue(e) {
811
- const n = e.views.map((c) => {
812
- const d = Y(c, e).map((m) => {
813
- const l = R(m.raw, e);
814
- return l ? ` ${m.name}: fields.${l},` : "";
816
+ function Je(e) {
817
+ const n = e.views.map((l) => {
818
+ const d = Y(l, e).map((m) => {
819
+ const c = R(m.raw, e);
820
+ return c ? ` ${m.name}: fields.${c},` : "";
815
821
  }).filter(Boolean).join(`
816
822
  `);
817
- return ` ${c.name}: {
823
+ return ` ${l.name}: {
818
824
  ${d}
819
825
  },`;
820
826
  }).join(`
821
- `), r = e.views.map((c) => {
822
- const d = L(c, e).map((m) => {
823
- const l = R(m.raw, e);
824
- return l ? ` ${m.name}: fields.${l},` : "";
827
+ `), r = e.views.map((l) => {
828
+ const d = L(l, e).map((m) => {
829
+ const c = R(m.raw, e);
830
+ return c ? ` ${m.name}: fields.${c},` : "";
825
831
  }).filter(Boolean).join(`
826
832
  `);
827
- return ` ${c.name}: {
833
+ return ` ${l.name}: {
828
834
  ${d}
829
835
  },`;
830
836
  }).join(`
831
- `), o = e.views.map((c) => {
832
- const u = L(c, e), d = Ze(u), m = We(u), l = u.map((w) => {
837
+ `), o = e.views.map((l) => {
838
+ const u = L(l, e), d = en(u), m = Xe(u), c = u.map((w) => {
833
839
  const b = Array.from(
834
840
  new Set(
835
- ye(w.raw).filter((F) => m.has(F))
841
+ ge(w.raw).filter((F) => m.has(F))
836
842
  )
837
843
  );
838
- return ` ${w.name}: metricKeysForField(metricFieldsForView.${c.name}.${w.name}, { allowNameFallback: ${d.has(w.raw.name) ? "false" : "true"}, excludedKeys: ${k(b)} }),`;
844
+ return ` ${w.name}: metricKeysForField(metricFieldsForView.${l.name}.${w.name}, { allowNameFallback: ${d.has(w.raw.name) ? "false" : "true"}, excludedKeys: ${k(b)} }),`;
839
845
  }).join(`
840
846
  `);
841
- return ` ${c.name}: {
842
- ${l}
847
+ return ` ${l.name}: {
848
+ ${c}
843
849
  },`;
844
850
  }).join(`
845
- `), t = e.views.map((c) => {
846
- const d = L(c, e).map((m) => ` ${m.name}: semaphorMetricMeasureBindingKey(metricFieldsForView.${c.name}.${m.name}),`).join(`
851
+ `), t = e.views.map((l) => {
852
+ const d = L(l, e).map((m) => ` ${m.name}: semaphorMetricMeasureBindingKey(metricFieldsForView.${l.name}.${m.name}),`).join(`
847
853
  `);
848
- return ` ${c.name}: {
854
+ return ` ${l.name}: {
849
855
  ${d}
850
856
  },`;
851
857
  }).join(`
852
- `), a = e.views.map((c) => {
853
- const u = L(c, e);
858
+ `), a = e.views.map((l) => {
859
+ const u = L(l, e);
854
860
  if (u.length === 0)
855
- return ` ${c.name}(): Record<keyof typeof metricFieldsForView.${c.name}, unknown> {
861
+ return ` ${l.name}(): Record<keyof typeof metricFieldsForView.${l.name}, unknown> {
856
862
  return {};
857
863
  },`;
858
- const d = Ye(c, u), m = u.map((l) => {
859
- const w = `metricMeasureKeysForView.${c.name}.${l.name}`, b = `metricMeasureBindingKeysForView.${c.name}.${l.name}`, F = d.has(l.name) ? `readMetricValueByBindingWithFallback(measures, measureBindings, ${b}, ${w}, scalarValue)` : `readMetricValueByBinding(measures, measureBindings, ${b}, ${w})`;
860
- return ` ${l.name}: ${F},`;
864
+ const d = Ze(l, u), m = u.map((c) => {
865
+ const w = `metricMeasureKeysForView.${l.name}.${c.name}`, b = `metricMeasureBindingKeysForView.${l.name}.${c.name}`, F = d.has(c.name) ? `readMetricValueByBindingWithFallback(measures, measureBindings, ${b}, ${w}, scalarValue)` : `readMetricValueByBinding(measures, measureBindings, ${b}, ${w})`;
866
+ return ` ${c.name}: ${F},`;
861
867
  }).join(`
862
868
  `);
863
- return ` ${c.name}(result: SemaphorGeneratedMetricResult): Record<keyof typeof metricFieldsForView.${c.name}, unknown> {
869
+ return ` ${l.name}(result: SemaphorGeneratedMetricResult): Record<keyof typeof metricFieldsForView.${l.name}, unknown> {
864
870
  const measures = result?.measures;
865
871
  const measureBindings = result?.measureBindings;
866
872
  const scalarValue = result?.value;
@@ -870,24 +876,24 @@ ${m}
870
876
  },`;
871
877
  }).join(`
872
878
 
873
- `), p = e.views.map((c) => {
874
- const u = Le(c, e);
875
- return ` ${c.name}: ${k(u)},`;
879
+ `), p = e.views.map((l) => {
880
+ const u = ze(l, e);
881
+ return ` ${l.name}: ${k(u)},`;
876
882
  }).join(`
877
- `), f = e.views.map((c) => {
878
- const d = Y(c, e).map((m) => ` ${m.name}: resolveColumnKey(columns, fieldsForView.${c.name}.${m.name}),`).join(`
883
+ `), f = e.views.map((l) => {
884
+ const d = Y(l, e).map((m) => ` ${m.name}: resolveColumnKey(columns, fieldsForView.${l.name}.${m.name}),`).join(`
879
885
  `);
880
- return ` ${c.name}(columns: SemaphorGeneratedColumns): Record<keyof typeof fieldsForView.${c.name}, string | undefined> {
886
+ return ` ${l.name}(columns: SemaphorGeneratedColumns): Record<keyof typeof fieldsForView.${l.name}, string | undefined> {
881
887
  return {
882
888
  ${d}
883
889
  };
884
890
  },`;
885
891
  }).join(`
886
892
 
887
- `), h = e.views.map((c) => {
888
- const d = Y(c, e).map((m) => ` ${m.name}: readCell(row, columns, fieldsForView.${c.name}.${m.name}),`).join(`
893
+ `), h = e.views.map((l) => {
894
+ const d = Y(l, e).map((m) => ` ${m.name}: readCell(row, columns, fieldsForView.${l.name}.${m.name}),`).join(`
889
895
  `);
890
- return ` ${c.name}(row: SemaphorGeneratedRow, columns: SemaphorGeneratedColumns): Record<keyof typeof fieldsForView.${c.name}, unknown> {
896
+ return ` ${l.name}(row: SemaphorGeneratedRow, columns: SemaphorGeneratedColumns): Record<keyof typeof fieldsForView.${l.name}, unknown> {
891
897
  return {
892
898
  ${d}
893
899
  };
@@ -903,7 +909,7 @@ ${d}
903
909
  y ? 'import { fields } from "./fields";' : void 0
904
910
  ].filter(O).join(`
905
911
  `);
906
- return `${v}
912
+ return `${H}
907
913
  ${I}
908
914
 
909
915
  export type SemaphorGeneratedRow = Record<string, unknown>;
@@ -1251,7 +1257,7 @@ function sourcesReferToSameDataset(
1251
1257
  }
1252
1258
  `;
1253
1259
  }
1254
- function Le(e, n) {
1260
+ function ze(e, n) {
1255
1261
  const r = Y(e, n), o = new Map(
1256
1262
  (K(e) ? z(e, n) : []).map((t) => [t.fieldName, t.key])
1257
1263
  );
@@ -1266,7 +1272,7 @@ function Le(e, n) {
1266
1272
  });
1267
1273
  });
1268
1274
  }
1269
- function Je(e) {
1275
+ function Ye(e) {
1270
1276
  const n = e.checklist.filterScopeByInput || [], r = e.checklist.requiredDevtools || {}, o = e.summary.views.map((i) => i.id).filter(Boolean), t = e.views.map((i) => i.raw.id).filter(Boolean), a = e.inputs.map((i) => i.raw.id).filter(Boolean), p = e.optionQueries.map((i) => i.raw.id || `${i.input.raw.id}-options`).filter(Boolean), f = Object.fromEntries(t.map((i) => [
1271
1277
  i,
1272
1278
  e.filterContracts.filter(
@@ -1282,18 +1288,18 @@ function Je(e) {
1282
1288
  sdkBuilder: i.raw.sdkBuilder
1283
1289
  }
1284
1290
  ])), y = Object.fromEntries(e.views.map((i) => {
1285
- var I, c, u;
1291
+ var I, l, u;
1286
1292
  return [
1287
1293
  i.name,
1288
1294
  A({
1289
1295
  viewId: i.raw.id,
1290
1296
  viewTitle: ((I = i.raw.visualSpec) == null ? void 0 : I.title) || i.raw.title,
1291
- visualType: (c = i.raw.visualSpec) == null ? void 0 : c.visualType,
1297
+ visualType: (l = i.raw.visualSpec) == null ? void 0 : l.visualType,
1292
1298
  title: ((u = i.raw.visualSpec) == null ? void 0 : u.title) || i.raw.title
1293
1299
  })
1294
1300
  ];
1295
1301
  }));
1296
- return `${v}
1302
+ return `${H}
1297
1303
  export const generatedViewIds = ${k(o)} as const;
1298
1304
  export const generatedQueryViewIds = ${k(t)} as const;
1299
1305
  export const generatedInputIds = ${k(a)} as const;
@@ -1343,8 +1349,8 @@ export const semaphorGeneratedContractMetadata = ${k({
1343
1349
  })} as const;
1344
1350
  `;
1345
1351
  }
1346
- function ze() {
1347
- return `${v}
1352
+ function We() {
1353
+ return `${H}
1348
1354
  export * from "./sources";
1349
1355
  export * from "./fields";
1350
1356
  export * from "./inputs";
@@ -1367,14 +1373,14 @@ function T(e, n) {
1367
1373
  }
1368
1374
  function Y(e, n) {
1369
1375
  const r = [];
1370
- if (Xe(r, e.raw.sdkSpec), r.length === 0)
1376
+ if (nn(r, e.raw.sdkSpec), r.length === 0)
1371
1377
  for (const t of e.raw.fields || [])
1372
1378
  g(r, t);
1373
1379
  const o = X(
1374
1380
  r.filter((t) => t.name && R(t, n)).map((t) => ({ raw: t, key: D(t), name: "" })),
1375
1381
  (t) => t.key
1376
1382
  );
1377
- return H(
1383
+ return v(
1378
1384
  o,
1379
1385
  (t) => Q(t.raw.label || t.raw.name || "field")
1380
1386
  ), o;
@@ -1390,12 +1396,12 @@ function L(e, n) {
1390
1396
  o.filter((a) => a.name && R(a, n)).map((a) => ({ raw: a, key: D(a), name: "" })),
1391
1397
  (a) => a.key
1392
1398
  );
1393
- return H(
1399
+ return v(
1394
1400
  t,
1395
1401
  (a) => Q(a.raw.label || a.raw.name || "metric")
1396
1402
  ), t;
1397
1403
  }
1398
- function Ye(e, n) {
1404
+ function Ze(e, n) {
1399
1405
  if (n.length === 1)
1400
1406
  return /* @__PURE__ */ new Set([n[0].name]);
1401
1407
  const r = $(e.raw.sdkSpec.spec);
@@ -1404,16 +1410,16 @@ function Ye(e, n) {
1404
1410
  const o = D(P(r.primaryMeasure)), t = n.find((a) => a.key === o);
1405
1411
  return t ? /* @__PURE__ */ new Set([t.name]) : /* @__PURE__ */ new Set();
1406
1412
  }
1407
- function We(e) {
1413
+ function Xe(e) {
1408
1414
  const n = /* @__PURE__ */ new Map();
1409
1415
  for (const r of e)
1410
- for (const o of new Set(ye(r.raw)))
1416
+ for (const o of new Set(ge(r.raw)))
1411
1417
  n.set(o, (n.get(o) || 0) + 1);
1412
1418
  return new Set(
1413
1419
  Array.from(n.entries()).filter(([, r]) => r > 1).map(([r]) => r)
1414
1420
  );
1415
1421
  }
1416
- function ye(e) {
1422
+ function ge(e) {
1417
1423
  const n = (e.aggregate || "SUM").toUpperCase();
1418
1424
  return _([
1419
1425
  `${n.toLowerCase()}_${e.name}`,
@@ -1423,7 +1429,7 @@ function ye(e) {
1423
1429
  e.name
1424
1430
  ]);
1425
1431
  }
1426
- function Ze(e) {
1432
+ function en(e) {
1427
1433
  const n = /* @__PURE__ */ new Map();
1428
1434
  for (const r of e)
1429
1435
  n.set(r.raw.name, (n.get(r.raw.name) || 0) + 1);
@@ -1431,7 +1437,7 @@ function Ze(e) {
1431
1437
  Array.from(n.entries()).filter(([, r]) => r > 1).map(([r]) => r)
1432
1438
  );
1433
1439
  }
1434
- function Xe(e, n) {
1440
+ function nn(e, n) {
1435
1441
  const r = $(n.spec);
1436
1442
  if (!r)
1437
1443
  return;
@@ -1452,22 +1458,22 @@ function Xe(e, n) {
1452
1458
  return;
1453
1459
  }
1454
1460
  if (o === "matrix") {
1455
- const t = le(r.rows), a = le(r.columns), p = q(r.values);
1456
- for (const f of t) pe(e, f);
1457
- for (const f of a) pe(e, f);
1461
+ const t = pe(r.rows), a = pe(r.columns), p = q(r.values);
1462
+ for (const f of t) le(e, f);
1463
+ for (const f of a) le(e, f);
1458
1464
  for (const f of p) {
1459
1465
  const h = $(f);
1460
1466
  g(e, h == null ? void 0 : h.field), g(e, h == null ? void 0 : h.measure);
1461
1467
  }
1462
1468
  }
1463
1469
  }
1464
- function le(e) {
1470
+ function pe(e) {
1465
1471
  if (Array.isArray(e))
1466
1472
  return e;
1467
1473
  const n = $(e);
1468
1474
  return Array.isArray(n == null ? void 0 : n.levels) ? n.levels : [];
1469
1475
  }
1470
- function pe(e, n) {
1476
+ function le(e, n) {
1471
1477
  var r;
1472
1478
  if (N(n)) {
1473
1479
  g(e, n);
@@ -1479,7 +1485,7 @@ function ce(e) {
1479
1485
  var n, r, o, t;
1480
1486
  return ((n = e == null ? void 0 : e.computation) == null ? void 0 : n.kind) === "presentation_only" || ((r = e == null ? void 0 : e.computation) == null ? void 0 : r.kind) === "derived" || ((o = e == null ? void 0 : e.computation) == null ? void 0 : o.kind) === "unsupported" || (e == null ? void 0 : e.visual) === "text_block" || ((t = e == null ? void 0 : e.visualSpec) == null ? void 0 : t.visualType) === "text_block";
1481
1487
  }
1482
- function en(e) {
1488
+ function rn(e) {
1483
1489
  const n = $(e) || {};
1484
1490
  return A({
1485
1491
  id: e.id,
@@ -1509,18 +1515,18 @@ function P(e) {
1509
1515
  ...e.source ? { source: e.source } : {}
1510
1516
  };
1511
1517
  }
1512
- function nn(e) {
1518
+ function tn(e) {
1513
1519
  if (!e.source)
1514
1520
  return;
1515
1521
  const n = {
1516
1522
  ...e.source,
1517
1523
  ...e.sourceKey ? { sourceKey: e.sourceKey } : {}
1518
- }, r = Se(n);
1524
+ }, r = we(n);
1519
1525
  if (r)
1520
1526
  return {
1521
1527
  raw: n,
1522
1528
  key: r,
1523
- aliases: we(n),
1529
+ aliases: $e(n),
1524
1530
  name: ""
1525
1531
  };
1526
1532
  }
@@ -1528,7 +1534,7 @@ function N(e) {
1528
1534
  const n = $(e);
1529
1535
  return !!(n && typeof n.name == "string" && (typeof n.role == "string" || typeof n.dataType == "string" || typeof n.aggregate == "string" || n.source || n.sourceKey));
1530
1536
  }
1531
- function ge(e) {
1537
+ function he(e) {
1532
1538
  const n = $(e);
1533
1539
  return !!(n && (typeof n.sourceKey == "string" || n.kind === "semantic" || typeof n.datasetName == "string" && typeof n.domainId == "string"));
1534
1540
  }
@@ -1543,8 +1549,8 @@ function C(e, n) {
1543
1549
  const t = R(P(e), n);
1544
1550
  if (t) return `fields.${t}`;
1545
1551
  }
1546
- if (ge(e)) {
1547
- const t = he(e, n);
1552
+ if (he(e)) {
1553
+ const t = Se(e, n);
1548
1554
  if (t) return `sources.${t}`;
1549
1555
  }
1550
1556
  const r = $(e);
@@ -1557,8 +1563,8 @@ function R(e, n) {
1557
1563
  if (N(e))
1558
1564
  return n.fieldNameByKey.get(D(P(e)));
1559
1565
  }
1560
- function he(e, n) {
1561
- if (ge(e))
1566
+ function Se(e, n) {
1567
+ if (he(e))
1562
1568
  for (const r of Z(e)) {
1563
1569
  const o = n.sourceNameByKey.get(r);
1564
1570
  if (o)
@@ -1573,15 +1579,15 @@ function D(e) {
1573
1579
  e.aggregate || ""
1574
1580
  ].join("|");
1575
1581
  }
1576
- function rn(e, n) {
1582
+ function on(e, n) {
1577
1583
  return !N(e) || !N(n) || e.name !== n.name ? !1 : ie(e).some(
1578
1584
  (r) => ie(n).includes(r)
1579
1585
  );
1580
1586
  }
1581
- function tn(e) {
1587
+ function sn(e) {
1582
1588
  return N(e) && e.role === "id";
1583
1589
  }
1584
- function on(e) {
1590
+ function an(e) {
1585
1591
  const n = [], r = /* @__PURE__ */ new Map();
1586
1592
  for (const o of e) {
1587
1593
  const t = _(o.aliases.length ? o.aliases : [o.key]), a = t.map((p) => r.get(p)).find(O);
@@ -1595,7 +1601,7 @@ function on(e) {
1595
1601
  }
1596
1602
  return n;
1597
1603
  }
1598
- function sn(e) {
1604
+ function un(e) {
1599
1605
  const n = /* @__PURE__ */ new Map();
1600
1606
  for (const r of e)
1601
1607
  for (const o of _([r.key, ...r.aliases])) {
@@ -1609,7 +1615,7 @@ function sn(e) {
1609
1615
  function _(e) {
1610
1616
  return Array.from(new Set(e.filter(Boolean)));
1611
1617
  }
1612
- function Se(e) {
1618
+ function we(e) {
1613
1619
  return Z(e)[0] || de(e);
1614
1620
  }
1615
1621
  function Z(e) {
@@ -1623,14 +1629,14 @@ function Z(e) {
1623
1629
  }
1624
1630
  return r.length === 0 && r.push(de(e)), _(r);
1625
1631
  }
1626
- function we(e) {
1632
+ function $e(e) {
1627
1633
  return Z(e);
1628
1634
  }
1629
1635
  function de(e) {
1630
1636
  const n = $(e);
1631
1637
  return n ? typeof n.sourceKey == "string" ? n.sourceKey : JSON.stringify(n) : "";
1632
1638
  }
1633
- function an(e) {
1639
+ function dn(e) {
1634
1640
  return N(e) && ie(e)[0] || "";
1635
1641
  }
1636
1642
  function ie(e) {
@@ -1645,15 +1651,15 @@ function B(e) {
1645
1651
  throw new Error(`Unsupported sdkSpec builder: ${e}`);
1646
1652
  return n;
1647
1653
  }
1648
- function un(e) {
1654
+ function pn(e) {
1649
1655
  const n = B(e);
1650
1656
  return n === "records" || n === "sql";
1651
1657
  }
1652
- function dn(e) {
1658
+ function ln(e) {
1653
1659
  const n = $(e);
1654
1660
  return typeof (n == null ? void 0 : n.operator) == "string" ? n.operator : e.type === "date_range" ? "between" : e.type === "multi_select" || e.type === "select" ? "in" : "=";
1655
1661
  }
1656
- function H(e, n) {
1662
+ function v(e, n) {
1657
1663
  const r = /* @__PURE__ */ new Map();
1658
1664
  for (const o of e) {
1659
1665
  const t = n(o) || "item", a = r.get(t) || 0;
@@ -1678,7 +1684,7 @@ function Q(e) {
1678
1684
  ].join("");
1679
1685
  return /^[A-Za-z_$]/.test(t) ? t : `item${t}`;
1680
1686
  }
1681
- function ln(e) {
1687
+ function cn(e) {
1682
1688
  const n = String(e).split(":");
1683
1689
  return n[n.length - 1] || String(e);
1684
1690
  }
@@ -1698,24 +1704,24 @@ function O(e) {
1698
1704
  return e !== void 0;
1699
1705
  }
1700
1706
  export {
1701
- Fn as CODEGEN_SUMMARY_SCHEMA_VERSION,
1702
- be as CODEGEN_SUMMARY_VALIDATOR_VERSION,
1703
- Ve as CONTRACT_MANIFEST_SCHEMA_VERSION,
1704
- mn as DEFAULT_GENERATED_CONTRACT_OUTPUT_DIR,
1707
+ Vn as CODEGEN_SUMMARY_SCHEMA_VERSION,
1708
+ ke as CODEGEN_SUMMARY_VALIDATOR_VERSION,
1709
+ Re as CONTRACT_MANIFEST_SCHEMA_VERSION,
1710
+ yn as DEFAULT_GENERATED_CONTRACT_OUTPUT_DIR,
1705
1711
  me as GENERATED_CONTRACT_SCHEMA_VERSION,
1706
- bn as GENERATED_CONTRACT_TYPESCRIPT_FILES,
1707
- Vn as REQUIRED_GENERATED_CONTRACT_FILES,
1708
- hn as SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION,
1709
- Sn as SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION,
1710
- Fe as assertValidCodegenSummary,
1711
- kn as buildSemaphorGeneratedActiveInput,
1712
- Rn as buildSemaphorGeneratedInputOptionIntent,
1713
- Mn as buildSemaphorGeneratedViewExecutionRequest,
1714
- Nn as buildSemaphorGeneratedViewExecutionRequests,
1715
- xn as evaluateSemaphorDataAppContractUpdatePolicy,
1716
- fn as generateSemaphorDataAppContract,
1717
- wn as isSemaphorDataAppCodegenSummary,
1718
- Cn as validateCodegenSummary,
1719
- $n as validateSemaphorDataAppCodegenSummary,
1720
- On as validateSemaphorGeneratedContract
1712
+ kn as GENERATED_CONTRACT_TYPESCRIPT_FILES,
1713
+ Rn as REQUIRED_GENERATED_CONTRACT_FILES,
1714
+ wn as SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION,
1715
+ $n as SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION,
1716
+ Ve as assertValidCodegenSummary,
1717
+ Mn as buildSemaphorGeneratedActiveInput,
1718
+ Nn as buildSemaphorGeneratedInputOptionIntent,
1719
+ xn as buildSemaphorGeneratedViewExecutionRequest,
1720
+ Cn as buildSemaphorGeneratedViewExecutionRequests,
1721
+ On as evaluateSemaphorDataAppContractUpdatePolicy,
1722
+ gn as generateSemaphorDataAppContract,
1723
+ In as isSemaphorDataAppCodegenSummary,
1724
+ Gn as validateCodegenSummary,
1725
+ Fn as validateSemaphorDataAppCodegenSummary,
1726
+ Kn as validateSemaphorGeneratedContract
1721
1727
  };