@agent-ix/quoin 0.23.1 → 0.26.1

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 (516) hide show
  1. package/README.md +8 -258
  2. package/bin/launcher.js +138 -0
  3. package/package.json +22 -123
  4. package/.agents/plugins/marketplace.json +0 -14
  5. package/.claude-plugin/marketplace.json +0 -16
  6. package/.claude-plugin/plugin.json +0 -8
  7. package/.codex-plugin/plugin.json +0 -27
  8. package/.github/plugin/marketplace.json +0 -16
  9. package/bin/quoin.js +0 -21
  10. package/default-modules.yaml +0 -107
  11. package/dist/advisor/advise.d.ts +0 -199
  12. package/dist/advisor/advise.d.ts.map +0 -1
  13. package/dist/advisor/index.d.ts +0 -10
  14. package/dist/advisor/index.d.ts.map +0 -1
  15. package/dist/advisor/methods.d.ts +0 -60
  16. package/dist/advisor/methods.d.ts.map +0 -1
  17. package/dist/advisor-B0rESCx1.js +0 -63
  18. package/dist/assurance/graph.d.ts +0 -87
  19. package/dist/assurance/graph.d.ts.map +0 -1
  20. package/dist/assurance/index.d.ts +0 -9
  21. package/dist/assurance/index.d.ts.map +0 -1
  22. package/dist/assurance/render.d.ts +0 -3
  23. package/dist/assurance/render.d.ts.map +0 -1
  24. package/dist/auditor/audit.d.ts +0 -146
  25. package/dist/auditor/audit.d.ts.map +0 -1
  26. package/dist/auditor/combinatorial.d.ts +0 -53
  27. package/dist/auditor/combinatorial.d.ts.map +0 -1
  28. package/dist/auditor/index.d.ts +0 -9
  29. package/dist/auditor/index.d.ts.map +0 -1
  30. package/dist/auditor-Dd3i9Aqx.js +0 -340
  31. package/dist/base-gAClyCNd.js +0 -137
  32. package/dist/base.d.ts +0 -23
  33. package/dist/base.d.ts.map +0 -1
  34. package/dist/catalog.d.ts +0 -33
  35. package/dist/catalog.d.ts.map +0 -1
  36. package/dist/change-assurance/attestations.d.ts +0 -7
  37. package/dist/change-assurance/attestations.d.ts.map +0 -1
  38. package/dist/change-assurance/index.d.ts +0 -14
  39. package/dist/change-assurance/index.d.ts.map +0 -1
  40. package/dist/change-assurance/integrity.d.ts +0 -11
  41. package/dist/change-assurance/integrity.d.ts.map +0 -1
  42. package/dist/change-assurance/records.d.ts +0 -22
  43. package/dist/change-assurance/records.d.ts.map +0 -1
  44. package/dist/change-assurance/schema-assets.d.ts +0 -8
  45. package/dist/change-assurance/schema-assets.d.ts.map +0 -1
  46. package/dist/change-assurance/store.d.ts +0 -18
  47. package/dist/change-assurance/store.d.ts.map +0 -1
  48. package/dist/change-assurance/types.d.ts +0 -180
  49. package/dist/change-assurance/types.d.ts.map +0 -1
  50. package/dist/change-assurance/verify.d.ts +0 -4
  51. package/dist/change-assurance/verify.d.ts.map +0 -1
  52. package/dist/change-assurance-CyKLPeKa.js +0 -1236
  53. package/dist/cli.d.ts +0 -61
  54. package/dist/cli.d.ts.map +0 -1
  55. package/dist/cli.js +0 -34
  56. package/dist/commands/advise.d.ts +0 -16
  57. package/dist/commands/advise.d.ts.map +0 -1
  58. package/dist/commands/advise.js +0 -234
  59. package/dist/commands/assurance.d.ts +0 -14
  60. package/dist/commands/assurance.d.ts.map +0 -1
  61. package/dist/commands/assurance.js +0 -204
  62. package/dist/commands/catalog/index.d.ts +0 -2
  63. package/dist/commands/catalog/index.d.ts.map +0 -1
  64. package/dist/commands/catalog/index.js +0 -2
  65. package/dist/commands/catalog/list.d.ts +0 -11
  66. package/dist/commands/catalog/list.d.ts.map +0 -1
  67. package/dist/commands/catalog/list.js +0 -22
  68. package/dist/commands/catalog/methods.d.ts +0 -12
  69. package/dist/commands/catalog/methods.d.ts.map +0 -1
  70. package/dist/commands/catalog/methods.js +0 -43
  71. package/dist/commands/catalog/show.d.ts +0 -13
  72. package/dist/commands/catalog/show.d.ts.map +0 -1
  73. package/dist/commands/catalog/show.js +0 -25
  74. package/dist/commands/catalog/validate.d.ts +0 -10
  75. package/dist/commands/catalog/validate.d.ts.map +0 -1
  76. package/dist/commands/catalog/validate.js +0 -27
  77. package/dist/commands/change-assurance/common.d.ts +0 -37
  78. package/dist/commands/change-assurance/common.d.ts.map +0 -1
  79. package/dist/commands/change-assurance/index.d.ts +0 -8
  80. package/dist/commands/change-assurance/index.d.ts.map +0 -1
  81. package/dist/commands/change-assurance/index.js +0 -12
  82. package/dist/commands/change-assurance/intake.d.ts +0 -15
  83. package/dist/commands/change-assurance/intake.d.ts.map +0 -1
  84. package/dist/commands/change-assurance/intake.js +0 -53
  85. package/dist/commands/change-assurance/receipt.d.ts +0 -21
  86. package/dist/commands/change-assurance/receipt.d.ts.map +0 -1
  87. package/dist/commands/change-assurance/receipt.js +0 -99
  88. package/dist/commands/change-assurance/recover.d.ts +0 -13
  89. package/dist/commands/change-assurance/recover.d.ts.map +0 -1
  90. package/dist/commands/change-assurance/recover.js +0 -29
  91. package/dist/commands/change-assurance/schema.d.ts +0 -13
  92. package/dist/commands/change-assurance/schema.d.ts.map +0 -1
  93. package/dist/commands/change-assurance/schema.js +0 -40
  94. package/dist/commands/change-assurance/seal-attestation.d.ts +0 -15
  95. package/dist/commands/change-assurance/seal-attestation.d.ts.map +0 -1
  96. package/dist/commands/change-assurance/seal-attestation.js +0 -58
  97. package/dist/commands/change-assurance/seal-record.d.ts +0 -14
  98. package/dist/commands/change-assurance/seal-record.d.ts.map +0 -1
  99. package/dist/commands/change-assurance/seal-record.js +0 -53
  100. package/dist/commands/change-assurance/verify-receipt.d.ts +0 -13
  101. package/dist/commands/change-assurance/verify-receipt.d.ts.map +0 -1
  102. package/dist/commands/change-assurance/verify-receipt.js +0 -41
  103. package/dist/commands/completeness.d.ts +0 -16
  104. package/dist/commands/completeness.d.ts.map +0 -1
  105. package/dist/commands/completeness.js +0 -49
  106. package/dist/commands/config/doctor.d.ts +0 -7
  107. package/dist/commands/config/doctor.d.ts.map +0 -1
  108. package/dist/commands/config/doctor.js +0 -15
  109. package/dist/commands/config/edit.d.ts +0 -7
  110. package/dist/commands/config/edit.d.ts.map +0 -1
  111. package/dist/commands/config/edit.js +0 -13
  112. package/dist/commands/config/get.d.ts +0 -11
  113. package/dist/commands/config/get.d.ts.map +0 -1
  114. package/dist/commands/config/get.js +0 -20
  115. package/dist/commands/config/index.d.ts +0 -2
  116. package/dist/commands/config/index.d.ts.map +0 -1
  117. package/dist/commands/config/index.js +0 -2
  118. package/dist/commands/config/set.d.ts +0 -12
  119. package/dist/commands/config/set.d.ts.map +0 -1
  120. package/dist/commands/config/set.js +0 -26
  121. package/dist/commands/evidence/affirm.d.ts +0 -17
  122. package/dist/commands/evidence/affirm.d.ts.map +0 -1
  123. package/dist/commands/evidence/affirm.js +0 -65
  124. package/dist/commands/evidence/audit.d.ts +0 -34
  125. package/dist/commands/evidence/audit.d.ts.map +0 -1
  126. package/dist/commands/evidence/audit.js +0 -107
  127. package/dist/commands/evidence/baseline.d.ts +0 -14
  128. package/dist/commands/evidence/baseline.d.ts.map +0 -1
  129. package/dist/commands/evidence/baseline.js +0 -89
  130. package/dist/commands/evidence/gc.d.ts +0 -13
  131. package/dist/commands/evidence/gc.d.ts.map +0 -1
  132. package/dist/commands/evidence/gc.js +0 -35
  133. package/dist/commands/evidence/index.d.ts +0 -8
  134. package/dist/commands/evidence/index.d.ts.map +0 -1
  135. package/dist/commands/evidence/index.js +0 -18
  136. package/dist/commands/evidence/inspect-mocks.d.ts +0 -16
  137. package/dist/commands/evidence/inspect-mocks.d.ts.map +0 -1
  138. package/dist/commands/evidence/inspect-mocks.js +0 -49
  139. package/dist/commands/evidence/record.d.ts +0 -22
  140. package/dist/commands/evidence/record.d.ts.map +0 -1
  141. package/dist/commands/evidence/record.js +0 -144
  142. package/dist/commands/graph/change-impact.d.ts +0 -16
  143. package/dist/commands/graph/change-impact.d.ts.map +0 -1
  144. package/dist/commands/graph/change-impact.js +0 -29
  145. package/dist/commands/graph/churn.d.ts +0 -14
  146. package/dist/commands/graph/churn.d.ts.map +0 -1
  147. package/dist/commands/graph/churn.js +0 -15
  148. package/dist/commands/graph/common.d.ts +0 -16
  149. package/dist/commands/graph/common.d.ts.map +0 -1
  150. package/dist/commands/graph/fan-out.d.ts +0 -14
  151. package/dist/commands/graph/fan-out.d.ts.map +0 -1
  152. package/dist/commands/graph/fan-out.js +0 -15
  153. package/dist/commands/graph/index.d.ts +0 -8
  154. package/dist/commands/graph/index.d.ts.map +0 -1
  155. package/dist/commands/graph/index.js +0 -12
  156. package/dist/commands/matrix.d.ts +0 -14
  157. package/dist/commands/matrix.d.ts.map +0 -1
  158. package/dist/commands/matrix.js +0 -15
  159. package/dist/commands/measurement/index.d.ts +0 -7
  160. package/dist/commands/measurement/index.d.ts.map +0 -1
  161. package/dist/commands/measurement/index.js +0 -11
  162. package/dist/commands/measurement/intervention.d.ts +0 -11
  163. package/dist/commands/measurement/intervention.d.ts.map +0 -1
  164. package/dist/commands/measurement/intervention.js +0 -31
  165. package/dist/commands/measurement/operational-release.d.ts +0 -11
  166. package/dist/commands/measurement/operational-release.d.ts.map +0 -1
  167. package/dist/commands/measurement/operational-release.js +0 -31
  168. package/dist/commands/measurement/record.d.ts +0 -10
  169. package/dist/commands/measurement/record.d.ts.map +0 -1
  170. package/dist/commands/measurement/record.js +0 -36
  171. package/dist/commands/module/ensure-defaults.d.ts +0 -8
  172. package/dist/commands/module/ensure-defaults.d.ts.map +0 -1
  173. package/dist/commands/module/ensure-defaults.js +0 -17
  174. package/dist/commands/module/index.d.ts +0 -2
  175. package/dist/commands/module/index.d.ts.map +0 -1
  176. package/dist/commands/module/index.js +0 -2
  177. package/dist/commands/module/install.d.ts +0 -11
  178. package/dist/commands/module/install.d.ts.map +0 -1
  179. package/dist/commands/module/install.js +0 -22
  180. package/dist/commands/module/list.d.ts +0 -8
  181. package/dist/commands/module/list.d.ts.map +0 -1
  182. package/dist/commands/module/list.js +0 -13
  183. package/dist/commands/module/remove.d.ts +0 -10
  184. package/dist/commands/module/remove.d.ts.map +0 -1
  185. package/dist/commands/module/remove.js +0 -16
  186. package/dist/commands/plugin/deprecation.d.ts +0 -10
  187. package/dist/commands/plugin/deprecation.d.ts.map +0 -1
  188. package/dist/commands/plugin/ensure-defaults.d.ts +0 -8
  189. package/dist/commands/plugin/ensure-defaults.d.ts.map +0 -1
  190. package/dist/commands/plugin/ensure-defaults.js +0 -12
  191. package/dist/commands/plugin/index.d.ts +0 -2
  192. package/dist/commands/plugin/index.d.ts.map +0 -1
  193. package/dist/commands/plugin/index.js +0 -2
  194. package/dist/commands/plugin/install.d.ts +0 -8
  195. package/dist/commands/plugin/install.d.ts.map +0 -1
  196. package/dist/commands/plugin/install.js +0 -12
  197. package/dist/commands/plugin/list.d.ts +0 -8
  198. package/dist/commands/plugin/list.d.ts.map +0 -1
  199. package/dist/commands/plugin/list.js +0 -12
  200. package/dist/commands/plugin/remove.d.ts +0 -8
  201. package/dist/commands/plugin/remove.d.ts.map +0 -1
  202. package/dist/commands/plugin/remove.js +0 -12
  203. package/dist/commands/report.d.ts +0 -19
  204. package/dist/commands/report.d.ts.map +0 -1
  205. package/dist/commands/report.js +0 -96
  206. package/dist/commands/review.d.ts +0 -14
  207. package/dist/commands/review.d.ts.map +0 -1
  208. package/dist/commands/review.js +0 -15
  209. package/dist/commands/to-plan.d.ts +0 -14
  210. package/dist/commands/to-plan.d.ts.map +0 -1
  211. package/dist/commands/to-plan.js +0 -15
  212. package/dist/commands/update.d.ts +0 -13
  213. package/dist/commands/update.d.ts.map +0 -1
  214. package/dist/commands/update.js +0 -34
  215. package/dist/commands/validate.d.ts +0 -13
  216. package/dist/commands/validate.d.ts.map +0 -1
  217. package/dist/commands/validate.js +0 -123
  218. package/dist/commands/write.d.ts +0 -16
  219. package/dist/commands/write.d.ts.map +0 -1
  220. package/dist/commands/write.js +0 -33
  221. package/dist/common-B1ZJ8CSO.js +0 -36
  222. package/dist/common-DTrmnvL-.js +0 -35
  223. package/dist/completeness/assess.d.ts +0 -82
  224. package/dist/completeness/assess.d.ts.map +0 -1
  225. package/dist/completeness/bundle.d.ts +0 -52
  226. package/dist/completeness/bundle.d.ts.map +0 -1
  227. package/dist/completeness/declarations.d.ts +0 -46
  228. package/dist/completeness/declarations.d.ts.map +0 -1
  229. package/dist/completeness/index.d.ts +0 -11
  230. package/dist/completeness/index.d.ts.map +0 -1
  231. package/dist/completeness/run.d.ts +0 -35
  232. package/dist/completeness/run.d.ts.map +0 -1
  233. package/dist/completeness-BzBuNq6w.js +0 -228
  234. package/dist/config-schema-Dp-vlxuR.js +0 -13
  235. package/dist/config-schema.d.ts +0 -52
  236. package/dist/config-schema.d.ts.map +0 -1
  237. package/dist/deprecation-fRxUHoxv.js +0 -4
  238. package/dist/evidence/adapters/agent-eval.d.ts +0 -26
  239. package/dist/evidence/adapters/agent-eval.d.ts.map +0 -1
  240. package/dist/evidence/adapters/audit-script.d.ts +0 -25
  241. package/dist/evidence/adapters/audit-script.d.ts.map +0 -1
  242. package/dist/evidence/adapters/cargo-mutants.d.ts +0 -3
  243. package/dist/evidence/adapters/cargo-mutants.d.ts.map +0 -1
  244. package/dist/evidence/adapters/contract-conformance.d.ts +0 -16
  245. package/dist/evidence/adapters/contract-conformance.d.ts.map +0 -1
  246. package/dist/evidence/adapters/differential-report.d.ts +0 -18
  247. package/dist/evidence/adapters/differential-report.d.ts.map +0 -1
  248. package/dist/evidence/adapters/junit.d.ts +0 -17
  249. package/dist/evidence/adapters/junit.d.ts.map +0 -1
  250. package/dist/evidence/adapters/registry.d.ts +0 -63
  251. package/dist/evidence/adapters/registry.d.ts.map +0 -1
  252. package/dist/evidence/adapters/sarif.d.ts +0 -35
  253. package/dist/evidence/adapters/sarif.d.ts.map +0 -1
  254. package/dist/evidence/adapters/sbom.d.ts +0 -35
  255. package/dist/evidence/adapters/sbom.d.ts.map +0 -1
  256. package/dist/evidence/adapters/types.d.ts +0 -86
  257. package/dist/evidence/adapters/types.d.ts.map +0 -1
  258. package/dist/evidence/index.d.ts +0 -27
  259. package/dist/evidence/index.d.ts.map +0 -1
  260. package/dist/evidence/mock-inspection.d.ts +0 -16
  261. package/dist/evidence/mock-inspection.d.ts.map +0 -1
  262. package/dist/evidence/record.d.ts +0 -58
  263. package/dist/evidence/record.d.ts.map +0 -1
  264. package/dist/evidence/store.d.ts +0 -215
  265. package/dist/evidence/store.d.ts.map +0 -1
  266. package/dist/evidence/types.d.ts +0 -281
  267. package/dist/evidence/types.d.ts.map +0 -1
  268. package/dist/evidence-OyqpqHLS.js +0 -614
  269. package/dist/flow-command-CCRTE5Oe.js +0 -88
  270. package/dist/flow-command.d.ts +0 -25
  271. package/dist/flow-command.d.ts.map +0 -1
  272. package/dist/flows.d.ts +0 -7
  273. package/dist/flows.d.ts.map +0 -1
  274. package/dist/graph-analysis/analysis.d.ts +0 -106
  275. package/dist/graph-analysis/analysis.d.ts.map +0 -1
  276. package/dist/graph-analysis/index.d.ts +0 -6
  277. package/dist/graph-analysis/index.d.ts.map +0 -1
  278. package/dist/graph-analysis/input.d.ts +0 -33
  279. package/dist/graph-analysis/input.d.ts.map +0 -1
  280. package/dist/graph-analysis/load.d.ts +0 -21
  281. package/dist/graph-analysis/load.d.ts.map +0 -1
  282. package/dist/graph-analysis/render.d.ts +0 -4
  283. package/dist/graph-analysis/render.d.ts.map +0 -1
  284. package/dist/graph-analysis-IWaoJJSN.js +0 -657
  285. package/dist/hooks/command-not-found.d.ts +0 -23
  286. package/dist/hooks/command-not-found.d.ts.map +0 -1
  287. package/dist/hooks/command-not-found.js +0 -8
  288. package/dist/index.d.ts +0 -13
  289. package/dist/index.d.ts.map +0 -1
  290. package/dist/index.js +0 -12
  291. package/dist/measurement/agent-eval-intervention.d.ts +0 -6
  292. package/dist/measurement/agent-eval-intervention.d.ts.map +0 -1
  293. package/dist/measurement/atomic-file.d.ts +0 -5
  294. package/dist/measurement/atomic-file.d.ts.map +0 -1
  295. package/dist/measurement/compare.d.ts +0 -4
  296. package/dist/measurement/compare.d.ts.map +0 -1
  297. package/dist/measurement/date-time.d.ts +0 -3
  298. package/dist/measurement/date-time.d.ts.map +0 -1
  299. package/dist/measurement/github-release-operational.d.ts +0 -7
  300. package/dist/measurement/github-release-operational.d.ts.map +0 -1
  301. package/dist/measurement/graph-adapters.d.ts +0 -304
  302. package/dist/measurement/graph-adapters.d.ts.map +0 -1
  303. package/dist/measurement/graph-portfolio-load.d.ts +0 -3
  304. package/dist/measurement/graph-portfolio-load.d.ts.map +0 -1
  305. package/dist/measurement/graph-portfolio.d.ts +0 -158
  306. package/dist/measurement/graph-portfolio.d.ts.map +0 -1
  307. package/dist/measurement/index.d.ts +0 -22
  308. package/dist/measurement/index.d.ts.map +0 -1
  309. package/dist/measurement/intervention-report.d.ts +0 -24
  310. package/dist/measurement/intervention-report.d.ts.map +0 -1
  311. package/dist/measurement/intervention-schema.d.ts +0 -144
  312. package/dist/measurement/intervention-schema.d.ts.map +0 -1
  313. package/dist/measurement/intervention-types.d.ts +0 -105
  314. package/dist/measurement/intervention-types.d.ts.map +0 -1
  315. package/dist/measurement/intervention.d.ts +0 -16
  316. package/dist/measurement/intervention.d.ts.map +0 -1
  317. package/dist/measurement/operational-report.d.ts +0 -17
  318. package/dist/measurement/operational-report.d.ts.map +0 -1
  319. package/dist/measurement/operational-schema.d.ts +0 -461
  320. package/dist/measurement/operational-schema.d.ts.map +0 -1
  321. package/dist/measurement/operational-types.d.ts +0 -121
  322. package/dist/measurement/operational-types.d.ts.map +0 -1
  323. package/dist/measurement/operational.d.ts +0 -13
  324. package/dist/measurement/operational.d.ts.map +0 -1
  325. package/dist/measurement/plans.d.ts +0 -6
  326. package/dist/measurement/plans.d.ts.map +0 -1
  327. package/dist/measurement/portfolio.d.ts +0 -54
  328. package/dist/measurement/portfolio.d.ts.map +0 -1
  329. package/dist/measurement/profiles.d.ts +0 -9
  330. package/dist/measurement/profiles.d.ts.map +0 -1
  331. package/dist/measurement/report.d.ts +0 -48
  332. package/dist/measurement/report.d.ts.map +0 -1
  333. package/dist/measurement/schemas/operational-evidence-v1.schema.json.d.ts +0 -384
  334. package/dist/measurement/store.d.ts +0 -14
  335. package/dist/measurement/store.d.ts.map +0 -1
  336. package/dist/measurement/types.d.ts +0 -85
  337. package/dist/measurement/types.d.ts.map +0 -1
  338. package/dist/measurement/validate.d.ts +0 -9
  339. package/dist/measurement/validate.d.ts.map +0 -1
  340. package/dist/measurement-j8sDSqx5.js +0 -2980
  341. package/dist/modules-DDQkKC4l.js +0 -23
  342. package/dist/modules.d.ts +0 -10
  343. package/dist/modules.d.ts.map +0 -1
  344. package/dist/org.d.ts +0 -61
  345. package/dist/org.d.ts.map +0 -1
  346. package/dist/plugins-CHpYhpEI.js +0 -77
  347. package/dist/plugins.d.ts +0 -13
  348. package/dist/plugins.d.ts.map +0 -1
  349. package/dist/quire/assurance.d.ts +0 -109
  350. package/dist/quire/assurance.d.ts.map +0 -1
  351. package/dist/quire/contract.d.ts +0 -88
  352. package/dist/quire/contract.d.ts.map +0 -1
  353. package/dist/quire/exec.d.ts +0 -66
  354. package/dist/quire/exec.d.ts.map +0 -1
  355. package/dist/quire/index.d.ts +0 -13
  356. package/dist/quire/index.d.ts.map +0 -1
  357. package/dist/quire/types.d.ts +0 -415
  358. package/dist/quire/types.d.ts.map +0 -1
  359. package/dist/quire/validate.d.ts +0 -39
  360. package/dist/quire/validate.d.ts.map +0 -1
  361. package/dist/quire-BsVj1xIR.js +0 -4968
  362. package/dist/schema-assets-HZWo_iFN.js +0 -233
  363. package/dist/schemas/assurance-v1.schema.json +0 -225
  364. package/dist/schemas/change-assurance-record-v1.schema.json +0 -234
  365. package/dist/schemas/coverage-v1.schema.json +0 -1111
  366. package/dist/schemas/operational-evidence-v1.schema.json +0 -381
  367. package/dist/schemas/proof-attestation-v1.schema.json +0 -96
  368. package/dist/schemas/properties-v1.schema.json +0 -159
  369. package/dist/schemas/verification-receipt-v1.schema.json +0 -208
  370. package/dist/validators/gates.d.ts +0 -18
  371. package/dist/validators/gates.d.ts.map +0 -1
  372. package/dist/validators/index.d.ts +0 -2
  373. package/dist/validators/index.d.ts.map +0 -1
  374. package/dist/version-CMxMIh5g.js +0 -17
  375. package/dist/version.d.ts +0 -3
  376. package/dist/version.d.ts.map +0 -1
  377. package/dist/write-CGTI0dRO.js +0 -157
  378. package/dist/write.d.ts +0 -28
  379. package/dist/write.d.ts.map +0 -1
  380. package/skills/assurance-status-report/SKILL.md +0 -135
  381. package/skills/assurance-status-report/references/report-contract.md +0 -110
  382. package/skills/gap-analysis/SKILL.md +0 -111
  383. package/skills/gap-analysis/references/step-1-target-selection.md +0 -53
  384. package/skills/gap-analysis/references/step-2-plan-completion.md +0 -49
  385. package/skills/gap-analysis/references/step-3-matrix-verification.md +0 -147
  386. package/skills/gap-analysis/references/step-4-underspecified-code.md +0 -92
  387. package/skills/gap-analysis/references/step-5-semantic-review.md +0 -51
  388. package/skills/gap-analysis/references/step-6-specreview-artifact.md +0 -108
  389. package/skills/spec-app-review/SKILL.md +0 -51
  390. package/skills/spec-app-review/references/checklist.md +0 -197
  391. package/skills/spec-architecture-evaluation/SKILL.md +0 -30
  392. package/skills/spec-correctness/SKILL.md +0 -96
  393. package/skills/spec-correctness/assets/strategy-table.md +0 -101
  394. package/skills/spec-correctness/assets/templates/fast-check.ts.md +0 -169
  395. package/skills/spec-correctness/assets/templates/hypothesis.py.md +0 -156
  396. package/skills/spec-correctness/assets/templates/proptest.rs.md +0 -147
  397. package/skills/spec-correctness/references/step-0-scope-and-harness.md +0 -94
  398. package/skills/spec-correctness/references/step-1-census.md +0 -53
  399. package/skills/spec-correctness/references/step-2-clause-grounding.md +0 -159
  400. package/skills/spec-correctness/references/step-3-strategy-selection.md +0 -85
  401. package/skills/spec-correctness/references/step-4-generate-tests.md +0 -117
  402. package/skills/spec-correctness/references/step-5-second-pass.md +0 -81
  403. package/skills/spec-correctness/references/step-6-review-artifact.md +0 -134
  404. package/skills/spec-correctness/references/step-7-report-and-handoff.md +0 -102
  405. package/skills/spec-dependency-analysis/SKILL.md +0 -90
  406. package/skills/spec-ears-analysis/SKILL.md +0 -102
  407. package/skills/spec-evidence-analysis/SKILL.md +0 -156
  408. package/skills/spec-failure-domain-analysis/SKILL.md +0 -59
  409. package/skills/spec-fuzz/SKILL.md +0 -133
  410. package/skills/spec-fuzz/assets/templates/atheris.py.md +0 -74
  411. package/skills/spec-fuzz/assets/templates/cargo-fuzz.rs.md +0 -83
  412. package/skills/spec-fuzz/assets/templates/fast-check.ts.md +0 -76
  413. package/skills/spec-fuzz/references/step-0-scope-and-harness.md +0 -51
  414. package/skills/spec-fuzz/references/step-1-select-obligations.md +0 -47
  415. package/skills/spec-fuzz/references/step-2-ground-entry-point.md +0 -55
  416. package/skills/spec-fuzz/references/step-3-emit-targets.md +0 -65
  417. package/skills/spec-fuzz/references/step-4-report.md +0 -56
  418. package/skills/spec-ideation/SKILL.md +0 -46
  419. package/skills/spec-integrity-analysis/SKILL.md +0 -62
  420. package/skills/spec-matrix/SKILL.md +0 -186
  421. package/skills/spec-matrix/assets/test-cases/TC-001.md +0 -35
  422. package/skills/spec-matrix/assets/test-cases/TC-002.md +0 -37
  423. package/skills/spec-matrix/assets/test-cases/TC-006.md +0 -50
  424. package/skills/spec-matrix/assets/test-matrix-example.md +0 -104
  425. package/skills/spec-matrix/assets/test-matrix-template.md +0 -123
  426. package/skills/spec-matrix/workflow-assets/dist/index.d.ts +0 -146
  427. package/skills/spec-matrix/workflow-assets/dist/index.d.ts.map +0 -1
  428. package/skills/spec-matrix/workflow-assets/dist/index.js +0 -7525
  429. package/skills/spec-matrix/workflow-assets/dist/invariants.d.ts +0 -6
  430. package/skills/spec-matrix/workflow-assets/dist/invariants.d.ts.map +0 -1
  431. package/skills/spec-matrix/workflow-assets/skills/matrix/SKILL.md +0 -35
  432. package/skills/spec-matrix/workflow-assets/skills/matrix/scripts/invariants.js +0 -1
  433. package/skills/spec-matrix/workflow-assets/skills/matrix/templates/report/default.md +0 -30
  434. package/skills/spec-matrix/workflow-assets/skills/matrix/workflows/matrix/def.yaml +0 -82
  435. package/skills/spec-object-review/SKILL.md +0 -125
  436. package/skills/spec-object-review/references/object-type-guide.md +0 -118
  437. package/skills/spec-review/SKILL.md +0 -92
  438. package/skills/spec-review/references/checklist.md +0 -50
  439. package/skills/spec-review/workflow-assets/dist/index.d.ts +0 -146
  440. package/skills/spec-review/workflow-assets/dist/index.d.ts.map +0 -1
  441. package/skills/spec-review/workflow-assets/dist/index.js +0 -7525
  442. package/skills/spec-review/workflow-assets/dist/invariants.d.ts +0 -6
  443. package/skills/spec-review/workflow-assets/dist/invariants.d.ts.map +0 -1
  444. package/skills/spec-review/workflow-assets/skills/review/SKILL.md +0 -96
  445. package/skills/spec-review/workflow-assets/skills/review/scripts/invariants.js +0 -61
  446. package/skills/spec-review/workflow-assets/skills/review/workflows/review/def.yaml +0 -68
  447. package/skills/spec-risk-complexity-analysis/SKILL.md +0 -92
  448. package/skills/spec-scope-boundary-analysis/SKILL.md +0 -101
  449. package/skills/spec-security-analysis/SKILL.md +0 -84
  450. package/skills/spec-security-analysis/assets/security-analysis-example.md +0 -89
  451. package/skills/spec-security-analysis/assets/security-analysis-template.md +0 -73
  452. package/skills/spec-security-analysis/references/component-type-mapping.md +0 -161
  453. package/skills/spec-security-analysis/references/gdpr/ChII-Principles.md +0 -58
  454. package/skills/spec-security-analysis/references/gdpr/ChIII-DataSubjectRights.md +0 -84
  455. package/skills/spec-security-analysis/references/gdpr/ChIV-ControllerProcessor.md +0 -83
  456. package/skills/spec-security-analysis/references/gdpr/ChV-DataTransfers.md +0 -62
  457. package/skills/spec-security-analysis/references/gdpr/index.md +0 -54
  458. package/skills/spec-security-analysis/references/iso27001/A5-OrganizationalControls.md +0 -64
  459. package/skills/spec-security-analysis/references/iso27001/A6-PeopleControls.md +0 -30
  460. package/skills/spec-security-analysis/references/iso27001/A7-PhysicalControls.md +0 -35
  461. package/skills/spec-security-analysis/references/iso27001/A8-TechnologicalControls.md +0 -66
  462. package/skills/spec-security-analysis/references/iso27001/index.md +0 -43
  463. package/skills/spec-security-analysis/references/nist-800-53/AC-AccessControl.md +0 -57
  464. package/skills/spec-security-analysis/references/nist-800-53/AU-AuditAccountability.md +0 -49
  465. package/skills/spec-security-analysis/references/nist-800-53/CM-ConfigurationManagement.md +0 -36
  466. package/skills/spec-security-analysis/references/nist-800-53/IA-IdentificationAuthentication.md +0 -44
  467. package/skills/spec-security-analysis/references/nist-800-53/SA-SystemServicesAcquisition.md +0 -50
  468. package/skills/spec-security-analysis/references/nist-800-53/SC-SystemCommunications.md +0 -53
  469. package/skills/spec-security-analysis/references/nist-800-53/SI-SystemInformationIntegrity.md +0 -52
  470. package/skills/spec-security-analysis/references/nist-800-53/index.md +0 -58
  471. package/skills/spec-security-analysis/references/owasp-asvs/V1-Architecture.md +0 -33
  472. package/skills/spec-security-analysis/references/owasp-asvs/V10-MaliciousCode.md +0 -33
  473. package/skills/spec-security-analysis/references/owasp-asvs/V11-BusinessLogic.md +0 -32
  474. package/skills/spec-security-analysis/references/owasp-asvs/V12-Files.md +0 -34
  475. package/skills/spec-security-analysis/references/owasp-asvs/V13-API.md +0 -34
  476. package/skills/spec-security-analysis/references/owasp-asvs/V14-Configuration.md +0 -35
  477. package/skills/spec-security-analysis/references/owasp-asvs/V2-Authentication.md +0 -36
  478. package/skills/spec-security-analysis/references/owasp-asvs/V3-SessionManagement.md +0 -35
  479. package/skills/spec-security-analysis/references/owasp-asvs/V4-AccessControl.md +0 -39
  480. package/skills/spec-security-analysis/references/owasp-asvs/V5-Validation.md +0 -37
  481. package/skills/spec-security-analysis/references/owasp-asvs/V6-Cryptography.md +0 -34
  482. package/skills/spec-security-analysis/references/owasp-asvs/V7-ErrorLogging.md +0 -37
  483. package/skills/spec-security-analysis/references/owasp-asvs/V8-DataProtection.md +0 -34
  484. package/skills/spec-security-analysis/references/owasp-asvs/V9-Communication.md +0 -32
  485. package/skills/spec-security-analysis/references/owasp-asvs/index.md +0 -59
  486. package/skills/spec-security-analysis/references/soc2/CC1-ControlEnvironment.md +0 -31
  487. package/skills/spec-security-analysis/references/soc2/CC2-CommunicationInformation.md +0 -27
  488. package/skills/spec-security-analysis/references/soc2/CC3-RiskAssessment.md +0 -29
  489. package/skills/spec-security-analysis/references/soc2/CC4-MonitoringActivities.md +0 -27
  490. package/skills/spec-security-analysis/references/soc2/CC5-ControlActivities.md +0 -28
  491. package/skills/spec-security-analysis/references/soc2/CC6-LogicalPhysicalAccess.md +0 -45
  492. package/skills/spec-security-analysis/references/soc2/CC7-SystemOperations.md +0 -42
  493. package/skills/spec-security-analysis/references/soc2/CC8-ChangeManagement.md +0 -32
  494. package/skills/spec-security-analysis/references/soc2/CC9-RiskMitigation.md +0 -34
  495. package/skills/spec-security-analysis/references/soc2/index.md +0 -46
  496. package/skills/spec-security-analysis/references/standards-index.md +0 -46
  497. package/skills/spec-to-plan/SKILL.md +0 -88
  498. package/skills/spec-to-plan/references/step-0-plan-selection.md +0 -121
  499. package/skills/spec-to-plan/references/step-1-analysis.md +0 -88
  500. package/skills/spec-to-plan/references/step-2-test-plan.md +0 -43
  501. package/skills/spec-to-plan/references/step-3-execution-plan.md +0 -218
  502. package/skills/spec-to-plan/workflow-assets/dist/index.d.ts +0 -146
  503. package/skills/spec-to-plan/workflow-assets/dist/index.d.ts.map +0 -1
  504. package/skills/spec-to-plan/workflow-assets/dist/index.js +0 -7525
  505. package/skills/spec-to-plan/workflow-assets/dist/invariants.d.ts +0 -6
  506. package/skills/spec-to-plan/workflow-assets/dist/invariants.d.ts.map +0 -1
  507. package/skills/spec-to-plan/workflow-assets/skills/to-plan/SKILL.md +0 -35
  508. package/skills/spec-to-plan/workflow-assets/skills/to-plan/scripts/invariants.js +0 -1
  509. package/skills/spec-to-plan/workflow-assets/skills/to-plan/templates/implementation-plan/default.md +0 -44
  510. package/skills/spec-to-plan/workflow-assets/skills/to-plan/workflows/to-plan/def.yaml +0 -85
  511. package/skills/specify/SKILL.md +0 -154
  512. package/skills/specify/assets/app-spec-template.md +0 -143
  513. package/skills/specify/assets/spec-template.md +0 -299
  514. package/skills/specify/references/integration-tests.md +0 -72
  515. package/skills/specify/references/us-to-fr.md +0 -40
  516. package/skills/specify/references/writing-good-requirements.md +0 -61
@@ -1,4968 +0,0 @@
1
- import { fileURLToPath as e } from "node:url";
2
- import { accessSync as t, constants as n, readFileSync as r, realpathSync as i } from "node:fs";
3
- import { delimiter as a, dirname as o, isAbsolute as s, join as c } from "node:path";
4
- import { createHash as l } from "node:crypto";
5
- import { execFileSync as u } from "node:child_process";
6
- //#region \0rolldown/runtime.js
7
- var d = Object.defineProperty, f = Object.getOwnPropertyDescriptor, p = Object.getOwnPropertyNames, m = Object.prototype.hasOwnProperty, h = (e, t, n) => () => {
8
- if (n) throw n[0];
9
- try {
10
- return e && (t = e(e = 0)), t;
11
- } catch (e) {
12
- throw n = [e], e;
13
- }
14
- }, g = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), _ = (e, t) => {
15
- let n = {};
16
- for (var r in e) d(n, r, {
17
- get: e[r],
18
- enumerable: !0
19
- });
20
- return t || d(n, Symbol.toStringTag, { value: "Module" }), n;
21
- }, v = (e, t, n, r) => {
22
- if (t && typeof t == "object" || typeof t == "function") for (var i = p(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !m.call(e, s) && s !== n && d(e, s, {
23
- get: ((e) => t[e]).bind(null, s),
24
- enumerable: !(r = f(t, s)) || r.enumerable
25
- });
26
- return e;
27
- }, y = (e) => m.call(e, "module.exports") ? e["module.exports"] : v(d({}, "__esModule", { value: !0 }), e), b = {
28
- sourceRevision: "e3352a0644abcfd5f0ebad348bc7aca235925ecc",
29
- contractVersion: "v1",
30
- minimumCli: "0.21.0",
31
- hashes: {
32
- "assurance-v1.schema.json": "441e1b8324fe64e234a007216b11867ec937ac4779fcebcdd84b30fa064367e5",
33
- "coverage-v1.schema.json": "f0cdbb9457ca7ca76b642c11fd5b6f41273909c894458c31f58c9c50fdbcdb38",
34
- "properties-v1.schema.json": "cc687773c35b3e71e82fc336e887ecc688a28b03e970e349b2921b8624e4d11c"
35
- }
36
- }, x = o(e(import.meta.url));
37
- function S(e) {
38
- return c(x, "schemas", e);
39
- }
40
- function C(e) {
41
- return JSON.parse(r(S(e), "utf8"));
42
- }
43
- function w(e) {
44
- let t = /(\d+)\.(\d+)\.(\d+)/.exec(e);
45
- return t ? t[0] : null;
46
- }
47
- function T(e, t) {
48
- let n = e.split(".").map((e) => Number.parseInt(e, 10)), r = t.split(".").map((e) => Number.parseInt(e, 10));
49
- for (let e = 0; e < 3; e += 1) {
50
- let t = (n[e] ?? 0) - (r[e] ?? 0);
51
- if (t !== 0) return t;
52
- }
53
- return 0;
54
- }
55
- function E(e) {
56
- let t = e ? w(e) : null, n = b.minimumCli;
57
- return t === null ? {
58
- kind: "version-premise",
59
- found: null,
60
- required: n,
61
- message: `could not determine the quire CLI version (expected >= ${n}). Install or update quire-cli: the JSON contract quoin reads is only emitted from ${n} onward.`
62
- } : T(t, n) < 0 ? {
63
- kind: "version-premise",
64
- found: t,
65
- required: n,
66
- message: `quire ${t} is older than the ${n} this contract requires. Its JSON payloads predate the published schemas (quire-rs FR-055) and the obligation records (FR-053), so quoin would misread them rather than fail. Update quire-cli.`
67
- } : null;
68
- }
69
- //#endregion
70
- //#region node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js
71
- var D = /* @__PURE__ */ g(((e) => {
72
- Object.defineProperty(e, "__esModule", { value: !0 }), e.regexpCode = e.getEsmExportName = e.getProperty = e.safeStringify = e.stringify = e.strConcat = e.addCodeArg = e.str = e._ = e.nil = e._Code = e.Name = e.IDENTIFIER = e._CodeOrName = void 0;
73
- var t = class {};
74
- e._CodeOrName = t, e.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
75
- var n = class extends t {
76
- constructor(t) {
77
- if (super(), !e.IDENTIFIER.test(t)) throw Error("CodeGen: name must be a valid identifier");
78
- this.str = t;
79
- }
80
- toString() {
81
- return this.str;
82
- }
83
- emptyStr() {
84
- return !1;
85
- }
86
- get names() {
87
- return { [this.str]: 1 };
88
- }
89
- };
90
- e.Name = n;
91
- var r = class extends t {
92
- constructor(e) {
93
- super(), this._items = typeof e == "string" ? [e] : e;
94
- }
95
- toString() {
96
- return this.str;
97
- }
98
- emptyStr() {
99
- if (this._items.length > 1) return !1;
100
- let e = this._items[0];
101
- return e === "" || e === "\"\"";
102
- }
103
- get str() {
104
- return this._str ??= this._items.reduce((e, t) => `${e}${t}`, "");
105
- }
106
- get names() {
107
- return this._names ??= this._items.reduce((e, t) => (t instanceof n && (e[t.str] = (e[t.str] || 0) + 1), e), {});
108
- }
109
- };
110
- e._Code = r, e.nil = new r("");
111
- function i(e, ...t) {
112
- let n = [e[0]], i = 0;
113
- for (; i < t.length;) s(n, t[i]), n.push(e[++i]);
114
- return new r(n);
115
- }
116
- e._ = i;
117
- var a = new r("+");
118
- function o(e, ...t) {
119
- let n = [p(e[0])], i = 0;
120
- for (; i < t.length;) n.push(a), s(n, t[i]), n.push(a, p(e[++i]));
121
- return c(n), new r(n);
122
- }
123
- e.str = o;
124
- function s(e, t) {
125
- t instanceof r ? e.push(...t._items) : t instanceof n ? e.push(t) : e.push(d(t));
126
- }
127
- e.addCodeArg = s;
128
- function c(e) {
129
- let t = 1;
130
- for (; t < e.length - 1;) {
131
- if (e[t] === a) {
132
- let n = l(e[t - 1], e[t + 1]);
133
- if (n !== void 0) {
134
- e.splice(t - 1, 3, n);
135
- continue;
136
- }
137
- e[t++] = "+";
138
- }
139
- t++;
140
- }
141
- }
142
- function l(e, t) {
143
- if (t === "\"\"") return e;
144
- if (e === "\"\"") return t;
145
- if (typeof e == "string") return t instanceof n || e[e.length - 1] !== "\"" ? void 0 : typeof t == "string" ? t[0] === "\"" ? e.slice(0, -1) + t.slice(1) : void 0 : `${e.slice(0, -1)}${t}"`;
146
- if (typeof t == "string" && t[0] === "\"" && !(e instanceof n)) return `"${e}${t.slice(1)}`;
147
- }
148
- function u(e, t) {
149
- return t.emptyStr() ? e : e.emptyStr() ? t : o`${e}${t}`;
150
- }
151
- e.strConcat = u;
152
- function d(e) {
153
- return typeof e == "number" || typeof e == "boolean" || e === null ? e : p(Array.isArray(e) ? e.join(",") : e);
154
- }
155
- function f(e) {
156
- return new r(p(e));
157
- }
158
- e.stringify = f;
159
- function p(e) {
160
- return JSON.stringify(e).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
161
- }
162
- e.safeStringify = p;
163
- function m(t) {
164
- return typeof t == "string" && e.IDENTIFIER.test(t) ? new r(`.${t}`) : i`[${t}]`;
165
- }
166
- e.getProperty = m;
167
- function h(t) {
168
- if (typeof t == "string" && e.IDENTIFIER.test(t)) return new r(`${t}`);
169
- throw Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`);
170
- }
171
- e.getEsmExportName = h;
172
- function g(e) {
173
- return new r(e.toString());
174
- }
175
- e.regexpCode = g;
176
- })), O = /* @__PURE__ */ g(((e) => {
177
- Object.defineProperty(e, "__esModule", { value: !0 }), e.ValueScope = e.ValueScopeName = e.Scope = e.varKinds = e.UsedValueState = void 0;
178
- var t = D(), n = class extends Error {
179
- constructor(e) {
180
- super(`CodeGen: "code" for ${e} not defined`), this.value = e.value;
181
- }
182
- }, r;
183
- (function(e) {
184
- e[e.Started = 0] = "Started", e[e.Completed = 1] = "Completed";
185
- })(r || (e.UsedValueState = r = {})), e.varKinds = {
186
- const: new t.Name("const"),
187
- let: new t.Name("let"),
188
- var: new t.Name("var")
189
- };
190
- var i = class {
191
- constructor({ prefixes: e, parent: t } = {}) {
192
- this._names = {}, this._prefixes = e, this._parent = t;
193
- }
194
- toName(e) {
195
- return e instanceof t.Name ? e : this.name(e);
196
- }
197
- name(e) {
198
- return new t.Name(this._newName(e));
199
- }
200
- _newName(e) {
201
- let t = this._names[e] || this._nameGroup(e);
202
- return `${e}${t.index++}`;
203
- }
204
- _nameGroup(e) {
205
- if ((this._parent?._prefixes)?.has(e) || this._prefixes && !this._prefixes.has(e)) throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);
206
- return this._names[e] = {
207
- prefix: e,
208
- index: 0
209
- };
210
- }
211
- };
212
- e.Scope = i;
213
- var a = class extends t.Name {
214
- constructor(e, t) {
215
- super(t), this.prefix = e;
216
- }
217
- setValue(e, { property: n, itemIndex: r }) {
218
- this.value = e, this.scopePath = (0, t._)`.${new t.Name(n)}[${r}]`;
219
- }
220
- };
221
- e.ValueScopeName = a;
222
- var o = (0, t._)`\n`;
223
- e.ValueScope = class extends i {
224
- constructor(e) {
225
- super(e), this._values = {}, this._scope = e.scope, this.opts = {
226
- ...e,
227
- _n: e.lines ? o : t.nil
228
- };
229
- }
230
- get() {
231
- return this._scope;
232
- }
233
- name(e) {
234
- return new a(e, this._newName(e));
235
- }
236
- value(e, t) {
237
- if (t.ref === void 0) throw Error("CodeGen: ref must be passed in value");
238
- let n = this.toName(e), { prefix: r } = n, i = t.key ?? t.ref, a = this._values[r];
239
- if (a) {
240
- let e = a.get(i);
241
- if (e) return e;
242
- } else a = this._values[r] = /* @__PURE__ */ new Map();
243
- a.set(i, n);
244
- let o = this._scope[r] || (this._scope[r] = []), s = o.length;
245
- return o[s] = t.ref, n.setValue(t, {
246
- property: r,
247
- itemIndex: s
248
- }), n;
249
- }
250
- getValue(e, t) {
251
- let n = this._values[e];
252
- if (n) return n.get(t);
253
- }
254
- scopeRefs(e, n = this._values) {
255
- return this._reduceValues(n, (n) => {
256
- if (n.scopePath === void 0) throw Error(`CodeGen: name "${n}" has no value`);
257
- return (0, t._)`${e}${n.scopePath}`;
258
- });
259
- }
260
- scopeCode(e = this._values, t, n) {
261
- return this._reduceValues(e, (e) => {
262
- if (e.value === void 0) throw Error(`CodeGen: name "${e}" has no value`);
263
- return e.value.code;
264
- }, t, n);
265
- }
266
- _reduceValues(i, a, o = {}, s) {
267
- let c = t.nil;
268
- for (let l in i) {
269
- let u = i[l];
270
- if (!u) continue;
271
- let d = o[l] = o[l] || /* @__PURE__ */ new Map();
272
- u.forEach((i) => {
273
- if (d.has(i)) return;
274
- d.set(i, r.Started);
275
- let o = a(i);
276
- if (o) {
277
- let n = this.opts.es5 ? e.varKinds.var : e.varKinds.const;
278
- c = (0, t._)`${c}${n} ${i} = ${o};${this.opts._n}`;
279
- } else if (o = s?.(i)) c = (0, t._)`${c}${o}${this.opts._n}`;
280
- else throw new n(i);
281
- d.set(i, r.Completed);
282
- });
283
- }
284
- return c;
285
- }
286
- };
287
- })), k = /* @__PURE__ */ g(((e) => {
288
- Object.defineProperty(e, "__esModule", { value: !0 }), e.or = e.and = e.not = e.CodeGen = e.operators = e.varKinds = e.ValueScopeName = e.ValueScope = e.Scope = e.Name = e.regexpCode = e.stringify = e.getProperty = e.nil = e.strConcat = e.str = e._ = void 0;
289
- var t = D(), n = O(), r = D();
290
- Object.defineProperty(e, "_", {
291
- enumerable: !0,
292
- get: function() {
293
- return r._;
294
- }
295
- }), Object.defineProperty(e, "str", {
296
- enumerable: !0,
297
- get: function() {
298
- return r.str;
299
- }
300
- }), Object.defineProperty(e, "strConcat", {
301
- enumerable: !0,
302
- get: function() {
303
- return r.strConcat;
304
- }
305
- }), Object.defineProperty(e, "nil", {
306
- enumerable: !0,
307
- get: function() {
308
- return r.nil;
309
- }
310
- }), Object.defineProperty(e, "getProperty", {
311
- enumerable: !0,
312
- get: function() {
313
- return r.getProperty;
314
- }
315
- }), Object.defineProperty(e, "stringify", {
316
- enumerable: !0,
317
- get: function() {
318
- return r.stringify;
319
- }
320
- }), Object.defineProperty(e, "regexpCode", {
321
- enumerable: !0,
322
- get: function() {
323
- return r.regexpCode;
324
- }
325
- }), Object.defineProperty(e, "Name", {
326
- enumerable: !0,
327
- get: function() {
328
- return r.Name;
329
- }
330
- });
331
- var i = O();
332
- Object.defineProperty(e, "Scope", {
333
- enumerable: !0,
334
- get: function() {
335
- return i.Scope;
336
- }
337
- }), Object.defineProperty(e, "ValueScope", {
338
- enumerable: !0,
339
- get: function() {
340
- return i.ValueScope;
341
- }
342
- }), Object.defineProperty(e, "ValueScopeName", {
343
- enumerable: !0,
344
- get: function() {
345
- return i.ValueScopeName;
346
- }
347
- }), Object.defineProperty(e, "varKinds", {
348
- enumerable: !0,
349
- get: function() {
350
- return i.varKinds;
351
- }
352
- }), e.operators = {
353
- GT: new t._Code(">"),
354
- GTE: new t._Code(">="),
355
- LT: new t._Code("<"),
356
- LTE: new t._Code("<="),
357
- EQ: new t._Code("==="),
358
- NEQ: new t._Code("!=="),
359
- NOT: new t._Code("!"),
360
- OR: new t._Code("||"),
361
- AND: new t._Code("&&"),
362
- ADD: new t._Code("+")
363
- };
364
- var a = class {
365
- optimizeNodes() {
366
- return this;
367
- }
368
- optimizeNames(e, t) {
369
- return this;
370
- }
371
- }, o = class extends a {
372
- constructor(e, t, n) {
373
- super(), this.varKind = e, this.name = t, this.rhs = n;
374
- }
375
- render({ es5: e, _n: t }) {
376
- let r = e ? n.varKinds.var : this.varKind, i = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
377
- return `${r} ${this.name}${i};` + t;
378
- }
379
- optimizeNames(e, t) {
380
- if (e[this.name.str]) return this.rhs &&= j(this.rhs, e, t), this;
381
- }
382
- get names() {
383
- return this.rhs instanceof t._CodeOrName ? this.rhs.names : {};
384
- }
385
- }, s = class extends a {
386
- constructor(e, t, n) {
387
- super(), this.lhs = e, this.rhs = t, this.sideEffects = n;
388
- }
389
- render({ _n: e }) {
390
- return `${this.lhs} = ${this.rhs};` + e;
391
- }
392
- optimizeNames(e, n) {
393
- if (!(this.lhs instanceof t.Name && !e[this.lhs.str] && !this.sideEffects)) return this.rhs = j(this.rhs, e, n), this;
394
- }
395
- get names() {
396
- return A(this.lhs instanceof t.Name ? {} : { ...this.lhs.names }, this.rhs);
397
- }
398
- }, c = class extends s {
399
- constructor(e, t, n, r) {
400
- super(e, n, r), this.op = t;
401
- }
402
- render({ _n: e }) {
403
- return `${this.lhs} ${this.op}= ${this.rhs};` + e;
404
- }
405
- }, l = class extends a {
406
- constructor(e) {
407
- super(), this.label = e, this.names = {};
408
- }
409
- render({ _n: e }) {
410
- return `${this.label}:` + e;
411
- }
412
- }, u = class extends a {
413
- constructor(e) {
414
- super(), this.label = e, this.names = {};
415
- }
416
- render({ _n: e }) {
417
- return `break${this.label ? ` ${this.label}` : ""};` + e;
418
- }
419
- }, d = class extends a {
420
- constructor(e) {
421
- super(), this.error = e;
422
- }
423
- render({ _n: e }) {
424
- return `throw ${this.error};` + e;
425
- }
426
- get names() {
427
- return this.error.names;
428
- }
429
- }, f = class extends a {
430
- constructor(e) {
431
- super(), this.code = e;
432
- }
433
- render({ _n: e }) {
434
- return `${this.code};` + e;
435
- }
436
- optimizeNodes() {
437
- return `${this.code}` ? this : void 0;
438
- }
439
- optimizeNames(e, t) {
440
- return this.code = j(this.code, e, t), this;
441
- }
442
- get names() {
443
- return this.code instanceof t._CodeOrName ? this.code.names : {};
444
- }
445
- }, p = class extends a {
446
- constructor(e = []) {
447
- super(), this.nodes = e;
448
- }
449
- render(e) {
450
- return this.nodes.reduce((t, n) => t + n.render(e), "");
451
- }
452
- optimizeNodes() {
453
- let { nodes: e } = this, t = e.length;
454
- for (; t--;) {
455
- let n = e[t].optimizeNodes();
456
- Array.isArray(n) ? e.splice(t, 1, ...n) : n ? e[t] = n : e.splice(t, 1);
457
- }
458
- return e.length > 0 ? this : void 0;
459
- }
460
- optimizeNames(e, t) {
461
- let { nodes: n } = this, r = n.length;
462
- for (; r--;) {
463
- let i = n[r];
464
- i.optimizeNames(e, t) || (M(e, i.names), n.splice(r, 1));
465
- }
466
- return n.length > 0 ? this : void 0;
467
- }
468
- get names() {
469
- return this.nodes.reduce((e, t) => k(e, t.names), {});
470
- }
471
- }, m = class extends p {
472
- render(e) {
473
- return "{" + e._n + super.render(e) + "}" + e._n;
474
- }
475
- }, h = class extends p {}, g = class extends m {};
476
- g.kind = "else";
477
- var _ = class e extends m {
478
- constructor(e, t) {
479
- super(t), this.condition = e;
480
- }
481
- render(e) {
482
- let t = `if(${this.condition})` + super.render(e);
483
- return this.else && (t += "else " + this.else.render(e)), t;
484
- }
485
- optimizeNodes() {
486
- super.optimizeNodes();
487
- let t = this.condition;
488
- if (t === !0) return this.nodes;
489
- let n = this.else;
490
- if (n) {
491
- let e = n.optimizeNodes();
492
- n = this.else = Array.isArray(e) ? new g(e) : e;
493
- }
494
- if (n) return t === !1 ? n instanceof e ? n : n.nodes : this.nodes.length ? this : new e(N(t), n instanceof e ? [n] : n.nodes);
495
- if (!(t === !1 || !this.nodes.length)) return this;
496
- }
497
- optimizeNames(e, t) {
498
- if (this.else = this.else?.optimizeNames(e, t), super.optimizeNames(e, t) || this.else) return this.condition = j(this.condition, e, t), this;
499
- }
500
- get names() {
501
- let e = super.names;
502
- return A(e, this.condition), this.else && k(e, this.else.names), e;
503
- }
504
- };
505
- _.kind = "if";
506
- var v = class extends m {};
507
- v.kind = "for";
508
- var y = class extends v {
509
- constructor(e) {
510
- super(), this.iteration = e;
511
- }
512
- render(e) {
513
- return `for(${this.iteration})` + super.render(e);
514
- }
515
- optimizeNames(e, t) {
516
- if (super.optimizeNames(e, t)) return this.iteration = j(this.iteration, e, t), this;
517
- }
518
- get names() {
519
- return k(super.names, this.iteration.names);
520
- }
521
- }, b = class extends v {
522
- constructor(e, t, n, r) {
523
- super(), this.varKind = e, this.name = t, this.from = n, this.to = r;
524
- }
525
- render(e) {
526
- let t = e.es5 ? n.varKinds.var : this.varKind, { name: r, from: i, to: a } = this;
527
- return `for(${t} ${r}=${i}; ${r}<${a}; ${r}++)` + super.render(e);
528
- }
529
- get names() {
530
- return A(A(super.names, this.from), this.to);
531
- }
532
- }, x = class extends v {
533
- constructor(e, t, n, r) {
534
- super(), this.loop = e, this.varKind = t, this.name = n, this.iterable = r;
535
- }
536
- render(e) {
537
- return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(e);
538
- }
539
- optimizeNames(e, t) {
540
- if (super.optimizeNames(e, t)) return this.iterable = j(this.iterable, e, t), this;
541
- }
542
- get names() {
543
- return k(super.names, this.iterable.names);
544
- }
545
- }, S = class extends m {
546
- constructor(e, t, n) {
547
- super(), this.name = e, this.args = t, this.async = n;
548
- }
549
- render(e) {
550
- return `${this.async ? "async " : ""}function ${this.name}(${this.args})` + super.render(e);
551
- }
552
- };
553
- S.kind = "func";
554
- var C = class extends p {
555
- render(e) {
556
- return "return " + super.render(e);
557
- }
558
- };
559
- C.kind = "return";
560
- var w = class extends m {
561
- render(e) {
562
- let t = "try" + super.render(e);
563
- return this.catch && (t += this.catch.render(e)), this.finally && (t += this.finally.render(e)), t;
564
- }
565
- optimizeNodes() {
566
- var e, t;
567
- return super.optimizeNodes(), (e = this.catch) == null || e.optimizeNodes(), (t = this.finally) == null || t.optimizeNodes(), this;
568
- }
569
- optimizeNames(e, t) {
570
- var n, r;
571
- return super.optimizeNames(e, t), (n = this.catch) == null || n.optimizeNames(e, t), (r = this.finally) == null || r.optimizeNames(e, t), this;
572
- }
573
- get names() {
574
- let e = super.names;
575
- return this.catch && k(e, this.catch.names), this.finally && k(e, this.finally.names), e;
576
- }
577
- }, T = class extends m {
578
- constructor(e) {
579
- super(), this.error = e;
580
- }
581
- render(e) {
582
- return `catch(${this.error})` + super.render(e);
583
- }
584
- };
585
- T.kind = "catch";
586
- var E = class extends m {
587
- render(e) {
588
- return "finally" + super.render(e);
589
- }
590
- };
591
- E.kind = "finally", e.CodeGen = class {
592
- constructor(e, t = {}) {
593
- this._values = {}, this._blockStarts = [], this._constants = {}, this.opts = {
594
- ...t,
595
- _n: t.lines ? "\n" : ""
596
- }, this._extScope = e, this._scope = new n.Scope({ parent: e }), this._nodes = [new h()];
597
- }
598
- toString() {
599
- return this._root.render(this.opts);
600
- }
601
- name(e) {
602
- return this._scope.name(e);
603
- }
604
- scopeName(e) {
605
- return this._extScope.name(e);
606
- }
607
- scopeValue(e, t) {
608
- let n = this._extScope.value(e, t);
609
- return (this._values[n.prefix] || (this._values[n.prefix] = /* @__PURE__ */ new Set())).add(n), n;
610
- }
611
- getScopeValue(e, t) {
612
- return this._extScope.getValue(e, t);
613
- }
614
- scopeRefs(e) {
615
- return this._extScope.scopeRefs(e, this._values);
616
- }
617
- scopeCode() {
618
- return this._extScope.scopeCode(this._values);
619
- }
620
- _def(e, t, n, r) {
621
- let i = this._scope.toName(t);
622
- return n !== void 0 && r && (this._constants[i.str] = n), this._leafNode(new o(e, i, n)), i;
623
- }
624
- const(e, t, r) {
625
- return this._def(n.varKinds.const, e, t, r);
626
- }
627
- let(e, t, r) {
628
- return this._def(n.varKinds.let, e, t, r);
629
- }
630
- var(e, t, r) {
631
- return this._def(n.varKinds.var, e, t, r);
632
- }
633
- assign(e, t, n) {
634
- return this._leafNode(new s(e, t, n));
635
- }
636
- add(t, n) {
637
- return this._leafNode(new c(t, e.operators.ADD, n));
638
- }
639
- code(e) {
640
- return typeof e == "function" ? e() : e !== t.nil && this._leafNode(new f(e)), this;
641
- }
642
- object(...e) {
643
- let n = ["{"];
644
- for (let [r, i] of e) n.length > 1 && n.push(","), n.push(r), (r !== i || this.opts.es5) && (n.push(":"), (0, t.addCodeArg)(n, i));
645
- return n.push("}"), new t._Code(n);
646
- }
647
- if(e, t, n) {
648
- if (this._blockNode(new _(e)), t && n) this.code(t).else().code(n).endIf();
649
- else if (t) this.code(t).endIf();
650
- else if (n) throw Error("CodeGen: \"else\" body without \"then\" body");
651
- return this;
652
- }
653
- elseIf(e) {
654
- return this._elseNode(new _(e));
655
- }
656
- else() {
657
- return this._elseNode(new g());
658
- }
659
- endIf() {
660
- return this._endBlockNode(_, g);
661
- }
662
- _for(e, t) {
663
- return this._blockNode(e), t && this.code(t).endFor(), this;
664
- }
665
- for(e, t) {
666
- return this._for(new y(e), t);
667
- }
668
- forRange(e, t, r, i, a = this.opts.es5 ? n.varKinds.var : n.varKinds.let) {
669
- let o = this._scope.toName(e);
670
- return this._for(new b(a, o, t, r), () => i(o));
671
- }
672
- forOf(e, r, i, a = n.varKinds.const) {
673
- let o = this._scope.toName(e);
674
- if (this.opts.es5) {
675
- let e = r instanceof t.Name ? r : this.var("_arr", r);
676
- return this.forRange("_i", 0, (0, t._)`${e}.length`, (n) => {
677
- this.var(o, (0, t._)`${e}[${n}]`), i(o);
678
- });
679
- }
680
- return this._for(new x("of", a, o, r), () => i(o));
681
- }
682
- forIn(e, r, i, a = this.opts.es5 ? n.varKinds.var : n.varKinds.const) {
683
- if (this.opts.ownProperties) return this.forOf(e, (0, t._)`Object.keys(${r})`, i);
684
- let o = this._scope.toName(e);
685
- return this._for(new x("in", a, o, r), () => i(o));
686
- }
687
- endFor() {
688
- return this._endBlockNode(v);
689
- }
690
- label(e) {
691
- return this._leafNode(new l(e));
692
- }
693
- break(e) {
694
- return this._leafNode(new u(e));
695
- }
696
- return(e) {
697
- let t = new C();
698
- if (this._blockNode(t), this.code(e), t.nodes.length !== 1) throw Error("CodeGen: \"return\" should have one node");
699
- return this._endBlockNode(C);
700
- }
701
- try(e, t, n) {
702
- if (!t && !n) throw Error("CodeGen: \"try\" without \"catch\" and \"finally\"");
703
- let r = new w();
704
- if (this._blockNode(r), this.code(e), t) {
705
- let e = this.name("e");
706
- this._currNode = r.catch = new T(e), t(e);
707
- }
708
- return n && (this._currNode = r.finally = new E(), this.code(n)), this._endBlockNode(T, E);
709
- }
710
- throw(e) {
711
- return this._leafNode(new d(e));
712
- }
713
- block(e, t) {
714
- return this._blockStarts.push(this._nodes.length), e && this.code(e).endBlock(t), this;
715
- }
716
- endBlock(e) {
717
- let t = this._blockStarts.pop();
718
- if (t === void 0) throw Error("CodeGen: not in self-balancing block");
719
- let n = this._nodes.length - t;
720
- if (n < 0 || e !== void 0 && n !== e) throw Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);
721
- return this._nodes.length = t, this;
722
- }
723
- func(e, n = t.nil, r, i) {
724
- return this._blockNode(new S(e, n, r)), i && this.code(i).endFunc(), this;
725
- }
726
- endFunc() {
727
- return this._endBlockNode(S);
728
- }
729
- optimize(e = 1) {
730
- for (; e-- > 0;) this._root.optimizeNodes(), this._root.optimizeNames(this._root.names, this._constants);
731
- }
732
- _leafNode(e) {
733
- return this._currNode.nodes.push(e), this;
734
- }
735
- _blockNode(e) {
736
- this._currNode.nodes.push(e), this._nodes.push(e);
737
- }
738
- _endBlockNode(e, t) {
739
- let n = this._currNode;
740
- if (n instanceof e || t && n instanceof t) return this._nodes.pop(), this;
741
- throw Error(`CodeGen: not in block "${t ? `${e.kind}/${t.kind}` : e.kind}"`);
742
- }
743
- _elseNode(e) {
744
- let t = this._currNode;
745
- if (!(t instanceof _)) throw Error("CodeGen: \"else\" without \"if\"");
746
- return this._currNode = t.else = e, this;
747
- }
748
- get _root() {
749
- return this._nodes[0];
750
- }
751
- get _currNode() {
752
- let e = this._nodes;
753
- return e[e.length - 1];
754
- }
755
- set _currNode(e) {
756
- let t = this._nodes;
757
- t[t.length - 1] = e;
758
- }
759
- };
760
- function k(e, t) {
761
- for (let n in t) e[n] = (e[n] || 0) + (t[n] || 0);
762
- return e;
763
- }
764
- function A(e, n) {
765
- return n instanceof t._CodeOrName ? k(e, n.names) : e;
766
- }
767
- function j(e, n, r) {
768
- if (e instanceof t.Name) return i(e);
769
- if (!a(e)) return e;
770
- return new t._Code(e._items.reduce((e, n) => (n instanceof t.Name && (n = i(n)), n instanceof t._Code ? e.push(...n._items) : e.push(n), e), []));
771
- function i(e) {
772
- let t = r[e.str];
773
- return t === void 0 || n[e.str] !== 1 ? e : (delete n[e.str], t);
774
- }
775
- function a(e) {
776
- return e instanceof t._Code && e._items.some((e) => e instanceof t.Name && n[e.str] === 1 && r[e.str] !== void 0);
777
- }
778
- }
779
- function M(e, t) {
780
- for (let n in t) e[n] = (e[n] || 0) - (t[n] || 0);
781
- }
782
- function N(e) {
783
- return typeof e == "boolean" || typeof e == "number" || e === null ? !e : (0, t._)`!${R(e)}`;
784
- }
785
- e.not = N;
786
- var P = L(e.operators.AND);
787
- function F(...e) {
788
- return e.reduce(P);
789
- }
790
- e.and = F;
791
- var I = L(e.operators.OR);
792
- function ee(...e) {
793
- return e.reduce(I);
794
- }
795
- e.or = ee;
796
- function L(e) {
797
- return (n, r) => n === t.nil ? r : r === t.nil ? n : (0, t._)`${R(n)} ${e} ${R(r)}`;
798
- }
799
- function R(e) {
800
- return e instanceof t.Name ? e : (0, t._)`(${e})`;
801
- }
802
- })), A = /* @__PURE__ */ g(((e) => {
803
- Object.defineProperty(e, "__esModule", { value: !0 }), e.checkStrictMode = e.getErrorPath = e.Type = e.useFunc = e.setEvaluated = e.evaluatedPropsToName = e.mergeEvaluated = e.eachItem = e.unescapeJsonPointer = e.escapeJsonPointer = e.escapeFragment = e.unescapeFragment = e.schemaRefOrVal = e.schemaHasRulesButRef = e.schemaHasRules = e.checkUnknownRules = e.alwaysValidSchema = e.toHash = void 0;
804
- var t = k(), n = D();
805
- function r(e) {
806
- let t = {};
807
- for (let n of e) t[n] = !0;
808
- return t;
809
- }
810
- e.toHash = r;
811
- function i(e, t) {
812
- return typeof t == "boolean" ? t : Object.keys(t).length === 0 || (a(e, t), !o(t, e.self.RULES.all));
813
- }
814
- e.alwaysValidSchema = i;
815
- function a(e, t = e.schema) {
816
- let { opts: n, self: r } = e;
817
- if (!n.strictSchema || typeof t == "boolean") return;
818
- let i = r.RULES.keywords;
819
- for (let n in t) i[n] || x(e, `unknown keyword: "${n}"`);
820
- }
821
- e.checkUnknownRules = a;
822
- function o(e, t) {
823
- if (typeof e == "boolean") return !e;
824
- for (let n in e) if (t[n]) return !0;
825
- return !1;
826
- }
827
- e.schemaHasRules = o;
828
- function s(e, t) {
829
- if (typeof e == "boolean") return !e;
830
- for (let n in e) if (n !== "$ref" && t.all[n]) return !0;
831
- return !1;
832
- }
833
- e.schemaHasRulesButRef = s;
834
- function c({ topSchemaRef: e, schemaPath: n }, r, i, a) {
835
- if (!a) {
836
- if (typeof r == "number" || typeof r == "boolean") return r;
837
- if (typeof r == "string") return (0, t._)`${r}`;
838
- }
839
- return (0, t._)`${e}${n}${(0, t.getProperty)(i)}`;
840
- }
841
- e.schemaRefOrVal = c;
842
- function l(e) {
843
- return f(decodeURIComponent(e));
844
- }
845
- e.unescapeFragment = l;
846
- function u(e) {
847
- return encodeURIComponent(d(e));
848
- }
849
- e.escapeFragment = u;
850
- function d(e) {
851
- return typeof e == "number" ? `${e}` : e.replace(/~/g, "~0").replace(/\//g, "~1");
852
- }
853
- e.escapeJsonPointer = d;
854
- function f(e) {
855
- return e.replace(/~1/g, "/").replace(/~0/g, "~");
856
- }
857
- e.unescapeJsonPointer = f;
858
- function p(e, t) {
859
- if (Array.isArray(e)) for (let n of e) t(n);
860
- else t(e);
861
- }
862
- e.eachItem = p;
863
- function m({ mergeNames: e, mergeToName: n, mergeValues: r, resultToName: i }) {
864
- return (a, o, s, c) => {
865
- let l = s === void 0 ? o : s instanceof t.Name ? (o instanceof t.Name ? e(a, o, s) : n(a, o, s), s) : o instanceof t.Name ? (n(a, s, o), o) : r(o, s);
866
- return c === t.Name && !(l instanceof t.Name) ? i(a, l) : l;
867
- };
868
- }
869
- e.mergeEvaluated = {
870
- props: m({
871
- mergeNames: (e, n, r) => e.if((0, t._)`${r} !== true && ${n} !== undefined`, () => {
872
- e.if((0, t._)`${n} === true`, () => e.assign(r, !0), () => e.assign(r, (0, t._)`${r} || {}`).code((0, t._)`Object.assign(${r}, ${n})`));
873
- }),
874
- mergeToName: (e, n, r) => e.if((0, t._)`${r} !== true`, () => {
875
- n === !0 ? e.assign(r, !0) : (e.assign(r, (0, t._)`${r} || {}`), g(e, r, n));
876
- }),
877
- mergeValues: (e, t) => e === !0 || {
878
- ...e,
879
- ...t
880
- },
881
- resultToName: h
882
- }),
883
- items: m({
884
- mergeNames: (e, n, r) => e.if((0, t._)`${r} !== true && ${n} !== undefined`, () => e.assign(r, (0, t._)`${n} === true ? true : ${r} > ${n} ? ${r} : ${n}`)),
885
- mergeToName: (e, n, r) => e.if((0, t._)`${r} !== true`, () => e.assign(r, n === !0 || (0, t._)`${r} > ${n} ? ${r} : ${n}`)),
886
- mergeValues: (e, t) => e === !0 || Math.max(e, t),
887
- resultToName: (e, t) => e.var("items", t)
888
- })
889
- };
890
- function h(e, n) {
891
- if (n === !0) return e.var("props", !0);
892
- let r = e.var("props", (0, t._)`{}`);
893
- return n !== void 0 && g(e, r, n), r;
894
- }
895
- e.evaluatedPropsToName = h;
896
- function g(e, n, r) {
897
- Object.keys(r).forEach((r) => e.assign((0, t._)`${n}${(0, t.getProperty)(r)}`, !0));
898
- }
899
- e.setEvaluated = g;
900
- var _ = {};
901
- function v(e, t) {
902
- return e.scopeValue("func", {
903
- ref: t,
904
- code: _[t.code] || (_[t.code] = new n._Code(t.code))
905
- });
906
- }
907
- e.useFunc = v;
908
- var y;
909
- (function(e) {
910
- e[e.Num = 0] = "Num", e[e.Str = 1] = "Str";
911
- })(y || (e.Type = y = {}));
912
- function b(e, n, r) {
913
- if (e instanceof t.Name) {
914
- let i = n === y.Num;
915
- return r ? i ? (0, t._)`"[" + ${e} + "]"` : (0, t._)`"['" + ${e} + "']"` : i ? (0, t._)`"/" + ${e}` : (0, t._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`;
916
- }
917
- return r ? (0, t.getProperty)(e).toString() : "/" + d(e);
918
- }
919
- e.getErrorPath = b;
920
- function x(e, t, n = e.opts.strictSchema) {
921
- if (n) {
922
- if (t = `strict mode: ${t}`, n === !0) throw Error(t);
923
- e.self.logger.warn(t);
924
- }
925
- }
926
- e.checkStrictMode = x;
927
- })), j = /* @__PURE__ */ g(((e) => {
928
- Object.defineProperty(e, "__esModule", { value: !0 });
929
- var t = k();
930
- e.default = {
931
- data: new t.Name("data"),
932
- valCxt: new t.Name("valCxt"),
933
- instancePath: new t.Name("instancePath"),
934
- parentData: new t.Name("parentData"),
935
- parentDataProperty: new t.Name("parentDataProperty"),
936
- rootData: new t.Name("rootData"),
937
- dynamicAnchors: new t.Name("dynamicAnchors"),
938
- vErrors: new t.Name("vErrors"),
939
- errors: new t.Name("errors"),
940
- this: new t.Name("this"),
941
- self: new t.Name("self"),
942
- scope: new t.Name("scope"),
943
- json: new t.Name("json"),
944
- jsonPos: new t.Name("jsonPos"),
945
- jsonLen: new t.Name("jsonLen"),
946
- jsonPart: new t.Name("jsonPart")
947
- };
948
- })), M = /* @__PURE__ */ g(((e) => {
949
- Object.defineProperty(e, "__esModule", { value: !0 }), e.extendErrors = e.resetErrorsCount = e.reportExtraError = e.reportError = e.keyword$DataError = e.keywordError = void 0;
950
- var t = k(), n = A(), r = j();
951
- e.keywordError = { message: ({ keyword: e }) => (0, t.str)`must pass "${e}" keyword validation` }, e.keyword$DataError = { message: ({ keyword: e, schemaType: n }) => n ? (0, t.str)`"${e}" keyword must be ${n} ($data)` : (0, t.str)`"${e}" keyword is invalid ($data)` };
952
- function i(n, r = e.keywordError, i, a) {
953
- let { it: o } = n, { gen: s, compositeRule: u, allErrors: f } = o, p = d(n, r, i);
954
- a ?? (u || f) ? c(s, p) : l(o, (0, t._)`[${p}]`);
955
- }
956
- e.reportError = i;
957
- function a(t, n = e.keywordError, i) {
958
- let { it: a } = t, { gen: o, compositeRule: s, allErrors: u } = a;
959
- c(o, d(t, n, i)), s || u || l(a, r.default.vErrors);
960
- }
961
- e.reportExtraError = a;
962
- function o(e, n) {
963
- e.assign(r.default.errors, n), e.if((0, t._)`${r.default.vErrors} !== null`, () => e.if(n, () => e.assign((0, t._)`${r.default.vErrors}.length`, n), () => e.assign(r.default.vErrors, null)));
964
- }
965
- e.resetErrorsCount = o;
966
- function s({ gen: e, keyword: n, schemaValue: i, data: a, errsCount: o, it: s }) {
967
- /* istanbul ignore if */
968
- if (o === void 0) throw Error("ajv implementation error");
969
- let c = e.name("err");
970
- e.forRange("i", o, r.default.errors, (o) => {
971
- e.const(c, (0, t._)`${r.default.vErrors}[${o}]`), e.if((0, t._)`${c}.instancePath === undefined`, () => e.assign((0, t._)`${c}.instancePath`, (0, t.strConcat)(r.default.instancePath, s.errorPath))), e.assign((0, t._)`${c}.schemaPath`, (0, t.str)`${s.errSchemaPath}/${n}`), s.opts.verbose && (e.assign((0, t._)`${c}.schema`, i), e.assign((0, t._)`${c}.data`, a));
972
- });
973
- }
974
- e.extendErrors = s;
975
- function c(e, n) {
976
- let i = e.const("err", n);
977
- e.if((0, t._)`${r.default.vErrors} === null`, () => e.assign(r.default.vErrors, (0, t._)`[${i}]`), (0, t._)`${r.default.vErrors}.push(${i})`), e.code((0, t._)`${r.default.errors}++`);
978
- }
979
- function l(e, n) {
980
- let { gen: r, validateName: i, schemaEnv: a } = e;
981
- a.$async ? r.throw((0, t._)`new ${e.ValidationError}(${n})`) : (r.assign((0, t._)`${i}.errors`, n), r.return(!1));
982
- }
983
- var u = {
984
- keyword: new t.Name("keyword"),
985
- schemaPath: new t.Name("schemaPath"),
986
- params: new t.Name("params"),
987
- propertyName: new t.Name("propertyName"),
988
- message: new t.Name("message"),
989
- schema: new t.Name("schema"),
990
- parentSchema: new t.Name("parentSchema")
991
- };
992
- function d(e, n, r) {
993
- let { createErrors: i } = e.it;
994
- return i === !1 ? (0, t._)`{}` : f(e, n, r);
995
- }
996
- function f(e, t, n = {}) {
997
- let { gen: r, it: i } = e, a = [p(i, n), m(e, n)];
998
- return h(e, t, a), r.object(...a);
999
- }
1000
- function p({ errorPath: e }, { instancePath: i }) {
1001
- let a = i ? (0, t.str)`${e}${(0, n.getErrorPath)(i, n.Type.Str)}` : e;
1002
- return [r.default.instancePath, (0, t.strConcat)(r.default.instancePath, a)];
1003
- }
1004
- function m({ keyword: e, it: { errSchemaPath: r } }, { schemaPath: i, parentSchema: a }) {
1005
- let o = a ? r : (0, t.str)`${r}/${e}`;
1006
- return i && (o = (0, t.str)`${o}${(0, n.getErrorPath)(i, n.Type.Str)}`), [u.schemaPath, o];
1007
- }
1008
- function h(e, { params: n, message: i }, a) {
1009
- let { keyword: o, data: s, schemaValue: c, it: l } = e, { opts: d, propertyName: f, topSchemaRef: p, schemaPath: m } = l;
1010
- a.push([u.keyword, o], [u.params, typeof n == "function" ? n(e) : n || (0, t._)`{}`]), d.messages && a.push([u.message, typeof i == "function" ? i(e) : i]), d.verbose && a.push([u.schema, c], [u.parentSchema, (0, t._)`${p}${m}`], [r.default.data, s]), f && a.push([u.propertyName, f]);
1011
- }
1012
- })), N = /* @__PURE__ */ g(((e) => {
1013
- Object.defineProperty(e, "__esModule", { value: !0 }), e.boolOrEmptySchema = e.topBoolOrEmptySchema = void 0;
1014
- var t = M(), n = k(), r = j(), i = { message: "boolean schema is false" };
1015
- function a(e) {
1016
- let { gen: t, schema: i, validateName: a } = e;
1017
- i === !1 ? s(e, !1) : typeof i == "object" && i.$async === !0 ? t.return(r.default.data) : (t.assign((0, n._)`${a}.errors`, null), t.return(!0));
1018
- }
1019
- e.topBoolOrEmptySchema = a;
1020
- function o(e, t) {
1021
- let { gen: n, schema: r } = e;
1022
- r === !1 ? (n.var(t, !1), s(e)) : n.var(t, !0);
1023
- }
1024
- e.boolOrEmptySchema = o;
1025
- function s(e, n) {
1026
- let { gen: r, data: a } = e, o = {
1027
- gen: r,
1028
- keyword: "false schema",
1029
- data: a,
1030
- schema: !1,
1031
- schemaCode: !1,
1032
- schemaValue: !1,
1033
- params: {},
1034
- it: e
1035
- };
1036
- (0, t.reportError)(o, i, void 0, n);
1037
- }
1038
- })), P = /* @__PURE__ */ g(((e) => {
1039
- Object.defineProperty(e, "__esModule", { value: !0 }), e.getRules = e.isJSONType = void 0;
1040
- var t = /* @__PURE__ */ new Set([
1041
- "string",
1042
- "number",
1043
- "integer",
1044
- "boolean",
1045
- "null",
1046
- "object",
1047
- "array"
1048
- ]);
1049
- function n(e) {
1050
- return typeof e == "string" && t.has(e);
1051
- }
1052
- e.isJSONType = n;
1053
- function r() {
1054
- let e = {
1055
- number: {
1056
- type: "number",
1057
- rules: []
1058
- },
1059
- string: {
1060
- type: "string",
1061
- rules: []
1062
- },
1063
- array: {
1064
- type: "array",
1065
- rules: []
1066
- },
1067
- object: {
1068
- type: "object",
1069
- rules: []
1070
- }
1071
- };
1072
- return {
1073
- types: {
1074
- ...e,
1075
- integer: !0,
1076
- boolean: !0,
1077
- null: !0
1078
- },
1079
- rules: [
1080
- { rules: [] },
1081
- e.number,
1082
- e.string,
1083
- e.array,
1084
- e.object
1085
- ],
1086
- post: { rules: [] },
1087
- all: {},
1088
- keywords: {}
1089
- };
1090
- }
1091
- e.getRules = r;
1092
- })), F = /* @__PURE__ */ g(((e) => {
1093
- Object.defineProperty(e, "__esModule", { value: !0 }), e.shouldUseRule = e.shouldUseGroup = e.schemaHasRulesForType = void 0;
1094
- function t({ schema: e, self: t }, r) {
1095
- let i = t.RULES.types[r];
1096
- return i && i !== !0 && n(e, i);
1097
- }
1098
- e.schemaHasRulesForType = t;
1099
- function n(e, t) {
1100
- return t.rules.some((t) => r(e, t));
1101
- }
1102
- e.shouldUseGroup = n;
1103
- function r(e, t) {
1104
- return e[t.keyword] !== void 0 || t.definition.implements?.some((t) => e[t] !== void 0);
1105
- }
1106
- e.shouldUseRule = r;
1107
- })), I = /* @__PURE__ */ g(((e) => {
1108
- Object.defineProperty(e, "__esModule", { value: !0 }), e.reportTypeError = e.checkDataTypes = e.checkDataType = e.coerceAndCheckDataType = e.getJSONTypes = e.getSchemaTypes = e.DataType = void 0;
1109
- var t = P(), n = F(), r = M(), i = k(), a = A(), o;
1110
- (function(e) {
1111
- e[e.Correct = 0] = "Correct", e[e.Wrong = 1] = "Wrong";
1112
- })(o || (e.DataType = o = {}));
1113
- function s(e) {
1114
- let t = c(e.type);
1115
- if (t.includes("null")) {
1116
- if (e.nullable === !1) throw Error("type: null contradicts nullable: false");
1117
- } else {
1118
- if (!t.length && e.nullable !== void 0) throw Error("\"nullable\" cannot be used without \"type\"");
1119
- e.nullable === !0 && t.push("null");
1120
- }
1121
- return t;
1122
- }
1123
- e.getSchemaTypes = s;
1124
- function c(e) {
1125
- let n = Array.isArray(e) ? e : e ? [e] : [];
1126
- if (n.every(t.isJSONType)) return n;
1127
- throw Error("type must be JSONType or JSONType[]: " + n.join(","));
1128
- }
1129
- e.getJSONTypes = c;
1130
- function l(e, t) {
1131
- let { gen: r, data: i, opts: a } = e, s = d(t, a.coerceTypes), c = t.length > 0 && !(s.length === 0 && t.length === 1 && (0, n.schemaHasRulesForType)(e, t[0]));
1132
- if (c) {
1133
- let n = h(t, i, a.strictNumbers, o.Wrong);
1134
- r.if(n, () => {
1135
- s.length ? f(e, t, s) : _(e);
1136
- });
1137
- }
1138
- return c;
1139
- }
1140
- e.coerceAndCheckDataType = l;
1141
- var u = /* @__PURE__ */ new Set([
1142
- "string",
1143
- "number",
1144
- "integer",
1145
- "boolean",
1146
- "null"
1147
- ]);
1148
- function d(e, t) {
1149
- return t ? e.filter((e) => u.has(e) || t === "array" && e === "array") : [];
1150
- }
1151
- function f(e, t, n) {
1152
- let { gen: r, data: a, opts: o } = e, s = r.let("dataType", (0, i._)`typeof ${a}`), c = r.let("coerced", (0, i._)`undefined`);
1153
- o.coerceTypes === "array" && r.if((0, i._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`, () => r.assign(a, (0, i._)`${a}[0]`).assign(s, (0, i._)`typeof ${a}`).if(h(t, a, o.strictNumbers), () => r.assign(c, a))), r.if((0, i._)`${c} !== undefined`);
1154
- for (let e of n) (u.has(e) || e === "array" && o.coerceTypes === "array") && l(e);
1155
- r.else(), _(e), r.endIf(), r.if((0, i._)`${c} !== undefined`, () => {
1156
- r.assign(a, c), p(e, c);
1157
- });
1158
- function l(e) {
1159
- switch (e) {
1160
- case "string":
1161
- r.elseIf((0, i._)`${s} == "number" || ${s} == "boolean"`).assign(c, (0, i._)`"" + ${a}`).elseIf((0, i._)`${a} === null`).assign(c, (0, i._)`""`);
1162
- return;
1163
- case "number":
1164
- r.elseIf((0, i._)`${s} == "boolean" || ${a} === null
1165
- || (${s} == "string" && ${a} && ${a} == +${a})`).assign(c, (0, i._)`+${a}`);
1166
- return;
1167
- case "integer":
1168
- r.elseIf((0, i._)`${s} === "boolean" || ${a} === null
1169
- || (${s} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(c, (0, i._)`+${a}`);
1170
- return;
1171
- case "boolean":
1172
- r.elseIf((0, i._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(c, !1).elseIf((0, i._)`${a} === "true" || ${a} === 1`).assign(c, !0);
1173
- return;
1174
- case "null":
1175
- r.elseIf((0, i._)`${a} === "" || ${a} === 0 || ${a} === false`), r.assign(c, null);
1176
- return;
1177
- case "array": r.elseIf((0, i._)`${s} === "string" || ${s} === "number"
1178
- || ${s} === "boolean" || ${a} === null`).assign(c, (0, i._)`[${a}]`);
1179
- }
1180
- }
1181
- }
1182
- function p({ gen: e, parentData: t, parentDataProperty: n }, r) {
1183
- e.if((0, i._)`${t} !== undefined`, () => e.assign((0, i._)`${t}[${n}]`, r));
1184
- }
1185
- function m(e, t, n, r = o.Correct) {
1186
- let a = r === o.Correct ? i.operators.EQ : i.operators.NEQ, s;
1187
- switch (e) {
1188
- case "null": return (0, i._)`${t} ${a} null`;
1189
- case "array":
1190
- s = (0, i._)`Array.isArray(${t})`;
1191
- break;
1192
- case "object":
1193
- s = (0, i._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;
1194
- break;
1195
- case "integer":
1196
- s = c((0, i._)`!(${t} % 1) && !isNaN(${t})`);
1197
- break;
1198
- case "number":
1199
- s = c();
1200
- break;
1201
- default: return (0, i._)`typeof ${t} ${a} ${e}`;
1202
- }
1203
- return r === o.Correct ? s : (0, i.not)(s);
1204
- function c(e = i.nil) {
1205
- return (0, i.and)((0, i._)`typeof ${t} == "number"`, e, n ? (0, i._)`isFinite(${t})` : i.nil);
1206
- }
1207
- }
1208
- e.checkDataType = m;
1209
- function h(e, t, n, r) {
1210
- if (e.length === 1) return m(e[0], t, n, r);
1211
- let o, s = (0, a.toHash)(e);
1212
- if (s.array && s.object) {
1213
- let e = (0, i._)`typeof ${t} != "object"`;
1214
- o = s.null ? e : (0, i._)`!${t} || ${e}`, delete s.null, delete s.array, delete s.object;
1215
- } else o = i.nil;
1216
- s.number && delete s.integer;
1217
- for (let e in s) o = (0, i.and)(o, m(e, t, n, r));
1218
- return o;
1219
- }
1220
- e.checkDataTypes = h;
1221
- var g = {
1222
- message: ({ schema: e }) => `must be ${e}`,
1223
- params: ({ schema: e, schemaValue: t }) => typeof e == "string" ? (0, i._)`{type: ${e}}` : (0, i._)`{type: ${t}}`
1224
- };
1225
- function _(e) {
1226
- let t = v(e);
1227
- (0, r.reportError)(t, g);
1228
- }
1229
- e.reportTypeError = _;
1230
- function v(e) {
1231
- let { gen: t, data: n, schema: r } = e, i = (0, a.schemaRefOrVal)(e, r, "type");
1232
- return {
1233
- gen: t,
1234
- keyword: "type",
1235
- data: n,
1236
- schema: r.type,
1237
- schemaCode: i,
1238
- schemaValue: i,
1239
- parentSchema: r,
1240
- params: {},
1241
- it: e
1242
- };
1243
- }
1244
- })), ee = /* @__PURE__ */ g(((e) => {
1245
- Object.defineProperty(e, "__esModule", { value: !0 }), e.assignDefaults = void 0;
1246
- var t = k(), n = A();
1247
- function r(e, t) {
1248
- let { properties: n, items: r } = e.schema;
1249
- if (t === "object" && n) for (let t in n) i(e, t, n[t].default);
1250
- else t === "array" && Array.isArray(r) && r.forEach((t, n) => i(e, n, t.default));
1251
- }
1252
- e.assignDefaults = r;
1253
- function i(e, r, i) {
1254
- let { gen: a, compositeRule: o, data: s, opts: c } = e;
1255
- if (i === void 0) return;
1256
- let l = (0, t._)`${s}${(0, t.getProperty)(r)}`;
1257
- if (o) {
1258
- (0, n.checkStrictMode)(e, `default is ignored for: ${l}`);
1259
- return;
1260
- }
1261
- let u = (0, t._)`${l} === undefined`;
1262
- c.useDefaults === "empty" && (u = (0, t._)`${u} || ${l} === null || ${l} === ""`), a.if(u, (0, t._)`${l} = ${(0, t.stringify)(i)}`);
1263
- }
1264
- })), L = /* @__PURE__ */ g(((e) => {
1265
- Object.defineProperty(e, "__esModule", { value: !0 }), e.validateUnion = e.validateArray = e.usePattern = e.callValidateCode = e.schemaProperties = e.allSchemaProperties = e.noPropertyInData = e.propertyInData = e.isOwnProperty = e.hasPropFunc = e.reportMissingProp = e.checkMissingProp = e.checkReportMissingProp = void 0;
1266
- var t = k(), n = A(), r = j(), i = A();
1267
- function a(e, n) {
1268
- let { gen: r, data: i, it: a } = e;
1269
- r.if(d(r, i, n, a.opts.ownProperties), () => {
1270
- e.setParams({ missingProperty: (0, t._)`${n}` }, !0), e.error();
1271
- });
1272
- }
1273
- e.checkReportMissingProp = a;
1274
- function o({ gen: e, data: n, it: { opts: r } }, i, a) {
1275
- return (0, t.or)(...i.map((i) => (0, t.and)(d(e, n, i, r.ownProperties), (0, t._)`${a} = ${i}`)));
1276
- }
1277
- e.checkMissingProp = o;
1278
- function s(e, t) {
1279
- e.setParams({ missingProperty: t }, !0), e.error();
1280
- }
1281
- e.reportMissingProp = s;
1282
- function c(e) {
1283
- return e.scopeValue("func", {
1284
- ref: Object.prototype.hasOwnProperty,
1285
- code: (0, t._)`Object.prototype.hasOwnProperty`
1286
- });
1287
- }
1288
- e.hasPropFunc = c;
1289
- function l(e, n, r) {
1290
- return (0, t._)`${c(e)}.call(${n}, ${r})`;
1291
- }
1292
- e.isOwnProperty = l;
1293
- function u(e, n, r, i) {
1294
- let a = (0, t._)`${n}${(0, t.getProperty)(r)} !== undefined`;
1295
- return i ? (0, t._)`${a} && ${l(e, n, r)}` : a;
1296
- }
1297
- e.propertyInData = u;
1298
- function d(e, n, r, i) {
1299
- let a = (0, t._)`${n}${(0, t.getProperty)(r)} === undefined`;
1300
- return i ? (0, t.or)(a, (0, t.not)(l(e, n, r))) : a;
1301
- }
1302
- e.noPropertyInData = d;
1303
- function f(e) {
1304
- return e ? Object.keys(e).filter((e) => e !== "__proto__") : [];
1305
- }
1306
- e.allSchemaProperties = f;
1307
- function p(e, t) {
1308
- return f(t).filter((r) => !(0, n.alwaysValidSchema)(e, t[r]));
1309
- }
1310
- e.schemaProperties = p;
1311
- function m({ schemaCode: e, data: n, it: { gen: i, topSchemaRef: a, schemaPath: o, errorPath: s }, it: c }, l, u, d) {
1312
- let f = d ? (0, t._)`${e}, ${n}, ${a}${o}` : n, p = [
1313
- [r.default.instancePath, (0, t.strConcat)(r.default.instancePath, s)],
1314
- [r.default.parentData, c.parentData],
1315
- [r.default.parentDataProperty, c.parentDataProperty],
1316
- [r.default.rootData, r.default.rootData]
1317
- ];
1318
- c.opts.dynamicRef && p.push([r.default.dynamicAnchors, r.default.dynamicAnchors]);
1319
- let m = (0, t._)`${f}, ${i.object(...p)}`;
1320
- return u === t.nil ? (0, t._)`${l}(${m})` : (0, t._)`${l}.call(${u}, ${m})`;
1321
- }
1322
- e.callValidateCode = m;
1323
- var h = (0, t._)`new RegExp`;
1324
- function g({ gen: e, it: { opts: n } }, r) {
1325
- let a = n.unicodeRegExp ? "u" : "", { regExp: o } = n.code, s = o(r, a);
1326
- return e.scopeValue("pattern", {
1327
- key: s.toString(),
1328
- ref: s,
1329
- code: (0, t._)`${o.code === "new RegExp" ? h : (0, i.useFunc)(e, o)}(${r}, ${a})`
1330
- });
1331
- }
1332
- e.usePattern = g;
1333
- function _(e) {
1334
- let { gen: r, data: i, keyword: a, it: o } = e, s = r.name("valid");
1335
- if (o.allErrors) {
1336
- let e = r.let("valid", !0);
1337
- return c(() => r.assign(e, !1)), e;
1338
- }
1339
- return r.var(s, !0), c(() => r.break()), s;
1340
- function c(o) {
1341
- let c = r.const("len", (0, t._)`${i}.length`);
1342
- r.forRange("i", 0, c, (i) => {
1343
- e.subschema({
1344
- keyword: a,
1345
- dataProp: i,
1346
- dataPropType: n.Type.Num
1347
- }, s), r.if((0, t.not)(s), o);
1348
- });
1349
- }
1350
- }
1351
- e.validateArray = _;
1352
- function v(e) {
1353
- let { gen: r, schema: i, keyword: a, it: o } = e;
1354
- /* istanbul ignore if */
1355
- if (!Array.isArray(i)) throw Error("ajv implementation error");
1356
- if (i.some((e) => (0, n.alwaysValidSchema)(o, e)) && !o.opts.unevaluated) return;
1357
- let s = r.let("valid", !1), c = r.name("_valid");
1358
- r.block(() => i.forEach((n, i) => {
1359
- let o = e.subschema({
1360
- keyword: a,
1361
- schemaProp: i,
1362
- compositeRule: !0
1363
- }, c);
1364
- r.assign(s, (0, t._)`${s} || ${c}`), e.mergeValidEvaluated(o, c) || r.if((0, t.not)(s));
1365
- })), e.result(s, () => e.reset(), () => e.error(!0));
1366
- }
1367
- e.validateUnion = v;
1368
- })), R = /* @__PURE__ */ g(((e) => {
1369
- Object.defineProperty(e, "__esModule", { value: !0 }), e.validateKeywordUsage = e.validSchemaType = e.funcKeywordCode = e.macroKeywordCode = void 0;
1370
- var t = k(), n = j(), r = L(), i = M();
1371
- function a(e, n) {
1372
- let { gen: r, keyword: i, schema: a, parentSchema: o, it: s } = e, c = n.macro.call(s.self, a, o, s), l = u(r, i, c);
1373
- s.opts.validateSchema !== !1 && s.self.validateSchema(c, !0);
1374
- let d = r.name("valid");
1375
- e.subschema({
1376
- schema: c,
1377
- schemaPath: t.nil,
1378
- errSchemaPath: `${s.errSchemaPath}/${i}`,
1379
- topSchemaRef: l,
1380
- compositeRule: !0
1381
- }, d), e.pass(d, () => e.error(!0));
1382
- }
1383
- e.macroKeywordCode = a;
1384
- function o(e, i) {
1385
- let { gen: a, keyword: o, schema: d, parentSchema: f, $data: p, it: m } = e;
1386
- l(m, i);
1387
- let h = u(a, o, !p && i.compile ? i.compile.call(m.self, d, f, m) : i.validate), g = a.let("valid");
1388
- e.block$data(g, _), e.ok(i.valid ?? g);
1389
- function _() {
1390
- if (i.errors === !1) b(), i.modifying && s(e), x(() => e.error());
1391
- else {
1392
- let t = i.async ? v() : y();
1393
- i.modifying && s(e), x(() => c(e, t));
1394
- }
1395
- }
1396
- function v() {
1397
- let e = a.let("ruleErrs", null);
1398
- return a.try(() => b((0, t._)`await `), (n) => a.assign(g, !1).if((0, t._)`${n} instanceof ${m.ValidationError}`, () => a.assign(e, (0, t._)`${n}.errors`), () => a.throw(n))), e;
1399
- }
1400
- function y() {
1401
- let e = (0, t._)`${h}.errors`;
1402
- return a.assign(e, null), b(t.nil), e;
1403
- }
1404
- function b(o = i.async ? (0, t._)`await ` : t.nil) {
1405
- let s = m.opts.passContext ? n.default.this : n.default.self, c = !("compile" in i && !p || i.schema === !1);
1406
- a.assign(g, (0, t._)`${o}${(0, r.callValidateCode)(e, h, s, c)}`, i.modifying);
1407
- }
1408
- function x(e) {
1409
- a.if((0, t.not)(i.valid ?? g), e);
1410
- }
1411
- }
1412
- e.funcKeywordCode = o;
1413
- function s(e) {
1414
- let { gen: n, data: r, it: i } = e;
1415
- n.if(i.parentData, () => n.assign(r, (0, t._)`${i.parentData}[${i.parentDataProperty}]`));
1416
- }
1417
- function c(e, r) {
1418
- let { gen: a } = e;
1419
- a.if((0, t._)`Array.isArray(${r})`, () => {
1420
- a.assign(n.default.vErrors, (0, t._)`${n.default.vErrors} === null ? ${r} : ${n.default.vErrors}.concat(${r})`).assign(n.default.errors, (0, t._)`${n.default.vErrors}.length`), (0, i.extendErrors)(e);
1421
- }, () => e.error());
1422
- }
1423
- function l({ schemaEnv: e }, t) {
1424
- if (t.async && !e.$async) throw Error("async keyword in sync schema");
1425
- }
1426
- function u(e, n, r) {
1427
- if (r === void 0) throw Error(`keyword "${n}" failed to compile`);
1428
- return e.scopeValue("keyword", typeof r == "function" ? { ref: r } : {
1429
- ref: r,
1430
- code: (0, t.stringify)(r)
1431
- });
1432
- }
1433
- function d(e, t, n = !1) {
1434
- return !t.length || t.some((t) => t === "array" ? Array.isArray(e) : t === "object" ? e && typeof e == "object" && !Array.isArray(e) : typeof e == t || n && e === void 0);
1435
- }
1436
- e.validSchemaType = d;
1437
- function f({ schema: e, opts: t, self: n, errSchemaPath: r }, i, a) {
1438
- /* istanbul ignore if */
1439
- if (Array.isArray(i.keyword) ? !i.keyword.includes(a) : i.keyword !== a) throw Error("ajv implementation error");
1440
- let o = i.dependencies;
1441
- if (o?.some((t) => !Object.prototype.hasOwnProperty.call(e, t))) throw Error(`parent schema must have dependencies of ${a}: ${o.join(",")}`);
1442
- if (i.validateSchema && !i.validateSchema(e[a])) {
1443
- let e = `keyword "${a}" value is invalid at path "${r}": ` + n.errorsText(i.validateSchema.errors);
1444
- if (t.validateSchema === "log") n.logger.error(e);
1445
- else throw Error(e);
1446
- }
1447
- }
1448
- e.validateKeywordUsage = f;
1449
- })), z = /* @__PURE__ */ g(((e) => {
1450
- Object.defineProperty(e, "__esModule", { value: !0 }), e.extendSubschemaMode = e.extendSubschemaData = e.getSubschema = void 0;
1451
- var t = k(), n = A();
1452
- function r(e, { keyword: r, schemaProp: i, schema: a, schemaPath: o, errSchemaPath: s, topSchemaRef: c }) {
1453
- if (r !== void 0 && a !== void 0) throw Error("both \"keyword\" and \"schema\" passed, only one allowed");
1454
- if (r !== void 0) {
1455
- let a = e.schema[r];
1456
- return i === void 0 ? {
1457
- schema: a,
1458
- schemaPath: (0, t._)`${e.schemaPath}${(0, t.getProperty)(r)}`,
1459
- errSchemaPath: `${e.errSchemaPath}/${r}`
1460
- } : {
1461
- schema: a[i],
1462
- schemaPath: (0, t._)`${e.schemaPath}${(0, t.getProperty)(r)}${(0, t.getProperty)(i)}`,
1463
- errSchemaPath: `${e.errSchemaPath}/${r}/${(0, n.escapeFragment)(i)}`
1464
- };
1465
- }
1466
- if (a !== void 0) {
1467
- if (o === void 0 || s === void 0 || c === void 0) throw Error("\"schemaPath\", \"errSchemaPath\" and \"topSchemaRef\" are required with \"schema\"");
1468
- return {
1469
- schema: a,
1470
- schemaPath: o,
1471
- topSchemaRef: c,
1472
- errSchemaPath: s
1473
- };
1474
- }
1475
- throw Error("either \"keyword\" or \"schema\" must be passed");
1476
- }
1477
- e.getSubschema = r;
1478
- function i(e, r, { dataProp: i, dataPropType: a, data: o, dataTypes: s, propertyName: c }) {
1479
- if (o !== void 0 && i !== void 0) throw Error("both \"data\" and \"dataProp\" passed, only one allowed");
1480
- let { gen: l } = r;
1481
- if (i !== void 0) {
1482
- let { errorPath: o, dataPathArr: s, opts: c } = r;
1483
- u(l.let("data", (0, t._)`${r.data}${(0, t.getProperty)(i)}`, !0)), e.errorPath = (0, t.str)`${o}${(0, n.getErrorPath)(i, a, c.jsPropertySyntax)}`, e.parentDataProperty = (0, t._)`${i}`, e.dataPathArr = [...s, e.parentDataProperty];
1484
- }
1485
- o !== void 0 && (u(o instanceof t.Name ? o : l.let("data", o, !0)), c !== void 0 && (e.propertyName = c)), s && (e.dataTypes = s);
1486
- function u(t) {
1487
- e.data = t, e.dataLevel = r.dataLevel + 1, e.dataTypes = [], r.definedProperties = /* @__PURE__ */ new Set(), e.parentData = r.data, e.dataNames = [...r.dataNames, t];
1488
- }
1489
- }
1490
- e.extendSubschemaData = i;
1491
- function a(e, { jtdDiscriminator: t, jtdMetadata: n, compositeRule: r, createErrors: i, allErrors: a }) {
1492
- r !== void 0 && (e.compositeRule = r), i !== void 0 && (e.createErrors = i), a !== void 0 && (e.allErrors = a), e.jtdDiscriminator = t, e.jtdMetadata = n;
1493
- }
1494
- e.extendSubschemaMode = a;
1495
- })), te = /* @__PURE__ */ g(((e, t) => {
1496
- t.exports = function e(t, n) {
1497
- if (t === n) return !0;
1498
- if (t && n && typeof t == "object" && typeof n == "object") {
1499
- if (t.constructor !== n.constructor) return !1;
1500
- var r, i, a;
1501
- if (Array.isArray(t)) {
1502
- if (r = t.length, r != n.length) return !1;
1503
- for (i = r; i-- !== 0;) if (!e(t[i], n[i])) return !1;
1504
- return !0;
1505
- }
1506
- if (t.constructor === RegExp) return t.source === n.source && t.flags === n.flags;
1507
- if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === n.valueOf();
1508
- if (t.toString !== Object.prototype.toString) return t.toString() === n.toString();
1509
- if (a = Object.keys(t), r = a.length, r !== Object.keys(n).length) return !1;
1510
- for (i = r; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(n, a[i])) return !1;
1511
- for (i = r; i-- !== 0;) {
1512
- var o = a[i];
1513
- if (!e(t[o], n[o])) return !1;
1514
- }
1515
- return !0;
1516
- }
1517
- return t !== t && n !== n;
1518
- };
1519
- })), ne = /* @__PURE__ */ g(((e, t) => {
1520
- var n = t.exports = function(e, t, n) {
1521
- typeof t == "function" && (n = t, t = {}), n = t.cb || n;
1522
- var i = typeof n == "function" ? n : n.pre || function() {}, a = n.post || function() {};
1523
- r(t, i, a, e, "", e);
1524
- };
1525
- n.keywords = {
1526
- additionalItems: !0,
1527
- items: !0,
1528
- contains: !0,
1529
- additionalProperties: !0,
1530
- propertyNames: !0,
1531
- not: !0,
1532
- if: !0,
1533
- then: !0,
1534
- else: !0
1535
- }, n.arrayKeywords = {
1536
- items: !0,
1537
- allOf: !0,
1538
- anyOf: !0,
1539
- oneOf: !0
1540
- }, n.propsKeywords = {
1541
- $defs: !0,
1542
- definitions: !0,
1543
- properties: !0,
1544
- patternProperties: !0,
1545
- dependencies: !0
1546
- }, n.skipKeywords = {
1547
- default: !0,
1548
- enum: !0,
1549
- const: !0,
1550
- required: !0,
1551
- maximum: !0,
1552
- minimum: !0,
1553
- exclusiveMaximum: !0,
1554
- exclusiveMinimum: !0,
1555
- multipleOf: !0,
1556
- maxLength: !0,
1557
- minLength: !0,
1558
- pattern: !0,
1559
- format: !0,
1560
- maxItems: !0,
1561
- minItems: !0,
1562
- uniqueItems: !0,
1563
- maxProperties: !0,
1564
- minProperties: !0
1565
- };
1566
- function r(e, t, a, o, s, c, l, u, d, f) {
1567
- if (o && typeof o == "object" && !Array.isArray(o)) {
1568
- for (var p in t(o, s, c, l, u, d, f), o) {
1569
- var m = o[p];
1570
- if (Array.isArray(m)) {
1571
- if (p in n.arrayKeywords) for (var h = 0; h < m.length; h++) r(e, t, a, m[h], s + "/" + p + "/" + h, c, s, p, o, h);
1572
- } else if (p in n.propsKeywords) {
1573
- if (m && typeof m == "object") for (var g in m) r(e, t, a, m[g], s + "/" + p + "/" + i(g), c, s, p, o, g);
1574
- } else (p in n.keywords || e.allKeys && !(p in n.skipKeywords)) && r(e, t, a, m, s + "/" + p, c, s, p, o);
1575
- }
1576
- a(o, s, c, l, u, d, f);
1577
- }
1578
- }
1579
- function i(e) {
1580
- return e.replace(/~/g, "~0").replace(/\//g, "~1");
1581
- }
1582
- })), B = /* @__PURE__ */ g(((e) => {
1583
- Object.defineProperty(e, "__esModule", { value: !0 }), e.getSchemaRefs = e.resolveUrl = e.normalizeId = e._getFullPath = e.getFullPath = e.inlineRef = void 0;
1584
- var t = A(), n = te(), r = ne(), i = /* @__PURE__ */ new Set([
1585
- "type",
1586
- "format",
1587
- "pattern",
1588
- "maxLength",
1589
- "minLength",
1590
- "maxProperties",
1591
- "minProperties",
1592
- "maxItems",
1593
- "minItems",
1594
- "maximum",
1595
- "minimum",
1596
- "uniqueItems",
1597
- "multipleOf",
1598
- "required",
1599
- "enum",
1600
- "const"
1601
- ]);
1602
- function a(e, t = !0) {
1603
- return typeof e == "boolean" ? !0 : t === !0 ? !s(e) : t ? c(e) <= t : !1;
1604
- }
1605
- e.inlineRef = a;
1606
- var o = /* @__PURE__ */ new Set([
1607
- "$ref",
1608
- "$recursiveRef",
1609
- "$recursiveAnchor",
1610
- "$dynamicRef",
1611
- "$dynamicAnchor"
1612
- ]);
1613
- function s(e) {
1614
- for (let t in e) {
1615
- if (o.has(t)) return !0;
1616
- let n = e[t];
1617
- if (Array.isArray(n) && n.some(s) || typeof n == "object" && s(n)) return !0;
1618
- }
1619
- return !1;
1620
- }
1621
- function c(e) {
1622
- let n = 0;
1623
- for (let r in e) if (r === "$ref" || (n++, !i.has(r) && (typeof e[r] == "object" && (0, t.eachItem)(e[r], (e) => n += c(e)), n === Infinity))) return Infinity;
1624
- return n;
1625
- }
1626
- function l(e, t = "", n) {
1627
- return n !== !1 && (t = f(t)), u(e, e.parse(t));
1628
- }
1629
- e.getFullPath = l;
1630
- function u(e, t) {
1631
- return e.serialize(t).split("#")[0] + "#";
1632
- }
1633
- e._getFullPath = u;
1634
- var d = /#\/?$/;
1635
- function f(e) {
1636
- return e ? e.replace(d, "") : "";
1637
- }
1638
- e.normalizeId = f;
1639
- function p(e, t, n) {
1640
- return n = f(n), e.resolve(t, n);
1641
- }
1642
- e.resolveUrl = p;
1643
- var m = /^[a-z_][-a-z0-9._]*$/i;
1644
- function h(e, t) {
1645
- if (typeof e == "boolean") return {};
1646
- let { schemaId: i, uriResolver: a } = this.opts, o = f(e[i] || t), s = { "": o }, c = l(a, o, !1), u = {}, d = /* @__PURE__ */ new Set();
1647
- return r(e, { allKeys: !0 }, (e, t, n, r) => {
1648
- if (r === void 0) return;
1649
- let a = c + t, o = s[r];
1650
- typeof e[i] == "string" && (o = l.call(this, e[i])), g.call(this, e.$anchor), g.call(this, e.$dynamicAnchor), s[t] = o;
1651
- function l(t) {
1652
- let n = this.opts.uriResolver.resolve;
1653
- if (t = f(o ? n(o, t) : t), d.has(t)) throw h(t);
1654
- d.add(t);
1655
- let r = this.refs[t];
1656
- return typeof r == "string" && (r = this.refs[r]), typeof r == "object" ? p(e, r.schema, t) : t !== f(a) && (t[0] === "#" ? (p(e, u[t], t), u[t] = e) : this.refs[t] = a), t;
1657
- }
1658
- function g(e) {
1659
- if (typeof e == "string") {
1660
- if (!m.test(e)) throw Error(`invalid anchor "${e}"`);
1661
- l.call(this, `#${e}`);
1662
- }
1663
- }
1664
- }), u;
1665
- function p(e, t, r) {
1666
- if (t !== void 0 && !n(e, t)) throw h(r);
1667
- }
1668
- function h(e) {
1669
- return /* @__PURE__ */ Error(`reference "${e}" resolves to more than one schema`);
1670
- }
1671
- }
1672
- e.getSchemaRefs = h;
1673
- })), V = /* @__PURE__ */ g(((e) => {
1674
- Object.defineProperty(e, "__esModule", { value: !0 }), e.getData = e.KeywordCxt = e.validateFunctionCode = void 0;
1675
- var t = N(), n = I(), r = F(), i = I(), a = ee(), o = R(), s = z(), c = k(), l = j(), u = B(), d = A(), f = M();
1676
- function p(e) {
1677
- if (S(e) && (w(e), x(e))) {
1678
- _(e);
1679
- return;
1680
- }
1681
- m(e, () => (0, t.topBoolOrEmptySchema)(e));
1682
- }
1683
- e.validateFunctionCode = p;
1684
- function m({ gen: e, validateName: t, schema: n, schemaEnv: r, opts: i }, a) {
1685
- i.code.es5 ? e.func(t, (0, c._)`${l.default.data}, ${l.default.valCxt}`, r.$async, () => {
1686
- e.code((0, c._)`"use strict"; ${y(n, i)}`), g(e, i), e.code(a);
1687
- }) : e.func(t, (0, c._)`${l.default.data}, ${h(i)}`, r.$async, () => e.code(y(n, i)).code(a));
1688
- }
1689
- function h(e) {
1690
- return (0, c._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${e.dynamicRef ? (0, c._)`, ${l.default.dynamicAnchors}={}` : c.nil}}={}`;
1691
- }
1692
- function g(e, t) {
1693
- e.if(l.default.valCxt, () => {
1694
- e.var(l.default.instancePath, (0, c._)`${l.default.valCxt}.${l.default.instancePath}`), e.var(l.default.parentData, (0, c._)`${l.default.valCxt}.${l.default.parentData}`), e.var(l.default.parentDataProperty, (0, c._)`${l.default.valCxt}.${l.default.parentDataProperty}`), e.var(l.default.rootData, (0, c._)`${l.default.valCxt}.${l.default.rootData}`), t.dynamicRef && e.var(l.default.dynamicAnchors, (0, c._)`${l.default.valCxt}.${l.default.dynamicAnchors}`);
1695
- }, () => {
1696
- e.var(l.default.instancePath, (0, c._)`""`), e.var(l.default.parentData, (0, c._)`undefined`), e.var(l.default.parentDataProperty, (0, c._)`undefined`), e.var(l.default.rootData, l.default.data), t.dynamicRef && e.var(l.default.dynamicAnchors, (0, c._)`{}`);
1697
- });
1698
- }
1699
- function _(e) {
1700
- let { schema: t, opts: n, gen: r } = e;
1701
- m(e, () => {
1702
- n.$comment && t.$comment && L(e), D(e), r.let(l.default.vErrors, null), r.let(l.default.errors, 0), n.unevaluated && v(e), T(e), te(e);
1703
- });
1704
- }
1705
- function v(e) {
1706
- let { gen: t, validateName: n } = e;
1707
- e.evaluated = t.const("evaluated", (0, c._)`${n}.evaluated`), t.if((0, c._)`${e.evaluated}.dynamicProps`, () => t.assign((0, c._)`${e.evaluated}.props`, (0, c._)`undefined`)), t.if((0, c._)`${e.evaluated}.dynamicItems`, () => t.assign((0, c._)`${e.evaluated}.items`, (0, c._)`undefined`));
1708
- }
1709
- function y(e, t) {
1710
- let n = typeof e == "object" && e[t.schemaId];
1711
- return n && (t.code.source || t.code.process) ? (0, c._)`/*# sourceURL=${n} */` : c.nil;
1712
- }
1713
- function b(e, n) {
1714
- if (S(e) && (w(e), x(e))) {
1715
- C(e, n);
1716
- return;
1717
- }
1718
- (0, t.boolOrEmptySchema)(e, n);
1719
- }
1720
- function x({ schema: e, self: t }) {
1721
- if (typeof e == "boolean") return !e;
1722
- for (let n in e) if (t.RULES.all[n]) return !0;
1723
- return !1;
1724
- }
1725
- function S(e) {
1726
- return typeof e.schema != "boolean";
1727
- }
1728
- function C(e, t) {
1729
- let { schema: n, gen: r, opts: i } = e;
1730
- i.$comment && n.$comment && L(e), O(e), P(e);
1731
- let a = r.const("_errs", l.default.errors);
1732
- T(e, a), r.var(t, (0, c._)`${a} === ${l.default.errors}`);
1733
- }
1734
- function w(e) {
1735
- (0, d.checkUnknownRules)(e), E(e);
1736
- }
1737
- function T(e, t) {
1738
- if (e.opts.jtd) return V(e, [], !1, t);
1739
- let r = (0, n.getSchemaTypes)(e.schema);
1740
- V(e, r, !(0, n.coerceAndCheckDataType)(e, r), t);
1741
- }
1742
- function E(e) {
1743
- let { schema: t, errSchemaPath: n, opts: r, self: i } = e;
1744
- t.$ref && r.ignoreKeywordsWithRef && (0, d.schemaHasRulesButRef)(t, i.RULES) && i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`);
1745
- }
1746
- function D(e) {
1747
- let { schema: t, opts: n } = e;
1748
- t.default !== void 0 && n.useDefaults && n.strictSchema && (0, d.checkStrictMode)(e, "default is ignored in the schema root");
1749
- }
1750
- function O(e) {
1751
- let t = e.schema[e.opts.schemaId];
1752
- t && (e.baseId = (0, u.resolveUrl)(e.opts.uriResolver, e.baseId, t));
1753
- }
1754
- function P(e) {
1755
- if (e.schema.$async && !e.schemaEnv.$async) throw Error("async schema in sync schema");
1756
- }
1757
- function L({ gen: e, schemaEnv: t, schema: n, errSchemaPath: r, opts: i }) {
1758
- let a = n.$comment;
1759
- if (i.$comment === !0) e.code((0, c._)`${l.default.self}.logger.log(${a})`);
1760
- else if (typeof i.$comment == "function") {
1761
- let n = (0, c.str)`${r}/$comment`, i = e.scopeValue("root", { ref: t.root });
1762
- e.code((0, c._)`${l.default.self}.opts.$comment(${a}, ${n}, ${i}.schema)`);
1763
- }
1764
- }
1765
- function te(e) {
1766
- let { gen: t, schemaEnv: n, validateName: r, ValidationError: i, opts: a } = e;
1767
- n.$async ? t.if((0, c._)`${l.default.errors} === 0`, () => t.return(l.default.data), () => t.throw((0, c._)`new ${i}(${l.default.vErrors})`)) : (t.assign((0, c._)`${r}.errors`, l.default.vErrors), a.unevaluated && ne(e), t.return((0, c._)`${l.default.errors} === 0`));
1768
- }
1769
- function ne({ gen: e, evaluated: t, props: n, items: r }) {
1770
- n instanceof c.Name && e.assign((0, c._)`${t}.props`, n), r instanceof c.Name && e.assign((0, c._)`${t}.items`, r);
1771
- }
1772
- function V(e, t, n, a) {
1773
- let { gen: o, schema: s, data: u, allErrors: f, opts: p, self: m } = e, { RULES: h } = m;
1774
- if (s.$ref && (p.ignoreKeywordsWithRef || !(0, d.schemaHasRulesButRef)(s, h))) {
1775
- o.block(() => Z(e, "$ref", h.all.$ref.definition));
1776
- return;
1777
- }
1778
- p.jtd || U(e, t), o.block(() => {
1779
- for (let e of h.rules) g(e);
1780
- g(h.post);
1781
- });
1782
- function g(d) {
1783
- (0, r.shouldUseGroup)(s, d) && (d.type ? (o.if((0, i.checkDataType)(d.type, u, p.strictNumbers)), H(e, d), t.length === 1 && t[0] === d.type && n && (o.else(), (0, i.reportTypeError)(e)), o.endIf()) : H(e, d), f || o.if((0, c._)`${l.default.errors} === ${a || 0}`));
1784
- }
1785
- }
1786
- function H(e, t) {
1787
- let { gen: n, schema: i, opts: { useDefaults: o } } = e;
1788
- o && (0, a.assignDefaults)(e, t.type), n.block(() => {
1789
- for (let n of t.rules) (0, r.shouldUseRule)(i, n) && Z(e, n.keyword, n.definition, t.type);
1790
- });
1791
- }
1792
- function U(e, t) {
1793
- e.schemaEnv.meta || !e.opts.strictTypes || (W(e, t), e.opts.allowUnionTypes || re(e, t), G(e, e.dataTypes));
1794
- }
1795
- function W(e, t) {
1796
- if (t.length) {
1797
- if (!e.dataTypes.length) {
1798
- e.dataTypes = t;
1799
- return;
1800
- }
1801
- t.forEach((t) => {
1802
- q(e.dataTypes, t) || Y(e, `type "${t}" not allowed by context "${e.dataTypes.join(",")}"`);
1803
- }), J(e, t);
1804
- }
1805
- }
1806
- function re(e, t) {
1807
- t.length > 1 && !(t.length === 2 && t.includes("null")) && Y(e, "use allowUnionTypes to allow union type keyword");
1808
- }
1809
- function G(e, t) {
1810
- let n = e.self.RULES.all;
1811
- for (let i in n) {
1812
- let a = n[i];
1813
- if (typeof a == "object" && (0, r.shouldUseRule)(e.schema, a)) {
1814
- let { type: n } = a.definition;
1815
- n.length && !n.some((e) => K(t, e)) && Y(e, `missing type "${n.join(",")}" for keyword "${i}"`);
1816
- }
1817
- }
1818
- }
1819
- function K(e, t) {
1820
- return e.includes(t) || t === "number" && e.includes("integer");
1821
- }
1822
- function q(e, t) {
1823
- return e.includes(t) || t === "integer" && e.includes("number");
1824
- }
1825
- function J(e, t) {
1826
- let n = [];
1827
- for (let r of e.dataTypes) q(t, r) ? n.push(r) : t.includes("integer") && r === "number" && n.push("integer");
1828
- e.dataTypes = n;
1829
- }
1830
- function Y(e, t) {
1831
- let n = e.schemaEnv.baseId + e.errSchemaPath;
1832
- t += ` at "${n}" (strictTypes)`, (0, d.checkStrictMode)(e, t, e.opts.strictTypes);
1833
- }
1834
- var X = class {
1835
- constructor(e, t, n) {
1836
- if ((0, o.validateKeywordUsage)(e, t, n), this.gen = e.gen, this.allErrors = e.allErrors, this.keyword = n, this.data = e.data, this.schema = e.schema[n], this.$data = t.$data && e.opts.$data && this.schema && this.schema.$data, this.schemaValue = (0, d.schemaRefOrVal)(e, this.schema, n, this.$data), this.schemaType = t.schemaType, this.parentSchema = e.schema, this.params = {}, this.it = e, this.def = t, this.$data) this.schemaCode = e.gen.const("vSchema", oe(this.$data, e));
1837
- else if (this.schemaCode = this.schemaValue, !(0, o.validSchemaType)(this.schema, t.schemaType, t.allowUndefined)) throw Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);
1838
- ("code" in t ? t.trackErrors : t.errors !== !1) && (this.errsCount = e.gen.const("_errs", l.default.errors));
1839
- }
1840
- result(e, t, n) {
1841
- this.failResult((0, c.not)(e), t, n);
1842
- }
1843
- failResult(e, t, n) {
1844
- this.gen.if(e), n ? n() : this.error(), t ? (this.gen.else(), t(), this.allErrors && this.gen.endIf()) : this.allErrors ? this.gen.endIf() : this.gen.else();
1845
- }
1846
- pass(e, t) {
1847
- this.failResult((0, c.not)(e), void 0, t);
1848
- }
1849
- fail(e) {
1850
- if (e === void 0) {
1851
- this.error(), this.allErrors || this.gen.if(!1);
1852
- return;
1853
- }
1854
- this.gen.if(e), this.error(), this.allErrors ? this.gen.endIf() : this.gen.else();
1855
- }
1856
- fail$data(e) {
1857
- if (!this.$data) return this.fail(e);
1858
- let { schemaCode: t } = this;
1859
- this.fail((0, c._)`${t} !== undefined && (${(0, c.or)(this.invalid$data(), e)})`);
1860
- }
1861
- error(e, t, n) {
1862
- if (t) {
1863
- this.setParams(t), this._error(e, n), this.setParams({});
1864
- return;
1865
- }
1866
- this._error(e, n);
1867
- }
1868
- _error(e, t) {
1869
- (e ? f.reportExtraError : f.reportError)(this, this.def.error, t);
1870
- }
1871
- $dataError() {
1872
- (0, f.reportError)(this, this.def.$dataError || f.keyword$DataError);
1873
- }
1874
- reset() {
1875
- if (this.errsCount === void 0) throw Error("add \"trackErrors\" to keyword definition");
1876
- (0, f.resetErrorsCount)(this.gen, this.errsCount);
1877
- }
1878
- ok(e) {
1879
- this.allErrors || this.gen.if(e);
1880
- }
1881
- setParams(e, t) {
1882
- t ? Object.assign(this.params, e) : this.params = e;
1883
- }
1884
- block$data(e, t, n = c.nil) {
1885
- this.gen.block(() => {
1886
- this.check$data(e, n), t();
1887
- });
1888
- }
1889
- check$data(e = c.nil, t = c.nil) {
1890
- if (!this.$data) return;
1891
- let { gen: n, schemaCode: r, schemaType: i, def: a } = this;
1892
- n.if((0, c.or)((0, c._)`${r} === undefined`, t)), e !== c.nil && n.assign(e, !0), (i.length || a.validateSchema) && (n.elseIf(this.invalid$data()), this.$dataError(), e !== c.nil && n.assign(e, !1)), n.else();
1893
- }
1894
- invalid$data() {
1895
- let { gen: e, schemaCode: t, schemaType: n, def: r, it: a } = this;
1896
- return (0, c.or)(o(), s());
1897
- function o() {
1898
- if (n.length) {
1899
- /* istanbul ignore if */
1900
- if (!(t instanceof c.Name)) throw Error("ajv implementation error");
1901
- let e = Array.isArray(n) ? n : [n];
1902
- return (0, c._)`${(0, i.checkDataTypes)(e, t, a.opts.strictNumbers, i.DataType.Wrong)}`;
1903
- }
1904
- return c.nil;
1905
- }
1906
- function s() {
1907
- if (r.validateSchema) {
1908
- let n = e.scopeValue("validate$data", { ref: r.validateSchema });
1909
- return (0, c._)`!${n}(${t})`;
1910
- }
1911
- return c.nil;
1912
- }
1913
- }
1914
- subschema(e, t) {
1915
- let n = (0, s.getSubschema)(this.it, e);
1916
- (0, s.extendSubschemaData)(n, this.it, e), (0, s.extendSubschemaMode)(n, e);
1917
- let r = {
1918
- ...this.it,
1919
- ...n,
1920
- items: void 0,
1921
- props: void 0
1922
- };
1923
- return b(r, t), r;
1924
- }
1925
- mergeEvaluated(e, t) {
1926
- let { it: n, gen: r } = this;
1927
- n.opts.unevaluated && (n.props !== !0 && e.props !== void 0 && (n.props = d.mergeEvaluated.props(r, e.props, n.props, t)), n.items !== !0 && e.items !== void 0 && (n.items = d.mergeEvaluated.items(r, e.items, n.items, t)));
1928
- }
1929
- mergeValidEvaluated(e, t) {
1930
- let { it: n, gen: r } = this;
1931
- if (n.opts.unevaluated && (n.props !== !0 || n.items !== !0)) return r.if(t, () => this.mergeEvaluated(e, c.Name)), !0;
1932
- }
1933
- };
1934
- e.KeywordCxt = X;
1935
- function Z(e, t, n, r) {
1936
- let i = new X(e, n, t);
1937
- "code" in n ? n.code(i, r) : i.$data && n.validate ? (0, o.funcKeywordCode)(i, n) : "macro" in n ? (0, o.macroKeywordCode)(i, n) : (n.compile || n.validate) && (0, o.funcKeywordCode)(i, n);
1938
- }
1939
- var ie = /^\/(?:[^~]|~0|~1)*$/, ae = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
1940
- function oe(e, { dataLevel: t, dataNames: n, dataPathArr: r }) {
1941
- let i, a;
1942
- if (e === "") return l.default.rootData;
1943
- if (e[0] === "/") {
1944
- if (!ie.test(e)) throw Error(`Invalid JSON-pointer: ${e}`);
1945
- i = e, a = l.default.rootData;
1946
- } else {
1947
- let o = ae.exec(e);
1948
- if (!o) throw Error(`Invalid JSON-pointer: ${e}`);
1949
- let s = +o[1];
1950
- if (i = o[2], i === "#") {
1951
- if (s >= t) throw Error(u("property/index", s));
1952
- return r[t - s];
1953
- }
1954
- if (s > t) throw Error(u("data", s));
1955
- if (a = n[t - s], !i) return a;
1956
- }
1957
- let o = a, s = i.split("/");
1958
- for (let e of s) e && (a = (0, c._)`${a}${(0, c.getProperty)((0, d.unescapeJsonPointer)(e))}`, o = (0, c._)`${o} && ${a}`);
1959
- return o;
1960
- function u(e, n) {
1961
- return `Cannot access ${e} ${n} levels up, current level is ${t}`;
1962
- }
1963
- }
1964
- e.getData = oe;
1965
- })), H = /* @__PURE__ */ g(((e) => {
1966
- Object.defineProperty(e, "__esModule", { value: !0 }), e.default = class extends Error {
1967
- constructor(e) {
1968
- super("validation failed"), this.errors = e, this.ajv = this.validation = !0;
1969
- }
1970
- };
1971
- })), U = /* @__PURE__ */ g(((e) => {
1972
- Object.defineProperty(e, "__esModule", { value: !0 });
1973
- var t = B();
1974
- e.default = class extends Error {
1975
- constructor(e, n, r, i) {
1976
- super(i || `can't resolve reference ${r} from id ${n}`), this.missingRef = (0, t.resolveUrl)(e, n, r), this.missingSchema = (0, t.normalizeId)((0, t.getFullPath)(e, this.missingRef));
1977
- }
1978
- };
1979
- })), W = /* @__PURE__ */ g(((e) => {
1980
- Object.defineProperty(e, "__esModule", { value: !0 }), e.resolveSchema = e.getCompilingSchema = e.resolveRef = e.compileSchema = e.SchemaEnv = void 0;
1981
- var t = k(), n = H(), r = j(), i = B(), a = A(), o = V(), s = class {
1982
- constructor(e) {
1983
- this.refs = {}, this.dynamicAnchors = {};
1984
- let t;
1985
- typeof e.schema == "object" && (t = e.schema), this.schema = e.schema, this.schemaId = e.schemaId, this.root = e.root || this, this.baseId = e.baseId ?? (0, i.normalizeId)(t?.[e.schemaId || "$id"]), this.schemaPath = e.schemaPath, this.localRefs = e.localRefs, this.meta = e.meta, this.$async = t?.$async, this.refs = {};
1986
- }
1987
- };
1988
- e.SchemaEnv = s;
1989
- function c(e) {
1990
- let a = d.call(this, e);
1991
- if (a) return a;
1992
- let s = (0, i.getFullPath)(this.opts.uriResolver, e.root.baseId), { es5: c, lines: l } = this.opts.code, { ownProperties: u } = this.opts, f = new t.CodeGen(this.scope, {
1993
- es5: c,
1994
- lines: l,
1995
- ownProperties: u
1996
- }), p;
1997
- e.$async && (p = f.scopeValue("Error", {
1998
- ref: n.default,
1999
- code: (0, t._)`require("ajv/dist/runtime/validation_error").default`
2000
- }));
2001
- let m = f.scopeName("validate");
2002
- e.validateName = m;
2003
- let h = {
2004
- gen: f,
2005
- allErrors: this.opts.allErrors,
2006
- data: r.default.data,
2007
- parentData: r.default.parentData,
2008
- parentDataProperty: r.default.parentDataProperty,
2009
- dataNames: [r.default.data],
2010
- dataPathArr: [t.nil],
2011
- dataLevel: 0,
2012
- dataTypes: [],
2013
- definedProperties: /* @__PURE__ */ new Set(),
2014
- topSchemaRef: f.scopeValue("schema", this.opts.code.source === !0 ? {
2015
- ref: e.schema,
2016
- code: (0, t.stringify)(e.schema)
2017
- } : { ref: e.schema }),
2018
- validateName: m,
2019
- ValidationError: p,
2020
- schema: e.schema,
2021
- schemaEnv: e,
2022
- rootId: s,
2023
- baseId: e.baseId || s,
2024
- schemaPath: t.nil,
2025
- errSchemaPath: e.schemaPath || (this.opts.jtd ? "" : "#"),
2026
- errorPath: (0, t._)`""`,
2027
- opts: this.opts,
2028
- self: this
2029
- }, g;
2030
- try {
2031
- this._compilations.add(e), (0, o.validateFunctionCode)(h), f.optimize(this.opts.code.optimize);
2032
- let n = f.toString();
2033
- g = `${f.scopeRefs(r.default.scope)}return ${n}`, this.opts.code.process && (g = this.opts.code.process(g, e));
2034
- let i = Function(`${r.default.self}`, `${r.default.scope}`, g)(this, this.scope.get());
2035
- if (this.scope.value(m, { ref: i }), i.errors = null, i.schema = e.schema, i.schemaEnv = e, e.$async && (i.$async = !0), this.opts.code.source === !0 && (i.source = {
2036
- validateName: m,
2037
- validateCode: n,
2038
- scopeValues: f._values
2039
- }), this.opts.unevaluated) {
2040
- let { props: e, items: n } = h;
2041
- i.evaluated = {
2042
- props: e instanceof t.Name ? void 0 : e,
2043
- items: n instanceof t.Name ? void 0 : n,
2044
- dynamicProps: e instanceof t.Name,
2045
- dynamicItems: n instanceof t.Name
2046
- }, i.source && (i.source.evaluated = (0, t.stringify)(i.evaluated));
2047
- }
2048
- return e.validate = i, e;
2049
- } catch (t) {
2050
- throw delete e.validate, delete e.validateName, g && this.logger.error("Error compiling schema, function code:", g), t;
2051
- } finally {
2052
- this._compilations.delete(e);
2053
- }
2054
- }
2055
- e.compileSchema = c;
2056
- function l(e, t, n) {
2057
- n = (0, i.resolveUrl)(this.opts.uriResolver, t, n);
2058
- let r = e.refs[n];
2059
- if (r) return r;
2060
- let a = p.call(this, e, n);
2061
- if (a === void 0) {
2062
- let r = e.localRefs?.[n], { schemaId: i } = this.opts;
2063
- r && (a = new s({
2064
- schema: r,
2065
- schemaId: i,
2066
- root: e,
2067
- baseId: t
2068
- }));
2069
- }
2070
- if (a !== void 0) return e.refs[n] = u.call(this, a);
2071
- }
2072
- e.resolveRef = l;
2073
- function u(e) {
2074
- return (0, i.inlineRef)(e.schema, this.opts.inlineRefs) ? e.schema : e.validate ? e : c.call(this, e);
2075
- }
2076
- function d(e) {
2077
- for (let t of this._compilations) if (f(t, e)) return t;
2078
- }
2079
- e.getCompilingSchema = d;
2080
- function f(e, t) {
2081
- return e.schema === t.schema && e.root === t.root && e.baseId === t.baseId;
2082
- }
2083
- function p(e, t) {
2084
- let n;
2085
- for (; typeof (n = this.refs[t]) == "string";) t = n;
2086
- return n || this.schemas[t] || m.call(this, e, t);
2087
- }
2088
- function m(e, t) {
2089
- let n = this.opts.uriResolver.parse(t), r = (0, i._getFullPath)(this.opts.uriResolver, n), a = (0, i.getFullPath)(this.opts.uriResolver, e.baseId, void 0);
2090
- if (Object.keys(e.schema).length > 0 && r === a) return g.call(this, n, e);
2091
- let o = (0, i.normalizeId)(r), l = this.refs[o] || this.schemas[o];
2092
- if (typeof l == "string") {
2093
- let t = m.call(this, e, l);
2094
- return typeof t?.schema == "object" ? g.call(this, n, t) : void 0;
2095
- }
2096
- if (typeof l?.schema == "object") {
2097
- if (l.validate || c.call(this, l), o === (0, i.normalizeId)(t)) {
2098
- let { schema: t } = l, { schemaId: n } = this.opts, r = t[n];
2099
- return r && (a = (0, i.resolveUrl)(this.opts.uriResolver, a, r)), new s({
2100
- schema: t,
2101
- schemaId: n,
2102
- root: e,
2103
- baseId: a
2104
- });
2105
- }
2106
- return g.call(this, n, l);
2107
- }
2108
- }
2109
- e.resolveSchema = m;
2110
- var h = /* @__PURE__ */ new Set([
2111
- "properties",
2112
- "patternProperties",
2113
- "enum",
2114
- "dependencies",
2115
- "definitions"
2116
- ]);
2117
- function g(e, { baseId: t, schema: n, root: r }) {
2118
- if (e.fragment?.[0] !== "/") return;
2119
- for (let r of e.fragment.slice(1).split("/")) {
2120
- if (typeof n == "boolean") return;
2121
- let e = n[(0, a.unescapeFragment)(r)];
2122
- if (e === void 0) return;
2123
- n = e;
2124
- let o = typeof n == "object" && n[this.opts.schemaId];
2125
- !h.has(r) && o && (t = (0, i.resolveUrl)(this.opts.uriResolver, t, o));
2126
- }
2127
- let o;
2128
- if (typeof n != "boolean" && n.$ref && !(0, a.schemaHasRulesButRef)(n, this.RULES)) {
2129
- let e = (0, i.resolveUrl)(this.opts.uriResolver, t, n.$ref);
2130
- o = m.call(this, r, e);
2131
- }
2132
- let { schemaId: c } = this.opts;
2133
- if (o ||= new s({
2134
- schema: n,
2135
- schemaId: c,
2136
- root: r,
2137
- baseId: t
2138
- }), o.schema !== o.root.schema) return o;
2139
- }
2140
- })), re = /* @__PURE__ */ _({
2141
- $id: () => G,
2142
- additionalProperties: () => !1,
2143
- default: () => X,
2144
- description: () => K,
2145
- properties: () => Y,
2146
- required: () => J,
2147
- type: () => q
2148
- }), G, K, q, J, Y, X, Z = h((() => {
2149
- G = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", K = "Meta-schema for $data reference (JSON AnySchema extension proposal)", q = "object", J = ["$data"], Y = { $data: {
2150
- type: "string",
2151
- anyOf: [{ format: "relative-json-pointer" }, { format: "json-pointer" }]
2152
- } }, X = {
2153
- $id: G,
2154
- description: K,
2155
- type: q,
2156
- required: J,
2157
- properties: Y,
2158
- additionalProperties: !1
2159
- };
2160
- })), ie = /* @__PURE__ */ g(((e, t) => {
2161
- var n = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu), r = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u), i = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu), a = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu), o = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);
2162
- function s(e) {
2163
- let t = "", n = 0, r = 0;
2164
- for (r = 0; r < e.length; r++) if (n = e[r].charCodeAt(0), n !== 48) {
2165
- if (!(n >= 48 && n <= 57 || n >= 65 && n <= 70 || n >= 97 && n <= 102)) return "";
2166
- t += e[r];
2167
- break;
2168
- }
2169
- for (r += 1; r < e.length; r++) {
2170
- if (n = e[r].charCodeAt(0), !(n >= 48 && n <= 57 || n >= 65 && n <= 70 || n >= 97 && n <= 102)) return "";
2171
- t += e[r];
2172
- }
2173
- return t;
2174
- }
2175
- var c = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
2176
- function l(e) {
2177
- return e.length = 0, !0;
2178
- }
2179
- function u(e, t, n) {
2180
- if (e.length) {
2181
- let r = s(e);
2182
- if (r !== "") t.push(r);
2183
- else return n.error = !0, !1;
2184
- e.length = 0;
2185
- }
2186
- return !0;
2187
- }
2188
- function d(e) {
2189
- let t = 0, n = {
2190
- error: !1,
2191
- address: "",
2192
- zone: ""
2193
- }, r = [], i = [], a = !1, o = !1, c = u;
2194
- for (let s = 0; s < e.length; s++) {
2195
- let u = e[s];
2196
- if (u !== "[" && u !== "]") {
2197
- if (u === ":") {
2198
- if (a === !0 && (o = !0), !c(i, r, n)) break;
2199
- if (++t > 7) {
2200
- n.error = !0;
2201
- break;
2202
- }
2203
- s > 0 && e[s - 1] === ":" && (a = !0), r.push(":");
2204
- continue;
2205
- }
2206
- if (u === "%") {
2207
- if (!c(i, r, n)) break;
2208
- c = l;
2209
- } else {
2210
- i.push(u);
2211
- continue;
2212
- }
2213
- }
2214
- }
2215
- return i.length && (c === l ? n.zone = i.join("") : o ? r.push(i.join("")) : r.push(s(i))), n.address = r.join(""), n;
2216
- }
2217
- function f(e) {
2218
- if (p(e, ":") < 2) return {
2219
- host: e,
2220
- isIPV6: !1
2221
- };
2222
- let t = d(e);
2223
- if (t.error) return {
2224
- host: e,
2225
- isIPV6: !1
2226
- };
2227
- {
2228
- let e = t.address, n = t.address;
2229
- return t.zone && (e += "%" + t.zone, n += "%25" + t.zone), {
2230
- host: e,
2231
- isIPV6: !0,
2232
- escapedHost: n
2233
- };
2234
- }
2235
- }
2236
- function p(e, t) {
2237
- let n = 0;
2238
- for (let r = 0; r < e.length; r++) e[r] === t && n++;
2239
- return n;
2240
- }
2241
- function m(e) {
2242
- let t = e, n = [], r = -1, i = 0;
2243
- for (; i = t.length;) {
2244
- if (i === 1) {
2245
- if (t === ".") break;
2246
- if (t === "/") {
2247
- n.push("/");
2248
- break;
2249
- }
2250
- n.push(t);
2251
- break;
2252
- }
2253
- if (i === 2) {
2254
- if (t[0] === ".") {
2255
- if (t[1] === ".") break;
2256
- if (t[1] === "/") {
2257
- t = t.slice(2);
2258
- continue;
2259
- }
2260
- } else if (t[0] === "/" && (t[1] === "." || t[1] === "/")) {
2261
- n.push("/");
2262
- break;
2263
- }
2264
- } else if (i === 3 && t === "/..") {
2265
- n.length !== 0 && n.pop(), n.push("/");
2266
- break;
2267
- }
2268
- if (t[0] === ".") {
2269
- if (t[1] === ".") {
2270
- if (t[2] === "/") {
2271
- t = t.slice(3);
2272
- continue;
2273
- }
2274
- } else if (t[1] === "/") {
2275
- t = t.slice(2);
2276
- continue;
2277
- }
2278
- } else if (t[0] === "/" && t[1] === ".") {
2279
- if (t[2] === "/") {
2280
- t = t.slice(2);
2281
- continue;
2282
- }
2283
- if (t[2] === "." && t[3] === "/") {
2284
- t = t.slice(3), n.length !== 0 && n.pop();
2285
- continue;
2286
- }
2287
- }
2288
- if ((r = t.indexOf("/", 1)) === -1) {
2289
- n.push(t);
2290
- break;
2291
- }
2292
- n.push(t.slice(0, r)), t = t.slice(r);
2293
- }
2294
- return n.join("");
2295
- }
2296
- var h = {
2297
- "@": "%40",
2298
- "/": "%2F",
2299
- "?": "%3F",
2300
- "#": "%23",
2301
- ":": "%3A"
2302
- }, g = /[@/?#:]/g, _ = /[@/?#]/g;
2303
- function v(e, t) {
2304
- let n = t ? _ : g;
2305
- return n.lastIndex = 0, e.replace(n, (e) => h[e]);
2306
- }
2307
- function y(e, t = !1) {
2308
- if (e.indexOf("%") === -1) return e;
2309
- let n = "";
2310
- for (let r = 0; r < e.length; r++) {
2311
- if (e[r] === "%" && r + 2 < e.length) {
2312
- let o = e.slice(r + 1, r + 3);
2313
- if (i(o)) {
2314
- let e = o.toUpperCase(), i = String.fromCharCode(parseInt(e, 16));
2315
- t && a(i) ? n += i : n += "%" + e, r += 2;
2316
- continue;
2317
- }
2318
- }
2319
- n += e[r];
2320
- }
2321
- return n;
2322
- }
2323
- function b(e) {
2324
- let t = "";
2325
- for (let n = 0; n < e.length; n++) {
2326
- if (e[n] === "%" && n + 2 < e.length) {
2327
- let r = e.slice(n + 1, n + 3);
2328
- if (i(r)) {
2329
- let e = r.toUpperCase(), i = String.fromCharCode(parseInt(e, 16));
2330
- i !== "." && a(i) ? t += i : t += "%" + e, n += 2;
2331
- continue;
2332
- }
2333
- }
2334
- o(e[n]) ? t += e[n] : t += escape(e[n]);
2335
- }
2336
- return t;
2337
- }
2338
- function x(e) {
2339
- let t = "";
2340
- for (let n = 0; n < e.length; n++) {
2341
- if (e[n] === "%" && n + 2 < e.length) {
2342
- let r = e.slice(n + 1, n + 3);
2343
- if (i(r)) {
2344
- t += "%" + r.toUpperCase(), n += 2;
2345
- continue;
2346
- }
2347
- }
2348
- t += escape(e[n]);
2349
- }
2350
- return t;
2351
- }
2352
- function S(e) {
2353
- let t = [];
2354
- if (e.userinfo !== void 0 && (t.push(e.userinfo), t.push("@")), e.host !== void 0) {
2355
- let n = unescape(e.host);
2356
- if (!r(n)) {
2357
- let e = f(n);
2358
- n = e.isIPV6 === !0 ? `[${e.escapedHost}]` : v(n, !1);
2359
- }
2360
- t.push(n);
2361
- }
2362
- return (typeof e.port == "number" || typeof e.port == "string") && (t.push(":"), t.push(String(e.port))), t.length ? t.join("") : void 0;
2363
- }
2364
- t.exports = {
2365
- nonSimpleDomain: c,
2366
- recomposeAuthority: S,
2367
- reescapeHostDelimiters: v,
2368
- normalizePercentEncoding: y,
2369
- normalizePathEncoding: b,
2370
- escapePreservingEscapes: x,
2371
- removeDotSegments: m,
2372
- isIPv4: r,
2373
- isUUID: n,
2374
- normalizeIPv6: f,
2375
- stringArrayToHexStripped: s
2376
- };
2377
- })), ae = /* @__PURE__ */ g(((e, t) => {
2378
- var { isUUID: n } = ie(), r = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu, i = [
2379
- "http",
2380
- "https",
2381
- "ws",
2382
- "wss",
2383
- "urn",
2384
- "urn:uuid"
2385
- ];
2386
- function a(e) {
2387
- return i.indexOf(e) !== -1;
2388
- }
2389
- function o(e) {
2390
- return e.secure === !0 ? !0 : e.secure === !1 ? !1 : e.scheme ? e.scheme.length === 3 && (e.scheme[0] === "w" || e.scheme[0] === "W") && (e.scheme[1] === "s" || e.scheme[1] === "S") && (e.scheme[2] === "s" || e.scheme[2] === "S") : !1;
2391
- }
2392
- function s(e) {
2393
- return e.host || (e.error = e.error || "HTTP URIs must have a host."), e;
2394
- }
2395
- function c(e) {
2396
- let t = String(e.scheme).toLowerCase() === "https";
2397
- return (e.port === (t ? 443 : 80) || e.port === "") && (e.port = void 0), e.path ||= "/", e;
2398
- }
2399
- function l(e) {
2400
- return e.secure = o(e), e.resourceName = (e.path || "/") + (e.query ? "?" + e.query : ""), e.path = void 0, e.query = void 0, e;
2401
- }
2402
- function u(e) {
2403
- if ((e.port === (o(e) ? 443 : 80) || e.port === "") && (e.port = void 0), typeof e.secure == "boolean" && (e.scheme = e.secure ? "wss" : "ws", e.secure = void 0), e.resourceName) {
2404
- let [t, n] = e.resourceName.split("?");
2405
- e.path = t && t !== "/" ? t : void 0, e.query = n, e.resourceName = void 0;
2406
- }
2407
- return e.fragment = void 0, e;
2408
- }
2409
- function d(e, t) {
2410
- if (!e.path) return e.error = "URN can not be parsed", e;
2411
- let n = e.path.match(r);
2412
- if (n) {
2413
- let r = t.scheme || e.scheme || "urn";
2414
- e.nid = n[1].toLowerCase(), e.nss = n[2];
2415
- let i = y(`${r}:${t.nid || e.nid}`);
2416
- e.path = void 0, i && (e = i.parse(e, t));
2417
- } else e.error = e.error || "URN can not be parsed.";
2418
- return e;
2419
- }
2420
- function f(e, t) {
2421
- if (e.nid === void 0) throw Error("URN without nid cannot be serialized");
2422
- let n = t.scheme || e.scheme || "urn", r = e.nid.toLowerCase(), i = y(`${n}:${t.nid || r}`);
2423
- i && (e = i.serialize(e, t));
2424
- let a = e, o = e.nss;
2425
- return a.path = `${r || t.nid}:${o}`, t.skipEscape = !0, a;
2426
- }
2427
- function p(e, t) {
2428
- let r = e;
2429
- return r.uuid = r.nss, r.nss = void 0, !t.tolerant && (!r.uuid || !n(r.uuid)) && (r.error = r.error || "UUID is not valid."), r;
2430
- }
2431
- function m(e) {
2432
- let t = e;
2433
- return t.nss = (e.uuid || "").toLowerCase(), t;
2434
- }
2435
- var h = {
2436
- scheme: "http",
2437
- domainHost: !0,
2438
- parse: s,
2439
- serialize: c
2440
- }, g = {
2441
- scheme: "https",
2442
- domainHost: h.domainHost,
2443
- parse: s,
2444
- serialize: c
2445
- }, _ = {
2446
- scheme: "ws",
2447
- domainHost: !0,
2448
- parse: l,
2449
- serialize: u
2450
- }, v = {
2451
- http: h,
2452
- https: g,
2453
- ws: _,
2454
- wss: {
2455
- scheme: "wss",
2456
- domainHost: _.domainHost,
2457
- parse: _.parse,
2458
- serialize: _.serialize
2459
- },
2460
- urn: {
2461
- scheme: "urn",
2462
- parse: d,
2463
- serialize: f,
2464
- skipNormalize: !0
2465
- },
2466
- "urn:uuid": {
2467
- scheme: "urn:uuid",
2468
- parse: p,
2469
- serialize: m,
2470
- skipNormalize: !0
2471
- }
2472
- };
2473
- Object.setPrototypeOf(v, null);
2474
- function y(e) {
2475
- return e && (v[e] || v[e.toLowerCase()]) || void 0;
2476
- }
2477
- t.exports = {
2478
- wsIsSecure: o,
2479
- SCHEMES: v,
2480
- isValidSchemeName: a,
2481
- getSchemeHandler: y
2482
- };
2483
- })), oe = /* @__PURE__ */ g(((e, t) => {
2484
- var { normalizeIPv6: n, removeDotSegments: r, recomposeAuthority: i, normalizePercentEncoding: a, normalizePathEncoding: o, escapePreservingEscapes: s, reescapeHostDelimiters: c, isIPv4: l, nonSimpleDomain: u } = ie(), { SCHEMES: d, getSchemeHandler: f } = ae();
2485
- function p(e, t) {
2486
- return typeof e == "string" ? e = w(e, t) : typeof e == "object" && (e = C(_(e, t), t)), e;
2487
- }
2488
- function m(e, t, n) {
2489
- let r = n ? Object.assign({ scheme: "null" }, n) : { scheme: "null" }, { parsed: i, malformedAuthorityOrPort: a } = S(e, r), { parsed: o, malformedAuthorityOrPort: s } = S(t, r);
2490
- if (a || s) throw Error(i.error || o.error || "URI is malformed.");
2491
- let c = h(i, o, r, !0);
2492
- return r.skipEscape = !0, _(c, r);
2493
- }
2494
- function h(e, t, n, i) {
2495
- let a = {};
2496
- return i || (e = C(_(e, n), n), t = C(_(t, n), n)), n ||= {}, !n.tolerant && t.scheme ? (a.scheme = t.scheme, a.userinfo = t.userinfo, a.host = t.host, a.port = t.port, a.path = r(t.path || ""), a.query = t.query) : (t.userinfo !== void 0 || t.host !== void 0 || t.port !== void 0 ? (a.userinfo = t.userinfo, a.host = t.host, a.port = t.port, a.path = r(t.path || ""), a.query = t.query) : (t.path ? (t.path[0] === "/" ? a.path = r(t.path) : (a.path = (e.userinfo !== void 0 || e.host !== void 0 || e.port !== void 0) && !e.path ? "/" + t.path : e.path ? e.path.slice(0, e.path.lastIndexOf("/") + 1) + t.path : t.path, a.path = r(a.path)), a.query = t.query) : (a.path = e.path, a.query = t.query === void 0 ? e.query : t.query), a.userinfo = e.userinfo, a.host = e.host, a.port = e.port), a.scheme = e.scheme), a.fragment = t.fragment, a;
2497
- }
2498
- function g(e, t, n) {
2499
- let r = E(e, n), i = E(t, n);
2500
- return r !== void 0 && i !== void 0 && r.toLowerCase() === i.toLowerCase();
2501
- }
2502
- function _(e, t) {
2503
- let n = {
2504
- host: e.host,
2505
- scheme: e.scheme,
2506
- userinfo: e.userinfo,
2507
- port: e.port,
2508
- path: e.path,
2509
- query: e.query,
2510
- nid: e.nid,
2511
- nss: e.nss,
2512
- uuid: e.uuid,
2513
- fragment: e.fragment,
2514
- reference: e.reference,
2515
- resourceName: e.resourceName,
2516
- secure: e.secure,
2517
- error: ""
2518
- }, o = Object.assign({}, t), c = [], l = f(o.scheme || n.scheme);
2519
- l && l.serialize && l.serialize(n, o), n.path !== void 0 && (o.skipEscape ? n.path = a(n.path) : (n.path = s(n.path), n.scheme !== void 0 && (n.path = n.path.split("%3A").join(":")))), o.reference !== "suffix" && n.scheme && c.push(n.scheme, ":");
2520
- let u = i(n);
2521
- if (u !== void 0 && (o.reference !== "suffix" && c.push("//"), c.push(u), n.path && n.path[0] !== "/" && c.push("/")), n.path !== void 0) {
2522
- let e = n.path;
2523
- !o.absolutePath && (!l || !l.absolutePath) && (e = r(e)), u === void 0 && e[0] === "/" && e[1] === "/" && (e = "/%2F" + e.slice(2)), c.push(e);
2524
- }
2525
- return n.query !== void 0 && c.push("?", n.query), n.fragment !== void 0 && c.push("#", n.fragment), c.join("");
2526
- }
2527
- var v = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u, y = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/, b = /^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;
2528
- function x(e, t) {
2529
- if (t[2] !== void 0 && e.path && e.path[0] !== "/") return "URI path must start with \"/\" when authority is present.";
2530
- if (typeof e.port == "number" && (e.port < 0 || e.port > 65535)) return "URI port is malformed.";
2531
- }
2532
- function S(e, t) {
2533
- let r = Object.assign({}, t), i = {
2534
- scheme: void 0,
2535
- userinfo: void 0,
2536
- host: "",
2537
- port: void 0,
2538
- path: "",
2539
- query: void 0,
2540
- fragment: void 0
2541
- }, a = !1, s = !1;
2542
- r.reference === "suffix" && (e = r.scheme ? r.scheme + ":" + e : "//" + e);
2543
- let d = e.match(y);
2544
- d !== null && d[1].indexOf("\\") !== -1 && (i.error = "URI authority must not contain a literal backslash.", a = !0);
2545
- let p = e.match(b);
2546
- if (p !== null) {
2547
- let e = p[1], t = e.replace(/[\t\n\r]/g, "");
2548
- t.length >= 2 && (t.slice(0, 2) === "//" ? e.length !== t.length && (i.error = i.error || "URI authority introducer must not contain whitespace.", a = !0) : (i.error = i.error || "URI authority must not contain a literal backslash.", a = !0));
2549
- }
2550
- let m = e.match(v);
2551
- if (m) {
2552
- i.scheme = m[1], i.userinfo = m[3], i.host = m[4], i.port = parseInt(m[5], 10), i.path = m[6] || "", i.query = m[7], i.fragment = m[8], isNaN(i.port) && (i.port = m[5]);
2553
- let t = x(i, m);
2554
- if (t !== void 0 && (i.error = i.error || t, a = !0), i.host) if (l(i.host) === !1) {
2555
- let e = n(i.host);
2556
- i.host = e.host.toLowerCase(), s = e.isIPV6;
2557
- } else s = !0;
2558
- i.reference = i.scheme === void 0 && i.userinfo === void 0 && i.host === void 0 && i.port === void 0 && i.query === void 0 && !i.path ? "same-document" : i.scheme === void 0 ? "relative" : i.fragment === void 0 ? "absolute" : "uri", r.reference && r.reference !== "suffix" && r.reference !== i.reference && (i.error = i.error || "URI is not a " + r.reference + " reference.");
2559
- let d = f(r.scheme || i.scheme);
2560
- if (!r.unicodeSupport && (!d || !d.unicodeSupport) && i.host && (r.domainHost || d && d.domainHost) && s === !1 && u(i.host)) try {
2561
- i.host = new URL("http://" + i.host).hostname;
2562
- } catch (e) {
2563
- i.error = i.error || "Host's domain name can not be converted to ASCII: " + e;
2564
- }
2565
- if ((!d || d && !d.skipNormalize) && (e.indexOf("%") !== -1 && (i.scheme !== void 0 && (i.scheme = unescape(i.scheme)), i.host !== void 0 && (i.host = c(unescape(i.host), s))), i.path &&= o(i.path), i.fragment)) try {
2566
- i.fragment = encodeURI(decodeURIComponent(i.fragment));
2567
- } catch {
2568
- i.error = i.error || "URI malformed";
2569
- }
2570
- d && d.parse && d.parse(i, r);
2571
- } else i.error = i.error || "URI can not be parsed.";
2572
- return {
2573
- parsed: i,
2574
- malformedAuthorityOrPort: a
2575
- };
2576
- }
2577
- function C(e, t) {
2578
- return S(e, t).parsed;
2579
- }
2580
- function w(e, t) {
2581
- return T(e, t).normalized;
2582
- }
2583
- function T(e, t) {
2584
- let { parsed: n, malformedAuthorityOrPort: r } = S(e, t);
2585
- return {
2586
- normalized: r ? e : _(n, t),
2587
- malformedAuthorityOrPort: r
2588
- };
2589
- }
2590
- function E(e, t) {
2591
- if (typeof e == "string") {
2592
- let { normalized: n, malformedAuthorityOrPort: r } = T(e, t);
2593
- return r ? void 0 : n;
2594
- }
2595
- if (typeof e == "object") return _(e, t);
2596
- }
2597
- var D = {
2598
- SCHEMES: d,
2599
- normalize: p,
2600
- resolve: m,
2601
- resolveComponent: h,
2602
- equal: g,
2603
- serialize: _,
2604
- parse: C
2605
- };
2606
- t.exports = D, t.exports.default = D, t.exports.fastUri = D;
2607
- })), se = /* @__PURE__ */ g(((e) => {
2608
- Object.defineProperty(e, "__esModule", { value: !0 });
2609
- var t = oe();
2610
- t.code = "require(\"ajv/dist/runtime/uri\").default", e.default = t;
2611
- })), ce = /* @__PURE__ */ g(((e) => {
2612
- Object.defineProperty(e, "__esModule", { value: !0 }), e.CodeGen = e.Name = e.nil = e.stringify = e.str = e._ = e.KeywordCxt = void 0;
2613
- var t = V();
2614
- Object.defineProperty(e, "KeywordCxt", {
2615
- enumerable: !0,
2616
- get: function() {
2617
- return t.KeywordCxt;
2618
- }
2619
- });
2620
- var n = k();
2621
- Object.defineProperty(e, "_", {
2622
- enumerable: !0,
2623
- get: function() {
2624
- return n._;
2625
- }
2626
- }), Object.defineProperty(e, "str", {
2627
- enumerable: !0,
2628
- get: function() {
2629
- return n.str;
2630
- }
2631
- }), Object.defineProperty(e, "stringify", {
2632
- enumerable: !0,
2633
- get: function() {
2634
- return n.stringify;
2635
- }
2636
- }), Object.defineProperty(e, "nil", {
2637
- enumerable: !0,
2638
- get: function() {
2639
- return n.nil;
2640
- }
2641
- }), Object.defineProperty(e, "Name", {
2642
- enumerable: !0,
2643
- get: function() {
2644
- return n.Name;
2645
- }
2646
- }), Object.defineProperty(e, "CodeGen", {
2647
- enumerable: !0,
2648
- get: function() {
2649
- return n.CodeGen;
2650
- }
2651
- });
2652
- var r = H(), i = U(), a = P(), o = W(), s = k(), c = B(), l = I(), u = A(), d = (Z(), y(re).default), f = se(), p = (e, t) => new RegExp(e, t);
2653
- p.code = "new RegExp";
2654
- var m = [
2655
- "removeAdditional",
2656
- "useDefaults",
2657
- "coerceTypes"
2658
- ], h = /* @__PURE__ */ new Set([
2659
- "validate",
2660
- "serialize",
2661
- "parse",
2662
- "wrapper",
2663
- "root",
2664
- "schema",
2665
- "keyword",
2666
- "pattern",
2667
- "formats",
2668
- "validate$data",
2669
- "func",
2670
- "obj",
2671
- "Error"
2672
- ]), g = {
2673
- errorDataPath: "",
2674
- format: "`validateFormats: false` can be used instead.",
2675
- nullable: "\"nullable\" keyword is supported by default.",
2676
- jsonPointers: "Deprecated jsPropertySyntax can be used instead.",
2677
- extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.",
2678
- missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.",
2679
- processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`",
2680
- sourceCode: "Use option `code: {source: true}`",
2681
- strictDefaults: "It is default now, see option `strict`.",
2682
- strictKeywords: "It is default now, see option `strict`.",
2683
- uniqueItems: "\"uniqueItems\" keyword is always validated.",
2684
- unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",
2685
- cache: "Map is used as cache, schema object as key.",
2686
- serialize: "Map is used as cache, schema object as key.",
2687
- ajvErrors: "It is default now."
2688
- }, _ = {
2689
- ignoreKeywordsWithRef: "",
2690
- jsPropertySyntax: "",
2691
- unicode: "\"minLength\"/\"maxLength\" account for unicode characters by default."
2692
- }, v = 200;
2693
- function b(e) {
2694
- let t = e.strict, n = e.code?.optimize, r = n === !0 || n === void 0 ? 1 : n || 0, i = e.code?.regExp ?? p, a = e.uriResolver ?? f.default;
2695
- return {
2696
- strictSchema: e.strictSchema ?? t ?? !0,
2697
- strictNumbers: e.strictNumbers ?? t ?? !0,
2698
- strictTypes: e.strictTypes ?? t ?? "log",
2699
- strictTuples: e.strictTuples ?? t ?? "log",
2700
- strictRequired: e.strictRequired ?? t ?? !1,
2701
- code: e.code ? {
2702
- ...e.code,
2703
- optimize: r,
2704
- regExp: i
2705
- } : {
2706
- optimize: r,
2707
- regExp: i
2708
- },
2709
- loopRequired: e.loopRequired ?? v,
2710
- loopEnum: e.loopEnum ?? v,
2711
- meta: e.meta ?? !0,
2712
- messages: e.messages ?? !0,
2713
- inlineRefs: e.inlineRefs ?? !0,
2714
- schemaId: e.schemaId ?? "$id",
2715
- addUsedSchema: e.addUsedSchema ?? !0,
2716
- validateSchema: e.validateSchema ?? !0,
2717
- validateFormats: e.validateFormats ?? !0,
2718
- unicodeRegExp: e.unicodeRegExp ?? !0,
2719
- int32range: e.int32range ?? !0,
2720
- uriResolver: a
2721
- };
2722
- }
2723
- var x = class {
2724
- constructor(e = {}) {
2725
- this.schemas = {}, this.refs = {}, this.formats = Object.create(null), this._compilations = /* @__PURE__ */ new Set(), this._loading = {}, this._cache = /* @__PURE__ */ new Map(), e = this.opts = {
2726
- ...e,
2727
- ...b(e)
2728
- };
2729
- let { es5: t, lines: n } = this.opts.code;
2730
- this.scope = new s.ValueScope({
2731
- scope: {},
2732
- prefixes: h,
2733
- es5: t,
2734
- lines: n
2735
- }), this.logger = j(e.logger);
2736
- let r = e.validateFormats;
2737
- e.validateFormats = !1, this.RULES = (0, a.getRules)(), S.call(this, g, e, "NOT SUPPORTED"), S.call(this, _, e, "DEPRECATED", "warn"), this._metaOpts = D.call(this), e.formats && T.call(this), this._addVocabularies(), this._addDefaultMetaSchema(), e.keywords && E.call(this, e.keywords), typeof e.meta == "object" && this.addMetaSchema(e.meta), w.call(this), e.validateFormats = r;
2738
- }
2739
- _addVocabularies() {
2740
- this.addKeyword("$async");
2741
- }
2742
- _addDefaultMetaSchema() {
2743
- let { $data: e, meta: t, schemaId: n } = this.opts, r = d;
2744
- n === "id" && (r = { ...d }, r.id = r.$id, delete r.$id), t && e && this.addMetaSchema(r, r[n], !1);
2745
- }
2746
- defaultMeta() {
2747
- let { meta: e, schemaId: t } = this.opts;
2748
- return this.opts.defaultMeta = typeof e == "object" ? e[t] || e : void 0;
2749
- }
2750
- validate(e, t) {
2751
- let n;
2752
- if (typeof e == "string") {
2753
- if (n = this.getSchema(e), !n) throw Error(`no schema with key or ref "${e}"`);
2754
- } else n = this.compile(e);
2755
- let r = n(t);
2756
- return "$async" in n || (this.errors = n.errors), r;
2757
- }
2758
- compile(e, t) {
2759
- let n = this._addSchema(e, t);
2760
- return n.validate || this._compileSchemaEnv(n);
2761
- }
2762
- compileAsync(e, t) {
2763
- if (typeof this.opts.loadSchema != "function") throw Error("options.loadSchema should be a function");
2764
- let { loadSchema: n } = this.opts;
2765
- return r.call(this, e, t);
2766
- async function r(e, t) {
2767
- await a.call(this, e.$schema);
2768
- let n = this._addSchema(e, t);
2769
- return n.validate || o.call(this, n);
2770
- }
2771
- async function a(e) {
2772
- e && !this.getSchema(e) && await r.call(this, { $ref: e }, !0);
2773
- }
2774
- async function o(e) {
2775
- try {
2776
- return this._compileSchemaEnv(e);
2777
- } catch (t) {
2778
- if (!(t instanceof i.default)) throw t;
2779
- return s.call(this, t), await c.call(this, t.missingSchema), o.call(this, e);
2780
- }
2781
- }
2782
- function s({ missingSchema: e, missingRef: t }) {
2783
- if (this.refs[e]) throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`);
2784
- }
2785
- async function c(e) {
2786
- let n = await l.call(this, e);
2787
- this.refs[e] || await a.call(this, n.$schema), this.refs[e] || this.addSchema(n, e, t);
2788
- }
2789
- async function l(e) {
2790
- let t = this._loading[e];
2791
- if (t) return t;
2792
- try {
2793
- return await (this._loading[e] = n(e));
2794
- } finally {
2795
- delete this._loading[e];
2796
- }
2797
- }
2798
- }
2799
- addSchema(e, t, n, r = this.opts.validateSchema) {
2800
- if (Array.isArray(e)) {
2801
- for (let t of e) this.addSchema(t, void 0, n, r);
2802
- return this;
2803
- }
2804
- let i;
2805
- if (typeof e == "object") {
2806
- let { schemaId: t } = this.opts;
2807
- if (i = e[t], i !== void 0 && typeof i != "string") throw Error(`schema ${t} must be string`);
2808
- }
2809
- return t = (0, c.normalizeId)(t || i), this._checkUnique(t), this.schemas[t] = this._addSchema(e, n, t, r, !0), this;
2810
- }
2811
- addMetaSchema(e, t, n = this.opts.validateSchema) {
2812
- return this.addSchema(e, t, !0, n), this;
2813
- }
2814
- validateSchema(e, t) {
2815
- if (typeof e == "boolean") return !0;
2816
- let n;
2817
- if (n = e.$schema, n !== void 0 && typeof n != "string") throw Error("$schema must be a string");
2818
- if (n = n || this.opts.defaultMeta || this.defaultMeta(), !n) return this.logger.warn("meta-schema not available"), this.errors = null, !0;
2819
- let r = this.validate(n, e);
2820
- if (!r && t) {
2821
- let e = "schema is invalid: " + this.errorsText();
2822
- if (this.opts.validateSchema === "log") this.logger.error(e);
2823
- else throw Error(e);
2824
- }
2825
- return r;
2826
- }
2827
- getSchema(e) {
2828
- let t;
2829
- for (; typeof (t = C.call(this, e)) == "string";) e = t;
2830
- if (t === void 0) {
2831
- let { schemaId: n } = this.opts, r = new o.SchemaEnv({
2832
- schema: {},
2833
- schemaId: n
2834
- });
2835
- if (t = o.resolveSchema.call(this, r, e), !t) return;
2836
- this.refs[e] = t;
2837
- }
2838
- return t.validate || this._compileSchemaEnv(t);
2839
- }
2840
- removeSchema(e) {
2841
- if (e instanceof RegExp) return this._removeAllSchemas(this.schemas, e), this._removeAllSchemas(this.refs, e), this;
2842
- switch (typeof e) {
2843
- case "undefined": return this._removeAllSchemas(this.schemas), this._removeAllSchemas(this.refs), this._cache.clear(), this;
2844
- case "string": {
2845
- let t = C.call(this, e);
2846
- return typeof t == "object" && this._cache.delete(t.schema), delete this.schemas[e], delete this.refs[e], this;
2847
- }
2848
- case "object": {
2849
- let t = e;
2850
- this._cache.delete(t);
2851
- let n = e[this.opts.schemaId];
2852
- return n && (n = (0, c.normalizeId)(n), delete this.schemas[n], delete this.refs[n]), this;
2853
- }
2854
- default: throw Error("ajv.removeSchema: invalid parameter");
2855
- }
2856
- }
2857
- addVocabulary(e) {
2858
- for (let t of e) this.addKeyword(t);
2859
- return this;
2860
- }
2861
- addKeyword(e, t) {
2862
- let n;
2863
- if (typeof e == "string") n = e, typeof t == "object" && (this.logger.warn("these parameters are deprecated, see docs for addKeyword"), t.keyword = n);
2864
- else if (typeof e == "object" && t === void 0) {
2865
- if (t = e, n = t.keyword, Array.isArray(n) && !n.length) throw Error("addKeywords: keyword must be string or non-empty array");
2866
- } else throw Error("invalid addKeywords parameters");
2867
- if (N.call(this, n, t), !t) return (0, u.eachItem)(n, (e) => F.call(this, e)), this;
2868
- L.call(this, t);
2869
- let r = {
2870
- ...t,
2871
- type: (0, l.getJSONTypes)(t.type),
2872
- schemaType: (0, l.getJSONTypes)(t.schemaType)
2873
- };
2874
- return (0, u.eachItem)(n, r.type.length === 0 ? (e) => F.call(this, e, r) : (e) => r.type.forEach((t) => F.call(this, e, r, t))), this;
2875
- }
2876
- getKeyword(e) {
2877
- let t = this.RULES.all[e];
2878
- return typeof t == "object" ? t.definition : !!t;
2879
- }
2880
- removeKeyword(e) {
2881
- let { RULES: t } = this;
2882
- delete t.keywords[e], delete t.all[e];
2883
- for (let n of t.rules) {
2884
- let t = n.rules.findIndex((t) => t.keyword === e);
2885
- t >= 0 && n.rules.splice(t, 1);
2886
- }
2887
- return this;
2888
- }
2889
- addFormat(e, t) {
2890
- return typeof t == "string" && (t = new RegExp(t)), this.formats[e] = t, this;
2891
- }
2892
- errorsText(e = this.errors, { separator: t = ", ", dataVar: n = "data" } = {}) {
2893
- return !e || e.length === 0 ? "No errors" : e.map((e) => `${n}${e.instancePath} ${e.message}`).reduce((e, n) => e + t + n);
2894
- }
2895
- $dataMetaSchema(e, t) {
2896
- let n = this.RULES.all;
2897
- e = JSON.parse(JSON.stringify(e));
2898
- for (let r of t) {
2899
- let t = r.split("/").slice(1), i = e;
2900
- for (let e of t) i = i[e];
2901
- for (let e in n) {
2902
- let t = n[e];
2903
- if (typeof t != "object") continue;
2904
- let { $data: r } = t.definition, a = i[e];
2905
- r && a && (i[e] = z(a));
2906
- }
2907
- }
2908
- return e;
2909
- }
2910
- _removeAllSchemas(e, t) {
2911
- for (let n in e) {
2912
- let r = e[n];
2913
- (!t || t.test(n)) && (typeof r == "string" ? delete e[n] : r && !r.meta && (this._cache.delete(r.schema), delete e[n]));
2914
- }
2915
- }
2916
- _addSchema(e, t, n, r = this.opts.validateSchema, i = this.opts.addUsedSchema) {
2917
- let a, { schemaId: s } = this.opts;
2918
- if (typeof e == "object") a = e[s];
2919
- else if (this.opts.jtd) throw Error("schema must be object");
2920
- else if (typeof e != "boolean") throw Error("schema must be object or boolean");
2921
- let l = this._cache.get(e);
2922
- if (l !== void 0) return l;
2923
- n = (0, c.normalizeId)(a || n);
2924
- let u = c.getSchemaRefs.call(this, e, n);
2925
- return l = new o.SchemaEnv({
2926
- schema: e,
2927
- schemaId: s,
2928
- meta: t,
2929
- baseId: n,
2930
- localRefs: u
2931
- }), this._cache.set(l.schema, l), i && !n.startsWith("#") && (n && this._checkUnique(n), this.refs[n] = l), r && this.validateSchema(e, !0), l;
2932
- }
2933
- _checkUnique(e) {
2934
- if (this.schemas[e] || this.refs[e]) throw Error(`schema with key or id "${e}" already exists`);
2935
- }
2936
- _compileSchemaEnv(e) {
2937
- /* istanbul ignore if */
2938
- if (e.meta ? this._compileMetaSchema(e) : o.compileSchema.call(this, e), !e.validate) throw Error("ajv implementation error");
2939
- return e.validate;
2940
- }
2941
- _compileMetaSchema(e) {
2942
- let t = this.opts;
2943
- this.opts = this._metaOpts;
2944
- try {
2945
- o.compileSchema.call(this, e);
2946
- } finally {
2947
- this.opts = t;
2948
- }
2949
- }
2950
- };
2951
- x.ValidationError = r.default, x.MissingRefError = i.default, e.default = x;
2952
- function S(e, t, n, r = "error") {
2953
- for (let i in e) {
2954
- let a = i;
2955
- a in t && this.logger[r](`${n}: option ${i}. ${e[a]}`);
2956
- }
2957
- }
2958
- function C(e) {
2959
- return e = (0, c.normalizeId)(e), this.schemas[e] || this.refs[e];
2960
- }
2961
- function w() {
2962
- let e = this.opts.schemas;
2963
- if (e) if (Array.isArray(e)) this.addSchema(e);
2964
- else for (let t in e) this.addSchema(e[t], t);
2965
- }
2966
- function T() {
2967
- for (let e in this.opts.formats) {
2968
- let t = this.opts.formats[e];
2969
- t && this.addFormat(e, t);
2970
- }
2971
- }
2972
- function E(e) {
2973
- if (Array.isArray(e)) {
2974
- this.addVocabulary(e);
2975
- return;
2976
- }
2977
- this.logger.warn("keywords option as map is deprecated, pass array");
2978
- for (let t in e) {
2979
- let n = e[t];
2980
- n.keyword ||= t, this.addKeyword(n);
2981
- }
2982
- }
2983
- function D() {
2984
- let e = { ...this.opts };
2985
- for (let t of m) delete e[t];
2986
- return e;
2987
- }
2988
- var O = {
2989
- log() {},
2990
- warn() {},
2991
- error() {}
2992
- };
2993
- function j(e) {
2994
- if (e === !1) return O;
2995
- if (e === void 0) return console;
2996
- if (e.log && e.warn && e.error) return e;
2997
- throw Error("logger must implement log, warn and error methods");
2998
- }
2999
- var M = /^[a-z_$][a-z0-9_$:-]*$/i;
3000
- function N(e, t) {
3001
- let { RULES: n } = this;
3002
- if ((0, u.eachItem)(e, (e) => {
3003
- if (n.keywords[e]) throw Error(`Keyword ${e} is already defined`);
3004
- if (!M.test(e)) throw Error(`Keyword ${e} has invalid name`);
3005
- }), t && t.$data && !("code" in t || "validate" in t)) throw Error("$data keyword must have \"code\" or \"validate\" function");
3006
- }
3007
- function F(e, t, n) {
3008
- var r;
3009
- let i = t?.post;
3010
- if (n && i) throw Error("keyword with \"post\" flag cannot have \"type\"");
3011
- let { RULES: a } = this, o = i ? a.post : a.rules.find(({ type: e }) => e === n);
3012
- if (o || (o = {
3013
- type: n,
3014
- rules: []
3015
- }, a.rules.push(o)), a.keywords[e] = !0, !t) return;
3016
- let s = {
3017
- keyword: e,
3018
- definition: {
3019
- ...t,
3020
- type: (0, l.getJSONTypes)(t.type),
3021
- schemaType: (0, l.getJSONTypes)(t.schemaType)
3022
- }
3023
- };
3024
- t.before ? ee.call(this, o, s, t.before) : o.rules.push(s), a.all[e] = s, (r = t.implements) == null || r.forEach((e) => this.addKeyword(e));
3025
- }
3026
- function ee(e, t, n) {
3027
- let r = e.rules.findIndex((e) => e.keyword === n);
3028
- r >= 0 ? e.rules.splice(r, 0, t) : (e.rules.push(t), this.logger.warn(`rule ${n} is not defined`));
3029
- }
3030
- function L(e) {
3031
- let { metaSchema: t } = e;
3032
- t !== void 0 && (e.$data && this.opts.$data && (t = z(t)), e.validateSchema = this.compile(t, !0));
3033
- }
3034
- var R = { $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#" };
3035
- function z(e) {
3036
- return { anyOf: [e, R] };
3037
- }
3038
- })), le = /* @__PURE__ */ g(((e) => {
3039
- Object.defineProperty(e, "__esModule", { value: !0 }), e.default = {
3040
- keyword: "id",
3041
- code() {
3042
- throw Error("NOT SUPPORTED: keyword \"id\", use \"$id\" for schema ID");
3043
- }
3044
- };
3045
- })), ue = /* @__PURE__ */ g(((e) => {
3046
- Object.defineProperty(e, "__esModule", { value: !0 }), e.callRef = e.getValidate = void 0;
3047
- var t = U(), n = L(), r = k(), i = j(), a = W(), o = A(), s = {
3048
- keyword: "$ref",
3049
- schemaType: "string",
3050
- code(e) {
3051
- let { gen: n, schema: i, it: o } = e, { baseId: s, schemaEnv: u, validateName: d, opts: f, self: p } = o, { root: m } = u;
3052
- if ((i === "#" || i === "#/") && s === m.baseId) return g();
3053
- let h = a.resolveRef.call(p, m, s, i);
3054
- if (h === void 0) throw new t.default(o.opts.uriResolver, s, i);
3055
- if (h instanceof a.SchemaEnv) return _(h);
3056
- return v(h);
3057
- function g() {
3058
- if (u === m) return l(e, d, u, u.$async);
3059
- let t = n.scopeValue("root", { ref: m });
3060
- return l(e, (0, r._)`${t}.validate`, m, m.$async);
3061
- }
3062
- function _(t) {
3063
- l(e, c(e, t), t, t.$async);
3064
- }
3065
- function v(t) {
3066
- let a = n.scopeValue("schema", f.code.source === !0 ? {
3067
- ref: t,
3068
- code: (0, r.stringify)(t)
3069
- } : { ref: t }), o = n.name("valid"), s = e.subschema({
3070
- schema: t,
3071
- dataTypes: [],
3072
- schemaPath: r.nil,
3073
- topSchemaRef: a,
3074
- errSchemaPath: i
3075
- }, o);
3076
- e.mergeEvaluated(s), e.ok(o);
3077
- }
3078
- }
3079
- };
3080
- function c(e, t) {
3081
- let { gen: n } = e;
3082
- return t.validate ? n.scopeValue("validate", { ref: t.validate }) : (0, r._)`${n.scopeValue("wrapper", { ref: t })}.validate`;
3083
- }
3084
- e.getValidate = c;
3085
- function l(e, t, a, s) {
3086
- let { gen: c, it: l } = e, { allErrors: u, schemaEnv: d, opts: f } = l, p = f.passContext ? i.default.this : r.nil;
3087
- s ? m() : h();
3088
- function m() {
3089
- if (!d.$async) throw Error("async schema referenced by sync schema");
3090
- let i = c.let("valid");
3091
- c.try(() => {
3092
- c.code((0, r._)`await ${(0, n.callValidateCode)(e, t, p)}`), _(t), u || c.assign(i, !0);
3093
- }, (e) => {
3094
- c.if((0, r._)`!(${e} instanceof ${l.ValidationError})`, () => c.throw(e)), g(e), u || c.assign(i, !1);
3095
- }), e.ok(i);
3096
- }
3097
- function h() {
3098
- e.result((0, n.callValidateCode)(e, t, p), () => _(t), () => g(t));
3099
- }
3100
- function g(e) {
3101
- let t = (0, r._)`${e}.errors`;
3102
- c.assign(i.default.vErrors, (0, r._)`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`), c.assign(i.default.errors, (0, r._)`${i.default.vErrors}.length`);
3103
- }
3104
- function _(e) {
3105
- if (!l.opts.unevaluated) return;
3106
- let t = a?.validate?.evaluated;
3107
- if (l.props !== !0) if (t && !t.dynamicProps) t.props !== void 0 && (l.props = o.mergeEvaluated.props(c, t.props, l.props));
3108
- else {
3109
- let t = c.var("props", (0, r._)`${e}.evaluated.props`);
3110
- l.props = o.mergeEvaluated.props(c, t, l.props, r.Name);
3111
- }
3112
- if (l.items !== !0) if (t && !t.dynamicItems) t.items !== void 0 && (l.items = o.mergeEvaluated.items(c, t.items, l.items));
3113
- else {
3114
- let t = c.var("items", (0, r._)`${e}.evaluated.items`);
3115
- l.items = o.mergeEvaluated.items(c, t, l.items, r.Name);
3116
- }
3117
- }
3118
- }
3119
- e.callRef = l, e.default = s;
3120
- })), de = /* @__PURE__ */ g(((e) => {
3121
- Object.defineProperty(e, "__esModule", { value: !0 });
3122
- var t = le(), n = ue();
3123
- e.default = [
3124
- "$schema",
3125
- "$id",
3126
- "$defs",
3127
- "$vocabulary",
3128
- { keyword: "$comment" },
3129
- "definitions",
3130
- t.default,
3131
- n.default
3132
- ];
3133
- })), fe = /* @__PURE__ */ g(((e) => {
3134
- Object.defineProperty(e, "__esModule", { value: !0 });
3135
- var t = k(), n = t.operators, r = {
3136
- maximum: {
3137
- okStr: "<=",
3138
- ok: n.LTE,
3139
- fail: n.GT
3140
- },
3141
- minimum: {
3142
- okStr: ">=",
3143
- ok: n.GTE,
3144
- fail: n.LT
3145
- },
3146
- exclusiveMaximum: {
3147
- okStr: "<",
3148
- ok: n.LT,
3149
- fail: n.GTE
3150
- },
3151
- exclusiveMinimum: {
3152
- okStr: ">",
3153
- ok: n.GT,
3154
- fail: n.LTE
3155
- }
3156
- };
3157
- e.default = {
3158
- keyword: Object.keys(r),
3159
- type: "number",
3160
- schemaType: "number",
3161
- $data: !0,
3162
- error: {
3163
- message: ({ keyword: e, schemaCode: n }) => (0, t.str)`must be ${r[e].okStr} ${n}`,
3164
- params: ({ keyword: e, schemaCode: n }) => (0, t._)`{comparison: ${r[e].okStr}, limit: ${n}}`
3165
- },
3166
- code(e) {
3167
- let { keyword: n, data: i, schemaCode: a } = e;
3168
- e.fail$data((0, t._)`${i} ${r[n].fail} ${a} || isNaN(${i})`);
3169
- }
3170
- };
3171
- })), pe = /* @__PURE__ */ g(((e) => {
3172
- Object.defineProperty(e, "__esModule", { value: !0 });
3173
- var t = k();
3174
- e.default = {
3175
- keyword: "multipleOf",
3176
- type: "number",
3177
- schemaType: "number",
3178
- $data: !0,
3179
- error: {
3180
- message: ({ schemaCode: e }) => (0, t.str)`must be multiple of ${e}`,
3181
- params: ({ schemaCode: e }) => (0, t._)`{multipleOf: ${e}}`
3182
- },
3183
- code(e) {
3184
- let { gen: n, data: r, schemaCode: i, it: a } = e, o = a.opts.multipleOfPrecision, s = n.let("res"), c = o ? (0, t._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}` : (0, t._)`${s} !== parseInt(${s})`;
3185
- e.fail$data((0, t._)`(${i} === 0 || (${s} = ${r}/${i}, ${c}))`);
3186
- }
3187
- };
3188
- })), me = /* @__PURE__ */ g(((e) => {
3189
- Object.defineProperty(e, "__esModule", { value: !0 });
3190
- function t(e) {
3191
- let t = e.length, n = 0, r = 0, i;
3192
- for (; r < t;) n++, i = e.charCodeAt(r++), i >= 55296 && i <= 56319 && r < t && (i = e.charCodeAt(r), (i & 64512) == 56320 && r++);
3193
- return n;
3194
- }
3195
- e.default = t, t.code = "require(\"ajv/dist/runtime/ucs2length\").default";
3196
- })), he = /* @__PURE__ */ g(((e) => {
3197
- Object.defineProperty(e, "__esModule", { value: !0 });
3198
- var t = k(), n = A(), r = me();
3199
- e.default = {
3200
- keyword: ["maxLength", "minLength"],
3201
- type: "string",
3202
- schemaType: "number",
3203
- $data: !0,
3204
- error: {
3205
- message({ keyword: e, schemaCode: n }) {
3206
- let r = e === "maxLength" ? "more" : "fewer";
3207
- return (0, t.str)`must NOT have ${r} than ${n} characters`;
3208
- },
3209
- params: ({ schemaCode: e }) => (0, t._)`{limit: ${e}}`
3210
- },
3211
- code(e) {
3212
- let { keyword: i, data: a, schemaCode: o, it: s } = e, c = i === "maxLength" ? t.operators.GT : t.operators.LT, l = s.opts.unicode === !1 ? (0, t._)`${a}.length` : (0, t._)`${(0, n.useFunc)(e.gen, r.default)}(${a})`;
3213
- e.fail$data((0, t._)`${l} ${c} ${o}`);
3214
- }
3215
- };
3216
- })), ge = /* @__PURE__ */ g(((e) => {
3217
- Object.defineProperty(e, "__esModule", { value: !0 });
3218
- var t = L(), n = A(), r = k();
3219
- e.default = {
3220
- keyword: "pattern",
3221
- type: "string",
3222
- schemaType: "string",
3223
- $data: !0,
3224
- error: {
3225
- message: ({ schemaCode: e }) => (0, r.str)`must match pattern "${e}"`,
3226
- params: ({ schemaCode: e }) => (0, r._)`{pattern: ${e}}`
3227
- },
3228
- code(e) {
3229
- let { gen: i, data: a, $data: o, schema: s, schemaCode: c, it: l } = e, u = l.opts.unicodeRegExp ? "u" : "";
3230
- if (o) {
3231
- let { regExp: t } = l.opts.code, o = t.code === "new RegExp" ? (0, r._)`new RegExp` : (0, n.useFunc)(i, t), s = i.let("valid");
3232
- i.try(() => i.assign(s, (0, r._)`${o}(${c}, ${u}).test(${a})`), () => i.assign(s, !1)), e.fail$data((0, r._)`!${s}`);
3233
- } else {
3234
- let n = (0, t.usePattern)(e, s);
3235
- e.fail$data((0, r._)`!${n}.test(${a})`);
3236
- }
3237
- }
3238
- };
3239
- })), _e = /* @__PURE__ */ g(((e) => {
3240
- Object.defineProperty(e, "__esModule", { value: !0 });
3241
- var t = k();
3242
- e.default = {
3243
- keyword: ["maxProperties", "minProperties"],
3244
- type: "object",
3245
- schemaType: "number",
3246
- $data: !0,
3247
- error: {
3248
- message({ keyword: e, schemaCode: n }) {
3249
- let r = e === "maxProperties" ? "more" : "fewer";
3250
- return (0, t.str)`must NOT have ${r} than ${n} properties`;
3251
- },
3252
- params: ({ schemaCode: e }) => (0, t._)`{limit: ${e}}`
3253
- },
3254
- code(e) {
3255
- let { keyword: n, data: r, schemaCode: i } = e, a = n === "maxProperties" ? t.operators.GT : t.operators.LT;
3256
- e.fail$data((0, t._)`Object.keys(${r}).length ${a} ${i}`);
3257
- }
3258
- };
3259
- })), ve = /* @__PURE__ */ g(((e) => {
3260
- Object.defineProperty(e, "__esModule", { value: !0 });
3261
- var t = L(), n = k(), r = A();
3262
- e.default = {
3263
- keyword: "required",
3264
- type: "object",
3265
- schemaType: "array",
3266
- $data: !0,
3267
- error: {
3268
- message: ({ params: { missingProperty: e } }) => (0, n.str)`must have required property '${e}'`,
3269
- params: ({ params: { missingProperty: e } }) => (0, n._)`{missingProperty: ${e}}`
3270
- },
3271
- code(e) {
3272
- let { gen: i, schema: a, schemaCode: o, data: s, $data: c, it: l } = e, { opts: u } = l;
3273
- if (!c && a.length === 0) return;
3274
- let d = a.length >= u.loopRequired;
3275
- if (l.allErrors ? f() : p(), u.strictRequired) {
3276
- let t = e.parentSchema.properties, { definedProperties: n } = e.it;
3277
- for (let e of a) if (t?.[e] === void 0 && !n.has(e)) {
3278
- let t = `required property "${e}" is not defined at "${l.schemaEnv.baseId + l.errSchemaPath}" (strictRequired)`;
3279
- (0, r.checkStrictMode)(l, t, l.opts.strictRequired);
3280
- }
3281
- }
3282
- function f() {
3283
- if (d || c) e.block$data(n.nil, m);
3284
- else for (let n of a) (0, t.checkReportMissingProp)(e, n);
3285
- }
3286
- function p() {
3287
- let n = i.let("missing");
3288
- if (d || c) {
3289
- let t = i.let("valid", !0);
3290
- e.block$data(t, () => h(n, t)), e.ok(t);
3291
- } else i.if((0, t.checkMissingProp)(e, a, n)), (0, t.reportMissingProp)(e, n), i.else();
3292
- }
3293
- function m() {
3294
- i.forOf("prop", o, (n) => {
3295
- e.setParams({ missingProperty: n }), i.if((0, t.noPropertyInData)(i, s, n, u.ownProperties), () => e.error());
3296
- });
3297
- }
3298
- function h(r, a) {
3299
- e.setParams({ missingProperty: r }), i.forOf(r, o, () => {
3300
- i.assign(a, (0, t.propertyInData)(i, s, r, u.ownProperties)), i.if((0, n.not)(a), () => {
3301
- e.error(), i.break();
3302
- });
3303
- }, n.nil);
3304
- }
3305
- }
3306
- };
3307
- })), ye = /* @__PURE__ */ g(((e) => {
3308
- Object.defineProperty(e, "__esModule", { value: !0 });
3309
- var t = k();
3310
- e.default = {
3311
- keyword: ["maxItems", "minItems"],
3312
- type: "array",
3313
- schemaType: "number",
3314
- $data: !0,
3315
- error: {
3316
- message({ keyword: e, schemaCode: n }) {
3317
- let r = e === "maxItems" ? "more" : "fewer";
3318
- return (0, t.str)`must NOT have ${r} than ${n} items`;
3319
- },
3320
- params: ({ schemaCode: e }) => (0, t._)`{limit: ${e}}`
3321
- },
3322
- code(e) {
3323
- let { keyword: n, data: r, schemaCode: i } = e, a = n === "maxItems" ? t.operators.GT : t.operators.LT;
3324
- e.fail$data((0, t._)`${r}.length ${a} ${i}`);
3325
- }
3326
- };
3327
- })), be = /* @__PURE__ */ g(((e) => {
3328
- Object.defineProperty(e, "__esModule", { value: !0 });
3329
- var t = te();
3330
- t.code = "require(\"ajv/dist/runtime/equal\").default", e.default = t;
3331
- })), xe = /* @__PURE__ */ g(((e) => {
3332
- Object.defineProperty(e, "__esModule", { value: !0 });
3333
- var t = I(), n = k(), r = A(), i = be();
3334
- e.default = {
3335
- keyword: "uniqueItems",
3336
- type: "array",
3337
- schemaType: "boolean",
3338
- $data: !0,
3339
- error: {
3340
- message: ({ params: { i: e, j: t } }) => (0, n.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,
3341
- params: ({ params: { i: e, j: t } }) => (0, n._)`{i: ${e}, j: ${t}}`
3342
- },
3343
- code(e) {
3344
- let { gen: a, data: o, $data: s, schema: c, parentSchema: l, schemaCode: u, it: d } = e;
3345
- if (!s && !c) return;
3346
- let f = a.let("valid"), p = l.items ? (0, t.getSchemaTypes)(l.items) : [];
3347
- e.block$data(f, m, (0, n._)`${u} === false`), e.ok(f);
3348
- function m() {
3349
- let t = a.let("i", (0, n._)`${o}.length`), r = a.let("j");
3350
- e.setParams({
3351
- i: t,
3352
- j: r
3353
- }), a.assign(f, !0), a.if((0, n._)`${t} > 1`, () => (h() ? g : _)(t, r));
3354
- }
3355
- function h() {
3356
- return p.length > 0 && !p.some((e) => e === "object" || e === "array");
3357
- }
3358
- function g(r, i) {
3359
- let s = a.name("item"), c = (0, t.checkDataTypes)(p, s, d.opts.strictNumbers, t.DataType.Wrong), l = a.const("indices", (0, n._)`{}`);
3360
- a.for((0, n._)`;${r}--;`, () => {
3361
- a.let(s, (0, n._)`${o}[${r}]`), a.if(c, (0, n._)`continue`), p.length > 1 && a.if((0, n._)`typeof ${s} == "string"`, (0, n._)`${s} += "_"`), a.if((0, n._)`typeof ${l}[${s}] == "number"`, () => {
3362
- a.assign(i, (0, n._)`${l}[${s}]`), e.error(), a.assign(f, !1).break();
3363
- }).code((0, n._)`${l}[${s}] = ${r}`);
3364
- });
3365
- }
3366
- function _(t, s) {
3367
- let c = (0, r.useFunc)(a, i.default), l = a.name("outer");
3368
- a.label(l).for((0, n._)`;${t}--;`, () => a.for((0, n._)`${s} = ${t}; ${s}--;`, () => a.if((0, n._)`${c}(${o}[${t}], ${o}[${s}])`, () => {
3369
- e.error(), a.assign(f, !1).break(l);
3370
- })));
3371
- }
3372
- }
3373
- };
3374
- })), Se = /* @__PURE__ */ g(((e) => {
3375
- Object.defineProperty(e, "__esModule", { value: !0 });
3376
- var t = k(), n = A(), r = be();
3377
- e.default = {
3378
- keyword: "const",
3379
- $data: !0,
3380
- error: {
3381
- message: "must be equal to constant",
3382
- params: ({ schemaCode: e }) => (0, t._)`{allowedValue: ${e}}`
3383
- },
3384
- code(e) {
3385
- let { gen: i, data: a, $data: o, schemaCode: s, schema: c } = e;
3386
- o || c && typeof c == "object" ? e.fail$data((0, t._)`!${(0, n.useFunc)(i, r.default)}(${a}, ${s})`) : e.fail((0, t._)`${c} !== ${a}`);
3387
- }
3388
- };
3389
- })), Ce = /* @__PURE__ */ g(((e) => {
3390
- Object.defineProperty(e, "__esModule", { value: !0 });
3391
- var t = k(), n = A(), r = be();
3392
- e.default = {
3393
- keyword: "enum",
3394
- schemaType: "array",
3395
- $data: !0,
3396
- error: {
3397
- message: "must be equal to one of the allowed values",
3398
- params: ({ schemaCode: e }) => (0, t._)`{allowedValues: ${e}}`
3399
- },
3400
- code(e) {
3401
- let { gen: i, data: a, $data: o, schema: s, schemaCode: c, it: l } = e;
3402
- if (!o && s.length === 0) throw Error("enum must have non-empty array");
3403
- let u = s.length >= l.opts.loopEnum, d, f = () => d ??= (0, n.useFunc)(i, r.default), p;
3404
- if (u || o) p = i.let("valid"), e.block$data(p, m);
3405
- else {
3406
- /* istanbul ignore if */
3407
- if (!Array.isArray(s)) throw Error("ajv implementation error");
3408
- let e = i.const("vSchema", c);
3409
- p = (0, t.or)(...s.map((t, n) => h(e, n)));
3410
- }
3411
- e.pass(p);
3412
- function m() {
3413
- i.assign(p, !1), i.forOf("v", c, (e) => i.if((0, t._)`${f()}(${a}, ${e})`, () => i.assign(p, !0).break()));
3414
- }
3415
- function h(e, n) {
3416
- let r = s[n];
3417
- return typeof r == "object" && r ? (0, t._)`${f()}(${a}, ${e}[${n}])` : (0, t._)`${a} === ${r}`;
3418
- }
3419
- }
3420
- };
3421
- })), we = /* @__PURE__ */ g(((e) => {
3422
- Object.defineProperty(e, "__esModule", { value: !0 });
3423
- var t = fe(), n = pe(), r = he(), i = ge(), a = _e(), o = ve(), s = ye(), c = xe(), l = Se(), u = Ce();
3424
- e.default = [
3425
- t.default,
3426
- n.default,
3427
- r.default,
3428
- i.default,
3429
- a.default,
3430
- o.default,
3431
- s.default,
3432
- c.default,
3433
- {
3434
- keyword: "type",
3435
- schemaType: ["string", "array"]
3436
- },
3437
- {
3438
- keyword: "nullable",
3439
- schemaType: "boolean"
3440
- },
3441
- l.default,
3442
- u.default
3443
- ];
3444
- })), Te = /* @__PURE__ */ g(((e) => {
3445
- Object.defineProperty(e, "__esModule", { value: !0 }), e.validateAdditionalItems = void 0;
3446
- var t = k(), n = A(), r = {
3447
- keyword: "additionalItems",
3448
- type: "array",
3449
- schemaType: ["boolean", "object"],
3450
- before: "uniqueItems",
3451
- error: {
3452
- message: ({ params: { len: e } }) => (0, t.str)`must NOT have more than ${e} items`,
3453
- params: ({ params: { len: e } }) => (0, t._)`{limit: ${e}}`
3454
- },
3455
- code(e) {
3456
- let { parentSchema: t, it: r } = e, { items: a } = t;
3457
- if (!Array.isArray(a)) {
3458
- (0, n.checkStrictMode)(r, "\"additionalItems\" is ignored when \"items\" is not an array of schemas");
3459
- return;
3460
- }
3461
- i(e, a);
3462
- }
3463
- };
3464
- function i(e, r) {
3465
- let { gen: i, schema: a, data: o, keyword: s, it: c } = e;
3466
- c.items = !0;
3467
- let l = i.const("len", (0, t._)`${o}.length`);
3468
- if (a === !1) e.setParams({ len: r.length }), e.pass((0, t._)`${l} <= ${r.length}`);
3469
- else if (typeof a == "object" && !(0, n.alwaysValidSchema)(c, a)) {
3470
- let n = i.var("valid", (0, t._)`${l} <= ${r.length}`);
3471
- i.if((0, t.not)(n), () => u(n)), e.ok(n);
3472
- }
3473
- function u(a) {
3474
- i.forRange("i", r.length, l, (r) => {
3475
- e.subschema({
3476
- keyword: s,
3477
- dataProp: r,
3478
- dataPropType: n.Type.Num
3479
- }, a), c.allErrors || i.if((0, t.not)(a), () => i.break());
3480
- });
3481
- }
3482
- }
3483
- e.validateAdditionalItems = i, e.default = r;
3484
- })), Ee = /* @__PURE__ */ g(((e) => {
3485
- Object.defineProperty(e, "__esModule", { value: !0 }), e.validateTuple = void 0;
3486
- var t = k(), n = A(), r = L(), i = {
3487
- keyword: "items",
3488
- type: "array",
3489
- schemaType: [
3490
- "object",
3491
- "array",
3492
- "boolean"
3493
- ],
3494
- before: "uniqueItems",
3495
- code(e) {
3496
- let { schema: t, it: i } = e;
3497
- if (Array.isArray(t)) return a(e, "additionalItems", t);
3498
- i.items = !0, !(0, n.alwaysValidSchema)(i, t) && e.ok((0, r.validateArray)(e));
3499
- }
3500
- };
3501
- function a(e, r, i = e.schema) {
3502
- let { gen: a, parentSchema: o, data: s, keyword: c, it: l } = e;
3503
- f(o), l.opts.unevaluated && i.length && l.items !== !0 && (l.items = n.mergeEvaluated.items(a, i.length, l.items));
3504
- let u = a.name("valid"), d = a.const("len", (0, t._)`${s}.length`);
3505
- i.forEach((r, i) => {
3506
- (0, n.alwaysValidSchema)(l, r) || (a.if((0, t._)`${d} > ${i}`, () => e.subschema({
3507
- keyword: c,
3508
- schemaProp: i,
3509
- dataProp: i
3510
- }, u)), e.ok(u));
3511
- });
3512
- function f(e) {
3513
- let { opts: t, errSchemaPath: a } = l, o = i.length, s = o === e.minItems && (o === e.maxItems || e[r] === !1);
3514
- if (t.strictTuples && !s) {
3515
- let e = `"${c}" is ${o}-tuple, but minItems or maxItems/${r} are not specified or different at path "${a}"`;
3516
- (0, n.checkStrictMode)(l, e, t.strictTuples);
3517
- }
3518
- }
3519
- }
3520
- e.validateTuple = a, e.default = i;
3521
- })), De = /* @__PURE__ */ g(((e) => {
3522
- Object.defineProperty(e, "__esModule", { value: !0 });
3523
- var t = Ee();
3524
- e.default = {
3525
- keyword: "prefixItems",
3526
- type: "array",
3527
- schemaType: ["array"],
3528
- before: "uniqueItems",
3529
- code: (e) => (0, t.validateTuple)(e, "items")
3530
- };
3531
- })), Oe = /* @__PURE__ */ g(((e) => {
3532
- Object.defineProperty(e, "__esModule", { value: !0 });
3533
- var t = k(), n = A(), r = L(), i = Te();
3534
- e.default = {
3535
- keyword: "items",
3536
- type: "array",
3537
- schemaType: ["object", "boolean"],
3538
- before: "uniqueItems",
3539
- error: {
3540
- message: ({ params: { len: e } }) => (0, t.str)`must NOT have more than ${e} items`,
3541
- params: ({ params: { len: e } }) => (0, t._)`{limit: ${e}}`
3542
- },
3543
- code(e) {
3544
- let { schema: t, parentSchema: a, it: o } = e, { prefixItems: s } = a;
3545
- o.items = !0, !(0, n.alwaysValidSchema)(o, t) && (s ? (0, i.validateAdditionalItems)(e, s) : e.ok((0, r.validateArray)(e)));
3546
- }
3547
- };
3548
- })), ke = /* @__PURE__ */ g(((e) => {
3549
- Object.defineProperty(e, "__esModule", { value: !0 });
3550
- var t = k(), n = A();
3551
- e.default = {
3552
- keyword: "contains",
3553
- type: "array",
3554
- schemaType: ["object", "boolean"],
3555
- before: "uniqueItems",
3556
- trackErrors: !0,
3557
- error: {
3558
- message: ({ params: { min: e, max: n } }) => n === void 0 ? (0, t.str)`must contain at least ${e} valid item(s)` : (0, t.str)`must contain at least ${e} and no more than ${n} valid item(s)`,
3559
- params: ({ params: { min: e, max: n } }) => n === void 0 ? (0, t._)`{minContains: ${e}}` : (0, t._)`{minContains: ${e}, maxContains: ${n}}`
3560
- },
3561
- code(e) {
3562
- let { gen: r, schema: i, parentSchema: a, data: o, it: s } = e, c, l, { minContains: u, maxContains: d } = a;
3563
- s.opts.next ? (c = u === void 0 ? 1 : u, l = d) : c = 1;
3564
- let f = r.const("len", (0, t._)`${o}.length`);
3565
- if (e.setParams({
3566
- min: c,
3567
- max: l
3568
- }), l === void 0 && c === 0) {
3569
- (0, n.checkStrictMode)(s, "\"minContains\" == 0 without \"maxContains\": \"contains\" keyword ignored");
3570
- return;
3571
- }
3572
- if (l !== void 0 && c > l) {
3573
- (0, n.checkStrictMode)(s, "\"minContains\" > \"maxContains\" is always invalid"), e.fail();
3574
- return;
3575
- }
3576
- if ((0, n.alwaysValidSchema)(s, i)) {
3577
- let n = (0, t._)`${f} >= ${c}`;
3578
- l !== void 0 && (n = (0, t._)`${n} && ${f} <= ${l}`), e.pass(n);
3579
- return;
3580
- }
3581
- s.items = !0;
3582
- let p = r.name("valid");
3583
- l === void 0 && c === 1 ? h(p, () => r.if(p, () => r.break())) : c === 0 ? (r.let(p, !0), l !== void 0 && r.if((0, t._)`${o}.length > 0`, m)) : (r.let(p, !1), m()), e.result(p, () => e.reset());
3584
- function m() {
3585
- let e = r.name("_valid"), t = r.let("count", 0);
3586
- h(e, () => r.if(e, () => g(t)));
3587
- }
3588
- function h(t, i) {
3589
- r.forRange("i", 0, f, (r) => {
3590
- e.subschema({
3591
- keyword: "contains",
3592
- dataProp: r,
3593
- dataPropType: n.Type.Num,
3594
- compositeRule: !0
3595
- }, t), i();
3596
- });
3597
- }
3598
- function g(e) {
3599
- r.code((0, t._)`${e}++`), l === void 0 ? r.if((0, t._)`${e} >= ${c}`, () => r.assign(p, !0).break()) : (r.if((0, t._)`${e} > ${l}`, () => r.assign(p, !1).break()), c === 1 ? r.assign(p, !0) : r.if((0, t._)`${e} >= ${c}`, () => r.assign(p, !0)));
3600
- }
3601
- }
3602
- };
3603
- })), Ae = /* @__PURE__ */ g(((e) => {
3604
- Object.defineProperty(e, "__esModule", { value: !0 }), e.validateSchemaDeps = e.validatePropertyDeps = e.error = void 0;
3605
- var t = k(), n = A(), r = L();
3606
- e.error = {
3607
- message: ({ params: { property: e, depsCount: n, deps: r } }) => {
3608
- let i = n === 1 ? "property" : "properties";
3609
- return (0, t.str)`must have ${i} ${r} when property ${e} is present`;
3610
- },
3611
- params: ({ params: { property: e, depsCount: n, deps: r, missingProperty: i } }) => (0, t._)`{property: ${e},
3612
- missingProperty: ${i},
3613
- depsCount: ${n},
3614
- deps: ${r}}`
3615
- };
3616
- var i = {
3617
- keyword: "dependencies",
3618
- type: "object",
3619
- schemaType: "object",
3620
- error: e.error,
3621
- code(e) {
3622
- let [t, n] = a(e);
3623
- o(e, t), s(e, n);
3624
- }
3625
- };
3626
- function a({ schema: e }) {
3627
- let t = {}, n = {};
3628
- for (let r in e) {
3629
- if (r === "__proto__") continue;
3630
- let i = Array.isArray(e[r]) ? t : n;
3631
- i[r] = e[r];
3632
- }
3633
- return [t, n];
3634
- }
3635
- function o(e, n = e.schema) {
3636
- let { gen: i, data: a, it: o } = e;
3637
- if (Object.keys(n).length === 0) return;
3638
- let s = i.let("missing");
3639
- for (let c in n) {
3640
- let l = n[c];
3641
- if (l.length === 0) continue;
3642
- let u = (0, r.propertyInData)(i, a, c, o.opts.ownProperties);
3643
- e.setParams({
3644
- property: c,
3645
- depsCount: l.length,
3646
- deps: l.join(", ")
3647
- }), o.allErrors ? i.if(u, () => {
3648
- for (let t of l) (0, r.checkReportMissingProp)(e, t);
3649
- }) : (i.if((0, t._)`${u} && (${(0, r.checkMissingProp)(e, l, s)})`), (0, r.reportMissingProp)(e, s), i.else());
3650
- }
3651
- }
3652
- e.validatePropertyDeps = o;
3653
- function s(e, t = e.schema) {
3654
- let { gen: i, data: a, keyword: o, it: s } = e, c = i.name("valid");
3655
- for (let l in t) (0, n.alwaysValidSchema)(s, t[l]) || (i.if((0, r.propertyInData)(i, a, l, s.opts.ownProperties), () => {
3656
- let t = e.subschema({
3657
- keyword: o,
3658
- schemaProp: l
3659
- }, c);
3660
- e.mergeValidEvaluated(t, c);
3661
- }, () => i.var(c, !0)), e.ok(c));
3662
- }
3663
- e.validateSchemaDeps = s, e.default = i;
3664
- })), je = /* @__PURE__ */ g(((e) => {
3665
- Object.defineProperty(e, "__esModule", { value: !0 });
3666
- var t = k(), n = A();
3667
- e.default = {
3668
- keyword: "propertyNames",
3669
- type: "object",
3670
- schemaType: ["object", "boolean"],
3671
- error: {
3672
- message: "property name must be valid",
3673
- params: ({ params: e }) => (0, t._)`{propertyName: ${e.propertyName}}`
3674
- },
3675
- code(e) {
3676
- let { gen: r, schema: i, data: a, it: o } = e;
3677
- if ((0, n.alwaysValidSchema)(o, i)) return;
3678
- let s = r.name("valid");
3679
- r.forIn("key", a, (n) => {
3680
- e.setParams({ propertyName: n }), e.subschema({
3681
- keyword: "propertyNames",
3682
- data: n,
3683
- dataTypes: ["string"],
3684
- propertyName: n,
3685
- compositeRule: !0
3686
- }, s), r.if((0, t.not)(s), () => {
3687
- e.error(!0), o.allErrors || r.break();
3688
- });
3689
- }), e.ok(s);
3690
- }
3691
- };
3692
- })), Me = /* @__PURE__ */ g(((e) => {
3693
- Object.defineProperty(e, "__esModule", { value: !0 });
3694
- var t = L(), n = k(), r = j(), i = A();
3695
- e.default = {
3696
- keyword: "additionalProperties",
3697
- type: ["object"],
3698
- schemaType: ["boolean", "object"],
3699
- allowUndefined: !0,
3700
- trackErrors: !0,
3701
- error: {
3702
- message: "must NOT have additional properties",
3703
- params: ({ params: e }) => (0, n._)`{additionalProperty: ${e.additionalProperty}}`
3704
- },
3705
- code(e) {
3706
- let { gen: a, schema: o, parentSchema: s, data: c, errsCount: l, it: u } = e;
3707
- /* istanbul ignore if */
3708
- if (!l) throw Error("ajv implementation error");
3709
- let { allErrors: d, opts: f } = u;
3710
- if (u.props = !0, f.removeAdditional !== "all" && (0, i.alwaysValidSchema)(u, o)) return;
3711
- let p = (0, t.allSchemaProperties)(s.properties), m = (0, t.allSchemaProperties)(s.patternProperties);
3712
- h(), e.ok((0, n._)`${l} === ${r.default.errors}`);
3713
- function h() {
3714
- a.forIn("key", c, (e) => {
3715
- !p.length && !m.length ? v(e) : a.if(g(e), () => v(e));
3716
- });
3717
- }
3718
- function g(r) {
3719
- let o;
3720
- if (p.length > 8) {
3721
- let e = (0, i.schemaRefOrVal)(u, s.properties, "properties");
3722
- o = (0, t.isOwnProperty)(a, e, r);
3723
- } else o = p.length ? (0, n.or)(...p.map((e) => (0, n._)`${r} === ${e}`)) : n.nil;
3724
- return m.length && (o = (0, n.or)(o, ...m.map((i) => (0, n._)`${(0, t.usePattern)(e, i)}.test(${r})`))), (0, n.not)(o);
3725
- }
3726
- function _(e) {
3727
- a.code((0, n._)`delete ${c}[${e}]`);
3728
- }
3729
- function v(t) {
3730
- if (f.removeAdditional === "all" || f.removeAdditional && o === !1) {
3731
- _(t);
3732
- return;
3733
- }
3734
- if (o === !1) {
3735
- e.setParams({ additionalProperty: t }), e.error(), d || a.break();
3736
- return;
3737
- }
3738
- if (typeof o == "object" && !(0, i.alwaysValidSchema)(u, o)) {
3739
- let r = a.name("valid");
3740
- f.removeAdditional === "failing" ? (y(t, r, !1), a.if((0, n.not)(r), () => {
3741
- e.reset(), _(t);
3742
- })) : (y(t, r), d || a.if((0, n.not)(r), () => a.break()));
3743
- }
3744
- }
3745
- function y(t, n, r) {
3746
- let a = {
3747
- keyword: "additionalProperties",
3748
- dataProp: t,
3749
- dataPropType: i.Type.Str
3750
- };
3751
- r === !1 && Object.assign(a, {
3752
- compositeRule: !0,
3753
- createErrors: !1,
3754
- allErrors: !1
3755
- }), e.subschema(a, n);
3756
- }
3757
- }
3758
- };
3759
- })), Ne = /* @__PURE__ */ g(((e) => {
3760
- Object.defineProperty(e, "__esModule", { value: !0 });
3761
- var t = V(), n = L(), r = A(), i = Me();
3762
- e.default = {
3763
- keyword: "properties",
3764
- type: "object",
3765
- schemaType: "object",
3766
- code(e) {
3767
- let { gen: a, schema: o, parentSchema: s, data: c, it: l } = e;
3768
- l.opts.removeAdditional === "all" && s.additionalProperties === void 0 && i.default.code(new t.KeywordCxt(l, i.default, "additionalProperties"));
3769
- let u = (0, n.allSchemaProperties)(o);
3770
- for (let e of u) l.definedProperties.add(e);
3771
- l.opts.unevaluated && u.length && l.props !== !0 && (l.props = r.mergeEvaluated.props(a, (0, r.toHash)(u), l.props));
3772
- let d = u.filter((e) => !(0, r.alwaysValidSchema)(l, o[e]));
3773
- if (d.length === 0) return;
3774
- let f = a.name("valid");
3775
- for (let t of d) p(t) ? m(t) : (a.if((0, n.propertyInData)(a, c, t, l.opts.ownProperties)), m(t), l.allErrors || a.else().var(f, !0), a.endIf()), e.it.definedProperties.add(t), e.ok(f);
3776
- function p(e) {
3777
- return l.opts.useDefaults && !l.compositeRule && o[e].default !== void 0;
3778
- }
3779
- function m(t) {
3780
- e.subschema({
3781
- keyword: "properties",
3782
- schemaProp: t,
3783
- dataProp: t
3784
- }, f);
3785
- }
3786
- }
3787
- };
3788
- })), Pe = /* @__PURE__ */ g(((e) => {
3789
- Object.defineProperty(e, "__esModule", { value: !0 });
3790
- var t = L(), n = k(), r = A(), i = A();
3791
- e.default = {
3792
- keyword: "patternProperties",
3793
- type: "object",
3794
- schemaType: "object",
3795
- code(e) {
3796
- let { gen: a, schema: o, data: s, parentSchema: c, it: l } = e, { opts: u } = l, d = (0, t.allSchemaProperties)(o), f = d.filter((e) => (0, r.alwaysValidSchema)(l, o[e]));
3797
- if (d.length === 0 || f.length === d.length && (!l.opts.unevaluated || l.props === !0)) return;
3798
- let p = u.strictSchema && !u.allowMatchingProperties && c.properties, m = a.name("valid");
3799
- l.props !== !0 && !(l.props instanceof n.Name) && (l.props = (0, i.evaluatedPropsToName)(a, l.props));
3800
- let { props: h } = l;
3801
- g();
3802
- function g() {
3803
- for (let e of d) p && _(e), l.allErrors ? v(e) : (a.var(m, !0), v(e), a.if(m));
3804
- }
3805
- function _(e) {
3806
- for (let t in p) new RegExp(e).test(t) && (0, r.checkStrictMode)(l, `property ${t} matches pattern ${e} (use allowMatchingProperties)`);
3807
- }
3808
- function v(r) {
3809
- a.forIn("key", s, (o) => {
3810
- a.if((0, n._)`${(0, t.usePattern)(e, r)}.test(${o})`, () => {
3811
- let t = f.includes(r);
3812
- t || e.subschema({
3813
- keyword: "patternProperties",
3814
- schemaProp: r,
3815
- dataProp: o,
3816
- dataPropType: i.Type.Str
3817
- }, m), l.opts.unevaluated && h !== !0 ? a.assign((0, n._)`${h}[${o}]`, !0) : !t && !l.allErrors && a.if((0, n.not)(m), () => a.break());
3818
- });
3819
- });
3820
- }
3821
- }
3822
- };
3823
- })), Fe = /* @__PURE__ */ g(((e) => {
3824
- Object.defineProperty(e, "__esModule", { value: !0 });
3825
- var t = A();
3826
- e.default = {
3827
- keyword: "not",
3828
- schemaType: ["object", "boolean"],
3829
- trackErrors: !0,
3830
- code(e) {
3831
- let { gen: n, schema: r, it: i } = e;
3832
- if ((0, t.alwaysValidSchema)(i, r)) {
3833
- e.fail();
3834
- return;
3835
- }
3836
- let a = n.name("valid");
3837
- e.subschema({
3838
- keyword: "not",
3839
- compositeRule: !0,
3840
- createErrors: !1,
3841
- allErrors: !1
3842
- }, a), e.failResult(a, () => e.reset(), () => e.error());
3843
- },
3844
- error: { message: "must NOT be valid" }
3845
- };
3846
- })), Ie = /* @__PURE__ */ g(((e) => {
3847
- Object.defineProperty(e, "__esModule", { value: !0 }), e.default = {
3848
- keyword: "anyOf",
3849
- schemaType: "array",
3850
- trackErrors: !0,
3851
- code: L().validateUnion,
3852
- error: { message: "must match a schema in anyOf" }
3853
- };
3854
- })), Le = /* @__PURE__ */ g(((e) => {
3855
- Object.defineProperty(e, "__esModule", { value: !0 });
3856
- var t = k(), n = A();
3857
- e.default = {
3858
- keyword: "oneOf",
3859
- schemaType: "array",
3860
- trackErrors: !0,
3861
- error: {
3862
- message: "must match exactly one schema in oneOf",
3863
- params: ({ params: e }) => (0, t._)`{passingSchemas: ${e.passing}}`
3864
- },
3865
- code(e) {
3866
- let { gen: r, schema: i, parentSchema: a, it: o } = e;
3867
- /* istanbul ignore if */
3868
- if (!Array.isArray(i)) throw Error("ajv implementation error");
3869
- if (o.opts.discriminator && a.discriminator) return;
3870
- let s = i, c = r.let("valid", !1), l = r.let("passing", null), u = r.name("_valid");
3871
- e.setParams({ passing: l }), r.block(d), e.result(c, () => e.reset(), () => e.error(!0));
3872
- function d() {
3873
- s.forEach((i, a) => {
3874
- let s;
3875
- (0, n.alwaysValidSchema)(o, i) ? r.var(u, !0) : s = e.subschema({
3876
- keyword: "oneOf",
3877
- schemaProp: a,
3878
- compositeRule: !0
3879
- }, u), a > 0 && r.if((0, t._)`${u} && ${c}`).assign(c, !1).assign(l, (0, t._)`[${l}, ${a}]`).else(), r.if(u, () => {
3880
- r.assign(c, !0), r.assign(l, a), s && e.mergeEvaluated(s, t.Name);
3881
- });
3882
- });
3883
- }
3884
- }
3885
- };
3886
- })), Re = /* @__PURE__ */ g(((e) => {
3887
- Object.defineProperty(e, "__esModule", { value: !0 });
3888
- var t = A();
3889
- e.default = {
3890
- keyword: "allOf",
3891
- schemaType: "array",
3892
- code(e) {
3893
- let { gen: n, schema: r, it: i } = e;
3894
- /* istanbul ignore if */
3895
- if (!Array.isArray(r)) throw Error("ajv implementation error");
3896
- let a = n.name("valid");
3897
- r.forEach((n, r) => {
3898
- if ((0, t.alwaysValidSchema)(i, n)) return;
3899
- let o = e.subschema({
3900
- keyword: "allOf",
3901
- schemaProp: r
3902
- }, a);
3903
- e.ok(a), e.mergeEvaluated(o);
3904
- });
3905
- }
3906
- };
3907
- })), ze = /* @__PURE__ */ g(((e) => {
3908
- Object.defineProperty(e, "__esModule", { value: !0 });
3909
- var t = k(), n = A(), r = {
3910
- keyword: "if",
3911
- schemaType: ["object", "boolean"],
3912
- trackErrors: !0,
3913
- error: {
3914
- message: ({ params: e }) => (0, t.str)`must match "${e.ifClause}" schema`,
3915
- params: ({ params: e }) => (0, t._)`{failingKeyword: ${e.ifClause}}`
3916
- },
3917
- code(e) {
3918
- let { gen: r, parentSchema: a, it: o } = e;
3919
- a.then === void 0 && a.else === void 0 && (0, n.checkStrictMode)(o, "\"if\" without \"then\" and \"else\" is ignored");
3920
- let s = i(o, "then"), c = i(o, "else");
3921
- if (!s && !c) return;
3922
- let l = r.let("valid", !0), u = r.name("_valid");
3923
- if (d(), e.reset(), s && c) {
3924
- let t = r.let("ifClause");
3925
- e.setParams({ ifClause: t }), r.if(u, f("then", t), f("else", t));
3926
- } else s ? r.if(u, f("then")) : r.if((0, t.not)(u), f("else"));
3927
- e.pass(l, () => e.error(!0));
3928
- function d() {
3929
- let t = e.subschema({
3930
- keyword: "if",
3931
- compositeRule: !0,
3932
- createErrors: !1,
3933
- allErrors: !1
3934
- }, u);
3935
- e.mergeEvaluated(t);
3936
- }
3937
- function f(n, i) {
3938
- return () => {
3939
- let a = e.subschema({ keyword: n }, u);
3940
- r.assign(l, u), e.mergeValidEvaluated(a, l), i ? r.assign(i, (0, t._)`${n}`) : e.setParams({ ifClause: n });
3941
- };
3942
- }
3943
- }
3944
- };
3945
- function i(e, t) {
3946
- let r = e.schema[t];
3947
- return r !== void 0 && !(0, n.alwaysValidSchema)(e, r);
3948
- }
3949
- e.default = r;
3950
- })), Be = /* @__PURE__ */ g(((e) => {
3951
- Object.defineProperty(e, "__esModule", { value: !0 });
3952
- var t = A();
3953
- e.default = {
3954
- keyword: ["then", "else"],
3955
- schemaType: ["object", "boolean"],
3956
- code({ keyword: e, parentSchema: n, it: r }) {
3957
- n.if === void 0 && (0, t.checkStrictMode)(r, `"${e}" without "if" is ignored`);
3958
- }
3959
- };
3960
- })), Ve = /* @__PURE__ */ g(((e) => {
3961
- Object.defineProperty(e, "__esModule", { value: !0 });
3962
- var t = Te(), n = De(), r = Ee(), i = Oe(), a = ke(), o = Ae(), s = je(), c = Me(), l = Ne(), u = Pe(), d = Fe(), f = Ie(), p = Le(), m = Re(), h = ze(), g = Be();
3963
- function _(e = !1) {
3964
- let _ = [
3965
- d.default,
3966
- f.default,
3967
- p.default,
3968
- m.default,
3969
- h.default,
3970
- g.default,
3971
- s.default,
3972
- c.default,
3973
- o.default,
3974
- l.default,
3975
- u.default
3976
- ];
3977
- return e ? _.push(n.default, i.default) : _.push(t.default, r.default), _.push(a.default), _;
3978
- }
3979
- e.default = _;
3980
- })), He = /* @__PURE__ */ g(((e) => {
3981
- Object.defineProperty(e, "__esModule", { value: !0 }), e.dynamicAnchor = void 0;
3982
- var t = k(), n = j(), r = W(), i = ue(), a = {
3983
- keyword: "$dynamicAnchor",
3984
- schemaType: "string",
3985
- code: (e) => o(e, e.schema)
3986
- };
3987
- function o(e, r) {
3988
- let { gen: i, it: a } = e;
3989
- a.schemaEnv.root.dynamicAnchors[r] = !0;
3990
- let o = (0, t._)`${n.default.dynamicAnchors}${(0, t.getProperty)(r)}`, c = a.errSchemaPath === "#" ? a.validateName : s(e);
3991
- i.if((0, t._)`!${o}`, () => i.assign(o, c));
3992
- }
3993
- e.dynamicAnchor = o;
3994
- function s(e) {
3995
- let { schemaEnv: t, schema: n, self: a } = e.it, { root: o, baseId: s, localRefs: c, meta: l } = t.root, { schemaId: u } = a.opts, d = new r.SchemaEnv({
3996
- schema: n,
3997
- schemaId: u,
3998
- root: o,
3999
- baseId: s,
4000
- localRefs: c,
4001
- meta: l
4002
- });
4003
- return r.compileSchema.call(a, d), (0, i.getValidate)(e, d);
4004
- }
4005
- e.default = a;
4006
- })), Ue = /* @__PURE__ */ g(((e) => {
4007
- Object.defineProperty(e, "__esModule", { value: !0 }), e.dynamicRef = void 0;
4008
- var t = k(), n = j(), r = ue(), i = {
4009
- keyword: "$dynamicRef",
4010
- schemaType: "string",
4011
- code: (e) => a(e, e.schema)
4012
- };
4013
- function a(e, i) {
4014
- let { gen: a, keyword: o, it: s } = e;
4015
- if (i[0] !== "#") throw Error(`"${o}" only supports hash fragment reference`);
4016
- let c = i.slice(1);
4017
- if (s.allErrors) l();
4018
- else {
4019
- let t = a.let("valid", !1);
4020
- l(t), e.ok(t);
4021
- }
4022
- function l(e) {
4023
- if (s.schemaEnv.root.dynamicAnchors[c]) {
4024
- let r = a.let("_v", (0, t._)`${n.default.dynamicAnchors}${(0, t.getProperty)(c)}`);
4025
- a.if(r, u(r, e), u(s.validateName, e));
4026
- } else u(s.validateName, e)();
4027
- }
4028
- function u(t, n) {
4029
- return n ? () => a.block(() => {
4030
- (0, r.callRef)(e, t), a.let(n, !0);
4031
- }) : () => (0, r.callRef)(e, t);
4032
- }
4033
- }
4034
- e.dynamicRef = a, e.default = i;
4035
- })), We = /* @__PURE__ */ g(((e) => {
4036
- Object.defineProperty(e, "__esModule", { value: !0 });
4037
- var t = He(), n = A();
4038
- e.default = {
4039
- keyword: "$recursiveAnchor",
4040
- schemaType: "boolean",
4041
- code(e) {
4042
- e.schema ? (0, t.dynamicAnchor)(e, "") : (0, n.checkStrictMode)(e.it, "$recursiveAnchor: false is ignored");
4043
- }
4044
- };
4045
- })), Ge = /* @__PURE__ */ g(((e) => {
4046
- Object.defineProperty(e, "__esModule", { value: !0 });
4047
- var t = Ue();
4048
- e.default = {
4049
- keyword: "$recursiveRef",
4050
- schemaType: "string",
4051
- code: (e) => (0, t.dynamicRef)(e, e.schema)
4052
- };
4053
- })), Ke = /* @__PURE__ */ g(((e) => {
4054
- Object.defineProperty(e, "__esModule", { value: !0 });
4055
- var t = He(), n = Ue(), r = We(), i = Ge();
4056
- e.default = [
4057
- t.default,
4058
- n.default,
4059
- r.default,
4060
- i.default
4061
- ];
4062
- })), qe = /* @__PURE__ */ g(((e) => {
4063
- Object.defineProperty(e, "__esModule", { value: !0 });
4064
- var t = Ae();
4065
- e.default = {
4066
- keyword: "dependentRequired",
4067
- type: "object",
4068
- schemaType: "object",
4069
- error: t.error,
4070
- code: (e) => (0, t.validatePropertyDeps)(e)
4071
- };
4072
- })), Je = /* @__PURE__ */ g(((e) => {
4073
- Object.defineProperty(e, "__esModule", { value: !0 });
4074
- var t = Ae();
4075
- e.default = {
4076
- keyword: "dependentSchemas",
4077
- type: "object",
4078
- schemaType: "object",
4079
- code: (e) => (0, t.validateSchemaDeps)(e)
4080
- };
4081
- })), Ye = /* @__PURE__ */ g(((e) => {
4082
- Object.defineProperty(e, "__esModule", { value: !0 });
4083
- var t = A();
4084
- e.default = {
4085
- keyword: ["maxContains", "minContains"],
4086
- type: "array",
4087
- schemaType: "number",
4088
- code({ keyword: e, parentSchema: n, it: r }) {
4089
- n.contains === void 0 && (0, t.checkStrictMode)(r, `"${e}" without "contains" is ignored`);
4090
- }
4091
- };
4092
- })), Xe = /* @__PURE__ */ g(((e) => {
4093
- Object.defineProperty(e, "__esModule", { value: !0 });
4094
- var t = qe(), n = Je(), r = Ye();
4095
- e.default = [
4096
- t.default,
4097
- n.default,
4098
- r.default
4099
- ];
4100
- })), Ze = /* @__PURE__ */ g(((e) => {
4101
- Object.defineProperty(e, "__esModule", { value: !0 });
4102
- var t = k(), n = A(), r = j();
4103
- e.default = {
4104
- keyword: "unevaluatedProperties",
4105
- type: "object",
4106
- schemaType: ["boolean", "object"],
4107
- trackErrors: !0,
4108
- error: {
4109
- message: "must NOT have unevaluated properties",
4110
- params: ({ params: e }) => (0, t._)`{unevaluatedProperty: ${e.unevaluatedProperty}}`
4111
- },
4112
- code(e) {
4113
- let { gen: i, schema: a, data: o, errsCount: s, it: c } = e;
4114
- /* istanbul ignore if */
4115
- if (!s) throw Error("ajv implementation error");
4116
- let { allErrors: l, props: u } = c;
4117
- u instanceof t.Name ? i.if((0, t._)`${u} !== true`, () => i.forIn("key", o, (e) => i.if(f(u, e), () => d(e)))) : u !== !0 && i.forIn("key", o, (e) => u === void 0 ? d(e) : i.if(p(u, e), () => d(e))), c.props = !0, e.ok((0, t._)`${s} === ${r.default.errors}`);
4118
- function d(r) {
4119
- if (a === !1) {
4120
- e.setParams({ unevaluatedProperty: r }), e.error(), l || i.break();
4121
- return;
4122
- }
4123
- if (!(0, n.alwaysValidSchema)(c, a)) {
4124
- let a = i.name("valid");
4125
- e.subschema({
4126
- keyword: "unevaluatedProperties",
4127
- dataProp: r,
4128
- dataPropType: n.Type.Str
4129
- }, a), l || i.if((0, t.not)(a), () => i.break());
4130
- }
4131
- }
4132
- function f(e, n) {
4133
- return (0, t._)`!${e} || !${e}[${n}]`;
4134
- }
4135
- function p(e, n) {
4136
- let r = [];
4137
- for (let i in e) e[i] === !0 && r.push((0, t._)`${n} !== ${i}`);
4138
- return (0, t.and)(...r);
4139
- }
4140
- }
4141
- };
4142
- })), Qe = /* @__PURE__ */ g(((e) => {
4143
- Object.defineProperty(e, "__esModule", { value: !0 });
4144
- var t = k(), n = A();
4145
- e.default = {
4146
- keyword: "unevaluatedItems",
4147
- type: "array",
4148
- schemaType: ["boolean", "object"],
4149
- error: {
4150
- message: ({ params: { len: e } }) => (0, t.str)`must NOT have more than ${e} items`,
4151
- params: ({ params: { len: e } }) => (0, t._)`{limit: ${e}}`
4152
- },
4153
- code(e) {
4154
- let { gen: r, schema: i, data: a, it: o } = e, s = o.items || 0;
4155
- if (s === !0) return;
4156
- let c = r.const("len", (0, t._)`${a}.length`);
4157
- if (i === !1) e.setParams({ len: s }), e.fail((0, t._)`${c} > ${s}`);
4158
- else if (typeof i == "object" && !(0, n.alwaysValidSchema)(o, i)) {
4159
- let n = r.var("valid", (0, t._)`${c} <= ${s}`);
4160
- r.if((0, t.not)(n), () => l(n, s)), e.ok(n);
4161
- }
4162
- o.items = !0;
4163
- function l(i, a) {
4164
- r.forRange("i", a, c, (a) => {
4165
- e.subschema({
4166
- keyword: "unevaluatedItems",
4167
- dataProp: a,
4168
- dataPropType: n.Type.Num
4169
- }, i), o.allErrors || r.if((0, t.not)(i), () => r.break());
4170
- });
4171
- }
4172
- }
4173
- };
4174
- })), $e = /* @__PURE__ */ g(((e) => {
4175
- Object.defineProperty(e, "__esModule", { value: !0 });
4176
- var t = Ze(), n = Qe();
4177
- e.default = [t.default, n.default];
4178
- })), et = /* @__PURE__ */ g(((e) => {
4179
- Object.defineProperty(e, "__esModule", { value: !0 });
4180
- var t = k();
4181
- e.default = {
4182
- keyword: "format",
4183
- type: ["number", "string"],
4184
- schemaType: "string",
4185
- $data: !0,
4186
- error: {
4187
- message: ({ schemaCode: e }) => (0, t.str)`must match format "${e}"`,
4188
- params: ({ schemaCode: e }) => (0, t._)`{format: ${e}}`
4189
- },
4190
- code(e, n) {
4191
- let { gen: r, data: i, $data: a, schema: o, schemaCode: s, it: c } = e, { opts: l, errSchemaPath: u, schemaEnv: d, self: f } = c;
4192
- if (!l.validateFormats) return;
4193
- a ? p() : m();
4194
- function p() {
4195
- let a = r.scopeValue("formats", {
4196
- ref: f.formats,
4197
- code: l.code.formats
4198
- }), o = r.const("fDef", (0, t._)`${a}[${s}]`), c = r.let("fType"), u = r.let("format");
4199
- r.if((0, t._)`typeof ${o} == "object" && !(${o} instanceof RegExp)`, () => r.assign(c, (0, t._)`${o}.type || "string"`).assign(u, (0, t._)`${o}.validate`), () => r.assign(c, (0, t._)`"string"`).assign(u, o)), e.fail$data((0, t.or)(p(), m()));
4200
- function p() {
4201
- return l.strictSchema === !1 ? t.nil : (0, t._)`${s} && !${u}`;
4202
- }
4203
- function m() {
4204
- let e = d.$async ? (0, t._)`(${o}.async ? await ${u}(${i}) : ${u}(${i}))` : (0, t._)`${u}(${i})`, r = (0, t._)`(typeof ${u} == "function" ? ${e} : ${u}.test(${i}))`;
4205
- return (0, t._)`${u} && ${u} !== true && ${c} === ${n} && !${r}`;
4206
- }
4207
- }
4208
- function m() {
4209
- let a = f.formats[o];
4210
- if (!a) {
4211
- m();
4212
- return;
4213
- }
4214
- if (a === !0) return;
4215
- let [s, c, p] = h(a);
4216
- s === n && e.pass(g());
4217
- function m() {
4218
- if (l.strictSchema === !1) {
4219
- f.logger.warn(e());
4220
- return;
4221
- }
4222
- throw Error(e());
4223
- function e() {
4224
- return `unknown format "${o}" ignored in schema at path "${u}"`;
4225
- }
4226
- }
4227
- function h(e) {
4228
- let n = e instanceof RegExp ? (0, t.regexpCode)(e) : l.code.formats ? (0, t._)`${l.code.formats}${(0, t.getProperty)(o)}` : void 0, i = r.scopeValue("formats", {
4229
- key: o,
4230
- ref: e,
4231
- code: n
4232
- });
4233
- return typeof e == "object" && !(e instanceof RegExp) ? [
4234
- e.type || "string",
4235
- e.validate,
4236
- (0, t._)`${i}.validate`
4237
- ] : [
4238
- "string",
4239
- e,
4240
- i
4241
- ];
4242
- }
4243
- function g() {
4244
- if (typeof a == "object" && !(a instanceof RegExp) && a.async) {
4245
- if (!d.$async) throw Error("async format in sync schema");
4246
- return (0, t._)`await ${p}(${i})`;
4247
- }
4248
- return typeof c == "function" ? (0, t._)`${p}(${i})` : (0, t._)`${p}.test(${i})`;
4249
- }
4250
- }
4251
- }
4252
- };
4253
- })), tt = /* @__PURE__ */ g(((e) => {
4254
- Object.defineProperty(e, "__esModule", { value: !0 }), e.default = [et().default];
4255
- })), nt = /* @__PURE__ */ g(((e) => {
4256
- Object.defineProperty(e, "__esModule", { value: !0 }), e.contentVocabulary = e.metadataVocabulary = void 0, e.metadataVocabulary = [
4257
- "title",
4258
- "description",
4259
- "default",
4260
- "deprecated",
4261
- "readOnly",
4262
- "writeOnly",
4263
- "examples"
4264
- ], e.contentVocabulary = [
4265
- "contentMediaType",
4266
- "contentEncoding",
4267
- "contentSchema"
4268
- ];
4269
- })), rt = /* @__PURE__ */ g(((e) => {
4270
- Object.defineProperty(e, "__esModule", { value: !0 });
4271
- var t = de(), n = we(), r = Ve(), i = Ke(), a = Xe(), o = $e(), s = tt(), c = nt();
4272
- e.default = [
4273
- i.default,
4274
- t.default,
4275
- n.default,
4276
- (0, r.default)(!0),
4277
- s.default,
4278
- c.metadataVocabulary,
4279
- c.contentVocabulary,
4280
- a.default,
4281
- o.default
4282
- ];
4283
- })), it = /* @__PURE__ */ g(((e) => {
4284
- Object.defineProperty(e, "__esModule", { value: !0 }), e.DiscrError = void 0;
4285
- var t;
4286
- (function(e) {
4287
- e.Tag = "tag", e.Mapping = "mapping";
4288
- })(t || (e.DiscrError = t = {}));
4289
- })), at = /* @__PURE__ */ g(((e) => {
4290
- Object.defineProperty(e, "__esModule", { value: !0 });
4291
- var t = k(), n = it(), r = W(), i = U(), a = A();
4292
- e.default = {
4293
- keyword: "discriminator",
4294
- type: "object",
4295
- schemaType: "object",
4296
- error: {
4297
- message: ({ params: { discrError: e, tagName: t } }) => e === n.DiscrError.Tag ? `tag "${t}" must be string` : `value of tag "${t}" must be in oneOf`,
4298
- params: ({ params: { discrError: e, tag: n, tagName: r } }) => (0, t._)`{error: ${e}, tag: ${r}, tagValue: ${n}}`
4299
- },
4300
- code(e) {
4301
- let { gen: o, data: s, schema: c, parentSchema: l, it: u } = e, { oneOf: d } = l;
4302
- if (!u.opts.discriminator) throw Error("discriminator: requires discriminator option");
4303
- let f = c.propertyName;
4304
- if (typeof f != "string") throw Error("discriminator: requires propertyName");
4305
- if (c.mapping) throw Error("discriminator: mapping is not supported");
4306
- if (!d) throw Error("discriminator: requires oneOf keyword");
4307
- let p = o.let("valid", !1), m = o.const("tag", (0, t._)`${s}${(0, t.getProperty)(f)}`);
4308
- o.if((0, t._)`typeof ${m} == "string"`, () => h(), () => e.error(!1, {
4309
- discrError: n.DiscrError.Tag,
4310
- tag: m,
4311
- tagName: f
4312
- })), e.ok(p);
4313
- function h() {
4314
- let r = _();
4315
- o.if(!1);
4316
- for (let e in r) o.elseIf((0, t._)`${m} === ${e}`), o.assign(p, g(r[e]));
4317
- o.else(), e.error(!1, {
4318
- discrError: n.DiscrError.Mapping,
4319
- tag: m,
4320
- tagName: f
4321
- }), o.endIf();
4322
- }
4323
- function g(n) {
4324
- let r = o.name("valid"), i = e.subschema({
4325
- keyword: "oneOf",
4326
- schemaProp: n
4327
- }, r);
4328
- return e.mergeEvaluated(i, t.Name), r;
4329
- }
4330
- function _() {
4331
- let e = {}, t = o(l), n = !0;
4332
- for (let e = 0; e < d.length; e++) {
4333
- let c = d[e];
4334
- if (c?.$ref && !(0, a.schemaHasRulesButRef)(c, u.self.RULES)) {
4335
- let e = c.$ref;
4336
- if (c = r.resolveRef.call(u.self, u.schemaEnv.root, u.baseId, e), c instanceof r.SchemaEnv && (c = c.schema), c === void 0) throw new i.default(u.opts.uriResolver, u.baseId, e);
4337
- }
4338
- let l = c?.properties?.[f];
4339
- if (typeof l != "object") throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);
4340
- n &&= t || o(c), s(l, e);
4341
- }
4342
- if (!n) throw Error(`discriminator: "${f}" must be required`);
4343
- return e;
4344
- function o({ required: e }) {
4345
- return Array.isArray(e) && e.includes(f);
4346
- }
4347
- function s(e, t) {
4348
- if (e.const) c(e.const, t);
4349
- else if (e.enum) for (let n of e.enum) c(n, t);
4350
- else throw Error(`discriminator: "properties/${f}" must have "const" or "enum"`);
4351
- }
4352
- function c(t, n) {
4353
- if (typeof t != "string" || t in e) throw Error(`discriminator: "${f}" values must be unique strings`);
4354
- e[t] = n;
4355
- }
4356
- }
4357
- }
4358
- };
4359
- })), ot = /* @__PURE__ */ _({
4360
- $comment: () => mt,
4361
- $dynamicAnchor: () => ut,
4362
- $id: () => ct,
4363
- $schema: () => st,
4364
- $vocabulary: () => lt,
4365
- allOf: () => ft,
4366
- default: () => gt,
4367
- properties: () => ht,
4368
- title: () => dt,
4369
- type: () => pt
4370
- }), st, ct, lt, ut, dt, ft, pt, mt, ht, gt, _t = h((() => {
4371
- st = "https://json-schema.org/draft/2020-12/schema", ct = "https://json-schema.org/draft/2020-12/schema", lt = {
4372
- "https://json-schema.org/draft/2020-12/vocab/core": !0,
4373
- "https://json-schema.org/draft/2020-12/vocab/applicator": !0,
4374
- "https://json-schema.org/draft/2020-12/vocab/unevaluated": !0,
4375
- "https://json-schema.org/draft/2020-12/vocab/validation": !0,
4376
- "https://json-schema.org/draft/2020-12/vocab/meta-data": !0,
4377
- "https://json-schema.org/draft/2020-12/vocab/format-annotation": !0,
4378
- "https://json-schema.org/draft/2020-12/vocab/content": !0
4379
- }, ut = "meta", dt = "Core and Validation specifications meta-schema", ft = [
4380
- { $ref: "meta/core" },
4381
- { $ref: "meta/applicator" },
4382
- { $ref: "meta/unevaluated" },
4383
- { $ref: "meta/validation" },
4384
- { $ref: "meta/meta-data" },
4385
- { $ref: "meta/format-annotation" },
4386
- { $ref: "meta/content" }
4387
- ], pt = ["object", "boolean"], mt = "This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.", ht = {
4388
- definitions: {
4389
- $comment: "\"definitions\" has been replaced by \"$defs\".",
4390
- type: "object",
4391
- additionalProperties: { $dynamicRef: "#meta" },
4392
- deprecated: !0,
4393
- default: {}
4394
- },
4395
- dependencies: {
4396
- $comment: "\"dependencies\" has been split and replaced by \"dependentSchemas\" and \"dependentRequired\" in order to serve their differing semantics.",
4397
- type: "object",
4398
- additionalProperties: { anyOf: [{ $dynamicRef: "#meta" }, { $ref: "meta/validation#/$defs/stringArray" }] },
4399
- deprecated: !0,
4400
- default: {}
4401
- },
4402
- $recursiveAnchor: {
4403
- $comment: "\"$recursiveAnchor\" has been replaced by \"$dynamicAnchor\".",
4404
- $ref: "meta/core#/$defs/anchorString",
4405
- deprecated: !0
4406
- },
4407
- $recursiveRef: {
4408
- $comment: "\"$recursiveRef\" has been replaced by \"$dynamicRef\".",
4409
- $ref: "meta/core#/$defs/uriReferenceString",
4410
- deprecated: !0
4411
- }
4412
- }, gt = {
4413
- $schema: st,
4414
- $id: ct,
4415
- $vocabulary: lt,
4416
- $dynamicAnchor: ut,
4417
- title: dt,
4418
- allOf: ft,
4419
- type: pt,
4420
- $comment: mt,
4421
- properties: ht
4422
- };
4423
- })), vt = /* @__PURE__ */ _({
4424
- $defs: () => Et,
4425
- $dynamicAnchor: () => St,
4426
- $id: () => bt,
4427
- $schema: () => yt,
4428
- $vocabulary: () => xt,
4429
- default: () => Dt,
4430
- properties: () => Tt,
4431
- title: () => Ct,
4432
- type: () => wt
4433
- }), yt, bt, xt, St, Ct, wt, Tt, Et, Dt, Ot = h((() => {
4434
- yt = "https://json-schema.org/draft/2020-12/schema", bt = "https://json-schema.org/draft/2020-12/meta/applicator", xt = { "https://json-schema.org/draft/2020-12/vocab/applicator": !0 }, St = "meta", Ct = "Applicator vocabulary meta-schema", wt = ["object", "boolean"], Tt = {
4435
- prefixItems: { $ref: "#/$defs/schemaArray" },
4436
- items: { $dynamicRef: "#meta" },
4437
- contains: { $dynamicRef: "#meta" },
4438
- additionalProperties: { $dynamicRef: "#meta" },
4439
- properties: {
4440
- type: "object",
4441
- additionalProperties: { $dynamicRef: "#meta" },
4442
- default: {}
4443
- },
4444
- patternProperties: {
4445
- type: "object",
4446
- additionalProperties: { $dynamicRef: "#meta" },
4447
- propertyNames: { format: "regex" },
4448
- default: {}
4449
- },
4450
- dependentSchemas: {
4451
- type: "object",
4452
- additionalProperties: { $dynamicRef: "#meta" },
4453
- default: {}
4454
- },
4455
- propertyNames: { $dynamicRef: "#meta" },
4456
- if: { $dynamicRef: "#meta" },
4457
- then: { $dynamicRef: "#meta" },
4458
- else: { $dynamicRef: "#meta" },
4459
- allOf: { $ref: "#/$defs/schemaArray" },
4460
- anyOf: { $ref: "#/$defs/schemaArray" },
4461
- oneOf: { $ref: "#/$defs/schemaArray" },
4462
- not: { $dynamicRef: "#meta" }
4463
- }, Et = { schemaArray: {
4464
- type: "array",
4465
- minItems: 1,
4466
- items: { $dynamicRef: "#meta" }
4467
- } }, Dt = {
4468
- $schema: yt,
4469
- $id: bt,
4470
- $vocabulary: xt,
4471
- $dynamicAnchor: St,
4472
- title: Ct,
4473
- type: wt,
4474
- properties: Tt,
4475
- $defs: Et
4476
- };
4477
- })), kt = /* @__PURE__ */ _({
4478
- $dynamicAnchor: () => Nt,
4479
- $id: () => jt,
4480
- $schema: () => At,
4481
- $vocabulary: () => Mt,
4482
- default: () => Lt,
4483
- properties: () => It,
4484
- title: () => Pt,
4485
- type: () => Ft
4486
- }), At, jt, Mt, Nt, Pt, Ft, It, Lt, Rt = h((() => {
4487
- At = "https://json-schema.org/draft/2020-12/schema", jt = "https://json-schema.org/draft/2020-12/meta/unevaluated", Mt = { "https://json-schema.org/draft/2020-12/vocab/unevaluated": !0 }, Nt = "meta", Pt = "Unevaluated applicator vocabulary meta-schema", Ft = ["object", "boolean"], It = {
4488
- unevaluatedItems: { $dynamicRef: "#meta" },
4489
- unevaluatedProperties: { $dynamicRef: "#meta" }
4490
- }, Lt = {
4491
- $schema: At,
4492
- $id: jt,
4493
- $vocabulary: Mt,
4494
- $dynamicAnchor: Nt,
4495
- title: Pt,
4496
- type: Ft,
4497
- properties: It
4498
- };
4499
- })), zt = /* @__PURE__ */ _({
4500
- $dynamicAnchor: () => Ut,
4501
- $id: () => Vt,
4502
- $schema: () => Bt,
4503
- $vocabulary: () => Ht,
4504
- default: () => qt,
4505
- properties: () => Kt,
4506
- title: () => Wt,
4507
- type: () => Gt
4508
- }), Bt, Vt, Ht, Ut, Wt, Gt, Kt, qt, Jt = h((() => {
4509
- Bt = "https://json-schema.org/draft/2020-12/schema", Vt = "https://json-schema.org/draft/2020-12/meta/content", Ht = { "https://json-schema.org/draft/2020-12/vocab/content": !0 }, Ut = "meta", Wt = "Content vocabulary meta-schema", Gt = ["object", "boolean"], Kt = {
4510
- contentEncoding: { type: "string" },
4511
- contentMediaType: { type: "string" },
4512
- contentSchema: { $dynamicRef: "#meta" }
4513
- }, qt = {
4514
- $schema: Bt,
4515
- $id: Vt,
4516
- $vocabulary: Ht,
4517
- $dynamicAnchor: Ut,
4518
- title: Wt,
4519
- type: Gt,
4520
- properties: Kt
4521
- };
4522
- })), Yt = /* @__PURE__ */ _({
4523
- $defs: () => rn,
4524
- $dynamicAnchor: () => $t,
4525
- $id: () => Zt,
4526
- $schema: () => Xt,
4527
- $vocabulary: () => Qt,
4528
- default: () => an,
4529
- properties: () => nn,
4530
- title: () => en,
4531
- type: () => tn
4532
- }), Xt, Zt, Qt, $t, en, tn, nn, rn, an, on = h((() => {
4533
- Xt = "https://json-schema.org/draft/2020-12/schema", Zt = "https://json-schema.org/draft/2020-12/meta/core", Qt = { "https://json-schema.org/draft/2020-12/vocab/core": !0 }, $t = "meta", en = "Core vocabulary meta-schema", tn = ["object", "boolean"], nn = {
4534
- $id: {
4535
- $ref: "#/$defs/uriReferenceString",
4536
- $comment: "Non-empty fragments not allowed.",
4537
- pattern: "^[^#]*#?$"
4538
- },
4539
- $schema: { $ref: "#/$defs/uriString" },
4540
- $ref: { $ref: "#/$defs/uriReferenceString" },
4541
- $anchor: { $ref: "#/$defs/anchorString" },
4542
- $dynamicRef: { $ref: "#/$defs/uriReferenceString" },
4543
- $dynamicAnchor: { $ref: "#/$defs/anchorString" },
4544
- $vocabulary: {
4545
- type: "object",
4546
- propertyNames: { $ref: "#/$defs/uriString" },
4547
- additionalProperties: { type: "boolean" }
4548
- },
4549
- $comment: { type: "string" },
4550
- $defs: {
4551
- type: "object",
4552
- additionalProperties: { $dynamicRef: "#meta" }
4553
- }
4554
- }, rn = {
4555
- anchorString: {
4556
- type: "string",
4557
- pattern: "^[A-Za-z_][-A-Za-z0-9._]*$"
4558
- },
4559
- uriString: {
4560
- type: "string",
4561
- format: "uri"
4562
- },
4563
- uriReferenceString: {
4564
- type: "string",
4565
- format: "uri-reference"
4566
- }
4567
- }, an = {
4568
- $schema: Xt,
4569
- $id: Zt,
4570
- $vocabulary: Qt,
4571
- $dynamicAnchor: $t,
4572
- title: en,
4573
- type: tn,
4574
- properties: nn,
4575
- $defs: rn
4576
- };
4577
- })), sn = /* @__PURE__ */ _({
4578
- $dynamicAnchor: () => dn,
4579
- $id: () => ln,
4580
- $schema: () => cn,
4581
- $vocabulary: () => un,
4582
- default: () => hn,
4583
- properties: () => mn,
4584
- title: () => fn,
4585
- type: () => pn
4586
- }), cn, ln, un, dn, fn, pn, mn, hn, gn = h((() => {
4587
- cn = "https://json-schema.org/draft/2020-12/schema", ln = "https://json-schema.org/draft/2020-12/meta/format-annotation", un = { "https://json-schema.org/draft/2020-12/vocab/format-annotation": !0 }, dn = "meta", fn = "Format vocabulary meta-schema for annotation results", pn = ["object", "boolean"], mn = { format: { type: "string" } }, hn = {
4588
- $schema: cn,
4589
- $id: ln,
4590
- $vocabulary: un,
4591
- $dynamicAnchor: dn,
4592
- title: fn,
4593
- type: pn,
4594
- properties: mn
4595
- };
4596
- })), _n = /* @__PURE__ */ _({
4597
- $dynamicAnchor: () => xn,
4598
- $id: () => yn,
4599
- $schema: () => vn,
4600
- $vocabulary: () => bn,
4601
- default: () => Tn,
4602
- properties: () => wn,
4603
- title: () => Sn,
4604
- type: () => Cn
4605
- }), vn, yn, bn, xn, Sn, Cn, wn, Tn, En = h((() => {
4606
- vn = "https://json-schema.org/draft/2020-12/schema", yn = "https://json-schema.org/draft/2020-12/meta/meta-data", bn = { "https://json-schema.org/draft/2020-12/vocab/meta-data": !0 }, xn = "meta", Sn = "Meta-data vocabulary meta-schema", Cn = ["object", "boolean"], wn = {
4607
- title: { type: "string" },
4608
- description: { type: "string" },
4609
- default: !0,
4610
- deprecated: {
4611
- type: "boolean",
4612
- default: !1
4613
- },
4614
- readOnly: {
4615
- type: "boolean",
4616
- default: !1
4617
- },
4618
- writeOnly: {
4619
- type: "boolean",
4620
- default: !1
4621
- },
4622
- examples: {
4623
- type: "array",
4624
- items: !0
4625
- }
4626
- }, Tn = {
4627
- $schema: vn,
4628
- $id: yn,
4629
- $vocabulary: bn,
4630
- $dynamicAnchor: xn,
4631
- title: Sn,
4632
- type: Cn,
4633
- properties: wn
4634
- };
4635
- })), Dn = /* @__PURE__ */ _({
4636
- $defs: () => Pn,
4637
- $dynamicAnchor: () => An,
4638
- $id: () => kn,
4639
- $schema: () => On,
4640
- $vocabulary: () => Q,
4641
- default: () => Fn,
4642
- properties: () => Nn,
4643
- title: () => jn,
4644
- type: () => Mn
4645
- }), On, kn, Q, An, jn, Mn, Nn, Pn, Fn, In = h((() => {
4646
- On = "https://json-schema.org/draft/2020-12/schema", kn = "https://json-schema.org/draft/2020-12/meta/validation", Q = { "https://json-schema.org/draft/2020-12/vocab/validation": !0 }, An = "meta", jn = "Validation vocabulary meta-schema", Mn = ["object", "boolean"], Nn = {
4647
- type: { anyOf: [{ $ref: "#/$defs/simpleTypes" }, {
4648
- type: "array",
4649
- items: { $ref: "#/$defs/simpleTypes" },
4650
- minItems: 1,
4651
- uniqueItems: !0
4652
- }] },
4653
- const: !0,
4654
- enum: {
4655
- type: "array",
4656
- items: !0
4657
- },
4658
- multipleOf: {
4659
- type: "number",
4660
- exclusiveMinimum: 0
4661
- },
4662
- maximum: { type: "number" },
4663
- exclusiveMaximum: { type: "number" },
4664
- minimum: { type: "number" },
4665
- exclusiveMinimum: { type: "number" },
4666
- maxLength: { $ref: "#/$defs/nonNegativeInteger" },
4667
- minLength: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
4668
- pattern: {
4669
- type: "string",
4670
- format: "regex"
4671
- },
4672
- maxItems: { $ref: "#/$defs/nonNegativeInteger" },
4673
- minItems: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
4674
- uniqueItems: {
4675
- type: "boolean",
4676
- default: !1
4677
- },
4678
- maxContains: { $ref: "#/$defs/nonNegativeInteger" },
4679
- minContains: {
4680
- $ref: "#/$defs/nonNegativeInteger",
4681
- default: 1
4682
- },
4683
- maxProperties: { $ref: "#/$defs/nonNegativeInteger" },
4684
- minProperties: { $ref: "#/$defs/nonNegativeIntegerDefault0" },
4685
- required: { $ref: "#/$defs/stringArray" },
4686
- dependentRequired: {
4687
- type: "object",
4688
- additionalProperties: { $ref: "#/$defs/stringArray" }
4689
- }
4690
- }, Pn = {
4691
- nonNegativeInteger: {
4692
- type: "integer",
4693
- minimum: 0
4694
- },
4695
- nonNegativeIntegerDefault0: {
4696
- $ref: "#/$defs/nonNegativeInteger",
4697
- default: 0
4698
- },
4699
- simpleTypes: { enum: [
4700
- "array",
4701
- "boolean",
4702
- "integer",
4703
- "null",
4704
- "number",
4705
- "object",
4706
- "string"
4707
- ] },
4708
- stringArray: {
4709
- type: "array",
4710
- items: { type: "string" },
4711
- uniqueItems: !0,
4712
- default: []
4713
- }
4714
- }, Fn = {
4715
- $schema: On,
4716
- $id: kn,
4717
- $vocabulary: Q,
4718
- $dynamicAnchor: An,
4719
- title: jn,
4720
- type: Mn,
4721
- properties: Nn,
4722
- $defs: Pn
4723
- };
4724
- })), Ln = /* @__PURE__ */ g(((e) => {
4725
- Object.defineProperty(e, "__esModule", { value: !0 });
4726
- var t = (_t(), y(ot).default), n = (Ot(), y(vt).default), r = (Rt(), y(kt).default), i = (Jt(), y(zt).default), a = (on(), y(Yt).default), o = (gn(), y(sn).default), s = (En(), y(_n).default), c = (In(), y(Dn).default), l = ["/properties"];
4727
- function u(e) {
4728
- return [
4729
- t,
4730
- n,
4731
- r,
4732
- i,
4733
- a,
4734
- u(this, o),
4735
- s,
4736
- u(this, c)
4737
- ].forEach((e) => this.addMetaSchema(e, void 0, !1)), this;
4738
- function u(t, n) {
4739
- return e ? t.$dataMetaSchema(n, l) : n;
4740
- }
4741
- }
4742
- e.default = u;
4743
- })), Rn = /* @__PURE__ */ g(((e, t) => {
4744
- Object.defineProperty(e, "__esModule", { value: !0 }), e.MissingRefError = e.ValidationError = e.CodeGen = e.Name = e.nil = e.stringify = e.str = e._ = e.KeywordCxt = e.Ajv2020 = void 0;
4745
- var n = ce(), r = rt(), i = at(), a = Ln(), o = "https://json-schema.org/draft/2020-12/schema", s = class extends n.default {
4746
- constructor(e = {}) {
4747
- super({
4748
- ...e,
4749
- dynamicRef: !0,
4750
- next: !0,
4751
- unevaluated: !0
4752
- });
4753
- }
4754
- _addVocabularies() {
4755
- super._addVocabularies(), r.default.forEach((e) => this.addVocabulary(e)), this.opts.discriminator && this.addKeyword(i.default);
4756
- }
4757
- _addDefaultMetaSchema() {
4758
- super._addDefaultMetaSchema();
4759
- let { $data: e, meta: t } = this.opts;
4760
- t && (a.default.call(this, e), this.refs["http://json-schema.org/schema"] = o);
4761
- }
4762
- defaultMeta() {
4763
- return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(o) ? o : void 0);
4764
- }
4765
- };
4766
- e.Ajv2020 = s, t.exports = e = s, t.exports.Ajv2020 = s, Object.defineProperty(e, "__esModule", { value: !0 }), e.default = s;
4767
- var c = V();
4768
- Object.defineProperty(e, "KeywordCxt", {
4769
- enumerable: !0,
4770
- get: function() {
4771
- return c.KeywordCxt;
4772
- }
4773
- });
4774
- var l = k();
4775
- Object.defineProperty(e, "_", {
4776
- enumerable: !0,
4777
- get: function() {
4778
- return l._;
4779
- }
4780
- }), Object.defineProperty(e, "str", {
4781
- enumerable: !0,
4782
- get: function() {
4783
- return l.str;
4784
- }
4785
- }), Object.defineProperty(e, "stringify", {
4786
- enumerable: !0,
4787
- get: function() {
4788
- return l.stringify;
4789
- }
4790
- }), Object.defineProperty(e, "nil", {
4791
- enumerable: !0,
4792
- get: function() {
4793
- return l.nil;
4794
- }
4795
- }), Object.defineProperty(e, "Name", {
4796
- enumerable: !0,
4797
- get: function() {
4798
- return l.Name;
4799
- }
4800
- }), Object.defineProperty(e, "CodeGen", {
4801
- enumerable: !0,
4802
- get: function() {
4803
- return l.CodeGen;
4804
- }
4805
- });
4806
- var u = H();
4807
- Object.defineProperty(e, "ValidationError", {
4808
- enumerable: !0,
4809
- get: function() {
4810
- return u.default;
4811
- }
4812
- });
4813
- var d = U();
4814
- Object.defineProperty(e, "MissingRefError", {
4815
- enumerable: !0,
4816
- get: function() {
4817
- return d.default;
4818
- }
4819
- });
4820
- })), zn = Rn(), Bn = /* @__PURE__ */ new Map();
4821
- function Vn(e) {
4822
- let t = Bn.get(e);
4823
- if (t) return t;
4824
- let n = new zn.Ajv2020({
4825
- allErrors: !0,
4826
- strict: !1
4827
- }).compile(C(e));
4828
- return Bn.set(e, n), n;
4829
- }
4830
- function Hn(e) {
4831
- return (e ?? []).map((e) => `${e.instancePath === "" ? "<root>" : e.instancePath}: ${e.message ?? "invalid"}`);
4832
- }
4833
- function Un(e, t) {
4834
- let n = Vn(e);
4835
- if (n(t)) return {
4836
- ok: !0,
4837
- value: t
4838
- };
4839
- let r = Hn(n.errors);
4840
- return {
4841
- ok: !1,
4842
- error: {
4843
- kind: "contract-violation",
4844
- schema: e,
4845
- errors: r,
4846
- message: `the quire payload does not satisfy the published ${e} contract (${r.length} error${r.length === 1 ? "" : "s"}). This is a shape drift between the quire release in use and the contract quoin pins, not a defect in the document being read.`
4847
- }
4848
- };
4849
- }
4850
- function Wn(e) {
4851
- return Un("coverage-v1.schema.json", e);
4852
- }
4853
- function Gn(e) {
4854
- return Un("properties-v1.schema.json", e);
4855
- }
4856
- function Kn(e) {
4857
- return Un("assurance-v1.schema.json", e);
4858
- }
4859
- function qn(e) {
4860
- return Xn(e, "coverage-v1.schema.json", Wn);
4861
- }
4862
- function Jn(e) {
4863
- return Xn(e, "properties-v1.schema.json", Gn);
4864
- }
4865
- function Yn(e) {
4866
- return Xn(e, "assurance-v1.schema.json", Kn);
4867
- }
4868
- function Xn(e, t, n) {
4869
- let r;
4870
- try {
4871
- r = JSON.parse(e);
4872
- } catch (e) {
4873
- return {
4874
- ok: !1,
4875
- error: {
4876
- kind: "contract-violation",
4877
- schema: t,
4878
- errors: [`<root>: ${e instanceof Error ? e.message : String(e)}`],
4879
- message: `the quire output is not valid JSON, so the ${t} contract could not be checked. Run the command directly to see what it emitted — a diagnostic on stdout rather than stderr is the usual cause.`
4880
- }
4881
- };
4882
- }
4883
- return n(r);
4884
- }
4885
- //#endregion
4886
- //#region src/quire/exec.ts
4887
- var $ = 67108864;
4888
- function Zn() {
4889
- let e = process.env.QUOIN_QUIRE, t = e ? Qn(e) : $n("quire"), n = process.env.QUOIN_EXPECTED_QUIRE_SHA256;
4890
- if (n) {
4891
- if (!/^sha256:[0-9a-f]{64}$/.test(n)) throw Error("QUOIN_EXPECTED_QUIRE_SHA256 must be a full lowercase sha256 digest");
4892
- let e = `sha256:${l("sha256").update(r(t)).digest("hex")}`;
4893
- if (e !== n) throw Error(`quire executable digest mismatch: expected ${n}, observed ${e} at ${t}`);
4894
- }
4895
- return t;
4896
- }
4897
- function Qn(e) {
4898
- if (!s(e)) throw Error(`QUOIN_QUIRE must be an absolute path, got ${e}`);
4899
- try {
4900
- return t(e, n.X_OK), i(e);
4901
- } catch {
4902
- throw Error(`QUOIN_QUIRE is not an executable file: ${e}`);
4903
- }
4904
- }
4905
- function $n(e) {
4906
- let r = process.platform === "win32" ? (process.env.PATHEXT ?? ".EXE;.CMD;.BAT").split(";") : [""];
4907
- for (let o of (process.env.PATH ?? "").split(a)) if (o) for (let a of r) {
4908
- let r = c(o, `${e}${a}`);
4909
- try {
4910
- return t(r, n.X_OK), i(r);
4911
- } catch {}
4912
- }
4913
- throw Object.assign(/* @__PURE__ */ Error(`${e} is not executable on PATH`), { code: "ENOENT" });
4914
- }
4915
- function er(e) {
4916
- try {
4917
- return u(Zn(), e, {
4918
- encoding: "utf8",
4919
- stdio: [
4920
- "ignore",
4921
- "pipe",
4922
- "pipe"
4923
- ],
4924
- maxBuffer: $
4925
- });
4926
- } catch (t) {
4927
- let n = t;
4928
- if (n.status == null) throw n.code === "ENOBUFS" ? Error(`quire ${e.join(" ")} produced more than ${$} bytes on one stream and was killed (ENOBUFS). The payload has outgrown QUIRE_MAX_BUFFER; raise it in src/quire/exec.ts.`) : n.signal ? Error(`quire ${e.join(" ")} was killed by ${n.signal} before it could exit.`) : Error(`quire ${e.join(" ")} could not be run (${String(n.code)}).`);
4929
- let r = String(n.stderr ?? "").trim();
4930
- throw Error(`quire ${e.join(" ")} exited ${n.status}` + (r ? `:\n${r}` : " with no diagnostic on stderr."));
4931
- }
4932
- }
4933
- function tr(e) {
4934
- try {
4935
- return {
4936
- stdout: u(Zn(), e, {
4937
- encoding: "utf8",
4938
- stdio: [
4939
- "ignore",
4940
- "pipe",
4941
- "pipe"
4942
- ],
4943
- maxBuffer: $
4944
- }),
4945
- stderr: "",
4946
- ok: !0
4947
- };
4948
- } catch (e) {
4949
- let t = e;
4950
- return {
4951
- stdout: String(t.stdout ?? ""),
4952
- stderr: String(t.stderr ?? "").trim(),
4953
- ok: !1
4954
- };
4955
- }
4956
- }
4957
- function nr() {
4958
- try {
4959
- return u(Zn(), ["--version"], {
4960
- encoding: "utf8",
4961
- maxBuffer: $
4962
- });
4963
- } catch {
4964
- return null;
4965
- }
4966
- }
4967
- //#endregion
4968
- export { qn as a, Rn as c, Yn as i, E as l, er as n, Jn as o, tr as r, Kn as s, nr as t };