typesea 0.1.0 → 0.2.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.
Files changed (285) hide show
  1. package/CHANGELOG.md +67 -6
  2. package/README.md +98 -17
  3. package/dist/adapters/index.d.ts +50 -8
  4. package/dist/adapters/index.d.ts.map +1 -1
  5. package/dist/adapters/index.js +169 -48
  6. package/dist/aot/index.d.ts +18 -2
  7. package/dist/aot/index.d.ts.map +1 -1
  8. package/dist/aot/index.js +93 -14
  9. package/dist/async/index.d.ts +28 -56
  10. package/dist/async/index.d.ts.map +1 -1
  11. package/dist/async/index.js +94 -37
  12. package/dist/builders/composite.d.ts +37 -6
  13. package/dist/builders/composite.d.ts.map +1 -1
  14. package/dist/builders/composite.js +84 -10
  15. package/dist/builders/index.d.ts +2 -0
  16. package/dist/builders/index.d.ts.map +1 -1
  17. package/dist/builders/index.js +2 -0
  18. package/dist/builders/modifier.d.ts +30 -5
  19. package/dist/builders/modifier.d.ts.map +1 -1
  20. package/dist/builders/modifier.js +38 -5
  21. package/dist/builders/object/guard.d.ts +18 -22
  22. package/dist/builders/object/guard.d.ts.map +1 -1
  23. package/dist/builders/object/guard.js +26 -26
  24. package/dist/builders/object/index.d.ts +2 -0
  25. package/dist/builders/object/index.d.ts.map +1 -1
  26. package/dist/builders/object/index.js +2 -0
  27. package/dist/builders/object/schema.d.ts +55 -9
  28. package/dist/builders/object/schema.d.ts.map +1 -1
  29. package/dist/builders/object/schema.js +92 -15
  30. package/dist/builders/object/types.d.ts +5 -31
  31. package/dist/builders/object/types.d.ts.map +1 -1
  32. package/dist/builders/object/types.js +2 -0
  33. package/dist/builders/scalar.d.ts +29 -8
  34. package/dist/builders/scalar.d.ts.map +1 -1
  35. package/dist/builders/scalar.js +33 -8
  36. package/dist/builders/table.d.ts +4 -0
  37. package/dist/builders/table.d.ts.map +1 -1
  38. package/dist/builders/table.js +4 -0
  39. package/dist/builders/types.d.ts +14 -4
  40. package/dist/builders/types.d.ts.map +1 -1
  41. package/dist/builders/types.js +2 -0
  42. package/dist/compile/check-composite.d.ts +22 -1
  43. package/dist/compile/check-composite.d.ts.map +1 -1
  44. package/dist/compile/check-composite.js +564 -24
  45. package/dist/compile/check-scalar.d.ts +78 -0
  46. package/dist/compile/check-scalar.d.ts.map +1 -1
  47. package/dist/compile/check-scalar.js +432 -1
  48. package/dist/compile/check.d.ts +12 -0
  49. package/dist/compile/check.d.ts.map +1 -1
  50. package/dist/compile/check.js +37 -0
  51. package/dist/compile/context.d.ts +47 -9
  52. package/dist/compile/context.d.ts.map +1 -1
  53. package/dist/compile/context.js +51 -8
  54. package/dist/compile/graph-predicate.d.ts +4 -2
  55. package/dist/compile/graph-predicate.d.ts.map +1 -1
  56. package/dist/compile/graph-predicate.js +1907 -171
  57. package/dist/compile/guard.d.ts +15 -24
  58. package/dist/compile/guard.d.ts.map +1 -1
  59. package/dist/compile/guard.js +158 -74
  60. package/dist/compile/index.d.ts +3 -1
  61. package/dist/compile/index.d.ts.map +1 -1
  62. package/dist/compile/index.js +2 -0
  63. package/dist/compile/issue.d.ts +110 -0
  64. package/dist/compile/issue.d.ts.map +1 -1
  65. package/dist/compile/issue.js +184 -1
  66. package/dist/compile/names.d.ts +12 -2
  67. package/dist/compile/names.d.ts.map +1 -1
  68. package/dist/compile/names.js +19 -3
  69. package/dist/compile/predicate.d.ts +24 -0
  70. package/dist/compile/predicate.d.ts.map +1 -1
  71. package/dist/compile/predicate.js +131 -5
  72. package/dist/compile/runtime.d.ts +80 -12
  73. package/dist/compile/runtime.d.ts.map +1 -1
  74. package/dist/compile/runtime.js +25 -6
  75. package/dist/compile/source.d.ts +10 -2
  76. package/dist/compile/source.d.ts.map +1 -1
  77. package/dist/compile/source.js +361 -26
  78. package/dist/compile/types.d.ts +20 -0
  79. package/dist/compile/types.d.ts.map +1 -1
  80. package/dist/compile/types.js +2 -0
  81. package/dist/decoder/index.d.ts +32 -46
  82. package/dist/decoder/index.d.ts.map +1 -1
  83. package/dist/decoder/index.js +102 -38
  84. package/dist/evaluate/check-composite.d.ts +59 -0
  85. package/dist/evaluate/check-composite.d.ts.map +1 -1
  86. package/dist/evaluate/check-composite.js +151 -3
  87. package/dist/evaluate/check-scalar.d.ts +16 -0
  88. package/dist/evaluate/check-scalar.d.ts.map +1 -1
  89. package/dist/evaluate/check-scalar.js +32 -0
  90. package/dist/evaluate/check.d.ts +7 -0
  91. package/dist/evaluate/check.d.ts.map +1 -1
  92. package/dist/evaluate/check.js +43 -0
  93. package/dist/evaluate/index.d.ts +2 -0
  94. package/dist/evaluate/index.d.ts.map +1 -1
  95. package/dist/evaluate/index.js +2 -0
  96. package/dist/evaluate/issue.d.ts +11 -1
  97. package/dist/evaluate/issue.d.ts.map +1 -1
  98. package/dist/evaluate/issue.js +15 -1
  99. package/dist/evaluate/predicate.d.ts +16 -5
  100. package/dist/evaluate/predicate.d.ts.map +1 -1
  101. package/dist/evaluate/predicate.js +20 -5
  102. package/dist/evaluate/shared.d.ts +59 -13
  103. package/dist/evaluate/shared.d.ts.map +1 -1
  104. package/dist/evaluate/shared.js +66 -8
  105. package/dist/evaluate/state.d.ts +35 -13
  106. package/dist/evaluate/state.d.ts.map +1 -1
  107. package/dist/evaluate/state.js +35 -2
  108. package/dist/guard/base.d.ts +79 -29
  109. package/dist/guard/base.d.ts.map +1 -1
  110. package/dist/guard/base.js +91 -29
  111. package/dist/guard/error.d.ts +10 -5
  112. package/dist/guard/error.d.ts.map +1 -1
  113. package/dist/guard/error.js +10 -5
  114. package/dist/guard/index.d.ts +2 -0
  115. package/dist/guard/index.d.ts.map +1 -1
  116. package/dist/guard/index.js +2 -0
  117. package/dist/guard/number.d.ts +26 -11
  118. package/dist/guard/number.d.ts.map +1 -1
  119. package/dist/guard/number.js +30 -11
  120. package/dist/guard/props.d.ts +27 -3
  121. package/dist/guard/props.d.ts.map +1 -1
  122. package/dist/guard/props.js +27 -3
  123. package/dist/guard/read.d.ts +62 -9
  124. package/dist/guard/read.d.ts.map +1 -1
  125. package/dist/guard/read.js +83 -10
  126. package/dist/guard/registry.d.ts +12 -2
  127. package/dist/guard/registry.d.ts.map +1 -1
  128. package/dist/guard/registry.js +15 -3
  129. package/dist/guard/string.d.ts +33 -13
  130. package/dist/guard/string.d.ts.map +1 -1
  131. package/dist/guard/string.js +37 -13
  132. package/dist/guard/types.d.ts +92 -40
  133. package/dist/guard/types.d.ts.map +1 -1
  134. package/dist/guard/types.js +2 -0
  135. package/dist/index.d.ts +1 -1
  136. package/dist/index.d.ts.map +1 -1
  137. package/dist/internal/index.d.ts +42 -6
  138. package/dist/internal/index.d.ts.map +1 -1
  139. package/dist/internal/index.js +51 -8
  140. package/dist/ir/builder.d.ts +16 -126
  141. package/dist/ir/builder.d.ts.map +1 -1
  142. package/dist/ir/builder.js +77 -137
  143. package/dist/ir/freeze.d.ts +4 -0
  144. package/dist/ir/freeze.d.ts.map +1 -1
  145. package/dist/ir/freeze.js +59 -0
  146. package/dist/ir/index.d.ts +3 -1
  147. package/dist/ir/index.d.ts.map +1 -1
  148. package/dist/ir/index.js +2 -0
  149. package/dist/ir/regexp.d.ts +2 -0
  150. package/dist/ir/regexp.d.ts.map +1 -1
  151. package/dist/ir/regexp.js +2 -0
  152. package/dist/ir/types.d.ts +90 -55
  153. package/dist/ir/types.d.ts.map +1 -1
  154. package/dist/ir/types.js +2 -0
  155. package/dist/ir/validate.d.ts +8 -1
  156. package/dist/ir/validate.d.ts.map +1 -1
  157. package/dist/ir/validate.js +477 -61
  158. package/dist/issue/index.d.ts +41 -9
  159. package/dist/issue/index.d.ts.map +1 -1
  160. package/dist/issue/index.js +61 -11
  161. package/dist/json-schema/emit-combinator.d.ts +44 -4
  162. package/dist/json-schema/emit-combinator.d.ts.map +1 -1
  163. package/dist/json-schema/emit-combinator.js +44 -4
  164. package/dist/json-schema/emit-composite.d.ts +10 -0
  165. package/dist/json-schema/emit-composite.d.ts.map +1 -1
  166. package/dist/json-schema/emit-composite.js +15 -1
  167. package/dist/json-schema/emit-scalar.d.ts +26 -3
  168. package/dist/json-schema/emit-scalar.d.ts.map +1 -1
  169. package/dist/json-schema/emit-scalar.js +70 -9
  170. package/dist/json-schema/emit-types.d.ts +11 -1
  171. package/dist/json-schema/emit-types.d.ts.map +1 -1
  172. package/dist/json-schema/emit-types.js +2 -0
  173. package/dist/json-schema/emit.d.ts +12 -1
  174. package/dist/json-schema/emit.d.ts.map +1 -1
  175. package/dist/json-schema/emit.js +12 -1
  176. package/dist/json-schema/freeze.d.ts +13 -2
  177. package/dist/json-schema/freeze.d.ts.map +1 -1
  178. package/dist/json-schema/freeze.js +41 -8
  179. package/dist/json-schema/index.d.ts +16 -2
  180. package/dist/json-schema/index.d.ts.map +1 -1
  181. package/dist/json-schema/index.js +23 -3
  182. package/dist/json-schema/issue.d.ts +4 -1
  183. package/dist/json-schema/issue.d.ts.map +1 -1
  184. package/dist/json-schema/issue.js +4 -1
  185. package/dist/json-schema/read.d.ts +24 -3
  186. package/dist/json-schema/read.d.ts.map +1 -1
  187. package/dist/json-schema/read.js +59 -12
  188. package/dist/json-schema/types.d.ts +38 -15
  189. package/dist/json-schema/types.d.ts.map +1 -1
  190. package/dist/json-schema/types.js +2 -0
  191. package/dist/kind/index.d.ts +15 -28
  192. package/dist/kind/index.d.ts.map +1 -1
  193. package/dist/kind/index.js +15 -10
  194. package/dist/lower/index.d.ts +6 -1
  195. package/dist/lower/index.d.ts.map +1 -1
  196. package/dist/lower/index.js +411 -44
  197. package/dist/message/index.d.ts +46 -10
  198. package/dist/message/index.d.ts.map +1 -1
  199. package/dist/message/index.js +88 -17
  200. package/dist/optimize/algebraic.d.ts +54 -0
  201. package/dist/optimize/algebraic.d.ts.map +1 -0
  202. package/dist/optimize/algebraic.js +314 -0
  203. package/dist/optimize/compact.d.ts +8 -1
  204. package/dist/optimize/compact.d.ts.map +1 -1
  205. package/dist/optimize/compact.js +13 -2
  206. package/dist/optimize/domain.d.ts +16 -0
  207. package/dist/optimize/domain.d.ts.map +1 -0
  208. package/dist/optimize/domain.js +615 -0
  209. package/dist/optimize/fold-boolean.d.ts +17 -2
  210. package/dist/optimize/fold-boolean.d.ts.map +1 -1
  211. package/dist/optimize/fold-boolean.js +59 -14
  212. package/dist/optimize/fold-common.d.ts +43 -8
  213. package/dist/optimize/fold-common.d.ts.map +1 -1
  214. package/dist/optimize/fold-common.js +37 -6
  215. package/dist/optimize/fold-constraints.d.ts +33 -0
  216. package/dist/optimize/fold-constraints.d.ts.map +1 -0
  217. package/dist/optimize/fold-constraints.js +484 -0
  218. package/dist/optimize/fold-scalar.d.ts +98 -13
  219. package/dist/optimize/fold-scalar.d.ts.map +1 -1
  220. package/dist/optimize/fold-scalar.js +98 -13
  221. package/dist/optimize/fold.d.ts +8 -1
  222. package/dist/optimize/fold.d.ts.map +1 -1
  223. package/dist/optimize/fold.js +22 -2
  224. package/dist/optimize/index.d.ts +9 -1
  225. package/dist/optimize/index.d.ts.map +1 -1
  226. package/dist/optimize/index.js +18 -3
  227. package/dist/optimize/map-node.d.ts +3 -1
  228. package/dist/optimize/map-node.d.ts.map +1 -1
  229. package/dist/optimize/map-node.js +45 -3
  230. package/dist/optimize/peephole.d.ts +16 -0
  231. package/dist/optimize/peephole.d.ts.map +1 -0
  232. package/dist/optimize/peephole.js +254 -0
  233. package/dist/optimize/remap.d.ts +2 -0
  234. package/dist/optimize/remap.d.ts.map +1 -1
  235. package/dist/optimize/remap.js +2 -0
  236. package/dist/optimize/rewrite.d.ts +13 -8
  237. package/dist/optimize/rewrite.d.ts.map +1 -1
  238. package/dist/optimize/rewrite.js +13 -8
  239. package/dist/plan/cache.d.ts +9 -3
  240. package/dist/plan/cache.d.ts.map +1 -1
  241. package/dist/plan/cache.js +21 -5
  242. package/dist/plan/index.d.ts +2 -0
  243. package/dist/plan/index.d.ts.map +1 -1
  244. package/dist/plan/index.js +2 -0
  245. package/dist/plan/predicate.d.ts +2 -0
  246. package/dist/plan/predicate.d.ts.map +1 -1
  247. package/dist/plan/predicate.js +268 -29
  248. package/dist/plan/schema-predicate.d.ts +6 -0
  249. package/dist/plan/schema-predicate.d.ts.map +1 -1
  250. package/dist/plan/schema-predicate.js +117 -13
  251. package/dist/plan/types.d.ts +2 -0
  252. package/dist/plan/types.d.ts.map +1 -1
  253. package/dist/plan/types.js +2 -0
  254. package/dist/result/index.d.ts +19 -5
  255. package/dist/result/index.d.ts.map +1 -1
  256. package/dist/result/index.js +10 -2
  257. package/dist/schema/common.d.ts +69 -6
  258. package/dist/schema/common.d.ts.map +1 -1
  259. package/dist/schema/common.js +104 -10
  260. package/dist/schema/freeze.d.ts +4 -0
  261. package/dist/schema/freeze.d.ts.map +1 -1
  262. package/dist/schema/freeze.js +18 -0
  263. package/dist/schema/index.d.ts +3 -0
  264. package/dist/schema/index.d.ts.map +1 -1
  265. package/dist/schema/index.js +3 -0
  266. package/dist/schema/lazy.d.ts +4 -0
  267. package/dist/schema/lazy.d.ts.map +1 -1
  268. package/dist/schema/lazy.js +4 -0
  269. package/dist/schema/literal.d.ts +7 -1
  270. package/dist/schema/literal.d.ts.map +1 -1
  271. package/dist/schema/literal.js +7 -1
  272. package/dist/schema/types.d.ts +20 -96
  273. package/dist/schema/types.d.ts.map +1 -1
  274. package/dist/schema/types.js +5 -1
  275. package/dist/schema/undefined.d.ts +17 -0
  276. package/dist/schema/undefined.d.ts.map +1 -0
  277. package/dist/schema/undefined.js +72 -0
  278. package/dist/schema/validate.d.ts +8 -1
  279. package/dist/schema/validate.d.ts.map +1 -1
  280. package/dist/schema/validate.js +146 -55
  281. package/docs/api.md +57 -0
  282. package/docs/assets/benchmark-headline.svg +163 -0
  283. package/docs/engine-notes.md +58 -15
  284. package/docs/index.html +130 -110
  285. package/package.json +65 -65
@@ -1,8 +1,14 @@
1
- import { NumberCheckTag, ObjectModeTag, PresenceTag, SchemaTag, StringCheckTag } from "../kind/index.js";
1
+ import { NumberCheckTag, PresenceTag, SchemaTag, StringCheckTag } from "../kind/index.js";
2
2
  import { GraphBuilder } from "../ir/index.js";
3
+ import { optimizeGraph } from "../optimize/index.js";
3
4
  import { UUID_PATTERN } from "../schema/index.js";
4
5
  /**
5
- * @brief lower schema.
6
+ * @brief Convert one schema root into a Sea-of-Nodes predicate graph.
7
+ * @details The graph always starts with a single input parameter and ends in a
8
+ * boolean return node. Keeping that calling convention uniform lets optimizer,
9
+ * interpreter, compiler, and AOT code consume the same IR shape.
10
+ * @param schema Root schema to lower into predicate IR.
11
+ * @returns Graph with one parameter and one return node.
6
12
  */
7
13
  export function lowerSchema(schema) {
8
14
  const builder = new GraphBuilder();
@@ -13,7 +19,14 @@ export function lowerSchema(schema) {
13
19
  return builder.finish(entry, ret);
14
20
  }
15
21
  /**
16
- * @brief lower predicate.
22
+ * @brief Lower one schema node into a boolean-producing IR node.
23
+ * @details Static schemas become explicit graph operations so later passes can
24
+ * fold, reorder, or specialize them. Dynamic schemas stay behind SchemaCheck
25
+ * nodes because their semantics require runtime callbacks or lazy resolution.
26
+ * @param builder Graph builder owning the current graph.
27
+ * @param schema Schema node to lower.
28
+ * @param value Node id that produces the candidate value.
29
+ * @returns Node id for the boolean predicate result.
17
30
  */
18
31
  function lowerPredicate(builder, schema, value) {
19
32
  switch (schema.tag) {
@@ -34,19 +47,24 @@ function lowerPredicate(builder, schema, value) {
34
47
  case SchemaTag.Literal:
35
48
  return builder.equals(value, builder.constant(schema.value));
36
49
  case SchemaTag.Array:
50
+ /*
51
+ * Container checks stay as explicit siblings of iteration nodes. The
52
+ * domain pass can later remove redundant guards when iteration already
53
+ * proves the same container type.
54
+ */
37
55
  return builder.and([
38
56
  builder.isArray(value),
39
- builder.arrayEvery(value, schema.item)
57
+ builder.arrayEvery(value, schema.item, lowerChildGraph(schema.item))
40
58
  ]);
41
59
  case SchemaTag.Tuple:
42
60
  return builder.and([
43
61
  builder.isArray(value),
44
- builder.tupleItems(value, schema.items)
62
+ builder.tupleItems(value, schema.items, lowerChildGraphs(schema.items))
45
63
  ]);
46
64
  case SchemaTag.Record:
47
65
  return builder.and([
48
66
  builder.isObject(value),
49
- builder.recordEvery(value, schema.value)
67
+ builder.recordEvery(value, schema.value, lowerChildGraph(schema.value))
50
68
  ]);
51
69
  case SchemaTag.Object:
52
70
  return lowerObject(builder, schema, value);
@@ -74,15 +92,31 @@ function lowerPredicate(builder, schema, value) {
74
92
  return lowerPredicate(builder, schema.inner, value);
75
93
  case SchemaTag.Lazy:
76
94
  case SchemaTag.Refine:
95
+ /*
96
+ * Lazy resolution and user predicates are represented as opaque schema
97
+ * checks. Lowering keeps the graph pure and lets runtime evaluation
98
+ * decide those dynamic cases.
99
+ */
77
100
  return builder.schemaCheck(value, schema);
78
101
  }
79
102
  }
80
103
  /**
81
- * @brief lower string.
104
+ * @brief Lower a string schema into independent scalar predicate nodes.
105
+ * @details The base string check and each constraint remain separate in the IR
106
+ * so algebraic and constraint passes can remove redundant bounds without
107
+ * re-parsing the source schema.
108
+ * @param builder Graph builder owning the current graph.
109
+ * @param schema String schema with scalar checks.
110
+ * @param value Node id that produces the candidate value.
111
+ * @returns Node id for the combined string predicate.
82
112
  */
83
113
  function lowerString(builder, schema, value) {
84
114
  const tests = [builder.isString(value)];
85
115
  const checks = schema.checks;
116
+ /*
117
+ * String constraints are represented as independent nodes. Later algebraic
118
+ * and domain passes can fold impossible or redundant checks.
119
+ */
86
120
  for (let index = 0; index < checks.length; index += 1) {
87
121
  const check = checks[index];
88
122
  if (check === undefined) {
@@ -106,7 +140,14 @@ function lowerString(builder, schema, value) {
106
140
  return builder.and(tests);
107
141
  }
108
142
  /**
109
- * @brief lower number.
143
+ * @brief Lower a number schema into numeric predicate nodes.
144
+ * @details Bounds are represented as comparisons against Const nodes. That
145
+ * gives constant folding one canonical place to intern literal limits and gives
146
+ * constraint folding clean min/max facts.
147
+ * @param builder Graph builder owning the current graph.
148
+ * @param schema Number schema with scalar checks.
149
+ * @param value Node id that produces the candidate value.
150
+ * @returns Node id for the combined number predicate.
110
151
  */
111
152
  function lowerNumber(builder, schema, value) {
112
153
  const tests = [builder.isNumber(value)];
@@ -131,59 +172,280 @@ function lowerNumber(builder, schema, value) {
131
172
  return builder.and(tests);
132
173
  }
133
174
  /**
134
- * @brief lower object.
175
+ * @brief Lower an object schema into one structured shape node.
176
+ * @details Object validation keeps key order, strict-mode metadata, and child
177
+ * graphs together. Codegen can then emit one object-shaped fast path instead of
178
+ * rediscovering shape facts from generic boolean nodes.
179
+ * @param builder Graph builder owning the current graph.
180
+ * @param schema Object schema with shape metadata.
181
+ * @param value Node id that produces the candidate value.
182
+ * @returns Node id for the object-shape predicate.
135
183
  */
136
184
  function lowerObject(builder, schema, value) {
137
- const entries = schema.entries;
138
- const tests = [builder.isObject(value)];
185
+ return builder.objectShape(value, lowerObjectShapeEntries(schema.entries), schema.keys, schema.mode);
186
+ }
187
+ /**
188
+ * @brief Lower and optimize a child schema before embedding it in a parent node.
189
+ * @details Composite nodes store child graphs by value. Optimizing them at
190
+ * construction time keeps array, tuple, record, object, and union codegen from
191
+ * carrying avoidable dead nodes in every embedded child.
192
+ * @param schema Child schema to lower.
193
+ * @returns Optimized child graph suitable for dispatch or iteration nodes.
194
+ */
195
+ function lowerChildGraph(schema) {
196
+ /*
197
+ * Child graphs are optimized immediately because they are embedded into
198
+ * dispatch and iteration nodes. Smaller child graphs make later codegen
199
+ * and graph introspection cheaper.
200
+ */
201
+ return optimizeGraph(lowerSchema(schema));
202
+ }
203
+ /**
204
+ * @brief Lower a schema vector into index-aligned child graphs.
205
+ * @details Undefined holes are preserved so union and tuple branch indexes
206
+ * remain stable for diagnostics and generated dispatch tables.
207
+ * @param schemas Closed schema list.
208
+ * @returns Child graph list preserving source indexes.
209
+ */
210
+ function lowerChildGraphs(schemas) {
211
+ const graphs = new Array(schemas.length);
212
+ for (let index = 0; index < schemas.length; index += 1) {
213
+ const schema = schemas[index];
214
+ if (schema !== undefined) {
215
+ graphs[index] = lowerChildGraph(schema);
216
+ }
217
+ }
218
+ return graphs;
219
+ }
220
+ /**
221
+ * @brief Lower object entries into IR entries with optimized child graphs.
222
+ * @details The IR keeps the original schema beside each child graph so
223
+ * diagnostics and dynamic fallback paths can still recover schema-level detail.
224
+ * @param entries Object schema entries.
225
+ * @returns IR object-shape entries with optimized child graphs.
226
+ */
227
+ function lowerObjectShapeEntries(entries) {
228
+ const lowered = new Array(entries.length);
139
229
  for (let index = 0; index < entries.length; index += 1) {
140
230
  const entry = entries[index];
141
- if (entry === undefined) {
142
- continue;
231
+ if (entry !== undefined) {
232
+ lowered[index] = {
233
+ key: entry.key,
234
+ schema: entry.schema,
235
+ graph: lowerChildGraph(entry.schema),
236
+ presence: entry.presence
237
+ };
143
238
  }
144
- const prop = builder.getProp(value, entry.key);
145
- const propTest = lowerPredicate(builder, entry.schema, prop);
146
- const hasData = builder.hasOwnData(value, entry.key);
147
- if (entry.presence === PresenceTag.Optional) {
148
- const hasKey = builder.hasOwn(value, entry.key);
149
- tests.push(builder.or([
150
- builder.not(hasKey),
151
- builder.and([hasData, propTest])
152
- ]));
239
+ }
240
+ return lowered;
241
+ }
242
+ /**
243
+ * @brief Select the most specific IR shape for a union schema.
244
+ * @details The lowering order is intentional: literal object discriminants are
245
+ * most precise, primitive-only masks are cheapest for scalar unions, and the
246
+ * general dispatch node preserves behavior for mixed or opaque branches.
247
+ * @param builder Graph builder owning the current graph.
248
+ * @param options Union option schemas.
249
+ * @param value Node id that produces the candidate value.
250
+ * @returns Node id for the selected union lowering strategy.
251
+ */
252
+ function lowerUnion(builder, options, value) {
253
+ const discriminant = inferObjectUnionDiscriminant(options);
254
+ if (discriminant !== undefined) {
255
+ /*
256
+ * Object unions with a common required string literal key can dispatch by
257
+ * one property read instead of probing every branch.
258
+ */
259
+ return builder.discriminantDispatch(value, discriminant.key, discriminant.literals, options, lowerChildGraphs(options));
260
+ }
261
+ if (isPrimitiveUnionOptions(options)) {
262
+ /*
263
+ * Primitive-only unions lower to a compact mask dispatch so codegen can
264
+ * group arms by typeof result.
265
+ */
266
+ return builder.primitiveUnion(value, lowerChildGraphs(options), lowerUnionMasks(options));
267
+ }
268
+ return builder.unionDispatch(value, options, lowerChildGraphs(options), lowerUnionMasks(options));
269
+ }
270
+ /**
271
+ * @brief Bit positions used to summarize possible union root domains.
272
+ * @details Masks let lowering and codegen skip branches whose root JavaScript
273
+ * kind is impossible for the candidate value.
274
+ */
275
+ const UnionMask = {
276
+ None: 0,
277
+ String: 1 << 0,
278
+ Number: 1 << 1,
279
+ Boolean: 1 << 2,
280
+ BigInt: 1 << 3,
281
+ Symbol: 1 << 4,
282
+ Undefined: 1 << 5,
283
+ Null: 1 << 6,
284
+ Array: 1 << 7,
285
+ Object: 1 << 8,
286
+ Function: 1 << 9,
287
+ Any: (1 << 10) - 1
288
+ };
289
+ /**
290
+ * @brief Mask containing only domains accepted by primitive-union dispatch.
291
+ * @details Object and array domains are excluded because they need descriptor,
292
+ * key, or child graph handling that primitive dispatch deliberately avoids.
293
+ */
294
+ const PrimitiveUnionMask = UnionMask.String |
295
+ UnionMask.Number |
296
+ UnionMask.Boolean |
297
+ UnionMask.BigInt |
298
+ UnionMask.Symbol |
299
+ UnionMask.Undefined |
300
+ UnionMask.Null;
301
+ /**
302
+ * @brief Decide whether a union can use primitive-domain dispatch.
303
+ * @details The generated graph can replace ordered branch probing with a small
304
+ * domain mask only when every reachable option is primitive-shaped. Empty
305
+ * unions are rejected here so the caller does not emit a vacuous dispatcher.
306
+ * @param options Union option schemas in public declaration order.
307
+ * @returns True when every reachable option has a primitive-only mask.
308
+ */
309
+ function isPrimitiveUnionOptions(options) {
310
+ let sawReachable = false;
311
+ for (let index = 0; index < options.length; index += 1) {
312
+ const option = options[index];
313
+ const mask = option === undefined ? UnionMask.None : schemaUnionMask(option);
314
+ if (mask === UnionMask.None) {
315
+ continue;
153
316
  }
154
- else {
155
- tests.push(hasData);
156
- tests.push(propTest);
317
+ if ((mask & ~PrimitiveUnionMask) !== 0) {
318
+ return false;
157
319
  }
320
+ sawReachable = true;
158
321
  }
159
- if (schema.mode === ObjectModeTag.Strict) {
160
- const keys = new Array(entries.length);
161
- for (let index = 0; index < entries.length; index += 1) {
162
- const entry = entries[index];
163
- if (entry !== undefined) {
164
- keys[index] = entry.key;
165
- }
166
- }
167
- tests.push(builder.strictKeys(value, keys));
322
+ return sawReachable;
323
+ }
324
+ /**
325
+ * @brief Compute root-domain masks for every union option.
326
+ * @details The returned array is index-aligned with the source options so
327
+ * generated dispatch can keep branch order while cheaply rejecting impossible
328
+ * arms by runtime kind.
329
+ * @param options Union option schemas.
330
+ * @returns Primitive-domain mask per union option.
331
+ */
332
+ function lowerUnionMasks(options) {
333
+ const masks = new Array(options.length);
334
+ for (let index = 0; index < options.length; index += 1) {
335
+ const option = options[index];
336
+ masks[index] = option === undefined ? UnionMask.None : schemaUnionMask(option);
168
337
  }
169
- return builder.and(tests);
338
+ return masks;
170
339
  }
171
340
  /**
172
- * @brief lower union.
341
+ * @brief Approximate the possible root runtime domains for a schema.
342
+ * @details The mask is intentionally conservative. Static scalar and container
343
+ * schemas narrow to precise domains, while lazy and refinement schemas widen to
344
+ * the full mask because their behavior is not known during lowering.
345
+ * @param schema Schema whose possible runtime domain is needed.
346
+ * @returns Bit mask describing the schema's possible runtime domains.
173
347
  */
174
- function lowerUnion(builder, options, value) {
175
- const tests = [];
348
+ function schemaUnionMask(schema) {
349
+ switch (schema.tag) {
350
+ case SchemaTag.Unknown:
351
+ return UnionMask.Any;
352
+ case SchemaTag.Never:
353
+ return UnionMask.None;
354
+ case SchemaTag.String:
355
+ return UnionMask.String;
356
+ case SchemaTag.Number:
357
+ return UnionMask.Number;
358
+ case SchemaTag.BigInt:
359
+ return UnionMask.BigInt;
360
+ case SchemaTag.Symbol:
361
+ return UnionMask.Symbol;
362
+ case SchemaTag.Boolean:
363
+ return UnionMask.Boolean;
364
+ case SchemaTag.Literal:
365
+ return literalUnionMask(schema.value);
366
+ case SchemaTag.Array:
367
+ case SchemaTag.Tuple:
368
+ return UnionMask.Array;
369
+ case SchemaTag.Object:
370
+ case SchemaTag.Record:
371
+ case SchemaTag.DiscriminatedUnion:
372
+ return UnionMask.Object;
373
+ case SchemaTag.Optional:
374
+ case SchemaTag.Undefinedable:
375
+ return UnionMask.Undefined | schemaUnionMask(schema.inner);
376
+ case SchemaTag.Nullable:
377
+ return UnionMask.Null | schemaUnionMask(schema.inner);
378
+ case SchemaTag.Brand:
379
+ return schemaUnionMask(schema.inner);
380
+ case SchemaTag.Intersection:
381
+ /*
382
+ * Intersections accept values accepted by both sides, so their
383
+ * possible runtime domain is the bitwise intersection of both masks.
384
+ */
385
+ return schemaUnionMask(schema.left) & schemaUnionMask(schema.right);
386
+ case SchemaTag.Union:
387
+ return unionOptionsMask(schema.options);
388
+ case SchemaTag.Lazy:
389
+ case SchemaTag.Refine:
390
+ return UnionMask.Any;
391
+ }
392
+ }
393
+ /**
394
+ * @brief Merge root-domain masks for a union option vector.
395
+ * @details This summary feeds recursive mask analysis for nested unions without
396
+ * expanding branch graphs during a simple domain query.
397
+ * @param options Union option schemas.
398
+ * @returns Bitwise union of all option masks.
399
+ */
400
+ function unionOptionsMask(options) {
401
+ let mask = UnionMask.None;
176
402
  for (let index = 0; index < options.length; index += 1) {
177
403
  const option = options[index];
178
- if (option === undefined) {
179
- continue;
404
+ if (option !== undefined) {
405
+ mask |= schemaUnionMask(option);
180
406
  }
181
- tests.push(lowerPredicate(builder, option, value));
182
407
  }
183
- return builder.or(tests);
408
+ return mask;
184
409
  }
185
410
  /**
186
- * @brief lower discriminated union.
411
+ * @brief Map a literal value to the matching root-domain bit.
412
+ * @details Literal schemas participate in union dispatch by their JavaScript
413
+ * runtime kind. Object literals are not supported by TypeSea literal schemas and
414
+ * therefore fall back to the empty mask.
415
+ * @param value Literal value from a literal schema.
416
+ * @returns Domain bit for the literal's runtime type.
417
+ */
418
+ function literalUnionMask(value) {
419
+ if (value === null) {
420
+ return UnionMask.Null;
421
+ }
422
+ switch (typeof value) {
423
+ case "string":
424
+ return UnionMask.String;
425
+ case "number":
426
+ return UnionMask.Number;
427
+ case "boolean":
428
+ return UnionMask.Boolean;
429
+ case "bigint":
430
+ return UnionMask.BigInt;
431
+ case "symbol":
432
+ return UnionMask.Symbol;
433
+ case "undefined":
434
+ return UnionMask.Undefined;
435
+ default:
436
+ return UnionMask.None;
437
+ }
438
+ }
439
+ /**
440
+ * @brief Lower an explicit discriminated union into table dispatch IR.
441
+ * @details Builder validation already proved that every branch requires its
442
+ * literal tag. Lowering can therefore store the literal table directly and let
443
+ * codegen emit a single property read plus branch selection.
444
+ * @param builder Graph builder owning the current graph.
445
+ * @param key Discriminant property name.
446
+ * @param cases Closed discriminated union cases.
447
+ * @param value Node id that produces the candidate value.
448
+ * @returns Node id for discriminant dispatch.
187
449
  */
188
450
  function lowerDiscriminatedUnion(builder, key, cases, value) {
189
451
  const literals = new Array(cases.length);
@@ -195,5 +457,110 @@ function lowerDiscriminatedUnion(builder, key, cases, value) {
195
457
  schemas[index] = unionCase.schema;
196
458
  }
197
459
  }
198
- return builder.discriminantDispatch(value, key, literals, schemas);
460
+ return builder.discriminantDispatch(value, key, literals, schemas, lowerChildGraphs(schemas));
461
+ }
462
+ /**
463
+ * @brief Search a plain object union for an implicit discriminant key.
464
+ * @details Only required string literal fields from the first branch are
465
+ * candidates. Every other branch must prove the same key with a unique literal
466
+ * before the union can use table dispatch.
467
+ * @param options Union option schemas.
468
+ * @returns Shared discriminant key and literals, or undefined when not provable.
469
+ */
470
+ function inferObjectUnionDiscriminant(options) {
471
+ if (options.length < 2) {
472
+ return undefined;
473
+ }
474
+ const first = options[0];
475
+ if (first?.tag !== SchemaTag.Object) {
476
+ return undefined;
477
+ }
478
+ const entries = first.entries;
479
+ for (let entryIndex = 0; entryIndex < entries.length; entryIndex += 1) {
480
+ const entry = entries[entryIndex];
481
+ if (entry === undefined) {
482
+ continue;
483
+ }
484
+ const firstLiteral = readRequiredStringLiteral(entry);
485
+ if (firstLiteral === undefined) {
486
+ continue;
487
+ }
488
+ /*
489
+ * Only keys already required by the first option are candidates. Every
490
+ * other option must carry a unique required string literal for that key.
491
+ */
492
+ const literals = readObjectUnionDiscriminantLiterals(options, entry.key);
493
+ if (literals !== undefined) {
494
+ return {
495
+ key: entry.key,
496
+ literals
497
+ };
498
+ }
499
+ }
500
+ return undefined;
501
+ }
502
+ /**
503
+ * @brief Build the literal dispatch table for an inferred object union.
504
+ * @details The table is usable only when each branch owns the candidate key,
505
+ * requires it, and binds it to a unique string literal. Repeated or missing
506
+ * literals make branch selection ambiguous, so this helper returns undefined
507
+ * and the lowerer keeps the general union path.
508
+ * @param options Union option schemas in branch order.
509
+ * @param key Candidate discriminant key shared by the branches.
510
+ * @returns Literal table when every option has a unique required string literal.
511
+ */
512
+ function readObjectUnionDiscriminantLiterals(options, key) {
513
+ const literals = new Array(options.length);
514
+ const seen = new Set();
515
+ for (let index = 0; index < options.length; index += 1) {
516
+ const option = options[index];
517
+ if (option?.tag !== SchemaTag.Object) {
518
+ return undefined;
519
+ }
520
+ const literal = readObjectDiscriminantLiteral(option, key);
521
+ if (literal === undefined || seen.has(literal)) {
522
+ /*
523
+ * Missing or repeated literals make direct dispatch ambiguous, so the
524
+ * union must fall back to general branch probing.
525
+ */
526
+ return undefined;
527
+ }
528
+ seen.add(literal);
529
+ literals[index] = literal;
530
+ }
531
+ return literals;
532
+ }
533
+ /**
534
+ * @brief Locate the required string literal carried by one object branch.
535
+ * @details Optional and wrapped non-literal fields are rejected because direct
536
+ * dispatch must prove that accepting the branch also proves the tag value.
537
+ * @param schema Object schema to inspect.
538
+ * @param key Candidate discriminant key.
539
+ * @returns Required string literal value for the key, or undefined.
540
+ */
541
+ function readObjectDiscriminantLiteral(schema, key) {
542
+ const entries = schema.entries;
543
+ for (let index = 0; index < entries.length; index += 1) {
544
+ const entry = entries[index];
545
+ if (entry?.key === key) {
546
+ return readRequiredStringLiteral(entry);
547
+ }
548
+ }
549
+ return undefined;
550
+ }
551
+ /**
552
+ * @brief Prove that an object entry is a required string literal tag.
553
+ * @details The discriminant optimizer deliberately refuses optional,
554
+ * undefinedable, or refined tags. Those forms may still validate correctly, but
555
+ * they do not provide a branch-selection proof before child validation runs.
556
+ * @param entry Object entry to inspect.
557
+ * @returns Literal string when the entry is required and exactly string-literal.
558
+ */
559
+ function readRequiredStringLiteral(entry) {
560
+ if (entry.presence !== PresenceTag.Required ||
561
+ entry.schema.tag !== SchemaTag.Literal ||
562
+ typeof entry.schema.value !== "string") {
563
+ return undefined;
564
+ }
565
+ return entry.schema.value;
199
566
  }
@@ -1,10 +1,14 @@
1
1
  import { type CheckResult, type Issue, type IssueCode, type PathSegment } from "../issue/index.js";
2
2
  /**
3
- * @brief message locale.
3
+ * @brief Built-in locale identifiers accepted by the message renderer.
4
+ * @details Message helpers keep structured issues separate from human-readable formatting
5
+ * until callers request text.
4
6
  */
5
7
  export type MessageLocale = "en" | "ko";
6
8
  /**
7
- * @brief issue message context.
9
+ * @brief Render-time fields exposed to message templates.
10
+ * @details The context is deliberately string-only so user formatters never
11
+ * depend on internal issue object layout beyond the documented fields.
8
12
  */
9
13
  export interface IssueMessageContext {
10
14
  readonly path: string;
@@ -13,19 +17,31 @@ export interface IssueMessageContext {
13
17
  readonly actual: string;
14
18
  }
15
19
  /**
16
- * @brief issue message formatter.
20
+ * @brief User supplied issue formatter callback.
21
+ * @details Message helpers keep structured issues separate from human-readable formatting
22
+ * until callers request text.
23
+ * @param issue Frozen issue being rendered.
24
+ * @param context Preformatted string fields for template authors.
25
+ * @returns Final message text for that issue.
17
26
  */
18
27
  export type IssueMessageFormatter = (issue: Issue, context: IssueMessageContext) => string;
19
28
  /**
20
- * @brief issue message template.
29
+ * @brief Message template accepted by a locale catalog.
30
+ * @details String templates use `{path}`, `{code}`, `{expected}`, and
31
+ * `{actual}` replacement tokens. Function templates are checked at runtime so
32
+ * incorrect user callbacks fail at the API boundary.
21
33
  */
22
34
  export type IssueMessageTemplate = string | IssueMessageFormatter;
23
35
  /**
24
- * @brief issue message catalog.
36
+ * @brief Partial mapping from TypeSea issue codes to render templates.
37
+ * @details Message helpers keep structured issues separate from human-readable formatting
38
+ * until callers request text.
25
39
  */
26
40
  export type IssueMessageCatalog = Partial<Readonly<Record<IssueCode, IssueMessageTemplate>>>;
27
41
  /**
28
- * @brief issue message options.
42
+ * @brief Optional message rendering configuration supplied by callers.
43
+ * @details Every field is optional at the API edge; `readOptions` normalizes
44
+ * this shape into a fully populated internal configuration.
29
45
  */
30
46
  export interface IssueMessageOptions {
31
47
  readonly locale: MessageLocale | undefined;
@@ -33,19 +49,39 @@ export interface IssueMessageOptions {
33
49
  readonly pathFormatter: ((path: readonly PathSegment[]) => string) | undefined;
34
50
  }
35
51
  /**
36
- * @brief define messages.
52
+ * @brief Freeze a user catalog after validating its keys and templates.
53
+ * @details Message helpers keep structured issues separate from human-readable formatting
54
+ * until callers request text.
55
+ * @param catalog Partial message catalog supplied by the application.
56
+ * @returns Frozen catalog that can be reused across validations.
37
57
  */
38
58
  export declare function defineMessages(catalog: IssueMessageCatalog): IssueMessageCatalog;
39
59
  /**
40
- * @brief format issue.
60
+ * @brief Render one issue into a localized human-readable message.
61
+ * @details The issue is copied before rendering so user callbacks cannot mutate
62
+ * shared diagnostic objects through accidental aliasing.
63
+ * @param issue Issue object to render.
64
+ * @param options Optional locale, catalog, and path formatter.
65
+ * @returns Rendered message text.
41
66
  */
42
67
  export declare function formatIssue(issue: Issue, options?: Partial<IssueMessageOptions>): string;
43
68
  /**
44
- * @brief format issues.
69
+ * @brief Render a frozen list of issues into localized message strings.
70
+ * @details The issue array is copied before rendering so caller-owned issue
71
+ * objects cannot change while user path formatters or templates execute.
72
+ * @param issues Issue list to render.
73
+ * @param options Optional locale, catalog, and path formatter.
74
+ * @returns Frozen list of rendered messages aligned with the input issue order.
45
75
  */
46
76
  export declare function formatIssues(issues: readonly Issue[], options?: Partial<IssueMessageOptions>): readonly string[];
47
77
  /**
48
- * @brief with messages.
78
+ * @brief Attach rendered messages to every issue in a failed check result.
79
+ * @details Successful results are returned unchanged. Failed results are copied
80
+ * into fresh issue objects so structured diagnostics keep their original fields
81
+ * while gaining a stable human-readable message.
82
+ * @param result Check result to decorate.
83
+ * @param options Optional locale, catalog, and path formatter.
84
+ * @returns Original success result or a failed result with rendered messages.
49
85
  */
50
86
  export declare function withMessages<TValue>(result: CheckResult<TValue>, options?: Partial<IssueMessageOptions>): CheckResult<TValue>;
51
87
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/message/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAC;AAG3B;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,IAAI,CAAC;AAExC;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAClC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,mBAAmB,KACzB,MAAM,CAAC;AAEZ;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,qBAAqB,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,CACvC,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC,CAClD,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,OAAO,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAClD,QAAQ,CAAC,aAAa,EAClB,CAAC,CAAC,IAAI,EAAE,SAAS,WAAW,EAAE,KAAK,MAAM,CAAC,GAC1C,SAAS,CAAC;CACf;AAWD;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,mBAAmB,GAAG,mBAAmB,CAEhF;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,KAAK,EACZ,OAAO,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GACrC,MAAM,CAOR;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,SAAS,KAAK,EAAE,EACxB,OAAO,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GACrC,SAAS,MAAM,EAAE,CAWnB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EACjC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,EAC3B,OAAO,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GACrC,WAAW,CAAC,MAAM,CAAC,CAoBrB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/message/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,WAAW,EACnB,MAAM,mBAAmB,CAAC;AAG3B;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,IAAI,CAAC;AAExC;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAChC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,mBAAmB,KAC3B,MAAM,CAAC;AAEZ;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,qBAAqB,CAAC;AAElE;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,CACrC,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC,CACpD,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAChC,QAAQ,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,OAAO,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAClD,QAAQ,CAAC,aAAa,EAChB,CAAC,CAAC,IAAI,EAAE,SAAS,WAAW,EAAE,KAAK,MAAM,CAAC,GAC1C,SAAS,CAAC;CACnB;AAaD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,mBAAmB,GAAG,mBAAmB,CAEhF;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACvB,KAAK,EAAE,KAAK,EACZ,OAAO,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GACvC,MAAM,CAOR;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CACxB,MAAM,EAAE,SAAS,KAAK,EAAE,EACxB,OAAO,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GACvC,SAAS,MAAM,EAAE,CAWnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAC/B,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,EAC3B,OAAO,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GACvC,WAAW,CAAC,MAAM,CAAC,CAoBrB"}