@dbml/parse 4.0.0 → 5.0.0-alpha.0

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,13 +1,13 @@
1
- var Wn = typeof global == "object" && global && global.Object === Object && global, zs = typeof self == "object" && self && self.Object === Object && self, _e = Wn || zs || Function("return this")(), Ne = _e.Symbol, Hn = Object.prototype, Ys = Hn.hasOwnProperty, qs = Hn.toString, ze = Ne ? Ne.toStringTag : void 0;
2
- function Ks(e) {
3
- var t = Ys.call(e, ze), n = e[ze];
1
+ var Wn = typeof global == "object" && global && global.Object === Object && global, Ks = typeof self == "object" && self && self.Object === Object && self, ge = Wn || Ks || Function("return this")(), Ne = ge.Symbol, Hn = Object.prototype, zs = Hn.hasOwnProperty, Ys = Hn.toString, Ke = Ne ? Ne.toStringTag : void 0;
2
+ function qs(e) {
3
+ var t = zs.call(e, Ke), n = e[Ke];
4
4
  try {
5
- e[ze] = void 0;
5
+ e[Ke] = void 0;
6
6
  var s = !0;
7
7
  } catch {
8
8
  }
9
- var r = qs.call(e);
10
- return s && (t ? e[ze] = n : delete e[ze]), r;
9
+ var r = Ys.call(e);
10
+ return s && (t ? e[Ke] = n : delete e[Ke]), r;
11
11
  }
12
12
  var Qs = Object.prototype, Js = Qs.toString;
13
13
  function Zs(e) {
@@ -15,7 +15,7 @@ function Zs(e) {
15
15
  }
16
16
  var er = "[object Null]", tr = "[object Undefined]", sn = Ne ? Ne.toStringTag : void 0;
17
17
  function Xe(e) {
18
- return e == null ? e === void 0 ? tr : er : sn && sn in Object(e) ? Ks(e) : Zs(e);
18
+ return e == null ? e === void 0 ? tr : er : sn && sn in Object(e) ? qs(e) : Zs(e);
19
19
  }
20
20
  function xe(e) {
21
21
  return e != null && typeof e == "object";
@@ -24,17 +24,17 @@ var nr = "[object Symbol]";
24
24
  function dt(e) {
25
25
  return typeof e == "symbol" || xe(e) && Xe(e) == nr;
26
26
  }
27
- function zn(e, t) {
27
+ function Kn(e, t) {
28
28
  for (var n = -1, s = e == null ? 0 : e.length, r = Array(s); ++n < s; )
29
29
  r[n] = t(e[n], n, e);
30
30
  return r;
31
31
  }
32
32
  var pe = Array.isArray, rn = Ne ? Ne.prototype : void 0, an = rn ? rn.toString : void 0;
33
- function Yn(e) {
33
+ function zn(e) {
34
34
  if (typeof e == "string")
35
35
  return e;
36
36
  if (pe(e))
37
- return zn(e, Yn) + "";
37
+ return Kn(e, zn) + "";
38
38
  if (dt(e))
39
39
  return an ? an.call(e) : "";
40
40
  var t = e + "";
@@ -88,13 +88,13 @@ function Et(e) {
88
88
  return e;
89
89
  }
90
90
  var Er = "[object AsyncFunction]", Nr = "[object Function]", Tr = "[object GeneratorFunction]", br = "[object Proxy]";
91
- function qn(e) {
91
+ function Yn(e) {
92
92
  if (!Ge(e))
93
93
  return !1;
94
94
  var t = Xe(e);
95
95
  return t == Nr || t == Tr || t == Er || t == br;
96
96
  }
97
- var yt = _e["__core-js_shared__"], cn = function() {
97
+ var yt = ge["__core-js_shared__"], cn = function() {
98
98
  var e = /[^.]+$/.exec(yt && yt.keys && yt.keys.IE_PROTO || "");
99
99
  return e ? "Symbol(src)_1." + e : "";
100
100
  }();
@@ -115,13 +115,13 @@ function Me(e) {
115
115
  }
116
116
  return "";
117
117
  }
118
- var gr = /[\\^$.*+?()[\]{}|]/g, Ar = /^\[object .+?Constructor\]$/, Lr = Function.prototype, vr = Object.prototype, yr = Lr.toString, wr = vr.hasOwnProperty, Sr = RegExp(
118
+ var gr = /[\\^$.*+?()[\]{}|]/g, Ar = /^\[object .+?Constructor\]$/, Lr = Function.prototype, vr = Object.prototype, yr = Lr.toString, wr = vr.hasOwnProperty, Pr = RegExp(
119
119
  "^" + yr.call(wr).replace(gr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
120
120
  );
121
- function Pr(e) {
121
+ function Sr(e) {
122
122
  if (!Ge(e) || mr(e))
123
123
  return !1;
124
- var t = qn(e) ? Sr : Ar;
124
+ var t = Yn(e) ? Pr : Ar;
125
125
  return t.test(Me(e));
126
126
  }
127
127
  function Or(e, t) {
@@ -129,9 +129,9 @@ function Or(e, t) {
129
129
  }
130
130
  function Fe(e, t) {
131
131
  var n = Or(e, t);
132
- return Pr(n) ? n : void 0;
132
+ return Sr(n) ? n : void 0;
133
133
  }
134
- var Pt = Fe(_e, "WeakMap");
134
+ var St = Fe(ge, "WeakMap");
135
135
  function xr(e, t, n) {
136
136
  switch (n.length) {
137
137
  case 0:
@@ -145,11 +145,11 @@ function xr(e, t, n) {
145
145
  }
146
146
  return e.apply(t, n);
147
147
  }
148
- var Dr = 800, Rr = 16, kr = Date.now;
148
+ var Dr = 800, kr = 16, Rr = Date.now;
149
149
  function Ur(e) {
150
150
  var t = 0, n = 0;
151
151
  return function() {
152
- var s = kr(), r = Rr - (s - n);
152
+ var s = Rr(), r = kr - (s - n);
153
153
  if (n = s, r > 0) {
154
154
  if (++t >= Dr)
155
155
  return arguments[0];
@@ -177,17 +177,17 @@ var un = function() {
177
177
  writable: !0
178
178
  });
179
179
  } : Et, Br = Ur(Fr);
180
- function Vr(e, t, n, s) {
180
+ function Cr(e, t, n, s) {
181
181
  e.length;
182
182
  for (var r = n + 1; r--; )
183
183
  if (t(e[r], r, e))
184
184
  return r;
185
185
  return -1;
186
186
  }
187
- var Cr = 9007199254740991, Gr = /^(?:0|[1-9]\d*)$/;
188
- function Kn(e, t) {
187
+ var Vr = 9007199254740991, Gr = /^(?:0|[1-9]\d*)$/;
188
+ function qn(e, t) {
189
189
  var n = typeof e;
190
- return t = t ?? Cr, !!t && (n == "number" || n != "symbol" && Gr.test(e)) && e > -1 && e % 1 == 0 && e < t;
190
+ return t = t ?? Vr, !!t && (n == "number" || n != "symbol" && Gr.test(e)) && e > -1 && e % 1 == 0 && e < t;
191
191
  }
192
192
  function Qn(e, t) {
193
193
  return e === t || e !== e && t !== t;
@@ -211,7 +211,7 @@ function Bt(e) {
211
211
  return typeof e == "number" && e > -1 && e % 1 == 0 && e <= jr;
212
212
  }
213
213
  function Nt(e) {
214
- return e != null && Bt(e.length) && !qn(e);
214
+ return e != null && Bt(e.length) && !Yn(e);
215
215
  }
216
216
  var Wr = Object.prototype;
217
217
  function Jn(e) {
@@ -227,15 +227,15 @@ var Hr = "[object Arguments]";
227
227
  function fn(e) {
228
228
  return xe(e) && Xe(e) == Hr;
229
229
  }
230
- var es = Object.prototype, zr = es.hasOwnProperty, Yr = es.propertyIsEnumerable, Vt = fn(/* @__PURE__ */ function() {
230
+ var es = Object.prototype, Kr = es.hasOwnProperty, zr = es.propertyIsEnumerable, Ct = fn(/* @__PURE__ */ function() {
231
231
  return arguments;
232
232
  }()) ? fn : function(e) {
233
- return xe(e) && zr.call(e, "callee") && !Yr.call(e, "callee");
233
+ return xe(e) && Kr.call(e, "callee") && !zr.call(e, "callee");
234
234
  };
235
- function qr() {
235
+ function Yr() {
236
236
  return !1;
237
237
  }
238
- var ts = typeof exports == "object" && exports && !exports.nodeType && exports, pn = ts && typeof module == "object" && module && !module.nodeType && module, Kr = pn && pn.exports === ts, dn = Kr ? _e.Buffer : void 0, Qr = dn ? dn.isBuffer : void 0, Ot = Qr || qr, Jr = "[object Arguments]", Zr = "[object Array]", ei = "[object Boolean]", ti = "[object Date]", ni = "[object Error]", si = "[object Function]", ri = "[object Map]", ii = "[object Number]", ai = "[object Object]", oi = "[object RegExp]", li = "[object Set]", ci = "[object String]", ui = "[object WeakMap]", hi = "[object ArrayBuffer]", fi = "[object DataView]", pi = "[object Float32Array]", di = "[object Float64Array]", Ei = "[object Int8Array]", Ni = "[object Int16Array]", Ti = "[object Int32Array]", bi = "[object Uint8Array]", mi = "[object Uint8ClampedArray]", Ii = "[object Uint16Array]", _i = "[object Uint32Array]", O = {};
238
+ var ts = typeof exports == "object" && exports && !exports.nodeType && exports, pn = ts && typeof module == "object" && module && !module.nodeType && module, qr = pn && pn.exports === ts, dn = qr ? ge.Buffer : void 0, Qr = dn ? dn.isBuffer : void 0, Ot = Qr || Yr, Jr = "[object Arguments]", Zr = "[object Array]", ei = "[object Boolean]", ti = "[object Date]", ni = "[object Error]", si = "[object Function]", ri = "[object Map]", ii = "[object Number]", ai = "[object Object]", oi = "[object RegExp]", li = "[object Set]", ci = "[object String]", ui = "[object WeakMap]", hi = "[object ArrayBuffer]", fi = "[object DataView]", pi = "[object Float32Array]", di = "[object Float64Array]", Ei = "[object Int8Array]", Ni = "[object Int16Array]", Ti = "[object Int32Array]", bi = "[object Uint8Array]", mi = "[object Uint8ClampedArray]", Ii = "[object Uint16Array]", _i = "[object Uint32Array]", O = {};
239
239
  O[pi] = O[di] = O[Ei] = O[Ni] = O[Ti] = O[bi] = O[mi] = O[Ii] = O[_i] = !0;
240
240
  O[Jr] = O[Zr] = O[hi] = O[ei] = O[fi] = O[ti] = O[ni] = O[si] = O[ri] = O[ii] = O[ai] = O[oi] = O[li] = O[ci] = O[ui] = !1;
241
241
  function gi(e) {
@@ -246,21 +246,21 @@ function Ai(e) {
246
246
  return e(t);
247
247
  };
248
248
  }
249
- var ns = typeof exports == "object" && exports && !exports.nodeType && exports, Ye = ns && typeof module == "object" && module && !module.nodeType && module, Li = Ye && Ye.exports === ns, wt = Li && Wn.process, En = function() {
249
+ var ns = typeof exports == "object" && exports && !exports.nodeType && exports, ze = ns && typeof module == "object" && module && !module.nodeType && module, Li = ze && ze.exports === ns, wt = Li && Wn.process, En = function() {
250
250
  try {
251
- var e = Ye && Ye.require && Ye.require("util").types;
251
+ var e = ze && ze.require && ze.require("util").types;
252
252
  return e || wt && wt.binding && wt.binding("util");
253
253
  } catch {
254
254
  }
255
255
  }(), Nn = En && En.isTypedArray, ss = Nn ? Ai(Nn) : gi, vi = Object.prototype, yi = vi.hasOwnProperty;
256
256
  function rs(e, t) {
257
- var n = pe(e), s = !n && Vt(e), r = !n && !s && Ot(e), i = !n && !s && !r && ss(e), a = n || s || r || i, o = a ? Zn(e.length, String) : [], u = o.length;
257
+ var n = pe(e), s = !n && Ct(e), r = !n && !s && Ot(e), i = !n && !s && !r && ss(e), a = n || s || r || i, o = a ? Zn(e.length, String) : [], u = o.length;
258
258
  for (var p in e)
259
259
  (t || yi.call(e, p)) && !(a && // Safari 9 has enumerable `arguments.length` in strict mode.
260
260
  (p == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
261
261
  r && (p == "offset" || p == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
262
262
  i && (p == "buffer" || p == "byteLength" || p == "byteOffset") || // Skip index properties.
263
- Kn(p, u))) && o.push(p);
263
+ qn(p, u))) && o.push(p);
264
264
  return o;
265
265
  }
266
266
  function wi(e, t) {
@@ -268,16 +268,16 @@ function wi(e, t) {
268
268
  return e(t(n));
269
269
  };
270
270
  }
271
- var Si = wi(Object.keys, Object), Pi = Object.prototype, Oi = Pi.hasOwnProperty;
271
+ var Pi = wi(Object.keys, Object), Si = Object.prototype, Oi = Si.hasOwnProperty;
272
272
  function xi(e) {
273
273
  if (!Jn(e))
274
- return Si(e);
274
+ return Pi(e);
275
275
  var t = [];
276
276
  for (var n in Object(e))
277
277
  Oi.call(e, n) && n != "constructor" && t.push(n);
278
278
  return t;
279
279
  }
280
- function Ct(e) {
280
+ function Vt(e) {
281
281
  return Nt(e) ? rs(e) : xi(e);
282
282
  }
283
283
  function Di(e) {
@@ -287,13 +287,13 @@ function Di(e) {
287
287
  t.push(n);
288
288
  return t;
289
289
  }
290
- var Ri = Object.prototype, ki = Ri.hasOwnProperty;
290
+ var ki = Object.prototype, Ri = ki.hasOwnProperty;
291
291
  function Ui(e) {
292
292
  if (!Ge(e))
293
293
  return Di(e);
294
294
  var t = Jn(e), n = [];
295
295
  for (var s in e)
296
- s == "constructor" && (t || !ki.call(e, s)) || n.push(s);
296
+ s == "constructor" && (t || !Ri.call(e, s)) || n.push(s);
297
297
  return n;
298
298
  }
299
299
  function Mi(e) {
@@ -306,32 +306,32 @@ function Gt(e, t) {
306
306
  var n = typeof e;
307
307
  return n == "number" || n == "symbol" || n == "boolean" || e == null || dt(e) ? !0 : Bi.test(e) || !Fi.test(e) || t != null && e in Object(t);
308
308
  }
309
- var Ke = Fe(Object, "create");
310
- function Vi() {
311
- this.__data__ = Ke ? Ke(null) : {}, this.size = 0;
309
+ var qe = Fe(Object, "create");
310
+ function Ci() {
311
+ this.__data__ = qe ? qe(null) : {}, this.size = 0;
312
312
  }
313
- function Ci(e) {
313
+ function Vi(e) {
314
314
  var t = this.has(e) && delete this.__data__[e];
315
315
  return this.size -= t ? 1 : 0, t;
316
316
  }
317
317
  var Gi = "__lodash_hash_undefined__", $i = Object.prototype, Xi = $i.hasOwnProperty;
318
318
  function ji(e) {
319
319
  var t = this.__data__;
320
- if (Ke) {
320
+ if (qe) {
321
321
  var n = t[e];
322
322
  return n === Gi ? void 0 : n;
323
323
  }
324
324
  return Xi.call(t, e) ? t[e] : void 0;
325
325
  }
326
326
  var Wi = Object.prototype, Hi = Wi.hasOwnProperty;
327
- function zi(e) {
327
+ function Ki(e) {
328
328
  var t = this.__data__;
329
- return Ke ? t[e] !== void 0 : Hi.call(t, e);
329
+ return qe ? t[e] !== void 0 : Hi.call(t, e);
330
330
  }
331
- var Yi = "__lodash_hash_undefined__";
332
- function qi(e, t) {
331
+ var zi = "__lodash_hash_undefined__";
332
+ function Yi(e, t) {
333
333
  var n = this.__data__;
334
- return this.size += this.has(e) ? 0 : 1, n[e] = Ke && t === void 0 ? Yi : t, this;
334
+ return this.size += this.has(e) ? 0 : 1, n[e] = qe && t === void 0 ? zi : t, this;
335
335
  }
336
336
  function De(e) {
337
337
  var t = -1, n = e == null ? 0 : e.length;
@@ -340,12 +340,12 @@ function De(e) {
340
340
  this.set(s[0], s[1]);
341
341
  }
342
342
  }
343
- De.prototype.clear = Vi;
344
- De.prototype.delete = Ci;
343
+ De.prototype.clear = Ci;
344
+ De.prototype.delete = Vi;
345
345
  De.prototype.get = ji;
346
- De.prototype.has = zi;
347
- De.prototype.set = qi;
348
- function Ki() {
346
+ De.prototype.has = Ki;
347
+ De.prototype.set = Yi;
348
+ function qi() {
349
349
  this.__data__ = [], this.size = 0;
350
350
  }
351
351
  function Tt(e, t) {
@@ -373,23 +373,23 @@ function na(e, t) {
373
373
  var n = this.__data__, s = Tt(n, e);
374
374
  return s < 0 ? (++this.size, n.push([e, t])) : n[s][1] = t, this;
375
375
  }
376
- function ge(e) {
376
+ function Ae(e) {
377
377
  var t = -1, n = e == null ? 0 : e.length;
378
378
  for (this.clear(); ++t < n; ) {
379
379
  var s = e[t];
380
380
  this.set(s[0], s[1]);
381
381
  }
382
382
  }
383
- ge.prototype.clear = Ki;
384
- ge.prototype.delete = Zi;
385
- ge.prototype.get = ea;
386
- ge.prototype.has = ta;
387
- ge.prototype.set = na;
388
- var Qe = Fe(_e, "Map");
383
+ Ae.prototype.clear = qi;
384
+ Ae.prototype.delete = Zi;
385
+ Ae.prototype.get = ea;
386
+ Ae.prototype.has = ta;
387
+ Ae.prototype.set = na;
388
+ var Qe = Fe(ge, "Map");
389
389
  function sa() {
390
390
  this.size = 0, this.__data__ = {
391
391
  hash: new De(),
392
- map: new (Qe || ge)(),
392
+ map: new (Qe || Ae)(),
393
393
  string: new De()
394
394
  };
395
395
  }
@@ -415,18 +415,18 @@ function la(e, t) {
415
415
  var n = bt(this, e), s = n.size;
416
416
  return n.set(e, t), this.size += n.size == s ? 0 : 1, this;
417
417
  }
418
- function Ae(e) {
418
+ function Le(e) {
419
419
  var t = -1, n = e == null ? 0 : e.length;
420
420
  for (this.clear(); ++t < n; ) {
421
421
  var s = e[t];
422
422
  this.set(s[0], s[1]);
423
423
  }
424
424
  }
425
- Ae.prototype.clear = sa;
426
- Ae.prototype.delete = ia;
427
- Ae.prototype.get = aa;
428
- Ae.prototype.has = oa;
429
- Ae.prototype.set = la;
425
+ Le.prototype.clear = sa;
426
+ Le.prototype.delete = ia;
427
+ Le.prototype.get = aa;
428
+ Le.prototype.has = oa;
429
+ Le.prototype.set = la;
430
430
  var ca = "Expected a function";
431
431
  function $t(e, t) {
432
432
  if (typeof e != "function" || t != null && typeof t != "function")
@@ -438,9 +438,9 @@ function $t(e, t) {
438
438
  var a = e.apply(this, s);
439
439
  return n.cache = i.set(r, a) || i, a;
440
440
  };
441
- return n.cache = new ($t.Cache || Ae)(), n;
441
+ return n.cache = new ($t.Cache || Le)(), n;
442
442
  }
443
- $t.Cache = Ae;
443
+ $t.Cache = Le;
444
444
  var ua = 500;
445
445
  function ha(e) {
446
446
  var t = $t(e, function(s) {
@@ -455,7 +455,7 @@ var fa = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=
455
455
  }), t;
456
456
  });
457
457
  function Ea(e) {
458
- return e == null ? "" : Yn(e);
458
+ return e == null ? "" : zn(e);
459
459
  }
460
460
  function is(e, t) {
461
461
  return pe(e) ? e : Gt(e, t) ? [e] : da(Ea(e));
@@ -483,7 +483,7 @@ function ls(e, t) {
483
483
  }
484
484
  var Tn = Ne ? Ne.isConcatSpreadable : void 0;
485
485
  function Na(e) {
486
- return pe(e) || Vt(e) || !!(Tn && e && e[Tn]);
486
+ return pe(e) || Ct(e) || !!(Tn && e && e[Tn]);
487
487
  }
488
488
  function Ta(e, t, n, s, r) {
489
489
  var i = -1, a = e.length;
@@ -498,7 +498,7 @@ function bn(e) {
498
498
  return t ? Ta(e) : [];
499
499
  }
500
500
  function ba() {
501
- this.__data__ = new ge(), this.size = 0;
501
+ this.__data__ = new Ae(), this.size = 0;
502
502
  }
503
503
  function ma(e) {
504
504
  var t = this.__data__, n = t.delete(e);
@@ -513,23 +513,23 @@ function _a(e) {
513
513
  var ga = 200;
514
514
  function Aa(e, t) {
515
515
  var n = this.__data__;
516
- if (n instanceof ge) {
516
+ if (n instanceof Ae) {
517
517
  var s = n.__data__;
518
518
  if (!Qe || s.length < ga - 1)
519
519
  return s.push([e, t]), this.size = ++n.size, this;
520
- n = this.__data__ = new Ae(s);
520
+ n = this.__data__ = new Le(s);
521
521
  }
522
522
  return n.set(e, t), this.size = n.size, this;
523
523
  }
524
- function Ie(e) {
525
- var t = this.__data__ = new ge(e);
524
+ function _e(e) {
525
+ var t = this.__data__ = new Ae(e);
526
526
  this.size = t.size;
527
527
  }
528
- Ie.prototype.clear = ba;
529
- Ie.prototype.delete = ma;
530
- Ie.prototype.get = Ia;
531
- Ie.prototype.has = _a;
532
- Ie.prototype.set = Aa;
528
+ _e.prototype.clear = ba;
529
+ _e.prototype.delete = ma;
530
+ _e.prototype.get = Ia;
531
+ _e.prototype.has = _a;
532
+ _e.prototype.set = Aa;
533
533
  function cs(e, t) {
534
534
  for (var n = -1, s = e == null ? 0 : e.length, r = 0, i = []; ++n < s; ) {
535
535
  var a = e[n];
@@ -545,16 +545,16 @@ var va = Object.prototype, ya = va.propertyIsEnumerable, mn = Object.getOwnPrope
545
545
  return ya.call(e, t);
546
546
  }));
547
547
  } : La;
548
- function Sa(e, t, n) {
548
+ function Pa(e, t, n) {
549
549
  var s = t(e);
550
550
  return pe(e) ? s : ls(s, n(e));
551
551
  }
552
552
  function In(e) {
553
- return Sa(e, Ct, wa);
553
+ return Pa(e, Vt, wa);
554
554
  }
555
- var xt = Fe(_e, "DataView"), Dt = Fe(_e, "Promise"), Rt = Fe(_e, "Set"), _n = "[object Map]", Pa = "[object Object]", gn = "[object Promise]", An = "[object Set]", Ln = "[object WeakMap]", vn = "[object DataView]", Oa = Me(xt), xa = Me(Qe), Da = Me(Dt), Ra = Me(Rt), ka = Me(Pt), we = Xe;
556
- (xt && we(new xt(new ArrayBuffer(1))) != vn || Qe && we(new Qe()) != _n || Dt && we(Dt.resolve()) != gn || Rt && we(new Rt()) != An || Pt && we(new Pt()) != Ln) && (we = function(e) {
557
- var t = Xe(e), n = t == Pa ? e.constructor : void 0, s = n ? Me(n) : "";
555
+ var xt = Fe(ge, "DataView"), Dt = Fe(ge, "Promise"), kt = Fe(ge, "Set"), _n = "[object Map]", Sa = "[object Object]", gn = "[object Promise]", An = "[object Set]", Ln = "[object WeakMap]", vn = "[object DataView]", Oa = Me(xt), xa = Me(Qe), Da = Me(Dt), ka = Me(kt), Ra = Me(St), we = Xe;
556
+ (xt && we(new xt(new ArrayBuffer(1))) != vn || Qe && we(new Qe()) != _n || Dt && we(Dt.resolve()) != gn || kt && we(new kt()) != An || St && we(new St()) != Ln) && (we = function(e) {
557
+ var t = Xe(e), n = t == Sa ? e.constructor : void 0, s = n ? Me(n) : "";
558
558
  if (s)
559
559
  switch (s) {
560
560
  case Oa:
@@ -563,14 +563,14 @@ var xt = Fe(_e, "DataView"), Dt = Fe(_e, "Promise"), Rt = Fe(_e, "Set"), _n = "[
563
563
  return _n;
564
564
  case Da:
565
565
  return gn;
566
- case Ra:
567
- return An;
568
566
  case ka:
567
+ return An;
568
+ case Ra:
569
569
  return Ln;
570
570
  }
571
571
  return t;
572
572
  });
573
- var yn = _e.Uint8Array, Ua = "__lodash_hash_undefined__";
573
+ var yn = ge.Uint8Array, Ua = "__lodash_hash_undefined__";
574
574
  function Ma(e) {
575
575
  return this.__data__.set(e, Ua), this;
576
576
  }
@@ -579,7 +579,7 @@ function Fa(e) {
579
579
  }
580
580
  function ot(e) {
581
581
  var t = -1, n = e == null ? 0 : e.length;
582
- for (this.__data__ = new Ae(); ++t < n; )
582
+ for (this.__data__ = new Le(); ++t < n; )
583
583
  this.add(e[t]);
584
584
  }
585
585
  ot.prototype.add = ot.prototype.push = Ma;
@@ -590,12 +590,12 @@ function Ba(e, t) {
590
590
  return !0;
591
591
  return !1;
592
592
  }
593
- function Va(e, t) {
593
+ function Ca(e, t) {
594
594
  return e.has(t);
595
595
  }
596
- var Ca = 1, Ga = 2;
596
+ var Va = 1, Ga = 2;
597
597
  function us(e, t, n, s, r, i) {
598
- var a = n & Ca, o = e.length, u = t.length;
598
+ var a = n & Va, o = e.length, u = t.length;
599
599
  if (o != u && !(a && u > o))
600
600
  return !1;
601
601
  var p = i.get(e), h = i.get(t);
@@ -613,9 +613,9 @@ function us(e, t, n, s, r, i) {
613
613
  break;
614
614
  }
615
615
  if (b) {
616
- if (!Ba(t, function(H, z) {
617
- if (!Va(b, z) && (A === H || r(A, H, n, s, i)))
618
- return b.push(z);
616
+ if (!Ba(t, function(H, K) {
617
+ if (!Ca(b, K) && (A === H || r(A, H, n, s, i)))
618
+ return b.push(K);
619
619
  })) {
620
620
  N = !1;
621
621
  break;
@@ -639,7 +639,7 @@ function Xa(e) {
639
639
  n[++t] = s;
640
640
  }), n;
641
641
  }
642
- var ja = 1, Wa = 2, Ha = "[object Boolean]", za = "[object Date]", Ya = "[object Error]", qa = "[object Map]", Ka = "[object Number]", Qa = "[object RegExp]", Ja = "[object Set]", Za = "[object String]", eo = "[object Symbol]", to = "[object ArrayBuffer]", no = "[object DataView]", wn = Ne ? Ne.prototype : void 0, St = wn ? wn.valueOf : void 0;
642
+ var ja = 1, Wa = 2, Ha = "[object Boolean]", Ka = "[object Date]", za = "[object Error]", Ya = "[object Map]", qa = "[object Number]", Qa = "[object RegExp]", Ja = "[object Set]", Za = "[object String]", eo = "[object Symbol]", to = "[object ArrayBuffer]", no = "[object DataView]", wn = Ne ? Ne.prototype : void 0, Pt = wn ? wn.valueOf : void 0;
643
643
  function so(e, t, n, s, r, i, a) {
644
644
  switch (n) {
645
645
  case no:
@@ -649,15 +649,15 @@ function so(e, t, n, s, r, i, a) {
649
649
  case to:
650
650
  return !(e.byteLength != t.byteLength || !i(new yn(e), new yn(t)));
651
651
  case Ha:
652
- case za:
653
652
  case Ka:
653
+ case qa:
654
654
  return Qn(+e, +t);
655
- case Ya:
655
+ case za:
656
656
  return e.name == t.name && e.message == t.message;
657
657
  case Qa:
658
658
  case Za:
659
659
  return e == t + "";
660
- case qa:
660
+ case Ya:
661
661
  var o = $a;
662
662
  case Ja:
663
663
  var u = s & ja;
@@ -670,8 +670,8 @@ function so(e, t, n, s, r, i, a) {
670
670
  var h = us(o(e), o(t), s, r, i, a);
671
671
  return a.delete(e), h;
672
672
  case eo:
673
- if (St)
674
- return St.call(e) == St.call(t);
673
+ if (Pt)
674
+ return Pt.call(e) == Pt.call(t);
675
675
  }
676
676
  return !1;
677
677
  }
@@ -692,25 +692,25 @@ function oo(e, t, n, s, r, i) {
692
692
  i.set(e, t), i.set(t, e);
693
693
  for (var v = a; ++d < u; ) {
694
694
  N = o[d];
695
- var H = e[N], z = t[N];
695
+ var H = e[N], K = t[N];
696
696
  if (s)
697
- var w = a ? s(z, H, N, t, e, i) : s(H, z, N, e, t, i);
698
- if (!(w === void 0 ? H === z || r(H, z, n, s, i) : w)) {
697
+ var w = a ? s(K, H, N, t, e, i) : s(H, K, N, e, t, i);
698
+ if (!(w === void 0 ? H === K || r(H, K, n, s, i) : w)) {
699
699
  m = !1;
700
700
  break;
701
701
  }
702
702
  v || (v = N == "constructor");
703
703
  }
704
704
  if (m && !v) {
705
- var J = e.constructor, G = t.constructor;
706
- J != G && "constructor" in e && "constructor" in t && !(typeof J == "function" && J instanceof J && typeof G == "function" && G instanceof G) && (m = !1);
705
+ var J = e.constructor, V = t.constructor;
706
+ J != V && "constructor" in e && "constructor" in t && !(typeof J == "function" && J instanceof J && typeof V == "function" && V instanceof V) && (m = !1);
707
707
  }
708
708
  return i.delete(e), i.delete(t), m;
709
709
  }
710
- var lo = 1, Sn = "[object Arguments]", Pn = "[object Array]", st = "[object Object]", co = Object.prototype, On = co.hasOwnProperty;
710
+ var lo = 1, Pn = "[object Arguments]", Sn = "[object Array]", st = "[object Object]", co = Object.prototype, On = co.hasOwnProperty;
711
711
  function uo(e, t, n, s, r, i) {
712
- var a = pe(e), o = pe(t), u = a ? Pn : we(e), p = o ? Pn : we(t);
713
- u = u == Sn ? st : u, p = p == Sn ? st : p;
712
+ var a = pe(e), o = pe(t), u = a ? Sn : we(e), p = o ? Sn : we(t);
713
+ u = u == Pn ? st : u, p = p == Pn ? st : p;
714
714
  var h = u == st, d = p == st, N = u == p;
715
715
  if (N && Ot(e)) {
716
716
  if (!Ot(t))
@@ -718,15 +718,15 @@ function uo(e, t, n, s, r, i) {
718
718
  a = !0, h = !1;
719
719
  }
720
720
  if (N && !h)
721
- return i || (i = new Ie()), a || ss(e) ? us(e, t, n, s, r, i) : so(e, t, u, n, s, r, i);
721
+ return i || (i = new _e()), a || ss(e) ? us(e, t, n, s, r, i) : so(e, t, u, n, s, r, i);
722
722
  if (!(n & lo)) {
723
723
  var b = h && On.call(e, "__wrapped__"), A = d && On.call(t, "__wrapped__");
724
724
  if (b || A) {
725
725
  var m = b ? e.value() : e, v = A ? t.value() : t;
726
- return i || (i = new Ie()), r(m, v, n, s, i);
726
+ return i || (i = new _e()), r(m, v, n, s, i);
727
727
  }
728
728
  }
729
- return N ? (i || (i = new Ie()), oo(e, t, n, s, r, i)) : !1;
729
+ return N ? (i || (i = new _e()), oo(e, t, n, s, r, i)) : !1;
730
730
  }
731
731
  function Xt(e, t, n, s, r) {
732
732
  return e === t ? !0 : e == null || t == null || !xe(e) && !xe(t) ? e !== e && t !== t : uo(e, t, n, s, Xt, r);
@@ -748,7 +748,7 @@ function po(e, t, n, s) {
748
748
  if (u === void 0 && !(o in e))
749
749
  return !1;
750
750
  } else {
751
- var h = new Ie(), d;
751
+ var h = new _e(), d;
752
752
  if (!(d === void 0 ? Xt(p, u, ho | fo, s, h) : d))
753
753
  return !1;
754
754
  }
@@ -759,7 +759,7 @@ function hs(e) {
759
759
  return e === e && !Ge(e);
760
760
  }
761
761
  function Eo(e) {
762
- for (var t = Ct(e), n = t.length; n--; ) {
762
+ for (var t = Vt(e), n = t.length; n--; ) {
763
763
  var s = t[n], r = e[s];
764
764
  t[n] = [s, r, hs(r)];
765
765
  }
@@ -787,7 +787,7 @@ function bo(e, t, n) {
787
787
  break;
788
788
  e = e[a];
789
789
  }
790
- return i || ++s != r ? i : (r = e == null ? 0 : e.length, !!r && Bt(r) && Kn(a, r) && (pe(e) || Vt(e)));
790
+ return i || ++s != r ? i : (r = e == null ? 0 : e.length, !!r && Bt(r) && qn(a, r) && (pe(e) || Ct(e)));
791
791
  }
792
792
  function mo(e, t) {
793
793
  return e != null && bo(e, t, To);
@@ -834,9 +834,9 @@ function yo(e) {
834
834
  }
835
835
  var Es = yo();
836
836
  function wo(e, t) {
837
- return e && Es(e, t, Ct);
837
+ return e && Es(e, t, Vt);
838
838
  }
839
- function So(e, t) {
839
+ function Po(e, t) {
840
840
  return function(n, s) {
841
841
  if (n == null)
842
842
  return n;
@@ -847,9 +847,9 @@ function So(e, t) {
847
847
  return n;
848
848
  };
849
849
  }
850
- var Po = So(wo);
850
+ var So = Po(wo);
851
851
  function Oo(e, t, n, s) {
852
- return Po(e, function(r, i, a) {
852
+ return So(e, function(r, i, a) {
853
853
  t(s, r, n(r), a);
854
854
  }), s;
855
855
  }
@@ -862,33 +862,33 @@ function xo(e, t) {
862
862
  function Do(e) {
863
863
  return xe(e) && Nt(e);
864
864
  }
865
- function F(e) {
865
+ function M(e) {
866
866
  var t = e == null ? 0 : e.length;
867
867
  return t ? e[t - 1] : void 0;
868
868
  }
869
- function Ro(e) {
869
+ function ko(e) {
870
870
  return typeof e == "function" ? e : Et;
871
871
  }
872
- var ko = Math.max, Uo = Math.min;
872
+ var Ro = Math.max, Uo = Math.min;
873
873
  function Mo(e, t, n) {
874
874
  var s = e == null ? 0 : e.length;
875
875
  if (!s)
876
876
  return -1;
877
877
  var r = s - 1;
878
- return n !== void 0 && (r = dr(n), r = n < 0 ? ko(s + r, 0) : Uo(r, s - 1)), Vr(e, ds(t), r);
878
+ return n !== void 0 && (r = dr(n), r = n < 0 ? Ro(s + r, 0) : Uo(r, s - 1)), Cr(e, ds(t), r);
879
879
  }
880
880
  function Fo(e) {
881
881
  return e && e.length ? e[0] : void 0;
882
882
  }
883
883
  function Je(e, t) {
884
- return e == null ? e : Es(e, Ro(t), Mi);
884
+ return e == null ? e : Es(e, ko(t), Mi);
885
885
  }
886
886
  var oe = xo(function(e, t, n) {
887
887
  e[n ? 0 : 1].push(t);
888
888
  }, function() {
889
889
  return [[], []];
890
890
  }), Bo = Math.max;
891
- function Vo(e) {
891
+ function Co(e) {
892
892
  if (!(e && e.length))
893
893
  return [];
894
894
  var t = 0;
@@ -896,11 +896,11 @@ function Vo(e) {
896
896
  if (Do(n))
897
897
  return t = Bo(n.length, t), !0;
898
898
  }), Zn(t, function(n) {
899
- return zn(e, ps(n));
899
+ return Kn(e, ps(n));
900
900
  });
901
901
  }
902
- var kt = Xr(Vo), f = /* @__PURE__ */ ((e) => (e.SPACE = "<space>", e.TAB = "<tab>", e.NEWLINE = "<newline>", e.COMMA = "<comma>", e.LPAREN = "<lparen>", e.RPAREN = "<rparen>", e.LBRACE = "<lbrace>", e.RBRACE = "<rbrace>", e.LBRACKET = "<lbracket>", e.RBRACKET = "<rbracket>", e.LANGLE = "<langle>", e.RANGLE = "<rangle>", e.OP = "<op>", e.EOF = "<eof>", e.NUMERIC_LITERAL = "<number>", e.STRING_LITERAL = "<string>", e.COLOR_LITERAL = "<color>", e.FUNCTION_EXPRESSION = "<function-expression>", e.QUOTED_STRING = "<variable>", e.IDENTIFIER = "<identifier>", e.SEMICOLON = "<semicolon>", e.COLON = "<colon>", e.TILDE = "<tilde>", e.SINGLE_LINE_COMMENT = "<single-line-comment>", e.MULTILINE_COMMENT = "<multiline-comment>", e))(f || {});
903
- function Co(e) {
902
+ var Rt = Xr(Co), f = /* @__PURE__ */ ((e) => (e.SPACE = "<space>", e.TAB = "<tab>", e.NEWLINE = "<newline>", e.COMMA = "<comma>", e.LPAREN = "<lparen>", e.RPAREN = "<rparen>", e.LBRACE = "<lbrace>", e.RBRACE = "<rbrace>", e.LBRACKET = "<lbracket>", e.RBRACKET = "<rbracket>", e.LANGLE = "<langle>", e.RANGLE = "<rangle>", e.OP = "<op>", e.EOF = "<eof>", e.NUMERIC_LITERAL = "<number>", e.STRING_LITERAL = "<string>", e.COLOR_LITERAL = "<color>", e.FUNCTION_EXPRESSION = "<function-expression>", e.QUOTED_STRING = "<variable>", e.IDENTIFIER = "<identifier>", e.SEMICOLON = "<semicolon>", e.COLON = "<colon>", e.TILDE = "<tilde>", e.SINGLE_LINE_COMMENT = "<single-line-comment>", e.MULTILINE_COMMENT = "<multiline-comment>", e))(f || {});
903
+ function Vo(e) {
904
904
  switch (e.kind) {
905
905
  case "<newline>":
906
906
  case "<space>":
@@ -954,7 +954,7 @@ function Ut(e) {
954
954
  return e.trailingTrivia.find(({ kind: t }) => [f.SPACE, f.TAB].includes(t)) !== void 0;
955
955
  }
956
956
  function Ts(e) {
957
- return e.trailingTrivia.length === 0 ? e.end : Ts(F(e.trailingTrivia));
957
+ return e.trailingTrivia.length === 0 ? e.end : Ts(M(e.trailingTrivia));
958
958
  }
959
959
  function bs(e) {
960
960
  return e.leadingTrivia.length === 0 ? e.start : bs(e.leadingTrivia[0]);
@@ -975,7 +975,7 @@ class Xo {
975
975
  return this.id++;
976
976
  }
977
977
  }
978
- class U {
978
+ class R {
979
979
  // The symbol that this syntax node refers to
980
980
  // args must be passed in order of appearance in the node
981
981
  constructor(t, n, s) {
@@ -995,12 +995,12 @@ class U {
995
995
  }
996
996
  }
997
997
  var Oe = /* @__PURE__ */ ((e) => (e.PROGRAM = "<program>", e.ELEMENT_DECLARATION = "<element-declaration>", e.ATTRIBUTE = "<attribute>", e.IDENTIFIER_STREAM = "<identifer-stream>", e.LITERAL = "<literal>", e.VARIABLE = "<variable>", e.PREFIX_EXPRESSION = "<prefix-expression>", e.INFIX_EXPRESSION = "<infix-expression>", e.POSTFIX_EXPRESSION = "<postfix-expression>", e.FUNCTION_EXPRESSION = "<function-expression>", e.FUNCTION_APPLICATION = "<function-application>", e.BLOCK_EXPRESSION = "<block-expression>", e.LIST_EXPRESSION = "<list-expression>", e.TUPLE_EXPRESSION = "<tuple-expression>", e.CALL_EXPRESSION = "<call-expression>", e.PRIMARY_EXPRESSION = "<primary-expression>", e.GROUP_EXPRESSION = "<group-expression>", e.DUMMY = "<dummy>", e.ARRAY = "<array>", e.PARTIAL_INJECTION = "<partial-injection>", e))(Oe || {});
998
- class ne extends U {
998
+ class ne extends R {
999
999
  constructor({ body: t = [], eof: n }, s) {
1000
1000
  super(s, "<program>", [...t, n]), this.body = t, this.eof = n;
1001
1001
  }
1002
1002
  }
1003
- class P extends U {
1003
+ class S extends R {
1004
1004
  constructor({
1005
1005
  type: t,
1006
1006
  name: n,
@@ -1018,17 +1018,17 @@ class P extends U {
1018
1018
  i,
1019
1019
  a,
1020
1020
  o
1021
- ]), o && a && !(o instanceof y || o instanceof P))
1021
+ ]), o && a && !(o instanceof y || o instanceof S))
1022
1022
  throw new Error("If an element has a simple body, it must be a function application node");
1023
1023
  this.type = t, this.name = n, this.as = s, this.alias = r, this.attributeList = i, this.bodyColon = a, this.body = o;
1024
1024
  }
1025
1025
  }
1026
- class ce extends U {
1026
+ class ce extends R {
1027
1027
  constructor({ identifiers: t = [] }, n) {
1028
1028
  super(n, "<identifer-stream>", t || []), this.identifiers = t;
1029
1029
  }
1030
1030
  }
1031
- class ue extends U {
1031
+ class ue extends R {
1032
1032
  constructor({
1033
1033
  name: t,
1034
1034
  colon: n,
@@ -1037,12 +1037,12 @@ class ue extends U {
1037
1037
  super(r, "<attribute>", [t, n, s]), this.name = t, this.value = s, this.colon = n;
1038
1038
  }
1039
1039
  }
1040
- class re extends U {
1040
+ class re extends R {
1041
1041
  constructor({ op: t, expression: n }, s) {
1042
1042
  super(s, "<prefix-expression>", [t, n]), this.op = t, this.expression = n;
1043
1043
  }
1044
1044
  }
1045
- class Te extends U {
1045
+ class Te extends R {
1046
1046
  constructor({
1047
1047
  op: t,
1048
1048
  leftExpression: n,
@@ -1051,22 +1051,22 @@ class Te extends U {
1051
1051
  super(r, "<infix-expression>", [n, t, s]), this.op = t, this.leftExpression = n, this.rightExpression = s;
1052
1052
  }
1053
1053
  }
1054
- class It extends U {
1054
+ class It extends R {
1055
1055
  constructor({ op: t, expression: n }, s) {
1056
1056
  super(s, "<postfix-expression>", [n, t]), this.op = t, this.expression = n;
1057
1057
  }
1058
1058
  }
1059
- class ie extends U {
1059
+ class ie extends R {
1060
1060
  constructor({ value: t }, n) {
1061
1061
  super(n, "<function-expression>", [t]), this.value = t;
1062
1062
  }
1063
1063
  }
1064
- class y extends U {
1064
+ class y extends R {
1065
1065
  constructor({ callee: t, args: n = [] }, s) {
1066
1066
  super(s, "<function-application>", [t, ...n]), this.callee = t, this.args = n;
1067
1067
  }
1068
1068
  }
1069
- class Ee extends U {
1069
+ class Ee extends R {
1070
1070
  constructor({
1071
1071
  blockOpenBrace: t,
1072
1072
  body: n = [],
@@ -1075,12 +1075,12 @@ class Ee extends U {
1075
1075
  super(r, "<block-expression>", [t, ...n, s]), this.blockOpenBrace = t, this.body = n, this.blockCloseBrace = s;
1076
1076
  }
1077
1077
  }
1078
- class Re extends U {
1078
+ class ke extends R {
1079
1079
  constructor({ op: t, partial: n }, s) {
1080
1080
  super(s, "<partial-injection>", [t, n]), this.partial = n;
1081
1081
  }
1082
1082
  }
1083
- class k extends U {
1083
+ class k extends R {
1084
1084
  constructor({
1085
1085
  listOpenBracket: t,
1086
1086
  elementList: n = [],
@@ -1094,7 +1094,7 @@ class k extends U {
1094
1094
  ]), this.listOpenBracket = t, this.elementList = n, this.commaList = s, this.listCloseBracket = r;
1095
1095
  }
1096
1096
  }
1097
- class be extends U {
1097
+ class be extends R {
1098
1098
  constructor({
1099
1099
  tupleOpenParen: t,
1100
1100
  elementList: n = [],
@@ -1125,7 +1125,7 @@ class jt extends be {
1125
1125
  ), this.kind = "<group-expression>";
1126
1126
  }
1127
1127
  }
1128
- class ae extends U {
1128
+ class ae extends R {
1129
1129
  constructor({
1130
1130
  callee: t,
1131
1131
  argumentList: n
@@ -1133,28 +1133,28 @@ class ae extends U {
1133
1133
  super(s, "<call-expression>", [t, n]), this.callee = t, this.argumentList = n;
1134
1134
  }
1135
1135
  }
1136
- class je extends U {
1136
+ class je extends R {
1137
1137
  constructor({ literal: t }, n) {
1138
1138
  super(n, "<literal>", [t]), this.literal = t;
1139
1139
  }
1140
1140
  }
1141
- class de extends U {
1141
+ class de extends R {
1142
1142
  constructor({ variable: t }, n) {
1143
1143
  super(n, "<variable>", [t]), this.variable = t;
1144
1144
  }
1145
1145
  }
1146
- class Y extends U {
1146
+ class z extends R {
1147
1147
  constructor({ expression: t }, n) {
1148
1148
  super(n, "<primary-expression>", [t]), this.expression = t;
1149
1149
  }
1150
1150
  }
1151
- class rt extends U {
1151
+ class rt extends R {
1152
1152
  constructor({ pre: t }, n) {
1153
1153
  const s = te.create(f.SPACE, t.endPos, t.endPos, " ", !1);
1154
1154
  super(n, "<dummy>", [s]);
1155
1155
  }
1156
1156
  }
1157
- class ke extends U {
1157
+ class Re extends R {
1158
1158
  constructor({ expression: t, indexer: n }, s) {
1159
1159
  super(s, "<array>", [t, n]), this.array = t, this.indexer = n;
1160
1160
  }
@@ -1165,11 +1165,11 @@ function ms(e, t) {
1165
1165
  if (!t || t.length === 0)
1166
1166
  return e || [];
1167
1167
  const [n] = e, [s] = t;
1168
- return (n.start < s.start ? bn(kt(e, t)) : bn(kt(t, e))).filter(
1168
+ return (n.start < s.start ? bn(Rt(e, t)) : bn(Rt(t, e))).filter(
1169
1169
  (r) => r !== null
1170
1170
  );
1171
1171
  }
1172
- function ac(e, t = !1) {
1172
+ function oc(e, t = !1) {
1173
1173
  return JSON.stringify(
1174
1174
  e,
1175
1175
  function(n, s) {
@@ -1195,7 +1195,7 @@ function ac(e, t = !1) {
1195
1195
  t ? 2 : 0
1196
1196
  );
1197
1197
  }
1198
- class V {
1198
+ class B {
1199
1199
  constructor(t) {
1200
1200
  this.value = t;
1201
1201
  }
@@ -1210,7 +1210,7 @@ class V {
1210
1210
  return t(this.value);
1211
1211
  }
1212
1212
  map(t) {
1213
- return new V(t(this.value));
1213
+ return new B(t(this.value));
1214
1214
  }
1215
1215
  isOk() {
1216
1216
  return !0;
@@ -1252,19 +1252,19 @@ function _t(e) {
1252
1252
  function Ht(e) {
1253
1253
  return `Enum:${e}`;
1254
1254
  }
1255
- function zt(e) {
1255
+ function Kt(e) {
1256
1256
  return `Enum field:${e}`;
1257
1257
  }
1258
- function Yt(e) {
1258
+ function zt(e) {
1259
1259
  return `TableGroup:${e}`;
1260
1260
  }
1261
- function qt(e) {
1261
+ function Yt(e) {
1262
1262
  return `TableGroup field:${e}`;
1263
1263
  }
1264
1264
  function jo(e) {
1265
1265
  return `Note:${e}`;
1266
1266
  }
1267
- function Kt(e) {
1267
+ function qt(e) {
1268
1268
  return `TablePartial:${e}`;
1269
1269
  }
1270
1270
  function Is(e) {
@@ -1277,24 +1277,24 @@ function it(e, t) {
1277
1277
  case "Enum":
1278
1278
  return Ht(e);
1279
1279
  case "Enum field":
1280
- return zt(e);
1280
+ return Kt(e);
1281
1281
  case "Schema":
1282
1282
  return Wt(e);
1283
1283
  case "Table":
1284
1284
  return lt(e);
1285
1285
  case "TableGroup":
1286
- return Yt(e);
1286
+ return zt(e);
1287
1287
  case "TableGroup field":
1288
- return qt(e);
1288
+ return Yt(e);
1289
1289
  case "TablePartial":
1290
- return Kt(e);
1290
+ return qt(e);
1291
1291
  default:
1292
1292
  throw new Error("Unreachable");
1293
1293
  }
1294
1294
  }
1295
1295
  function he(e) {
1296
1296
  const [t, n] = e.split(":");
1297
- return Object.values(I).includes(t) ? new V({
1297
+ return Object.values(I).includes(t) ? new B({
1298
1298
  name: n,
1299
1299
  kind: t
1300
1300
  }) : new x();
@@ -1312,7 +1312,7 @@ function Ho(e) {
1312
1312
  const { kind: n } = t;
1313
1313
  return n === "TablePartialInjection";
1314
1314
  }
1315
- function zo(e) {
1315
+ function Ko(e) {
1316
1316
  const t = he(e).unwrap_or(void 0);
1317
1317
  if (!t) return null;
1318
1318
  const { kind: n, name: s } = t;
@@ -1322,7 +1322,7 @@ function zo(e) {
1322
1322
  /* TablePartial */
1323
1323
  ) : null;
1324
1324
  }
1325
- class Yo {
1325
+ class zo {
1326
1326
  constructor() {
1327
1327
  this.id = 0;
1328
1328
  }
@@ -1338,12 +1338,12 @@ class _s {
1338
1338
  this.references = [], this.id = n, this.symbolTable = t;
1339
1339
  }
1340
1340
  }
1341
- class qo {
1341
+ class Yo {
1342
1342
  constructor({ symbolTable: t, declaration: n }, s) {
1343
1343
  this.references = [], this.id = s, this.symbolTable = t, this.declaration = n;
1344
1344
  }
1345
1345
  }
1346
- class Ko {
1346
+ class qo {
1347
1347
  constructor({ declaration: t }, n) {
1348
1348
  this.references = [], this.id = n, this.declaration = t;
1349
1349
  }
@@ -1388,11 +1388,11 @@ function nl(e) {
1388
1388
  Wt,
1389
1389
  lt,
1390
1390
  Ht,
1391
- Yt,
1392
- _t,
1393
1391
  zt,
1394
- qt,
1392
+ _t,
1395
1393
  Kt,
1394
+ Yt,
1395
+ qt,
1396
1396
  Is
1397
1397
  ].map((t) => t(e));
1398
1398
  }
@@ -1410,16 +1410,16 @@ function rl(e) {
1410
1410
  const [t] = e;
1411
1411
  return ct(t) || gt(t) && t.toLowerCase() >= "a" && t.toLowerCase() <= "f";
1412
1412
  }
1413
- function Ce(e) {
1413
+ function Ve(e) {
1414
1414
  return gt(e) || ct(e);
1415
1415
  }
1416
- function Rn(e, t) {
1416
+ function kn(e, t) {
1417
1417
  const n = [], s = Math.min(e.length, t.length);
1418
1418
  for (let r = 0; r < s; r += 1)
1419
1419
  n.push(e[r], t[r]);
1420
1420
  return n.push(...e.slice(s), ...t.slice(s)), n;
1421
1421
  }
1422
- function qe(e, t) {
1422
+ function Ye(e, t) {
1423
1423
  return e >= t.start && e < t.end;
1424
1424
  }
1425
1425
  function As(e) {
@@ -1430,7 +1430,7 @@ function Mt(e) {
1430
1430
  var t;
1431
1431
  return e instanceof re ? ((t = e.op) == null ? void 0 : t.value) === "-" ? -Mt(e.expression) : Mt(e.expression) : Number.parseFloat(e.expression.literal.value);
1432
1432
  }
1433
- var l = /* @__PURE__ */ ((e) => (e[e.UNKNOWN_SYMBOL = 1e3] = "UNKNOWN_SYMBOL", e[e.UNEXPECTED_SYMBOL = 1001] = "UNEXPECTED_SYMBOL", e[e.UNEXPECTED_EOF = 1002] = "UNEXPECTED_EOF", e[e.UNEXPECTED_NEWLINE = 1003] = "UNEXPECTED_NEWLINE", e[e.UNKNOWN_TOKEN = 1004] = "UNKNOWN_TOKEN", e[e.UNEXPECTED_TOKEN = 1005] = "UNEXPECTED_TOKEN", e[e.UNEXPECTED_ELEMENT_DECLARATION = 1006] = "UNEXPECTED_ELEMENT_DECLARATION", e[e.MISSING_SPACES = 1007] = "MISSING_SPACES", e[e.UNKNOWN_PREFIX_OP = 1008] = "UNKNOWN_PREFIX_OP", e[e.INVALID_OPERAND = 1009] = "INVALID_OPERAND", e[e.EMPTY_ATTRIBUTE_NAME = 1010] = "EMPTY_ATTRIBUTE_NAME", e[e.INVALID_ESCAPE_SEQUENCE = 1011] = "INVALID_ESCAPE_SEQUENCE", e[e.INVALID_NAME = 3e3] = "INVALID_NAME", e[e.UNEXPECTED_NAME = 3001] = "UNEXPECTED_NAME", e[e.NAME_NOT_FOUND = 3002] = "NAME_NOT_FOUND", e[e.DUPLICATE_NAME = 3003] = "DUPLICATE_NAME", e[e.INVALID_ALIAS = 3004] = "INVALID_ALIAS", e[e.UNEXPECTED_ALIAS = 3005] = "UNEXPECTED_ALIAS", e[e.UNEXPECTED_SETTINGS = 3006] = "UNEXPECTED_SETTINGS", e[e.INVALID_SETTINGS = 3007] = "INVALID_SETTINGS", e[e.UNEXPECTED_SIMPLE_BODY = 3008] = "UNEXPECTED_SIMPLE_BODY", e[e.UNEXPECTED_COMPLEX_BODY = 3009] = "UNEXPECTED_COMPLEX_BODY", e[e.INVALID_TABLE_CONTEXT = 3010] = "INVALID_TABLE_CONTEXT", e[e.UNKNOWN_TABLE_SETTING = 3011] = "UNKNOWN_TABLE_SETTING", e[e.DUPLICATE_TABLE_SETTING = 3012] = "DUPLICATE_TABLE_SETTING", e[e.INVALID_TABLEGROUP_CONTEXT = 3013] = "INVALID_TABLEGROUP_CONTEXT", e[e.INVALID_TABLEGROUP_ELEMENT_NAME = 3014] = "INVALID_TABLEGROUP_ELEMENT_NAME", e[e.DUPLICATE_TABLEGROUP_ELEMENT_NAME = 3015] = "DUPLICATE_TABLEGROUP_ELEMENT_NAME", e[e.DUPLICATE_TABLEGROUP_FIELD_NAME = 3016] = "DUPLICATE_TABLEGROUP_FIELD_NAME", e[e.INVALID_TABLEGROUP_FIELD = 3017] = "INVALID_TABLEGROUP_FIELD", e[e.EMPTY_TABLE = 3018] = "EMPTY_TABLE", e[e.INVALID_COLUMN = 3019] = "INVALID_COLUMN", e[e.INVALID_COLUMN_NAME = 3020] = "INVALID_COLUMN_NAME", e[e.UNKNOWN_COLUMN_SETTING = 3021] = "UNKNOWN_COLUMN_SETTING", e[e.INVALID_COLUMN_TYPE = 3022] = "INVALID_COLUMN_TYPE", e[e.DUPLICATE_COLUMN_NAME = 3023] = "DUPLICATE_COLUMN_NAME", e[e.DUPLICATE_COLUMN_SETTING = 3024] = "DUPLICATE_COLUMN_SETTING", e[e.INVALID_COLUMN_SETTING_VALUE = 3025] = "INVALID_COLUMN_SETTING_VALUE", e[e.INVALID_ENUM_CONTEXT = 3026] = "INVALID_ENUM_CONTEXT", e[e.INVALID_ENUM_ELEMENT_NAME = 3027] = "INVALID_ENUM_ELEMENT_NAME", e[e.INVALID_ENUM_ELEMENT = 3028] = "INVALID_ENUM_ELEMENT", e[e.DUPLICATE_ENUM_ELEMENT_NAME = 3029] = "DUPLICATE_ENUM_ELEMENT_NAME", e[e.UNKNOWN_ENUM_ELEMENT_SETTING = 3030] = "UNKNOWN_ENUM_ELEMENT_SETTING", e[e.DUPLICATE_ENUM_ELEMENT_SETTING = 3031] = "DUPLICATE_ENUM_ELEMENT_SETTING", e[e.INVALID_ENUM_ELEMENT_SETTING = 3032] = "INVALID_ENUM_ELEMENT_SETTING", e[e.EMPTY_ENUM = 3033] = "EMPTY_ENUM", e[e.INVALID_REF_CONTEXT = 3034] = "INVALID_REF_CONTEXT", e[e.UNKNOWN_REF_SETTING = 3035] = "UNKNOWN_REF_SETTING", e[e.DUPLICATE_REF_SETTING = 3036] = "DUPLICATE_REF_SETTING", e[e.INVALID_REF_SETTING_VALUE = 3037] = "INVALID_REF_SETTING_VALUE", e[e.INVALID_REF_RELATIONSHIP = 3038] = "INVALID_REF_RELATIONSHIP", e[e.INVALID_REF_FIELD = 3039] = "INVALID_REF_FIELD", e[e.EMPTY_REF = 3040] = "EMPTY_REF", e[e.REF_REDEFINED = 3041] = "REF_REDEFINED", e[e.INVALID_NOTE_CONTEXT = 3042] = "INVALID_NOTE_CONTEXT", e[e.INVALID_NOTE = 3043] = "INVALID_NOTE", e[e.NOTE_REDEFINED = 3044] = "NOTE_REDEFINED", e[e.NOTE_CONTENT_REDEFINED = 3045] = "NOTE_CONTENT_REDEFINED", e[e.EMPTY_NOTE = 3046] = "EMPTY_NOTE", e[e.INVALID_INDEXES_CONTEXT = 3047] = "INVALID_INDEXES_CONTEXT", e[e.INVALID_INDEXES_FIELD = 3048] = "INVALID_INDEXES_FIELD", e[e.INVALID_INDEX = 3049] = "INVALID_INDEX", e[e.UNKNOWN_INDEX_SETTING = 3050] = "UNKNOWN_INDEX_SETTING", e[e.DUPLICATE_INDEX_SETTING = 3051] = "DUPLICATE_INDEX_SETTING", e[e.UNEXPECTED_INDEX_SETTING_VALUE = 3052] = "UNEXPECTED_INDEX_SETTING_VALUE", e[e.INVALID_INDEX_SETTING_VALUE = 3053] = "INVALID_INDEX_SETTING_VALUE", e[e.INVALID_PROJECT_CONTEXT = 3054] = "INVALID_PROJECT_CONTEXT", e[e.PROJECT_REDEFINED = 3055] = "PROJECT_REDEFINED", e[e.INVALID_PROJECT_FIELD = 3056] = "INVALID_PROJECT_FIELD", e[e.INVALID_CUSTOM_CONTEXT = 3057] = "INVALID_CUSTOM_CONTEXT", e[e.INVALID_CUSTOM_ELEMENT_VALUE = 3058] = "INVALID_CUSTOM_ELEMENT_VALUE", e[e.INVALID_ELEMENT_IN_SIMPLE_BODY = 3059] = "INVALID_ELEMENT_IN_SIMPLE_BODY", e[e.INVALID_TABLE_PARTIAL_CONTEXT = 3060] = "INVALID_TABLE_PARTIAL_CONTEXT", e[e.INVALID_TABLE_PARTIAL_ELEMENT_NAME = 3061] = "INVALID_TABLE_PARTIAL_ELEMENT_NAME", e[e.INVALID_TABLE_PARTIAL_SETTING_VALUE = 3062] = "INVALID_TABLE_PARTIAL_SETTING_VALUE", e[e.DUPLICATE_TABLE_PARTIAL_ELEMENT_NAME = 3063] = "DUPLICATE_TABLE_PARTIAL_ELEMENT_NAME", e[e.DUPLICATE_TABLE_PARTIAL_SETTING = 3064] = "DUPLICATE_TABLE_PARTIAL_SETTING", e[e.INVALID_TABLE_PARTIAL_INJECTION = 3065] = "INVALID_TABLE_PARTIAL_INJECTION", e[e.INVALID_TABLE_PARTIAL_INJECTION_OP = 3066] = "INVALID_TABLE_PARTIAL_INJECTION_OP", e[e.INVALID_TABLE_PARTIAL_INJECTION_NAME = 3067] = "INVALID_TABLE_PARTIAL_INJECTION_NAME", e[e.DUPLICATE_TABLE_PARTIAL_INJECTION_NAME = 3068] = "DUPLICATE_TABLE_PARTIAL_INJECTION_NAME", e[e.UNKNOWN_TABLE_PARTIAL_SETTING = 3069] = "UNKNOWN_TABLE_PARTIAL_SETTING", e[e.INVALID_TABLE_SETTING_VALUE = 3070] = "INVALID_TABLE_SETTING_VALUE", e[e.INVALID_CONSTRAINTS_CONTEXT = 3071] = "INVALID_CONSTRAINTS_CONTEXT", e[e.INVALID_CONSTRAINTS_FIELD = 3072] = "INVALID_CONSTRAINTS_FIELD", e[e.INVALID_CONSTRAINT = 3073] = "INVALID_CONSTRAINT", e[e.UNKNOWN_CONSTRAINT_SETTING = 3074] = "UNKNOWN_CONSTRAINT_SETTING", e[e.DUPLICATE_CONSTRAINT_SETTING = 3075] = "DUPLICATE_CONSTRAINT_SETTING", e[e.INVALID_CONSTRAINT_SETTING_VALUE = 3076] = "INVALID_CONSTRAINT_SETTING_VALUE", e[e.BINDING_ERROR = 4e3] = "BINDING_ERROR", e[e.UNSUPPORTED = 5e3] = "UNSUPPORTED", e[e.CIRCULAR_REF = 5001] = "CIRCULAR_REF", e[e.SAME_ENDPOINT = 5002] = "SAME_ENDPOINT", e[e.UNEQUAL_FIELDS_BINARY_REF = 5003] = "UNEQUAL_FIELDS_BINARY_REF", e[e.CONFLICTING_SETTING = 5004] = "CONFLICTING_SETTING", e[e.TABLE_REAPPEAR_IN_TABLEGROUP = 5005] = "TABLE_REAPPEAR_IN_TABLEGROUP", e))(l || {});
1433
+ var l = /* @__PURE__ */ ((e) => (e[e.UNKNOWN_SYMBOL = 1e3] = "UNKNOWN_SYMBOL", e[e.UNEXPECTED_SYMBOL = 1001] = "UNEXPECTED_SYMBOL", e[e.UNEXPECTED_EOF = 1002] = "UNEXPECTED_EOF", e[e.UNEXPECTED_NEWLINE = 1003] = "UNEXPECTED_NEWLINE", e[e.UNKNOWN_TOKEN = 1004] = "UNKNOWN_TOKEN", e[e.UNEXPECTED_TOKEN = 1005] = "UNEXPECTED_TOKEN", e[e.UNEXPECTED_ELEMENT_DECLARATION = 1006] = "UNEXPECTED_ELEMENT_DECLARATION", e[e.MISSING_SPACES = 1007] = "MISSING_SPACES", e[e.UNKNOWN_PREFIX_OP = 1008] = "UNKNOWN_PREFIX_OP", e[e.INVALID_OPERAND = 1009] = "INVALID_OPERAND", e[e.EMPTY_ATTRIBUTE_NAME = 1010] = "EMPTY_ATTRIBUTE_NAME", e[e.INVALID_ESCAPE_SEQUENCE = 1011] = "INVALID_ESCAPE_SEQUENCE", e[e.INVALID_NAME = 3e3] = "INVALID_NAME", e[e.UNEXPECTED_NAME = 3001] = "UNEXPECTED_NAME", e[e.NAME_NOT_FOUND = 3002] = "NAME_NOT_FOUND", e[e.DUPLICATE_NAME = 3003] = "DUPLICATE_NAME", e[e.INVALID_ALIAS = 3004] = "INVALID_ALIAS", e[e.UNEXPECTED_ALIAS = 3005] = "UNEXPECTED_ALIAS", e[e.UNEXPECTED_SETTINGS = 3006] = "UNEXPECTED_SETTINGS", e[e.INVALID_SETTINGS = 3007] = "INVALID_SETTINGS", e[e.UNEXPECTED_SIMPLE_BODY = 3008] = "UNEXPECTED_SIMPLE_BODY", e[e.UNEXPECTED_COMPLEX_BODY = 3009] = "UNEXPECTED_COMPLEX_BODY", e[e.INVALID_TABLE_CONTEXT = 3010] = "INVALID_TABLE_CONTEXT", e[e.UNKNOWN_TABLE_SETTING = 3011] = "UNKNOWN_TABLE_SETTING", e[e.DUPLICATE_TABLE_SETTING = 3012] = "DUPLICATE_TABLE_SETTING", e[e.INVALID_TABLEGROUP_CONTEXT = 3013] = "INVALID_TABLEGROUP_CONTEXT", e[e.INVALID_TABLEGROUP_ELEMENT_NAME = 3014] = "INVALID_TABLEGROUP_ELEMENT_NAME", e[e.DUPLICATE_TABLEGROUP_ELEMENT_NAME = 3015] = "DUPLICATE_TABLEGROUP_ELEMENT_NAME", e[e.DUPLICATE_TABLEGROUP_FIELD_NAME = 3016] = "DUPLICATE_TABLEGROUP_FIELD_NAME", e[e.INVALID_TABLEGROUP_FIELD = 3017] = "INVALID_TABLEGROUP_FIELD", e[e.EMPTY_TABLE = 3018] = "EMPTY_TABLE", e[e.INVALID_COLUMN = 3019] = "INVALID_COLUMN", e[e.INVALID_COLUMN_NAME = 3020] = "INVALID_COLUMN_NAME", e[e.UNKNOWN_COLUMN_SETTING = 3021] = "UNKNOWN_COLUMN_SETTING", e[e.INVALID_COLUMN_TYPE = 3022] = "INVALID_COLUMN_TYPE", e[e.DUPLICATE_COLUMN_NAME = 3023] = "DUPLICATE_COLUMN_NAME", e[e.DUPLICATE_COLUMN_SETTING = 3024] = "DUPLICATE_COLUMN_SETTING", e[e.INVALID_COLUMN_SETTING_VALUE = 3025] = "INVALID_COLUMN_SETTING_VALUE", e[e.INVALID_ENUM_CONTEXT = 3026] = "INVALID_ENUM_CONTEXT", e[e.INVALID_ENUM_ELEMENT_NAME = 3027] = "INVALID_ENUM_ELEMENT_NAME", e[e.INVALID_ENUM_ELEMENT = 3028] = "INVALID_ENUM_ELEMENT", e[e.DUPLICATE_ENUM_ELEMENT_NAME = 3029] = "DUPLICATE_ENUM_ELEMENT_NAME", e[e.UNKNOWN_ENUM_ELEMENT_SETTING = 3030] = "UNKNOWN_ENUM_ELEMENT_SETTING", e[e.DUPLICATE_ENUM_ELEMENT_SETTING = 3031] = "DUPLICATE_ENUM_ELEMENT_SETTING", e[e.INVALID_ENUM_ELEMENT_SETTING = 3032] = "INVALID_ENUM_ELEMENT_SETTING", e[e.EMPTY_ENUM = 3033] = "EMPTY_ENUM", e[e.INVALID_REF_CONTEXT = 3034] = "INVALID_REF_CONTEXT", e[e.UNKNOWN_REF_SETTING = 3035] = "UNKNOWN_REF_SETTING", e[e.DUPLICATE_REF_SETTING = 3036] = "DUPLICATE_REF_SETTING", e[e.INVALID_REF_SETTING_VALUE = 3037] = "INVALID_REF_SETTING_VALUE", e[e.INVALID_REF_RELATIONSHIP = 3038] = "INVALID_REF_RELATIONSHIP", e[e.INVALID_REF_FIELD = 3039] = "INVALID_REF_FIELD", e[e.EMPTY_REF = 3040] = "EMPTY_REF", e[e.REF_REDEFINED = 3041] = "REF_REDEFINED", e[e.INVALID_NOTE_CONTEXT = 3042] = "INVALID_NOTE_CONTEXT", e[e.INVALID_NOTE = 3043] = "INVALID_NOTE", e[e.NOTE_REDEFINED = 3044] = "NOTE_REDEFINED", e[e.NOTE_CONTENT_REDEFINED = 3045] = "NOTE_CONTENT_REDEFINED", e[e.EMPTY_NOTE = 3046] = "EMPTY_NOTE", e[e.INVALID_INDEXES_CONTEXT = 3047] = "INVALID_INDEXES_CONTEXT", e[e.INVALID_INDEXES_FIELD = 3048] = "INVALID_INDEXES_FIELD", e[e.INVALID_INDEX = 3049] = "INVALID_INDEX", e[e.UNKNOWN_INDEX_SETTING = 3050] = "UNKNOWN_INDEX_SETTING", e[e.DUPLICATE_INDEX_SETTING = 3051] = "DUPLICATE_INDEX_SETTING", e[e.UNEXPECTED_INDEX_SETTING_VALUE = 3052] = "UNEXPECTED_INDEX_SETTING_VALUE", e[e.INVALID_INDEX_SETTING_VALUE = 3053] = "INVALID_INDEX_SETTING_VALUE", e[e.INVALID_PROJECT_CONTEXT = 3054] = "INVALID_PROJECT_CONTEXT", e[e.PROJECT_REDEFINED = 3055] = "PROJECT_REDEFINED", e[e.INVALID_PROJECT_FIELD = 3056] = "INVALID_PROJECT_FIELD", e[e.INVALID_CUSTOM_CONTEXT = 3057] = "INVALID_CUSTOM_CONTEXT", e[e.INVALID_CUSTOM_ELEMENT_VALUE = 3058] = "INVALID_CUSTOM_ELEMENT_VALUE", e[e.INVALID_ELEMENT_IN_SIMPLE_BODY = 3059] = "INVALID_ELEMENT_IN_SIMPLE_BODY", e[e.INVALID_TABLE_PARTIAL_CONTEXT = 3060] = "INVALID_TABLE_PARTIAL_CONTEXT", e[e.INVALID_TABLE_PARTIAL_ELEMENT_NAME = 3061] = "INVALID_TABLE_PARTIAL_ELEMENT_NAME", e[e.INVALID_TABLE_PARTIAL_SETTING_VALUE = 3062] = "INVALID_TABLE_PARTIAL_SETTING_VALUE", e[e.DUPLICATE_TABLE_PARTIAL_ELEMENT_NAME = 3063] = "DUPLICATE_TABLE_PARTIAL_ELEMENT_NAME", e[e.DUPLICATE_TABLE_PARTIAL_SETTING = 3064] = "DUPLICATE_TABLE_PARTIAL_SETTING", e[e.INVALID_TABLE_PARTIAL_INJECTION = 3065] = "INVALID_TABLE_PARTIAL_INJECTION", e[e.INVALID_TABLE_PARTIAL_INJECTION_OP = 3066] = "INVALID_TABLE_PARTIAL_INJECTION_OP", e[e.INVALID_TABLE_PARTIAL_INJECTION_NAME = 3067] = "INVALID_TABLE_PARTIAL_INJECTION_NAME", e[e.DUPLICATE_TABLE_PARTIAL_INJECTION_NAME = 3068] = "DUPLICATE_TABLE_PARTIAL_INJECTION_NAME", e[e.UNKNOWN_TABLE_PARTIAL_SETTING = 3069] = "UNKNOWN_TABLE_PARTIAL_SETTING", e[e.INVALID_TABLE_SETTING_VALUE = 3070] = "INVALID_TABLE_SETTING_VALUE", e[e.INVALID_CHECKS_CONTEXT = 3071] = "INVALID_CHECKS_CONTEXT", e[e.INVALID_CHECKS_FIELD = 3072] = "INVALID_CHECKS_FIELD", e[e.INVALID_CHECK = 3073] = "INVALID_CHECK", e[e.UNKNOWN_CHECK_SETTING = 3074] = "UNKNOWN_CHECK_SETTING", e[e.DUPLICATE_CHECK_SETTING = 3075] = "DUPLICATE_CHECK_SETTING", e[e.INVALID_CHECK_SETTING_VALUE = 3076] = "INVALID_CHECK_SETTING_VALUE", e[e.BINDING_ERROR = 4e3] = "BINDING_ERROR", e[e.UNSUPPORTED = 5e3] = "UNSUPPORTED", e[e.CIRCULAR_REF = 5001] = "CIRCULAR_REF", e[e.SAME_ENDPOINT = 5002] = "SAME_ENDPOINT", e[e.UNEQUAL_FIELDS_BINARY_REF = 5003] = "UNEQUAL_FIELDS_BINARY_REF", e[e.CONFLICTING_SETTING = 5004] = "CONFLICTING_SETTING", e[e.TABLE_REAPPEAR_IN_TABLEGROUP = 5005] = "TABLE_REAPPEAR_IN_TABLEGROUP", e))(l || {});
1434
1434
  class c extends Error {
1435
1435
  constructor(t, n, s) {
1436
1436
  super(n), this.code = t, this.diagnostic = n, this.nodeOrToken = s, this.start = s.start, this.end = s.end, this.name = this.constructor.name, Object.setPrototypeOf(this, c.prototype);
@@ -1455,16 +1455,16 @@ class se {
1455
1455
  }
1456
1456
  }
1457
1457
  function il(e, t, n) {
1458
- if (!e || !Se(e) || t.length === 0)
1458
+ if (!e || !Pe(e) || t.length === 0)
1459
1459
  return new x();
1460
- const s = [...t], r = kn(e).unwrap(), i = s.pop();
1460
+ const s = [...t], r = Rn(e).unwrap(), i = s.pop();
1461
1461
  if (!(i instanceof Ee))
1462
1462
  return new x();
1463
- const a = F(s) instanceof k ? s.pop() : void 0;
1463
+ const a = M(s) instanceof k ? s.pop() : void 0;
1464
1464
  if (s.length === 3) {
1465
- const o = kn(s[1]).value;
1466
- return !o || !Ft(o) ? new x() : new V(
1467
- n.create(P, {
1465
+ const o = Rn(s[1]).value;
1466
+ return !o || !Ft(o) ? new x() : new B(
1467
+ n.create(S, {
1468
1468
  type: r,
1469
1469
  name: s[0],
1470
1470
  as: o,
@@ -1474,15 +1474,15 @@ function il(e, t, n) {
1474
1474
  })
1475
1475
  );
1476
1476
  }
1477
- return s.length === 1 ? new V(
1478
- n.create(P, {
1477
+ return s.length === 1 ? new B(
1478
+ n.create(S, {
1479
1479
  type: r,
1480
1480
  name: s[0],
1481
1481
  attributeList: a,
1482
1482
  body: i
1483
1483
  })
1484
- ) : s.length === 0 ? new V(
1485
- n.create(P, {
1484
+ ) : s.length === 0 ? new B(
1485
+ n.create(S, {
1486
1486
  type: r,
1487
1487
  attributeList: a,
1488
1488
  body: i
@@ -1499,7 +1499,7 @@ function al(e) {
1499
1499
  e.kind !== f.EOF && (e.isInvalid = !0);
1500
1500
  }
1501
1501
  function ol(e) {
1502
- if (e instanceof P)
1502
+ if (e instanceof S)
1503
1503
  g(e.type), g(e.name), g(e.as), g(e.alias), g(e.bodyColon), g(e.attributeList), g(e.body);
1504
1504
  else if (e instanceof ce)
1505
1505
  e.identifiers.forEach(g);
@@ -1521,7 +1521,7 @@ function ol(e) {
1521
1521
  g(e.callee), g(e.argumentList);
1522
1522
  else if (e instanceof y)
1523
1523
  g(e.callee), e.args.forEach(g);
1524
- else if (e instanceof Y)
1524
+ else if (e instanceof z)
1525
1525
  g(e.expression);
1526
1526
  else if (e instanceof ie)
1527
1527
  g(e.value);
@@ -1540,7 +1540,7 @@ function X(...e) {
1540
1540
  function ll(e) {
1541
1541
  if (e instanceof ne)
1542
1542
  return X(...e.body, e.eof);
1543
- if (e instanceof P)
1543
+ if (e instanceof S)
1544
1544
  return X(
1545
1545
  e.type,
1546
1546
  e.name,
@@ -1573,50 +1573,50 @@ function ll(e) {
1573
1573
  if (e instanceof k)
1574
1574
  return X(
1575
1575
  e.listOpenBracket,
1576
- ...Rn(e.elementList, e.commaList),
1576
+ ...kn(e.elementList, e.commaList),
1577
1577
  e.listCloseBracket
1578
1578
  );
1579
1579
  if (e instanceof be)
1580
1580
  return X(
1581
1581
  e.tupleOpenParen,
1582
- ...Rn(e.elementList, e.commaList),
1582
+ ...kn(e.elementList, e.commaList),
1583
1583
  e.tupleCloseParen
1584
1584
  );
1585
1585
  if (e instanceof ae)
1586
1586
  return X(e.callee, e.argumentList);
1587
- if (e instanceof Y)
1587
+ if (e instanceof z)
1588
1588
  return X(e.expression);
1589
- if (e instanceof ke)
1589
+ if (e instanceof Re)
1590
1590
  return X(
1591
1591
  e.array,
1592
1592
  e.indexer
1593
1593
  );
1594
- if (e instanceof Re) return X(e.partial);
1594
+ if (e instanceof ke) return X(e.partial);
1595
1595
  throw e instanceof jt ? new Error("This case is already handled by TupleExpressionNode") : new Error("Unreachable - no other possible cases");
1596
1596
  }
1597
- function kn(e) {
1598
- return W(e) ? new V(e.expression.variable) : new x();
1597
+ function Rn(e) {
1598
+ return W(e) ? new B(e.expression.variable) : new x();
1599
1599
  }
1600
- function q(e) {
1600
+ function Y(e) {
1601
1601
  var t;
1602
- return e instanceof Y && (e.expression instanceof de && e.expression.variable instanceof te && e.expression.variable.kind === f.QUOTED_STRING || e.expression instanceof je && ((t = e.expression.literal) == null ? void 0 : t.kind) === f.STRING_LITERAL);
1602
+ return e instanceof z && (e.expression instanceof de && e.expression.variable instanceof te && e.expression.variable.kind === f.QUOTED_STRING || e.expression instanceof je && ((t = e.expression.literal) == null ? void 0 : t.kind) === f.STRING_LITERAL);
1603
1603
  }
1604
1604
  function W(e) {
1605
- return e instanceof Y && e.expression instanceof de && e.expression.variable instanceof te;
1605
+ return e instanceof z && e.expression instanceof de && e.expression.variable instanceof te;
1606
1606
  }
1607
- function Se(e) {
1607
+ function Pe(e) {
1608
1608
  var t;
1609
- return e instanceof Y && e.expression instanceof de && ((t = e.expression.variable) == null ? void 0 : t.kind) === f.IDENTIFIER;
1609
+ return e instanceof z && e.expression instanceof de && ((t = e.expression.variable) == null ? void 0 : t.kind) === f.IDENTIFIER;
1610
1610
  }
1611
1611
  function Jt(e) {
1612
1612
  var t;
1613
- return e instanceof Te && e.leftExpression instanceof U && e.rightExpression instanceof U && ((t = e.op) == null ? void 0 : t.value) === ".";
1613
+ return e instanceof Te && e.leftExpression instanceof R && e.rightExpression instanceof R && ((t = e.op) == null ? void 0 : t.value) === ".";
1614
1614
  }
1615
1615
  function $e(e) {
1616
1616
  if (e === void 0)
1617
1617
  return new x();
1618
1618
  const t = e.identifiers.map((n) => n.value).join(" ");
1619
- return t === "" ? new x() : new V(t);
1619
+ return t === "" ? new x() : new B(t);
1620
1620
  }
1621
1621
  class cl {
1622
1622
  // list of errors during lexing
@@ -1759,7 +1759,7 @@ class cl {
1759
1759
  let t = !0, n = [], s;
1760
1760
  const r = [];
1761
1761
  for (const i of this.tokens)
1762
- Co(i) ? (n.push(i), i.kind === f.NEWLINE && s && (s.trailingTrivia = n, t = !0, s = void 0, n = [])) : (t ? i.leadingTrivia = n : s.trailingTrivia = n, r.push(i), n = [], s = i, t = !1);
1762
+ Vo(i) ? (n.push(i), i.kind === f.NEWLINE && s && (s.trailingTrivia = n, t = !0, s = void 0, n = [])) : (t ? i.leadingTrivia = n : s.trailingTrivia = n, r.push(i), n = [], s = i, t = !1);
1763
1763
  this.tokens = r;
1764
1764
  }
1765
1765
  gatherInvalid() {
@@ -1854,7 +1854,7 @@ class cl {
1854
1854
  });
1855
1855
  }
1856
1856
  identifier() {
1857
- for (; !this.isAtEnd() && Ce(this.peek()); )
1857
+ for (; !this.isAtEnd() && Ve(this.peek()); )
1858
1858
  this.advance();
1859
1859
  this.addToken(f.IDENTIFIER);
1860
1860
  }
@@ -1886,26 +1886,26 @@ class cl {
1886
1886
  break;
1887
1887
  if (!n && this.current.offset === this.text.length - 1)
1888
1888
  return this.advance(), this.addToken(f.NUMERIC_LITERAL);
1889
- if (!n && !Ce(this.peek()))
1889
+ if (!n && !Ve(this.peek()))
1890
1890
  return this.addToken(f.NUMERIC_LITERAL);
1891
1891
  if (!n && !ct(this.peek()))
1892
1892
  break;
1893
1893
  this.advance();
1894
1894
  }
1895
1895
  if (t > 0) {
1896
- for (; !this.isAtEnd() && (this.check(".") || Ce(this.peek())); )
1896
+ for (; !this.isAtEnd() && (this.check(".") || Ve(this.peek())); )
1897
1897
  this.advance();
1898
1898
  const n = this.createToken(f.NUMERIC_LITERAL, !0);
1899
1899
  this.tokens.push(n), this.errors.push(new c(l.UNKNOWN_TOKEN, "Invalid number", n));
1900
1900
  } else {
1901
- for (; !this.isAtEnd() && Ce(this.peek()); )
1901
+ for (; !this.isAtEnd() && Ve(this.peek()); )
1902
1902
  this.advance();
1903
1903
  const n = this.createToken(f.IDENTIFIER, !1);
1904
1904
  this.tokens.push(n);
1905
1905
  }
1906
1906
  }
1907
1907
  colorLiteral() {
1908
- for (; !this.isAtEnd() && Ce(this.peek()); )
1908
+ for (; !this.isAtEnd() && Ve(this.peek()); )
1909
1909
  this.advance();
1910
1910
  this.addToken(f.COLOR_LITERAL);
1911
1911
  }
@@ -1948,7 +1948,7 @@ class cl {
1948
1948
  case "u": {
1949
1949
  let n = "";
1950
1950
  for (let s = 0; s <= 3; s += 1) {
1951
- if (this.isAtEnd() || !Ce(this.peek()))
1951
+ if (this.isAtEnd() || !Ve(this.peek()))
1952
1952
  return this.errors.push(new c(l.INVALID_ESCAPE_SEQUENCE, `Invalid unicode escape sequence '\\u${n}', only unicode escape sequences of the form '\\uHHHH' where H is a hexadecimal number are allowed`, te.create(f.STRING_LITERAL, t, this.current, `\\u${n}`, !0))), `\\u${n}`;
1953
1953
  n += this.advance();
1954
1954
  }
@@ -1972,7 +1972,7 @@ class ul {
1972
1972
  return t === 0 && (this.numberOfNestedLBrackets -= 1), t === 1 && (this.numberOfNestedLParens -= 1), t === 2 && (this.numberOfNestedLBraces -= 1), t;
1973
1973
  }
1974
1974
  top() {
1975
- return F(this.stack);
1975
+ return M(this.stack);
1976
1976
  }
1977
1977
  isWithinGroupExpressionContext() {
1978
1978
  return this.numberOfNestedLParens > 0;
@@ -2072,7 +2072,7 @@ class fl {
2072
2072
  for (; !this.isAtEnd() && !this.check(f.RBRACE); )
2073
2073
  try {
2074
2074
  if (this.match(f.TILDE)) {
2075
- const i = this.previous(), a = this.variable(), o = this.nodeFactory.create(Re, { op: i, partial: a });
2075
+ const i = this.previous(), a = this.variable(), o = this.nodeFactory.create(ke, { op: i, partial: a });
2076
2076
  s.body.push(o);
2077
2077
  } else
2078
2078
  s.body.push(this.canBeField() ? this.fieldDeclaration() : this.expression());
@@ -2132,7 +2132,7 @@ class fl {
2132
2132
  } catch (a) {
2133
2133
  if (!(a instanceof T))
2134
2134
  throw a;
2135
- if (a.partialNode instanceof U && s.elementList.push(a.partialNode), !this.canHandle(a))
2135
+ if (a.partialNode instanceof R && s.elementList.push(a.partialNode), !this.canHandle(a))
2136
2136
  throw new T(a.token, i(), a.handlerContext);
2137
2137
  this.synchronizeTuple();
2138
2138
  }
@@ -2180,7 +2180,7 @@ class fl {
2180
2180
  } catch (i) {
2181
2181
  if (!(i instanceof T))
2182
2182
  throw i;
2183
- if (i.partialNode instanceof U && s.elementList.push(i.partialNode), !this.canHandle(i))
2183
+ if (i.partialNode instanceof R && s.elementList.push(i.partialNode), !this.canHandle(i))
2184
2184
  throw new T(i.token, r(), i.handlerContext);
2185
2185
  this.synchronizeList();
2186
2186
  }
@@ -2221,10 +2221,10 @@ class fl {
2221
2221
  return this.current >= this.tokens.length || this.tokens[this.current].kind === f.EOF;
2222
2222
  }
2223
2223
  advance() {
2224
- return this.isAtEnd() ? F(this.tokens) : this.tokens[this.current++];
2224
+ return this.isAtEnd() ? M(this.tokens) : this.tokens[this.current++];
2225
2225
  }
2226
2226
  peek(t = 0) {
2227
- return t + this.current >= this.tokens.length ? F(this.tokens) : this.tokens[this.current + t];
2227
+ return t + this.current >= this.tokens.length ? M(this.tokens) : this.tokens[this.current + t];
2228
2228
  }
2229
2229
  match(...t) {
2230
2230
  const n = this.check(...t);
@@ -2290,7 +2290,7 @@ class fl {
2290
2290
  }
2291
2291
  /* Parsing and synchronizing top-level ElementDeclarationNode */
2292
2292
  elementDeclaration() {
2293
- const t = {}, n = () => this.nodeFactory.create(P, t);
2293
+ const t = {}, n = () => this.nodeFactory.create(S, t);
2294
2294
  try {
2295
2295
  this.consume("Expect an identifier", f.IDENTIFIER), t.type = this.previous();
2296
2296
  } catch (s) {
@@ -2334,13 +2334,13 @@ class fl {
2334
2334
  if (this.match(f.COLON)) {
2335
2335
  t.bodyColon = this.previous();
2336
2336
  const s = this.expression();
2337
- s instanceof P ? (g(s), this.logError(s, l.UNEXPECTED_ELEMENT_DECLARATION, "An element's simple body must not be an element declaration")) : t.body = s;
2337
+ s instanceof S ? (g(s), this.logError(s, l.UNEXPECTED_ELEMENT_DECLARATION, "An element's simple body must not be an element declaration")) : t.body = s;
2338
2338
  } else
2339
2339
  t.body = this.blockExpression();
2340
2340
  } catch (s) {
2341
2341
  throw s instanceof T ? (t.body = s.partialNode, new T(s.token, n(), s.handlerContext)) : s;
2342
2342
  }
2343
- return this.nodeFactory.create(P, t);
2343
+ return this.nodeFactory.create(S, t);
2344
2344
  }
2345
2345
  /* Parsing nested element declarations with simple body */
2346
2346
  // e.g
@@ -2349,7 +2349,7 @@ class fl {
2349
2349
  // Note: 'This is a note' // fieldDeclaration() handles this
2350
2350
  // }
2351
2351
  fieldDeclaration() {
2352
- const t = {}, n = () => this.nodeFactory.create(P, t);
2352
+ const t = {}, n = () => this.nodeFactory.create(S, t);
2353
2353
  try {
2354
2354
  this.consume("Expect an identifier", f.IDENTIFIER), t.type = this.previous();
2355
2355
  } catch (s) {
@@ -2362,11 +2362,11 @@ class fl {
2362
2362
  }
2363
2363
  try {
2364
2364
  const s = this.expression();
2365
- s instanceof P ? this.errors.push(new c(l.INVALID_ELEMENT_IN_SIMPLE_BODY, "Simple body cannot be an element declaration", s)) : t.body = s;
2365
+ s instanceof S ? this.errors.push(new c(l.INVALID_ELEMENT_IN_SIMPLE_BODY, "Simple body cannot be an element declaration", s)) : t.body = s;
2366
2366
  } catch (s) {
2367
2367
  throw s instanceof T ? (t.body = s.partialNode, new T(s.token, n(), s.handlerContext)) : s;
2368
2368
  }
2369
- return this.nodeFactory.create(P, t);
2369
+ return this.nodeFactory.create(S, t);
2370
2370
  }
2371
2371
  /* Parsing any ExpressionNode, including non-NormalExpression */
2372
2372
  expression() {
@@ -2428,12 +2428,12 @@ class fl {
2428
2428
  if (Ut(this.previous()))
2429
2429
  break;
2430
2430
  try {
2431
- n = this.nodeFactory.create(ke, {
2431
+ n = this.nodeFactory.create(Re, {
2432
2432
  expression: n,
2433
2433
  indexer: this.listExpression()
2434
2434
  });
2435
2435
  } catch (r) {
2436
- throw r instanceof T ? (n = this.nodeFactory.create(ke, {
2436
+ throw r instanceof T ? (n = this.nodeFactory.create(Re, {
2437
2437
  expression: n,
2438
2438
  indexer: r.partialNode
2439
2439
  }), new T(r.token, n, r.handlerContext)) : r;
@@ -2556,11 +2556,11 @@ class fl {
2556
2556
  f.STRING_LITERAL,
2557
2557
  f.NUMERIC_LITERAL
2558
2558
  ))
2559
- return this.nodeFactory.create(Y, {
2559
+ return this.nodeFactory.create(z, {
2560
2560
  expression: this.nodeFactory.create(je, { literal: this.previous() })
2561
2561
  });
2562
2562
  if (this.match(f.QUOTED_STRING, f.IDENTIFIER))
2563
- return this.nodeFactory.create(Y, {
2563
+ return this.nodeFactory.create(z, {
2564
2564
  expression: this.nodeFactory.create(de, { variable: this.previous() })
2565
2565
  });
2566
2566
  throw this.logError(this.peek(), l.UNEXPECTED_TOKEN, "Expect a variable or literal"), new T(
@@ -2661,8 +2661,8 @@ const Tl = {
2661
2661
  function Un(e) {
2662
2662
  return Tl[e.value] || { left: null, right: null };
2663
2663
  }
2664
- var _ = /* @__PURE__ */ ((e) => (e.Table = "table", e.Enum = "enum", e.Ref = "ref", e.Note = "note", e.Project = "project", e.Indexes = "indexes", e.TableGroup = "tablegroup", e.TablePartial = "tablepartial", e.Constraints = "constraints", e))(_ || {}), E = /* @__PURE__ */ ((e) => (e.Color = "color", e.HeaderColor = "headercolor", e.Note = "note", e.PK = "pk", e.PrimaryKey = "primary key", e.Unique = "unique", e.Ref = "ref", e.NotNull = "not null", e.Null = "null", e.Increment = "increment", e.Default = "default", e.Name = "name", e.Type = "type", e.Constraint = "constraint", e.Update = "update", e.Delete = "delete", e))(E || {});
2665
- function Pe(e) {
2664
+ var _ = /* @__PURE__ */ ((e) => (e.Table = "table", e.Enum = "enum", e.Ref = "ref", e.Note = "note", e.Project = "project", e.Indexes = "indexes", e.TableGroup = "tablegroup", e.TablePartial = "tablepartial", e.Check = "checks", e))(_ || {}), E = /* @__PURE__ */ ((e) => (e.Color = "color", e.HeaderColor = "headercolor", e.Note = "note", e.PK = "pk", e.PrimaryKey = "primary key", e.Unique = "unique", e.Ref = "ref", e.NotNull = "not null", e.Null = "null", e.Increment = "increment", e.Default = "default", e.Name = "name", e.Type = "type", e.Check = "check", e.Update = "update", e.Delete = "delete", e))(E || {});
2665
+ function Se(e) {
2666
2666
  var n;
2667
2667
  const t = (n = e == null ? void 0 : e.type) == null ? void 0 : n.value.toLowerCase();
2668
2668
  switch (t) {
@@ -2674,17 +2674,17 @@ function Pe(e) {
2674
2674
  case _.Ref:
2675
2675
  case _.TableGroup:
2676
2676
  case _.TablePartial:
2677
- case _.Constraints:
2678
- return new V(t);
2677
+ case _.Check:
2678
+ return new B(t);
2679
2679
  default:
2680
2680
  return new x();
2681
2681
  }
2682
2682
  }
2683
2683
  function Be(e) {
2684
2684
  if (!Jt(e))
2685
- return new V([e]);
2685
+ return new B([e]);
2686
2686
  const t = Be(e.leftExpression).unwrap_or(void 0);
2687
- return t ? (t.push(e.rightExpression), new V(t)) : new x();
2687
+ return t ? (t.push(e.rightExpression), new B(t)) : new x();
2688
2688
  }
2689
2689
  function Q(e) {
2690
2690
  if (e === void 0)
@@ -2694,12 +2694,12 @@ function Q(e) {
2694
2694
  return new x();
2695
2695
  const n = [];
2696
2696
  for (const s of t) {
2697
- const r = K(s).unwrap_or(void 0);
2697
+ const r = q(s).unwrap_or(void 0);
2698
2698
  if (!r)
2699
2699
  return new x();
2700
2700
  n.push(r);
2701
2701
  }
2702
- return new V(n);
2702
+ return new B(n);
2703
2703
  }
2704
2704
  function Ze(e) {
2705
2705
  if (e === void 0)
@@ -2709,52 +2709,50 @@ function Ze(e) {
2709
2709
  return new x();
2710
2710
  const n = [];
2711
2711
  let s;
2712
- if (!W(F(t))) {
2712
+ if (!W(M(t))) {
2713
2713
  const r = t.pop();
2714
- if (Ps(r))
2715
- s = r.elementList.map(
2716
- (i) => j(i).unwrap()
2717
- );
2714
+ if (Ss(r))
2715
+ s = r.elementList.map((i) => j(i).unwrap());
2718
2716
  else
2719
2717
  return new x();
2720
2718
  }
2721
2719
  for (const r of t) {
2722
- const i = K(r).unwrap_or(void 0);
2720
+ const i = q(r).unwrap_or(void 0);
2723
2721
  if (!i)
2724
2722
  return new x();
2725
2723
  n.push(i);
2726
2724
  }
2727
- return new V({
2725
+ return new B({
2728
2726
  variables: n,
2729
2727
  tupleElements: s
2730
2728
  });
2731
2729
  }
2732
- function K(e) {
2733
- return W(e) ? new V(e.expression.variable.value) : new x();
2730
+ function q(e) {
2731
+ return W(e) ? new B(e.expression.variable.value) : new x();
2734
2732
  }
2735
2733
  function ut(e) {
2736
2734
  if (Mn(e))
2737
- return e instanceof ie ? new V({ functional: [e], nonFunctional: [] }) : new V({ functional: [], nonFunctional: [e] });
2735
+ return e instanceof ie ? new B({ functional: [e], nonFunctional: [] }) : new B({ functional: [], nonFunctional: [e] });
2738
2736
  if (e instanceof be && e.elementList.every(Mn)) {
2739
2737
  const t = e.elementList.filter(
2740
2738
  (s) => s instanceof ie
2741
2739
  ), n = e.elementList.filter(W);
2742
- return new V({ functional: t, nonFunctional: n });
2740
+ return new B({ functional: t, nonFunctional: n });
2743
2741
  }
2744
2742
  return new x();
2745
2743
  }
2746
2744
  function j(e) {
2747
2745
  var n;
2748
2746
  const t = (n = e == null ? void 0 : e.expression.variable) == null ? void 0 : n.value;
2749
- return t === void 0 ? new x() : new V(t);
2747
+ return t === void 0 ? new x() : new B(t);
2750
2748
  }
2751
2749
  function bl(e) {
2752
2750
  var n, s;
2753
2751
  const t = (s = (n = e == null ? void 0 : e.partial) == null ? void 0 : n.variable) == null ? void 0 : s.value;
2754
- return t === void 0 ? new x() : new V(t);
2752
+ return t === void 0 ? new x() : new B(t);
2755
2753
  }
2756
2754
  function C(e) {
2757
- return q(e) ? e.expression instanceof de ? new V(e.expression.variable.value) : new V(e.expression.literal.value) : new x();
2755
+ return Y(e) ? e.expression instanceof de ? new B(e.expression.variable.value) : new B(e.expression.literal.value) : new x();
2758
2756
  }
2759
2757
  function ml(e) {
2760
2758
  var t;
@@ -2768,7 +2766,7 @@ function Il(e) {
2768
2766
  return (s == null ? void 0 : s.length) === (r == null ? void 0 : r.length);
2769
2767
  }
2770
2768
  function Mn(e) {
2771
- return e instanceof Y && e.expression instanceof de || e instanceof ie;
2769
+ return e instanceof z && e.expression instanceof de || e instanceof ie;
2772
2770
  }
2773
2771
  function Fn(e, t) {
2774
2772
  var r, i, a, o;
@@ -2789,10 +2787,16 @@ class _l {
2789
2787
  this.declarationNode = t, this.publicSymbolTable = n, this.symbolFactory = s;
2790
2788
  }
2791
2789
  validate() {
2792
- return [...this.validateContext(), ...this.validateName(this.declarationNode.name), ...this.validateAlias(this.declarationNode.alias), ...this.validateSettingList(this.declarationNode.attributeList), ...this.validateBody(this.declarationNode.body)];
2790
+ return [
2791
+ ...this.validateContext(),
2792
+ ...this.validateName(this.declarationNode.name),
2793
+ ...this.validateAlias(this.declarationNode.alias),
2794
+ ...this.validateSettingList(this.declarationNode.attributeList),
2795
+ ...this.validateBody(this.declarationNode.body)
2796
+ ];
2793
2797
  }
2794
2798
  validateContext() {
2795
- return this.declarationNode.parent instanceof ne || Pe(this.declarationNode.parent).unwrap_or(void 0) !== _.Project ? [new c(l.INVALID_CUSTOM_CONTEXT, "A custom element can only appear in a Project", this.declarationNode)] : [];
2799
+ return this.declarationNode.parent instanceof ne || Se(this.declarationNode.parent).unwrap_or(void 0) !== _.Project ? [new c(l.INVALID_CUSTOM_CONTEXT, "A Custom element can only appear in a Project", this.declarationNode)] : [];
2796
2800
  }
2797
2801
  validateName(t) {
2798
2802
  return t ? [new c(l.UNEXPECTED_NAME, "A Custom element shouldn't have a name", t)] : [];
@@ -2809,7 +2813,7 @@ class _l {
2809
2813
  if (t instanceof Ee)
2810
2814
  return [new c(l.UNEXPECTED_COMPLEX_BODY, "A Custom element can only have an inline field", t)];
2811
2815
  const n = [];
2812
- return q(t.callee) || n.push(new c(l.INVALID_CUSTOM_ELEMENT_VALUE, "A Custom element value can only be a string", t)), t.args.length > 0 && n.push(...t.args.map((s) => new c(l.INVALID_CUSTOM_ELEMENT_VALUE, "A Custom element value can only be a string", s))), n;
2816
+ return Y(t.callee) || n.push(new c(l.INVALID_CUSTOM_ELEMENT_VALUE, "A Custom element value can only be a string", t)), t.args.length > 0 && n.push(...t.args.map((s) => new c(l.INVALID_CUSTOM_ELEMENT_VALUE, "A Custom element value can only be a string", s))), n;
2813
2817
  }
2814
2818
  }
2815
2819
  class We {
@@ -2837,10 +2841,17 @@ class gl {
2837
2841
  this.declarationNode = t, this.publicSymbolTable = n, this.symbolFactory = s;
2838
2842
  }
2839
2843
  validate() {
2840
- return [...this.validateContext(), ...this.validateName(this.declarationNode.name), ...this.validateAlias(this.declarationNode.alias), ...this.validateSettingList(this.declarationNode.attributeList), ...this.registerElement(), ...this.validateBody(this.declarationNode.body)];
2844
+ return [
2845
+ ...this.validateContext(),
2846
+ ...this.validateName(this.declarationNode.name),
2847
+ ...this.validateAlias(this.declarationNode.alias),
2848
+ ...this.validateSettingList(this.declarationNode.attributeList),
2849
+ ...this.registerElement(),
2850
+ ...this.validateBody(this.declarationNode.body)
2851
+ ];
2841
2852
  }
2842
2853
  validateContext() {
2843
- return this.declarationNode.parent instanceof P ? [new c(l.INVALID_PROJECT_CONTEXT, "An Enum can only appear top-level", this.declarationNode)] : [];
2854
+ return this.declarationNode.parent instanceof S ? [new c(l.INVALID_PROJECT_CONTEXT, "An Enum can only appear top-level", this.declarationNode)] : [];
2844
2855
  }
2845
2856
  validateName(t) {
2846
2857
  return t ? vs(t) ? [] : [new c(l.INVALID_NAME, "An Enum name must be of the form <enum> or <schema>.<enum>", t)] : [new c(l.NAME_NOT_FOUND, "An Enum must have a name", this.declarationNode)];
@@ -2850,7 +2861,7 @@ class gl {
2850
2861
  }
2851
2862
  registerElement() {
2852
2863
  const t = [];
2853
- this.declarationNode.symbol = this.symbolFactory.create(qo, { declaration: this.declarationNode, symbolTable: new We() });
2864
+ this.declarationNode.symbol = this.symbolFactory.create(Yo, { declaration: this.declarationNode, symbolTable: new We() });
2854
2865
  const { name: n } = this.declarationNode, s = Q(n);
2855
2866
  if (s.isOk()) {
2856
2867
  const r = s.unwrap(), i = r.pop(), a = At(r, this.publicSymbolTable, this.symbolFactory), o = Ht(i);
@@ -2874,17 +2885,17 @@ class gl {
2874
2885
  const s = [];
2875
2886
  n.callee && !W(n.callee) && s.push(new c(l.INVALID_ENUM_ELEMENT_NAME, "An enum field must be an identifier or a quoted identifier", n.callee));
2876
2887
  const r = [...n.args];
2877
- return F(r) instanceof k ? (s.push(...this.validateFieldSettings(F(r))), r.pop()) : r[0] instanceof k && (s.push(...this.validateFieldSettings(r[0])), r.shift()), r.length > 0 && s.push(...r.map((i) => new c(l.INVALID_ENUM_ELEMENT, "An Enum must have only a field and optionally a setting list", i))), s.push(...this.registerField(n)), s;
2888
+ return M(r) instanceof k ? (s.push(...this.validateFieldSettings(M(r))), r.pop()) : r[0] instanceof k && (s.push(...this.validateFieldSettings(r[0])), r.shift()), r.length > 0 && s.push(...r.map((i) => new c(l.INVALID_ENUM_ELEMENT, "An Enum must have only a field and optionally a setting list", i))), s.push(...this.registerField(n)), s;
2878
2889
  });
2879
2890
  }
2880
2891
  validateFieldSettings(t) {
2881
- const n = B(t), s = n.getErrors(), r = n.getValue();
2892
+ const n = F(t), s = n.getErrors(), r = n.getValue();
2882
2893
  for (const i in r) {
2883
2894
  const a = r[i];
2884
2895
  switch (i) {
2885
2896
  case "note":
2886
2897
  a.length > 1 && a.forEach((o) => s.push(new c(l.DUPLICATE_ENUM_ELEMENT_SETTING, "'note' can only appear once", o))), a.forEach((o) => {
2887
- q(o.value) || s.push(new c(l.INVALID_ENUM_ELEMENT_SETTING, "'note' must be a string", o));
2898
+ Y(o.value) || s.push(new c(l.INVALID_ENUM_ELEMENT_SETTING, "'note' must be a string", o));
2888
2899
  });
2889
2900
  break;
2890
2901
  default:
@@ -2903,7 +2914,7 @@ class gl {
2903
2914
  }
2904
2915
  registerField(t) {
2905
2916
  if (t.callee && W(t.callee)) {
2906
- const n = j(t.callee).unwrap(), s = zt(n), r = this.symbolFactory.create(Ko, { declaration: t });
2917
+ const n = j(t.callee).unwrap(), s = Kt(n), r = this.symbolFactory.create(qo, { declaration: t });
2907
2918
  t.symbol = r;
2908
2919
  const i = this.declarationNode.symbol.symbolTable;
2909
2920
  if (i.has(s)) {
@@ -2938,7 +2949,7 @@ class Al {
2938
2949
  this.declarationNode
2939
2950
  );
2940
2951
  if (this.declarationNode.parent instanceof ne) return [t];
2941
- const n = Pe(this.declarationNode.parent).unwrap_or(void 0);
2952
+ const n = Se(this.declarationNode.parent).unwrap_or(void 0);
2942
2953
  return n && [_.Table, _.TablePartial].includes(n) ? [] : [t];
2943
2954
  }
2944
2955
  validateName(t) {
@@ -2963,7 +2974,7 @@ class Al {
2963
2974
  if (!n.callee)
2964
2975
  return [];
2965
2976
  const s = [], r = [n.callee, ...n.args];
2966
- return F(r) instanceof k && s.push(...this.validateFieldSetting(r.pop())), r.forEach((i) => {
2977
+ return M(r) instanceof k && s.push(...this.validateFieldSetting(r.pop())), r.forEach((i) => {
2967
2978
  for (; i instanceof ae; )
2968
2979
  i.argumentList && !ut(i.argumentList).isOk() && s.push(new c(l.INVALID_INDEXES_FIELD, "An index field must be an identifier, a quoted identifier, a functional expression or a tuple of such", i.argumentList)), i = i.callee;
2969
2980
  ut(i).isOk() || s.push(new c(l.INVALID_INDEXES_FIELD, "An index field must be an identifier, a quoted identifier, a functional expression or a tuple of such", i));
@@ -2971,14 +2982,14 @@ class Al {
2971
2982
  });
2972
2983
  }
2973
2984
  validateFieldSetting(t) {
2974
- const n = B(t), s = n.getErrors(), r = n.getValue();
2985
+ const n = F(t), s = n.getErrors(), r = n.getValue();
2975
2986
  for (const i in r) {
2976
2987
  const a = r[i];
2977
2988
  switch (i) {
2978
2989
  case "note":
2979
2990
  case "name":
2980
2991
  a.length > 1 && a.forEach((o) => s.push(new c(l.DUPLICATE_INDEX_SETTING, `'${i}' can only appear once`, o))), a.forEach((o) => {
2981
- q(o.value) || s.push(new c(l.INVALID_INDEX_SETTING_VALUE, `'${i}' must be a string`, o));
2992
+ Y(o.value) || s.push(new c(l.INVALID_INDEX_SETTING_VALUE, `'${i}' must be a string`, o));
2982
2993
  });
2983
2994
  break;
2984
2995
  case "unique":
@@ -3026,7 +3037,7 @@ class Ll {
3026
3037
  _.TableGroup,
3027
3038
  _.TablePartial,
3028
3039
  _.Project
3029
- ].includes(Pe(this.declarationNode.parent).unwrap_or(void 0)) ? [new c(
3040
+ ].includes(Se(this.declarationNode.parent).unwrap_or(void 0)) ? [new c(
3030
3041
  l.INVALID_NOTE_CONTEXT,
3031
3042
  "A Note can only appear inside a Table, a TableGroup, a TablePartial or a Project. Sticky note can only appear at the global scope.",
3032
3043
  this.declarationNode
@@ -3058,7 +3069,7 @@ class Ll {
3058
3069
  }
3059
3070
  validateFields(t) {
3060
3071
  const n = [];
3061
- return t.length === 0 ? [new c(l.EMPTY_NOTE, "A Note must have a content", this.declarationNode)] : (t.length > 1 && t.slice(1).forEach((s) => n.push(new c(l.NOTE_CONTENT_REDEFINED, "A Note can only contain one string", s))), q(t[0].callee) || n.push(new c(l.INVALID_NOTE, "A Note content must be a quoted string", t[0])), t[0].args.length > 0 && n.push(...t[0].args.map((s) => new c(l.INVALID_NOTE, "A Note can only contain one quoted string", s))), n);
3072
+ return t.length === 0 ? [new c(l.EMPTY_NOTE, "A Note must have a content", this.declarationNode)] : (t.length > 1 && t.slice(1).forEach((s) => n.push(new c(l.NOTE_CONTENT_REDEFINED, "A Note can only contain one string", s))), Y(t[0].callee) || n.push(new c(l.INVALID_NOTE, "A Note content must be a quoted string", t[0])), t[0].args.length > 0 && n.push(...t[0].args.map((s) => new c(l.INVALID_NOTE, "A Note can only contain one quoted string", s))), n);
3062
3073
  }
3063
3074
  validateSubElements(t) {
3064
3075
  return t.flatMap((n) => {
@@ -3077,7 +3088,7 @@ class vl {
3077
3088
  return [...this.validateContext(), ...this.validateName(this.declarationNode.name), ...this.validateAlias(this.declarationNode.alias), ...this.validateSettingList(this.declarationNode.attributeList), ...this.validateBody(this.declarationNode.body)];
3078
3089
  }
3079
3090
  validateContext() {
3080
- return this.declarationNode.parent instanceof P ? [new c(l.INVALID_PROJECT_CONTEXT, "A Project can only appear top-level", this.declarationNode)] : [];
3091
+ return this.declarationNode.parent instanceof S ? [new c(l.INVALID_PROJECT_CONTEXT, "A Project can only appear top-level", this.declarationNode)] : [];
3081
3092
  }
3082
3093
  validateName(t) {
3083
3094
  return t ? He(t) ? [] : [new c(l.INVALID_NAME, "A Project's name is optional or must be an identifier or a quoted identifer", t)] : [];
@@ -3113,7 +3124,13 @@ class yl {
3113
3124
  this.declarationNode = t, this.publicSymbolTable = n, this.symbolFactory = s;
3114
3125
  }
3115
3126
  validate() {
3116
- return [...this.validateContext(), ...this.validateName(this.declarationNode.name), ...this.validateAlias(this.declarationNode.alias), ...this.validateSettingList(this.declarationNode.attributeList), ...this.validateBody(this.declarationNode.body)];
3127
+ return [
3128
+ ...this.validateContext(),
3129
+ ...this.validateName(this.declarationNode.name),
3130
+ ...this.validateAlias(this.declarationNode.alias),
3131
+ ...this.validateSettingList(this.declarationNode.attributeList),
3132
+ ...this.validateBody(this.declarationNode.body)
3133
+ ];
3117
3134
  }
3118
3135
  validateContext() {
3119
3136
  return this.declarationNode.parent instanceof ne ? [] : [new c(l.INVALID_REF_CONTEXT, "A Ref must appear top-level", this.declarationNode)];
@@ -3142,15 +3159,15 @@ class yl {
3142
3159
  return t.length > 1 && n.push(...t.slice(1).map((s) => new c(l.REF_REDEFINED, "A Ref can only contain one binary relationship", s))), t.forEach((s) => {
3143
3160
  s.callee && !ml(s.callee) && n.push(new c(l.INVALID_REF_FIELD, "A Ref field must be a binary relationship", s.callee)), s.callee && !Il(s.callee) && n.push(new c(l.UNEQUAL_FIELDS_BINARY_REF, "Unequal fields in ref endpoints", s.callee));
3144
3161
  const r = [...s.args];
3145
- if (F(r) instanceof k) {
3146
- const i = this.validateFieldSettings(F(r));
3162
+ if (M(r) instanceof k) {
3163
+ const i = this.validateFieldSettings(M(r));
3147
3164
  n.push(...i), r.pop();
3148
3165
  } else r[0] instanceof k && (n.push(...this.validateFieldSettings(r[0])), r.shift());
3149
3166
  r.length > 0 && n.push(...r.map((i) => new c(l.INVALID_REF_FIELD, "A Ref field should only have a single binary relationship", i)));
3150
3167
  }), n;
3151
3168
  }
3152
3169
  validateFieldSettings(t) {
3153
- const n = B(t), s = n.getErrors(), r = n.getValue();
3170
+ const n = F(t), s = n.getErrors(), r = n.getValue();
3154
3171
  for (const i in r) {
3155
3172
  const a = r[i];
3156
3173
  switch (i) {
@@ -3197,7 +3214,7 @@ function wl(e) {
3197
3214
  }
3198
3215
  return !1;
3199
3216
  }
3200
- class Sl {
3217
+ class Pl {
3201
3218
  constructor(t, n, s) {
3202
3219
  this.declarationNode = t, this.symbolFactory = s, this.publicSymbolTable = n;
3203
3220
  }
@@ -3212,16 +3229,16 @@ class Sl {
3212
3229
  ];
3213
3230
  }
3214
3231
  validateContext() {
3215
- return this.declarationNode.parent instanceof P ? [new c(l.INVALID_TABLE_CONTEXT, "Table must appear top-level", this.declarationNode)] : [];
3232
+ return this.declarationNode.parent instanceof S ? [new c(l.INVALID_TABLE_CONTEXT, "Table must appear top-level", this.declarationNode)] : [];
3216
3233
  }
3217
3234
  validateName(t) {
3218
- return t ? t instanceof ke ? [new c(l.INVALID_NAME, "Invalid array as Table name, maybe you forget to add a space between the name and the setting list?", t)] : vs(t) ? [] : [new c(l.INVALID_NAME, "A Table name must be of the form <table> or <schema>.<table>", t)] : [new c(l.NAME_NOT_FOUND, "A Table must have a name", this.declarationNode)];
3235
+ return t ? t instanceof Re ? [new c(l.INVALID_NAME, "Invalid array as Table name, maybe you forget to add a space between the name and the setting list?", t)] : vs(t) ? [] : [new c(l.INVALID_NAME, "A Table name must be of the form <table> or <schema>.<table>", t)] : [new c(l.NAME_NOT_FOUND, "A Table must have a name", this.declarationNode)];
3219
3236
  }
3220
3237
  validateAlias(t) {
3221
- return t ? kl(t) ? [] : [new c(l.INVALID_ALIAS, "Table aliases can only contains alphanumeric and underscore unless surrounded by double quotes", t)] : [];
3238
+ return t ? Rl(t) ? [] : [new c(l.INVALID_ALIAS, "Table aliases can only contains alphanumeric and underscore unless surrounded by double quotes", t)] : [];
3222
3239
  }
3223
3240
  validateSettingList(t) {
3224
- const n = B(t), s = n.getErrors(), r = n.getValue();
3241
+ const n = F(t), s = n.getErrors(), r = n.getValue();
3225
3242
  return Je(r, (i, a) => {
3226
3243
  switch (a) {
3227
3244
  case E.HeaderColor:
@@ -3231,7 +3248,7 @@ class Sl {
3231
3248
  break;
3232
3249
  case E.Note:
3233
3250
  i.length > 1 && s.push(...i.map((o) => new c(l.DUPLICATE_TABLE_SETTING, "'note' can only appear once", o))), i.forEach((o) => {
3234
- q(o.value) || s.push(new c(l.INVALID_TABLE_SETTING_VALUE, "'note' must be a string literal", o.value || o.name));
3251
+ Y(o.value) || s.push(new c(l.INVALID_TABLE_SETTING_VALUE, "'note' must be a string literal", o.value || o.name));
3235
3252
  });
3236
3253
  break;
3237
3254
  default:
@@ -3247,7 +3264,7 @@ class Sl {
3247
3264
  const i = [...r.unwrap()], a = i.pop(), o = At(i, this.publicSymbolTable, this.symbolFactory), u = lt(a);
3248
3265
  o.has(u) && t.push(new c(l.DUPLICATE_NAME, `Table name '${a}' already exists in schema '${i.join(".") || "public"}'`, n)), o.set(u, this.declarationNode.symbol);
3249
3266
  }
3250
- if (s && He(s) && !Pl(s.expression.variable.value, r.unwrap_or([]))) {
3267
+ if (s && He(s) && !Sl(s.expression.variable.value, r.unwrap_or([]))) {
3251
3268
  const i = j(s).unwrap(), a = lt(i);
3252
3269
  this.publicSymbolTable.has(a) && t.push(new c(l.DUPLICATE_NAME, `Table name '${i}' already exists`, n)), this.publicSymbolTable.set(a, this.declarationNode.symbol);
3253
3270
  }
@@ -3258,7 +3275,7 @@ class Sl {
3258
3275
  return [];
3259
3276
  if (t instanceof y)
3260
3277
  return [new c(l.UNEXPECTED_SIMPLE_BODY, "A Table's body must be a block", t)];
3261
- const [n, s, r] = t.body.reduce((i, a) => (a instanceof y ? i[0].push(a) : a instanceof Re ? i[1].push(a) : a instanceof P && i[2].push(a), i), [[], [], []]);
3278
+ const [n, s, r] = t.body.reduce((i, a) => (a instanceof y ? i[0].push(a) : a instanceof ke ? i[1].push(a) : a instanceof S && i[2].push(a), i), [[], [], []]);
3262
3279
  return [
3263
3280
  ...this.validateFields(n),
3264
3281
  ...this.validateInjections(s),
@@ -3307,13 +3324,13 @@ class Sl {
3307
3324
  }
3308
3325
  // This is needed to support legacy inline settings
3309
3326
  validateFieldSetting(t) {
3310
- if (!t.slice(0, -1).every(Se) || !t.slice(-1).every((u) => Se(u) || u instanceof k))
3327
+ if (!t.slice(0, -1).every(Pe) || !t.slice(-1).every((u) => Pe(u) || u instanceof k))
3311
3328
  return [...t.map((u) => new c(l.INVALID_COLUMN, "These fields must be some inline settings optionally ended with a setting list", u))];
3312
3329
  if (t.length === 0)
3313
3330
  return [];
3314
3331
  let n;
3315
- F(t) instanceof k && (n = t.pop());
3316
- const s = B(n), r = s.getErrors(), i = s.getValue();
3332
+ M(t) instanceof k && (n = t.pop());
3333
+ const s = F(n), r = s.getErrors(), i = s.getValue();
3317
3334
  t.forEach((u) => {
3318
3335
  const p = j(u).unwrap_or("").toLowerCase();
3319
3336
  if (p !== "pk" && p !== "unique") {
@@ -3329,12 +3346,12 @@ class Sl {
3329
3346
  switch (p) {
3330
3347
  case E.Note:
3331
3348
  u.length > 1 && r.push(...u.map((h) => new c(l.DUPLICATE_COLUMN_SETTING, "note can only appear once", h))), u.forEach((h) => {
3332
- q(h.value) || r.push(new c(l.INVALID_COLUMN_SETTING_VALUE, "'note' must be a quoted string", h.value || h.name));
3349
+ Y(h.value) || r.push(new c(l.INVALID_COLUMN_SETTING_VALUE, "'note' must be a quoted string", h.value || h.name));
3333
3350
  });
3334
3351
  break;
3335
3352
  case E.Ref:
3336
3353
  u.forEach((h) => {
3337
- Ss(h.value) || r.push(new c(l.INVALID_COLUMN_SETTING_VALUE, "'ref' must be a valid unary relationship", h.value || h.name));
3354
+ Ps(h.value) || r.push(new c(l.INVALID_COLUMN_SETTING_VALUE, "'ref' must be a valid unary relationship", h.value || h.name));
3338
3355
  });
3339
3356
  break;
3340
3357
  case E.PrimaryKey:
@@ -3381,9 +3398,9 @@ class Sl {
3381
3398
  ));
3382
3399
  });
3383
3400
  break;
3384
- case E.Constraint:
3401
+ case E.Check:
3385
3402
  u.forEach((h) => {
3386
- h.value instanceof ie || r.push(new c(l.INVALID_COLUMN_SETTING_VALUE, "'constraint' must be a function expression", h.value || h.name));
3403
+ h.value instanceof ie || r.push(new c(l.INVALID_COLUMN_SETTING_VALUE, "'check' must be a function expression", h.value || h.name));
3387
3404
  });
3388
3405
  break;
3389
3406
  default:
@@ -3404,7 +3421,7 @@ class Sl {
3404
3421
  return s.length > 1 && n.push(...s.map((r) => new c(l.NOTE_REDEFINED, "Duplicate notes are defined", r))), n;
3405
3422
  }
3406
3423
  }
3407
- function Pl(e, t) {
3424
+ function Sl(e, t) {
3408
3425
  return t.length === 1 && e === t[0];
3409
3426
  }
3410
3427
  class Ol {
@@ -3422,7 +3439,7 @@ class Ol {
3422
3439
  ];
3423
3440
  }
3424
3441
  validateContext() {
3425
- return this.declarationNode.parent instanceof P ? [new c(
3442
+ return this.declarationNode.parent instanceof S ? [new c(
3426
3443
  l.INVALID_TABLEGROUP_CONTEXT,
3427
3444
  "TableGroup must appear top-level",
3428
3445
  this.declarationNode
@@ -3451,7 +3468,7 @@ class Ol {
3451
3468
  this.declarationNode.symbol = this.symbolFactory.create(Qo, { declaration: this.declarationNode, symbolTable: new We() });
3452
3469
  const n = Q(t);
3453
3470
  if (n.isOk()) {
3454
- const s = n.unwrap(), r = s.pop(), i = At(s, this.publicSymbolTable, this.symbolFactory), a = Yt(r);
3471
+ const s = n.unwrap(), r = s.pop(), i = At(s, this.publicSymbolTable, this.symbolFactory), a = zt(r);
3455
3472
  if (i.has(a))
3456
3473
  return [new c(l.DUPLICATE_NAME, `TableGroup name '${r}' already exists`, t)];
3457
3474
  i.set(a, this.declarationNode.symbol);
@@ -3459,7 +3476,7 @@ class Ol {
3459
3476
  return [];
3460
3477
  }
3461
3478
  validateSettingList(t) {
3462
- const n = B(t), s = n.getErrors(), r = n.getValue();
3479
+ const n = F(t), s = n.getErrors(), r = n.getValue();
3463
3480
  return Je(r, (i, a) => {
3464
3481
  switch (a) {
3465
3482
  case "color":
@@ -3480,7 +3497,7 @@ class Ol {
3480
3497
  l.DUPLICATE_TABLE_SETTING,
3481
3498
  "'note' can only appear once",
3482
3499
  o
3483
- ))), i.filter((o) => !q(o.value)).forEach((o) => {
3500
+ ))), i.filter((o) => !Y(o.value)).forEach((o) => {
3484
3501
  s.push(new c(
3485
3502
  l.INVALID_TABLE_SETTING_VALUE,
3486
3503
  "'note' must be a string literal",
@@ -3532,7 +3549,7 @@ class Ol {
3532
3549
  }
3533
3550
  registerField(t) {
3534
3551
  if (t.callee && W(t.callee)) {
3535
- const n = j(t.callee).unwrap(), s = qt(n), r = this.symbolFactory.create(Jo, { declaration: t });
3552
+ const n = j(t.callee).unwrap(), s = Yt(n), r = this.symbolFactory.create(Jo, { declaration: t });
3536
3553
  t.symbol = r;
3537
3554
  const i = this.declarationNode.symbol.symbolTable;
3538
3555
  if (i.has(s)) {
@@ -3563,7 +3580,7 @@ class Dl {
3563
3580
  ];
3564
3581
  }
3565
3582
  validateContext() {
3566
- return this.declarationNode.parent instanceof P ? [new c(
3583
+ return this.declarationNode.parent instanceof S ? [new c(
3567
3584
  l.INVALID_TABLE_PARTIAL_CONTEXT,
3568
3585
  "TablePartial must appear top-level",
3569
3586
  this.declarationNode
@@ -3588,7 +3605,7 @@ class Dl {
3588
3605
  )] : [];
3589
3606
  }
3590
3607
  validateSettingList(t) {
3591
- const n = B(t), s = n.getErrors(), r = n.getValue();
3608
+ const n = F(t), s = n.getErrors(), r = n.getValue();
3592
3609
  return Je(r, (i, a) => {
3593
3610
  switch (a) {
3594
3611
  case E.HeaderColor:
@@ -3598,7 +3615,7 @@ class Dl {
3598
3615
  break;
3599
3616
  case E.Note:
3600
3617
  i.length > 1 && s.push(...i.map((o) => new c(l.DUPLICATE_TABLE_PARTIAL_SETTING, `'${a}' can only appear once`, o))), i.forEach((o) => {
3601
- q(o.value) || s.push(new c(l.INVALID_TABLE_PARTIAL_SETTING_VALUE, `'${a}' must be a string literal`, o.value || o.name));
3618
+ Y(o.value) || s.push(new c(l.INVALID_TABLE_PARTIAL_SETTING_VALUE, `'${a}' must be a string literal`, o.value || o.name));
3602
3619
  });
3603
3620
  break;
3604
3621
  default:
@@ -3611,7 +3628,7 @@ class Dl {
3611
3628
  this.declarationNode.symbol = this.symbolFactory.create(Zo, { declaration: this.declarationNode, symbolTable: new We() });
3612
3629
  const n = Q(t);
3613
3630
  if (!n.isOk()) return [];
3614
- const s = n.unwrap(), r = s.pop(), i = At(s, this.publicSymbolTable, this.symbolFactory), a = Kt(r);
3631
+ const s = n.unwrap(), r = s.pop(), i = At(s, this.publicSymbolTable, this.symbolFactory), a = qt(r);
3615
3632
  return i.has(a) ? [new c(l.DUPLICATE_NAME, `TablePartial name '${r}' already exists`, t)] : (i.set(a, this.declarationNode.symbol), []);
3616
3633
  }
3617
3634
  validateBody(t) {
@@ -3652,13 +3669,13 @@ class Dl {
3652
3669
  }
3653
3670
  // This is needed to support legacy inline settings
3654
3671
  validateFieldSetting(t) {
3655
- const n = F(t);
3656
- if (!t.slice(0, -1).every(Se) || !(Se(n) || n instanceof k))
3672
+ const n = M(t);
3673
+ if (!t.slice(0, -1).every(Pe) || !(Pe(n) || n instanceof k))
3657
3674
  return [...t.map((p) => new c(l.INVALID_COLUMN, "These fields must be some inline settings optionally ended with a setting list", p))];
3658
3675
  if (t.length === 0) return [];
3659
3676
  let s;
3660
- F(t) instanceof k && (s = t.pop());
3661
- const r = B(s), i = r.getErrors(), a = r.getValue();
3677
+ M(t) instanceof k && (s = t.pop());
3678
+ const r = F(s), i = r.getErrors(), a = r.getValue();
3662
3679
  t.forEach((p) => {
3663
3680
  const h = j(p).unwrap_or("").toLowerCase();
3664
3681
  if (h !== E.PK && h !== E.Unique) {
@@ -3676,12 +3693,12 @@ class Dl {
3676
3693
  switch (h) {
3677
3694
  case E.Note:
3678
3695
  p.length > 1 && i.push(...p.map((d) => new c(l.DUPLICATE_COLUMN_SETTING, `'${h}' can only appear once`, d))), p.forEach((d) => {
3679
- q(d.value) || i.push(new c(l.INVALID_COLUMN_SETTING_VALUE, `'${h}' must be a quoted string`, d.value || d.name));
3696
+ Y(d.value) || i.push(new c(l.INVALID_COLUMN_SETTING_VALUE, `'${h}' must be a quoted string`, d.value || d.name));
3680
3697
  });
3681
3698
  break;
3682
3699
  case E.Ref:
3683
3700
  p.forEach((d) => {
3684
- Ss(d.value) || i.push(new c(l.INVALID_COLUMN_SETTING_VALUE, `'${h}' must be a valid unary relationship`, d.value || d.name));
3701
+ Ps(d.value) || i.push(new c(l.INVALID_COLUMN_SETTING_VALUE, `'${h}' must be a valid unary relationship`, d.value || d.name));
3685
3702
  });
3686
3703
  break;
3687
3704
  case E.PrimaryKey:
@@ -3730,9 +3747,9 @@ class Dl {
3730
3747
  ));
3731
3748
  });
3732
3749
  break;
3733
- case E.Constraint:
3750
+ case E.Check:
3734
3751
  p.forEach((d) => {
3735
- d.value instanceof ie || i.push(new c(l.INVALID_COLUMN_SETTING_VALUE, "'constraint' must be a function expression", d.value || d.name));
3752
+ d.value instanceof ie || i.push(new c(l.INVALID_COLUMN_SETTING_VALUE, "'check' must be a function expression", d.value || d.name));
3736
3753
  });
3737
3754
  break;
3738
3755
  default:
@@ -3753,7 +3770,7 @@ class Dl {
3753
3770
  return s.length > 1 && n.push(...s.map((r) => new c(l.NOTE_REDEFINED, "Duplicate notes are defined", r))), n;
3754
3771
  }
3755
3772
  }
3756
- class Rl {
3773
+ class kl {
3757
3774
  constructor(t, n, s) {
3758
3775
  this.declarationNode = t, this.publicSymbolTable = n, this.symbolFactory = s;
3759
3776
  }
@@ -3768,28 +3785,28 @@ class Rl {
3768
3785
  }
3769
3786
  validateContext() {
3770
3787
  const t = new c(
3771
- l.INVALID_CONSTRAINTS_CONTEXT,
3772
- "A Constraints can only appear inside a Table or a TablePartial",
3788
+ l.INVALID_CHECKS_CONTEXT,
3789
+ "A Checks can only appear inside a Table or a TablePartial",
3773
3790
  this.declarationNode
3774
3791
  );
3775
3792
  if (this.declarationNode.parent instanceof ne) return [t];
3776
- const n = Pe(this.declarationNode.parent).unwrap_or(void 0);
3793
+ const n = Se(this.declarationNode.parent).unwrap_or(void 0);
3777
3794
  return n && [_.Table, _.TablePartial].includes(n) ? [] : [t];
3778
3795
  }
3779
3796
  validateName(t) {
3780
- return t ? [new c(l.UNEXPECTED_NAME, "A Constraints shouldn't have a name", t)] : [];
3797
+ return t ? [new c(l.UNEXPECTED_NAME, "A Checks shouldn't have a name", t)] : [];
3781
3798
  }
3782
3799
  validateAlias(t) {
3783
- return t ? [new c(l.UNEXPECTED_ALIAS, "A Constraints shouldn't have an alias", t)] : [];
3800
+ return t ? [new c(l.UNEXPECTED_ALIAS, "A Checks shouldn't have an alias", t)] : [];
3784
3801
  }
3785
3802
  validateSettingList(t) {
3786
- return t ? [new c(l.UNEXPECTED_SETTINGS, "A Constraints shouldn't have a setting list", t)] : [];
3803
+ return t ? [new c(l.UNEXPECTED_SETTINGS, "A Checks shouldn't have a setting list", t)] : [];
3787
3804
  }
3788
3805
  validateBody(t) {
3789
3806
  if (!t)
3790
3807
  return [];
3791
3808
  if (t instanceof y)
3792
- return [new c(l.UNEXPECTED_SIMPLE_BODY, "A Constraints must have a complex body", t)];
3809
+ return [new c(l.UNEXPECTED_SIMPLE_BODY, "A Checks must have a complex body", t)];
3793
3810
  const [n, s] = oe(t.body, (r) => r instanceof y);
3794
3811
  return [...this.validateFields(n), ...this.validateSubElements(s)];
3795
3812
  }
@@ -3798,21 +3815,21 @@ class Rl {
3798
3815
  if (!n.callee)
3799
3816
  return [];
3800
3817
  const s = [], r = [n.callee, ...n.args];
3801
- return F(r) instanceof k && s.push(...this.validateFieldSetting(r.pop())), (r.length > 1 || !(r[0] instanceof ie)) && s.push(new c(l.INVALID_CONSTRAINTS_FIELD, "A constraint field must be a function expression", n)), s;
3818
+ return M(r) instanceof k && s.push(...this.validateFieldSetting(r.pop())), (r.length > 1 || !(r[0] instanceof ie)) && s.push(new c(l.INVALID_CHECKS_FIELD, "A check field must be a function expression", n)), s;
3802
3819
  });
3803
3820
  }
3804
3821
  validateFieldSetting(t) {
3805
- const n = B(t), s = n.getErrors(), r = n.getValue();
3822
+ const n = F(t), s = n.getErrors(), r = n.getValue();
3806
3823
  for (const i in r) {
3807
3824
  const a = r[i];
3808
3825
  switch (i) {
3809
3826
  case "name":
3810
- a.length > 1 && a.forEach((o) => s.push(new c(l.DUPLICATE_CONSTRAINT_SETTING, `'${i}' can only appear once`, o))), a.forEach((o) => {
3811
- q(o.value) || s.push(new c(l.INVALID_CONSTRAINT_SETTING_VALUE, `'${i}' must be a string`, o));
3827
+ a.length > 1 && a.forEach((o) => s.push(new c(l.DUPLICATE_CHECK_SETTING, `'${i}' can only appear once`, o))), a.forEach((o) => {
3828
+ Y(o.value) || s.push(new c(l.INVALID_CHECK_SETTING_VALUE, `'${i}' must be a string`, o));
3812
3829
  });
3813
3830
  break;
3814
3831
  default:
3815
- a.forEach((o) => s.push(new c(l.UNKNOWN_CONSTRAINT_SETTING, `Unknown constraint setting '${i}'`, o)));
3832
+ a.forEach((o) => s.push(new c(l.UNKNOWN_CHECK_SETTING, `Unknown check setting '${i}'`, o)));
3816
3833
  }
3817
3834
  }
3818
3835
  return s;
@@ -3831,7 +3848,7 @@ function me(e) {
3831
3848
  case _.Enum:
3832
3849
  return gl;
3833
3850
  case _.Table:
3834
- return Sl;
3851
+ return Pl;
3835
3852
  case _.TableGroup:
3836
3853
  return Ol;
3837
3854
  case _.Project:
@@ -3844,8 +3861,8 @@ function me(e) {
3844
3861
  return Al;
3845
3862
  case _.TablePartial:
3846
3863
  return Dl;
3847
- case _.Constraints:
3848
- return Rl;
3864
+ case _.Check:
3865
+ return kl;
3849
3866
  default:
3850
3867
  return _l;
3851
3868
  }
@@ -3853,11 +3870,11 @@ function me(e) {
3853
3870
  function vs(e) {
3854
3871
  return !!Q(e).unwrap_or(!1);
3855
3872
  }
3856
- function kl(e) {
3873
+ function Rl(e) {
3857
3874
  return He(e);
3858
3875
  }
3859
3876
  function He(e) {
3860
- return e instanceof Y && e.expression instanceof de;
3877
+ return e instanceof z && e.expression instanceof de;
3861
3878
  }
3862
3879
  function At(e, t, n) {
3863
3880
  var r;
@@ -3883,7 +3900,7 @@ function ys(e) {
3883
3900
  }
3884
3901
  function Lt(e) {
3885
3902
  var n;
3886
- if (!(e instanceof Y) || !(e.expression instanceof je) || ((n = e.expression.literal) == null ? void 0 : n.kind) !== f.COLOR_LITERAL)
3903
+ if (!(e instanceof z) || !(e.expression instanceof je) || ((n = e.expression.literal) == null ? void 0 : n.kind) !== f.COLOR_LITERAL)
3887
3904
  return !1;
3888
3905
  const t = e.expression.literal.value;
3889
3906
  if (t.length !== 4 && t.length !== 7 || t[0] !== "#")
@@ -3898,31 +3915,31 @@ function ee(e) {
3898
3915
  }
3899
3916
  function ws(e) {
3900
3917
  var t;
3901
- return !!(q(e) || Ue(e) || Se(e) && ["true", "false", "null"].includes(e.expression.variable.value.toLowerCase()) || e instanceof re && xl.includes((t = e.op) == null ? void 0 : t.value) && Ue(e.expression) || e instanceof ie);
3918
+ return !!(Y(e) || Ue(e) || Pe(e) && ["true", "false", "null"].includes(e.expression.variable.value.toLowerCase()) || e instanceof re && xl.includes((t = e.op) == null ? void 0 : t.value) && Ue(e.expression) || e instanceof ie);
3902
3919
  }
3903
3920
  function Ue(e) {
3904
3921
  var t, n, s;
3905
- return e instanceof re ? ((t = e.op) == null ? void 0 : t.value) !== "-" && ((n = e.op) == null ? void 0 : n.value) !== "+" ? !1 : Ue(e.expression) : e instanceof Y && e.expression instanceof je && ((s = e.expression.literal) == null ? void 0 : s.kind) === f.NUMERIC_LITERAL;
3922
+ return e instanceof re ? ((t = e.op) == null ? void 0 : t.value) !== "-" && ((n = e.op) == null ? void 0 : n.value) !== "+" ? !1 : Ue(e.expression) : e instanceof z && e.expression instanceof je && ((s = e.expression.literal) == null ? void 0 : s.kind) === f.NUMERIC_LITERAL;
3906
3923
  }
3907
- function Ss(e) {
3924
+ function Ps(e) {
3908
3925
  var n;
3909
3926
  if (!(e instanceof re) || !ys((n = e.op) == null ? void 0 : n.value))
3910
3927
  return !1;
3911
3928
  const t = Q(e.expression).unwrap_or(void 0);
3912
3929
  return t !== void 0 && t.length > 0;
3913
3930
  }
3914
- function Ps(e) {
3931
+ function Ss(e) {
3915
3932
  return e instanceof be && e.elementList.every(W);
3916
3933
  }
3917
3934
  function Os(e) {
3918
- if (!(e instanceof ae || Jt(e) || e instanceof Y || e instanceof ke))
3935
+ if (!(e instanceof ae || Jt(e) || e instanceof z || e instanceof Re))
3919
3936
  return !1;
3920
3937
  if (e instanceof ae) {
3921
- if (e.callee === void 0 || e.argumentList === void 0 || !e.argumentList.elementList.every((n) => Ue(n) || q(n) || Se(n)))
3938
+ if (e.callee === void 0 || e.argumentList === void 0 || !e.argumentList.elementList.every((n) => Ue(n) || Y(n) || Pe(n)))
3922
3939
  return !1;
3923
3940
  e = e.callee;
3924
3941
  }
3925
- for (; e instanceof ke; ) {
3942
+ for (; e instanceof Re; ) {
3926
3943
  if (e.array === void 0 || e.indexer === void 0 || !e.indexer.elementList.every((n) => !n.colon && !n.value && Ue(n.name)))
3927
3944
  return !1;
3928
3945
  e = e.array;
@@ -3930,7 +3947,7 @@ function Os(e) {
3930
3947
  const t = Q(e).unwrap_or(void 0);
3931
3948
  return t !== void 0 && t.length > 0;
3932
3949
  }
3933
- function B(e) {
3950
+ function F(e) {
3934
3951
  var s;
3935
3952
  const t = {}, n = [];
3936
3953
  if (!e)
@@ -3938,7 +3955,7 @@ function B(e) {
3938
3955
  for (const r of e.elementList) {
3939
3956
  if (!r.name)
3940
3957
  continue;
3941
- if (r.name instanceof Y) {
3958
+ if (r.name instanceof z) {
3942
3959
  n.push(new c(l.INVALID_SETTINGS, "A setting name must be a stream of identifiers", r.name));
3943
3960
  continue;
3944
3961
  }
@@ -3965,11 +3982,11 @@ class Bn {
3965
3982
  );
3966
3983
  t.push(...i.validate());
3967
3984
  });
3968
- const n = this.ast.body.filter((s) => Pe(s).unwrap_or(void 0) === _.Project);
3985
+ const n = this.ast.body.filter((s) => Se(s).unwrap_or(void 0) === _.Project);
3969
3986
  return n.length > 1 && n.forEach((s) => t.push(new c(l.PROJECT_REDEFINED, "Only one project can exist", s))), new se(this.ast, t);
3970
3987
  }
3971
3988
  }
3972
- class Le {
3989
+ class Ie {
3973
3990
  constructor(t, n) {
3974
3991
  this.declarationNode = t, this.errors = n;
3975
3992
  }
@@ -3978,7 +3995,7 @@ class Le {
3978
3995
  }
3979
3996
  bindSettingList(t, n) {
3980
3997
  t && t.elementList.forEach((s) => {
3981
- if (s.name instanceof Y) return;
3998
+ if (s.name instanceof z) return;
3982
3999
  const r = $e(s.name).unwrap_or(void 0);
3983
4000
  if (!r) return;
3984
4001
  const i = n[r.toLowerCase()];
@@ -3990,15 +4007,15 @@ class Le {
3990
4007
  if (!t.body) return;
3991
4008
  const { body: n } = t;
3992
4009
  n instanceof Ee ? n.body.forEach((s) => {
3993
- if (s instanceof P) {
3994
- if (!s.type || Pe(this.declarationNode).unwrap_or(null) === _.TablePartial && Pe(s).unwrap_or(null) === _.Indexes) return;
4010
+ if (s instanceof S) {
4011
+ if (!s.type || Se(this.declarationNode).unwrap_or(null) === _.TablePartial && Se(s).unwrap_or(null) === _.Indexes) return;
3995
4012
  const r = xs(s);
3996
4013
  new r(s, this.errors).bind();
3997
4014
  } else s instanceof y ? this.bindSubfield(s) : this.bindPartialInjection(s);
3998
4015
  }) : this.bindSubfield(n);
3999
4016
  }
4000
4017
  bindSubfield(t) {
4001
- const n = [t.callee, ...t.args], s = F(n);
4018
+ const n = [t.callee, ...t.args], s = M(n);
4002
4019
  s instanceof k && (n.pop(), this.bindSettingList(s, this.subfield.settingList));
4003
4020
  const { argBinderRules: r } = this.subfield.arg;
4004
4021
  for (let i = 0; i < Math.min(n.length, r.length); i += 1)
@@ -4012,18 +4029,18 @@ class Le {
4012
4029
  scanAndBind(t, n) {
4013
4030
  var s, r;
4014
4031
  if (t)
4015
- if (t instanceof Y) {
4032
+ if (t instanceof z) {
4016
4033
  if (t.expression instanceof de && ((r = n.keywords) != null && r.includes((s = t.expression.variable) == null ? void 0 : s.value.toLowerCase())))
4017
4034
  return;
4018
4035
  this.bindFragments([t], n);
4019
- } else t instanceof Te ? Jt(t) ? this.bindFragments(Be(t).unwrap_or([]), n) : (this.scanAndBind(t.leftExpression, n), this.scanAndBind(t.rightExpression, n)) : t instanceof re ? this.scanAndBind(t.expression, n) : t instanceof It ? this.scanAndBind(t.expression, n) : t instanceof be ? t.elementList.forEach((i) => this.scanAndBind(i, n)) : t instanceof Re && this.bindFragments([t], n);
4036
+ } else t instanceof Te ? Jt(t) ? this.bindFragments(Be(t).unwrap_or([]), n) : (this.scanAndBind(t.leftExpression, n), this.scanAndBind(t.rightExpression, n)) : t instanceof re ? this.scanAndBind(t.expression, n) : t instanceof It ? this.scanAndBind(t.expression, n) : t instanceof be ? t.elementList.forEach((i) => this.scanAndBind(i, n)) : t instanceof ke && this.bindFragments([t], n);
4020
4037
  }
4021
4038
  // Bind the fragments of a member access expression
4022
4039
  // which can be a simple expression like v1.User,
4023
4040
  // or a complex tuple like v1.User.(id, name)
4024
4041
  bindFragments(t, n) {
4025
4042
  if (t.length === 0) return;
4026
- const s = t.length === 1 && t[0] instanceof Re, r = [...n.topSubnamesSymbolKind], { remainingSubnamesSymbolKind: i } = n, a = s ? -1 : t.findIndex((N) => !W(N)), u = a !== -1 && Ps(t[a]) ? t[a] : void 0, p = a >= 0 ? r.pop() : void 0, h = t.slice(
4043
+ const s = t.length === 1 && t[0] instanceof ke, r = [...n.topSubnamesSymbolKind], { remainingSubnamesSymbolKind: i } = n, a = s ? -1 : t.findIndex((N) => !W(N)), u = a !== -1 && Ss(t[a]) ? t[a] : void 0, p = a >= 0 ? r.pop() : void 0, h = t.slice(
4027
4044
  0,
4028
4045
  a === -1 ? void 0 : a
4029
4046
  );
@@ -4097,7 +4114,7 @@ class Le {
4097
4114
  n.forEach((i, a) => {
4098
4115
  var p, h;
4099
4116
  if (!Ho(a)) return;
4100
- const o = Fn(zo(a), this.declarationNode), u = (h = (p = o == null ? void 0 : o.declaration) == null ? void 0 : p.symbol) == null ? void 0 : h.symbolTable;
4117
+ const o = Fn(Ko(a), this.declarationNode), u = (h = (p = o == null ? void 0 : o.declaration) == null ? void 0 : p.symbol) == null ? void 0 : h.symbolTable;
4101
4118
  u && u.forEach((d, N) => {
4102
4119
  n.has(N) || s.set(N, { injectorFieldSymbol: d, injectorDeclaration: i.declaration });
4103
4120
  });
@@ -4109,7 +4126,21 @@ class Le {
4109
4126
  });
4110
4127
  }
4111
4128
  }
4112
- class Ul extends Le {
4129
+ class Ul extends Ie {
4130
+ constructor() {
4131
+ super(...arguments), this.subfield = {
4132
+ arg: {
4133
+ argBinderRules: [
4134
+ {
4135
+ shouldBind: !1
4136
+ }
4137
+ ]
4138
+ },
4139
+ settingList: {}
4140
+ }, this.settingList = {};
4141
+ }
4142
+ }
4143
+ class Ml extends Ie {
4113
4144
  constructor() {
4114
4145
  super(...arguments), this.subfield = {
4115
4146
  arg: {
@@ -4119,7 +4150,7 @@ class Ul extends Le {
4119
4150
  }, this.settingList = {};
4120
4151
  }
4121
4152
  }
4122
- class Ml extends Le {
4153
+ class Fl extends Ie {
4123
4154
  constructor() {
4124
4155
  super(...arguments), this.subfield = {
4125
4156
  arg: {
@@ -4129,7 +4160,7 @@ class Ml extends Le {
4129
4160
  }, this.settingList = {};
4130
4161
  }
4131
4162
  }
4132
- class Fl extends Le {
4163
+ class Bl extends Ie {
4133
4164
  constructor() {
4134
4165
  super(...arguments), this.subfield = {
4135
4166
  arg: {
@@ -4164,7 +4195,7 @@ class Fl extends Le {
4164
4195
  }, this.settingList = {};
4165
4196
  }
4166
4197
  }
4167
- class Bl extends Le {
4198
+ class Cl extends Ie {
4168
4199
  constructor() {
4169
4200
  super(...arguments), this.subfield = {
4170
4201
  arg: {
@@ -4174,7 +4205,7 @@ class Bl extends Le {
4174
4205
  }, this.settingList = {};
4175
4206
  }
4176
4207
  }
4177
- class Vl extends Le {
4208
+ class Vl extends Ie {
4178
4209
  constructor() {
4179
4210
  super(...arguments), this.subfield = {
4180
4211
  arg: {
@@ -4184,7 +4215,7 @@ class Vl extends Le {
4184
4215
  }, this.settingList = {};
4185
4216
  }
4186
4217
  }
4187
- class Cl extends Le {
4218
+ class Gl extends Ie {
4188
4219
  constructor() {
4189
4220
  super(...arguments), this.subfield = {
4190
4221
  arg: {
@@ -4201,7 +4232,7 @@ class Cl extends Le {
4201
4232
  }, this.settingList = {};
4202
4233
  }
4203
4234
  }
4204
- class Gl extends Le {
4235
+ class $l extends Ie {
4205
4236
  constructor() {
4206
4237
  super(...arguments), this.subfield = {
4207
4238
  arg: {
@@ -4225,7 +4256,7 @@ class Gl extends Le {
4225
4256
  default: {
4226
4257
  shouldBind: !1
4227
4258
  },
4228
- constraint: {
4259
+ check: {
4229
4260
  shouldBind: !1
4230
4261
  }
4231
4262
  }
@@ -4237,7 +4268,7 @@ class Gl extends Le {
4237
4268
  };
4238
4269
  }
4239
4270
  }
4240
- class $l extends Le {
4271
+ class Xl extends Ie {
4241
4272
  constructor() {
4242
4273
  super(...arguments), this.subfield = {
4243
4274
  arg: {
@@ -4254,7 +4285,7 @@ class $l extends Le {
4254
4285
  }, this.settingList = {};
4255
4286
  }
4256
4287
  }
4257
- class Xl extends Le {
4288
+ class jl extends Ie {
4258
4289
  constructor() {
4259
4290
  super(...arguments), this.subfield = {
4260
4291
  arg: {
@@ -4277,6 +4308,9 @@ class Xl extends Le {
4277
4308
  },
4278
4309
  default: {
4279
4310
  shouldBind: !1
4311
+ },
4312
+ check: {
4313
+ shouldBind: !1
4280
4314
  }
4281
4315
  }
4282
4316
  }, this.settingList = {};
@@ -4285,26 +4319,28 @@ class Xl extends Le {
4285
4319
  function xs(e) {
4286
4320
  switch (e.type.value.toLowerCase()) {
4287
4321
  case _.Enum:
4288
- return Ml;
4322
+ return Fl;
4289
4323
  case _.Table:
4290
- return Gl;
4291
- case _.TableGroup:
4292
4324
  return $l;
4325
+ case _.TableGroup:
4326
+ return Xl;
4293
4327
  case _.Project:
4294
4328
  return Vl;
4295
4329
  case _.Ref:
4296
- return Cl;
4330
+ return Gl;
4297
4331
  case _.Note:
4298
- return Bl;
4332
+ return Cl;
4299
4333
  case _.Indexes:
4300
- return Fl;
4334
+ return Bl;
4301
4335
  case _.TablePartial:
4302
- return Xl;
4303
- default:
4336
+ return jl;
4337
+ case _.Check:
4304
4338
  return Ul;
4339
+ default:
4340
+ return Ml;
4305
4341
  }
4306
4342
  }
4307
- class jl {
4343
+ class Wl {
4308
4344
  constructor(t) {
4309
4345
  this.ast = t, this.errors = [];
4310
4346
  }
@@ -4316,7 +4352,7 @@ class jl {
4316
4352
  }).forEach((n) => n == null ? void 0 : n.bind()), new se(this.ast, this.errors);
4317
4353
  }
4318
4354
  }
4319
- class Wl {
4355
+ class Hl {
4320
4356
  constructor(t) {
4321
4357
  this.generator = t;
4322
4358
  }
@@ -4324,20 +4360,20 @@ class Wl {
4324
4360
  return new t(n, this.generator.nextId());
4325
4361
  }
4326
4362
  }
4327
- class Hl {
4363
+ class Kl {
4328
4364
  constructor(t, n) {
4329
- this.ast = t, this.symbolFactory = new Wl(n);
4365
+ this.ast = t, this.symbolFactory = new Hl(n);
4330
4366
  }
4331
4367
  // Analyzing: Invoking both the validator and binder
4332
4368
  analyze() {
4333
- return new Bn(this.ast, this.symbolFactory).validate().chain((n) => new jl(n).resolve(this.symbolFactory));
4369
+ return new Bn(this.ast, this.symbolFactory).validate().chain((n) => new Wl(n).resolve(this.symbolFactory));
4334
4370
  }
4335
4371
  // For invoking the validator only
4336
4372
  validate() {
4337
4373
  return new Bn(this.ast, this.symbolFactory).validate().chain((n) => new se(n, []));
4338
4374
  }
4339
4375
  }
4340
- function Vn(e, t) {
4376
+ function Cn(e, t) {
4341
4377
  const { variables: n, tupleElements: s } = Ze(e).unwrap();
4342
4378
  return s ? n.length === 0 ? {
4343
4379
  schemaName: t.schemaName,
@@ -4390,7 +4426,7 @@ function ht(e) {
4390
4426
  const t = (n = Be(e).unwrap_or(void 0)) == null ? void 0 : n.pop();
4391
4427
  return t instanceof be ? t.elementList.map((s) => s.referee) : [t.referee];
4392
4428
  }
4393
- function Ve(e) {
4429
+ function Ce(e) {
4394
4430
  const t = Q(e).unwrap();
4395
4431
  return {
4396
4432
  name: t.pop(),
@@ -4400,7 +4436,7 @@ function Ve(e) {
4400
4436
  function tt(e) {
4401
4437
  return e.expression.literal.value;
4402
4438
  }
4403
- function Rs(e, t) {
4439
+ function ks(e, t) {
4404
4440
  if (Array.isArray(e)) {
4405
4441
  const r = e.map(({ id: a }) => a).sort().join(","), i = t.map(({ id: a }) => a).sort().join(",");
4406
4442
  return r < i ? `${r}-${i}` : `${i}-${r}`;
@@ -4411,7 +4447,7 @@ function Rs(e, t) {
4411
4447
  function Zt(e, t) {
4412
4448
  if (Array.isArray(e)) {
4413
4449
  const r = e.map(({ id: a }) => a).sort(), i = t.map(({ id: a }) => a).sort();
4414
- return kt(r, i).every(([a, o]) => a === o);
4450
+ return Rt(r, i).every(([a, o]) => a === o);
4415
4451
  }
4416
4452
  const n = e.id, s = t.id;
4417
4453
  return n === s;
@@ -4422,9 +4458,9 @@ function fe(e) {
4422
4458
  return n.map((i) => i.slice(r)).join(`
4423
4459
  `);
4424
4460
  }
4425
- function ks(e) {
4461
+ function Rs(e) {
4426
4462
  if (e) {
4427
- if (q(e))
4463
+ if (Y(e))
4428
4464
  return {
4429
4465
  value: C(e).unwrap(),
4430
4466
  type: "string"
@@ -4434,7 +4470,7 @@ function ks(e) {
4434
4470
  type: "number",
4435
4471
  value: Mt(e)
4436
4472
  };
4437
- if (Se(e))
4473
+ if (Pe(e))
4438
4474
  return {
4439
4475
  value: e.expression.variable.value.toLowerCase(),
4440
4476
  type: "boolean"
@@ -4449,11 +4485,11 @@ function ks(e) {
4449
4485
  }
4450
4486
  function Us(e) {
4451
4487
  let t = null;
4452
- e instanceof ae && (t = e.argumentList.elementList.map((i) => Ue(i) ? As(i) : q(i) ? C(i).unwrap() : K(i).unwrap()).join(","), e = e.callee);
4488
+ e instanceof ae && (t = e.argumentList.elementList.map((i) => Ue(i) ? As(i) : Y(i) ? C(i).unwrap() : q(i).unwrap()).join(","), e = e.callee);
4453
4489
  let n = "";
4454
- for (; e instanceof ke; )
4490
+ for (; e instanceof Re; )
4455
4491
  n = `[${e.indexer.elementList.map((i) => i.name.expression.literal.value).join(",")}]${n}`, e = e.array;
4456
- const { name: s, schemaName: r } = Ve(e);
4492
+ const { name: s, schemaName: r } = Ce(e);
4457
4493
  return r.length > 1 ? new se(
4458
4494
  {
4459
4495
  schemaName: r.length === 0 ? null : r[0],
@@ -4477,7 +4513,7 @@ class Ms {
4477
4513
  token: void 0,
4478
4514
  indexes: [],
4479
4515
  partials: [],
4480
- constraints: []
4516
+ checks: []
4481
4517
  }, this.pkColumns = [];
4482
4518
  }
4483
4519
  interpret() {
@@ -4502,7 +4538,7 @@ class Ms {
4502
4538
  })), t;
4503
4539
  }
4504
4540
  interpretName(t) {
4505
- const { name: n, schemaName: s } = Ve(t);
4541
+ const { name: n, schemaName: s } = Ce(t);
4506
4542
  return s.length > 1 ? (this.table.name = n, this.table.schemaName = s.join("."), [new c(l.UNSUPPORTED, "Nested schema is not supported", t)]) : (this.table.name = n, this.table.schemaName = s.length ? s[0] : null, []);
4507
4543
  }
4508
4544
  interpretAlias(t) {
@@ -4520,7 +4556,7 @@ class Ms {
4520
4556
  }
4521
4557
  interpretSettingList(t) {
4522
4558
  var r, i, a;
4523
- const n = B(t).getValue();
4559
+ const n = F(t).getValue();
4524
4560
  this.table.headerColor = (r = n[E.HeaderColor]) != null && r.length ? tt((a = (i = n[E.HeaderColor]) == null ? void 0 : i.at(0)) == null ? void 0 : a.value) : void 0;
4525
4561
  const [s] = n[E.Note] || [];
4526
4562
  return this.table.note = s && {
@@ -4529,7 +4565,7 @@ class Ms {
4529
4565
  }, [];
4530
4566
  }
4531
4567
  interpretBody(t) {
4532
- const [n, s] = oe(t.body, (r) => r instanceof y || r instanceof Re);
4568
+ const [n, s] = oe(t.body, (r) => r instanceof y || r instanceof ke);
4533
4569
  return [
4534
4570
  ...this.interpretFields(n),
4535
4571
  ...this.interpretSubElements(s)
@@ -4548,8 +4584,8 @@ class Ms {
4548
4584
  }, [];
4549
4585
  case _.Indexes:
4550
4586
  return this.interpretIndexes(n);
4551
- case _.Constraints:
4552
- return this.interpretConstraints(n);
4587
+ case _.Check:
4588
+ return this.interpretChecks(n);
4553
4589
  default:
4554
4590
  return [];
4555
4591
  }
@@ -4577,9 +4613,9 @@ class Ms {
4577
4613
  const r = Us(t.args[0]);
4578
4614
  s.type = r.getValue(), n.push(...r.getErrors()), s.token = L(t), s.inline_refs = [];
4579
4615
  const i = t.args.slice(1);
4580
- if (F(i) instanceof k) {
4581
- const m = B(i.pop()).getValue();
4582
- s.pk = !!((a = m[E.PK]) != null && a.length) || !!((o = m[E.PrimaryKey]) != null && o.length), s.increment = !!((u = m[E.Increment]) != null && u.length), s.unique = !!((p = m[E.Unique]) != null && p.length), s.not_null = (h = m[E.NotNull]) != null && h.length ? !0 : (d = m[E.Null]) != null && d.length ? !1 : void 0, s.dbdefault = ks((b = (N = m[E.Default]) == null ? void 0 : N.at(0)) == null ? void 0 : b.value);
4616
+ if (M(i) instanceof k) {
4617
+ const m = F(i.pop()).getValue();
4618
+ s.pk = !!((a = m[E.PK]) != null && a.length) || !!((o = m[E.PrimaryKey]) != null && o.length), s.increment = !!((u = m[E.Increment]) != null && u.length), s.unique = !!((p = m[E.Unique]) != null && p.length), s.not_null = (h = m[E.NotNull]) != null && h.length ? !0 : (d = m[E.Null]) != null && d.length ? !1 : void 0, s.dbdefault = Rs((b = (N = m[E.Default]) == null ? void 0 : N.at(0)) == null ? void 0 : b.value);
4583
4619
  const v = (A = m[E.Note]) == null ? void 0 : A.at(0);
4584
4620
  s.note = v && {
4585
4621
  value: C(v.value).map(fe).unwrap(),
@@ -4590,60 +4626,59 @@ class Ms {
4590
4626
  const [J] = ht(w.value.expression);
4591
4627
  if (Zt(J, t.symbol))
4592
4628
  return n.push(new c(l.SAME_ENDPOINT, "Two endpoints are the same", w)), [];
4593
- const G = w.value.op, D = Q(w.value.expression).unwrap();
4629
+ const V = w.value.op, G = Q(w.value.expression).unwrap();
4594
4630
  let le;
4595
- if (D.length === 1) {
4596
- const [Z] = D;
4631
+ if (G.length === 1) {
4632
+ const [Z] = G;
4597
4633
  le = {
4598
4634
  schemaName: this.table.schemaName,
4599
4635
  tableName: this.table.name,
4600
4636
  fieldNames: [Z],
4601
- relation: G.value,
4637
+ relation: V.value,
4602
4638
  token: L(w)
4603
4639
  };
4604
- } else if (D.length === 2) {
4605
- const [Z, ye] = D;
4640
+ } else if (G.length === 2) {
4641
+ const [Z, ye] = G;
4606
4642
  le = {
4607
4643
  schemaName: null,
4608
4644
  tableName: Z,
4609
4645
  fieldNames: [ye],
4610
- relation: G.value,
4646
+ relation: V.value,
4611
4647
  token: L(w)
4612
4648
  };
4613
- } else if (D.length === 3) {
4614
- const [Z, ye, nn] = D;
4649
+ } else if (G.length === 3) {
4650
+ const [Z, ye, nn] = G;
4615
4651
  le = {
4616
4652
  schemaName: Z,
4617
4653
  tableName: ye,
4618
4654
  fieldNames: [nn],
4619
- relation: G.value,
4655
+ relation: V.value,
4620
4656
  token: L(w)
4621
4657
  };
4622
4658
  } else {
4623
4659
  n.push(new c(l.UNSUPPORTED, "Nested schema is not supported", w));
4624
- const Z = D.pop(), ye = D.pop();
4660
+ const Z = G.pop(), ye = G.pop();
4625
4661
  le = {
4626
- schemaName: D.join("."),
4662
+ schemaName: G.join("."),
4627
4663
  tableName: ye,
4628
4664
  fieldNames: [Z],
4629
- relation: G.value,
4665
+ relation: V.value,
4630
4666
  token: L(w)
4631
4667
  };
4632
4668
  }
4633
4669
  const ve = this.registerInlineRefToEnv(t, J, le, w);
4634
4670
  return n.push(...ve), ve.length === 0 ? le : [];
4635
4671
  });
4636
- const z = m[E.Constraint] || [];
4637
- s.constraints = z.map((w) => {
4638
- var D;
4639
- const J = L(w), G = (D = w.value.value) == null ? void 0 : D.value;
4672
+ const K = m[E.Check] || [];
4673
+ s.checks = K.map((w) => {
4674
+ const J = L(w), V = w.value.value.value;
4640
4675
  return {
4641
4676
  token: J,
4642
- expression: G
4677
+ expression: V
4643
4678
  };
4644
4679
  });
4645
4680
  }
4646
- return s.pk || (s.pk = i.some((m) => K(m).unwrap().toLowerCase() === "pk")), s.unique || (s.unique = i.some((m) => K(m).unwrap().toLowerCase() === "unique")), this.table.fields.push(s), s.pk && this.pkColumns.push(s), n;
4681
+ return s.pk || (s.pk = i.some((m) => q(m).unwrap().toLowerCase() === "pk")), s.unique || (s.unique = i.some((m) => q(m).unwrap().toLowerCase() === "unique")), this.table.fields.push(s), s.pk && this.pkColumns.push(s), n;
4647
4682
  }
4648
4683
  interpretIndexes(t) {
4649
4684
  return this.table.indexes.push(...t.body.body.map((n) => {
@@ -4651,14 +4686,14 @@ class Ms {
4651
4686
  const s = { columns: [] }, r = n;
4652
4687
  s.token = L(r);
4653
4688
  const i = [r.callee, ...r.args];
4654
- if (F(i) instanceof k) {
4655
- const b = B(i.pop()).getValue();
4689
+ if (M(i) instanceof k) {
4690
+ const b = F(i.pop()).getValue();
4656
4691
  s.pk = !!((a = b[E.PK]) != null && a.length), s.unique = !!((o = b[E.Unique]) != null && o.length), s.name = C((p = (u = b[E.Name]) == null ? void 0 : u.at(0)) == null ? void 0 : p.value).unwrap_or(void 0);
4657
4692
  const A = (h = b[E.Note]) == null ? void 0 : h.at(0);
4658
4693
  s.note = A && {
4659
4694
  value: C(A.value).unwrap(),
4660
4695
  token: L(A)
4661
- }, s.type = K((N = (d = b[E.Type]) == null ? void 0 : d.at(0)) == null ? void 0 : N.value).unwrap_or(void 0);
4696
+ }, s.type = q((N = (d = b[E.Type]) == null ? void 0 : d.at(0)) == null ? void 0 : N.value).unwrap_or(void 0);
4662
4697
  }
4663
4698
  return i.flatMap((b) => {
4664
4699
  if (!(b instanceof ae))
@@ -4684,19 +4719,19 @@ class Ms {
4684
4719
  }), s;
4685
4720
  })), [];
4686
4721
  }
4687
- interpretConstraints(t) {
4688
- return this.table.constraints.push(...t.body.body.map((n) => {
4689
- var i, a, o;
4722
+ interpretChecks(t) {
4723
+ return this.table.checks.push(...t.body.body.map((n) => {
4724
+ var i, a;
4690
4725
  const s = {}, r = n;
4691
4726
  if (s.token = L(r), r.args[0] instanceof k) {
4692
- const u = B(r.args[0]).getValue();
4693
- s.name = C((a = (i = u[E.Name]) == null ? void 0 : i.at(0)) == null ? void 0 : a.value).unwrap_or(void 0);
4727
+ const o = F(r.args[0]).getValue();
4728
+ s.name = C((a = (i = o[E.Name]) == null ? void 0 : i.at(0)) == null ? void 0 : a.value).unwrap_or(void 0);
4694
4729
  }
4695
- return s.expression = (o = r.callee.value) == null ? void 0 : o.value, s;
4730
+ return s.expression = r.callee.value.value, s;
4696
4731
  })), [];
4697
4732
  }
4698
4733
  registerInlineRefToEnv(t, n, s, r) {
4699
- const i = Rs(t.symbol, n);
4734
+ const i = ks(t.symbol, n);
4700
4735
  if (this.env.refIds[i])
4701
4736
  return [
4702
4737
  new c(l.CIRCULAR_REF, "References with same endpoints exist", r),
@@ -4715,7 +4750,7 @@ class Ms {
4715
4750
  {
4716
4751
  schemaName: this.table.schemaName,
4717
4752
  tableName: this.table.name,
4718
- fieldNames: [K(t.callee).unwrap()],
4753
+ fieldNames: [q(t.callee).unwrap()],
4719
4754
  token: L(t),
4720
4755
  relation: a[0]
4721
4756
  }
@@ -4735,12 +4770,12 @@ class zl {
4735
4770
  ];
4736
4771
  }
4737
4772
  interpretName(t) {
4738
- const { name: n } = Ve(t);
4773
+ const { name: n } = Ce(t);
4739
4774
  return this.note.name = n, [];
4740
4775
  }
4741
4776
  interpretSettingList(t) {
4742
4777
  var s, r, i;
4743
- const n = B(t).getValue();
4778
+ const n = F(t).getValue();
4744
4779
  return this.note.headerColor = (s = n.headercolor) != null && s.length ? tt((i = (r = n.headercolor) == null ? void 0 : r.at(0)) == null ? void 0 : i.value) : void 0, [];
4745
4780
  }
4746
4781
  interpretBody(t) {
@@ -4756,7 +4791,7 @@ class zl {
4756
4791
  }
4757
4792
  class Fs {
4758
4793
  constructor(t, n) {
4759
- this.declarationNode = t, this.env = n, this.container = this.declarationNode.parent instanceof P ? this.env.tables.get(this.declarationNode.parent) : void 0, this.ref = {};
4794
+ this.declarationNode = t, this.env = n, this.container = this.declarationNode.parent instanceof S ? this.env.tables.get(this.declarationNode.parent) : void 0, this.ref = {};
4760
4795
  }
4761
4796
  interpret() {
4762
4797
  return this.ref.token = L(this.declarationNode), this.env.ref.set(this.declarationNode, this.ref), [
@@ -4776,27 +4811,27 @@ class Fs {
4776
4811
  const n = t.callee.op.value, { leftExpression: s, rightExpression: r } = t.callee, i = ht(s), a = ht(r);
4777
4812
  if (Zt(i, a))
4778
4813
  return [new c(l.SAME_ENDPOINT, "Two endpoints are the same", t)];
4779
- const o = Rs(i, a);
4814
+ const o = ks(i, a);
4780
4815
  if (this.env.refIds[o])
4781
4816
  return [
4782
4817
  new c(l.CIRCULAR_REF, "References with same endpoints exist", this.declarationNode),
4783
4818
  new c(l.CIRCULAR_REF, "References with same endpoints exist", this.env.refIds[o])
4784
4819
  ];
4785
4820
  if (t.args[0]) {
4786
- const v = B(t.args[0]).getValue(), H = (h = (p = v.delete) == null ? void 0 : p.at(0)) == null ? void 0 : h.value;
4787
- this.ref.onDelete = H instanceof ce ? $e(H).unwrap_or(void 0) : K(H).unwrap_or(void 0);
4788
- const z = (N = (d = v.update) == null ? void 0 : d.at(0)) == null ? void 0 : N.value;
4789
- this.ref.onUpdate = z instanceof ce ? $e(z).unwrap_or(void 0) : K(z).unwrap_or(void 0), this.ref.color = (b = v.color) != null && b.length ? tt((m = (A = v.color) == null ? void 0 : A.at(0)) == null ? void 0 : m.value) : void 0;
4821
+ const v = F(t.args[0]).getValue(), H = (h = (p = v.delete) == null ? void 0 : p.at(0)) == null ? void 0 : h.value;
4822
+ this.ref.onDelete = H instanceof ce ? $e(H).unwrap_or(void 0) : q(H).unwrap_or(void 0);
4823
+ const K = (N = (d = v.update) == null ? void 0 : d.at(0)) == null ? void 0 : N.value;
4824
+ this.ref.onUpdate = K instanceof ce ? $e(K).unwrap_or(void 0) : q(K).unwrap_or(void 0), this.ref.color = (b = v.color) != null && b.length ? tt((m = (A = v.color) == null ? void 0 : A.at(0)) == null ? void 0 : m.value) : void 0;
4790
4825
  }
4791
4826
  const u = Ds(n);
4792
4827
  return this.ref.endpoints = [
4793
4828
  {
4794
- ...Vn(s, this.container),
4829
+ ...Cn(s, this.container),
4795
4830
  relation: u[0],
4796
4831
  token: L(s)
4797
4832
  },
4798
4833
  {
4799
- ...Vn(r, this.container),
4834
+ ...Cn(r, this.container),
4800
4835
  relation: u[1],
4801
4836
  token: L(r)
4802
4837
  }
@@ -4816,7 +4851,7 @@ class Bs {
4816
4851
  ), t;
4817
4852
  }
4818
4853
  interpretName(t) {
4819
- const n = [], { name: s, schemaName: r } = Ve(t);
4854
+ const n = [], { name: s, schemaName: r } = Ce(t);
4820
4855
  return r.length >= 2 && (this.tableGroup.name = s, this.tableGroup.schemaName = r.join("."), n.push(new c(l.UNSUPPORTED, "Nested schema is not supported", this.declarationNode.name))), this.tableGroup.name = s, this.tableGroup.schemaName = r[0] || null, n;
4821
4856
  }
4822
4857
  interpretBody(t) {
@@ -4861,7 +4896,7 @@ class Bs {
4861
4896
  }
4862
4897
  interpretSettingList(t) {
4863
4898
  var r, i, a;
4864
- const n = B(t).getValue();
4899
+ const n = F(t).getValue();
4865
4900
  this.tableGroup.color = (r = n.color) != null && r.length ? tt((a = (i = n.color) == null ? void 0 : i.at(0)) == null ? void 0 : a.value) : void 0;
4866
4901
  const [s] = n.note || [];
4867
4902
  return this.tableGroup.note = s && {
@@ -4870,7 +4905,7 @@ class Bs {
4870
4905
  }, [];
4871
4906
  }
4872
4907
  }
4873
- class Vs {
4908
+ class Cs {
4874
4909
  constructor(t, n) {
4875
4910
  this.declarationNode = t, this.env = n, this.enum = { values: [] };
4876
4911
  }
@@ -4878,15 +4913,15 @@ class Vs {
4878
4913
  return this.enum.token = L(this.declarationNode), this.env.enums.set(this.declarationNode, this.enum), [...this.interpretName(this.declarationNode.name), ...this.interpretBody(this.declarationNode.body)];
4879
4914
  }
4880
4915
  interpretName(t) {
4881
- const { name: n, schemaName: s } = Ve(t);
4916
+ const { name: n, schemaName: s } = Ce(t);
4882
4917
  return s.length > 1 ? (this.enum.name = n, this.enum.schemaName = s.join("."), [new c(l.UNSUPPORTED, "Nested schema is not supported", t)]) : (this.enum.name = n, this.enum.schemaName = s.length ? s[0] : null, []);
4883
4918
  }
4884
4919
  interpretBody(t) {
4885
4920
  return t.body.flatMap((n) => {
4886
4921
  var o;
4887
4922
  const s = n, r = {};
4888
- r.token = L(s), r.name = K(s.callee).unwrap();
4889
- const a = (o = B(s.args[0]).getValue().note) == null ? void 0 : o.at(0);
4923
+ r.token = L(s), r.name = q(s.callee).unwrap();
4924
+ const a = (o = F(s.args[0]).getValue().note) == null ? void 0 : o.at(0);
4890
4925
  return r.note = a && {
4891
4926
  value: C(a.value).map(fe).unwrap(),
4892
4927
  token: L(a)
@@ -4894,14 +4929,14 @@ class Vs {
4894
4929
  });
4895
4930
  }
4896
4931
  }
4897
- class Cs {
4932
+ class Vs {
4898
4933
  constructor(t, n) {
4899
4934
  this.declarationNode = t, this.env = n, this.tablePartial = {
4900
4935
  name: void 0,
4901
4936
  fields: [],
4902
4937
  token: void 0,
4903
4938
  indexes: [],
4904
- constraints: []
4939
+ checks: []
4905
4940
  }, this.pkColumns = [];
4906
4941
  }
4907
4942
  interpret() {
@@ -4925,11 +4960,11 @@ class Cs {
4925
4960
  })), t;
4926
4961
  }
4927
4962
  interpretName(t) {
4928
- const { name: n } = Ve(t);
4963
+ const { name: n } = Ce(t);
4929
4964
  return this.tablePartial.name = n, [];
4930
4965
  }
4931
4966
  interpretSettingList(t) {
4932
- const n = B(t).getValue(), s = Fo(n[E.HeaderColor]);
4967
+ const n = F(t).getValue(), s = Fo(n[E.HeaderColor]);
4933
4968
  this.tablePartial.headerColor = s ? tt(s.value) : void 0;
4934
4969
  const [r] = n[E.Note] || [];
4935
4970
  return this.tablePartial.note = r && {
@@ -4957,8 +4992,8 @@ class Cs {
4957
4992
  }, [];
4958
4993
  case _.Indexes:
4959
4994
  return this.interpretIndexes(n);
4960
- case _.Constraints:
4961
- return this.interpretConstraints(n);
4995
+ case _.Check:
4996
+ return this.interpretChecks(n);
4962
4997
  default:
4963
4998
  return [];
4964
4999
  }
@@ -4974,9 +5009,9 @@ class Cs {
4974
5009
  const r = Us(t.args[0]);
4975
5010
  s.type = r.getValue(), n.push(...r.getErrors()), s.token = L(t), s.inline_refs = [];
4976
5011
  const i = t.args.slice(1);
4977
- if (F(i) instanceof k) {
4978
- const m = B(i.pop()).getValue();
4979
- s.pk = !!((a = m[E.PK]) != null && a.length) || !!((o = m[E.PrimaryKey]) != null && o.length), s.increment = !!((u = m[E.Increment]) != null && u.length), s.unique = !!((p = m[E.Unique]) != null && p.length), s.not_null = (h = m[E.NotNull]) != null && h.length ? !0 : (d = m[E.Null]) != null && d.length ? !1 : void 0, s.dbdefault = ks((b = (N = m[E.Default]) == null ? void 0 : N.at(0)) == null ? void 0 : b.value);
5012
+ if (M(i) instanceof k) {
5013
+ const m = F(i.pop()).getValue();
5014
+ s.pk = !!((a = m[E.PK]) != null && a.length) || !!((o = m[E.PrimaryKey]) != null && o.length), s.increment = !!((u = m[E.Increment]) != null && u.length), s.unique = !!((p = m[E.Unique]) != null && p.length), s.not_null = (h = m[E.NotNull]) != null && h.length ? !0 : (d = m[E.Null]) != null && d.length ? !1 : void 0, s.dbdefault = Rs((b = (N = m[E.Default]) == null ? void 0 : N.at(0)) == null ? void 0 : b.value);
4980
5015
  const v = (A = m[E.Note]) == null ? void 0 : A.at(0);
4981
5016
  s.note = v && {
4982
5017
  value: C(v.value).map(fe).unwrap(),
@@ -4987,50 +5022,49 @@ class Cs {
4987
5022
  const [J] = ht(w.value.expression);
4988
5023
  if (Zt(J, t.symbol))
4989
5024
  return n.push(new c(l.SAME_ENDPOINT, "Two endpoints are the same", w)), [];
4990
- const G = w.value.op, D = Q(w.value.expression).unwrap();
5025
+ const V = w.value.op, G = Q(w.value.expression).unwrap();
4991
5026
  let le;
4992
- if (D.length === 2) {
4993
- const [ve, Z] = D;
5027
+ if (G.length === 2) {
5028
+ const [ve, Z] = G;
4994
5029
  le = {
4995
5030
  schemaName: null,
4996
5031
  tableName: ve,
4997
5032
  fieldNames: [Z],
4998
- relation: G.value,
5033
+ relation: V.value,
4999
5034
  token: L(w)
5000
5035
  };
5001
- } else if (D.length === 3) {
5002
- const [ve, Z, ye] = D;
5036
+ } else if (G.length === 3) {
5037
+ const [ve, Z, ye] = G;
5003
5038
  le = {
5004
5039
  schemaName: ve,
5005
5040
  tableName: Z,
5006
5041
  fieldNames: [ye],
5007
- relation: G.value,
5042
+ relation: V.value,
5008
5043
  token: L(w)
5009
5044
  };
5010
5045
  } else {
5011
5046
  n.push(new c(l.UNSUPPORTED, "Unsupported", w));
5012
- const ve = D.pop(), Z = D.pop();
5047
+ const ve = G.pop(), Z = G.pop();
5013
5048
  le = {
5014
- schemaName: D.join("."),
5049
+ schemaName: G.join("."),
5015
5050
  tableName: Z,
5016
5051
  fieldNames: [ve],
5017
- relation: G.value,
5052
+ relation: V.value,
5018
5053
  token: L(w)
5019
5054
  };
5020
5055
  }
5021
5056
  return le;
5022
5057
  });
5023
- const z = m[E.Constraint] || [];
5024
- s.constraints = z.map((w) => {
5025
- var D;
5026
- const J = L(w), G = (D = w.value.value) == null ? void 0 : D.value;
5058
+ const K = m[E.Check] || [];
5059
+ s.checks = K.map((w) => {
5060
+ const J = L(w), V = w.value.value.value;
5027
5061
  return {
5028
5062
  token: J,
5029
- expression: G
5063
+ expression: V
5030
5064
  };
5031
5065
  });
5032
5066
  }
5033
- return s.pk || (s.pk = i.some((m) => K(m).unwrap().toLowerCase() === "pk")), s.unique || (s.unique = i.some((m) => K(m).unwrap().toLowerCase() === "unique")), this.tablePartial.fields.push(s), s.pk && this.pkColumns.push(s), n;
5067
+ return s.pk || (s.pk = i.some((m) => q(m).unwrap().toLowerCase() === "pk")), s.unique || (s.unique = i.some((m) => q(m).unwrap().toLowerCase() === "unique")), this.tablePartial.fields.push(s), s.pk && this.pkColumns.push(s), n;
5034
5068
  }
5035
5069
  interpretIndexes(t) {
5036
5070
  return this.tablePartial.indexes.push(...t.body.body.map((n) => {
@@ -5038,14 +5072,14 @@ class Cs {
5038
5072
  const s = { columns: [] }, r = n;
5039
5073
  s.token = L(r);
5040
5074
  const i = [r.callee, ...r.args];
5041
- if (F(i) instanceof k) {
5042
- const b = B(i.pop()).getValue();
5075
+ if (M(i) instanceof k) {
5076
+ const b = F(i.pop()).getValue();
5043
5077
  s.pk = !!((a = b[E.PK]) != null && a.length), s.unique = !!((o = b[E.Unique]) != null && o.length), s.name = C((p = (u = b[E.Name]) == null ? void 0 : u.at(0)) == null ? void 0 : p.value).unwrap_or(void 0);
5044
5078
  const A = (h = b[E.Note]) == null ? void 0 : h.at(0);
5045
5079
  s.note = A && {
5046
5080
  value: C(A.value).unwrap(),
5047
5081
  token: L(A)
5048
- }, s.type = K((N = (d = b[E.Type]) == null ? void 0 : d.at(0)) == null ? void 0 : N.value).unwrap_or(void 0);
5082
+ }, s.type = q((N = (d = b[E.Type]) == null ? void 0 : d.at(0)) == null ? void 0 : N.value).unwrap_or(void 0);
5049
5083
  }
5050
5084
  return i.flatMap((b) => {
5051
5085
  if (!(b instanceof ae)) return b;
@@ -5071,21 +5105,27 @@ class Cs {
5071
5105
  }), s;
5072
5106
  })), [];
5073
5107
  }
5074
- interpretConstraints(t) {
5075
- return this.tablePartial.constraints.push(...t.body.body.map((n) => {
5076
- var i, a, o;
5108
+ interpretChecks(t) {
5109
+ return this.tablePartial.checks.push(...t.body.body.map((n) => {
5110
+ var i, a;
5077
5111
  const s = {}, r = n;
5078
5112
  if (s.token = L(r), r.args[0] instanceof k) {
5079
- const u = B(r.args[0]).getValue();
5080
- s.name = C((a = (i = u[E.Name]) == null ? void 0 : i.at(0)) == null ? void 0 : a.value).unwrap_or(void 0);
5113
+ const o = F(r.args[0]).getValue();
5114
+ s.name = C((a = (i = o[E.Name]) == null ? void 0 : i.at(0)) == null ? void 0 : a.value).unwrap_or(void 0);
5081
5115
  }
5082
- return s.expression = (o = r.callee.value) == null ? void 0 : o.value, s;
5116
+ return s.expression = r.callee.value.value, s;
5083
5117
  })), [];
5084
5118
  }
5085
5119
  }
5086
5120
  class Yl {
5087
5121
  constructor(t, n) {
5088
- this.declarationNode = t, this.env = n, this.project = { enums: [], refs: [], tableGroups: [], tables: [], tablePartials: [] };
5122
+ this.declarationNode = t, this.env = n, this.project = {
5123
+ enums: [],
5124
+ refs: [],
5125
+ tableGroups: [],
5126
+ tables: [],
5127
+ tablePartials: []
5128
+ };
5089
5129
  }
5090
5130
  interpret() {
5091
5131
  return this.env.project.set(this.declarationNode, this.project), this.project.token = L(this.declarationNode), [...this.interpretName(this.declarationNode.name), ...this.interpretBody(this.declarationNode.body)];
@@ -5093,7 +5133,7 @@ class Yl {
5093
5133
  interpretName(t) {
5094
5134
  if (!t)
5095
5135
  return this.project.name = null, [];
5096
- const { name: n } = Ve(t);
5136
+ const { name: n } = Ce(t);
5097
5137
  return this.project.name = n, [];
5098
5138
  }
5099
5139
  interpretBody(t) {
@@ -5114,7 +5154,7 @@ class Yl {
5114
5154
  return this.project.tableGroups.push(this.env.tableGroups.get(s)), i;
5115
5155
  }
5116
5156
  case "enum": {
5117
- const i = new Vs(s, this.env).interpret();
5157
+ const i = new Cs(s, this.env).interpret();
5118
5158
  return this.project.enums.push(this.env.enums.get(s)), i;
5119
5159
  }
5120
5160
  case "note":
@@ -5123,7 +5163,7 @@ class Yl {
5123
5163
  token: L(s)
5124
5164
  }, [];
5125
5165
  case "tablepartial": {
5126
- const i = new Cs(s, this.env).interpret();
5166
+ const i = new Vs(s, this.env).interpret();
5127
5167
  return this.project.tablePartials.push(this.env.tablePartials.get(s)), i;
5128
5168
  }
5129
5169
  default:
@@ -5145,7 +5185,7 @@ function ql(e) {
5145
5185
  tablePartials: Array.from(e.tablePartials.values())
5146
5186
  };
5147
5187
  }
5148
- class Kl {
5188
+ class Ql {
5149
5189
  constructor(t) {
5150
5190
  this.ast = t, this.env = {
5151
5191
  schema: [],
@@ -5163,7 +5203,7 @@ class Kl {
5163
5203
  }
5164
5204
  interpret() {
5165
5205
  const t = this.ast.body.flatMap((n) => {
5166
- switch (Pe(n).unwrap_or(void 0)) {
5206
+ switch (Se(n).unwrap_or(void 0)) {
5167
5207
  case _.Table:
5168
5208
  return new Ms(n, this.env).interpret();
5169
5209
  case _.Note:
@@ -5173,9 +5213,9 @@ class Kl {
5173
5213
  case _.TableGroup:
5174
5214
  return new Bs(n, this.env).interpret();
5175
5215
  case _.TablePartial:
5176
- return new Cs(n, this.env).interpret();
5177
- case _.Enum:
5178
5216
  return new Vs(n, this.env).interpret();
5217
+ case _.Enum:
5218
+ return new Cs(n, this.env).interpret();
5179
5219
  case _.Project:
5180
5220
  return new Yl(n, this.env).interpret();
5181
5221
  default:
@@ -5185,25 +5225,25 @@ class Kl {
5185
5225
  return new se(ql(this.env), t);
5186
5226
  }
5187
5227
  }
5188
- var S = /* @__PURE__ */ ((e) => (e[e.Function = 1] = "Function", e[e.Constructor = 2] = "Constructor", e[e.Field = 3] = "Field", e[e.Variable = 4] = "Variable", e[e.Class = 5] = "Class", e[e.Struct = 6] = "Struct", e[e.Interface = 7] = "Interface", e[e.Module = 8] = "Module", e[e.Property = 9] = "Property", e[e.Event = 10] = "Event", e[e.Operator = 11] = "Operator", e[e.Unit = 12] = "Unit", e[e.Value = 13] = "Value", e[e.Constant = 14] = "Constant", e[e.Enum = 15] = "Enum", e[e.EnumMember = 16] = "EnumMember", e[e.Keyword = 17] = "Keyword", e[e.Text = 18] = "Text", e[e.Color = 19] = "Color", e[e.File = 20] = "File", e[e.Reference = 21] = "Reference", e[e.Customcolor = 22] = "Customcolor", e[e.Folder = 23] = "Folder", e[e.TypeParameter = 24] = "TypeParameter", e[e.User = 25] = "User", e[e.Issue = 26] = "Issue", e[e.Snippet = 27] = "Snippet", e))(S || {}), M = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.KeepWhitespace = 1] = "KeepWhitespace", e[e.InsertAsSnippet = 4] = "InsertAsSnippet", e))(M || {});
5228
+ var P = /* @__PURE__ */ ((e) => (e[e.Function = 1] = "Function", e[e.Constructor = 2] = "Constructor", e[e.Field = 3] = "Field", e[e.Variable = 4] = "Variable", e[e.Class = 5] = "Class", e[e.Struct = 6] = "Struct", e[e.Interface = 7] = "Interface", e[e.Module = 8] = "Module", e[e.Property = 9] = "Property", e[e.Event = 10] = "Event", e[e.Operator = 11] = "Operator", e[e.Unit = 12] = "Unit", e[e.Value = 13] = "Value", e[e.Constant = 14] = "Constant", e[e.Enum = 15] = "Enum", e[e.EnumMember = 16] = "EnumMember", e[e.Keyword = 17] = "Keyword", e[e.Text = 18] = "Text", e[e.Color = 19] = "Color", e[e.File = 20] = "File", e[e.Reference = 21] = "Reference", e[e.Customcolor = 22] = "Customcolor", e[e.Folder = 23] = "Folder", e[e.TypeParameter = 24] = "TypeParameter", e[e.User = 25] = "User", e[e.Issue = 26] = "Issue", e[e.Snippet = 27] = "Snippet", e))(P || {}), U = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.KeepWhitespace = 1] = "KeepWhitespace", e[e.InsertAsSnippet = 4] = "InsertAsSnippet", e))(U || {});
5189
5229
  function et(e) {
5190
5230
  switch (e) {
5191
5231
  case I.Schema:
5192
- return S.Module;
5232
+ return P.Module;
5193
5233
  case I.Table:
5194
5234
  case I.TablePartial:
5195
- return S.Class;
5235
+ return P.Class;
5196
5236
  case I.Column:
5197
5237
  case I.TableGroupField:
5198
- return S.Field;
5238
+ return P.Field;
5199
5239
  case I.Enum:
5200
- return S.Enum;
5240
+ return P.Enum;
5201
5241
  case I.EnumField:
5202
- return S.EnumMember;
5242
+ return P.EnumMember;
5203
5243
  case I.TableGroup:
5204
- return S.Struct;
5244
+ return P.Struct;
5205
5245
  default:
5206
- return S.Text;
5246
+ return P.Text;
5207
5247
  }
5208
5248
  }
5209
5249
  function ft(e, t) {
@@ -5254,14 +5294,14 @@ class Gs {
5254
5294
  ...(i == null ? void 0 : i.trailingTrivia) || [],
5255
5295
  ...(i == null ? void 0 : i.leadingTrivia) || [],
5256
5296
  ...(o == null ? void 0 : o.leadingTrivia) || []
5257
- ].find((N) => $o(N) && qe(s, N)))
5297
+ ].find((N) => $o(N) && Ye(s, N)))
5258
5298
  return $();
5259
5299
  if (a === void 0)
5260
5300
  return jn();
5261
- if ([f.STRING_LITERAL, f.QUOTED_STRING].includes(i.kind) && qe(s, i))
5301
+ if ([f.STRING_LITERAL, f.QUOTED_STRING].includes(i.kind) && Ye(s, i))
5262
5302
  return $();
5263
5303
  const u = this.compiler.container.element(s);
5264
- if (this.compiler.container.scopeKind(s) === R.TOPLEVEL || u instanceof P && u.type && u.type.start <= s && u.type.end >= s)
5304
+ if (this.compiler.container.scopeKind(s) === D.TOPLEVEL || u instanceof S && u.type && u.type.start <= s && u.type.end >= s)
5265
5305
  return jn();
5266
5306
  const p = [...this.compiler.container.stack(s)].reverse();
5267
5307
  for (const N of p)
@@ -5271,7 +5311,7 @@ class Gs {
5271
5311
  case "<":
5272
5312
  case "<>":
5273
5313
  case "-":
5274
- return Cn(
5314
+ return Vn(
5275
5315
  this.compiler,
5276
5316
  s,
5277
5317
  N
@@ -5283,7 +5323,7 @@ class Gs {
5283
5323
  case "<":
5284
5324
  case "<>":
5285
5325
  case "-":
5286
- return Cn(
5326
+ return Vn(
5287
5327
  this.compiler,
5288
5328
  s,
5289
5329
  N
@@ -5301,27 +5341,27 @@ class Gs {
5301
5341
  if (N instanceof k)
5302
5342
  return Gn(this.compiler, s, N);
5303
5343
  if (N instanceof be)
5344
+ return Zl(this.compiler, s);
5345
+ if (N instanceof ke)
5304
5346
  return Jl(this.compiler, s);
5305
- if (N instanceof Re)
5306
- return Ql(this.compiler, s);
5307
5347
  if (N instanceof y)
5308
5348
  return Xn(this.compiler, s, N);
5309
- if (N instanceof P && (N.bodyColon && s >= N.bodyColon.end || N.body && qe(s, N.body)))
5349
+ if (N instanceof S && (N.bodyColon && s >= N.bodyColon.end || N.body && Ye(s, N.body)))
5310
5350
  return Xn(this.compiler, s, void 0);
5311
5351
  }
5312
5352
  return $();
5313
5353
  }
5314
5354
  }
5315
- function Ql(e, t) {
5355
+ function Jl(e, t) {
5316
5356
  const n = e.container.element(t);
5317
5357
  return nt(e, t, n, [I.TablePartial]);
5318
5358
  }
5319
- function Cn(e, t, n) {
5359
+ function Vn(e, t, n) {
5320
5360
  const s = e.container.scopeKind(t);
5321
5361
  if ([
5322
- R.REF,
5323
- R.TABLE,
5324
- R.TABLEPARTIAL
5362
+ D.REF,
5363
+ D.TABLE,
5364
+ D.TABLEPARTIAL
5325
5365
  ].includes(s)) {
5326
5366
  const r = nt(e, t, e.container.element(t), [
5327
5367
  I.Table,
@@ -5345,23 +5385,23 @@ function nt(e, t, n, s) {
5345
5385
  ...e.symbol.members(o).filter(({ kind: u }) => s.includes(u)).map(({ name: u, kind: p }) => ({
5346
5386
  label: u,
5347
5387
  insertText: u,
5348
- insertTextRules: M.KeepWhitespace,
5388
+ insertTextRules: U.KeepWhitespace,
5349
5389
  kind: et(p),
5350
5390
  sortText: et(p).toString().padStart(2, "0"),
5351
5391
  range: void 0
5352
5392
  }))
5353
5393
  );
5354
5394
  }
5355
- r = r instanceof P ? r.parent : void 0;
5395
+ r = r instanceof S ? r.parent : void 0;
5356
5396
  }
5357
5397
  return vt(i);
5358
5398
  }
5359
- function Jl(e, t) {
5399
+ function Zl(e, t) {
5360
5400
  var s;
5361
5401
  switch (e.container.scopeKind(t)) {
5362
- case R.INDEXES:
5402
+ case D.INDEXES:
5363
5403
  return js(e, t);
5364
- case R.REF:
5404
+ case D.REF:
5365
5405
  {
5366
5406
  const r = [...e.container.stack(t)];
5367
5407
  for (; r.length > 0; ) {
@@ -5387,7 +5427,7 @@ function Gn(e, t, n) {
5387
5427
  if (n.name && n.name.start <= t && n.name.end >= t)
5388
5428
  return $n(e, t);
5389
5429
  if (n.name instanceof ce) {
5390
- const r = Zl(
5430
+ const r = ec(
5391
5431
  e,
5392
5432
  t,
5393
5433
  $e(n.name).unwrap_or("")
@@ -5400,14 +5440,14 @@ function $n(e, t) {
5400
5440
  const n = e.container.element(t);
5401
5441
  if (n instanceof ne) return $();
5402
5442
  const s = e.container.scopeKind(t);
5403
- if (n.body && !qe(t, n.body)) {
5443
+ if (n.body && !Ye(t, n.body)) {
5404
5444
  let r;
5405
5445
  switch (s) {
5406
- case R.TABLE:
5407
- case R.TABLEPARTIAL:
5446
+ case D.TABLE:
5447
+ case D.TABLEPARTIAL:
5408
5448
  r = [E.HeaderColor, E.Note];
5409
5449
  break;
5410
- case R.TABLEGROUP:
5450
+ case D.TABLEGROUP:
5411
5451
  r = [E.Color, E.Note];
5412
5452
  break;
5413
5453
  default:
@@ -5417,15 +5457,15 @@ function $n(e, t) {
5417
5457
  suggestions: r.map((i) => ({
5418
5458
  label: i,
5419
5459
  insertText: `${i}: `,
5420
- kind: S.Field,
5421
- insertTextRules: M.KeepWhitespace,
5460
+ kind: P.Field,
5461
+ insertTextRules: U.KeepWhitespace,
5422
5462
  range: void 0
5423
5463
  }))
5424
5464
  };
5425
5465
  }
5426
5466
  switch (s) {
5427
- case R.TABLE:
5428
- case R.TABLEPARTIAL:
5467
+ case D.TABLE:
5468
+ case D.TABLEPARTIAL:
5429
5469
  return {
5430
5470
  suggestions: [
5431
5471
  ...[
@@ -5438,51 +5478,51 @@ function $n(e, t) {
5438
5478
  ].map((r) => ({
5439
5479
  label: r,
5440
5480
  insertText: r,
5441
- kind: S.Property,
5442
- insertTextRules: M.KeepWhitespace,
5481
+ kind: P.Property,
5482
+ insertTextRules: U.KeepWhitespace,
5443
5483
  range: void 0
5444
5484
  })),
5445
- ...[E.Ref, E.Default, E.Note, E.Constraint].map((r) => ({
5485
+ ...[E.Ref, E.Default, E.Note, E.Check].map((r) => ({
5446
5486
  label: r,
5447
5487
  insertText: `${r}: `,
5448
- kind: S.Property,
5449
- insertTextRules: M.KeepWhitespace,
5488
+ kind: P.Property,
5489
+ insertTextRules: U.KeepWhitespace,
5450
5490
  range: void 0
5451
5491
  }))
5452
5492
  ]
5453
5493
  };
5454
- case R.ENUM:
5494
+ case D.ENUM:
5455
5495
  return {
5456
5496
  suggestions: [
5457
5497
  ...[E.Note].map((r) => ({
5458
5498
  label: r,
5459
5499
  insertText: `${r}: `,
5460
- kind: S.Property,
5461
- insertTextRules: M.KeepWhitespace,
5500
+ kind: P.Property,
5501
+ insertTextRules: U.KeepWhitespace,
5462
5502
  range: void 0
5463
5503
  }))
5464
5504
  ]
5465
5505
  };
5466
- case R.INDEXES:
5506
+ case D.INDEXES:
5467
5507
  return {
5468
5508
  suggestions: [
5469
5509
  ...[E.Unique, E.PK].map((r) => ({
5470
5510
  label: r,
5471
5511
  insertText: r,
5472
- insertTextRules: M.KeepWhitespace,
5473
- kind: S.Property,
5512
+ insertTextRules: U.KeepWhitespace,
5513
+ kind: P.Property,
5474
5514
  range: void 0
5475
5515
  })),
5476
5516
  ...[E.Note, E.Name, E.Type].map((r) => ({
5477
5517
  label: r,
5478
5518
  insertText: `${r}: `,
5479
- kind: S.Property,
5480
- insertTextRules: M.KeepWhitespace,
5519
+ kind: P.Property,
5520
+ insertTextRules: U.KeepWhitespace,
5481
5521
  range: void 0
5482
5522
  }))
5483
5523
  ]
5484
5524
  };
5485
- case R.REF:
5525
+ case D.REF:
5486
5526
  return {
5487
5527
  suggestions: [
5488
5528
  E.Update,
@@ -5491,27 +5531,27 @@ function $n(e, t) {
5491
5531
  ].map((r) => ({
5492
5532
  label: r,
5493
5533
  insertText: `${r}: `,
5494
- kind: S.Property,
5495
- insertTextRules: M.KeepWhitespace,
5534
+ kind: P.Property,
5535
+ insertTextRules: U.KeepWhitespace,
5496
5536
  range: void 0
5497
5537
  }))
5498
5538
  };
5499
- case R.CONSTRAINTS:
5539
+ case D.CHECKS:
5500
5540
  return {
5501
5541
  suggestions: [
5502
5542
  E.Name
5503
5543
  ].map((r) => ({
5504
5544
  label: r,
5505
5545
  insertText: `${r}: `,
5506
- kind: S.Property,
5507
- insertTextRules: M.KeepWhitespace,
5546
+ kind: P.Property,
5547
+ insertTextRules: U.KeepWhitespace,
5508
5548
  range: void 0
5509
5549
  }))
5510
5550
  };
5511
5551
  }
5512
5552
  return $();
5513
5553
  }
5514
- function Zl(e, t, n) {
5554
+ function ec(e, t, n) {
5515
5555
  switch (n == null ? void 0 : n.toLowerCase()) {
5516
5556
  case "update":
5517
5557
  case "delete":
@@ -5519,8 +5559,8 @@ function Zl(e, t, n) {
5519
5559
  suggestions: ["cascade", "set default", "set null", "restrict"].map((s) => ({
5520
5560
  label: s,
5521
5561
  insertText: s,
5522
- kind: S.Value,
5523
- insertTextRules: M.KeepWhitespace,
5562
+ kind: P.Value,
5563
+ insertTextRules: U.KeepWhitespace,
5524
5564
  range: void 0
5525
5565
  }))
5526
5566
  };
@@ -5529,8 +5569,8 @@ function Zl(e, t, n) {
5529
5569
  suggestions: ["btree", "hash"].map((s) => ({
5530
5570
  label: s,
5531
5571
  insertText: `${s}`,
5532
- kind: S.Value,
5533
- insertTextRules: M.KeepWhitespace,
5572
+ kind: P.Value,
5573
+ insertTextRules: U.KeepWhitespace,
5534
5574
  range: void 0
5535
5575
  }))
5536
5576
  };
@@ -5541,7 +5581,7 @@ function $s(e, t, n) {
5541
5581
  const s = Be(n).unwrap_or([]);
5542
5582
  if (s.pop(), s.some((i) => !W(i)))
5543
5583
  return $();
5544
- const r = s.map((i) => K(i).unwrap());
5584
+ const r = s.map((i) => q(i).unwrap());
5545
5585
  return vt({
5546
5586
  suggestions: e.symbol.ofName({ nameStack: r, owner: e.container.element(t) }).flatMap(({ symbol: i }) => e.symbol.members(i)).map(({ kind: i, name: a }) => ({
5547
5587
  label: a,
@@ -5554,21 +5594,21 @@ function $s(e, t, n) {
5554
5594
  function Xn(e, t, n) {
5555
5595
  var r;
5556
5596
  switch (e.container.scopeKind(t)) {
5557
- case R.TABLE:
5558
- case R.TABLEPARTIAL:
5559
- return tc(e, t, n);
5560
- case R.PROJECT:
5597
+ case D.TABLE:
5598
+ case D.TABLEPARTIAL:
5561
5599
  return nc(e, t, n);
5562
- case R.INDEXES:
5563
- return rc(e, t);
5564
- case R.ENUM:
5565
- return ec(e, t, n);
5566
- case R.REF: {
5600
+ case D.PROJECT:
5601
+ return sc(e, t, n);
5602
+ case D.INDEXES:
5603
+ return ic(e, t);
5604
+ case D.ENUM:
5605
+ return tc(e, t, n);
5606
+ case D.REF: {
5567
5607
  const i = Xs(e, t);
5568
5608
  return ((r = e.container.token(t).token) == null ? void 0 : r.kind) === f.COLON && ft(e.container.token(t).token, t) ? pt(i) : i;
5569
5609
  }
5570
- case R.TABLEGROUP:
5571
- return sc(e);
5610
+ case D.TABLEGROUP:
5611
+ return rc(e);
5572
5612
  default:
5573
5613
  return $();
5574
5614
  }
@@ -5578,28 +5618,28 @@ function jn() {
5578
5618
  suggestions: ["Table", "TableGroup", "Enum", "Project", "Ref", "TablePartial"].map((e) => ({
5579
5619
  label: e,
5580
5620
  insertText: e,
5581
- insertTextRules: M.KeepWhitespace,
5582
- kind: S.Keyword,
5621
+ insertTextRules: U.KeepWhitespace,
5622
+ kind: P.Keyword,
5583
5623
  range: void 0
5584
5624
  }))
5585
5625
  };
5586
5626
  }
5587
- function ec(e, t, n) {
5627
+ function tc(e, t, n) {
5588
5628
  return n != null && n.callee && tn(t, n) === 1 ? nt(e, t, e.container.element(t), [
5589
5629
  I.Schema,
5590
5630
  I.Table,
5591
5631
  I.Column
5592
5632
  ]) : $();
5593
5633
  }
5594
- function tc(e, t, n) {
5595
- const s = ["Note", "indexes", "constraints"];
5634
+ function nc(e, t, n) {
5635
+ const s = ["Note", "indexes", "checks"];
5596
5636
  if (!(n != null && n.callee))
5597
5637
  return {
5598
5638
  suggestions: s.map((i) => ({
5599
5639
  label: i,
5600
5640
  insertText: i,
5601
- insertTextRules: M.KeepWhitespace,
5602
- kind: S.Keyword,
5641
+ insertTextRules: U.KeepWhitespace,
5642
+ kind: P.Keyword,
5603
5643
  range: void 0
5604
5644
  }))
5605
5645
  };
@@ -5608,28 +5648,28 @@ function tc(e, t, n) {
5608
5648
  suggestions: s.map((i) => ({
5609
5649
  label: i,
5610
5650
  insertText: i,
5611
- insertTextRules: M.KeepWhitespace,
5612
- kind: S.Keyword,
5651
+ insertTextRules: U.KeepWhitespace,
5652
+ kind: P.Keyword,
5613
5653
  range: void 0
5614
5654
  }))
5615
- } : r === 1 ? ic(e, t) : $();
5655
+ } : r === 1 ? ac(e, t) : $();
5616
5656
  }
5617
- function nc(e, t, n) {
5657
+ function sc(e, t, n) {
5618
5658
  const s = ["Table", "TableGroup", "Enum", "Note", "Ref", "TablePartial"];
5619
5659
  return n != null && n.callee ? tn(t, n) === 0 ? {
5620
5660
  suggestions: s.map((i) => ({
5621
5661
  label: i,
5622
5662
  insertText: i,
5623
- insertTextRules: M.KeepWhitespace,
5624
- kind: S.Keyword,
5663
+ insertTextRules: U.KeepWhitespace,
5664
+ kind: P.Keyword,
5625
5665
  range: void 0
5626
5666
  }))
5627
5667
  } : $() : {
5628
5668
  suggestions: s.map((i) => ({
5629
5669
  label: i,
5630
5670
  insertText: i,
5631
- insertTextRules: M.KeepWhitespace,
5632
- kind: S.Keyword,
5671
+ insertTextRules: U.KeepWhitespace,
5672
+ kind: P.Keyword,
5633
5673
  range: void 0
5634
5674
  }))
5635
5675
  };
@@ -5641,7 +5681,7 @@ function Xs(e, t) {
5641
5681
  I.Column
5642
5682
  ]);
5643
5683
  }
5644
- function sc(e) {
5684
+ function rc(e) {
5645
5685
  return {
5646
5686
  suggestions: [
5647
5687
  ...vt({
@@ -5652,7 +5692,7 @@ function sc(e) {
5652
5692
  return s !== I.Table && s !== I.Schema ? [] : {
5653
5693
  label: r,
5654
5694
  insertText: r,
5655
- insertTextRules: M.KeepWhitespace,
5695
+ insertTextRules: U.KeepWhitespace,
5656
5696
  kind: et(s),
5657
5697
  range: void 0
5658
5698
  };
@@ -5661,17 +5701,17 @@ function sc(e) {
5661
5701
  ...["Note"].map((t) => ({
5662
5702
  label: t,
5663
5703
  insertText: t,
5664
- insertTextRules: M.KeepWhitespace,
5665
- kind: S.Keyword,
5704
+ insertTextRules: U.KeepWhitespace,
5705
+ kind: P.Keyword,
5666
5706
  range: void 0
5667
5707
  }))
5668
5708
  ]
5669
5709
  };
5670
5710
  }
5671
- function rc(e, t) {
5711
+ function ic(e, t) {
5672
5712
  return js(e, t);
5673
5713
  }
5674
- function ic(e, t) {
5714
+ function ac(e, t) {
5675
5715
  return {
5676
5716
  suggestions: [
5677
5717
  ...[
@@ -5734,9 +5774,9 @@ function ic(e, t) {
5734
5774
  ].map((n) => ({
5735
5775
  label: n,
5736
5776
  insertText: n,
5737
- insertTextRules: M.KeepWhitespace,
5738
- kind: S.TypeParameter,
5739
- sortText: S.TypeParameter.toString().padStart(2, "0"),
5777
+ insertTextRules: U.KeepWhitespace,
5778
+ kind: P.TypeParameter,
5779
+ sortText: P.TypeParameter.toString().padStart(2, "0"),
5740
5780
  range: void 0
5741
5781
  })),
5742
5782
  ...nt(e, t, e.container.element(t), [
@@ -5760,7 +5800,7 @@ function js(e, t) {
5760
5800
  return {
5761
5801
  label: o,
5762
5802
  insertText: o,
5763
- insertTextRules: M.KeepWhitespace,
5803
+ insertTextRules: U.KeepWhitespace,
5764
5804
  kind: et(I.Column),
5765
5805
  range: void 0
5766
5806
  };
@@ -5834,37 +5874,31 @@ class Hs {
5834
5874
  return [];
5835
5875
  }
5836
5876
  }
5837
- const oc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5877
+ const lc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5838
5878
  __proto__: null,
5839
- CompletionItemInsertTextRule: M,
5840
- CompletionItemKind: S,
5879
+ CompletionItemInsertTextRule: U,
5880
+ CompletionItemKind: P,
5841
5881
  DBMLCompletionItemProvider: Gs,
5842
5882
  DBMLDefinitionProvider: Ws,
5843
5883
  DBMLReferencesProvider: Hs
5844
5884
  }, Symbol.toStringTag, { value: "Module" }));
5845
- var R = /* @__PURE__ */ ((e) => (e[e.TABLE = 0] = "TABLE", e[e.ENUM = 1] = "ENUM", e[e.TABLEGROUP = 2] = "TABLEGROUP", e[e.INDEXES = 3] = "INDEXES", e[e.NOTE = 4] = "NOTE", e[e.REF = 5] = "REF", e[e.PROJECT = 6] = "PROJECT", e[e.CUSTOM = 7] = "CUSTOM", e[e.TOPLEVEL = 8] = "TOPLEVEL", e[e.TABLEPARTIAL = 9] = "TABLEPARTIAL", e[e.CONSTRAINTS = 10] = "CONSTRAINTS", e))(R || {});
5846
- class lc {
5885
+ var D = /* @__PURE__ */ ((e) => (e[e.TABLE = 0] = "TABLE", e[e.ENUM = 1] = "ENUM", e[e.TABLEGROUP = 2] = "TABLEGROUP", e[e.INDEXES = 3] = "INDEXES", e[e.NOTE = 4] = "NOTE", e[e.REF = 5] = "REF", e[e.PROJECT = 6] = "PROJECT", e[e.CUSTOM = 7] = "CUSTOM", e[e.TOPLEVEL = 8] = "TOPLEVEL", e[e.TABLEPARTIAL = 9] = "TABLEPARTIAL", e[e.CHECKS = 10] = "CHECKS", e))(D || {});
5886
+ class cc {
5847
5887
  constructor() {
5848
5888
  this.source = "", this.cache = new Array(
5849
5889
  16
5850
5890
  /* TOTAL_QUERY_COUNT */
5851
- ).fill(null), this.nodeIdGenerator = new Xo(), this.symbolIdGenerator = new Yo(), this.token = {
5852
- invalidStream: this.createQuery(
5853
- 6,
5854
- () => this.parse.tokens().filter(Ls)
5855
- ),
5891
+ ).fill(null), this.nodeIdGenerator = new Xo(), this.symbolIdGenerator = new zo(), this.token = {
5892
+ invalidStream: this.createQuery(6, () => this.parse.tokens().filter(Ls)),
5856
5893
  // Valid + Invalid tokens (which are guarenteed to be non-trivials) are included in the stream
5857
- flatStream: this.createQuery(
5858
- 7,
5859
- () => this.parse.tokens().flatMap((t) => [...t.leadingInvalid, t, ...t.trailingInvalid])
5860
- )
5894
+ flatStream: this.createQuery(7, () => this.parse.tokens().flatMap((t) => [...t.leadingInvalid, t, ...t.trailingInvalid]))
5861
5895
  }, this.parse = {
5862
5896
  source: () => this.source,
5863
5897
  _: this.createQuery(
5864
5898
  0,
5865
5899
  () => {
5866
- const t = new cl(this.source).lex().chain((n) => new fl(n, this.nodeIdGenerator).parse()).chain(({ ast: n, tokens: s }) => new Hl(n, this.symbolIdGenerator).analyze().map(() => ({ ast: n, tokens: s })));
5867
- return t.getErrors().length > 0 ? t : t.chain(({ ast: n, tokens: s }) => new Kl(n).interpret().map((i) => ({ ast: n, tokens: s, rawDb: i })));
5900
+ const t = new cl(this.source).lex().chain((n) => new fl(n, this.nodeIdGenerator).parse()).chain(({ ast: n, tokens: s }) => new Kl(n, this.symbolIdGenerator).analyze().map(() => ({ ast: n, tokens: s })));
5901
+ return t.getErrors().length > 0 ? t : t.chain(({ ast: n, tokens: s }) => new Ql(n).interpret().map((i) => ({ ast: n, tokens: s, rawDb: i })));
5868
5902
  }
5869
5903
  ),
5870
5904
  ast: this.createQuery(
@@ -5895,7 +5929,7 @@ class lc {
5895
5929
  let o = this.parse.ast();
5896
5930
  const u = [o];
5897
5931
  for (; ; ) {
5898
- const h = ll(o).find((d) => qe(a, d));
5932
+ const h = ll(o).find((d) => Ye(a, d));
5899
5933
  if (h === void 0 || h instanceof te)
5900
5934
  break;
5901
5935
  u.push(h), o = h;
@@ -5904,7 +5938,7 @@ class lc {
5904
5938
  return u;
5905
5939
  for (; u.length > 0; ) {
5906
5940
  let p = !1;
5907
- const h = F(u);
5941
+ const h = M(u);
5908
5942
  if (h instanceof y) {
5909
5943
  const d = this.parse.source();
5910
5944
  for (let N = h.end; N < t; N += 1)
@@ -5912,8 +5946,8 @@ class lc {
5912
5946
  ` && (u.pop(), p = !0);
5913
5947
  } else h instanceof re || h instanceof Te ? this.container.token(t).token !== h.op && (u.pop(), p = !0) : h instanceof k ? h.listCloseBracket && h.end <= t && (u.pop(), p = !0) : h instanceof be ? h.tupleCloseParen && h.end <= t && (u.pop(), p = !0) : h instanceof Ee ? h.blockCloseBrace && h.end <= t && (u.pop(), p = !0) : h instanceof ce || h.end < t && (u.pop(), p = !0);
5914
5948
  if (p) {
5915
- const d = F(u);
5916
- d instanceof P && d.end <= t && u.pop();
5949
+ const d = M(u);
5950
+ d instanceof S && d.end <= t && u.pop();
5917
5951
  }
5918
5952
  if (!p)
5919
5953
  break;
@@ -5936,7 +5970,7 @@ class lc {
5936
5970
  (t) => {
5937
5971
  const n = this.container.stack(t);
5938
5972
  for (let s = n.length - 1; s >= 0; s -= 1)
5939
- if (n[s] instanceof P)
5973
+ if (n[s] instanceof S)
5940
5974
  return n[s];
5941
5975
  return this.parse.ast();
5942
5976
  }
@@ -5969,7 +6003,7 @@ class lc {
5969
6003
  return 6;
5970
6004
  case "tablepartial":
5971
6005
  return 9;
5972
- case "constraints":
6006
+ case "checks":
5973
6007
  return 10;
5974
6008
  default:
5975
6009
  return 7;
@@ -5990,20 +6024,16 @@ class lc {
5990
6024
  if (t.length === 0)
5991
6025
  return [];
5992
6026
  const s = [];
5993
- for (let i = n; i; i = i instanceof P ? i.parent : void 0) {
6027
+ for (let i = n; i; i = i instanceof S ? i.parent : void 0) {
5994
6028
  if (!((r = i.symbol) != null && r.symbolTable))
5995
6029
  continue;
5996
6030
  const { symbolTable: a } = i.symbol;
5997
6031
  let o = [a], u = [];
5998
6032
  for (const p of t)
5999
- u = o.flatMap(
6000
- (h) => nl(p).flatMap((d) => {
6001
- const N = h.get(d), b = he(d).unwrap_or(void 0);
6002
- return !N || !b ? [] : { ...b, symbol: N };
6003
- })
6004
- ), o = u.flatMap(
6005
- (h) => h.symbol.symbolTable ? h.symbol.symbolTable : []
6006
- );
6033
+ u = o.flatMap((h) => nl(p).flatMap((d) => {
6034
+ const N = h.get(d), b = he(d).unwrap_or(void 0);
6035
+ return !N || !b ? [] : { ...b, symbol: N };
6036
+ })), o = u.flatMap((h) => h.symbol.symbolTable ? h.symbol.symbolTable : []);
6007
6037
  s.push(...u);
6008
6038
  }
6009
6039
  return s;
@@ -6049,15 +6079,15 @@ class lc {
6049
6079
  export {
6050
6080
  c as CompileError,
6051
6081
  l as CompileErrorCode,
6052
- lc as Compiler,
6053
- P as ElementDeclarationNode,
6082
+ cc as Compiler,
6083
+ S as ElementDeclarationNode,
6054
6084
  _ as ElementKind,
6055
6085
  ne as ProgramNode,
6056
- R as ScopeKind,
6057
- U as SyntaxNode,
6086
+ D as ScopeKind,
6087
+ R as SyntaxNode,
6058
6088
  Oe as SyntaxNodeKind,
6059
6089
  te as SyntaxToken,
6060
6090
  f as SyntaxTokenKind,
6061
- ac as serialize,
6062
- oc as services
6091
+ oc as serialize,
6092
+ lc as services
6063
6093
  };