arktype 3.0.0-beta.1 → 3.0.0-rc.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 (312) hide show
  1. package/README.md +48 -144
  2. package/out/_internal/regex/charset.d.ts +24 -0
  3. package/out/_internal/regex/escape.d.ts +29 -0
  4. package/out/_internal/regex/execArray.d.ts +24 -0
  5. package/out/_internal/regex/group.d.ts +34 -0
  6. package/out/_internal/regex/index.d.ts +2 -0
  7. package/out/_internal/regex/internal.d.ts +9 -0
  8. package/out/_internal/regex/parse.d.ts +10 -0
  9. package/out/_internal/regex/quantify.d.ts +59 -0
  10. package/out/_internal/regex/regex.d.ts +38 -0
  11. package/out/_internal/regex/state.d.ts +383 -0
  12. package/out/_internal/schema/codecs.d.ts +2 -0
  13. package/out/_internal/schema/config.d.ts +103 -0
  14. package/out/_internal/schema/constraint.d.ts +78 -0
  15. package/out/_internal/schema/errors.d.ts +1 -0
  16. package/out/_internal/schema/generic.d.ts +85 -0
  17. package/out/_internal/schema/i18n.d.ts +3 -0
  18. package/out/_internal/schema/index.d.ts +54 -0
  19. package/out/_internal/schema/internal.d.ts +15 -0
  20. package/out/_internal/schema/intrinsic.d.ts +28 -0
  21. package/out/_internal/schema/kinds.d.ts +76 -0
  22. package/out/_internal/schema/module.d.ts +23 -0
  23. package/out/_internal/schema/mutatesInput.d.ts +2 -0
  24. package/out/_internal/schema/node.d.ts +349 -0
  25. package/out/_internal/schema/parse.d.ts +77 -0
  26. package/out/_internal/schema/parseSchema.d.ts +116 -0
  27. package/out/_internal/schema/predicate.d.ts +46 -0
  28. package/out/_internal/schema/refinements/after.d.ts +32 -0
  29. package/out/_internal/schema/refinements/before.d.ts +32 -0
  30. package/out/_internal/schema/refinements/divisor.d.ts +41 -0
  31. package/out/_internal/schema/refinements/exactLength.d.ts +43 -0
  32. package/out/_internal/schema/refinements/kinds.d.ts +40 -0
  33. package/out/_internal/schema/refinements/max.d.ts +33 -0
  34. package/out/_internal/schema/refinements/maxLength.d.ts +32 -0
  35. package/out/_internal/schema/refinements/min.d.ts +33 -0
  36. package/out/_internal/schema/refinements/minLength.d.ts +32 -0
  37. package/out/_internal/schema/refinements/notEqual.d.ts +38 -0
  38. package/out/_internal/schema/refinements/notEqualLength.d.ts +38 -0
  39. package/out/_internal/schema/refinements/pattern.d.ts +43 -0
  40. package/out/_internal/schema/refinements/range.d.ts +101 -0
  41. package/out/_internal/schema/roots/alias.d.ts +49 -0
  42. package/out/_internal/schema/roots/basis.d.ts +12 -0
  43. package/out/_internal/schema/roots/domain.d.ts +45 -0
  44. package/out/_internal/schema/roots/intersection.d.ts +72 -0
  45. package/out/_internal/schema/roots/morph.d.ts +59 -0
  46. package/out/_internal/schema/roots/proto.d.ts +42 -0
  47. package/out/_internal/schema/roots/root.d.ts +163 -0
  48. package/out/_internal/schema/roots/union.d.ts +146 -0
  49. package/out/_internal/schema/roots/unit.d.ts +36 -0
  50. package/out/_internal/schema/runtime.d.ts +29 -0
  51. package/out/_internal/schema/runtimeLean.d.ts +2 -0
  52. package/out/_internal/schema/runtimeNone.d.ts +2 -0
  53. package/out/_internal/schema/runtimeNoneLean.d.ts +2 -0
  54. package/out/_internal/schema/scope.d.ts +203 -0
  55. package/out/_internal/schema/shared/codecs.d.ts +5 -0
  56. package/out/_internal/schema/shared/compile.d.ts +144 -0
  57. package/out/_internal/schema/shared/configured.d.ts +14 -0
  58. package/out/_internal/schema/shared/declare.d.ts +100 -0
  59. package/out/_internal/schema/shared/disjoint.d.ts +45 -0
  60. package/out/_internal/schema/shared/enWriters.d.ts +30 -0
  61. package/out/_internal/schema/shared/errorModes.d.ts +25 -0
  62. package/out/_internal/schema/shared/errorWriters.d.ts +34 -0
  63. package/out/_internal/schema/shared/errors.d.ts +264 -0
  64. package/out/_internal/schema/shared/implement.d.ts +154 -0
  65. package/out/_internal/schema/shared/inPlace.d.ts +8 -0
  66. package/out/_internal/schema/shared/issueFeatures.d.ts +38 -0
  67. package/out/_internal/schema/shared/issues.d.ts +261 -0
  68. package/out/_internal/schema/shared/issuesLean.d.ts +80 -0
  69. package/out/_internal/schema/shared/issuesNone.d.ts +22 -0
  70. package/out/_internal/schema/shared/issuesNoneLean.d.ts +20 -0
  71. package/out/_internal/schema/shared/issuesUndetailed.d.ts +25 -0
  72. package/out/_internal/schema/shared/jsonSchema.d.ts +153 -0
  73. package/out/_internal/schema/shared/listed.d.ts +15 -0
  74. package/out/_internal/schema/shared/locale.d.ts +149 -0
  75. package/out/_internal/schema/shared/registry.d.ts +16 -0
  76. package/out/_internal/schema/shared/render.d.ts +3 -0
  77. package/out/_internal/schema/shared/rootApply.d.ts +19 -0
  78. package/out/_internal/schema/shared/sets.d.ts +26 -0
  79. package/out/_internal/schema/shared/standardFailure.d.ts +22 -0
  80. package/out/_internal/schema/shared/standardSchema.d.ts +124 -0
  81. package/out/_internal/schema/shared/toJsonSchema.d.ts +229 -0
  82. package/out/_internal/schema/shared/transform.d.ts +35 -0
  83. package/out/_internal/schema/shared/traversal.d.ts +288 -0
  84. package/out/_internal/schema/shared/utils.d.ts +59 -0
  85. package/out/_internal/schema/structure/index.d.ts +43 -0
  86. package/out/_internal/schema/structure/optional.d.ts +61 -0
  87. package/out/_internal/schema/structure/prop.d.ts +45 -0
  88. package/out/_internal/schema/structure/required.d.ts +49 -0
  89. package/out/_internal/schema/structure/sequence.d.ts +127 -0
  90. package/out/_internal/schema/structure/shared.d.ts +3 -0
  91. package/out/_internal/schema/structure/structure.d.ts +178 -0
  92. package/out/_internal/schema/units.d.ts +123 -0
  93. package/out/_internal/sets/algebra.d.ts +26 -0
  94. package/out/_internal/sets/constraint.d.ts +19 -0
  95. package/out/_internal/sets/engine.d.ts +2 -0
  96. package/out/_internal/sets/formats.d.ts +23 -0
  97. package/out/_internal/sets/fromJsonSchema.d.ts +15 -0
  98. package/out/_internal/sets/implement.d.ts +16 -0
  99. package/out/_internal/sets/index.d.ts +2 -0
  100. package/out/_internal/sets/internal.d.ts +20 -0
  101. package/out/_internal/sets/intersections.d.ts +5 -0
  102. package/out/_internal/sets/kinds.d.ts +3 -0
  103. package/out/_internal/sets/refinements.d.ts +14 -0
  104. package/out/_internal/sets/roots/alias.d.ts +3 -0
  105. package/out/_internal/sets/roots/domain.d.ts +3 -0
  106. package/out/_internal/sets/roots/intersection.d.ts +4 -0
  107. package/out/_internal/sets/roots/morph.d.ts +4 -0
  108. package/out/_internal/sets/roots/proto.d.ts +3 -0
  109. package/out/_internal/sets/roots/union.d.ts +16 -0
  110. package/out/_internal/sets/roots/unit.d.ts +3 -0
  111. package/out/_internal/sets/structure/index.d.ts +3 -0
  112. package/out/_internal/sets/structure/prop.d.ts +8 -0
  113. package/out/_internal/sets/structure/sequence.d.ts +3 -0
  114. package/out/_internal/sets/structure/structure.d.ts +3 -0
  115. package/out/_internal/sets/toJsonSchema.d.ts +25 -0
  116. package/out/_internal/util/arrays.d.ts +130 -0
  117. package/out/_internal/util/clone.d.ts +4 -0
  118. package/out/_internal/util/describe.d.ts +25 -0
  119. package/out/_internal/util/domain.d.ts +49 -0
  120. package/out/_internal/util/errors.d.ts +29 -0
  121. package/out/_internal/util/facts.d.ts +22 -0
  122. package/out/_internal/util/flatMorph.d.ts +41 -0
  123. package/out/_internal/util/formats.d.ts +8 -0
  124. package/out/_internal/util/functions.d.ts +33 -0
  125. package/out/_internal/util/generics.d.ts +65 -0
  126. package/out/_internal/util/get.d.ts +9 -0
  127. package/out/_internal/util/hkt.d.ts +27 -0
  128. package/out/_internal/util/i18n.d.ts +12 -0
  129. package/out/_internal/util/index.d.ts +28 -0
  130. package/out/_internal/util/internal.d.ts +2 -0
  131. package/out/_internal/util/intersections.d.ts +50 -0
  132. package/out/_internal/util/isomorphic.d.ts +8 -0
  133. package/out/_internal/util/keys.d.ts +18 -0
  134. package/out/_internal/util/lazily.d.ts +7 -0
  135. package/out/_internal/util/numbers.d.ts +82 -0
  136. package/out/_internal/util/objectKinds.d.ts +157 -0
  137. package/out/_internal/util/path.d.ts +16 -0
  138. package/out/_internal/util/primitive.d.ts +16 -0
  139. package/out/_internal/util/records.d.ts +173 -0
  140. package/out/_internal/util/registry.d.ts +13 -0
  141. package/out/_internal/util/scanner.d.ts +110 -0
  142. package/out/_internal/util/serialize.d.ts +40 -0
  143. package/out/_internal/util/strings.d.ts +35 -0
  144. package/out/_internal/util/traits.d.ts +89 -0
  145. package/out/_internal/util/unionToTuple.d.ts +14 -0
  146. package/out/_internal/util/weak.d.ts +8 -0
  147. package/out/attributes.d.ts +15 -11
  148. package/out/checkers.d.ts +1 -1
  149. package/out/chunk-22RQSVV3.js +0 -0
  150. package/out/chunk-3HZC67MT.js +965 -0
  151. package/out/chunk-3KBOPH3J.js +1564 -0
  152. package/out/chunk-3SH2BQ4T.js +15 -0
  153. package/out/chunk-46PLKNON.js +126 -0
  154. package/out/{chunk-G45P2CLE.js → chunk-4FTHWK63.js} +6 -1
  155. package/out/{chunk-UK5UGFOX.js → chunk-4HREHNIV.js} +23 -11
  156. package/out/chunk-4NZCLVBD.js +14 -0
  157. package/out/chunk-6FMBO47M.js +7 -0
  158. package/out/chunk-7TALAWYX.js +10 -0
  159. package/out/{chunk-DLWCO4RV.js → chunk-BCYKO54Z.js} +11 -2
  160. package/out/chunk-BDJVONP7.js +168 -0
  161. package/out/{chunk-E3DZXEZK.js → chunk-C2JOL5M2.js} +4 -2
  162. package/out/{chunk-2U2AWCI3.js → chunk-C2V6QPE3.js} +126 -97
  163. package/out/chunk-C3B4IFQL.js +6408 -0
  164. package/out/chunk-CWSF57VM.js +10 -0
  165. package/out/chunk-F5BACUJS.js +7 -0
  166. package/out/{chunk-EVCML554.js → chunk-FWRSDUJ2.js} +14 -5
  167. package/out/chunk-GID3FSQA.js +161 -0
  168. package/out/chunk-I2KLQ2HA.js +22 -0
  169. package/out/chunk-K7SLP5D2.js +84 -0
  170. package/out/chunk-KQPSKGUI.js +9 -0
  171. package/out/chunk-KXOC3JEX.js +8234 -0
  172. package/out/chunk-KXOSUYRA.js +405 -0
  173. package/out/chunk-LHNEY6QW.js +0 -0
  174. package/out/chunk-MTWKGAGO.js +323 -0
  175. package/out/chunk-NU73GNCX.js +170 -0
  176. package/out/{chunk-RAZ3TXOE.js → chunk-P5W67FQH.js} +34 -19
  177. package/out/chunk-PDLTEX6Z.js +1118 -0
  178. package/out/{chunk-VV6YDN2D.js → chunk-QUS4IAXJ.js} +304 -263
  179. package/out/chunk-R7WXIH5P.js +94 -0
  180. package/out/chunk-TACLEIDM.js +95 -0
  181. package/out/chunk-UJJGG4VQ.js +71 -0
  182. package/out/chunk-US6BWOGJ.js +109 -0
  183. package/out/chunk-VMMMOO4R.js +945 -0
  184. package/out/chunk-VYMXHSFR.js +439 -0
  185. package/out/chunk-W2XOI5DY.js +141 -0
  186. package/out/chunk-WC5L5YRP.js +25 -0
  187. package/out/{chunk-NRIGTMPM.js → chunk-WKOSL2G6.js} +4 -1
  188. package/out/chunk-XLG66ZDF.js +0 -0
  189. package/out/{chunk-5U2ZMDNI.js → chunk-XNUAQSJ4.js} +52 -30
  190. package/out/chunk-ZRYEHGSG.js +79 -0
  191. package/out/cli.d.ts +28 -0
  192. package/out/cli.js +636 -0
  193. package/out/codecs.d.ts +6 -5
  194. package/out/codecs.js +23 -7
  195. package/out/config.d.ts +5 -17
  196. package/out/config.js +11 -2
  197. package/out/declare.d.ts +40 -12
  198. package/out/deferred.d.ts +2 -2
  199. package/out/errors.d.ts +1 -1
  200. package/out/errors.js +10 -2
  201. package/out/fn.d.ts +20 -13
  202. package/out/fromJsonSchema.d.ts +18 -0
  203. package/out/generic.d.ts +9 -6
  204. package/out/i18n.d.ts +2 -2
  205. package/out/i18n.js +9 -2
  206. package/out/index.d.ts +16 -7
  207. package/out/index.js +25 -8
  208. package/out/internal.d.ts +4 -0
  209. package/out/internal.js +41 -17
  210. package/out/island.js +22 -6
  211. package/out/islandDependency.js +42 -18
  212. package/out/jsonSchema/infer.d.ts +805 -0
  213. package/out/jsonSchema/validate.d.ts +416 -0
  214. package/out/keywords/Array.d.ts +2 -2
  215. package/out/keywords/builtins.d.ts +3 -3
  216. package/out/keywords/constructors.d.ts +1 -1
  217. package/out/keywords/functions.d.ts +5 -192
  218. package/out/keywords/keywords.d.ts +3 -3
  219. package/out/keywords/number.d.ts +2 -2
  220. package/out/keywords/phrases.d.ts +4 -191
  221. package/out/keywords/string.d.ts +3 -3
  222. package/out/keywords/ts.d.ts +18 -18
  223. package/out/keywords/ts.js +19 -4
  224. package/out/locale.d.ts +6 -2
  225. package/out/locales/de.js +9 -2
  226. package/out/locales/en.js +21 -5
  227. package/out/match.d.ts +13 -10
  228. package/out/module.d.ts +2 -2
  229. package/out/mutatesInput.js +18 -3
  230. package/out/nary.d.ts +220 -194
  231. package/out/parser/ast/bounds.d.ts +2 -2
  232. package/out/parser/ast/default.d.ts +2 -2
  233. package/out/parser/ast/divisor.d.ts +2 -2
  234. package/out/parser/ast/generic.d.ts +2 -2
  235. package/out/parser/ast/infer.d.ts +1 -1
  236. package/out/parser/ast/keyof.d.ts +2 -2
  237. package/out/parser/ast/utils.d.ts +1 -1
  238. package/out/parser/ast/validate.d.ts +2 -2
  239. package/out/parser/definition.d.ts +4 -4
  240. package/out/parser/objectLiteral.d.ts +2 -2
  241. package/out/parser/property.d.ts +2 -2
  242. package/out/parser/reduce/dynamic.d.ts +2 -2
  243. package/out/parser/reduce/shared.d.ts +1 -1
  244. package/out/parser/reduce/static.d.ts +1 -1
  245. package/out/parser/shift/operand/enclosed.d.ts +2 -2
  246. package/out/parser/shift/operand/genericArgs.d.ts +2 -2
  247. package/out/parser/shift/operand/operand.d.ts +1 -1
  248. package/out/parser/shift/operand/unenclosed.d.ts +2 -2
  249. package/out/parser/shift/operand/unresolvable.d.ts +2 -2
  250. package/out/parser/shift/operator/bounds.d.ts +2 -2
  251. package/out/parser/shift/operator/brand.d.ts +2 -2
  252. package/out/parser/shift/operator/default.d.ts +4 -4
  253. package/out/parser/shift/operator/divisor.d.ts +1 -1
  254. package/out/parser/shift/operator/operator.d.ts +1 -1
  255. package/out/parser/shift/tokens.d.ts +1 -1
  256. package/out/parser/string.d.ts +2 -2
  257. package/out/parser/tupleExpressions.d.ts +6 -8
  258. package/out/parser/tupleLiteral.d.ts +2 -2
  259. package/out/precompiled.d.ts +1 -1
  260. package/out/precompiled.js +16 -2
  261. package/out/regex.d.ts +1 -0
  262. package/out/regex.js +2 -0
  263. package/out/runtime.d.ts +10 -8
  264. package/out/runtime.js +6 -4
  265. package/out/runtimeDevelopment.js +70 -52
  266. package/out/schema.d.ts +1 -0
  267. package/out/schema.js +15 -0
  268. package/out/schemaInternal.d.ts +1 -0
  269. package/out/schemaInternal.js +1401 -0
  270. package/out/schemaIssueFeatures.d.ts +1 -0
  271. package/out/schemaRuntime.d.ts +1 -0
  272. package/out/schemaRuntime.js +7 -0
  273. package/out/schemaRuntimeLean.d.ts +1 -0
  274. package/out/schemaRuntimeLean.js +1870 -0
  275. package/out/schemaRuntimeNone.d.ts +1 -0
  276. package/out/schemaRuntimeNone.js +1774 -0
  277. package/out/schemaRuntimeNoneLean.d.ts +1 -0
  278. package/out/schemaRuntimeNoneLean.js +1767 -0
  279. package/out/scope.d.ts +3 -4
  280. package/out/shared/issueFeatures.d.ts +38 -0
  281. package/out/shared/issueFeatures.js +40 -0
  282. package/out/standalone/artifact.d.ts +6 -6
  283. package/out/standalone/baking.d.ts +2 -2
  284. package/out/standalone/combinators.d.ts +1 -1
  285. package/out/standalone/compilers.d.ts +1 -1
  286. package/out/standalone/fallbacks.d.ts +1 -1
  287. package/out/standalone/keys.d.ts +1 -1
  288. package/out/standalone/sites.d.ts +3 -3
  289. package/out/standalone/units.d.ts +1 -1
  290. package/out/standalone/values.d.ts +1 -1
  291. package/out/type.d.ts +6 -6
  292. package/out/util.d.ts +1 -0
  293. package/out/util.js +137 -0
  294. package/out/variants/array.d.ts +6 -6
  295. package/out/variants/base.d.ts +61 -10
  296. package/out/variants/date.d.ts +5 -5
  297. package/out/variants/instantiate.d.ts +1 -1
  298. package/out/variants/number.d.ts +6 -6
  299. package/out/variants/object.d.ts +25 -12
  300. package/out/variants/string.d.ts +8 -8
  301. package/package.json +183 -8
  302. package/skills/arktype/SKILL.md +93 -93
  303. package/skills/arktype/references/migrating.md +144 -158
  304. package/skills/arktype/references/precompile.md +7 -7
  305. package/out/chunk-4CUA5XIP.js +0 -7
  306. package/out/chunk-GPNK5353.js +0 -2529
  307. package/out/chunk-MLKGABMK.js +0 -9
  308. package/out/chunk-PRTMQCHS.js +0 -3
  309. package/out/chunk-R5G57XC7.js +0 -7
  310. package/out/chunk-SWOOCAHN.js +0 -4
  311. package/out/chunk-TAHPKDNM.js +0 -3
  312. package/out/chunk-UETB6YE2.js +0 -14
@@ -0,0 +1,1870 @@
1
+ // ../util/out/arrays.js
2
+ var includes = (array, element) => array.includes(element);
3
+
4
+ // ../util/out/domain.js
5
+ var hasDomain = (data, kind) => domainOf(data) === kind;
6
+ var domainOf = (data) => {
7
+ const builtinType = typeof data;
8
+ return builtinType === "object" ? data === null ? "null" : "object" : builtinType === "function" ? "object" : builtinType;
9
+ };
10
+ var domainDescriptions = {
11
+ boolean: "boolean",
12
+ null: "null",
13
+ undefined: "undefined",
14
+ bigint: "a bigint",
15
+ number: "a number",
16
+ object: "an object",
17
+ string: "a string",
18
+ symbol: "a symbol"
19
+ };
20
+
21
+ // ../util/out/errors.js
22
+ var InternalArktypeError = class extends Error {
23
+ };
24
+ var throwInternalError = (message) => throwError(message, InternalArktypeError);
25
+ var throwError = (message, ctor = Error) => {
26
+ throw new ctor(message);
27
+ };
28
+ var ParseError = class extends Error {
29
+ name = "ParseError";
30
+ };
31
+ var throwParseError = (message) => throwError(message, ParseError);
32
+ var noSuggest = ((s) => ` ${s}`);
33
+
34
+ // ../util/out/facts.js
35
+ var isDate = (value) => value instanceof Date;
36
+ var prototypeOf = (o) => Object.getPrototypeOf(o);
37
+ var arityOf = (fn) => {
38
+ const proto = Object.getPrototypeOf(fn);
39
+ return proto && Object.prototype.hasOwnProperty.call(proto, "traverse") ? 2 : fn.length;
40
+ };
41
+ var functionNameOf = (fn) => fn.name;
42
+ var constructorNameOf = (o) => o.constructor?.name;
43
+ var expressionOf = (o) => "expression" in o && typeof o.expression === "string" ? o.expression : void 0;
44
+ var toJsonMethodOf = (o) => {
45
+ const toJson = o.toJSON;
46
+ return typeof toJson === "function" ? toJson : void 0;
47
+ };
48
+ var ownEntriesOf = (o, opts) => {
49
+ const result = [];
50
+ for (const k of Reflect.ownKeys(o)) {
51
+ const descriptor = Object.getOwnPropertyDescriptor(o, k);
52
+ if (!descriptor.enumerable)
53
+ continue;
54
+ result.push([
55
+ k,
56
+ "value" in descriptor ? descriptor.value : opts.onAccessor ? opts.onAccessor(descriptor) : o[k]
57
+ ]);
58
+ }
59
+ return result;
60
+ };
61
+
62
+ // ../util/out/records.js
63
+ var isKeyOf = (k, o) => k in o;
64
+ var hasOwn = (o, k) => Object.prototype.hasOwnProperty.call(o, k);
65
+ var hasKey = (o, k) => k in o;
66
+ var isEmptyObject = (o) => {
67
+ for (const k in o)
68
+ if (hasOwn(o, k))
69
+ return false;
70
+ return true;
71
+ };
72
+ var defineProperties = ((base, merged) => (
73
+ // declared like this to avoid https://github.com/microsoft/TypeScript/issues/55049
74
+ Object.defineProperties(base, Object.getOwnPropertyDescriptors(merged))
75
+ ));
76
+ var defineValue = (o, k, value) => Object.defineProperty(o, k, {
77
+ value,
78
+ writable: true,
79
+ enumerable: true,
80
+ configurable: true
81
+ });
82
+
83
+ // ../util/out/objectKinds.js
84
+ var ecmascriptConstructorsOf = () => ({
85
+ Array,
86
+ Boolean,
87
+ Date,
88
+ Error,
89
+ Function,
90
+ Map,
91
+ Number,
92
+ Promise,
93
+ RegExp,
94
+ Set,
95
+ String,
96
+ WeakMap,
97
+ WeakSet
98
+ });
99
+ var platformConstructorsOf = () => ({
100
+ ArrayBuffer,
101
+ Blob: globalThis.Blob,
102
+ // Node loads a module for File, and undici for the rest, on first read
103
+ get File() {
104
+ return globalThis.File ?? globalThis.Blob;
105
+ },
106
+ get FormData() {
107
+ return globalThis.FormData;
108
+ },
109
+ get Headers() {
110
+ return globalThis.Headers;
111
+ },
112
+ get Request() {
113
+ return globalThis.Request;
114
+ },
115
+ get Response() {
116
+ return globalThis.Response;
117
+ },
118
+ URL: globalThis.URL
119
+ });
120
+ var typedArrayConstructorsOf = () => ({
121
+ Int8Array,
122
+ Uint8Array,
123
+ Uint8ClampedArray,
124
+ Int16Array,
125
+ Uint16Array,
126
+ Int32Array,
127
+ Uint32Array,
128
+ Float32Array,
129
+ Float64Array,
130
+ BigInt64Array,
131
+ BigUint64Array
132
+ });
133
+ var builtins;
134
+ var builtinsOf = () => builtins ??= defineProperties(defineProperties(Object.assign({}, ecmascriptConstructorsOf()), platformConstructorsOf()), typedArrayConstructorsOf());
135
+ var objectKindOf = (data) => {
136
+ if (Array.isArray(data))
137
+ return "Array";
138
+ let prototype = prototypeOf(data);
139
+ if (prototype === Object.prototype)
140
+ return void 0;
141
+ const constructors = builtinsOf();
142
+ while (prototype?.constructor && (!hasOwn(constructors, prototype.constructor.name) || constructors[prototype.constructor.name]?.prototype !== prototype))
143
+ prototype = Object.getPrototypeOf(prototype);
144
+ const name = prototype?.constructor?.name;
145
+ if (name === void 0 || name === "Object")
146
+ return void 0;
147
+ return name;
148
+ };
149
+ var objectKindOrDomainOf = (data) => typeof data === "object" && data !== null ? objectKindOf(data) ?? "object" : domainOf(data);
150
+ var isArray = /* @__PURE__ */ (() => Array.isArray)();
151
+ var dateGetTime = /* @__PURE__ */ (() => Date.prototype.getTime)();
152
+ var timeOf = (date) => {
153
+ try {
154
+ return date.getTime === dateGetTime ? date.getTime() : dateGetTime.call(date);
155
+ } catch {
156
+ return void 0;
157
+ }
158
+ };
159
+ var isValidDate = (date) => {
160
+ try {
161
+ return !Number.isNaN(date.getTime === dateGetTime ? date.getTime() : dateGetTime.call(date));
162
+ } catch {
163
+ return false;
164
+ }
165
+ };
166
+
167
+ // ../util/out/functions.js
168
+ var isThunk = (value) => typeof value === "function" && arityOf(value) === 0;
169
+
170
+ // ../util/out/i18n.js
171
+ var listPattern = (or, and) => (items, type) => {
172
+ const pattern = type === "or" ? or : and;
173
+ if (items.length < 2)
174
+ return items[0] ?? "";
175
+ if (items.length === 2)
176
+ return `${items[0]}${pattern.two}${items[1]}`;
177
+ return `${items.slice(0, -1).join(pattern.middle)}${pattern.end}${items[items.length - 1]}`;
178
+ };
179
+
180
+ // ../util/out/primitive.js
181
+ var lastString;
182
+ var lastSerialized;
183
+ var serializePrimitive = (value) => typeof value === "string" ? value === lastString ? lastSerialized : lastSerialized = JSON.stringify(lastString = value) : typeof value === "bigint" ? `${value}n` : `${value}`;
184
+
185
+ // ../util/out/serialize.js
186
+ var printable = (data, opts) => {
187
+ switch (domainOf(data)) {
188
+ case "object":
189
+ const o = data;
190
+ const ctorName = constructorNameOf(o) ?? "Object";
191
+ const serializationOpts = opts?.ownDataOnly ? ownDataPrintableOpts : printableOpts;
192
+ return ctorName === "Object" || ctorName === "Array" ? opts?.quoteKeys === false ? stringifyUnquoted(o, opts?.indent ?? 0, "", serializationOpts) : JSON.stringify(_serialize(o, serializationOpts, []), null, opts?.indent).replace(quotedMarkedValue, "$1") : stringifyUnquoted(o, opts?.indent ?? 0, "", serializationOpts);
193
+ case "symbol":
194
+ return printableOpts.onSymbol(data);
195
+ default:
196
+ return serializePrimitive(data);
197
+ }
198
+ };
199
+ var printKind = (data) => typeof data === "function" ? "a function" : typeof data === "symbol" ? printSymbol(data) : typeof data !== "object" || data === null ? serializePrimitive(data) : isArray(data) ? "an array" : "an object";
200
+ var stringifyUnquoted = (value, indent, currentIndent, opts) => {
201
+ if (typeof value === "function")
202
+ return printableOpts.onFunction(value);
203
+ if (typeof value === "symbol")
204
+ return printableOpts.onSymbol(value);
205
+ if (typeof value !== "object" || value === null)
206
+ return serializePrimitive(value);
207
+ const nextIndent = currentIndent + " ".repeat(indent);
208
+ if (isArray(value)) {
209
+ if (value.length === 0)
210
+ return "[]";
211
+ const items = value.map((item) => stringifyUnquoted(item, indent, nextIndent, opts)).join(",\n" + nextIndent);
212
+ return indent ? `[
213
+ ${nextIndent}${items}
214
+ ${currentIndent}]` : `[${items}]`;
215
+ }
216
+ const ctorName = constructorNameOf(value) ?? "Object";
217
+ if (ctorName === "Object") {
218
+ const keyValues = ownEntriesOf(value, opts).map(([key, val]) => {
219
+ const stringifiedKey = typeof key === "symbol" ? printableOpts.onSymbol(key) : isDotAccessible(key) ? key : JSON.stringify(key);
220
+ const stringifiedValue = stringifyUnquoted(val, indent, nextIndent, opts);
221
+ return `${nextIndent}${stringifiedKey}: ${stringifiedValue}`;
222
+ });
223
+ if (keyValues.length === 0)
224
+ return "{}";
225
+ return indent ? `{
226
+ ${keyValues.join(",\n")}
227
+ ${currentIndent}}` : `{${keyValues.join(", ")}}`;
228
+ }
229
+ if (isDate(value))
230
+ return describeCollapsibleDate(value);
231
+ return expressionOf(value) ?? ctorName;
232
+ };
233
+ var printSymbol = (symbol) => `Symbol(${baseNameOfSymbol(symbol)})`;
234
+ var printableOpts = {
235
+ onCycle: () => "(cycle)",
236
+ onSymbol: printSymbol,
237
+ onFunction: (v) => `Function(${baseNameOf(v)})`,
238
+ onBigInt: (n) => `${n}n`,
239
+ onUndefined: "undefined"
240
+ };
241
+ var ownDataPrintableOpts = /* @__PURE__ */ Object.assign({}, printableOpts, {
242
+ onAccessor: (descriptor) => descriptor.get ? "(getter)" : "(setter)"
243
+ });
244
+ var quotedMarkedValue = /"\uE000(-?\d+n|undefined)"/g;
245
+ var _serialize = (data, opts, seen) => {
246
+ switch (domainOf(data)) {
247
+ case "object": {
248
+ const o = data;
249
+ const toJson = !opts.onAccessor || isDate(o) ? toJsonMethodOf(o) : void 0;
250
+ if (toJson)
251
+ return Reflect.apply(toJson, o, []);
252
+ if (typeof o === "function")
253
+ return opts.onFunction?.(o) ?? printableOpts.onFunction(o);
254
+ if (seen.includes(o))
255
+ return opts.onCycle?.(o) ?? "(cycle)";
256
+ const nextSeen = [...seen, o];
257
+ if (isArray(o))
258
+ return o.map((item) => _serialize(item, opts, nextSeen));
259
+ if (isDate(o))
260
+ return o.toDateString();
261
+ const result = {};
262
+ for (const [k, v] of ownEntriesOf(o, opts)) {
263
+ const key = typeof k === "symbol" ? opts.onSymbol?.(k) ?? k.toString() : k;
264
+ defineValue(result, key, _serialize(v, opts, nextSeen));
265
+ }
266
+ return result;
267
+ }
268
+ case "symbol":
269
+ return opts.onSymbol?.(data) ?? printableOpts.onSymbol(data);
270
+ case "bigint":
271
+ return opts.onBigInt?.(data) ?? `${data}n`;
272
+ case "undefined":
273
+ return opts.onUndefined ?? "undefined";
274
+ case "string":
275
+ return data.replace(/\\/g, "\\\\");
276
+ default:
277
+ return data;
278
+ }
279
+ };
280
+ var describeCollapsibleDate = (date) => {
281
+ if (!isValidDate(date))
282
+ return "Invalid Date";
283
+ const year = date.getUTCFullYear();
284
+ const month = date.getUTCMonth();
285
+ const dayOfMonth = date.getUTCDate();
286
+ const hours = date.getUTCHours();
287
+ const minutes = date.getUTCMinutes();
288
+ const seconds = date.getUTCSeconds();
289
+ const milliseconds = date.getUTCMilliseconds();
290
+ if (hours === 0 && minutes === 0 && seconds === 0 && milliseconds === 0)
291
+ return `${months[month]} ${dayOfMonth}, ${year}`;
292
+ const h = hours % 12 || 12;
293
+ const suffix = hours < 12 ? " AM" : " PM";
294
+ let timePortion = seconds || milliseconds ? `${h}:${pad(minutes, 2)}:${pad(seconds, 2)}` : `${h}:${pad(minutes, 2)}`;
295
+ if (milliseconds)
296
+ timePortion += `.${pad(milliseconds, 3)}`;
297
+ return `${months[month]} ${dayOfMonth}, ${year}, ${timePortion + suffix} UTC`;
298
+ };
299
+ var months = [
300
+ "January",
301
+ "February",
302
+ "March",
303
+ "April",
304
+ "May",
305
+ "June",
306
+ "July",
307
+ "August",
308
+ "September",
309
+ "October",
310
+ "November",
311
+ "December"
312
+ ];
313
+ var pad = (value, length) => String(value).padStart(length, "0");
314
+ var dotAccessibleKeys = /* @__PURE__ */ new Map();
315
+ var isDotAccessible = (keyName) => {
316
+ let accessible = dotAccessibleKeys.get(keyName);
317
+ if (accessible === void 0) {
318
+ accessible = /^[$A-Z_a-z][\w$]*$/.test(keyName);
319
+ if (keyName.length <= 64) {
320
+ if (dotAccessibleKeys.size === 1024)
321
+ dotAccessibleKeys.clear();
322
+ dotAccessibleKeys.set(keyName, accessible);
323
+ }
324
+ }
325
+ return accessible;
326
+ };
327
+ var baseNameOf = (value) => {
328
+ switch (typeof value) {
329
+ case "object": {
330
+ if (value === null)
331
+ break;
332
+ const prefix = objectKindOf(value) ?? "object";
333
+ return prefix[0].toLowerCase() + prefix.slice(1);
334
+ }
335
+ case "function":
336
+ const name = functionNameOf(value);
337
+ return isDotAccessible(name) ? name : "fn";
338
+ case "symbol":
339
+ return baseNameOfSymbol(value);
340
+ }
341
+ return throwInternalError(`Unexpected attempt to register serializable value of type ${domainOf(value)}`);
342
+ };
343
+ var baseNameOfSymbol = (symbol) => symbol.description && isDotAccessible(symbol.description) ? symbol.description : "symbol";
344
+
345
+ // ../schema/out/shared/configured.js
346
+ var isPlain = (value) => {
347
+ const proto = Object.getPrototypeOf(value);
348
+ return proto === Object.prototype || proto === null;
349
+ };
350
+ var copyPlain = (value) => typeof value !== "object" || value === null ? value : Array.isArray(value) ? value.map(copyPlain) : isPlain(value) ? Object.fromEntries(Object.entries(value).map(([k, v]) => [k, copyPlain(v)])) : value;
351
+ var copyConfig = (config) => {
352
+ const copy = {};
353
+ for (const k in config) {
354
+ const v = config[k];
355
+ copy[k] = k === "locale" ? v : copyPlain(v);
356
+ }
357
+ return copy;
358
+ };
359
+ var isSameConfig = (l, r) => {
360
+ if (l === r)
361
+ return true;
362
+ if (typeof l === "function" && typeof r === "function") {
363
+ const source = Function.prototype.toString.call(l);
364
+ return source === Function.prototype.toString.call(r) && !/\[native code]\s*}$/.test(source);
365
+ }
366
+ if (typeof l !== "object" || typeof r !== "object" || !l || !r)
367
+ return false;
368
+ const entries = Object.entries(l);
369
+ return entries.length === Object.keys(r).length && entries.every(([k, v]) => Object.prototype.hasOwnProperty.call(r, k) && isSameConfig(v, r[k]));
370
+ };
371
+
372
+ // ../schema/out/shared/enWriters.js
373
+ var Stamp = class {
374
+ constructor(o) {
375
+ return o;
376
+ }
377
+ };
378
+ var DescribedActual = class extends Stamp {
379
+ #described = true;
380
+ static has(o) {
381
+ return #described in o;
382
+ }
383
+ };
384
+ var describeActual = (ctx) => {
385
+ if (!DescribedActual.has(ctx))
386
+ new DescribedActual(ctx);
387
+ };
388
+ var describeUnwrittenActual = (ctx) => {
389
+ try {
390
+ new DescribedActual(ctx);
391
+ } catch {
392
+ }
393
+ };
394
+ var printedActualOf = (ctx) => DescribedActual.has(ctx) ? "" : ctx.actual;
395
+ var writeMessage = (ctx) => {
396
+ const actual = printedActualOf(ctx);
397
+ return `must be ${ctx.expected}${actual ? ` (was ${actual})` : ""}`;
398
+ };
399
+ var writeLine = (ctx) => `${ctx.propString}${ctx.custom ? ":" : ""} ${ctx.message}`;
400
+ var writeUnitMessage = (ctx) => {
401
+ const actual = printedActualOf(ctx);
402
+ return !actual ? `must be ${ctx.expected}` : ctx.expected === actual ? `must be reference equal to ${ctx.expected} (serialized to the same value)` : `must be ${ctx.expected} (was ${actual})`;
403
+ };
404
+ var writeUnitActual = (data) => data instanceof Date && isValidDate(data) ? describeCollapsibleDate(data) : printKind(data);
405
+ var writeNotEqualActual = (data) => data instanceof Date ? describeCollapsibleDate(data) : printKind(data);
406
+ var writeDomainActual = (data) => typeof data === "number" && !Number.isFinite(data) ? String(data) : domainDescriptions[domainOf(data)];
407
+ var writeLengthActual = (data, e) => e.meta?.description === void 0 && e.meta?.expected === void 0 ? `${data.length}` : `length ${data.length}`;
408
+ var writeProtoActual = (data) => {
409
+ if (data instanceof Date && !isValidDate(data)) {
410
+ return timeOf(data) === void 0 ? domainDescriptions.object : "an invalid Date";
411
+ }
412
+ const kind = objectKindOrDomainOf(data);
413
+ return isKeyOf(kind, domainDescriptions) ? domainDescriptions[kind] : kind;
414
+ };
415
+ var enInfo = /* @__PURE__ */ Object.freeze({
416
+ tag: "en",
417
+ list: /* @__PURE__ */ listPattern({ two: " or ", middle: ", ", end: " or " }, { two: " and ", middle: ", ", end: " and " }),
418
+ plural: (n) => n === 1 ? "one" : "other",
419
+ number: String,
420
+ date: describeCollapsibleDate,
421
+ verbatim: (text) => text
422
+ });
423
+
424
+ // ../schema/out/runtime.js
425
+ export { appliesValues, discriminatesBooleans, failsInBranches, findsOnRead, holdsExpression, listsUnions, transformsBranches, traversesUnions } from "./shared/issueFeatures.js";
426
+
427
+ // ../schema/out/shared/issuesLean.js
428
+ import { bracketsKeys, callsSiteText, listsUnions, namesTraversalError, readsErrors, readsSummary, reportsIndices, writesText } from "./shared/issueFeatures.js";
429
+ var refuseLocale = (locale) => {
430
+ if (locale === void 0)
431
+ return;
432
+ if (typeof locale !== "object" || locale === null || Array.isArray(locale))
433
+ throw Error("Expected a Locale object");
434
+ throw Error('import "arktype/i18n" to write errors in locales other than en');
435
+ };
436
+ var ReadIssues = class {
437
+ /** @internal each issue in the order it was added */
438
+ _ = [];
439
+ /** @internal the path a fused traversal is at */
440
+ _p = [];
441
+ /**
442
+ * The number of issues.
443
+ */
444
+ get count() {
445
+ return this._.length;
446
+ }
447
+ /**
448
+ * Each issue, its message written when they are first read.
449
+ */
450
+ get issues() {
451
+ return serializableIssues(this._);
452
+ }
453
+ /** @internal takes neither a key nor a site, as issues.ts's */
454
+ _e(data, code, expected, message, text) {
455
+ this._.push({ code, path: this._p.slice(), data, expected, message });
456
+ if (callsSiteText)
457
+ text?.(this._[this._.length - 1]);
458
+ return void 0;
459
+ }
460
+ /** @internal */
461
+ _k(apply, data, key, ...missing) {
462
+ this._p.push(key);
463
+ const stops = missing.length && !(key in data) ? this._e(data, "required", ...missing) : !apply(data[key], this);
464
+ this._p.pop();
465
+ return stops;
466
+ }
467
+ };
468
+ var failsKey = (ctx, data, key, code, expected, missing = expected) => ctx._k((value, ctx2) => !ctx2._e(value, code, expected), data, key, missing);
469
+ var failsSite = (ctx, context, data) => ctx._e(data, context.code, context.description, context.x, context.text);
470
+ var failsKeySite = (ctx, site, data, key) => ctx._k((value, ctx2) => !failsSite(ctx2, site.v ?? site, value), data, key, ...missingTextOf(site.m));
471
+ var missingTextOf = (missing) => missing ? [missing.description, missing.x, missing.text] : [];
472
+ var Issues = readsErrors ? class ArkErrors {
473
+ _ = [];
474
+ _p = [];
475
+ get count() {
476
+ return this._.length;
477
+ }
478
+ get issues() {
479
+ return serializableIssues(this._);
480
+ }
481
+ _e(data, code, expected, message, text) {
482
+ this._.push({ code, path: this._p.slice(), data, expected, message });
483
+ if (callsSiteText)
484
+ text?.(this._[this._.length - 1]);
485
+ return void 0;
486
+ }
487
+ _k(apply, data, key, ...missing) {
488
+ this._p.push(key);
489
+ const stops = missing.length && !(key in data) ? this._e(data, "required", ...missing) : !apply(data[key], this);
490
+ this._p.pop();
491
+ return stops;
492
+ }
493
+ get summary() {
494
+ return this._.map(lineOf).join("\n");
495
+ }
496
+ summaryIn(locale) {
497
+ refuseLocale(locale);
498
+ return this.summary;
499
+ }
500
+ // as issues.ts's, an instance of TraversalError wherever it's kept
501
+ throw() {
502
+ if (namesTraversalError)
503
+ throw new ThrownIssues(this);
504
+ if (definedThrown)
505
+ throw new definedThrown(this);
506
+ const thrown = Error(this.summary);
507
+ thrown.name = "TraversalError";
508
+ throw Object.defineProperty(thrown, "arkErrors", { value: this });
509
+ }
510
+ toJSON() {
511
+ return this.issues.map(jsonIssueOf);
512
+ }
513
+ toString() {
514
+ return this.summary;
515
+ }
516
+ [Symbol.iterator]() {
517
+ return this.issues[Symbol.iterator]();
518
+ }
519
+ } : readsSummary ? class extends ReadIssues {
520
+ get summary() {
521
+ return this._.map(lineOf).join("\n");
522
+ }
523
+ } : ReadIssues;
524
+ var jsonIssueOf = (issue) => ({
525
+ code: issue.code,
526
+ path: issue.path.map((k) => typeof k === "symbol" ? String(k) : k),
527
+ ...issue.expected !== void 0 && { expected: issue.expected },
528
+ message: issue.message ?? messageOf(issue),
529
+ ...issue.errors?.length ? { errors: issue.errors.map(jsonIssueOf) } : {}
530
+ });
531
+ var issuesToJson = {
532
+ value() {
533
+ return this.map(jsonIssueOf);
534
+ },
535
+ writable: true,
536
+ configurable: true
537
+ };
538
+ var serializableIssues = (issues) => {
539
+ for (const issue of issues)
540
+ issue.message ??= messageOf(issue);
541
+ return issues.toJSON ? issues : Object.defineProperty(issues, "toJSON", issuesToJson);
542
+ };
543
+ var FirstIssues = class extends Issues {
544
+ get failFast() {
545
+ return true;
546
+ }
547
+ _e(...failure) {
548
+ super._e(...failure);
549
+ return true;
550
+ }
551
+ };
552
+ var issueAt = (path, site, data, key) => {
553
+ let context = site.v ?? site;
554
+ if (key !== void 0) {
555
+ path.push(key);
556
+ if (site.m && !(key in data))
557
+ context = site.m;
558
+ else
559
+ data = data[key];
560
+ }
561
+ const issue = {
562
+ code: context.code,
563
+ path: path.slice(),
564
+ data,
565
+ expected: context.description,
566
+ message: context.x
567
+ };
568
+ if (callsSiteText)
569
+ context.text?.(issue);
570
+ if (key !== void 0)
571
+ path.pop();
572
+ return issue;
573
+ };
574
+ var issuesOf = (apply, data, errors) => {
575
+ apply(data, errors);
576
+ if (!errors._.length)
577
+ errors._e(data, "predicate", "valid", "is invalid");
578
+ return errors._;
579
+ };
580
+ var foundErrors = (apply, data, onFail, Ctx = Issues) => {
581
+ const errors = new Ctx();
582
+ apply(data, errors);
583
+ if (!errors._.length)
584
+ errors._e(data, "predicate", "valid", "is invalid");
585
+ return onFail ? onFail(errors) : errors;
586
+ };
587
+ var throwIssues = (apply, data) => {
588
+ const errors = new Issues();
589
+ issuesOf(apply, data, errors);
590
+ return errors.throw();
591
+ };
592
+ var applyIssues = (apply, data, onFail, Ctx = Issues) => {
593
+ const errors = new Ctx();
594
+ apply(data, errors);
595
+ return !errors.count ? data : onFail ? onFail(errors) : errors;
596
+ };
597
+ var throwOnDefault = (errors) => errors.throw();
598
+ var mergeIssues = (errors, merged, prefix) => {
599
+ for (const issue of merged.issues) {
600
+ errors._.push(listsUnions && issue._m ? issue._m(prefix) : movedIssue(issue, [...prefix, ...issue.path]));
601
+ }
602
+ };
603
+ var isCustomIssue = (issue) => listsUnions && issue._l !== void 0 ? false : writesText && issue.message !== void 0 && !issue.message.startsWith(messageOf(issue));
604
+ var codedIssue = (issue) => Object.defineProperty(issue, "_c", { value: 2 });
605
+ var notedAs = (issue, copy) => listsUnions && writesText && issue._c ? codedIssue(copy) : copy;
606
+ var movedIssue = (issue, path) => notedAs(issue, {
607
+ code: issue.code,
608
+ path,
609
+ data: issue.data,
610
+ expected: issue.expected,
611
+ message: issue.message
612
+ });
613
+ var pathOf = (issue) => {
614
+ let path = "";
615
+ for (const k of issue.path) {
616
+ path += reportsIndices && typeof k === "number" ? `[${k}]` : bracketsKeys && !/^[$_a-z][\w$]*$/i.test(String(k)) ? `[${JSON.stringify(k) ?? String(k)}]` : (path && ".") + String(k);
617
+ }
618
+ return path;
619
+ };
620
+ var lineOf = (issue) => {
621
+ const message = issue.message ??= messageOf(issue);
622
+ const path = reportsIndices || bracketsKeys ? pathOf(issue) : issue.path.join(".");
623
+ return listsUnions && issue._l !== void 0 ? issue._l : path ? path + (writesText && !(message === "is invalid" && issue.expected === "valid") && !message.startsWith(messageOf(issue)) ? ": " : " ") + message : message;
624
+ };
625
+ var messageOf = (issue) => issue.expected !== void 0 ? "must be " + issue.expected + (issue.code === "required" ? " (was missing)" : "") : issue.code === "required" ? "is missing" : "is invalid";
626
+ var definedThrown;
627
+ var ThrownIssues = /* @__PURE__ */ (() => definedThrown = class TraversalError extends Error {
628
+ constructor(errors) {
629
+ super(errors.summary);
630
+ this.name = "TraversalError";
631
+ Object.defineProperty(this, "arkErrors", { value: errors });
632
+ }
633
+ })();
634
+
635
+ // ../schema/out/shared/listed.js
636
+ import { rewritesUnions, writesText as writesText2 } from "./shared/issueFeatures.js";
637
+ var writeBranches = (alternatives) => {
638
+ const unique = [...new Set(alternatives)];
639
+ if ([...unique].sort().join() === "false,true")
640
+ return "boolean";
641
+ const last = unique.pop();
642
+ return unique.length ? `${unique.join(", ")} or ${last}` : last;
643
+ };
644
+ var alternativesOf = (issues) => issues.flatMap(({ code, expected = "valid" }) => issues.length > 1 && /^(req|disc|union)/.test(code) ? expected.split(/(?:, | or )(?=(?:[^"]*"[^"]*")*[^"]*$)/) : [expected]);
645
+ var writeListed = (errors) => {
646
+ const atSubject = {};
647
+ for (const error of errors) {
648
+ error.message ??= messageOf(error);
649
+ const path = pathOf(error);
650
+ (atSubject[(path && path + " ") + "must be "] ??= []).push(error);
651
+ }
652
+ return writeBranches(Object.entries(atSubject).map(([subject, same]) => subject + writeBranches(alternativesOf(same))));
653
+ };
654
+ var writeAlike = (errors) => {
655
+ for (const error of errors)
656
+ error.message ??= messageOf(error);
657
+ return lineOf(errors[0]);
658
+ };
659
+ var sharedMessageOf = (errors) => {
660
+ let shared;
661
+ for (const error of errors) {
662
+ if (!isCustomIssue(error) || error._c || shared !== void 0 && error.message !== shared)
663
+ return;
664
+ shared = error.message;
665
+ }
666
+ return shared;
667
+ };
668
+ var ListedIssue = class {
669
+ code = "union";
670
+ // private, so only what an issue's readers see is its own
671
+ #line;
672
+ constructor(path, data, errors, line, expected, message = expected) {
673
+ this.path = path;
674
+ this.data = data;
675
+ this.errors = errors;
676
+ this.expected = expected;
677
+ this.message = message;
678
+ this.#line = line;
679
+ }
680
+ get _l() {
681
+ return this.#line;
682
+ }
683
+ };
684
+ var movedBy = (errors, path) => errors.map((error) => ({ ...error, path: path(error) }));
685
+ var writeFromPath = (path, errors, write) => write(path.length ? movedBy(errors, (error) => error.path.slice(path.length)) : errors);
686
+ var basesIssueOf = (path, data, errors, describe) => {
687
+ for (const { code, path: at } of errors) {
688
+ if (code !== "domain" && code !== "proto" && code !== "unit" || at.length !== path.length || at.some((k, i) => k !== path[i]))
689
+ return;
690
+ }
691
+ const expected = describe(errors.map((error) => error.expected));
692
+ return new ListedIssue(path.slice(), data, [], void 0, expected, messageOf({ expected }));
693
+ };
694
+ var listed = (Issue, path, data, errors, write) => {
695
+ const line = write(errors);
696
+ const expected = writeFromPath(path, errors, write);
697
+ const shared = writesText2 ? sharedMessageOf(errors) : void 0;
698
+ return shared === void 0 ? new Issue(path.slice(), data, errors, line, expected) : new Issue(path.slice(), data, errors, void 0, expected, shared);
699
+ };
700
+ var issueWriterOf = (write, describeBases) => rewritesUnions ? /* @__PURE__ */ (() => {
701
+ class RewrittenIssue extends ListedIssue {
702
+ _m(prefix) {
703
+ const moved = movedBy(this.errors, (error) => [
704
+ ...prefix,
705
+ ...error.path
706
+ ]);
707
+ return new RewrittenIssue([...prefix, ...this.path], this.data, moved, this._l === void 0 ? void 0 : write(moved), this.expected, this.message);
708
+ }
709
+ }
710
+ return (path, data, errors) => basesIssueOf(path, data, errors, describeBases) ?? listed(RewrittenIssue, path, data, errors, write);
711
+ })() : (path, data, errors) => basesIssueOf(path, data, errors, describeBases) ?? listed(ListedIssue, path, data, errors, write);
712
+ var listedIssue = /* @__PURE__ */ issueWriterOf(writeListed, writeBranches);
713
+ var alikeIssue = /* @__PURE__ */ issueWriterOf(writeAlike, (expected) => expected[0]);
714
+
715
+ // ../schema/out/shared/jsonSchema.js
716
+ var ToJsonSchemaError = class extends Error {
717
+ name = "ToJsonSchemaError";
718
+ code;
719
+ context;
720
+ constructor(code, context, path = "", message = `Can't convert "${code}"${path && ` at ${path}`} to JSON Schema. Configure fallback.${code} to write it:
721
+ ${printable(context, { quoteKeys: false, indent: 4 })}`) {
722
+ super(message);
723
+ this.code = code;
724
+ this.context = context;
725
+ }
726
+ hasCode(code) {
727
+ return this.code === code;
728
+ }
729
+ };
730
+ var supportedJsonSchemaTargets = [
731
+ "draft-2020-12",
732
+ "draft-07",
733
+ "openapi-3.0"
734
+ ];
735
+ var writeInvalidJsonSchemaTargetMessage = (target, targets = supportedJsonSchemaTargets) => {
736
+ const quoted = targets.map((t) => `"${t}"`);
737
+ return `JSONSchema target '${target}' is not supported (must be ${quoted.slice(0, -1).join(", ")} or ${quoted[quoted.length - 1]})`;
738
+ };
739
+ var validateStandardJsonSchemaTarget = (target) => {
740
+ if (!includes(supportedJsonSchemaTargets, target))
741
+ throwParseError(writeInvalidJsonSchemaTargetMessage(target));
742
+ return target;
743
+ };
744
+ var openApiNull = () => ({
745
+ type: "string",
746
+ nullable: true,
747
+ enum: [null]
748
+ });
749
+ var writeUnionJsonSchema = (branches, target, meta, metaJson, discriminant) => {
750
+ if (!branches.length)
751
+ return { not: {} };
752
+ if (branches.length === 1)
753
+ return branches[0];
754
+ const unitKey = target === "openapi-3.0" ? "enum" : "const";
755
+ if (branches.every((branch) => (
756
+ // units with no meta but the union's own are an enum
757
+ Object.entries(branch).every(([k, v]) => k === unitKey || k === "type" || v === meta[k] || v === metaJson[k]) && hasKey(branch, unitKey)
758
+ ))) {
759
+ const values = branches.flatMap((branch) => unitKey === "enum" ? branch.enum : [branch.const]);
760
+ const { type } = branches[0];
761
+ return type && branches.every((branch) => branch.type === type) ? { type, enum: values } : { enum: values };
762
+ }
763
+ return discriminant && branches.every(requiresKeyOf(discriminant.key)) ? writeOneOf(branches, discriminant) : { anyOf: branches };
764
+ };
765
+ var requiresKeyOf = (key) => (branch) => "$ref" in branch || !!branch.required?.includes(key);
766
+ var writeOneOf = (branches, { key, values, writesKeyword }) => {
767
+ if (!writesKeyword)
768
+ return { oneOf: branches };
769
+ const mapping = {};
770
+ for (let i = 0; i < branches.length; i++) {
771
+ const ref = branches[i].$ref;
772
+ if (ref)
773
+ for (const value of values[i])
774
+ defineValue(mapping, value, ref);
775
+ }
776
+ return {
777
+ oneOf: branches,
778
+ discriminator: isEmptyObject(mapping) ? { propertyName: key } : { propertyName: key, mapping }
779
+ };
780
+ };
781
+ var writeNullableJsonSchema = (schema, isUnion, target) => {
782
+ if (target === "openapi-3.0" && typeof schema.type === "string") {
783
+ return Object.assign(schema, { nullable: true }, "enum" in schema && {
784
+ enum: [...schema.enum, null]
785
+ });
786
+ }
787
+ return {
788
+ anyOf: [
789
+ ...isUnion && "anyOf" in schema ? schema.anyOf : [schema],
790
+ target === "openapi-3.0" ? openApiNull() : { type: "null" }
791
+ ]
792
+ };
793
+ };
794
+
795
+ // ../schema/out/shared/transform.js
796
+ var TransformErrors = class TransformErrors {
797
+ // a function, so a check can rule out other values by typeof
798
+ constructor(result, data) {
799
+ const errors = Object.setPrototypeOf(() => {
800
+ }, TransformErrors.prototype);
801
+ errors.entries = [{ reversedPath: [], result, data }];
802
+ return errors;
803
+ }
804
+ addTo(gathered, key) {
805
+ if (key !== void 0)
806
+ for (const entry of this.entries)
807
+ entry.reversedPath.push(key);
808
+ if (!gathered)
809
+ return this;
810
+ gathered.entries.push(...this.entries);
811
+ return gathered;
812
+ }
813
+ };
814
+ var holdsOnlyIndices = (data) => {
815
+ const keys = Object.keys(data);
816
+ return keys.length === data.length && (!keys.length || keys[keys.length - 1] === `${keys.length - 1}`) && !Object.getOwnPropertySymbols(data).length;
817
+ };
818
+ var copyOf = (data) => {
819
+ if (isArray(data)) {
820
+ const copy = Array.prototype.slice.call(data);
821
+ const keys = Object.keys(data);
822
+ return keys.length !== copy.length || keys[copy.length - 1] !== `${copy.length - 1}` || Object.getOwnPropertySymbols(data).length ? Object.defineProperties(copy, Object.getOwnPropertyDescriptors({ ...data })) : copy;
823
+ }
824
+ const prototype = Object.getPrototypeOf(data);
825
+ if (prototype === Object.prototype)
826
+ return { ...data };
827
+ return Object.prototype.toString.call(data) === "[object Object]" ? Object.setPrototypeOf({ ...data }, prototype) : data;
828
+ };
829
+ var setOwnValue = (out, k, value) => {
830
+ if (k === "__proto__")
831
+ defineValue(out, k, value);
832
+ else
833
+ out[k] = value;
834
+ };
835
+ var keepOwn = (out, data, k) => {
836
+ if (!(k in out) && hasOwn(data, k))
837
+ setOwnValue(out, k, data[k]);
838
+ };
839
+ var copyDeclared = (data, declared, changes) => {
840
+ "use strict";
841
+ let out = data;
842
+ if (changes) {
843
+ for (let i = 0; i < changes.length; i += 3) {
844
+ if (Object.is(changes[i + 2], changes[i + 1]))
845
+ continue;
846
+ if (out === data)
847
+ out = copyOf(data);
848
+ setOwnValue(out, changes[i], changes[i + 2]);
849
+ }
850
+ if (out !== data)
851
+ for (const k of declared)
852
+ keepOwn(out, data, k);
853
+ }
854
+ for (const k of [
855
+ ...Object.keys(data),
856
+ ...Object.getOwnPropertySymbols(data)
857
+ ]) {
858
+ if (declared.includes(k))
859
+ continue;
860
+ if (out === data)
861
+ out = copyOf(data);
862
+ delete out[k];
863
+ }
864
+ return out;
865
+ };
866
+ var mergeTransformed = (input, l, r) => {
867
+ if (Object.is(r, input))
868
+ return l;
869
+ if (!hasDomain(input, "object") || !hasDomain(l, "object") || !hasDomain(r, "object") || r instanceof TransformErrors)
870
+ return r;
871
+ const merged = copyOf(l);
872
+ for (const k in input)
873
+ if (!hasOwn(r, k))
874
+ delete merged[k];
875
+ for (const k in r) {
876
+ if (!(k in input) || !Object.is(r[k], input[k]))
877
+ setOwnValue(merged, k, r[k]);
878
+ }
879
+ return merged;
880
+ };
881
+
882
+ // ../schema/out/shared/traversal.js
883
+ import { callsSiteText as callsSiteText2, findsOnRead, listsUnions as listsUnions2 } from "./shared/issueFeatures.js";
884
+
885
+ // ../schema/out/shared/utils.js
886
+ var inProgress = {
887
+ definitions: 0,
888
+ resolutions: 0,
889
+ ioReads: 0,
890
+ compositions: 0
891
+ };
892
+ var removedProblemMessage = "problem was removed in 3.0; write message";
893
+
894
+ // ../schema/out/shared/traversal.js
895
+ var noBranches = [];
896
+ var InternalTraversal = class {
897
+ constructor(root, config) {
898
+ this.context = callContext;
899
+ if (onContextRead)
900
+ Object.defineProperty(this, "context", { get: onContextRead });
901
+ this.path = [];
902
+ this._errors = void 0;
903
+ this.root = root;
904
+ this.config = config;
905
+ this.branches = noBranches;
906
+ this.res = void 0;
907
+ this.isTree = true;
908
+ this.tfdById = void 0;
909
+ this.recv = root;
910
+ this.recvAt = 0;
911
+ this.chkOnly = false;
912
+ this.retFrom = void 0;
913
+ }
914
+ /**
915
+ * #### whether {@link currentBranch} (or the traversal root, outside a union) has one or more errors
916
+ */
917
+ hasError() {
918
+ return this.errN !== 0;
919
+ }
920
+ get currentBranch() {
921
+ return this.branches.length === 0 ? void 0 : this.branches[this.branches.length - 1];
922
+ }
923
+ /** its result: the data, or its errors passed to `onFail` if it has any */
924
+ fin(onFail) {
925
+ if (this.hasError())
926
+ return onFail ? onFail(this._errors) : this._errors;
927
+ return this.root;
928
+ }
929
+ /** how many errors the current union branch has, or the traversal has outside a union */
930
+ get errN() {
931
+ const branches = this.branches;
932
+ return branches.length === 0 ? this._errors?.count ?? 0 : branches[branches.length - 1].errN;
933
+ }
934
+ get failFast() {
935
+ return this.branches.length !== 0;
936
+ }
937
+ /** starts counting a union branch's errors */
938
+ pushBr() {
939
+ const branch = { error: void 0, errN: 0 };
940
+ if (this.branches === noBranches)
941
+ this.branches = [branch];
942
+ else
943
+ this.branches.push(branch);
944
+ }
945
+ /** stops counting the innermost union branch's errors, returning it */
946
+ popBr() {
947
+ return this.branches.pop();
948
+ }
949
+ /**
950
+ * @internal
951
+ * Convenience for casting from InternalTraversal to Traversal
952
+ * for cases where the extra methods on the external type are expected, e.g.
953
+ * a morph or predicate.
954
+ */
955
+ get external() {
956
+ return this;
957
+ }
958
+ nodeError(input, data) {
959
+ return this.addError({
960
+ code: input.code,
961
+ path: this.path.slice(),
962
+ data,
963
+ expected: input.description
964
+ });
965
+ }
966
+ /** @internal a validator's failure, as its errors take one */
967
+ _e(data, code, expected, message, text) {
968
+ const issue = {
969
+ code,
970
+ path: this.path.slice(),
971
+ data,
972
+ expected,
973
+ message
974
+ };
975
+ if (callsSiteText2)
976
+ text?.(issue);
977
+ this.addError(issue);
978
+ return this.failFast;
979
+ }
980
+ /** @internal a validator's key, as its errors enter one */
981
+ _k(apply, data, key, ...missing) {
982
+ this.path.push(key);
983
+ const value = data[key];
984
+ const stops = value === void 0 && missing.length && !(key in data) ? this._e(data, "required", ...missing) : !apply(value, this);
985
+ this.path.pop();
986
+ return stops;
987
+ }
988
+ /** @internal */
989
+ failsUnion(branches, site, data) {
990
+ this.addError(issueAt(this.path, site, data, void 0));
991
+ return this.failFast;
992
+ }
993
+ /** @internal */
994
+ addError(error) {
995
+ if (this.currentBranch)
996
+ this.failBranch(error);
997
+ else {
998
+ const errors = errorsOf(this);
999
+ if (findsOnRead || errors._.length)
1000
+ errors._.push(error);
1001
+ else
1002
+ errors._ = [error];
1003
+ }
1004
+ return error;
1005
+ }
1006
+ /**
1007
+ * @internal adds the errors of a validator called with this traversal,
1008
+ * returning its own
1009
+ */
1010
+ piped(errors) {
1011
+ const target = errorsOf(this);
1012
+ if (target._merge)
1013
+ target._merge(errors, this.path);
1014
+ else {
1015
+ for (const issue of errors._) {
1016
+ target._.push(listsUnions2 && issue._m ? issue._m(this.path) : notedAs(issue, { ...issue, path: [...this.path, ...issue.path] }));
1017
+ }
1018
+ }
1019
+ return target;
1020
+ }
1021
+ /** @internal */
1022
+ createErrors() {
1023
+ return new Issues();
1024
+ }
1025
+ failBranch(error) {
1026
+ const branch = this.currentBranch;
1027
+ branch.error = error;
1028
+ branch.errN++;
1029
+ }
1030
+ };
1031
+ var Traversal = class extends InternalTraversal {
1032
+ /**
1033
+ * #### {@link ArkErrors} that will be part of this traversal's finalized result
1034
+ *
1035
+ * ✅ will always be empty for a valid traversal
1036
+ */
1037
+ get errors() {
1038
+ return errorsOf(this);
1039
+ }
1040
+ /**
1041
+ * #### the data being validated or morphed
1042
+ *
1043
+ * ✅ the value at {@link path}, as transformed by any morphs that have already run
1044
+ */
1045
+ get data() {
1046
+ let result = this.recv;
1047
+ for (let i = this.recvAt; i < this.path.length; i++)
1048
+ result = result?.[this.path[i]];
1049
+ return result;
1050
+ }
1051
+ /**
1052
+ * #### a string representing {@link path}
1053
+ *
1054
+ * @propString
1055
+ */
1056
+ get propString() {
1057
+ return pathOf(this);
1058
+ }
1059
+ /**
1060
+ * #### add an {@link ArkError} and return `false`
1061
+ *
1062
+ * ✅ useful for predicates like `.narrow`
1063
+ * ✅ `{ message: "Enter a valid email" }` is the whole sentence an issue says
1064
+ * 🔗 to say what the value must be, as `must be even`, pass `"even"` to {@link mustBe}
1065
+ */
1066
+ reject(input) {
1067
+ this.raise(input);
1068
+ return false;
1069
+ }
1070
+ /**
1071
+ * #### add an {@link ArkError} from a description and return `false`
1072
+ *
1073
+ * ✅ useful for predicates like `.narrow`
1074
+ * 🔗 equivalent to {@link reject}({ expected })
1075
+ */
1076
+ mustBe(expected) {
1077
+ this.raise(expected);
1078
+ return false;
1079
+ }
1080
+ error(input) {
1081
+ this.retFrom ??= errorsOf(this).count;
1082
+ return this.raise(input);
1083
+ }
1084
+ raise(input) {
1085
+ throwOnProblem(input);
1086
+ const supplied = typeof input === "object" ? input : { expected: input };
1087
+ const code = supplied.code ?? "predicate";
1088
+ const issue = {
1089
+ code,
1090
+ path: [
1091
+ ...supplied.prefixPath ?? [],
1092
+ ...supplied.path ?? this.path,
1093
+ ...supplied.relativePath ?? []
1094
+ ],
1095
+ data: "data" in supplied ? supplied.data : this.data,
1096
+ // a keyword raises its errors with the description of what it checks
1097
+ // a code of its own is written without what its rule describes
1098
+ expected: supplied.expected ?? supplied.description ?? (code === "predicate" || supplied.morph ? describePredicate(supplied) : "valid")
1099
+ };
1100
+ if (supplied.message !== void 0)
1101
+ issue.message = supplied.message;
1102
+ else if (supplied.cause !== void 0 && supplied.morph) {
1103
+ try {
1104
+ issue.message = `must be ${issue.expected} (${String(supplied.cause)})`;
1105
+ } catch {
1106
+ }
1107
+ } else if (supplied.actual)
1108
+ issue.message = `must be ${issue.expected} (was ${supplied.actual})`;
1109
+ return this.addError(issue);
1110
+ }
1111
+ };
1112
+ var FirstIssueTraversal = class extends Traversal {
1113
+ get failFast() {
1114
+ return true;
1115
+ }
1116
+ fin(onFail) {
1117
+ this._errors?._.splice(1);
1118
+ return super.fin(onFail);
1119
+ }
1120
+ };
1121
+ var throwOnProblem = (input) => {
1122
+ if (typeof input === "object" && "problem" in input)
1123
+ throwError(removedProblemMessage);
1124
+ };
1125
+ var errorsOf = (ctx) => ctx._errors ??= ctx.createErrors();
1126
+ var applyRejected = (node, data, config, onFail, ctor) => {
1127
+ const ctx = new ctor(data, config);
1128
+ node.tApply(data, ctx);
1129
+ return ctx.fin(onFail);
1130
+ };
1131
+ var receive = (ctx, data) => {
1132
+ ctx.recv = data;
1133
+ ctx.recvAt = ctx.path.length;
1134
+ };
1135
+ var describePredicate = (ctx) => {
1136
+ const fn = ctx.predicate ?? ctx.morph;
1137
+ return `valid according to ${fn && functionNameOf(fn) || "an anonymous predicate"}`;
1138
+ };
1139
+ var tryMorph = (morph) => (In, ctx) => {
1140
+ try {
1141
+ return morph(In, ctx);
1142
+ } catch (cause) {
1143
+ return ctx.error({ code: "predicate", morph, cause });
1144
+ }
1145
+ };
1146
+ var execMorph = (regex) => (s) => regex.exec(s);
1147
+ var callMorph = (ctx, morph, data) => {
1148
+ const { recv, recvAt } = ctx;
1149
+ receive(ctx, data);
1150
+ ctx.retFrom = void 0;
1151
+ const result = morph(data, ctx);
1152
+ ctx.recv = recv;
1153
+ ctx.recvAt = recvAt;
1154
+ return ctx.retFrom === void 0 ? result : returned(ctx, result);
1155
+ };
1156
+ var returned = (ctx, result) => typeof result === "object" && ctx._errors._.includes(result, ctx.retFrom) ? ctx._errors : result;
1157
+ var transform = (ctx, node, data) => node.tfsById ? transformResolution(ctx, node.id, data, node.tTransform, node) : transformAcyclic(ctx, node, data);
1158
+ var transformAcyclic = (ctx, node, data) => transformed(ctx, node.tTransform(data, ctx), data);
1159
+ var transformed = (ctx, result, data) => {
1160
+ if (!(result instanceof TransformErrors))
1161
+ return result;
1162
+ addMorphErrs(ctx, result);
1163
+ return data;
1164
+ };
1165
+ var pipeOf = (node) => node.hasAlias ? pipe : pipeAcyclicOf(node);
1166
+ var pipeAcyclicOf = (node) => node.tfs ? pipeTransformed : node.allowsCtx || node.reportsPred ? pipeChecked : pipeApplied;
1167
+ var pipeChecked = (ctx, node, data) => allowsPiped(ctx, node, data) ? data : errorsOf(ctx);
1168
+ var pipeApplied = (ctx, node, data) => {
1169
+ if (node.allows(data))
1170
+ return data;
1171
+ node.tApply(data, ctx);
1172
+ return errorsOf(ctx);
1173
+ };
1174
+ var pipeTransformed = (ctx, node, data) => allowsPiped(ctx, node, data) ? transformPiped(ctx, node, data, transformAcyclic) : errorsOf(ctx);
1175
+ var pipe = (ctx, node, data) => {
1176
+ if (!node.hasAlias)
1177
+ return pipeAcyclicOf(node)(ctx, node, data);
1178
+ if (!node.allows(data)) {
1179
+ applyPipedResolution(ctx, node, data);
1180
+ return errorsOf(ctx);
1181
+ }
1182
+ if (!node.tfs)
1183
+ return data;
1184
+ const { tfdById, isTree } = ctx;
1185
+ ctx.tfdById = void 0;
1186
+ ctx.isTree = true;
1187
+ const result = transformPiped(ctx, node, data, transform);
1188
+ ctx.tfdById = tfdById;
1189
+ ctx.isTree = isTree;
1190
+ return result;
1191
+ };
1192
+ var allowsPiped = (ctx, node, data) => {
1193
+ if (node.allowsCtx || node.reportsPred)
1194
+ return applyPiped(ctx, node, data);
1195
+ if (node.allows(data))
1196
+ return true;
1197
+ applyPiped(ctx, node, data);
1198
+ return false;
1199
+ };
1200
+ var transformPiped = (ctx, node, data, transformNode) => {
1201
+ const { recv, recvAt } = ctx;
1202
+ const errN = ctx.errN;
1203
+ const result = transformNode(ctx, node, data);
1204
+ ctx.recv = recv;
1205
+ ctx.recvAt = recvAt;
1206
+ return ctx.errN > errN ? errorsOf(ctx) : result;
1207
+ };
1208
+ var applyPiped = (ctx, node, data) => {
1209
+ const errN = ctx.errN;
1210
+ const { recv, recvAt, chkOnly } = ctx;
1211
+ receive(ctx, data);
1212
+ ctx.chkOnly = true;
1213
+ node.tApply(data, ctx);
1214
+ ctx.chkOnly = chkOnly;
1215
+ ctx.recv = recv;
1216
+ ctx.recvAt = recvAt;
1217
+ return ctx.errN === errN;
1218
+ };
1219
+ var applyPipedResolution = (ctx, node, data) => {
1220
+ const { recv, recvAt, chkOnly } = ctx;
1221
+ receive(ctx, data);
1222
+ ctx.chkOnly = true;
1223
+ const piped = traversalOf(ctx, data);
1224
+ piped.chkOnly = true;
1225
+ const { _errors } = applyCyclic(node, data, piped);
1226
+ if (_errors)
1227
+ addErrors(ctx, _errors);
1228
+ ctx.chkOnly = chkOnly;
1229
+ ctx.recv = recv;
1230
+ ctx.recvAt = recvAt;
1231
+ };
1232
+ var transformsValid = (ctx) => ctx.branches.length === 0 && !ctx.chkOnly;
1233
+ var transformedInApply = (ctx, result) => {
1234
+ if (result instanceof TransformErrors)
1235
+ addMorphErrs(ctx, result);
1236
+ };
1237
+ var transformIfAllowed = (ctx, node, data) => {
1238
+ if (!transformsValid(ctx))
1239
+ return false;
1240
+ if (node.hasAlias) {
1241
+ const untracked = allowsAcyclic(node, data);
1242
+ if (!(untracked ?? allowsInTraversal(node, data, traversalOf(ctx, data))))
1243
+ return false;
1244
+ ctx.isTree = untracked === void 0;
1245
+ ctx.tfdById = void 0;
1246
+ } else if (!allowsInBranch(ctx, node, data))
1247
+ return false;
1248
+ transformedInApply(ctx, transform(ctx, node, data));
1249
+ return true;
1250
+ };
1251
+ var allowsInBranch = (ctx, node, data) => node.checksCtx ? allowsInBranchBy(ctx, node.tAllows, data, node) : node.allows(data);
1252
+ var silentCtx = {
1253
+ mustBe: () => false,
1254
+ reject: () => false,
1255
+ get context() {
1256
+ return onContextRead ? onContextRead() : callContext;
1257
+ }
1258
+ };
1259
+ var callContext;
1260
+ var inContext = (context, run) => {
1261
+ const outer = callContext;
1262
+ callContext = context;
1263
+ try {
1264
+ return run();
1265
+ } finally {
1266
+ callContext = outer;
1267
+ }
1268
+ };
1269
+ var onContextRead;
1270
+ var readingContextWith = (onRead, run) => {
1271
+ const outer = onContextRead;
1272
+ onContextRead = onRead;
1273
+ try {
1274
+ return run();
1275
+ } finally {
1276
+ onContextRead = outer;
1277
+ }
1278
+ };
1279
+ var withContextOf = (t, context) => {
1280
+ const standard = t["~standard"];
1281
+ return Object.assign((data) => inContext(context, () => t(data)), {
1282
+ assert: (data) => inContext(context, () => t.assert(data)),
1283
+ allows: (data) => inContext(context, () => t.allows(data)),
1284
+ // as the Type's, with its vendor's own members like _c, but validating in context
1285
+ "~standard": Object.defineProperties({}, {
1286
+ ...Object.getOwnPropertyDescriptors(standard),
1287
+ validate: {
1288
+ value: (value, options) => inContext(context, () => standard.validate(value, options)),
1289
+ enumerable: true
1290
+ }
1291
+ })
1292
+ });
1293
+ };
1294
+ var allowsInBranchBy = (ctx, allows, data, node) => {
1295
+ const pathLength = ctx.path.length;
1296
+ ctx.pushBr();
1297
+ const allowed = allows.call(node, data, ctx);
1298
+ if (ctx.path.length !== pathLength)
1299
+ ctx.path.length = pathLength;
1300
+ return ctx.popBr().errN === 0 && allowed;
1301
+ };
1302
+ var disallowed = () => false;
1303
+ var rejectedBy;
1304
+ var rejectedValue;
1305
+ var rejected = (allows, value) => {
1306
+ if (typeof value === "string") {
1307
+ rejectedBy = allows;
1308
+ rejectedValue = value;
1309
+ }
1310
+ return false;
1311
+ };
1312
+ var rejects = (allows, value) => {
1313
+ if (value !== rejectedValue || allows !== rejectedBy)
1314
+ return !allows(value);
1315
+ rejectedBy = rejectedValue = void 0;
1316
+ return true;
1317
+ };
1318
+ var minStickyLength = 16;
1319
+ var stickyCopies = /* @__PURE__ */ new WeakMap();
1320
+ var matchesRepeated = (pattern, data) => {
1321
+ if (data.length < minStickyLength)
1322
+ return pattern.test(data);
1323
+ let sticky = stickyCopies.get(pattern);
1324
+ if (!sticky) {
1325
+ sticky = new RegExp(pattern.source.slice(1, -1), `${pattern.flags}y`);
1326
+ stickyCopies.set(pattern, sticky);
1327
+ }
1328
+ sticky.lastIndex = 0;
1329
+ return sticky.test(data) && sticky.lastIndex === data.length;
1330
+ };
1331
+ var addErrors = (ctx, errors) => {
1332
+ if (errors === ctx._errors)
1333
+ return;
1334
+ const target = errorsOf(ctx);
1335
+ if (target._merge)
1336
+ target._merge(errors, ctx.path);
1337
+ else
1338
+ mergeIssues(target, errors, ctx.path);
1339
+ };
1340
+ var addMorphErrs = (ctx, errors, key) => {
1341
+ const { path, recv, recvAt } = ctx;
1342
+ for (const { reversedPath, result, data } of errors.entries) {
1343
+ ctx.path = [...path];
1344
+ if (key !== void 0)
1345
+ ctx.path.push(key);
1346
+ for (let i = reversedPath.length - 1; i >= 0; i--)
1347
+ ctx.path.push(reversedPath[i]);
1348
+ receive(ctx, data);
1349
+ addErrors(ctx, result);
1350
+ }
1351
+ ctx.path = path;
1352
+ ctx.recv = recv;
1353
+ ctx.recvAt = recvAt;
1354
+ };
1355
+ var transformResolution = (ctx, id, data, transform2, node) => {
1356
+ if (!ctx.isTree || !hasDomain(data, "object"))
1357
+ return transformed(ctx, transform2.call(node, data, ctx), data);
1358
+ const transformedByData = (ctx.tfdById ??= {})[id] ??= /* @__PURE__ */ new Map();
1359
+ if (transformedByData.has(data)) {
1360
+ const result2 = transformedByData.get(data);
1361
+ if (result2 !== transforming)
1362
+ return result2;
1363
+ const placeholder2 = isArray(data) ? [] : {};
1364
+ transformedByData.set(data, placeholder2);
1365
+ return placeholder2;
1366
+ }
1367
+ transformedByData.set(data, transforming);
1368
+ const result = transformed(ctx, transform2.call(node, data, ctx), data);
1369
+ const placeholder = transformedByData.get(data);
1370
+ if (placeholder === transforming || !canFill(placeholder, result)) {
1371
+ transformedByData.set(data, result);
1372
+ if (hasDomain(result, "object"))
1373
+ transformedByData.set(result, result);
1374
+ return result;
1375
+ }
1376
+ Object.defineProperties(placeholder, Object.getOwnPropertyDescriptors(result));
1377
+ transformedByData.set(placeholder, placeholder);
1378
+ return Object.setPrototypeOf(placeholder, Object.getPrototypeOf(result));
1379
+ };
1380
+ var Resolutions = class {
1381
+ seen = {};
1382
+ // untracked until data is deep or broad enough to be cyclic
1383
+ tracked = true;
1384
+ // reused by depth, so entering doesn't allocate
1385
+ frames = void 0;
1386
+ depth = 0;
1387
+ /** how many nodes were entered while untracked, bounded so a cycle can't run forever */
1388
+ visits = 0;
1389
+ /** whether a failure was recorded, so untracked lookups still find it */
1390
+ hasFailed = false;
1391
+ /** how many resolutions were entered, numbering each */
1392
+ nEntered = 0;
1393
+ assumedFrom = Number.POSITIVE_INFINITY;
1394
+ assumed = void 0;
1395
+ /** the first reported invalid resolution reached */
1396
+ invalid = void 0;
1397
+ };
1398
+ var resolutionsOf = (ctx) => ctx.res ??= new Resolutions();
1399
+ var enterResolution = (ctx, id, data) => {
1400
+ const res = resolutionsOf(ctx);
1401
+ const states = res.tracked || res.hasFailed ? res.seen[id] : void 0;
1402
+ const state = states?.get(data);
1403
+ if (state !== void 0) {
1404
+ if (typeof state === "number") {
1405
+ if (state < res.assumedFrom)
1406
+ res.assumedFrom = state;
1407
+ return true;
1408
+ }
1409
+ if (typeof state === "boolean")
1410
+ return state;
1411
+ if (ctx.currentBranch) {
1412
+ ctx.failBranch(state.error);
1413
+ return false;
1414
+ }
1415
+ if (state.reported) {
1416
+ res.invalid ??= state;
1417
+ return false;
1418
+ }
1419
+ }
1420
+ if (!res.tracked && (res.depth >= maxAliasDepth || ++res.visits > maxAliasVisits))
1421
+ throw untrackedBound;
1422
+ const frame = (res.frames ??= [])[res.depth++] ??= {
1423
+ id,
1424
+ data,
1425
+ entered: 0,
1426
+ errN: 0,
1427
+ outerInvalid: void 0,
1428
+ assumedOuter: 0,
1429
+ assumedLength: 0
1430
+ };
1431
+ frame.id = id;
1432
+ frame.data = data;
1433
+ frame.errN = ctx.errN;
1434
+ if (!res.tracked)
1435
+ return;
1436
+ (states ?? (res.seen[id] = /* @__PURE__ */ new Map())).set(data, ++res.nEntered);
1437
+ frame.entered = res.nEntered;
1438
+ frame.outerInvalid = res.invalid;
1439
+ res.invalid = void 0;
1440
+ frame.assumedOuter = res.assumedFrom;
1441
+ frame.assumedLength = (res.assumed ??= []).length;
1442
+ res.assumedFrom = Number.POSITIVE_INFINITY;
1443
+ return;
1444
+ };
1445
+ var exitResolution = (ctx, allowed) => {
1446
+ const res = ctx.res;
1447
+ const frame = res.frames[--res.depth];
1448
+ if (!res.tracked)
1449
+ return allowed ?? exitUntracked(ctx, frame);
1450
+ const invalid = res.invalid;
1451
+ res.invalid = frame.outerInvalid;
1452
+ const valid = allowed ?? (invalid === void 0 && ctx.errN === frame.errN);
1453
+ const data = frame.data;
1454
+ const states = res.seen[frame.id];
1455
+ if (typeof data === "object" ? data === null : typeof data !== "function") {
1456
+ res.assumedFrom = frame.assumedOuter;
1457
+ states.delete(data);
1458
+ return valid;
1459
+ }
1460
+ const state = valid || allowed === false ? valid : invalidResolution(ctx, invalid?.error);
1461
+ const assumedFrom = res.assumedFrom;
1462
+ res.assumedFrom = frame.assumedOuter;
1463
+ const assumed = res.assumed;
1464
+ if (valid && assumedFrom < frame.entered) {
1465
+ assumed.push(states, data);
1466
+ if (assumedFrom < res.assumedFrom)
1467
+ res.assumedFrom = assumedFrom;
1468
+ return true;
1469
+ }
1470
+ if (assumed.length !== frame.assumedLength) {
1471
+ for (let i = frame.assumedLength; i < assumed.length; i += 2) {
1472
+ const assumedStates = assumed[i];
1473
+ if (valid)
1474
+ assumedStates.set(assumed[i + 1], true);
1475
+ else
1476
+ assumedStates.delete(assumed[i + 1]);
1477
+ }
1478
+ assumed.length = frame.assumedLength;
1479
+ }
1480
+ states.set(data, state);
1481
+ if (typeof state === "object" && state.reported)
1482
+ res.invalid ??= state;
1483
+ return valid;
1484
+ };
1485
+ var exitUntracked = (ctx, frame) => {
1486
+ if (ctx.errN === frame.errN)
1487
+ return true;
1488
+ if (!hasDomain(frame.data, "object"))
1489
+ return false;
1490
+ const res = ctx.res;
1491
+ (res.seen[frame.id] ??= /* @__PURE__ */ new Map()).set(frame.data, invalidResolution(ctx));
1492
+ res.hasFailed = true;
1493
+ return false;
1494
+ };
1495
+ var invalidResolution = (ctx, error = ctx.currentBranch?.error ?? lastOf(ctx._errors._i ?? ctx._errors._)) => ({
1496
+ error,
1497
+ reported: !ctx.currentBranch
1498
+ });
1499
+ var traversalOf = (ctx, data) => new ctx.constructor(data, ctx.config);
1500
+ var lastOf = (array) => array[array.length - 1];
1501
+ var transforming = /* @__PURE__ */ noSuggest("transforming");
1502
+ var maxAliasDepth = 64;
1503
+ var maxAliasVisits = 1e3;
1504
+ var continuation;
1505
+ var continuationConfig;
1506
+ var aliasVisits = {
1507
+ count: 0,
1508
+ tracked: false,
1509
+ // data past the depth bound may be cyclic, so every path past it continues one tracked traversal
1510
+ exceed: (data) => {
1511
+ aliasVisits.count += maxAliasDepth;
1512
+ if (aliasVisits.count > maxAliasVisits) {
1513
+ aliasVisits.count = Number.POSITIVE_INFINITY;
1514
+ return false;
1515
+ }
1516
+ aliasVisits.tracked = true;
1517
+ return continuation ??= new InternalTraversal(data, continuationConfig);
1518
+ }
1519
+ };
1520
+ var untrackedBound = /* @__PURE__ */ noSuggest("untrackedBound");
1521
+ var applyCyclic = (node, data, ctx) => {
1522
+ if (node.tfs) {
1523
+ applyResolution(node.trackedId, node, data, ctx);
1524
+ return ctx;
1525
+ }
1526
+ resolutionsOf(ctx).tracked = false;
1527
+ try {
1528
+ node.tApply(data, ctx);
1529
+ } catch (e) {
1530
+ if (e !== untrackedBound)
1531
+ throw e;
1532
+ ctx = traversalOf(ctx, data);
1533
+ applyResolution(node.trackedId, node, data, ctx);
1534
+ }
1535
+ return ctx;
1536
+ };
1537
+ var applyResolution = (id, node, data, ctx) => {
1538
+ if (enterResolution(ctx, id, data) !== void 0)
1539
+ return;
1540
+ node.tApply(data, ctx);
1541
+ exitResolution(ctx);
1542
+ };
1543
+ var enterApplied = (ctx, id, data) => {
1544
+ const entered = enterResolution(ctx, id, data);
1545
+ return entered === void 0 ? void 0 : entered || !ctx.failFast;
1546
+ };
1547
+ var exitApplied = (ctx, continues) => {
1548
+ exitResolution(ctx);
1549
+ return continues;
1550
+ };
1551
+ var applyMember = (node, data, ctx, member = node) => member.hasAlias ? applyResolution(member.id, node, data, ctx) : node.tApply(data, ctx);
1552
+ var applyValue = (node, data, ctx, tfs = true) => {
1553
+ if (node.tfs && (tfs && (node.hasMorph || node.hasAlias) ? transformIfAllowed(ctx, node, data) : allowsInBranch(ctx, node, data)))
1554
+ return;
1555
+ if (node.entersAlias)
1556
+ applyResolution(node.id, node, data, ctx);
1557
+ else
1558
+ node.tApply(data, ctx);
1559
+ };
1560
+ var allowsUntracked = (node, data) => {
1561
+ if (inProgress.definitions || inProgress.resolutions || node.checksCtx)
1562
+ return;
1563
+ const outerVisits = aliasVisits.count;
1564
+ const outerContinuation = continuation;
1565
+ const outerConfig = continuationConfig;
1566
+ aliasVisits.count = 0;
1567
+ continuation = void 0;
1568
+ continuationConfig = node.$.cfg;
1569
+ let allowed;
1570
+ try {
1571
+ allowed = node.tAllows(data, 0);
1572
+ } catch (e) {
1573
+ aliasVisits.count = outerVisits;
1574
+ continuation = outerContinuation;
1575
+ continuationConfig = outerConfig;
1576
+ throw e;
1577
+ }
1578
+ const exceeded = aliasVisits.count > maxAliasVisits;
1579
+ aliasVisits.count = outerVisits;
1580
+ continuation = outerContinuation;
1581
+ continuationConfig = outerConfig;
1582
+ return exceeded ? void 0 : allowed;
1583
+ };
1584
+ var allowsAcyclic = (node, data) => {
1585
+ if (inProgress.definitions || inProgress.resolutions || node.checksCtx)
1586
+ return;
1587
+ const outerTracked = aliasVisits.tracked;
1588
+ const outerVisits = aliasVisits.count;
1589
+ const outerContinuation = continuation;
1590
+ const outerConfig = continuationConfig;
1591
+ aliasVisits.tracked = false;
1592
+ aliasVisits.count = 0;
1593
+ continuation = void 0;
1594
+ continuationConfig = node.$.cfg;
1595
+ try {
1596
+ const allowed = node.tAllows(data, 0);
1597
+ return aliasVisits.count > maxAliasVisits || aliasVisits.tracked ? void 0 : allowed;
1598
+ } finally {
1599
+ aliasVisits.tracked ||= outerTracked;
1600
+ aliasVisits.count = outerVisits;
1601
+ continuation = outerContinuation;
1602
+ continuationConfig = outerConfig;
1603
+ }
1604
+ };
1605
+ var allowsInContext = (node, data, config, ctor = Traversal) => allowsInTraversal(node, data, new ctor(data, config));
1606
+ var allowsInTraversal = (node, data, ctx) => node.tAllows(data, ctx) && !ctx.hasError();
1607
+ var canFill = (placeholder, result) => typeof result === "object" && result !== null && (isArray(placeholder) ? isArray(result) : objectKindOf(result) === void 0);
1608
+ var travKey = (key, fn, ctx) => {
1609
+ if (!ctx || typeof ctx === "number")
1610
+ return fn();
1611
+ ctx.path.push(key);
1612
+ const result = fn();
1613
+ ctx.path.pop();
1614
+ return result;
1615
+ };
1616
+ var computeDefaultValueMorph = (key, value, defaultInput, node = value, isThunkInput = isThunk(defaultInput)) => {
1617
+ const thunk = isThunkInput ? defaultInput : void 0;
1618
+ const write = (data, v) => {
1619
+ setOwnValue(data, key, v);
1620
+ return data;
1621
+ };
1622
+ if (!thunk && !node.alters && !node.hasAlias)
1623
+ return (data) => write(data, defaultInput);
1624
+ if (!node.allowsCtx && !node.ctxMorph) {
1625
+ return (data) => {
1626
+ const input = thunk ? thunk() : defaultInput;
1627
+ const output = value.traverse(input);
1628
+ if (output instanceof Issues)
1629
+ return new TransformErrors(output, input).addTo(void 0, key);
1630
+ return write(data, output);
1631
+ };
1632
+ }
1633
+ let transformingDefault = false;
1634
+ return (data, ctx) => {
1635
+ if (transformingDefault)
1636
+ return data;
1637
+ if (!thunk && !node.tfs)
1638
+ return write(data, defaultInput);
1639
+ transformingDefault = true;
1640
+ try {
1641
+ write(data, travKey(key, () => value(thunk ? thunk() : defaultInput, ctx), ctx));
1642
+ } finally {
1643
+ transformingDefault = false;
1644
+ }
1645
+ return data;
1646
+ };
1647
+ };
1648
+
1649
+ // ../schema/out/structure/shared.js
1650
+ var arrayIndexSource = `^(?:0|[1-9]\\d*)$`;
1651
+ var arrayIndexMatcher = /* @__PURE__ */ new RegExp(arrayIndexSource);
1652
+
1653
+ // ../schema/out/runtime.js
1654
+ var runtimeConfig = {
1655
+ // validation never generates code, so it never needs eval
1656
+ jitless: true,
1657
+ onFail: null
1658
+ };
1659
+ var runtimeScope = /* @__PURE__ */ Object.freeze({
1660
+ cfg: runtimeConfig
1661
+ });
1662
+ var checkConfigured;
1663
+ var programConfig;
1664
+ var configureIslands;
1665
+ var configure = (config, fingerprint) => {
1666
+ if (Object.isFrozen(runtimeConfig) || checkConfigured) {
1667
+ return isSameConfig(config, programConfig ?? {}) ? config : throwParseError(reconfiguredMessage);
1668
+ }
1669
+ const received = fingerprintOf(config);
1670
+ if (fingerprint !== void 0 && fingerprint !== received)
1671
+ return throwParseError(configuredUnlikeBuildMessage);
1672
+ configureIslands?.(config);
1673
+ if ("onFail" in config)
1674
+ runtimeConfig.onFail = config.onFail;
1675
+ let isRechecked = false;
1676
+ checkConfigured = (built) => {
1677
+ if (!isRechecked && fingerprintOf(config) !== received)
1678
+ throwParseError(writtenConfigMessage);
1679
+ isRechecked = true;
1680
+ if (fingerprint === void 0 || built !== fingerprint)
1681
+ throwParseError(configMismatchMessage);
1682
+ };
1683
+ programConfig = copyConfig(config);
1684
+ return config;
1685
+ };
1686
+ var configuredWriterOf = (code, k) => (...args) => programConfig[code][k](...args);
1687
+ var configuredFallbackOf = (code) => (ctx) => {
1688
+ const { fallback } = programConfig.toJsonSchema;
1689
+ return (typeof fallback === "function" ? fallback : fallback[code] ?? fallback.default)(ctx);
1690
+ };
1691
+ var fingerprintOf = (config) => {
1692
+ const text = staticTextOf(config, []);
1693
+ let a = 1;
1694
+ let b = 2;
1695
+ for (let i = 0; i < text.length; i++) {
1696
+ a = Math.imul(a ^ text.charCodeAt(i), 2654435761);
1697
+ b = Math.imul(b ^ text.charCodeAt(i), 1597334677);
1698
+ }
1699
+ return `${(a >>> 0).toString(36)}_${(b >>> 0).toString(36)}`;
1700
+ };
1701
+ var staticTextOf = (value, seen) => {
1702
+ if (value === null || typeof value !== "object" && typeof value !== "function") {
1703
+ return typeof value === "string" ? JSON.stringify(value) : typeof value === "bigint" ? `${value}n` : Object.is(value, -0) ? "-0" : String(value);
1704
+ }
1705
+ const index = seen.indexOf(value);
1706
+ if (index !== -1)
1707
+ return `#${index}`;
1708
+ seen.push(value);
1709
+ if (typeof value === "function")
1710
+ return "function";
1711
+ const tag = Object.prototype.toString.call(value);
1712
+ const builtins2 = [
1713
+ null,
1714
+ Object.prototype,
1715
+ Array.prototype,
1716
+ Date.prototype,
1717
+ RegExp.prototype
1718
+ ];
1719
+ const enumerable = [];
1720
+ for (const k in value)
1721
+ enumerable.push(k);
1722
+ let entries = "";
1723
+ for (const k of /* @__PURE__ */ new Set([...enumerable, ...Reflect.ownKeys(value)])) {
1724
+ entries += `${enumerable.includes(k) ? "" : "~"}${JSON.stringify(
1725
+ // a symbol key prints as its registered name
1726
+ typeof k === "symbol" ? [Symbol.keyFor(k)] : k
1727
+ )}:${staticTextOf(value[k], seen)},`;
1728
+ }
1729
+ return `${tag}${builtins2.indexOf(Object.getPrototypeOf(value))}${tag === "[object Date]" ? Number(value) : tag === "[object RegExp]" ? `${value}` : ""}{${entries}}`;
1730
+ };
1731
+ var fixConfig = (() => {
1732
+ Object.freeze(runtimeConfig);
1733
+ checkConfigured?.();
1734
+ });
1735
+ var fixConfigured = (fingerprint, path, config) => {
1736
+ Object.freeze(runtimeConfig);
1737
+ if (!checkConfigured)
1738
+ return throwParseError(writeCreatedBeforeConfigureMessage(path, config));
1739
+ checkConfigured(fingerprint);
1740
+ };
1741
+ var shareConfig = (configureArktype) => {
1742
+ configureIslands = configureArktype;
1743
+ if (programConfig)
1744
+ configureArktype(programConfig);
1745
+ };
1746
+ var configuredUnlikeBuildMessage = "configure() received values other than its build's";
1747
+ var reconfiguredMessage = "configure() must be called once, before any Type is created";
1748
+ var writtenConfigMessage = "configure()'s argument was modified after it was called";
1749
+ var configMismatchMessage = "An artifact must run under the configuration it was built with";
1750
+ var writeCreatedBeforeConfigureMessage = (path, config) => `${path} creates a Type before configure() runs
1751
+ Import the config module before any module that creates a Type: first in the entry or test setup file that loads ${path}, or at the top of ${path}:
1752
+ import "${config}"`;
1753
+ export {
1754
+ Issues as ArkErrors,
1755
+ FirstIssueTraversal,
1756
+ FirstIssues,
1757
+ InternalTraversal,
1758
+ ToJsonSchemaError,
1759
+ TransformErrors,
1760
+ Traversal,
1761
+ ThrownIssues as TraversalError,
1762
+ addErrors,
1763
+ addMorphErrs,
1764
+ aliasVisits,
1765
+ alikeIssue,
1766
+ allowsAcyclic,
1767
+ allowsInBranch,
1768
+ allowsInBranchBy,
1769
+ allowsInContext,
1770
+ allowsUntracked,
1771
+ applyCyclic,
1772
+ applyIssues,
1773
+ applyMember,
1774
+ applyRejected,
1775
+ applyResolution,
1776
+ applyValue,
1777
+ arrayIndexMatcher,
1778
+ callMorph,
1779
+ codedIssue,
1780
+ computeDefaultValueMorph,
1781
+ configMismatchMessage,
1782
+ configure,
1783
+ configuredFallbackOf,
1784
+ configuredUnlikeBuildMessage,
1785
+ configuredWriterOf,
1786
+ copyDeclared,
1787
+ copyOf,
1788
+ describeActual,
1789
+ describeCollapsibleDate,
1790
+ describePredicate,
1791
+ describeUnwrittenActual,
1792
+ disallowed,
1793
+ enInfo,
1794
+ enterApplied,
1795
+ enterResolution,
1796
+ errorsOf,
1797
+ execMorph,
1798
+ exitApplied,
1799
+ exitResolution,
1800
+ failsKey,
1801
+ failsKeySite,
1802
+ failsSite,
1803
+ fingerprintOf,
1804
+ fixConfig,
1805
+ fixConfigured,
1806
+ foundErrors,
1807
+ holdsOnlyIndices,
1808
+ inContext,
1809
+ isCustomIssue,
1810
+ issueAt,
1811
+ issuesOf,
1812
+ keepOwn,
1813
+ lineOf,
1814
+ listedIssue,
1815
+ matchesRepeated,
1816
+ maxAliasDepth,
1817
+ maxAliasVisits,
1818
+ mergeIssues,
1819
+ mergeTransformed,
1820
+ messageOf,
1821
+ missingTextOf,
1822
+ movedIssue,
1823
+ notedAs,
1824
+ pathOf,
1825
+ pipe,
1826
+ pipeApplied,
1827
+ pipeChecked,
1828
+ pipeOf,
1829
+ pipeTransformed,
1830
+ printKind,
1831
+ printedActualOf,
1832
+ readingContextWith,
1833
+ reconfiguredMessage,
1834
+ rejected,
1835
+ rejects,
1836
+ runtimeConfig,
1837
+ runtimeScope,
1838
+ setOwnValue,
1839
+ shareConfig,
1840
+ sharedMessageOf,
1841
+ silentCtx,
1842
+ supportedJsonSchemaTargets,
1843
+ throwIssues,
1844
+ throwOnDefault,
1845
+ throwOnProblem,
1846
+ transform,
1847
+ transformIfAllowed,
1848
+ transformResolution,
1849
+ transformed,
1850
+ transformedInApply,
1851
+ transformsValid,
1852
+ travKey,
1853
+ tryMorph,
1854
+ validateStandardJsonSchemaTarget,
1855
+ withContextOf,
1856
+ writeCreatedBeforeConfigureMessage,
1857
+ writeDomainActual,
1858
+ writeFromPath,
1859
+ writeLengthActual,
1860
+ writeLine,
1861
+ writeListed,
1862
+ writeMessage,
1863
+ writeNotEqualActual,
1864
+ writeNullableJsonSchema,
1865
+ writeProtoActual,
1866
+ writeUnionJsonSchema,
1867
+ writeUnitActual,
1868
+ writeUnitMessage,
1869
+ writtenConfigMessage
1870
+ };