@prisma/orm-framework 8.0.0-rc.19-dev.6 → 8.0.0-rc.19-dev.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/dist/{authoring-BMkyimEq.mjs → authoring-CNUti739.mjs} +456 -247
  2. package/dist/authoring-CNUti739.mjs.map +1 -0
  3. package/dist/{authoring-CUZxY2RV.d.mts → authoring-CjwinhU5.d.mts} +79 -7
  4. package/dist/authoring-CjwinhU5.d.mts.map +1 -0
  5. package/dist/{binder-D_4RBHbt-56WrFUy3.d.mts → binder-D_4RBHbt-C-WTJ1K6.d.mts} +10 -10
  6. package/dist/{binder-D_4RBHbt-56WrFUy3.d.mts.map → binder-D_4RBHbt-C-WTJ1K6.d.mts.map} +1 -1
  7. package/dist/{codec-B_KV-HpC.d.mts → codec-B4ypaota.d.mts} +112 -3
  8. package/dist/codec-B4ypaota.d.mts.map +1 -0
  9. package/dist/codec-Do8tfXqk.mjs +457 -0
  10. package/dist/codec-Do8tfXqk.mjs.map +1 -0
  11. package/dist/{codec-descriptor-V2-N5Qmm-BR-5owl6.mjs → codec-descriptor-D0oY-hgs-C5e11ola.mjs} +19 -4
  12. package/dist/codec-descriptor-D0oY-hgs-C5e11ola.mjs.map +1 -0
  13. package/dist/{components-CJ5VhJT8.d.mts → components-B9ow7ca6.d.mts} +3 -3
  14. package/dist/{components-CJ5VhJT8.d.mts.map → components-B9ow7ca6.d.mts.map} +1 -1
  15. package/dist/{components-C83PWIWw.mjs → components-BaV9iCkq.mjs} +2 -2
  16. package/dist/{components-C83PWIWw.mjs.map → components-BaV9iCkq.mjs.map} +1 -1
  17. package/dist/components.d.mts +11 -11
  18. package/dist/components.mjs +8 -8
  19. package/dist/components__authoring.d.mts +4 -4
  20. package/dist/components__authoring.mjs +3 -3
  21. package/dist/components__codec.d.mts +2 -2
  22. package/dist/components__codec.mjs +4 -4
  23. package/dist/components__components.d.mts +3 -3
  24. package/dist/components__components.mjs +1 -1
  25. package/dist/components__control.d.mts +3 -3
  26. package/dist/components__control.mjs +2 -2
  27. package/dist/components__execution.d.mts +1 -1
  28. package/dist/components__psl-ast.d.mts +3 -3
  29. package/dist/{config-types-hb9Af32k.d.mts → config-types-Blog3oGn.d.mts} +6 -6
  30. package/dist/{config-types-hb9Af32k.d.mts.map → config-types-Blog3oGn.d.mts.map} +1 -1
  31. package/dist/config.d.mts +1 -1
  32. package/dist/config__config-types.d.mts +1 -1
  33. package/dist/contract-authoring.d.mts +3 -3
  34. package/dist/contract-authoring.mjs +3 -3
  35. package/dist/{control-B5ezUWD2-BdH2_lqS.d.mts → control-B5ezUWD2-Cy2_LDVU.d.mts} +2 -2
  36. package/dist/{control-B5ezUWD2-BdH2_lqS.d.mts.map → control-B5ezUWD2-Cy2_LDVU.d.mts.map} +1 -1
  37. package/dist/control-CvY9anXC.d.mts +1 -0
  38. package/dist/{control-BTteCOsf.mjs → control-DMJqhnwU.mjs} +3 -3
  39. package/dist/{control-BTteCOsf.mjs.map → control-DMJqhnwU.mjs.map} +1 -1
  40. package/dist/{control-D2drwCoH.d.mts → control-Dg8BDPmn.d.mts} +5 -5
  41. package/dist/{control-D2drwCoH.d.mts.map → control-Dg8BDPmn.d.mts.map} +1 -1
  42. package/dist/{control-KsXr4fYD-Csaj4sPO.mjs → control-KsXr4fYD-D2Ows0NI.mjs} +2 -2
  43. package/dist/{control-KsXr4fYD-Csaj4sPO.mjs.map → control-KsXr4fYD-D2Ows0NI.mjs.map} +1 -1
  44. package/dist/{data-type-CVNHtd6y-BFa_VnCb.mjs → data-type-V6mcDhcG-DVQAPOQT.mjs} +2 -2
  45. package/dist/{data-type-CVNHtd6y-BFa_VnCb.mjs.map → data-type-V6mcDhcG-DVQAPOQT.mjs.map} +1 -1
  46. package/dist/{declarations-BgUAq1RG-BOxzxoTR.mjs → declarations-BgUAq1RG-Dz_-EI1Q.mjs} +2 -2
  47. package/dist/{declarations-BgUAq1RG-BOxzxoTR.mjs.map → declarations-BgUAq1RG-Dz_-EI1Q.mjs.map} +1 -1
  48. package/dist/errors.d.mts +4 -4
  49. package/dist/errors.mjs +3 -3
  50. package/dist/errors__control.d.mts +2 -2
  51. package/dist/errors__control.mjs +1 -1
  52. package/dist/errors__execution.d.mts +1 -1
  53. package/dist/errors__execution.mjs +1 -1
  54. package/dist/errors__migration.d.mts +1 -1
  55. package/dist/errors__migration.mjs +1 -1
  56. package/dist/{execution-B_qZ4WLk.d.mts → execution-BsrZp2ks.d.mts} +2 -2
  57. package/dist/{execution-B_qZ4WLk.d.mts.map → execution-BsrZp2ks.d.mts.map} +1 -1
  58. package/dist/{execution-0Irooze3.d.mts → execution-DXqYartX.d.mts} +2 -2
  59. package/dist/{execution-0Irooze3.d.mts.map → execution-DXqYartX.d.mts.map} +1 -1
  60. package/dist/{execution-B7JGFd5C.mjs → execution-vfY4d-SZ.mjs} +2 -2
  61. package/dist/{execution-B7JGFd5C.mjs.map → execution-vfY4d-SZ.mjs.map} +1 -1
  62. package/dist/{expressions-CMQzbnHk-CrNw_vqf.mjs → expressions-CMQzbnHk-BL2zN0Iv.mjs} +2 -2
  63. package/dist/{expressions-CMQzbnHk-CrNw_vqf.mjs.map → expressions-CMQzbnHk-BL2zN0Iv.mjs.map} +1 -1
  64. package/dist/{framework-authoring-C78etPdT-CeiBIBJ-.d.mts → framework-authoring-DDxddXZm-uZYdhoE0.d.mts} +24 -27
  65. package/dist/framework-authoring-DDxddXZm-uZYdhoE0.d.mts.map +1 -0
  66. package/dist/{framework-components-BmRQfvNS-KSEiBXXc.d.mts → framework-components-Bo8VkHuI-CLxCdRvy.d.mts} +3 -3
  67. package/dist/{framework-components-BmRQfvNS-KSEiBXXc.d.mts.map → framework-components-Bo8VkHuI-CLxCdRvy.d.mts.map} +1 -1
  68. package/dist/ids.d.mts +1 -1
  69. package/dist/{migration-n7Y0_y4n.d.mts → migration-_8vByrkL.d.mts} +2 -2
  70. package/dist/{migration-n7Y0_y4n.d.mts.map → migration-_8vByrkL.d.mts.map} +1 -1
  71. package/dist/{migration-LrheHk4r.mjs → migration-uC-bSKA4.mjs} +2 -2
  72. package/dist/{migration-LrheHk4r.mjs.map → migration-uC-bSKA4.mjs.map} +1 -1
  73. package/dist/{parse-bZgfjovA-sINnImkq.mjs → parse-bZgfjovA-BNgYhylT.mjs} +3 -3
  74. package/dist/{parse-bZgfjovA-sINnImkq.mjs.map → parse-bZgfjovA-BNgYhylT.mjs.map} +1 -1
  75. package/dist/{parse-djL5wker-CYBtaUrK.d.mts → parse-djL5wker-DaT4W0gt.d.mts} +6 -6
  76. package/dist/{parse-djL5wker-CYBtaUrK.d.mts.map → parse-djL5wker-DaT4W0gt.d.mts.map} +1 -1
  77. package/dist/psl-ast-COcYtLlz.d.mts +2 -0
  78. package/dist/{psl-ast-54cA0pl_-DrzGrcMF.d.mts → psl-ast-rY25o3Ze-ClLY3CYt.d.mts} +3 -3
  79. package/dist/{psl-ast-54cA0pl_-DrzGrcMF.d.mts.map → psl-ast-rY25o3Ze-ClLY3CYt.d.mts.map} +1 -1
  80. package/dist/psl-parser.d.mts +20 -11
  81. package/dist/psl-parser.d.mts.map +1 -1
  82. package/dist/psl-parser.mjs +69 -45
  83. package/dist/psl-parser.mjs.map +1 -1
  84. package/dist/psl-parser__format.d.mts +1 -1
  85. package/dist/psl-parser__format.mjs +3 -3
  86. package/dist/psl-parser__interpret.d.mts +6 -6
  87. package/dist/psl-parser__interpret.mjs +3 -3
  88. package/dist/psl-parser__syntax.d.mts +1 -1
  89. package/dist/psl-parser__syntax.mjs +3 -3
  90. package/dist/psl-printer.d.mts +4 -4
  91. package/dist/psl-printer.mjs +1 -1
  92. package/dist/{temporal-presets-CIFczljn-BrjropV6.mjs → temporal-presets-5TK1pTYJ-DmhrnMP1.mjs} +3 -3
  93. package/dist/{temporal-presets-CIFczljn-BrjropV6.mjs.map → temporal-presets-5TK1pTYJ-DmhrnMP1.mjs.map} +1 -1
  94. package/dist/{temporal-presets-suGfXweJ-Cv2uijGj.d.mts → temporal-presets-BuMqk7h8-DZSuu4Z_.d.mts} +3 -3
  95. package/dist/{temporal-presets-suGfXweJ-Cv2uijGj.d.mts.map → temporal-presets-BuMqk7h8-DZSuu4Z_.d.mts.map} +1 -1
  96. package/dist/{type-constructor-calls-BLf-HsFy-Z9ApP-kL.mjs → type-constructor-calls-BLf-HsFy-D_jbIqj8.mjs} +4 -4
  97. package/dist/{type-constructor-calls-BLf-HsFy-Z9ApP-kL.mjs.map → type-constructor-calls-BLf-HsFy-D_jbIqj8.mjs.map} +1 -1
  98. package/package.json +15 -15
  99. package/dist/authoring-BMkyimEq.mjs.map +0 -1
  100. package/dist/authoring-CUZxY2RV.d.mts.map +0 -1
  101. package/dist/codec-B_KV-HpC.d.mts.map +0 -1
  102. package/dist/codec-DGRG8oEH.mjs +0 -56
  103. package/dist/codec-DGRG8oEH.mjs.map +0 -1
  104. package/dist/codec-descriptor-V2-N5Qmm-BR-5owl6.mjs.map +0 -1
  105. package/dist/control-BY0_FFTB.d.mts +0 -1
  106. package/dist/framework-authoring-C78etPdT-CeiBIBJ-.d.mts.map +0 -1
  107. package/dist/psl-ast-BubQebay.d.mts +0 -2
@@ -0,0 +1,457 @@
1
+ import { o as structuredError } from "./structured-error-BXbihKQ-.mjs";
2
+ import { t as InternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
3
+ import { g as isNonFiniteText } from "./data-type-V6mcDhcG-DVQAPOQT.mjs";
4
+ import { s as tsStringLiteral } from "./dist-D1f6xr7F.mjs";
5
+ import { a as numeralText } from "./codec-descriptor-D0oY-hgs-C5e11ola.mjs";
6
+ //#region ../../../1-framework/1-core/framework-components/dist/codec.mjs
7
+ /** A cast between two types that store the same shape: the value is already the form this type stores. */
8
+ const castUnchanged = (value) => value;
9
+ /** Refuses a value that is not in the shape the cast's source type stores. */
10
+ function refuseWrongShape(value, expected) {
11
+ throw structuredError("CONTRACT.CAST_REFUSED", `Expected ${expected}, got ${JSON.stringify(value)}.`, {
12
+ why: "A cast reads the stored form of the type it takes values of.",
13
+ fix: "Hand the cast a value in the shape its source type stores."
14
+ });
15
+ }
16
+ /** A whole number as the digit text a 64-bit integer or decimal type stores. */
17
+ const asNumeralText = (value) => typeof value === "number" ? numeralText(value) : refuseWrongShape(value, "a number");
18
+ /**
19
+ * A number as the floating-point types store it: a JSON number, or one of the three words, which
20
+ * those types keep as text. A magnitude past what a double holds is refused rather than rounded to
21
+ * a word: the database refuses it too, and storing `Infinity` would make a written number
22
+ * indistinguishable from a written `Infinity`.
23
+ */
24
+ const asFloat = (value) => {
25
+ if (typeof value === "number") return value;
26
+ if (typeof value !== "string") return refuseWrongShape(value, "a number or numeral text");
27
+ if (isNonFiniteText(value)) return value;
28
+ const converted = Number(value);
29
+ if (Number.isFinite(converted)) return converted;
30
+ throw structuredError("CONTRACT.CAST_REFUSED", `${value} is out of range: no double holds a number that large.`, {
31
+ why: "The floating-point types store a double, which holds magnitudes up to about 1.8e308.",
32
+ fix: "Use a number a double holds, or a decimal type."
33
+ });
34
+ };
35
+ /**
36
+ * Trivial column packager. Per-codec helpers call this directly with the result of `descriptor.factory(params)` — direct method invocation binds the descriptor's method-level generic at the call site and the literal flows through `R`.
37
+ */
38
+ function column(codecFactory, codecId, typeParams) {
39
+ return {
40
+ codecFactory,
41
+ codecId,
42
+ typeParams
43
+ };
44
+ }
45
+ /**
46
+ * The reader targets build the stored form of each date and time type with; ADR 254
47
+ * states the forms and the text it reads.
48
+ */
49
+ const SHAPES = {
50
+ date: {
51
+ description: "a date",
52
+ plural: "dates",
53
+ example: "2024-01-01",
54
+ date: true,
55
+ time: false,
56
+ offset: false
57
+ },
58
+ time: {
59
+ description: "a time of day",
60
+ plural: "times of day",
61
+ example: "12:34:56",
62
+ date: false,
63
+ time: true,
64
+ offset: false
65
+ },
66
+ timeWithOffset: {
67
+ description: "a time of day with a UTC offset",
68
+ plural: "times of day with a UTC offset",
69
+ example: "12:34:56+02:00",
70
+ date: false,
71
+ time: true,
72
+ offset: true
73
+ },
74
+ dateTime: {
75
+ description: "a date and time",
76
+ plural: "dates and times",
77
+ example: "2024-01-01T12:34:56",
78
+ date: true,
79
+ time: true,
80
+ offset: false
81
+ },
82
+ instant: {
83
+ description: "a date and time with a UTC offset",
84
+ plural: "instants",
85
+ example: "2024-01-01T12:34:56Z",
86
+ date: true,
87
+ time: true,
88
+ offset: true
89
+ }
90
+ };
91
+ const DATE_PREFIX = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})/;
92
+ const TIME_PREFIX = /^(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?/;
93
+ const OFFSET = /^([+-])(\d{2})(?::(\d{2})(?::(\d{2}))?)?$/;
94
+ const MAX_FRACTION_DIGITS = 6;
95
+ const FRACTION_UNITS = {
96
+ 3: "milliseconds",
97
+ 6: "microseconds"
98
+ };
99
+ const SECONDS_PER_DAY = 86400;
100
+ const MIDNIGHT = {
101
+ hour: 0,
102
+ minute: 0,
103
+ second: 0,
104
+ fraction: ""
105
+ };
106
+ function refused(message) {
107
+ throw structuredError("CONTRACT.CAST_REFUSED", message, {
108
+ why: "A date or time type stores one form for each value (ADR 254).",
109
+ fix: "Write text the type holds, as the message shows."
110
+ });
111
+ }
112
+ function isLeapYear(year) {
113
+ return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
114
+ }
115
+ function daysInMonth(year, month) {
116
+ if (month === 2) return isLeapYear(year) ? 29 : 28;
117
+ return [
118
+ 4,
119
+ 6,
120
+ 9,
121
+ 11
122
+ ].includes(month) ? 30 : 31;
123
+ }
124
+ /** Days from 1970-01-01 to a date of the proleptic Gregorian calendar, with year 0 as 1 BC. */
125
+ function daysFromCivil({ year, month, day }) {
126
+ const shifted = month <= 2 ? year - 1 : year;
127
+ const era = Math.floor(shifted / 400);
128
+ const yearOfEra = shifted - era * 400;
129
+ const dayOfYear = Math.floor((153 * (month + (month > 2 ? -3 : 9)) + 2) / 5) + day - 1;
130
+ const dayOfEra = yearOfEra * 365 + Math.floor(yearOfEra / 4) - Math.floor(yearOfEra / 100) + dayOfYear;
131
+ return era * 146097 + dayOfEra - 719468;
132
+ }
133
+ function civilFromDays(days) {
134
+ const shifted = days + 719468;
135
+ const era = Math.floor(shifted / 146097);
136
+ const dayOfEra = shifted - era * 146097;
137
+ const yearOfEra = Math.floor((dayOfEra - Math.floor(dayOfEra / 1460) + Math.floor(dayOfEra / 36524) - Math.floor(dayOfEra / 146096)) / 365);
138
+ const dayOfYear = dayOfEra - (365 * yearOfEra + Math.floor(yearOfEra / 4) - Math.floor(yearOfEra / 100));
139
+ const monthIndex = Math.floor((5 * dayOfYear + 2) / 153);
140
+ const day = dayOfYear - Math.floor((153 * monthIndex + 2) / 5) + 1;
141
+ const month = monthIndex < 10 ? monthIndex + 3 : monthIndex - 9;
142
+ return {
143
+ year: yearOfEra + era * 400 + (month <= 2 ? 1 : 0),
144
+ month,
145
+ day
146
+ };
147
+ }
148
+ function pad(value, width = 2) {
149
+ return String(value).padStart(width, "0");
150
+ }
151
+ function yearText(year) {
152
+ if (year >= 0 && year <= 9999) return pad(year, 4);
153
+ return `${year < 0 ? "-" : "+"}${pad(Math.abs(year), 6)}`;
154
+ }
155
+ function dateText(date) {
156
+ return `${yearText(date.year)}-${pad(date.month)}-${pad(date.day)}`;
157
+ }
158
+ function timeText(time) {
159
+ const fraction = time.fraction.replace(/0+$/, "");
160
+ return `${pad(time.hour)}:${pad(time.minute)}:${pad(time.second)}${fraction === "" ? "" : `.${fraction}`}`;
161
+ }
162
+ function offsetText(seconds) {
163
+ if (seconds === 0) return "Z";
164
+ const magnitude = Math.abs(seconds);
165
+ const rest = magnitude % 60;
166
+ return `${seconds < 0 ? "-" : "+"}${pad(Math.floor(magnitude / 3600))}:${pad(Math.floor(magnitude / 60) % 60)}${rest === 0 ? "" : `:${pad(rest)}`}`;
167
+ }
168
+ /**
169
+ * The fields of an ISO 8601 date, time, or date and time, or `undefined` when the text is not one.
170
+ * Ranges are checked by the caller, which words the refusal.
171
+ */
172
+ function readWritten(text) {
173
+ let rest = text;
174
+ let date;
175
+ let timeFollows = true;
176
+ const dateMatch = DATE_PREFIX.exec(rest);
177
+ if (dateMatch !== null) {
178
+ const [whole, yearDigits = "", month = "", day = ""] = dateMatch;
179
+ if (yearDigits === "-000000") return void 0;
180
+ date = {
181
+ year: Number(yearDigits),
182
+ month: Number(month),
183
+ day: Number(day)
184
+ };
185
+ rest = rest.slice(whole.length);
186
+ timeFollows = /^[Tt ]/.test(rest);
187
+ if (timeFollows) rest = rest.slice(1);
188
+ }
189
+ let time;
190
+ let fractionDigits = 0;
191
+ if (timeFollows) {
192
+ const timeMatch = TIME_PREFIX.exec(rest);
193
+ if (timeMatch === null) return void 0;
194
+ const [whole, hour = "", minute = "", second = "00", fraction = ""] = timeMatch;
195
+ time = {
196
+ hour: Number(hour),
197
+ minute: Number(minute),
198
+ second: Number(second),
199
+ fraction
200
+ };
201
+ fractionDigits = fraction.length;
202
+ rest = rest.slice(whole.length);
203
+ }
204
+ let offsetSeconds;
205
+ if (rest === "Z" || rest === "z") offsetSeconds = 0;
206
+ else if (rest !== "") {
207
+ const offset = OFFSET.exec(rest);
208
+ if (offset === null) return void 0;
209
+ const [, sign, hours = "", minutes = "00", seconds = "00"] = offset;
210
+ if (Number(minutes) > 59 || Number(seconds) > 59) return void 0;
211
+ const magnitude = Number(hours) * 3600 + Number(minutes) * 60 + Number(seconds);
212
+ offsetSeconds = sign === "-" ? -magnitude : magnitude;
213
+ }
214
+ return {
215
+ date,
216
+ time,
217
+ offsetSeconds,
218
+ fractionDigits
219
+ };
220
+ }
221
+ function withFraction(example, digits) {
222
+ return example.replace(/(\d{2}:\d{2}:\d{2})/, `$1.${"123456".slice(0, digits)}`);
223
+ }
224
+ /** The value with an instant moved to UTC. */
225
+ function normalized(written, shape) {
226
+ const clock = written.time ?? MIDNIGHT;
227
+ const offsetSeconds = written.offsetSeconds ?? 0;
228
+ if (written.date === void 0 || shape !== "instant") return {
229
+ date: written.date,
230
+ time: clock,
231
+ offsetSeconds
232
+ };
233
+ const utc = daysFromCivil(written.date) * SECONDS_PER_DAY + clock.hour * 3600 + clock.minute * 60 + clock.second - offsetSeconds;
234
+ const days = Math.floor(utc / SECONDS_PER_DAY);
235
+ const secondOfDay = utc - days * SECONDS_PER_DAY;
236
+ return {
237
+ date: civilFromDays(days),
238
+ time: {
239
+ hour: Math.floor(secondOfDay / 3600),
240
+ minute: Math.floor(secondOfDay / 60) % 60,
241
+ second: secondOfDay % 60,
242
+ fraction: clock.fraction
243
+ },
244
+ offsetSeconds: 0
245
+ };
246
+ }
247
+ function position(value) {
248
+ const { time } = value;
249
+ return [
250
+ value.date === void 0 ? 0 : daysFromCivil(value.date),
251
+ time.hour * 3600 + time.minute * 60 + time.second,
252
+ time.fraction.padEnd(MAX_FRACTION_DIGITS, "0")
253
+ ];
254
+ }
255
+ function isBefore(left, right) {
256
+ if (left[0] !== right[0]) return left[0] < right[0];
257
+ if (left[1] !== right[1]) return left[1] < right[1];
258
+ return left[2] < right[2];
259
+ }
260
+ function printed(value, shape) {
261
+ const { date, time, offsetSeconds } = value;
262
+ if (date === void 0) return shape === "timeWithOffset" ? `${timeText(time)}${offsetText(offsetSeconds)}` : timeText(time);
263
+ if (shape === "date") return dateText(date);
264
+ if (shape === "dateTime") return `${dateText(date)}T${timeText(time)}`;
265
+ return `${dateText(date)}T${timeText(time)}Z`;
266
+ }
267
+ /** The position of a range bound, which the data type declares in stored form. */
268
+ function boundPosition(text, shape) {
269
+ const written = readWritten(text);
270
+ if (written === void 0) throw new InternalError(`The range bound "${text}" is not in its stored form.`);
271
+ return position(normalized(written, shape));
272
+ }
273
+ /**
274
+ * The stored form of written date or time text, or a refusal with a message that says what is
275
+ * wrong and shows text the type holds. `written` is the text as its author wrote it, which the
276
+ * message shows, when a target rewrote it into ISO 8601 before calling this.
277
+ */
278
+ function dateTimeStoredText(text, options, written = text) {
279
+ const shape = SHAPES[options.shape];
280
+ const { ownerId: id } = options;
281
+ const parts = readWritten(text);
282
+ if (parts === void 0) refused(`${id} cannot read "${written}". Write ${shape.description}, as in "${shape.example}".`);
283
+ if (parts.date !== void 0 && !shape.date) refused(`${id} holds a time of day without a date, but "${written}" has a date. Write the time alone, as in "${shape.example}".`);
284
+ if (parts.date === void 0 && shape.date) refused(shape.time ? `${id} holds ${shape.description}, but "${written}" has no date. Write the date too, as in "${shape.example}".` : `${id} holds a date, and "${written}" is a time of day. Write a date, as in "${shape.example}".`);
285
+ if (parts.time !== void 0 && !shape.time) refused(`${id} holds a date without a time of day, but "${written}" has a time. Write the date alone, as in "${shape.example}".`);
286
+ if (parts.time === void 0 && shape.offset) refused(`${id} holds ${shape.description}, but "${written}" has no time of day. Write the time too, as in "${shape.example}".`);
287
+ if (parts.offsetSeconds !== void 0 && !shape.offset) refused(`${id} holds no UTC offset, but "${written}" has one. Leave it out, as in "${shape.example}".`);
288
+ if (parts.offsetSeconds === void 0 && shape.offset) refused(`${id} needs a UTC offset, but "${written}" has none. Add Z for UTC or an offset such as +02:00, as in "${shape.example}".`);
289
+ const maxFractionDigits = options.maxFractionDigits ?? MAX_FRACTION_DIGITS;
290
+ if (parts.fractionDigits > maxFractionDigits) refused(`"${written}" has ${parts.fractionDigits} digits after the decimal point, but ${id} holds ${FRACTION_UNITS[maxFractionDigits]}, so at most ${maxFractionDigits}. Round it, as in "${withFraction(shape.example, maxFractionDigits)}".`);
291
+ const { date, time } = parts;
292
+ if (date !== void 0 && (date.month < 1 || date.month > 12 || date.day < 1 || date.day > daysInMonth(date.year, date.month))) refused(`"${written}" is not a date that exists. Write a real date, as in "${shape.example}".`);
293
+ if (time !== void 0 && (time.hour > 23 || time.minute > 59 || time.second > 59)) refused(`"${written}" is not a time of day that exists: hours run from 00 to 23, and minutes and seconds from 00 to 59. Write one, as in "${shape.example}".`);
294
+ const offsetLimit = options.maxOffsetHours ?? 23;
295
+ if (parts.offsetSeconds !== void 0 && Math.abs(parts.offsetSeconds) >= (offsetLimit + 1) * 3600) refused(`"${written}" has a UTC offset outside -${pad(offsetLimit)}:59 to +${pad(offsetLimit)}:59, which ${id} does not hold. Write a smaller offset, as in "${shape.example}".`);
296
+ const value = normalized(parts, options.shape);
297
+ const { range } = options;
298
+ if (range !== void 0) {
299
+ const at = position(value);
300
+ if (isBefore(at, boundPosition(range.earliest, options.shape)) || isBefore(boundPosition(range.latest, options.shape), at)) refused(`${id} holds ${shape.plural} from ${range.earliest} to ${range.latest}, and "${written}" is outside them.`);
301
+ }
302
+ return printed(value, options.shape);
303
+ }
304
+ const ISO_DATE_STRING_FRACTION = /^(.*:\d{2})(?:\.(\d{1,3}))?Z$/;
305
+ /**
306
+ * The instant in UTC with exactly three fraction digits, the text `Date.prototype.toISOString()` writes, from ISO 8601 text with a UTC offset. The range and the millisecond precision are those of a JavaScript `Date`. Throws `CONTRACT.CAST_REFUSED`, naming `ownerId`, for text that names no instant a `Date` holds.
307
+ */
308
+ function isoDateStringText(text, ownerId) {
309
+ const stored = dateTimeStoredText(text, {
310
+ shape: "instant",
311
+ ownerId,
312
+ maxFractionDigits: 3,
313
+ range: {
314
+ earliest: "-271821-04-20T00:00:00Z",
315
+ latest: "+275760-09-13T00:00:00Z"
316
+ }
317
+ });
318
+ const match = ISO_DATE_STRING_FRACTION.exec(stored);
319
+ return match === null ? stored : `${match[1]}.${(match[2] ?? "").padEnd(3, "0")}Z`;
320
+ }
321
+ const DECIMAL_TEXT = /^([+-]?)(\d*)(?:\.(\d*))?$/;
322
+ /**
323
+ * The key two decimal texts share exactly when they are the same number, for a data type that stores a decimal as text and keeps the scale it was written with, as `numeric` stores `0.5` and `0.50`: leading zeros, trailing fraction zeros and the sign of zero do not count. `NaN` and the infinities keep their own keys.
324
+ */
325
+ function decimalTextEqualityKey(json) {
326
+ const text = String(json);
327
+ const match = DECIMAL_TEXT.exec(text);
328
+ if (match === null) return text;
329
+ const [, sign = "", whole = "", fraction = ""] = match;
330
+ const digits = whole.replace(/^0+/, "");
331
+ const decimals = fraction.replace(/0+$/, "");
332
+ if (digits === "" && decimals === "") return "0";
333
+ const magnitude = decimals === "" ? digits || "0" : `${digits || "0"}.${decimals}`;
334
+ return sign === "-" ? `-${magnitude}` : magnitude;
335
+ }
336
+ /**
337
+ * Read JSON text into the document it holds.
338
+ *
339
+ * `JSON.parse` reads a numeral too large for a double as `Infinity`, and `JSON.stringify` writes
340
+ * that back as `null`, so a document holding one would not be the document stored; it is refused
341
+ * here instead, naming where the number is.
342
+ */
343
+ function parseJsonText(text) {
344
+ let value;
345
+ try {
346
+ value = JSON.parse(text);
347
+ } catch (error) {
348
+ throw structuredError("CONTRACT.INVALID_JSON_LITERAL", error instanceof Error ? error.message : String(error), {
349
+ why: "The text is not a JSON document.",
350
+ fix: "Write a JSON document."
351
+ });
352
+ }
353
+ const overflowed = nonFiniteNumberIn(value, "");
354
+ if (overflowed !== void 0) throw structuredError("CONTRACT.INVALID_JSON_LITERAL", `${overflowed.path} is ${overflowed.value}, which JSON cannot write back: the number in the text is outside the range a JSON number holds.`, {
355
+ why: "JSON.parse reads a numeral too large for a double as Infinity, which JSON.stringify writes back as null.",
356
+ fix: "Write a number JSON can hold, or write it as text."
357
+ });
358
+ return value;
359
+ }
360
+ /** Write a document as the text of a JSON literal. */
361
+ function printJsonText(value) {
362
+ return JSON.stringify(value);
363
+ }
364
+ function nonFiniteNumberIn(value, path) {
365
+ if (typeof value === "number") return Number.isFinite(value) ? void 0 : {
366
+ path: path === "" ? "The value" : path,
367
+ value
368
+ };
369
+ if (Array.isArray(value)) {
370
+ for (const [index, element] of value.entries()) {
371
+ const found = nonFiniteNumberIn(element, `${path}[${index}]`);
372
+ if (found !== void 0) return found;
373
+ }
374
+ return;
375
+ }
376
+ if (typeof value === "object" && value !== null) for (const [key, member] of Object.entries(value)) {
377
+ const found = nonFiniteNumberIn(member, path === "" ? key : `${path}.${key}`);
378
+ if (found !== void 0) return found;
379
+ }
380
+ }
381
+ const WRITTEN_INTEGER_TEXT = /^[+-]?\d+$/;
382
+ const WRITTEN_DECIMAL_TEXT = /^[+-]?\d+\.\d+$/;
383
+ const DECIMAL_NUMERAL = /^([+-]?)0*(\d+)(\.\d+)?$/;
384
+ /** Whether `text` is a whole number or a decimal as a contract source writes one. */
385
+ function isNumeralText(text) {
386
+ return WRITTEN_INTEGER_TEXT.test(text) || WRITTEN_DECIMAL_TEXT.test(text);
387
+ }
388
+ /**
389
+ * A written numeral as the contract stores it. Leading zeros and the sign of zero never change a
390
+ * number, so they go; trailing zeros stay, because a type without a scale keeps them.
391
+ */
392
+ function storedNumeralText(text) {
393
+ const numeral = DECIMAL_NUMERAL.exec(text);
394
+ if (numeral === null) return text;
395
+ const [, sign = "", whole = "", fraction = ""] = numeral;
396
+ const digits = `${whole}${fraction}`;
397
+ return sign !== "-" || /^[0.]+$/.test(digits) ? digits : `-${digits}`;
398
+ }
399
+ /** The range of a signed integer of `bits` bits. */
400
+ function signedRange(bits) {
401
+ const half = 2n ** (BigInt(bits) - 1n);
402
+ return {
403
+ min: -half,
404
+ max: half - 1n
405
+ };
406
+ }
407
+ /**
408
+ * The classifier one target's plain-number authoring entry carries: it reads the digits and says
409
+ * which of the target's types the value is, in that type's stored form. `undefined` means no
410
+ * type of this target holds the number.
411
+ */
412
+ function createNumberClassifier(spec) {
413
+ const as = (classification, value) => classification === void 0 ? void 0 : {
414
+ type: classification.type,
415
+ value
416
+ };
417
+ return (text) => {
418
+ if (isNonFiniteText(text)) return as(spec.words, spec.words?.form === "number" ? Number(text) : text);
419
+ if (WRITTEN_DECIMAL_TEXT.test(text)) {
420
+ const canonical = storedNumeralText(text);
421
+ return as(spec.fraction, spec.fraction?.form === "number" ? Number(canonical) : canonical);
422
+ }
423
+ if (!WRITTEN_INTEGER_TEXT.test(text)) return void 0;
424
+ const digits = BigInt(text);
425
+ const classification = spec.integers.find(({ min, max }) => digits >= min && digits <= max) ?? spec.largerWhole;
426
+ return as(classification, classification?.form === "number" ? Number(digits) : digits.toString());
427
+ };
428
+ }
429
+ /**
430
+ * Renders a stored value as a TypeScript literal (e.g. `"low"`, `1`, `true`), or `undefined`
431
+ * when the value isn't literal-expressible (objects, arrays, null).
432
+ *
433
+ * Valid **only for codecs whose application value is the stored JSON** (text, int, float, bool). A
434
+ * codec whose application value differs from the stored JSON (e.g. digit text read as a `bigint`)
435
+ * must NOT use this: it renders the application value in its own `renderValueLiteral`.
436
+ */
437
+ function renderTsLiteral(value) {
438
+ if (typeof value === "string") return tsStringLiteral(value);
439
+ if (typeof value === "number" || typeof value === "boolean") return String(value);
440
+ }
441
+ const DECIMAL_INTEGER = /^-?\d+$/;
442
+ /** Renders decimal integer text, read as a `number`, as a number literal, or `undefined` for any other value. */
443
+ function decimalTextNumberLiteral(value) {
444
+ return typeof value === "string" && DECIMAL_INTEGER.test(value) ? value : void 0;
445
+ }
446
+ /** Renders decimal integer text, read as a `bigint`, as a bigint literal, or `undefined` for any other value. */
447
+ function decimalTextBigintLiteral(value) {
448
+ return typeof value === "string" && DECIMAL_INTEGER.test(value) ? `${value}n` : void 0;
449
+ }
450
+ /** Renders a float's stored number as a number literal. A target stores an infinity, and NaN where it holds one (SQLite does not), as text, which has no literal type, so it renders nothing. */
451
+ function floatNumberLiteral(value) {
452
+ return typeof value === "number" ? String(value) : void 0;
453
+ }
454
+ //#endregion
455
+ export { signedRange as _, createNumberClassifier as a, decimalTextEqualityKey as c, isNumeralText as d, isoDateStringText as f, renderTsLiteral as g, refuseWrongShape as h, column as i, decimalTextNumberLiteral as l, printJsonText as m, asNumeralText as n, dateTimeStoredText as o, parseJsonText as p, castUnchanged as r, decimalTextBigintLiteral as s, asFloat as t, floatNumberLiteral as u, storedNumeralText as v };
456
+
457
+ //# sourceMappingURL=codec-Do8tfXqk.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-Do8tfXqk.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/codec.mjs"],"sourcesContent":["import { C as readJsonInteger, D as refuseJsonValue, E as readJsonString, O as DATA_TYPE_ID_PATTERN, S as readJsonFloat, T as readJsonMatching, _ as SAFE_INTEGER_RANGE, a as dataTypeId, b as isNonFiniteText, c as dataTypeValuesEqual, d as requiredParamKeys, f as requiredSchemaKeys, g as SAFE_INTEGER_BIGINT_RANGE, h as INT64_RANGE, i as dataType, l as objectSchemaKeys, m as INT32_RANGE, n as assertDataTypeParams, o as dataTypeParams, p as schemaKeysAllowing, r as createDataTypeLookup, s as dataTypeParamsProblem, t as assembleDataTypes, u as requireValueOf, v as floatToJson, w as readJsonIntegerText, x as readJsonBoolean, y as isIntegerIn } from \"./data-type-V6mcDhcG.mjs\";\nimport { a as readContractValue, i as CodecImpl, n as CodecDescriptorTemplateImpl, o as numeralText, r as enumRefusalOf, t as CodecDescriptorImpl } from \"./codec-descriptor-D0oY-hgs.mjs\";\nimport { t as emptyCodecLookup } from \"./codec-types-BXLUbk-Y.mjs\";\nimport { a as resolveCodecDescriptorOrThrow, i as materializeCodec, o as validateCodecTypeParams, r as codecForRef, t as CONTRACT_CODEC_DESCRIPTOR_MISSING } from \"./resolve-codec-qqMjZrmn.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { tsStringLiteral } from \"@internal/ts-render\";\n//#region src/shared/casts.ts\n/** A cast between two types that store the same shape: the value is already the form this type stores. */\nconst castUnchanged = (value) => value;\n/** Refuses a value that is not in the shape the cast's source type stores. */\nfunction refuseWrongShape(value, expected) {\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `Expected ${expected}, got ${JSON.stringify(value)}.`, {\n\t\twhy: \"A cast reads the stored form of the type it takes values of.\",\n\t\tfix: \"Hand the cast a value in the shape its source type stores.\"\n\t});\n}\n/** A whole number as the digit text a 64-bit integer or decimal type stores. */\nconst asNumeralText = (value) => typeof value === \"number\" ? numeralText(value) : refuseWrongShape(value, \"a number\");\n/**\n* A number as the floating-point types store it: a JSON number, or one of the three words, which\n* those types keep as text. A magnitude past what a double holds is refused rather than rounded to\n* a word: the database refuses it too, and storing `Infinity` would make a written number\n* indistinguishable from a written `Infinity`.\n*/\nconst asFloat = (value) => {\n\tif (typeof value === \"number\") return value;\n\tif (typeof value !== \"string\") return refuseWrongShape(value, \"a number or numeral text\");\n\tif (isNonFiniteText(value)) return value;\n\tconst converted = Number(value);\n\tif (Number.isFinite(converted)) return converted;\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", `${value} is out of range: no double holds a number that large.`, {\n\t\twhy: \"The floating-point types store a double, which holds magnitudes up to about 1.8e308.\",\n\t\tfix: \"Use a number a double holds, or a decimal type.\"\n\t});\n};\n//#endregion\n//#region src/shared/column-spec.ts\n/**\n* Trivial column packager. Per-codec helpers call this directly with the result of `descriptor.factory(params)` — direct method invocation binds the descriptor's method-level generic at the call site and the literal flows through `R`.\n*/\nfunction column(codecFactory, codecId, typeParams) {\n\treturn {\n\t\tcodecFactory,\n\t\tcodecId,\n\t\ttypeParams\n\t};\n}\n//#endregion\n//#region src/shared/date-time-stored-form.ts\n/**\n* The reader targets build the stored form of each date and time type with; ADR 254\n* states the forms and the text it reads.\n*/\nconst SHAPES = {\n\tdate: {\n\t\tdescription: \"a date\",\n\t\tplural: \"dates\",\n\t\texample: \"2024-01-01\",\n\t\tdate: true,\n\t\ttime: false,\n\t\toffset: false\n\t},\n\ttime: {\n\t\tdescription: \"a time of day\",\n\t\tplural: \"times of day\",\n\t\texample: \"12:34:56\",\n\t\tdate: false,\n\t\ttime: true,\n\t\toffset: false\n\t},\n\ttimeWithOffset: {\n\t\tdescription: \"a time of day with a UTC offset\",\n\t\tplural: \"times of day with a UTC offset\",\n\t\texample: \"12:34:56+02:00\",\n\t\tdate: false,\n\t\ttime: true,\n\t\toffset: true\n\t},\n\tdateTime: {\n\t\tdescription: \"a date and time\",\n\t\tplural: \"dates and times\",\n\t\texample: \"2024-01-01T12:34:56\",\n\t\tdate: true,\n\t\ttime: true,\n\t\toffset: false\n\t},\n\tinstant: {\n\t\tdescription: \"a date and time with a UTC offset\",\n\t\tplural: \"instants\",\n\t\texample: \"2024-01-01T12:34:56Z\",\n\t\tdate: true,\n\t\ttime: true,\n\t\toffset: true\n\t}\n};\nconst DATE_PREFIX = /^([+-]\\d{6}|\\d{4})-(\\d{2})-(\\d{2})/;\nconst TIME_PREFIX = /^(\\d{2}):(\\d{2})(?::(\\d{2})(?:\\.(\\d+))?)?/;\nconst OFFSET = /^([+-])(\\d{2})(?::(\\d{2})(?::(\\d{2}))?)?$/;\nconst MAX_FRACTION_DIGITS = 6;\nconst FRACTION_UNITS = {\n\t3: \"milliseconds\",\n\t6: \"microseconds\"\n};\nconst SECONDS_PER_DAY = 86400;\nconst MIDNIGHT = {\n\thour: 0,\n\tminute: 0,\n\tsecond: 0,\n\tfraction: \"\"\n};\nfunction refused(message) {\n\tthrow structuredError(\"CONTRACT.CAST_REFUSED\", message, {\n\t\twhy: \"A date or time type stores one form for each value (ADR 254).\",\n\t\tfix: \"Write text the type holds, as the message shows.\"\n\t});\n}\nfunction isLeapYear(year) {\n\treturn year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;\n}\nfunction daysInMonth(year, month) {\n\tif (month === 2) return isLeapYear(year) ? 29 : 28;\n\treturn [\n\t\t4,\n\t\t6,\n\t\t9,\n\t\t11\n\t].includes(month) ? 30 : 31;\n}\n/** Days from 1970-01-01 to a date of the proleptic Gregorian calendar, with year 0 as 1 BC. */\nfunction daysFromCivil({ year, month, day }) {\n\tconst shifted = month <= 2 ? year - 1 : year;\n\tconst era = Math.floor(shifted / 400);\n\tconst yearOfEra = shifted - era * 400;\n\tconst dayOfYear = Math.floor((153 * (month + (month > 2 ? -3 : 9)) + 2) / 5) + day - 1;\n\tconst dayOfEra = yearOfEra * 365 + Math.floor(yearOfEra / 4) - Math.floor(yearOfEra / 100) + dayOfYear;\n\treturn era * 146097 + dayOfEra - 719468;\n}\nfunction civilFromDays(days) {\n\tconst shifted = days + 719468;\n\tconst era = Math.floor(shifted / 146097);\n\tconst dayOfEra = shifted - era * 146097;\n\tconst yearOfEra = Math.floor((dayOfEra - Math.floor(dayOfEra / 1460) + Math.floor(dayOfEra / 36524) - Math.floor(dayOfEra / 146096)) / 365);\n\tconst dayOfYear = dayOfEra - (365 * yearOfEra + Math.floor(yearOfEra / 4) - Math.floor(yearOfEra / 100));\n\tconst monthIndex = Math.floor((5 * dayOfYear + 2) / 153);\n\tconst day = dayOfYear - Math.floor((153 * monthIndex + 2) / 5) + 1;\n\tconst month = monthIndex < 10 ? monthIndex + 3 : monthIndex - 9;\n\treturn {\n\t\tyear: yearOfEra + era * 400 + (month <= 2 ? 1 : 0),\n\t\tmonth,\n\t\tday\n\t};\n}\nfunction pad(value, width = 2) {\n\treturn String(value).padStart(width, \"0\");\n}\nfunction yearText(year) {\n\tif (year >= 0 && year <= 9999) return pad(year, 4);\n\treturn `${year < 0 ? \"-\" : \"+\"}${pad(Math.abs(year), 6)}`;\n}\nfunction dateText(date) {\n\treturn `${yearText(date.year)}-${pad(date.month)}-${pad(date.day)}`;\n}\nfunction timeText(time) {\n\tconst fraction = time.fraction.replace(/0+$/, \"\");\n\treturn `${pad(time.hour)}:${pad(time.minute)}:${pad(time.second)}${fraction === \"\" ? \"\" : `.${fraction}`}`;\n}\nfunction offsetText(seconds) {\n\tif (seconds === 0) return \"Z\";\n\tconst magnitude = Math.abs(seconds);\n\tconst rest = magnitude % 60;\n\treturn `${seconds < 0 ? \"-\" : \"+\"}${pad(Math.floor(magnitude / 3600))}:${pad(Math.floor(magnitude / 60) % 60)}${rest === 0 ? \"\" : `:${pad(rest)}`}`;\n}\n/**\n* The fields of an ISO 8601 date, time, or date and time, or `undefined` when the text is not one.\n* Ranges are checked by the caller, which words the refusal.\n*/\nfunction readWritten(text) {\n\tlet rest = text;\n\tlet date;\n\tlet timeFollows = true;\n\tconst dateMatch = DATE_PREFIX.exec(rest);\n\tif (dateMatch !== null) {\n\t\tconst [whole, yearDigits = \"\", month = \"\", day = \"\"] = dateMatch;\n\t\tif (yearDigits === \"-000000\") return void 0;\n\t\tdate = {\n\t\t\tyear: Number(yearDigits),\n\t\t\tmonth: Number(month),\n\t\t\tday: Number(day)\n\t\t};\n\t\trest = rest.slice(whole.length);\n\t\ttimeFollows = /^[Tt ]/.test(rest);\n\t\tif (timeFollows) rest = rest.slice(1);\n\t}\n\tlet time;\n\tlet fractionDigits = 0;\n\tif (timeFollows) {\n\t\tconst timeMatch = TIME_PREFIX.exec(rest);\n\t\tif (timeMatch === null) return void 0;\n\t\tconst [whole, hour = \"\", minute = \"\", second = \"00\", fraction = \"\"] = timeMatch;\n\t\ttime = {\n\t\t\thour: Number(hour),\n\t\t\tminute: Number(minute),\n\t\t\tsecond: Number(second),\n\t\t\tfraction\n\t\t};\n\t\tfractionDigits = fraction.length;\n\t\trest = rest.slice(whole.length);\n\t}\n\tlet offsetSeconds;\n\tif (rest === \"Z\" || rest === \"z\") offsetSeconds = 0;\n\telse if (rest !== \"\") {\n\t\tconst offset = OFFSET.exec(rest);\n\t\tif (offset === null) return void 0;\n\t\tconst [, sign, hours = \"\", minutes = \"00\", seconds = \"00\"] = offset;\n\t\tif (Number(minutes) > 59 || Number(seconds) > 59) return void 0;\n\t\tconst magnitude = Number(hours) * 3600 + Number(minutes) * 60 + Number(seconds);\n\t\toffsetSeconds = sign === \"-\" ? -magnitude : magnitude;\n\t}\n\treturn {\n\t\tdate,\n\t\ttime,\n\t\toffsetSeconds,\n\t\tfractionDigits\n\t};\n}\nfunction withFraction(example, digits) {\n\treturn example.replace(/(\\d{2}:\\d{2}:\\d{2})/, `$1.${\"123456\".slice(0, digits)}`);\n}\n/** The value with an instant moved to UTC. */\nfunction normalized(written, shape) {\n\tconst clock = written.time ?? MIDNIGHT;\n\tconst offsetSeconds = written.offsetSeconds ?? 0;\n\tif (written.date === void 0 || shape !== \"instant\") return {\n\t\tdate: written.date,\n\t\ttime: clock,\n\t\toffsetSeconds\n\t};\n\tconst utc = daysFromCivil(written.date) * SECONDS_PER_DAY + clock.hour * 3600 + clock.minute * 60 + clock.second - offsetSeconds;\n\tconst days = Math.floor(utc / SECONDS_PER_DAY);\n\tconst secondOfDay = utc - days * SECONDS_PER_DAY;\n\treturn {\n\t\tdate: civilFromDays(days),\n\t\ttime: {\n\t\t\thour: Math.floor(secondOfDay / 3600),\n\t\t\tminute: Math.floor(secondOfDay / 60) % 60,\n\t\t\tsecond: secondOfDay % 60,\n\t\t\tfraction: clock.fraction\n\t\t},\n\t\toffsetSeconds: 0\n\t};\n}\nfunction position(value) {\n\tconst { time } = value;\n\treturn [\n\t\tvalue.date === void 0 ? 0 : daysFromCivil(value.date),\n\t\ttime.hour * 3600 + time.minute * 60 + time.second,\n\t\ttime.fraction.padEnd(MAX_FRACTION_DIGITS, \"0\")\n\t];\n}\nfunction isBefore(left, right) {\n\tif (left[0] !== right[0]) return left[0] < right[0];\n\tif (left[1] !== right[1]) return left[1] < right[1];\n\treturn left[2] < right[2];\n}\nfunction printed(value, shape) {\n\tconst { date, time, offsetSeconds } = value;\n\tif (date === void 0) return shape === \"timeWithOffset\" ? `${timeText(time)}${offsetText(offsetSeconds)}` : timeText(time);\n\tif (shape === \"date\") return dateText(date);\n\tif (shape === \"dateTime\") return `${dateText(date)}T${timeText(time)}`;\n\treturn `${dateText(date)}T${timeText(time)}Z`;\n}\n/** The position of a range bound, which the data type declares in stored form. */\nfunction boundPosition(text, shape) {\n\tconst written = readWritten(text);\n\tif (written === void 0) throw new InternalError(`The range bound \"${text}\" is not in its stored form.`);\n\treturn position(normalized(written, shape));\n}\n/**\n* The stored form of written date or time text, or a refusal with a message that says what is\n* wrong and shows text the type holds. `written` is the text as its author wrote it, which the\n* message shows, when a target rewrote it into ISO 8601 before calling this.\n*/\nfunction dateTimeStoredText(text, options, written = text) {\n\tconst shape = SHAPES[options.shape];\n\tconst { ownerId: id } = options;\n\tconst parts = readWritten(text);\n\tif (parts === void 0) refused(`${id} cannot read \"${written}\". Write ${shape.description}, as in \"${shape.example}\".`);\n\tif (parts.date !== void 0 && !shape.date) refused(`${id} holds a time of day without a date, but \"${written}\" has a date. Write the time alone, as in \"${shape.example}\".`);\n\tif (parts.date === void 0 && shape.date) refused(shape.time ? `${id} holds ${shape.description}, but \"${written}\" has no date. Write the date too, as in \"${shape.example}\".` : `${id} holds a date, and \"${written}\" is a time of day. Write a date, as in \"${shape.example}\".`);\n\tif (parts.time !== void 0 && !shape.time) refused(`${id} holds a date without a time of day, but \"${written}\" has a time. Write the date alone, as in \"${shape.example}\".`);\n\tif (parts.time === void 0 && shape.offset) refused(`${id} holds ${shape.description}, but \"${written}\" has no time of day. Write the time too, as in \"${shape.example}\".`);\n\tif (parts.offsetSeconds !== void 0 && !shape.offset) refused(`${id} holds no UTC offset, but \"${written}\" has one. Leave it out, as in \"${shape.example}\".`);\n\tif (parts.offsetSeconds === void 0 && shape.offset) refused(`${id} needs a UTC offset, but \"${written}\" has none. Add Z for UTC or an offset such as +02:00, as in \"${shape.example}\".`);\n\tconst maxFractionDigits = options.maxFractionDigits ?? MAX_FRACTION_DIGITS;\n\tif (parts.fractionDigits > maxFractionDigits) refused(`\"${written}\" has ${parts.fractionDigits} digits after the decimal point, but ${id} holds ${FRACTION_UNITS[maxFractionDigits]}, so at most ${maxFractionDigits}. Round it, as in \"${withFraction(shape.example, maxFractionDigits)}\".`);\n\tconst { date, time } = parts;\n\tif (date !== void 0 && (date.month < 1 || date.month > 12 || date.day < 1 || date.day > daysInMonth(date.year, date.month))) refused(`\"${written}\" is not a date that exists. Write a real date, as in \"${shape.example}\".`);\n\tif (time !== void 0 && (time.hour > 23 || time.minute > 59 || time.second > 59)) refused(`\"${written}\" is not a time of day that exists: hours run from 00 to 23, and minutes and seconds from 00 to 59. Write one, as in \"${shape.example}\".`);\n\tconst offsetLimit = options.maxOffsetHours ?? 23;\n\tif (parts.offsetSeconds !== void 0 && Math.abs(parts.offsetSeconds) >= (offsetLimit + 1) * 3600) refused(`\"${written}\" has a UTC offset outside -${pad(offsetLimit)}:59 to +${pad(offsetLimit)}:59, which ${id} does not hold. Write a smaller offset, as in \"${shape.example}\".`);\n\tconst value = normalized(parts, options.shape);\n\tconst { range } = options;\n\tif (range !== void 0) {\n\t\tconst at = position(value);\n\t\tif (isBefore(at, boundPosition(range.earliest, options.shape)) || isBefore(boundPosition(range.latest, options.shape), at)) refused(`${id} holds ${shape.plural} from ${range.earliest} to ${range.latest}, and \"${written}\" is outside them.`);\n\t}\n\treturn printed(value, options.shape);\n}\nconst ISO_DATE_STRING_FRACTION = /^(.*:\\d{2})(?:\\.(\\d{1,3}))?Z$/;\n/**\n* The instant in UTC with exactly three fraction digits, the text `Date.prototype.toISOString()` writes, from ISO 8601 text with a UTC offset. The range and the millisecond precision are those of a JavaScript `Date`. Throws `CONTRACT.CAST_REFUSED`, naming `ownerId`, for text that names no instant a `Date` holds.\n*/\nfunction isoDateStringText(text, ownerId) {\n\tconst stored = dateTimeStoredText(text, {\n\t\tshape: \"instant\",\n\t\townerId,\n\t\tmaxFractionDigits: 3,\n\t\trange: {\n\t\t\tearliest: \"-271821-04-20T00:00:00Z\",\n\t\t\tlatest: \"+275760-09-13T00:00:00Z\"\n\t\t}\n\t});\n\tconst match = ISO_DATE_STRING_FRACTION.exec(stored);\n\treturn match === null ? stored : `${match[1]}.${(match[2] ?? \"\").padEnd(3, \"0\")}Z`;\n}\n//#endregion\n//#region src/shared/decimal-text-equality.ts\nconst DECIMAL_TEXT = /^([+-]?)(\\d*)(?:\\.(\\d*))?$/;\n/**\n* The key two decimal texts share exactly when they are the same number, for a data type that stores a decimal as text and keeps the scale it was written with, as `numeric` stores `0.5` and `0.50`: leading zeros, trailing fraction zeros and the sign of zero do not count. `NaN` and the infinities keep their own keys.\n*/\nfunction decimalTextEqualityKey(json) {\n\tconst text = String(json);\n\tconst match = DECIMAL_TEXT.exec(text);\n\tif (match === null) return text;\n\tconst [, sign = \"\", whole = \"\", fraction = \"\"] = match;\n\tconst digits = whole.replace(/^0+/, \"\");\n\tconst decimals = fraction.replace(/0+$/, \"\");\n\tif (digits === \"\" && decimals === \"\") return \"0\";\n\tconst magnitude = decimals === \"\" ? digits || \"0\" : `${digits || \"0\"}.${decimals}`;\n\treturn sign === \"-\" ? `-${magnitude}` : magnitude;\n}\n//#endregion\n//#region src/shared/json-text.ts\n/**\n* Read JSON text into the document it holds.\n*\n* `JSON.parse` reads a numeral too large for a double as `Infinity`, and `JSON.stringify` writes\n* that back as `null`, so a document holding one would not be the document stored; it is refused\n* here instead, naming where the number is.\n*/\nfunction parseJsonText(text) {\n\tlet value;\n\ttry {\n\t\tvalue = JSON.parse(text);\n\t} catch (error) {\n\t\tthrow structuredError(\"CONTRACT.INVALID_JSON_LITERAL\", error instanceof Error ? error.message : String(error), {\n\t\t\twhy: \"The text is not a JSON document.\",\n\t\t\tfix: \"Write a JSON document.\"\n\t\t});\n\t}\n\tconst overflowed = nonFiniteNumberIn(value, \"\");\n\tif (overflowed !== void 0) throw structuredError(\"CONTRACT.INVALID_JSON_LITERAL\", `${overflowed.path} is ${overflowed.value}, which JSON cannot write back: the number in the text is outside the range a JSON number holds.`, {\n\t\twhy: \"JSON.parse reads a numeral too large for a double as Infinity, which JSON.stringify writes back as null.\",\n\t\tfix: \"Write a number JSON can hold, or write it as text.\"\n\t});\n\treturn value;\n}\n/** Write a document as the text of a JSON literal. */\nfunction printJsonText(value) {\n\treturn JSON.stringify(value);\n}\nfunction nonFiniteNumberIn(value, path) {\n\tif (typeof value === \"number\") return Number.isFinite(value) ? void 0 : {\n\t\tpath: path === \"\" ? \"The value\" : path,\n\t\tvalue\n\t};\n\tif (Array.isArray(value)) {\n\t\tfor (const [index, element] of value.entries()) {\n\t\t\tconst found = nonFiniteNumberIn(element, `${path}[${index}]`);\n\t\t\tif (found !== void 0) return found;\n\t\t}\n\t\treturn;\n\t}\n\tif (typeof value === \"object\" && value !== null) for (const [key, member] of Object.entries(value)) {\n\t\tconst found = nonFiniteNumberIn(member, path === \"\" ? key : `${path}.${key}`);\n\t\tif (found !== void 0) return found;\n\t}\n}\n//#endregion\n//#region src/shared/number-classifier.ts\nconst WRITTEN_INTEGER_TEXT = /^[+-]?\\d+$/;\nconst WRITTEN_DECIMAL_TEXT = /^[+-]?\\d+\\.\\d+$/;\nconst DECIMAL_NUMERAL = /^([+-]?)0*(\\d+)(\\.\\d+)?$/;\n/** Whether `text` is a whole number or a decimal as a contract source writes one. */\nfunction isNumeralText(text) {\n\treturn WRITTEN_INTEGER_TEXT.test(text) || WRITTEN_DECIMAL_TEXT.test(text);\n}\n/**\n* A written numeral as the contract stores it. Leading zeros and the sign of zero never change a\n* number, so they go; trailing zeros stay, because a type without a scale keeps them.\n*/\nfunction storedNumeralText(text) {\n\tconst numeral = DECIMAL_NUMERAL.exec(text);\n\tif (numeral === null) return text;\n\tconst [, sign = \"\", whole = \"\", fraction = \"\"] = numeral;\n\tconst digits = `${whole}${fraction}`;\n\treturn sign !== \"-\" || /^[0.]+$/.test(digits) ? digits : `-${digits}`;\n}\n/** The range of a signed integer of `bits` bits. */\nfunction signedRange(bits) {\n\tconst half = 2n ** (BigInt(bits) - 1n);\n\treturn {\n\t\tmin: -half,\n\t\tmax: half - 1n\n\t};\n}\n/**\n* The classifier one target's plain-number authoring entry carries: it reads the digits and says\n* which of the target's types the value is, in that type's stored form. `undefined` means no\n* type of this target holds the number.\n*/\nfunction createNumberClassifier(spec) {\n\tconst as = (classification, value) => classification === void 0 ? void 0 : {\n\t\ttype: classification.type,\n\t\tvalue\n\t};\n\treturn (text) => {\n\t\tif (isNonFiniteText(text)) return as(spec.words, spec.words?.form === \"number\" ? Number(text) : text);\n\t\tif (WRITTEN_DECIMAL_TEXT.test(text)) {\n\t\t\tconst canonical = storedNumeralText(text);\n\t\t\treturn as(spec.fraction, spec.fraction?.form === \"number\" ? Number(canonical) : canonical);\n\t\t}\n\t\tif (!WRITTEN_INTEGER_TEXT.test(text)) return void 0;\n\t\tconst digits = BigInt(text);\n\t\tconst classification = spec.integers.find(({ min, max }) => digits >= min && digits <= max) ?? spec.largerWhole;\n\t\treturn as(classification, classification?.form === \"number\" ? Number(digits) : digits.toString());\n\t};\n}\n//#endregion\n//#region src/shared/render-ts-literal.ts\n/**\n* Renders a stored value as a TypeScript literal (e.g. `\"low\"`, `1`, `true`), or `undefined`\n* when the value isn't literal-expressible (objects, arrays, null).\n*\n* Valid **only for codecs whose application value is the stored JSON** (text, int, float, bool). A\n* codec whose application value differs from the stored JSON (e.g. digit text read as a `bigint`)\n* must NOT use this: it renders the application value in its own `renderValueLiteral`.\n*/\nfunction renderTsLiteral(value) {\n\tif (typeof value === \"string\") return tsStringLiteral(value);\n\tif (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n}\nconst DECIMAL_INTEGER = /^-?\\d+$/;\n/** Renders decimal integer text, read as a `number`, as a number literal, or `undefined` for any other value. */\nfunction decimalTextNumberLiteral(value) {\n\treturn typeof value === \"string\" && DECIMAL_INTEGER.test(value) ? value : void 0;\n}\n/** Renders decimal integer text, read as a `bigint`, as a bigint literal, or `undefined` for any other value. */\nfunction decimalTextBigintLiteral(value) {\n\treturn typeof value === \"string\" && DECIMAL_INTEGER.test(value) ? `${value}n` : void 0;\n}\n/** Renders a float's stored number as a number literal. A target stores an infinity, and NaN where it holds one (SQLite does not), as text, which has no literal type, so it renders nothing. */\nfunction floatNumberLiteral(value) {\n\treturn typeof value === \"number\" ? String(value) : void 0;\n}\n//#endregion\nexport { CONTRACT_CODEC_DESCRIPTOR_MISSING, CodecDescriptorImpl, CodecDescriptorTemplateImpl, CodecImpl, DATA_TYPE_ID_PATTERN, INT32_RANGE, INT64_RANGE, SAFE_INTEGER_BIGINT_RANGE, SAFE_INTEGER_RANGE, asFloat, asNumeralText, assembleDataTypes, assertDataTypeParams, castUnchanged, codecForRef, column, createDataTypeLookup, createNumberClassifier, dataType, dataTypeId, dataTypeParams, dataTypeParamsProblem, dataTypeValuesEqual, dateTimeStoredText, decimalTextBigintLiteral, decimalTextEqualityKey, decimalTextNumberLiteral, emptyCodecLookup, enumRefusalOf, floatNumberLiteral, floatToJson, isIntegerIn, isNonFiniteText, isNumeralText, isoDateStringText, materializeCodec, numeralText, objectSchemaKeys, parseJsonText, printJsonText, readContractValue, readJsonBoolean, readJsonFloat, readJsonInteger, readJsonIntegerText, readJsonMatching, readJsonString, refuseJsonValue, refuseWrongShape, renderTsLiteral, requireValueOf, requiredParamKeys, requiredSchemaKeys, resolveCodecDescriptorOrThrow, schemaKeysAllowing, signedRange, storedNumeralText, validateCodecTypeParams };\n\n//# sourceMappingURL=codec.mjs.map"],"mappings":";;;;;;;AASA,MAAM,iBAAiB,UAAU;;AAEjC,SAAS,iBAAiB,OAAO,UAAU;CAC1C,MAAM,gBAAgB,yBAAyB,YAAY,SAAS,QAAQ,KAAK,UAAU,KAAK,EAAE,IAAI;EACrG,KAAK;EACL,KAAK;CACN,CAAC;AACF;;AAEA,MAAM,iBAAiB,UAAU,OAAO,UAAU,WAAW,YAAY,KAAK,IAAI,iBAAiB,OAAO,UAAU;;;;;;;AAOpH,MAAM,WAAW,UAAU;CAC1B,IAAI,OAAO,UAAU,UAAU,OAAO;CACtC,IAAI,OAAO,UAAU,UAAU,OAAO,iBAAiB,OAAO,0BAA0B;CACxF,IAAI,gBAAgB,KAAK,GAAG,OAAO;CACnC,MAAM,YAAY,OAAO,KAAK;CAC9B,IAAI,OAAO,SAAS,SAAS,GAAG,OAAO;CACvC,MAAM,gBAAgB,yBAAyB,GAAG,MAAM,yDAAyD;EAChH,KAAK;EACL,KAAK;CACN,CAAC;AACF;;;;AAMA,SAAS,OAAO,cAAc,SAAS,YAAY;CAClD,OAAO;EACN;EACA;EACA;CACD;AACD;;;;;AAOA,MAAM,SAAS;CACd,MAAM;EACL,aAAa;EACb,QAAQ;EACR,SAAS;EACT,MAAM;EACN,MAAM;EACN,QAAQ;CACT;CACA,MAAM;EACL,aAAa;EACb,QAAQ;EACR,SAAS;EACT,MAAM;EACN,MAAM;EACN,QAAQ;CACT;CACA,gBAAgB;EACf,aAAa;EACb,QAAQ;EACR,SAAS;EACT,MAAM;EACN,MAAM;EACN,QA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,IAAI,GAAG,MAAM,KAAK,KAAK;AACtF;;AAEA,SAAS,mBAAmB,OAAO;CAClC,OAAO,OAAO,UAAU,WAAW,OAAO,KAAK,IAAI,KAAK;AACzD"}
@@ -1,6 +1,21 @@
1
1
  import { t as InternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
2
- import { T as requireValueOf, d as dataTypeParams } from "./data-type-CVNHtd6y-BFa_VnCb.mjs";
3
- //#region ../../../1-framework/1-core/framework-components/dist/codec-descriptor-V2-N5Qmm.mjs
2
+ import { T as requireValueOf, d as dataTypeParams } from "./data-type-V6mcDhcG-DVQAPOQT.mjs";
3
+ //#region ../../../1-framework/1-core/framework-components/dist/codec-descriptor-D0oY-hgs.mjs
4
+ /**
5
+ * A number as a contract source writes it: no exponent, because no schema language has that syntax,
6
+ * so the decimal point moves to where the exponent puts it. A non-finite number is its own word.
7
+ */
8
+ function numeralText(value) {
9
+ const [coefficient = "", exponent] = String(value).split("e");
10
+ if (exponent === void 0) return coefficient;
11
+ const sign = coefficient.startsWith("-") ? "-" : "";
12
+ const [whole = "", fraction = ""] = coefficient.slice(sign.length).split(".");
13
+ const digits = `${whole}${fraction}`;
14
+ const point = whole.length + Number(exponent);
15
+ if (point <= 0) return `${sign}0.${"0".repeat(-point)}${digits}`;
16
+ if (point >= digits.length) return `${sign}${digits}${"0".repeat(point - digits.length)}`;
17
+ return `${sign}${digits.slice(0, point)}.${digits.slice(point)}`;
18
+ }
4
19
  /**
5
20
  * The application value `codec` gives for `json`, a value a contract stores for a column with the column's `typeParams`: the codec's data type reads it with the parameters it declares, and the codec converts the value.
6
21
  */
@@ -73,6 +88,6 @@ var CodecDescriptorTemplateImpl = class {
73
88
  */
74
89
  var CodecDescriptorImpl = class extends CodecDescriptorTemplateImpl {};
75
90
  //#endregion
76
- export { readContractValue as a, enumRefusalOf as i, CodecDescriptorTemplateImpl as n, CodecImpl as r, CodecDescriptorImpl as t };
91
+ export { numeralText as a, enumRefusalOf as i, CodecDescriptorTemplateImpl as n, readContractValue as o, CodecImpl as r, CodecDescriptorImpl as t };
77
92
 
78
- //# sourceMappingURL=codec-descriptor-V2-N5Qmm-BR-5owl6.mjs.map
93
+ //# sourceMappingURL=codec-descriptor-D0oY-hgs-C5e11ola.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-descriptor-D0oY-hgs-C5e11ola.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/codec-descriptor-D0oY-hgs.mjs"],"sourcesContent":["import { o as dataTypeParams, u as requireValueOf } from \"./data-type-V6mcDhcG.mjs\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/shared/numeral-text.ts\n/**\n* A number as a contract source writes it: no exponent, because no schema language has that syntax,\n* so the decimal point moves to where the exponent puts it. A non-finite number is its own word.\n*/\nfunction numeralText(value) {\n\tconst [coefficient = \"\", exponent] = String(value).split(\"e\");\n\tif (exponent === void 0) return coefficient;\n\tconst sign = coefficient.startsWith(\"-\") ? \"-\" : \"\";\n\tconst [whole = \"\", fraction = \"\"] = coefficient.slice(sign.length).split(\".\");\n\tconst digits = `${whole}${fraction}`;\n\tconst point = whole.length + Number(exponent);\n\tif (point <= 0) return `${sign}0.${\"0\".repeat(-point)}${digits}`;\n\tif (point >= digits.length) return `${sign}${digits}${\"0\".repeat(point - digits.length)}`;\n\treturn `${sign}${digits.slice(0, point)}.${digits.slice(point)}`;\n}\n//#endregion\n//#region src/shared/codec.ts\n/**\n* The application value `codec` gives for `json`, a value a contract stores for a column with the column's `typeParams`: the codec's data type reads it with the parameters it declares, and the codec converts the value.\n*/\nfunction readContractValue(codec, json, typeParams) {\n\treturn codec.fromDataTypeValue(codec.dataType.fromContract(json, dataTypeParams(codec.dataType, typeParams)));\n}\nfunction namedDataType(descriptor) {\n\treturn Reflect.get(descriptor, \"dataType\");\n}\n/**\n* Abstract base class for concrete codec implementations.\n*\n* A codec is built with its descriptor, the data type it converts values of and the column's parameters of that type. The constructor makes `fromDataTypeValue` refuse a value of another data type before the subclass's conversion runs. `fromDataTypeValue` and `toDataTypeValue` convert between a value of the type and the application value, and `toDataTypeValue` finishes with {@link CodecImpl.dataTypeValueOf}, which constructs the value through the type. `fromWire` and `toWire` read and write what the driver exchanges, asynchronously.\n*/\nvar CodecImpl = class {\n\tdescriptor;\n\tdataType;\n\tdataTypeParams;\n\t/**\n\t* The descriptor is variance-erased: concrete codec subclasses receive the typed descriptor in their own constructors and forward it via `super(descriptor, dataType, params)`; the variance erasure lives at this base because the abstract surface can't carry the concrete `TParams`.\n\t*/\n\tconstructor(descriptor, dataType, dataTypeParams = {}) {\n\t\tthis.descriptor = descriptor;\n\t\tthis.dataType = dataType;\n\t\tthis.dataTypeParams = dataTypeParams;\n\t\tconst named = namedDataType(descriptor);\n\t\tif (named !== void 0 && named !== dataType.id) throw new InternalError(`Codec ${descriptor.codecId} is built with the data type ${dataType.id}, but its descriptor names ${String(named)}.`);\n\t\tconst convert = Reflect.get(this, \"fromDataTypeValue\");\n\t\tObject.defineProperty(this, \"fromDataTypeValue\", {\n\t\t\tvalue: (value) => convert.call(this, requireValueOf(this.dataType.id, value, `Codec ${this.id}`)),\n\t\t\twritable: true,\n\t\t\tconfigurable: true\n\t\t});\n\t}\n\tget id() {\n\t\treturn this.descriptor.codecId;\n\t}\n\t/** The value of the codec's data type that `json` stores, under the codec's parameters. */\n\tdataTypeValueOf(json) {\n\t\treturn this.dataType.valueFrom(json, this.dataTypeParams);\n\t}\n};\n//#endregion\n//#region src/shared/codec-descriptor.ts\n/**\n* Why an enum cannot use the codec `descriptor` describes, or `undefined` when one can: the codec's own {@link CodecDescriptorTemplate.enumRefusal}, else the missing `equality` trait. Every enum authoring surface refuses a codec through this.\n*/\nfunction enumRefusalOf(descriptor) {\n\tif (descriptor.enumRefusal !== void 0) return descriptor.enumRefusal;\n\tif (descriptor.traits.includes(\"equality\")) return void 0;\n\treturn \"The codec does not declare the equality trait, so no value can be compared with a member. Use a codec that declares it.\";\n}\n/**\n* Abstract base class for concrete codec descriptors.\n*\n* Codec authors extend this class with their typed `TParams` and declare `codecId`, `traits`, `paramsSchema`, and the curried `factory(params)`.\n*\n* Implements the {@link CodecDescriptor} interface so a concrete subclass instance is directly usable wherever the framework expects a `CodecDescriptor<P>`.\n*/\nvar CodecDescriptorTemplateImpl = class {\n\tget isParameterized() {\n\t\treturn this.paramsSchema !== void 0;\n\t}\n};\n/**\n* Abstract base for a concrete codec descriptor: a {@link CodecDescriptorTemplateImpl} that also\n* names the data type its codec represents.\n*\n* A codec whose data type depends on the target that adopts it extends\n* {@link CodecDescriptorTemplateImpl} instead, and the target names the type when it adapts the\n* template.\n*/\nvar CodecDescriptorImpl = class extends CodecDescriptorTemplateImpl {};\n//#endregion\nexport { readContractValue as a, CodecImpl as i, CodecDescriptorTemplateImpl as n, numeralText as o, enumRefusalOf as r, CodecDescriptorImpl as t };\n\n//# sourceMappingURL=codec-descriptor-D0oY-hgs.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,YAAY,OAAO;CAC3B,MAAM,CAAC,cAAc,IAAI,YAAY,OAAO,KAAK,CAAC,CAAC,MAAM,GAAG;CAC5D,IAAI,aAAa,KAAK,GAAG,OAAO;CAChC,MAAM,OAAO,YAAY,WAAW,GAAG,IAAI,MAAM;CACjD,MAAM,CAAC,QAAQ,IAAI,WAAW,MAAM,YAAY,MAAM,KAAK,MAAM,CAAC,CAAC,MAAM,GAAG;CAC5E,MAAM,SAAS,GAAG,QAAQ;CAC1B,MAAM,QAAQ,MAAM,SAAS,OAAO,QAAQ;CAC5C,IAAI,SAAS,GAAG,OAAO,GAAG,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,IAAI;CACxD,IAAI,SAAS,OAAO,QAAQ,OAAO,GAAG,OAAO,SAAS,IAAI,OAAO,QAAQ,OAAO,MAAM;CACtF,OAAO,GAAG,OAAO,OAAO,MAAM,GAAG,KAAK,EAAE,GAAG,OAAO,MAAM,KAAK;AAC9D;;;;AAMA,SAAS,kBAAkB,OAAO,MAAM,YA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unctionCall } from "./framework-authoring-C78etPdT-CeiBIBJ-.mjs";
2
+ import { Q as GeneratorFunctionComponent, Z as GeneratorFunctionCall } from "./framework-authoring-DDxddXZm-uZYdhoE0.mjs";
3
3
  import { t as AggregateDescriptor } from "./types-import-spec-DQjfX-gM-zVncuzs0.mjs";
4
- import "./framework-components-BmRQfvNS-KSEiBXXc.mjs";
4
+ import "./framework-components-Bo8VkHuI-CLxCdRvy.mjs";
5
5
  //#region ../../../1-framework/1-core/framework-components/dist/components.d.mts
6
6
  //#region src/shared/aggregate-overloads.d.ts
7
7
  /** What settling needs to know about a codec: its id, and the traits an overload can claim it by. */
@@ -83,4 +83,4 @@ type GeneratorHelpersOf<Component> = { readonly [Contribution in Declared<Contri
83
83
  declare function createGeneratorHelpers<const Component extends GeneratorFunctionComponent>(components: readonly Component[]): GeneratorHelpersOf<Component>;
84
84
  //#endregion
85
85
  export { GeneratorHelper as a, SettledAggregateOverloads as c, createGeneratorHelpers as d, settleAggregateOverloads as f, ExtensionPackValues as i, SignatureArgumentOutput as l, AggregateOverloadAmbiguity as n, GeneratorHelpersOf as o, AggregateOverloadDuplicate as r, SettledAggregateOperation as s, AggregateCodecTraits as t, SignatureOptionalArgument as u };
86
- //# sourceMappingURL=components-CJ5VhJT8.d.mts.map
86
+ //# sourceMappingURL=components-B9ow7ca6.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"components-CJ5VhJT8.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/components.d.mts"],"mappings":";;;;;;;UAQU;WACC;WACA,iBAAiB;;;UAGlB,0BAA0B,oBAAoB;;WAE7C,WAAW,oBAAoB;;WAE/B,SAAS;;WAET,UAAU;;;UAGX;WACC;WACA;WACA,iBAAiB;;;UAGlB,2BAA2B,oBAAoB;WAC9C;WACA;WACA,OAAO;WACP,QAAQ;;UAET,0BAA0B,oBAAoB;WAC7C,YAAY,oBAAoB,0BAA0B;WAC1D,sBAAsB;WACtB,qBAAqB,2BAA2B;;;;;;;;;;;iBAW1C,yBAAyB,oBAAoB,qBAAqB,sBAAsB,eAAe,QAAQ,SAAS,wBAAwB,0BAA0B;;;;UAIjL,wBAAwB;WACvB,OAAO;;;UAGR;WACC;;KAEN,YAAY,QAAQ,aAAa,8BAA8B,OAAO,QAAQ;KAC9E,oBAAoB,UAAU,+BAA+B,eAAe,QAAQ;WAC9E,YAAY;IACnB,aAAa,6BAA6B,WAAW,YAAY,UAAU,oBAAoB,UAAU,UAAU,YAAY,UAAU,oBAAoB;;KAE5J,gBAAgB,aAAa,uBAAuB,sBAAsB,SAAS,QAAQ;;KAE3F,gBAAgB,iBAAiB,MAAM,gBAAgB;WACjD,kBAAkB;IACzB,oBAAoB,iBAAiB;KACpC,gBAAgB,aAAa;WACvB,2BAA2B;IAClC,sCAAsC,kBAAkB;KACvD,SAAS,gBAAgB;WACnB;WACA;IACP;;KAEC,oBAAoB,cAAc,mBAAmB,qBAAqB,QAAQ;;KAElF,mBAAmB,yBAAyB,gBAAgB,SAAS,gBAAgB,eAAe,uBAAuB,gBAAgB;;;;iBAI/H,6BAA6B,kBAAkB,4BAA4B,qBAAqB,cAAc,mBAAmB"}
1
+ {"version":3,"file":"components-B9ow7ca6.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/components.d.mts"],"mappings":";;;;;;;UAQU;WACC;WACA,iBAAiB;;;UAGlB,0BAA0B,oBAAoB;;WAE7C,WAAW,oBAAoB;;WAE/B,SAAS;;WAET,UAAU;;;UAGX;WACC;WACA;WACA,iBAAiB;;;UAGlB,2BAA2B,oBAAoB;WAC9C;WACA;WACA,OAAO;WACP,QAAQ;;UAET,0BAA0B,oBAAoB;WAC7C,YAAY,oBAAoB,0BAA0B;WAC1D,sBAAsB;WACtB,qBAAqB,2BAA2B;;;;;;;;;;;iBAW1C,yBAAyB,oBAAoB,qBAAqB,sBAAsB,eAAe,QAAQ,SAAS,wBAAwB,0BAA0B;;;;UAIjL,wBAAwB;WACvB,OAAO;;;UAGR;WACC;;KAEN,YAAY,QAAQ,aAAa,8BAA8B,OAAO,QAAQ;KAC9E,oBAAoB,UAAU,+BAA+B,eAAe,QAAQ;WAC9E,YAAY;IACnB,aAAa,6BAA6B,WAAW,YAAY,UAAU,oBAAoB,UAAU,UAAU,YAAY,UAAU,oBAAoB;;KAE5J,gBAAgB,aAAa,uBAAuB,sBAAsB,SAAS,QAAQ;;KAE3F,gBAAgB,iBAAiB,MAAM,gBAAgB;WACjD,kBAAkB;IACzB,oBAAoB,iBAAiB;KACpC,gBAAgB,aAAa;WACvB,2BAA2B;IAClC,sCAAsC,kBAAkB;KACvD,SAAS,gBAAgB;WACnB;WACA;IACP;;KAEC,oBAAoB,cAAc,mBAAmB,qBAAqB,QAAQ;;KAElF,mBAAmB,yBAAyB,gBAAgB,SAAS,gBAAgB,eAAe,uBAAuB,gBAAgB;;;;iBAI/H,6BAA6B,kBAAkB,4BAA4B,qBAAqB,cAAc,mBAAmB"}
@@ -1,5 +1,5 @@
1
1
  import { t as blindCast } from "./casts-DpaahrlC-Bd5n2coI.mjs";
2
- import { c as createDataTypeLookup } from "./data-type-CVNHtd6y-BFa_VnCb.mjs";
2
+ import { c as createDataTypeLookup } from "./data-type-V6mcDhcG-DVQAPOQT.mjs";
3
3
  import { n as aggregateDescriptorKey } from "./generator-functions-CXbQfvYu-BIFU1Ryx.mjs";
4
4
  //#region ../../../1-framework/1-core/framework-components/dist/components.mjs
5
5
  /**
@@ -116,4 +116,4 @@ function createGeneratorHelpers(components) {
116
116
  //#endregion
117
117
  export { settleAggregateOverloads as n, createGeneratorHelpers as t };
118
118
 
119
- //# sourceMappingURL=components-C83PWIWw.mjs.map
119
+ //# sourceMappingURL=components-BaV9iCkq.mjs.map