react-semaphor 0.1.583 → 0.1.585

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 (95) hide show
  1. package/dist/analytics-protocol/index.js +470 -428
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/brand-studio/index.js +7 -7
  4. package/dist/briefings/index.js +4 -4
  5. package/dist/chunks/aggregate-measure-field-DsFXETpI.js +22 -0
  6. package/dist/chunks/{assistant-chat-D3fm5qod.js → assistant-chat-BdbLmAnK.js} +12 -12
  7. package/dist/chunks/{bookmark-impact-Dpxl46Wd.js → bookmark-impact-BhT3k379.js} +2 -2
  8. package/dist/chunks/{bookmark-state-BEl_G9vr.js → bookmark-state-CL4WEpgB.js} +22 -22
  9. package/dist/chunks/{card-filter-builder-IxkFVxy2.js → card-filter-builder-CEcKF6Fw.js} +124 -124
  10. package/dist/chunks/comparison-window-caption-CoART8BC.js +1254 -0
  11. package/dist/chunks/{dashboard-BMqG98fc.js → dashboard-MPku_x1M.js} +1 -1
  12. package/dist/chunks/{dashboard-briefing-launcher-D45YfCkm.js → dashboard-briefing-launcher-CkFNlkr1.js} +13 -13
  13. package/dist/chunks/{dashboard-controls-DOvZRfof.js → dashboard-controls-Clt4ovXS.js} +84 -84
  14. package/dist/chunks/{dashboard-json-B_4TqF_o.js → dashboard-json-DSmXazIg.js} +4 -4
  15. package/dist/chunks/{dates-44_rcNj2.js → dates-CYZW9owO.js} +8 -8
  16. package/dist/chunks/{edit-dashboard-visual-BBPKJWSe.js → edit-dashboard-visual-Dn2ECRbX.js} +2752 -2687
  17. package/dist/chunks/filter-line-Cu2u1K36.js +131 -0
  18. package/dist/chunks/{filter-reach-copy-DWPq4Swi.js → filter-reach-copy-CmJpPa4G.js} +1745 -1326
  19. package/dist/chunks/{filter-value-text-DXGYypEd.js → filter-value-text-xefXzZlf.js} +6 -6
  20. package/dist/chunks/{index-DPRzcFp0.js → index-0WYn6RMz.js} +37 -37
  21. package/dist/chunks/{layout-grid-8rR-LPTk.js → layout-grid-9nSS2SL-.js} +1 -1
  22. package/dist/chunks/{list-filter-C1-uTgjR.js → list-filter-CfMPI6v4.js} +1 -1
  23. package/dist/chunks/{matrix-analytical-definition-D_HgptqZ.js → matrix-analytical-definition-QjBgUYhP.js} +382 -544
  24. package/dist/chunks/{matrix-member-presentation-DRa-9e6Q.js → matrix-member-presentation-BKDyxJho.js} +1 -1
  25. package/dist/chunks/{matrix-operation-contract-DCVinw1o.js → matrix-operation-contract-BM5TveR3.js} +153 -147
  26. package/dist/chunks/{metric-comparison-n9NsIa-2.js → metric-comparison-ZmurmEIs.js} +3 -3
  27. package/dist/chunks/{paintbrush-aR17Z3C9.js → paintbrush-LzAje2ff.js} +1 -1
  28. package/dist/chunks/{palette-a5FCZKFI.js → palette-DicJG0TC.js} +1 -1
  29. package/dist/chunks/{pivot-header-presentation-MvvlxtIB.js → pivot-header-presentation-CdeTU96P.js} +1 -1
  30. package/dist/chunks/{pivot-result-contract-expectations-8tuNjRvG.js → pivot-result-contract-expectations-Bx_BCu-7.js} +1029 -1010
  31. package/dist/chunks/{pivot-result-identity-B89X5xjb.js → pivot-result-identity-Bvs6Uq3v.js} +1 -1
  32. package/dist/chunks/raw-temporal-value-DH-feMc2.js +322 -0
  33. package/dist/chunks/{report-preferences-dialog-B8PhISua.js → report-preferences-dialog-BRaeufEi.js} +63 -62
  34. package/dist/chunks/{report-runtime-context-BhPzLTbS.js → report-runtime-context-NlOXwyRB.js} +1 -1
  35. package/dist/chunks/{resolve-dashboard-input-context-BfT8y5xL.js → resolve-dashboard-input-context-Cn9jumxl.js} +4924 -4823
  36. package/dist/chunks/{save-D985VvYp.js → save-0wu1Z1U7.js} +1 -1
  37. package/dist/chunks/{saved-dashboard-context-DH91-2B9.js → saved-dashboard-context-CfqkUMzR.js} +6 -6
  38. package/dist/chunks/selection-filter-compiler-BReJy-uv.js +92 -0
  39. package/dist/chunks/{semaphor-ready-indicator-Cg_Z2IDc.js → semaphor-ready-indicator-D6WjdTGl.js} +48377 -47074
  40. package/dist/chunks/{shelf-drop-preview-context-C7-BgcP4.js → shelf-drop-preview-context-Bbbrr9u4.js} +5 -5
  41. package/dist/chunks/{stored-dashboard-BpyCiE49.js → stored-dashboard-sPkTjxYf.js} +210 -221
  42. package/dist/chunks/{style-sheet-parts-C7qGZuH1.js → style-sheet-parts-_dGSFzDi.js} +2 -2
  43. package/dist/chunks/{table-export-sheet-wBkk17aa.js → table-export-sheet-Dmtqi5NV.js} +1 -1
  44. package/dist/chunks/{token-types-iKMplaBL.js → token-types-DEe_FP4l.js} +1 -1
  45. package/dist/chunks/{upload-CiGNKJ_0.js → upload-CtyOkU_B.js} +1 -1
  46. package/dist/chunks/{validators-B8fpdinG.js → validators-CJ8Jh0E8.js} +2 -2
  47. package/dist/chunks/{variable-draft-D8GFhAkm.js → variable-draft-D1RotIEG.js} +4 -4
  48. package/dist/dashboard/index.js +2 -2
  49. package/dist/dashboard-authoring/index.js +670 -647
  50. package/dist/format-utils/index.js +218 -215
  51. package/dist/index.js +234 -231
  52. package/dist/report-runtime-context/index.js +1 -1
  53. package/dist/style.css +1 -1
  54. package/dist/surfboard/index.js +2 -2
  55. package/dist/types/components/visual/data-table/types/data-table.d.ts +3 -0
  56. package/dist/types/components/visual/matrix-table/matrix-interaction-actions.d.ts +24 -3
  57. package/dist/types/index.js +5 -5
  58. package/dist/types/lib/hooks/interactions/use-drill-actions.d.ts +1 -1
  59. package/dist/types/lib/interactions/get-click-context-from-chartjs.d.ts +9 -0
  60. package/dist/types/lib/matrix-table/matrix-runtime.d.ts +8 -3
  61. package/dist/types/lib/query-context/compile-selection-filters.d.ts +1 -5
  62. package/dist/types/lib/see-records/click.d.ts +79 -0
  63. package/dist/types/lib/see-records/see-records-offer.d.ts +25 -0
  64. package/dist/types/lib/see-records/use-see-records-offer.d.ts +16 -0
  65. package/dist/types/lib/types/common-types.d.ts +6 -0
  66. package/dist/types/shared/analytics-protocol/aggregate-expression.d.ts +7 -0
  67. package/dist/types/shared/analytics-protocol/aggregate-measure-field.d.ts +13 -0
  68. package/dist/types/shared/analytics-protocol/index.d.ts +1 -0
  69. package/dist/types/shared/analytics-protocol/selection-filter-compiler.d.ts +3 -0
  70. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +6 -0
  71. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
  72. package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +1 -1
  73. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -0
  74. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +2 -0
  75. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +1 -0
  76. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
  77. package/dist/types/shared/dashboard-authoring/index.d.ts +2 -0
  78. package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +191 -0
  79. package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +14 -0
  80. package/dist/types/shared/dashboard-authoring/see-records/availability.d.ts +30 -0
  81. package/dist/types/shared/dashboard-authoring/see-records/click.d.ts +37 -0
  82. package/dist/types/shared/dashboard-authoring/see-records/index.d.ts +12 -0
  83. package/dist/types/shared/dashboard-authoring/see-records/limits.d.ts +18 -0
  84. package/dist/types/shared/dashboard-authoring/see-records/measure-kind.d.ts +49 -0
  85. package/dist/types/shared/dashboard-authoring/see-records/request.d.ts +28 -0
  86. package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +94 -0
  87. package/dist/types/shared/format-utils/semantic-format.d.ts +0 -1
  88. package/dist/types/shared/format-utils/temporal-bucket.d.ts +20 -0
  89. package/dist/types/shared/temporal/calendar-periods.d.ts +15 -0
  90. package/dist/types/shared/temporal/raw-temporal-equality.d.ts +14 -0
  91. package/dist/types/shared/usage-events/envelope.d.ts +4 -4
  92. package/package.json +1 -1
  93. package/dist/chunks/comparison-window-caption-sRFtnX1q.js +0 -1371
  94. package/dist/chunks/raw-temporal-value-DdT0s47W.js +0 -159
  95. package/dist/chunks/selection-filter-compiler-CUDRnUxc.js +0 -80
@@ -1,206 +1,58 @@
1
- import { am as N, ao as Q, ag as X, ae as p, an as _e, af as ie, at as De, ah as Ae, a5 as K, I as ae, o as Ee } from "./validators-B8fpdinG.js";
2
- import { r as qe } from "./metric-comparison-n9NsIa-2.js";
3
- import { b as Z, d as Be, w as _ } from "./raw-temporal-value-DdT0s47W.js";
4
- const Y = 864e5, ee = {
5
- second: 1e3,
6
- minute: 6e4,
7
- hour: 36e5
8
- };
9
- function G(e, t) {
10
- return {
11
- ...Z(e, t),
12
- millisecond: (e.getTime() % 1e3 + 1e3) % 1e3
13
- };
14
- }
15
- function E(e, t) {
16
- return Be(e, t);
17
- }
18
- function O(e) {
19
- const t = new Date(e);
20
- return {
21
- year: t.getUTCFullYear(),
22
- month: t.getUTCMonth() + 1,
23
- day: t.getUTCDate(),
24
- hour: t.getUTCHours(),
25
- minute: t.getUTCMinutes(),
26
- second: t.getUTCSeconds(),
27
- millisecond: t.getUTCMilliseconds()
28
- };
29
- }
30
- function le(e, t) {
31
- const n = /* @__PURE__ */ new Date(0);
32
- return n.setUTCFullYear(e, t, 0), n.getUTCDate();
33
- }
34
- function L(e, t) {
35
- const n = e.year * 12 + (e.month - 1) + t, i = Math.floor(n / 12), a = n - i * 12 + 1;
36
- return { ...e, year: i, month: a, day: Math.min(e.day, le(i, a)) };
37
- }
38
- function q(e, t, n) {
39
- if (t === 0) return e;
40
- switch (n) {
41
- case "second":
42
- case "minute":
43
- case "hour":
44
- return O(
45
- _(e) + t * ee[n]
46
- );
47
- case "day":
48
- return O(_(e) + t * Y);
49
- case "week":
50
- return O(_(e) + t * 7 * Y);
51
- case "month":
52
- return L(e, t);
53
- case "quarter":
54
- return L(e, t * 3);
55
- case "year":
56
- return L(e, t * 12);
57
- }
58
- }
59
- function xe(e) {
60
- return new Date(
61
- _({ ...e, hour: 0, minute: 0, second: 0 })
62
- ).getUTCDay();
63
- }
64
- function oe(e) {
65
- var n;
66
- const t = (n = e.fiscalCalendar) == null ? void 0 : n.yearStartMonth;
67
- return t && t >= 1 && t <= 12 ? t : 1;
68
- }
69
- function Fe(e, t, n) {
70
- const i = { ...e, hour: 0, minute: 0, second: 0, millisecond: 0 };
71
- switch (t) {
72
- case "day":
73
- return i;
74
- case "week":
75
- return q(
76
- i,
77
- -((xe(e) - n.weekStart + 7) % 7),
78
- "day"
79
- );
80
- case "month":
81
- return { ...i, day: 1 };
82
- case "quarter": {
83
- const a = (e.month - oe(n) + 12) % 12;
84
- return L({ ...i, day: 1 }, -(a % 3));
85
- }
86
- case "year": {
87
- const a = oe(n);
88
- return {
89
- ...i,
90
- year: e.month >= a ? e.year : e.year - 1,
91
- month: a,
92
- day: 1
93
- };
94
- }
95
- }
96
- }
97
- function B(e, t, n, i = 0) {
98
- const a = ee[t];
99
- if (a !== void 0) {
100
- const o = G(e, n.tz), d = o.millisecond + (t === "second" ? 0 : o.second * 1e3) + (t === "hour" ? o.minute * 6e4 : 0), c = e.getTime() - d + i * a;
101
- return { start: new Date(c), endExclusive: new Date(c + a) };
102
- }
103
- const s = t, r = q(
104
- Fe(G(e, n.tz), s, n),
105
- i,
106
- t
107
- );
108
- return {
109
- start: E(r, n.tz),
110
- endExclusive: E(q(r, 1, t), n.tz)
111
- };
112
- }
113
- function V(e, t, n) {
114
- return B(e, t, n).start;
115
- }
116
- function D(e, t, n) {
117
- return new Date(B(e, t, n).endExclusive.getTime() - 1);
118
- }
119
- function ue(e, t, n, i) {
120
- return t === 0 ? e : E(
121
- q(G(e, i.tz), t, n),
122
- i.tz
123
- );
124
- }
125
- function yt(e, t, n) {
126
- const i = (a) => {
127
- const { year: s, month: r, day: o } = Z(a, n);
128
- return _({ year: s, month: r, day: o, hour: 0, minute: 0, second: 0 });
129
- };
130
- return Math.round((i(t) - i(e)) / Y);
131
- }
132
- const He = /^(\d{4})-(\d{2})-(\d{2})$/;
133
- function bt(e, t) {
134
- const { year: n, month: i, day: a } = Z(e, t);
135
- return `${String(n).padStart(4, "0")}-${String(i).padStart(2, "0")}-${String(a).padStart(2, "0")}`;
136
- }
137
- function fe(e) {
138
- const t = He.exec(e);
139
- if (!t) return null;
140
- const n = Number(t[1]), i = Number(t[2]), a = Number(t[3]);
141
- return i < 1 || i > 12 || a < 1 || a > le(n, i) ? null : { year: n, month: i, day: a };
142
- }
143
- function gt(e, t) {
144
- const n = fe(e);
145
- if (!n) return null;
146
- const i = { ...n, hour: 0, minute: 0, second: 0, millisecond: 0 };
147
- return {
148
- start: E(i, t),
149
- endExclusive: E(q(i, 1, "day"), t)
150
- };
151
- }
152
- class re extends Error {
1
+ import { k as R, l as T, E as be, m as ee, j as Q, q as ye } from "./raw-temporal-value-DH-feMc2.js";
2
+ import { am as C, ao as w, ag as W, ae as p, an as ge, af as G, at as he, ah as pe, a5 as M, I as V, o as ve } from "./validators-CJ8Jh0E8.js";
3
+ import { a as ke } from "./metric-comparison-ZmurmEIs.js";
4
+ class J extends Error {
153
5
  constructor(t) {
154
6
  super(t), this.name = "RelativeDateUsageError";
155
7
  }
156
8
  }
157
- function Pe(e, t, n = {}) {
9
+ function Ie(e, t, n = {}) {
158
10
  const i = n.spansBack ?? 0;
159
- if (i !== 0) return Le(e, t, i);
160
- const { calendar: a, now: s } = t;
11
+ if (i !== 0) return Ne(e, t, i);
12
+ const { calendar: a, now: r } = t;
161
13
  switch (e.kind) {
162
14
  case "periods": {
163
- const r = me(e, t);
15
+ const s = te(e, t);
164
16
  return {
165
- start: B(r, e.unit, a, e.from).start,
166
- end: e.toDate ? r : ye(r, e.unit, a, e.to)
17
+ start: Q(s, e.unit, a, e.from).start,
18
+ end: e.toDate ? s : ne(s, e.unit, a, e.to)
167
19
  };
168
20
  }
169
21
  case "rolling": {
170
- const r = e.anchor === "latest_data" ? t.latestData ?? s : s, o = ee[e.unit];
22
+ const s = e.anchor === "latest_data" ? t.latestData ?? r : r, o = be[e.unit];
171
23
  return {
172
- start: o === void 0 ? ue(r, -e.n, e.unit, a) : new Date(r.getTime() - e.n * o),
173
- end: r
24
+ start: o === void 0 ? ee(s, -e.n, e.unit, a) : new Date(s.getTime() - e.n * o),
25
+ end: s
174
26
  };
175
27
  }
176
28
  case "monthDay": {
177
- const r = e.day === "first" ? V(s, "month", a) : D(s, "month", a);
178
- return { start: V(r, "day", a), end: D(r, "day", a) };
29
+ const s = e.day === "first" ? R(r, "month", a) : T(r, "month", a);
30
+ return { start: R(s, "day", a), end: T(s, "day", a) };
179
31
  }
180
32
  }
181
33
  }
182
- function me(e, t) {
34
+ function te(e, t) {
183
35
  const { anchor: n } = e;
184
- return n === "latest_data" ? t.latestData ?? t.now : n === "now" ? t.now : new Date(V(t.now, n.lastComplete, t.calendar).getTime() - 1);
36
+ return n === "latest_data" ? t.latestData ?? t.now : n === "now" ? t.now : new Date(R(t.now, n.lastComplete, t.calendar).getTime() - 1);
185
37
  }
186
- function ye(e, t, n, i) {
187
- return new Date(B(e, t, n, i).endExclusive.getTime() - 1);
38
+ function ne(e, t, n, i) {
39
+ return new Date(Q(e, t, n, i).endExclusive.getTime() - 1);
188
40
  }
189
- function Le(e, t, n) {
41
+ function Ne(e, t, n) {
190
42
  if (!Number.isInteger(n) || n < 0)
191
- throw new re(`spansBack must be a whole number of spans, got ${n}.`);
43
+ throw new J(`spansBack must be a whole number of spans, got ${n}.`);
192
44
  if (e.kind !== "periods" || typeof e.anchor != "object")
193
- throw new re("spansBack applies only to a window anchored at the end of the last complete period.");
194
- const { calendar: i } = t, { unit: a } = e, s = Pe(e, t), r = -n * (e.to - e.from + 1), o = B(s.start, a, i, r).start;
195
- if (D(s.end, a, i).getTime() === s.end.getTime())
196
- return { start: o, end: ye(s.end, a, i, r) };
197
- const d = ue(me(e, t), r, a, i), c = Math.min(
198
- D(d, e.anchor.lastComplete, i).getTime(),
199
- D(d, a, i).getTime()
45
+ throw new J("spansBack applies only to a window anchored at the end of the last complete period.");
46
+ const { calendar: i } = t, { unit: a } = e, r = Ie(e, t), s = -n * (e.to - e.from + 1), o = Q(r.start, a, i, s).start;
47
+ if (T(r.end, a, i).getTime() === r.end.getTime())
48
+ return { start: o, end: ne(r.end, a, i, s) };
49
+ const l = ee(te(e, t), s, a, i), c = Math.min(
50
+ T(l, e.anchor.lastComplete, i).getTime(),
51
+ T(l, a, i).getTime()
200
52
  );
201
53
  return { start: o, end: new Date(c) };
202
54
  }
203
- function be(e) {
55
+ function ie(e) {
204
56
  return e.prefixLevels.length === 1 && e.prefixLevels[0] === "table" ? ["table"] : Array.from(
205
57
  /* @__PURE__ */ new Set([
206
58
  "database",
@@ -208,34 +60,34 @@ function be(e) {
208
60
  ])
209
61
  );
210
62
  }
211
- function ht(e) {
212
- const t = e.source.connectionType ? N(e.source.connectionType) : void 0, n = e.source.dialect ? Q(e.source.dialect) : void 0, i = e.source.dialect && e.source.dialect !== "unknown" ? N(e.source.dialect) : void 0;
63
+ function et(e) {
64
+ const t = e.source.connectionType ? C(e.source.connectionType) : void 0, n = e.source.dialect ? w(e.source.dialect) : void 0, i = e.source.dialect && e.source.dialect !== "unknown" ? C(e.source.dialect) : void 0;
213
65
  if (!e.capabilities && e.source.connectionType && e.source.dialect && e.source.dialect !== "unknown" && (!t || n === "unknown" || t.dialect !== n))
214
66
  return { kind: "incompatible_capabilities" };
215
67
  const a = e.capabilities || t || i;
216
68
  if (!a) return { kind: "incompatible_capabilities" };
217
- const s = be(a), r = {
218
- ...s.includes("database") && e.source.databaseName ? { databaseName: e.source.databaseName } : {},
219
- ...s.includes("schema") && e.source.schemaName ? { schemaName: e.source.schemaName } : {},
69
+ const r = ie(a), s = {
70
+ ...r.includes("database") && e.source.databaseName ? { databaseName: e.source.databaseName } : {},
71
+ ...r.includes("schema") && e.source.schemaName ? { schemaName: e.source.schemaName } : {},
220
72
  ...e.source.tableName ? { tableName: e.source.tableName } : {}
221
- }, o = s.filter((d) => d === "database" ? !r.databaseName : d === "schema" ? !r.schemaName : !r.tableName);
73
+ }, o = r.filter((l) => l === "database" ? !s.databaseName : l === "schema" ? !s.schemaName : !s.tableName);
222
74
  return o.length > 0 ? { kind: "missing_coordinates", missing: o } : {
223
75
  kind: "resolved",
224
- coordinates: r
76
+ coordinates: s
225
77
  };
226
78
  }
227
79
  function f(e) {
228
80
  return typeof e == "string" && e.trim() ? e.trim() : void 0;
229
81
  }
230
- function x(e) {
82
+ function D(e) {
231
83
  return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
232
84
  }
233
- function ge(e) {
234
- const t = x(e);
85
+ function ae(e) {
86
+ const t = D(e);
235
87
  return !t || !f(t.name) || t.type === "model" ? !1 : t.type === "dataset" ? t.datasetType === "physical" : !0;
236
88
  }
237
- function H(e) {
238
- const t = x(e);
89
+ function q(e) {
90
+ const t = D(e);
239
91
  if (!t) return {};
240
92
  const n = f(t.table) || f(t.name);
241
93
  return {
@@ -244,41 +96,41 @@ function H(e) {
244
96
  ...n ? { tableName: n } : {}
245
97
  };
246
98
  }
247
- function Me(e) {
248
- if (Oe(e)) return { kind: "malformed" };
249
- const t = e.entities.filter(ge), n = ze(e), i = je({
99
+ function Ce(e) {
100
+ if (Ae(e)) return { kind: "malformed" };
101
+ const t = e.entities.filter(ae), n = _e(e), i = Se({
250
102
  entities: t,
251
103
  connectionType: e.connectionType,
252
104
  dialect: e.dialect,
253
105
  capabilities: e.capabilities
254
106
  });
255
107
  if (!i) return { kind: "incompatible_capabilities" };
256
- const { capabilities: a } = i, s = $e({
108
+ const { capabilities: a } = i, r = De({
257
109
  hints: e.qualifiedHints || [],
258
110
  coordinateHint: e.coordinateHint,
259
111
  capabilityAuthority: i
260
112
  });
261
- if (s.kind !== "valid")
262
- return { kind: s.kind };
263
- const r = s.coordinates, o = r ? t.filter(
264
- (c) => X({
265
- left: he(
266
- H(c),
113
+ if (r.kind !== "valid")
114
+ return { kind: r.kind };
115
+ const s = r.coordinates, o = s ? t.filter(
116
+ (c) => W({
117
+ left: oe(
118
+ q(c),
267
119
  a
268
120
  ),
269
- right: r,
121
+ right: s,
270
122
  capabilities: a
271
123
  })
272
124
  ) : t;
273
- if (r && o.length === 0)
125
+ if (s && o.length === 0)
274
126
  return {
275
127
  kind: "not_found",
276
128
  basis: "qualified",
277
- coordinates: r,
129
+ coordinates: s,
278
130
  capabilityAuthority: i
279
131
  };
280
- if (r && o.length === 1) {
281
- const c = o[0], l = $(
132
+ if (s && o.length === 1) {
133
+ const c = o[0], d = L(
282
134
  i,
283
135
  c
284
136
  );
@@ -286,35 +138,35 @@ function Me(e) {
286
138
  kind: "resolved",
287
139
  basis: "qualified",
288
140
  entity: c,
289
- coordinates: Qe(
290
- H(c),
291
- r,
292
- l
141
+ coordinates: He(
142
+ q(c),
143
+ s,
144
+ d
293
145
  ),
294
- capabilityAuthority: l
146
+ capabilityAuthority: d
295
147
  };
296
148
  }
297
- const d = pe([
149
+ const l = se([
298
150
  ...e.bareHints || [],
299
- ...s.bareHints,
300
- r == null ? void 0 : r.tableName
151
+ ...r.bareHints,
152
+ s == null ? void 0 : s.tableName
301
153
  ]);
302
- if (d.size > 0) {
303
- const c = o.filter((l) => {
304
- const m = We(l);
305
- return Array.from(d).some((b) => m.has(b));
154
+ if (l.size > 0) {
155
+ const c = o.filter((d) => {
156
+ const m = Be(d);
157
+ return Array.from(l).some((y) => m.has(y));
306
158
  });
307
159
  if (c.length === 1) {
308
- const l = c[0], m = $(
160
+ const d = c[0], m = L(
309
161
  i,
310
- l
162
+ d
311
163
  );
312
164
  return {
313
165
  kind: "resolved",
314
166
  basis: "bare",
315
- entity: l,
316
- coordinates: M(
317
- H(l),
167
+ entity: d,
168
+ coordinates: H(
169
+ q(d),
318
170
  m
319
171
  ),
320
172
  capabilityAuthority: m
@@ -322,7 +174,7 @@ function Me(e) {
322
174
  }
323
175
  return c.length > 1 ? { kind: "ambiguous", basis: "bare" } : { kind: "not_found", basis: "bare", capabilityAuthority: i };
324
176
  }
325
- if (r)
177
+ if (s)
326
178
  return { kind: "ambiguous", basis: "qualified" };
327
179
  if (n)
328
180
  return {
@@ -331,7 +183,7 @@ function Me(e) {
331
183
  capabilityAuthority: i
332
184
  };
333
185
  if (t.length === 1) {
334
- const c = t[0], l = $(
186
+ const c = t[0], d = L(
335
187
  i,
336
188
  c
337
189
  );
@@ -339,16 +191,16 @@ function Me(e) {
339
191
  kind: "resolved",
340
192
  basis: "unqualified",
341
193
  entity: c,
342
- coordinates: M(
343
- H(c),
344
- l
194
+ coordinates: H(
195
+ q(c),
196
+ d
345
197
  ),
346
- capabilityAuthority: l
198
+ capabilityAuthority: d
347
199
  };
348
200
  }
349
201
  return { kind: "unqualified" };
350
202
  }
351
- function ze(e) {
203
+ function _e(e) {
352
204
  const t = (e.qualifiedHints || []).map(f).filter((i) => !!i);
353
205
  return Object.values(e.coordinateHint || {}).some(
354
206
  (i) => !!f(i)
@@ -359,60 +211,60 @@ function ze(e) {
359
211
  function A(e) {
360
212
  return `${e.dialect}:${e.prefixLevels.join(".")}`;
361
213
  }
362
- function P(e) {
214
+ function B(e) {
363
215
  return {
364
216
  dialect: e.dialect,
365
217
  prefixLevels: [...e.prefixLevels]
366
218
  };
367
219
  }
368
- function je(e) {
220
+ function Se(e) {
369
221
  var k;
370
- const t = f(e.connectionType), n = f(e.dialect), i = e.capabilities ? P(e.capabilities) : void 0, a = t ? N(t) : void 0, s = n ? Q(n) : void 0, r = n && n !== "unknown" ? N(n) : void 0;
371
- if (t && !a || n && n !== "unknown" && s === "unknown" || i && a && A(i) !== A(a))
222
+ const t = f(e.connectionType), n = f(e.dialect), i = e.capabilities ? B(e.capabilities) : void 0, a = t ? C(t) : void 0, r = n ? w(n) : void 0, s = n && n !== "unknown" ? C(n) : void 0;
223
+ if (t && !a || n && n !== "unknown" && r === "unknown" || i && a && A(i) !== A(a))
372
224
  return;
373
- const o = i || (a ? P(a) : r ? P(r) : void 0);
225
+ const o = i || (a ? B(a) : s ? B(s) : void 0);
374
226
  if (o)
375
- return s && s !== "unknown" && o.dialect !== s ? void 0 : {
227
+ return r && r !== "unknown" && o.dialect !== r ? void 0 : {
376
228
  capabilities: o,
377
229
  ...t ? { connectionType: t } : {},
378
230
  dialect: o.dialect,
379
231
  evidence: "explicit"
380
232
  };
381
- const d = e.entities.map((y) => {
382
- const C = x(y), h = f(C == null ? void 0 : C.connectionType), I = f(C == null ? void 0 : C.dialect), T = h ? N(h) : void 0, F = I ? Q(I) : void 0, j = I && I !== "unknown" ? N(I) : void 0;
383
- if (h && !T || I && I !== "unknown" && F === "unknown" || I && I !== "unknown" && !T && !j || T && F && F !== "unknown" && T.dialect !== F)
233
+ const l = e.entities.map((b) => {
234
+ const I = D(b), h = f(I == null ? void 0 : I.connectionType), N = f(I == null ? void 0 : I.dialect), S = h ? C(h) : void 0, E = N ? w(N) : void 0, x = N && N !== "unknown" ? C(N) : void 0;
235
+ if (h && !S || N && N !== "unknown" && E === "unknown" || N && N !== "unknown" && !S && !x || S && E && E !== "unknown" && S.dialect !== E)
384
236
  return;
385
- const ne = T || j, w = ne ? P(ne) : we(C);
386
- return w ? {
387
- capabilities: w,
237
+ const U = S || x, P = U ? B(U) : Te(I);
238
+ return P ? {
239
+ capabilities: P,
388
240
  connectionType: h,
389
- capabilityIdentity: h ? _e(h) : void 0,
390
- inferred: !T && !j,
391
- signature: A(w)
241
+ capabilityIdentity: h ? ge(h) : void 0,
242
+ inferred: !S && !x,
243
+ signature: A(P)
392
244
  } : void 0;
393
245
  });
394
- if (d.some((y) => !y)) return;
395
- const c = d.filter(
396
- (y) => !!y
246
+ if (l.some((b) => !b)) return;
247
+ const c = l.filter(
248
+ (b) => !!b
397
249
  );
398
- if (new Set(c.map((y) => y.signature)).size > 1)
250
+ if (new Set(c.map((b) => b.signature)).size > 1)
399
251
  return;
400
- const l = (k = c[0]) == null ? void 0 : k.capabilities;
401
- if (!l || s && s !== "unknown" && l.dialect !== s)
252
+ const d = (k = c[0]) == null ? void 0 : k.capabilities;
253
+ if (!d || r && r !== "unknown" && d.dialect !== r)
402
254
  return;
403
255
  const m = new Set(
404
- c.map((y) => y.capabilityIdentity).filter((y) => !!y)
405
- ), b = c.every(
406
- (y) => y.connectionType && y.capabilityIdentity
256
+ c.map((b) => b.capabilityIdentity).filter((b) => !!b)
257
+ ), y = c.every(
258
+ (b) => b.connectionType && b.capabilityIdentity
407
259
  );
408
260
  return {
409
- capabilities: l,
410
- ...b && m.size === 1 ? { connectionType: c[0].connectionType } : {},
411
- dialect: l.dialect,
412
- evidence: c.every((y) => y.inferred) ? "coordinates" : "entity"
261
+ capabilities: d,
262
+ ...y && m.size === 1 ? { connectionType: c[0].connectionType } : {},
263
+ dialect: d.dialect,
264
+ evidence: c.every((b) => b.inferred) ? "coordinates" : "entity"
413
265
  };
414
266
  }
415
- function we(e) {
267
+ function Te(e) {
416
268
  const t = !!f(e == null ? void 0 : e.database), n = !!f(e == null ? void 0 : e.schema);
417
269
  if (!(t && n)) {
418
270
  if (n)
@@ -421,13 +273,13 @@ function we(e) {
421
273
  return { dialect: "unknown", prefixLevels: ["database", "table"] };
422
274
  }
423
275
  }
424
- function $(e, t) {
276
+ function L(e, t) {
425
277
  var a;
426
278
  if (e.evidence !== "entity") return e;
427
- const n = f((a = x(t)) == null ? void 0 : a.connectionType), i = n ? N(n) : void 0;
279
+ const n = f((a = D(t)) == null ? void 0 : a.connectionType), i = n ? C(n) : void 0;
428
280
  return i && A(i) === A(e.capabilities) ? { ...e, connectionType: n } : e;
429
281
  }
430
- function Oe(e) {
282
+ function Ae(e) {
431
283
  return (e.qualifiedHints || []).some(
432
284
  (n) => {
433
285
  const i = f(n);
@@ -438,79 +290,79 @@ function Oe(e) {
438
290
  return !!(i && !p(i));
439
291
  });
440
292
  }
441
- function $e(e) {
293
+ function De(e) {
442
294
  const { capabilities: t } = e.capabilityAuthority, n = [], i = [];
443
295
  for (const m of e.hints) {
444
- const b = f(m);
445
- if (!b) continue;
446
- if (!b.includes(".")) {
447
- i.push(b);
296
+ const y = f(m);
297
+ if (!y) continue;
298
+ if (!y.includes(".")) {
299
+ i.push(y);
448
300
  continue;
449
301
  }
450
- const k = p(b);
302
+ const k = p(y);
451
303
  if (!k) return { kind: "malformed" };
452
304
  n.push(k);
453
305
  }
454
- const a = Re(e.coordinateHint);
306
+ const a = Ee(e.coordinateHint);
455
307
  if (a.kind === "malformed") return a;
456
- const s = Array.from(new Set(n)).map(
457
- (m) => ie({
308
+ const r = Array.from(new Set(n)).map(
309
+ (m) => G({
458
310
  qualifiedName: m,
459
311
  capabilities: t
460
312
  })
461
313
  );
462
- if (!Ue(s, t))
314
+ if (!qe(r, t))
463
315
  return { kind: "conflicting" };
464
- const r = [...new Set(n)].sort(
465
- (m, b) => b.split(".").length - m.split(".").length
466
- )[0], o = r ? ie({
467
- qualifiedName: r,
316
+ const s = [...new Set(n)].sort(
317
+ (m, y) => y.split(".").length - m.split(".").length
318
+ )[0], o = s ? G({
319
+ qualifiedName: s,
468
320
  capabilities: t
469
- }) : void 0, d = he(
321
+ }) : void 0, l = oe(
470
322
  a.coordinates,
471
323
  t
472
- ), c = M(
324
+ ), c = H(
473
325
  a.coordinates,
474
326
  e.capabilityAuthority
475
- ), l = !!(d.tableName && (d.databaseName || d.schemaName));
476
- return o && l && !X({
327
+ ), d = !!(l.tableName && (l.databaseName || l.schemaName));
328
+ return o && d && !W({
477
329
  left: o,
478
- right: d,
330
+ right: l,
479
331
  capabilities: t
480
332
  }) ? { kind: "conflicting" } : {
481
333
  kind: "valid",
482
334
  coordinates: o ? {
483
335
  ...c,
484
336
  ...o
485
- } : l ? c : void 0,
337
+ } : d ? c : void 0,
486
338
  bareHints: [
487
339
  ...i,
488
- ...!l && d.tableName ? [d.tableName] : []
340
+ ...!d && l.tableName ? [l.tableName] : []
489
341
  ]
490
342
  };
491
343
  }
492
- function Re(e) {
344
+ function Ee(e) {
493
345
  const t = {};
494
346
  for (const [n, i] of Object.entries(e || {})) {
495
347
  const a = f(i);
496
348
  if (!a) continue;
497
- const s = p(a);
498
- if (!s) return { kind: "malformed" };
499
- t[n] = s;
349
+ const r = p(a);
350
+ if (!r) return { kind: "malformed" };
351
+ t[n] = r;
500
352
  }
501
353
  return { kind: "valid", coordinates: t };
502
354
  }
503
- function he(e, t) {
355
+ function oe(e, t) {
504
356
  return {
505
357
  ...t.prefixLevels.includes("database") && e.databaseName ? { databaseName: e.databaseName } : {},
506
358
  ...t.prefixLevels.includes("schema") && e.schemaName ? { schemaName: e.schemaName } : {},
507
359
  ...e.tableName ? { tableName: e.tableName } : {}
508
360
  };
509
361
  }
510
- function Ue(e, t) {
362
+ function qe(e, t) {
511
363
  return e.every(
512
364
  (n, i) => e.slice(i + 1).every(
513
- (a) => X({
365
+ (a) => W({
514
366
  left: n,
515
367
  right: a,
516
368
  capabilities: t
@@ -518,21 +370,21 @@ function Ue(e, t) {
518
370
  )
519
371
  );
520
372
  }
521
- function pe(e) {
373
+ function se(e) {
522
374
  return new Set(
523
375
  e.map(f).map(p).filter((t) => !!t)
524
376
  );
525
377
  }
526
- function We(e) {
527
- const t = x(e);
528
- return t ? pe([
378
+ function Be(e) {
379
+ const t = D(e);
380
+ return t ? se([
529
381
  f(t.name),
530
382
  f(t.table),
531
383
  f(t.id)
532
384
  ]) : /* @__PURE__ */ new Set();
533
385
  }
534
- function Qe(e, t, n) {
535
- return M(
386
+ function He(e, t, n) {
387
+ return H(
536
388
  {
537
389
  ...e,
538
390
  ...t
@@ -540,8 +392,8 @@ function Qe(e, t, n) {
540
392
  n
541
393
  );
542
394
  }
543
- function M(e, t) {
544
- const n = t.evidence === "coordinates" ? t.capabilities.prefixLevels : be(t.capabilities);
395
+ function H(e, t) {
396
+ const n = t.evidence === "coordinates" ? t.capabilities.prefixLevels : ie(t.capabilities);
545
397
  return {
546
398
  ...n.includes("database") && e.databaseName ? { databaseName: e.databaseName } : {},
547
399
  ...n.includes("schema") && e.schemaName ? { schemaName: e.schemaName } : {},
@@ -551,89 +403,89 @@ function M(e, t) {
551
403
  function u(e) {
552
404
  return typeof e == "string" && e.trim() ? e.trim() : void 0;
553
405
  }
554
- function S(e) {
406
+ function _(e) {
555
407
  return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
556
408
  }
557
- function Ke(e) {
558
- const t = S(e);
409
+ function Fe(e) {
410
+ const t = _(e);
559
411
  return !!(t && t.type === "dataset" && u(t.name));
560
412
  }
561
- function ve(e) {
562
- const t = S(e);
413
+ function re(e) {
414
+ const t = _(e);
563
415
  return !!(t && t.type === "dataset" && t.datasetType !== "physical" && u(t.name));
564
416
  }
565
- function se(e) {
417
+ function Y(e) {
566
418
  const t = /* @__PURE__ */ new Set();
567
419
  for (const n of e) {
568
420
  const i = u(n);
569
421
  if (!i) continue;
570
422
  const a = p(i);
571
423
  if (!a) continue;
572
- const s = a.toLowerCase();
573
- t.add(s);
574
- const r = s.split("."), o = r[r.length - 1];
424
+ const r = a.toLowerCase();
425
+ t.add(r);
426
+ const s = r.split("."), o = s[s.length - 1];
575
427
  o && t.add(o);
576
428
  }
577
429
  return t;
578
430
  }
579
- function ce(e) {
431
+ function X(e) {
580
432
  var n;
581
433
  const t = u(e);
582
434
  return t ? (n = p(t)) == null ? void 0 : n.toLowerCase() : void 0;
583
435
  }
584
- function R(e, t) {
585
- const n = S(t), i = u(n == null ? void 0 : n.domainId) || u(e.semanticDomainId), a = u(n == null ? void 0 : n.name);
436
+ function j(e, t) {
437
+ const n = _(t), i = u(n == null ? void 0 : n.domainId) || u(e.semanticDomainId), a = u(n == null ? void 0 : n.name);
586
438
  if (!i || !a) return;
587
- const s = (n == null ? void 0 : n.datasetType) === "physical" ? void 0 : De(n || {}), r = u(n == null ? void 0 : n.connectionId) || u(e.connectionId);
439
+ const r = (n == null ? void 0 : n.datasetType) === "physical" ? void 0 : he(n || {}), s = u(n == null ? void 0 : n.connectionId) || u(e.connectionId);
588
440
  return {
589
441
  kind: "semantic",
590
442
  domainId: i,
591
443
  datasetName: a,
592
- ...s ? { datasetId: s } : {},
593
- ...r ? { connectionId: r } : {}
444
+ ...r ? { datasetId: r } : {},
445
+ ...s ? { connectionId: s } : {}
594
446
  };
595
447
  }
596
- function Ye(e, t = {}) {
448
+ function xe(e, t = {}) {
597
449
  const n = u(e.fieldEntityType);
598
450
  if (n && n !== "dataset")
599
451
  return { kind: "unqualified" };
600
452
  const i = e.entities.filter(
601
- (r) => t.includePhysicalDatasets ? Ke(r) : ve(r)
453
+ (s) => t.includePhysicalDatasets ? Fe(s) : re(s)
602
454
  ), a = u(e.entityId);
603
455
  if (a) {
604
- const r = ce(a), o = i.filter((d) => {
605
- const c = S(d);
606
- return !!(r && ce(c == null ? void 0 : c.id) === r);
456
+ const s = X(a), o = i.filter((l) => {
457
+ const c = _(l);
458
+ return !!(s && X(c == null ? void 0 : c.id) === s);
607
459
  });
608
460
  if (o.length > 1) return { kind: "ambiguous", basis: "bare" };
609
461
  if (o.length === 1) {
610
- const d = R(e, o[0]);
611
- return d ? {
462
+ const l = j(e, o[0]);
463
+ return l ? {
612
464
  kind: "resolved",
613
465
  basis: "bare",
614
466
  entity: o[0],
615
- source: d,
467
+ source: l,
616
468
  matchedById: !0
617
469
  } : { kind: "not_found", basis: "bare" };
618
470
  }
619
471
  }
620
- const s = se([
472
+ const r = Y([
621
473
  e.entityName,
622
474
  ...e.qualifiedHints || [],
623
475
  ...e.bareHints || []
624
476
  ]);
625
- if (s.size > 0) {
626
- const r = i.filter((o) => {
627
- const d = S(o);
628
- return [...se([d == null ? void 0 : d.id, d == null ? void 0 : d.name])].some((l) => s.has(l));
477
+ if (r.size > 0) {
478
+ const s = i.filter((o) => {
479
+ const l = _(o);
480
+ return [...Y([l == null ? void 0 : l.id, l == null ? void 0 : l.name])].some((d) => r.has(d));
629
481
  });
630
- if (r.length > 1) return { kind: "ambiguous", basis: "bare" };
631
- if (r.length === 1) {
632
- const o = R(e, r[0]);
482
+ if (s.length > 1) return { kind: "ambiguous", basis: "bare" };
483
+ if (s.length === 1) {
484
+ const o = j(e, s[0]);
633
485
  return o ? {
634
486
  kind: "resolved",
635
487
  basis: "bare",
636
- entity: r[0],
488
+ entity: s[0],
637
489
  source: o,
638
490
  matchedById: !1
639
491
  } : { kind: "not_found", basis: "bare" };
@@ -641,19 +493,19 @@ function Ye(e, t = {}) {
641
493
  return { kind: "not_found", basis: "bare" };
642
494
  }
643
495
  if (i.length === 1) {
644
- const r = R(e, i[0]);
645
- return r ? {
496
+ const s = j(e, i[0]);
497
+ return s ? {
646
498
  kind: "resolved",
647
499
  basis: "unqualified",
648
500
  entity: i[0],
649
- source: r,
501
+ source: s,
650
502
  matchedById: !1
651
503
  } : { kind: "unqualified" };
652
504
  }
653
505
  return { kind: "unqualified" };
654
506
  }
655
- function U(e) {
656
- const t = e.resolution.kind === "resolved" ? S(e.resolution.entity) : void 0, n = u(e.connectionId) || u(t == null ? void 0 : t.connectionId), { connectionType: i, dialect: a } = e.resolution.capabilityAuthority, s = N(a), r = !!(s && s.dialect === e.resolution.capabilityAuthority.capabilities.dialect && s.prefixLevels.join(".") === e.resolution.capabilityAuthority.capabilities.prefixLevels.join(
507
+ function z(e) {
508
+ const t = e.resolution.kind === "resolved" ? _(e.resolution.entity) : void 0, n = u(e.connectionId) || u(t == null ? void 0 : t.connectionId), { connectionType: i, dialect: a } = e.resolution.capabilityAuthority, r = C(a), s = !!(r && r.dialect === e.resolution.capabilityAuthority.capabilities.dialect && r.prefixLevels.join(".") === e.resolution.capabilityAuthority.capabilities.prefixLevels.join(
657
509
  "."
658
510
  )), o = e.resolution.coordinates;
659
511
  if (!(!n || !(o != null && o.tableName)))
@@ -661,21 +513,21 @@ function U(e) {
661
513
  kind: "physical",
662
514
  connectionId: n,
663
515
  ...i ? { connectionType: i } : {},
664
- ...!i && r ? { dialect: a } : {},
516
+ ...!i && s ? { dialect: a } : {},
665
517
  tableName: o.tableName,
666
518
  ...o.databaseName ? { databaseName: o.databaseName } : {},
667
519
  ...o.schemaName ? { schemaName: o.schemaName } : {}
668
520
  };
669
521
  }
670
- function Ge(e) {
671
- const t = S(e.entity), n = p(u(t == null ? void 0 : t.table));
522
+ function Pe(e) {
523
+ const t = _(e.entity), n = p(u(t == null ? void 0 : t.table));
672
524
  if (!n) return !1;
673
525
  const i = p(
674
526
  u(t == null ? void 0 : t.database)
675
527
  ), a = p(
676
528
  u(t == null ? void 0 : t.schema)
677
529
  );
678
- return e.coordinates.tableName ? Ae({
530
+ return e.coordinates.tableName ? pe({
679
531
  requested: e.coordinates,
680
532
  allowed: {
681
533
  ...i ? { databaseName: i } : {},
@@ -685,12 +537,12 @@ function Ge(e) {
685
537
  capabilities: e.capabilityAuthority.capabilities
686
538
  }) : !1;
687
539
  }
688
- function Ve(e) {
689
- var a, s, r;
690
- if (u(e.connectionType) || u(e.dialect) || e.capabilities || u(e.semanticDomainId) || u(e.fieldEntityType) === "dataset" || u((a = e.fallbackCoordinateHint) == null ? void 0 : a.databaseName) || u((s = e.fallbackCoordinateHint) == null ? void 0 : s.schemaName))
540
+ function Le(e) {
541
+ var a, r, s;
542
+ if (u(e.connectionType) || u(e.dialect) || e.capabilities || u(e.semanticDomainId) || u(e.fieldEntityType) === "dataset" || u((a = e.fallbackCoordinateHint) == null ? void 0 : a.databaseName) || u((r = e.fallbackCoordinateHint) == null ? void 0 : r.schemaName))
691
543
  return;
692
544
  const t = [
693
- u((r = e.fallbackCoordinateHint) == null ? void 0 : r.tableName),
545
+ u((s = e.fallbackCoordinateHint) == null ? void 0 : s.tableName),
694
546
  ...(e.qualifiedHints || []).map(u),
695
547
  ...(e.bareHints || []).map(u),
696
548
  u(e.entityName),
@@ -701,29 +553,29 @@ function Ve(e) {
701
553
  const n = t.map(p);
702
554
  return n.some((o) => !o) ? void 0 : new Set(n.map((o) => o.toLowerCase())).size === 1 ? n[0] : void 0;
703
555
  }
704
- function pt(e) {
556
+ function tt(e) {
705
557
  const t = e.entities.filter(
706
- ge
558
+ ae
707
559
  ), n = e.entities.filter(
708
- ve
709
- ), i = t.length > 0 || n.length > 0, a = Ye(e), s = e.qualifiedHints || [], r = s.some(
560
+ re
561
+ ), i = t.length > 0 || n.length > 0, a = xe(e), r = e.qualifiedHints || [], s = r.some(
710
562
  (c) => {
711
- var l;
712
- return (l = u(c)) == null ? void 0 : l.includes(".");
563
+ var d;
564
+ return (d = u(c)) == null ? void 0 : d.includes(".");
713
565
  }
714
- ), o = Me({
566
+ ), o = Ce({
715
567
  entities: t,
716
568
  connectionType: u(e.connectionType),
717
569
  dialect: e.dialect,
718
570
  capabilities: e.capabilities,
719
- qualifiedHints: s,
571
+ qualifiedHints: r,
720
572
  bareHints: [e.entityName, e.entityId, ...e.bareHints || []],
721
- ...!r && e.fallbackCoordinateHint ? { coordinateHint: e.fallbackCoordinateHint } : {}
573
+ ...!s && e.fallbackCoordinateHint ? { coordinateHint: e.fallbackCoordinateHint } : {}
722
574
  });
723
- if (o.kind === "malformed" || o.kind === "conflicting" || o.kind === "incompatible_capabilities" && r || o.kind === "ambiguous" && o.basis === "qualified")
575
+ if (o.kind === "malformed" || o.kind === "conflicting" || o.kind === "incompatible_capabilities" && s || o.kind === "ambiguous" && o.basis === "qualified")
724
576
  return o;
725
577
  if (o.kind === "resolved" && o.basis === "qualified") {
726
- const c = U({
578
+ const c = z({
727
579
  resolution: o,
728
580
  connectionId: e.connectionId
729
581
  });
@@ -735,7 +587,7 @@ function pt(e) {
735
587
  } : { kind: "missing_connection" };
736
588
  }
737
589
  if (o.kind === "not_found" && o.basis === "qualified" && o.coordinates) {
738
- if (a.kind === "resolved" && a.matchedById && Ge({
590
+ if (a.kind === "resolved" && a.matchedById && Pe({
739
591
  entity: a.entity,
740
592
  coordinates: o.coordinates,
741
593
  capabilityAuthority: o.capabilityAuthority
@@ -746,7 +598,7 @@ function pt(e) {
746
598
  source: a.source,
747
599
  entity: a.entity
748
600
  };
749
- const c = U({
601
+ const c = z({
750
602
  resolution: o,
751
603
  connectionId: e.connectionId
752
604
  });
@@ -761,7 +613,7 @@ function pt(e) {
761
613
  };
762
614
  if (a.kind === "ambiguous") return a;
763
615
  if (o.kind === "resolved") {
764
- const c = U({
616
+ const c = z({
765
617
  resolution: o,
766
618
  connectionId: e.connectionId
767
619
  });
@@ -772,24 +624,24 @@ function pt(e) {
772
624
  entity: o.entity
773
625
  } : { kind: "missing_connection" };
774
626
  }
775
- const d = u(e.entityName) || u(e.entityId);
776
- if (!i && !r && u(e.semanticDomainId) && (!u(e.fieldEntityType) || u(e.fieldEntityType) === "dataset") && d)
627
+ const l = u(e.entityName) || u(e.entityId);
628
+ if (!i && !s && u(e.semanticDomainId) && (!u(e.fieldEntityType) || u(e.fieldEntityType) === "dataset") && l)
777
629
  return {
778
630
  kind: "resolved",
779
631
  basis: "historical",
780
632
  source: {
781
633
  kind: "semantic",
782
634
  domainId: u(e.semanticDomainId),
783
- datasetName: d,
635
+ datasetName: l,
784
636
  ...u(e.connectionId) ? { connectionId: u(e.connectionId) } : {}
785
637
  }
786
638
  };
787
639
  if (o.kind === "incompatible_capabilities") {
788
- const c = i ? void 0 : Ve(e), l = u(e.connectionId);
789
- return c && l ? {
640
+ const c = i ? void 0 : Le(e), d = u(e.connectionId);
641
+ return c && d ? {
790
642
  kind: "resolved",
791
643
  basis: "historical",
792
- source: { kind: "physical", connectionId: l, tableName: c }
644
+ source: { kind: "physical", connectionId: d, tableName: c }
793
645
  } : o;
794
646
  }
795
647
  return o.kind === "ambiguous" ? o : o.kind === "not_found" ? {
@@ -797,19 +649,19 @@ function pt(e) {
797
649
  basis: o.basis
798
650
  } : { kind: "unqualified" };
799
651
  }
800
- function Je(e, t) {
801
- return qe({ ...e, role: t });
652
+ function je(e, t) {
653
+ return ke({ ...e, role: t });
802
654
  }
803
- function vt(e, t) {
655
+ function nt(e, t) {
804
656
  if (t.id) {
805
657
  const n = [];
806
658
  e.forEach(
807
- ({ fields: a }, s) => a.forEach((r, o) => {
808
- r.id === t.id && n.push({ group: s, index: o });
659
+ ({ fields: a }, r) => a.forEach((s, o) => {
660
+ s.id === t.id && n.push({ group: r, index: o });
809
661
  })
810
662
  );
811
663
  const i = t.alias ? n.find(
812
- ({ group: a, index: s }) => Je(e[a].fields[s], e[a].role) === t.alias
664
+ ({ group: a, index: r }) => je(e[a].fields[r], e[a].role) === t.alias
813
665
  ) : void 0;
814
666
  if (i) return i;
815
667
  if (n.length === 1) return n[0];
@@ -821,25 +673,25 @@ function vt(e, t) {
821
673
  if (i !== -1) return { group: n, index: i };
822
674
  }
823
675
  }
824
- function ke(e, t) {
676
+ function ce(e, t) {
825
677
  const n = e.split(".").map((o) => o.trim()), i = t.split(".").map((o) => o.trim());
826
678
  if (n.length === 0 || i.length === 0 || n.some((o) => !o) || i.some((o) => !o))
827
679
  return !1;
828
- const [a, s] = n.length <= i.length ? [n, i] : [i, n], r = s.length - a.length;
829
- return a.every((o, d) => o === s[d + r]);
680
+ const [a, r] = n.length <= i.length ? [n, i] : [i, n], s = r.length - a.length;
681
+ return a.every((o, l) => o === r[l + s]);
830
682
  }
831
- function Xe(e, t) {
832
- const n = e.split("."), i = t.split("."), a = n.pop(), s = i.pop();
833
- return !!(a && a === s && n.length > 0 && i.length > 0 && ke(
683
+ function ze(e, t) {
684
+ const n = e.split("."), i = t.split("."), a = n.pop(), r = i.pop();
685
+ return !!(a && a === r && n.length > 0 && i.length > 0 && ce(
834
686
  n.join("."),
835
687
  i.join(".")
836
688
  ));
837
689
  }
838
- function Ze(e) {
690
+ function Oe(e) {
839
691
  const t = e.map((i) => i.trim()).filter(Boolean);
840
692
  if (t.every(
841
693
  (i, a) => t.slice(a + 1).every(
842
- (s) => ke(i, s)
694
+ (r) => ce(i, r)
843
695
  )
844
696
  ))
845
697
  return [...t].sort(
@@ -849,12 +701,12 @@ function Ze(e) {
849
701
  function v(e) {
850
702
  return typeof e == "object" && e !== null && !Array.isArray(e);
851
703
  }
852
- function de(e) {
704
+ function Z(e) {
853
705
  if (typeof e != "string") return "";
854
706
  const t = e.split(".").map((n) => n.trim());
855
707
  return t.length > 1 && t.every(Boolean) ? t.join(".") : "";
856
708
  }
857
- function J(e) {
709
+ function $(e) {
858
710
  if (typeof e != "string") return "";
859
711
  const t = e.split(".").map((n) => n.trim());
860
712
  return t.length > 0 && t.every(Boolean) ? t.join(".") : "";
@@ -862,92 +714,92 @@ function J(e) {
862
714
  function g(e) {
863
715
  return typeof e == "string" ? e.trim() : "";
864
716
  }
865
- function et(e, t) {
717
+ function Re(e, t) {
866
718
  return e.every(
867
719
  (n, i) => e.slice(i + 1).every((a) => t(n, a))
868
720
  );
869
721
  }
870
- function tt(e, t) {
871
- const n = g(e.id), i = g(e.name), a = g(t.entityId), s = g(t.entityName);
872
- return !i || !a && !s ? !1 : (!a || a === n || a === i) && (!s || s === i);
722
+ function we(e, t) {
723
+ const n = g(e.id), i = g(e.name), a = g(t.entityId), r = g(t.entityName);
724
+ return !i || !a && !r ? !1 : (!a || a === n || a === i) && (!r || r === i);
873
725
  }
874
- function nt(e) {
726
+ function Me(e) {
875
727
  const t = v(e.semanticContext) ? e.semanticContext : void 0, n = v(e.fieldMeta) ? e.fieldMeta : void 0, i = g(t == null ? void 0 : t.semanticDomainId), a = Array.isArray(t == null ? void 0 : t.selectedEntities) ? t.selectedEntities.filter(
876
728
  (h) => v(h) && h.type === "dataset"
877
729
  ) : [];
878
730
  if (!!!(i || a.length > 0 || (n == null ? void 0 : n.entityType) === "dataset")) return;
879
731
  if (!i)
880
732
  return { status: "unresolved", reason: "incomplete_source_identity" };
881
- const r = g(n == null ? void 0 : n.entityId), o = g(n == null ? void 0 : n.entityName), d = !!(r || o), c = d ? a.filter(
882
- (h) => tt(h, {
883
- entityId: r,
733
+ const s = g(n == null ? void 0 : n.entityId), o = g(n == null ? void 0 : n.entityName), l = !!(s || o), c = l ? a.filter(
734
+ (h) => we(h, {
735
+ entityId: s,
884
736
  entityName: o
885
737
  })
886
738
  ) : a;
887
739
  if (c.length > 1)
888
740
  return { status: "unresolved", reason: "incomplete_source_identity" };
889
- if (d && a.length > 0 && c.length === 0)
741
+ if (l && a.length > 0 && c.length === 0)
890
742
  return { status: "unresolved", reason: "divergent_source_identity" };
891
- const l = c[0], m = g(l == null ? void 0 : l.domainId), b = g(l == null ? void 0 : l.id), k = g(l == null ? void 0 : l.name);
743
+ const d = c[0], m = g(d == null ? void 0 : d.domainId), y = g(d == null ? void 0 : d.id), k = g(d == null ? void 0 : d.name);
892
744
  if (m && m !== i)
893
745
  return { status: "unresolved", reason: "divergent_source_identity" };
894
- const y = b, C = k || o;
895
- return C ? {
746
+ const b = y, I = k || o;
747
+ return I ? {
896
748
  status: "resolved",
897
749
  source: {
898
750
  kind: "semantic",
899
751
  domainId: i,
900
- datasetName: C,
901
- ...y ? { datasetId: y } : {}
752
+ datasetName: I,
753
+ ...b ? { datasetId: b } : {}
902
754
  }
903
755
  } : { status: "unresolved", reason: "incomplete_source_identity" };
904
756
  }
905
- function it(e, t) {
757
+ function $e(e, t) {
906
758
  const n = g(e.connectionId), i = v(e.semanticContext) ? e.semanticContext : void 0, a = g(i == null ? void 0 : i.connectionId);
907
759
  if (n && a && n !== a)
908
760
  return { status: "unresolved", reason: "divergent_source_identity" };
909
- const s = n || a, r = v(e.fieldMeta) ? e.fieldMeta : void 0, o = t.split(".").slice(0, -1).join("."), d = J(e.qualifiedTableName), c = J(
910
- r == null ? void 0 : r.qualifiedEntityName
911
- ), l = [
912
- d,
761
+ const r = n || a, s = v(e.fieldMeta) ? e.fieldMeta : void 0, o = t.split(".").slice(0, -1).join("."), l = $(e.qualifiedTableName), c = $(
762
+ s == null ? void 0 : s.qualifiedEntityName
763
+ ), d = [
764
+ l,
913
765
  c,
914
766
  o
915
- ].filter(Boolean), m = Ze(l);
916
- return !m && l.length > 0 ? { status: "unresolved", reason: "divergent_source_identity" } : !s || !m ? { status: "unresolved", reason: "incomplete_source_identity" } : {
767
+ ].filter(Boolean), m = Oe(d);
768
+ return !m && d.length > 0 ? { status: "unresolved", reason: "divergent_source_identity" } : !r || !m ? { status: "unresolved", reason: "incomplete_source_identity" } : {
917
769
  status: "resolved",
918
- source: { kind: "physical", connectionId: s, tableName: m }
770
+ source: { kind: "physical", connectionId: r, tableName: m }
919
771
  };
920
772
  }
921
- function at(e, t) {
922
- const n = v(e.fieldMeta) ? e.fieldMeta : void 0, i = typeof (n == null ? void 0 : n.qualifiedFieldName) == "string" ? n.qualifiedFieldName.trim() : "", a = de(
773
+ function Qe(e, t) {
774
+ const n = v(e.fieldMeta) ? e.fieldMeta : void 0, i = typeof (n == null ? void 0 : n.qualifiedFieldName) == "string" ? n.qualifiedFieldName.trim() : "", a = Z(
923
775
  n == null ? void 0 : n.qualifiedFieldName
924
- ), s = typeof e.column == "string" ? e.column.trim() : "", r = de(s), o = typeof e.qualifiedTableName == "string" ? e.qualifiedTableName.trim() : "", d = J(
776
+ ), r = typeof e.column == "string" ? e.column.trim() : "", s = Z(r), o = typeof e.qualifiedTableName == "string" ? e.qualifiedTableName.trim() : "", l = $(
925
777
  e.qualifiedTableName
926
778
  );
927
- if (i && !a || t && o && !d || s.includes(".") && !r)
779
+ if (i && !a || t && o && !l || r.includes(".") && !s)
928
780
  return { status: "unresolved", reason: "incomplete_field_identity" };
929
- const c = r.split("."), l = r ? c[c.length - 1] : s, m = t && d && l ? `${d}.${l}` : "", b = [
781
+ const c = s.split("."), d = s ? c[c.length - 1] : r, m = t && l && d ? `${l}.${d}` : "", y = [
930
782
  a,
931
- r,
783
+ s,
932
784
  m
933
785
  ].filter(Boolean);
934
- if (!et(
935
- b,
936
- Xe
786
+ if (!Re(
787
+ y,
788
+ ze
937
789
  ))
938
790
  return { status: "unresolved", reason: "divergent_field_identity" };
939
- const k = r || a || m;
791
+ const k = s || a || m;
940
792
  return k ? { status: "resolved", qualifiedFieldName: k } : { status: "unresolved", reason: "incomplete_field_identity" };
941
793
  }
942
- function ot(e) {
794
+ function We(e) {
943
795
  if (!v(e))
944
796
  return { status: "ineligible", reason: "invalid_input" };
945
797
  if (e.kind === "global-date")
946
798
  return { status: "eligible", kind: "global_date" };
947
- const t = K(e.dataType);
799
+ const t = M(e.dataType);
948
800
  if (t !== "date" && t !== "datetime")
949
801
  return { status: "ineligible", reason: "non_date_filter" };
950
- const n = v(e.fieldMeta) ? e.fieldMeta : void 0, i = K(
802
+ const n = v(e.fieldMeta) ? e.fieldMeta : void 0, i = M(
951
803
  n == null ? void 0 : n.dataType
952
804
  );
953
805
  if ((n == null ? void 0 : n.dataType) !== void 0 && i !== "date" && i !== "datetime")
@@ -956,102 +808,102 @@ function ot(e) {
956
808
  return { status: "ineligible", reason: "custom_filter" };
957
809
  if (e.targetColumns !== void 0 && (!Array.isArray(e.targetColumns) || e.targetColumns.length > 0))
958
810
  return { status: "ineligible", reason: "multi_target_filter" };
959
- const a = nt(e), s = at(e, a === void 0);
960
- if (s.status === "unresolved")
961
- return { status: "ineligible", reason: s.reason };
962
- const r = a || it(e, s.qualifiedFieldName);
963
- return r.status === "resolved" ? {
811
+ const a = Me(e), r = Qe(e, a === void 0);
812
+ if (r.status === "unresolved")
813
+ return { status: "ineligible", reason: r.reason };
814
+ const s = a || $e(e, r.qualifiedFieldName);
815
+ return s.status === "resolved" ? {
964
816
  status: "eligible",
965
817
  kind: "field_date",
966
- qualifiedFieldName: s.qualifiedFieldName,
967
- source: r.source
968
- } : { status: "ineligible", reason: r.reason };
818
+ qualifiedFieldName: r.qualifiedFieldName,
819
+ source: s.source
820
+ } : { status: "ineligible", reason: s.reason };
969
821
  }
970
- function rt(e) {
822
+ function Ke(e) {
971
823
  if (!v(e) || e.kind !== "filter" || !v(e.filter))
972
824
  return { status: "ineligible", reason: "invalid_input" };
973
- const t = ot(
825
+ const t = We(
974
826
  e.filter
975
827
  );
976
828
  return t.status === "ineligible" ? t : t.kind === "field_date" && v(e.compatibility) && e.compatibility.source === "cardInlineFilter" ? { status: "ineligible", reason: "card_inline_filter" } : t;
977
829
  }
978
- function kt(e) {
979
- return rt(e).status === "eligible";
830
+ function it(e) {
831
+ return Ke(e).status === "eligible";
980
832
  }
981
- function Ct(e) {
833
+ function at(e) {
982
834
  return `compat-filter:${e}`;
983
835
  }
984
- function It(e) {
836
+ function ot(e) {
985
837
  return `compat-control:${e}`;
986
838
  }
987
- function Nt(e, t) {
839
+ function st(e, t) {
988
840
  return `compat-inline-filter:${e}:${t}`;
989
841
  }
990
- function St(e, t) {
842
+ function rt(e, t) {
991
843
  return `compat-card-control:${e}:${t}`;
992
844
  }
993
- function Ce(e, t) {
845
+ function le(e, t) {
994
846
  if (e) return e;
995
- const n = t === void 0 ? "unknown" : K(t);
847
+ const n = t === void 0 ? "unknown" : M(t);
996
848
  return n === "number" || n === "unknown" ? "SUM" : "COUNT";
997
849
  }
998
- function st(e) {
999
- const t = e.aggregate === Ce(e.semanticAggregate, e.dataType);
850
+ function Ue(e) {
851
+ const t = e.aggregate === le(e.semanticAggregate, e.dataType);
1000
852
  return {
1001
853
  effectiveAggregate: e.aggregate,
1002
854
  aggregateSource: t ? e.semanticAggregate ? "semantic_model" : "default_sum" : "caller_override"
1003
855
  };
1004
856
  }
1005
- function ct(e, t, n) {
857
+ function Ge(e, t, n) {
1006
858
  const i = e.effectiveAggregate !== void 0 || e.aggregateSource !== void 0;
1007
859
  return {
1008
860
  aggregate: t,
1009
861
  aggregateOrigin: n,
1010
- ...i ? st({ aggregate: t, semanticAggregate: e.semanticAggregate, dataType: e.dataType }) : {}
862
+ ...i ? Ue({ aggregate: t, semanticAggregate: e.semanticAggregate, dataType: e.dataType }) : {}
1011
863
  };
1012
864
  }
1013
- function Tt(e, t, n) {
1014
- return { ...e, ...ct(e, t, n) };
865
+ function ct(e, t, n) {
866
+ return { ...e, ...Ge(e, t, n) };
1015
867
  }
1016
- function _t(e) {
868
+ function lt(e) {
1017
869
  return e.aggregate ?? e.effectiveAggregate;
1018
870
  }
1019
- function Dt(e) {
871
+ function dt(e) {
1020
872
  if (!e.aggregate) return !1;
1021
873
  if (e.aggregateOrigin === "explicit" || e.aggregateSource === "caller_override") return !0;
1022
874
  if (e.aggregateSource) {
1023
- const t = e.aggregateSource === "default_sum" ? Ce(void 0, e.dataType) : e.semanticAggregate ?? e.effectiveAggregate;
875
+ const t = e.aggregateSource === "default_sum" ? le(void 0, e.dataType) : e.semanticAggregate ?? e.effectiveAggregate;
1024
876
  return t !== void 0 && e.aggregate !== t;
1025
877
  }
1026
878
  return e.aggregateOrigin !== "default";
1027
879
  }
1028
- const At = ["label", "labelOrigin", "derivedLabel"];
1029
- function Et(e) {
880
+ const ut = ["label", "labelOrigin", "derivedLabel"];
881
+ function ft(e) {
1030
882
  return { label: e, labelOrigin: "override", derivedLabel: void 0 };
1031
883
  }
1032
- function qt(e, t) {
884
+ function mt(e, t) {
1033
885
  const { derivedLabel: n, ...i } = e;
1034
886
  return { ...i, label: t, labelOrigin: "override" };
1035
887
  }
1036
- function Bt(e, t) {
888
+ function bt(e, t) {
1037
889
  return e.labelOrigin === "override" ? {} : { label: t, labelOrigin: "semantic" };
1038
890
  }
1039
- function xt(e) {
891
+ function yt(e) {
1040
892
  if (e.groupedDate !== void 0) return { target: e.groupedDate, direction: "asc" };
1041
893
  if (!(!e.grouped || e.measures.length === 0))
1042
894
  return { target: e.primaryMeasure ?? e.measures[0], direction: "desc" };
1043
895
  }
1044
- const Ft = /* @__PURE__ */ new Set([
896
+ const gt = /* @__PURE__ */ new Set([
1045
897
  "contains",
1046
898
  "startsWith",
1047
899
  "endsWith",
1048
900
  "like",
1049
901
  "not like"
1050
902
  ]);
1051
- function Ie(e) {
903
+ function de(e) {
1052
904
  return e.includes("%") || e.includes("_");
1053
905
  }
1054
- function dt(e, t) {
906
+ function Ve(e, t) {
1055
907
  switch (e) {
1056
908
  case "contains":
1057
909
  return { pattern: `%${t}%`, negate: !1 };
@@ -1065,68 +917,68 @@ function dt(e, t) {
1065
917
  return { pattern: t, negate: !0 };
1066
918
  }
1067
919
  }
1068
- function lt(e) {
1069
- return Ie(e) ? e : `%${e}%`;
920
+ function Je(e) {
921
+ return de(e) ? e : `%${e}%`;
1070
922
  }
1071
- function Ht(e, t) {
1072
- const { pattern: n, negate: i } = dt(e, t), a = n.length > 2 && n.startsWith("%") && n.endsWith("%") ? n.slice(1, -1) : void 0, s = a !== void 0 && !Ie(a) ? a : n;
1073
- if (lt(s) === n)
1074
- return { operator: i ? "not_contains" : "contains", value: s };
923
+ function ht(e, t) {
924
+ const { pattern: n, negate: i } = Ve(e, t), a = n.length > 2 && n.startsWith("%") && n.endsWith("%") ? n.slice(1, -1) : void 0, r = a !== void 0 && !de(a) ? a : n;
925
+ if (Je(r) === n)
926
+ return { operator: i ? "not_contains" : "contains", value: r };
1075
927
  }
1076
- function Pt(e) {
928
+ function pt(e) {
1077
929
  const { operation: t, values: n, temporalPrecision: i } = e;
1078
930
  if (t !== "=" && t !== "!=" || i === "minute")
1079
931
  return null;
1080
932
  const a = Array.isArray(n) ? n : [n];
1081
933
  if (a.length !== 1 || typeof a[0] != "string") return null;
1082
- const s = a[0].trim();
1083
- return fe(s) ? { operation: t, day: s } : null;
934
+ const r = a[0].trim();
935
+ return ye(r) ? { operation: t, day: r } : null;
1084
936
  }
1085
- function Ne(e) {
937
+ function ue(e) {
1086
938
  const { label: t, ...n } = e;
1087
939
  return {
1088
- dataset: Ee(n),
940
+ dataset: ve(n),
1089
941
  ...e.kind === "physical" ? { dialect: e.dialect, connectionType: e.connectionType } : {}
1090
942
  };
1091
943
  }
1092
- function Se(e) {
944
+ function fe(e) {
1093
945
  const { label: t, source: n, ...i } = e;
1094
- return { ...i, source: n && Ne(n) };
946
+ return { ...i, source: n && ue(n) };
1095
947
  }
1096
- function te(e) {
948
+ function K(e) {
1097
949
  const {
1098
950
  label: t,
1099
951
  format: n,
1100
952
  description: i,
1101
953
  tags: a,
1102
- inputs: s,
1103
- ...r
954
+ inputs: r,
955
+ ...s
1104
956
  } = e;
1105
957
  return {
1106
- ...r,
958
+ ...s,
1107
959
  inputs: Object.fromEntries(
1108
- Object.entries(s).map(([o, d]) => [
960
+ Object.entries(r).map(([o, l]) => [
1109
961
  o,
1110
- { ...d, field: Se(d.field) }
962
+ { ...l, field: fe(l.field) }
1111
963
  ])
1112
964
  )
1113
965
  };
1114
966
  }
1115
- function W(e) {
967
+ function O(e) {
1116
968
  const { derivedField: t, ...n } = e;
1117
969
  return {
1118
- ...Se(n),
1119
- derivedField: t && te(t)
970
+ ...fe(n),
971
+ derivedField: t && K(t)
1120
972
  };
1121
973
  }
1122
- function z(e) {
974
+ function F(e) {
1123
975
  const {
1124
976
  label: t,
1125
977
  format: n,
1126
978
  description: i,
1127
979
  semanticTemporalPresentation: a,
1128
- derivedField: s,
1129
- calculatedFormula: r,
980
+ derivedField: r,
981
+ calculatedFormula: s,
1130
982
  ...o
1131
983
  } = e;
1132
984
  return {
@@ -1134,44 +986,44 @@ function z(e) {
1134
986
  semanticTemporalPresentation: a && {
1135
987
  granularity: a.granularity
1136
988
  },
1137
- derivedField: s && te(s),
1138
- calculatedFormula: r && {
1139
- ...r,
1140
- inputFields: r.inputFields.map(z)
989
+ derivedField: r && K(r),
990
+ calculatedFormula: s && {
991
+ ...s,
992
+ inputFields: s.inputFields.map(F)
1141
993
  }
1142
994
  };
1143
995
  }
1144
- function Te(e) {
996
+ function me(e) {
1145
997
  return {
1146
998
  ...e,
1147
999
  conditions: e.conditions.map(
1148
1000
  ({ label: t, field: n, ...i }) => ({
1149
1001
  ...i,
1150
- field: z(n)
1002
+ field: F(n)
1151
1003
  })
1152
1004
  ),
1153
- groups: e.groups.map(Te)
1005
+ groups: e.groups.map(me)
1154
1006
  };
1155
1007
  }
1156
- function Lt(e) {
1008
+ function vt(e) {
1157
1009
  return {
1158
1010
  ...e,
1159
- source: Ne(e.source),
1011
+ source: ue(e.source),
1160
1012
  rows: e.rows.map((t) => ({
1161
1013
  ...t,
1162
- field: W(t.field)
1014
+ field: O(t.field)
1163
1015
  })),
1164
1016
  columns: e.columns.map((t) => ({
1165
1017
  ...t,
1166
- field: W(t.field)
1018
+ field: O(t.field)
1167
1019
  })),
1168
1020
  measures: e.measures.map(
1169
- (t) => t.kind === "aggregate" ? { ...t, field: W(t.field) } : {
1021
+ (t) => t.kind === "aggregate" ? { ...t, field: O(t.field) } : {
1170
1022
  ...t,
1171
- definition: te(t.definition)
1023
+ definition: K(t.definition)
1172
1024
  }
1173
1025
  ),
1174
- filters: e.filters && Te(e.filters),
1026
+ filters: e.filters && me(e.filters),
1175
1027
  joinPlan: e.joinPlan && {
1176
1028
  ...e.joinPlan,
1177
1029
  // relationshipName participates in governed relationship resolution.
@@ -1181,73 +1033,59 @@ function Lt(e) {
1181
1033
  ...n,
1182
1034
  keys: n.keys.map((i) => ({
1183
1035
  ...i,
1184
- source: z(i.source),
1185
- target: z(i.target)
1036
+ source: F(i.source),
1037
+ target: F(i.target)
1186
1038
  }))
1187
1039
  }))
1188
1040
  }))
1189
1041
  },
1190
1042
  // Sort scopes are keyed overrides, unlike ordered axes/calculation inputs.
1191
1043
  sorts: [...e.sorts].sort((t, n) => {
1192
- const i = ae(t), a = ae(n);
1044
+ const i = V(t), a = V(n);
1193
1045
  return i < a ? -1 : i > a ? 1 : 0;
1194
1046
  })
1195
1047
  };
1196
1048
  }
1197
1049
  export {
1198
- te as $,
1199
- At as A,
1200
- Et as B,
1201
- qt as C,
1202
- xt as D,
1203
- Ie as E,
1204
- dt as F,
1205
- lt as G,
1206
- Ht as H,
1207
- ee as I,
1208
- G as J,
1209
- E as K,
1210
- le as L,
1211
- q as M,
1212
- xe as N,
1213
- B as O,
1214
- V as P,
1215
- D as Q,
1216
- re as R,
1217
- Ft as S,
1218
- ue as T,
1219
- yt as U,
1220
- bt as V,
1221
- fe as W,
1222
- gt as X,
1223
- Pt as Y,
1224
- ke as Z,
1225
- Ze as _,
1226
- Lt as a,
1227
- Xe as a0,
1228
- be as b,
1229
- Me as c,
1230
- ve as d,
1231
- Ye as e,
1232
- pt as f,
1233
- Bt as g,
1234
- vt as h,
1235
- ge as i,
1236
- tt as j,
1237
- ot as k,
1238
- rt as l,
1239
- ct as m,
1240
- kt as n,
1241
- Ct as o,
1242
- It as p,
1243
- Nt as q,
1244
- ht as r,
1245
- Je as s,
1246
- St as t,
1247
- Pe as u,
1248
- Ce as v,
1249
- st as w,
1250
- Tt as x,
1251
- _t as y,
1252
- Dt as z
1050
+ ut as A,
1051
+ ft as B,
1052
+ mt as C,
1053
+ yt as D,
1054
+ de as E,
1055
+ Ve as F,
1056
+ Je as G,
1057
+ ht as H,
1058
+ pt as I,
1059
+ ce as J,
1060
+ Oe as K,
1061
+ K as L,
1062
+ ze as M,
1063
+ J as R,
1064
+ gt as S,
1065
+ vt as a,
1066
+ ie as b,
1067
+ Ce as c,
1068
+ re as d,
1069
+ xe as e,
1070
+ tt as f,
1071
+ bt as g,
1072
+ nt as h,
1073
+ ae as i,
1074
+ we as j,
1075
+ We as k,
1076
+ Ke as l,
1077
+ Ge as m,
1078
+ it as n,
1079
+ at as o,
1080
+ ot as p,
1081
+ st as q,
1082
+ et as r,
1083
+ je as s,
1084
+ rt as t,
1085
+ Ie as u,
1086
+ le as v,
1087
+ Ue as w,
1088
+ ct as x,
1089
+ lt as y,
1090
+ dt as z
1253
1091
  };