reactive-md 0.9.1 → 0.9.3

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 (428) hide show
  1. package/CHANGELOG-ch.md +44 -0
  2. package/CHANGELOG.md +44 -0
  3. package/README-ch.md +7 -7
  4. package/README-en.md +6 -6
  5. package/README.md +7 -7
  6. package/cli/init.mjs +1 -1
  7. package/dist-library/LocalDocumentView-D6zQkTkt.js +112 -0
  8. package/dist-library/{LocalDocumentViewCore-GiWV3bey.js → LocalDocumentViewCore-CmJhemcA.js} +387 -9471
  9. package/dist-library/LocalReactiveDocumentCore-lAKOGAZ7.js +283 -0
  10. package/dist-library/LocalStaticDocumentView-2J7w0sKm.js +143 -0
  11. package/dist-library/{authoring-Dsune4Hy.js → authoring-B14SsOXZ.js} +68 -67
  12. package/dist-library/chart-B1TUtzm-.js +3 -0
  13. package/dist-library/color-values-r8Wf7ALn.js +6 -0
  14. package/dist-library/{compile-wUv8KEge.js → compile-D50B5_Ww.js} +32 -32
  15. package/dist-library/compile-cache-key-6GgpETz_.js +28 -0
  16. package/dist-library/compiler-DLkKUK4t.js +98 -0
  17. package/dist-library/{compiler-core-As_m-MNm.js → compiler-core-Niqhp9wV.js} +2963 -3283
  18. package/dist-library/{registry-core-Bbad9Bm2.js → component-kernel-IG4wOO0i.js} +72 -195
  19. package/dist-library/component-state-CwKX_SN5.js +763 -0
  20. package/dist-library/{component-state-C52ZFJGl.js → component-state-Ht-hOK0W.js} +15 -14
  21. package/dist-library/component-utils-eSj5IdG4.js +338 -0
  22. package/dist-library/computations-CffoW7Ff.js +340 -0
  23. package/dist-library/config-validation-Cpol91_M.js +456 -0
  24. package/dist-library/controls-B-CLSK8Q.js +5927 -0
  25. package/dist-library/controls-DWlx-AQl.js +3 -0
  26. package/dist-library/{coordinate-CWS9p5q_.js → coordinate-PyLPMIQK.js} +85 -85
  27. package/dist-library/data-BtFlkJzp.js +3 -0
  28. package/dist-library/{data-table-Bgccxd7h.js → data-table-Kv_ZA2Z2.js} +14 -13
  29. package/dist-library/data-visuals-_Z7QqYTk.js +384 -0
  30. package/dist-library/{default-components-BwQf0oP-.js → default-components-jugH7Ubr.js} +333 -331
  31. package/dist-library/{config-BadfhjdP.js → default-config-DIrRpuQz.js} +96 -79
  32. package/dist-library/default-options-DU5dxuU6.js +125 -0
  33. package/dist-library/{registry-B9NGct4d.js → default-registry-BlloaZi7.js} +4 -4
  34. package/dist-library/default-schema-Ch-Vznpm.js +33 -0
  35. package/dist-library/diagram-BLepzI8l.js +3 -0
  36. package/dist-library/{display-B-VhqVND.js → display-y4v9v0Qd.js} +1 -1
  37. package/dist-library/dist-Cueh1Psp.js +4761 -0
  38. package/dist-library/{config-validation-F47AcE6o.js → document-theme-DBAfnk7y.js} +248 -731
  39. package/dist-library/{export-BqVmTXm8.js → export-heVBqgxA.js} +46 -44
  40. package/dist-library/gallery-BC6FYTqw.js +3 -0
  41. package/dist-library/{gallery-CY6mTx8i.js → gallery-Q6VPS2ep.js} +1 -1
  42. package/dist-library/{html-CNT4KD-2.js → html-CCnvzan1.js} +56 -54
  43. package/dist-library/identity-BUx0Q_-d.js +40 -0
  44. package/dist-library/{incremental-Dv0FSp_U.js → incremental-Bzvh8_lB.js} +529 -380
  45. package/dist-library/{layout-C0YlEPGr.js → layout-BfUzzO2b.js} +147 -156
  46. package/dist-library/layout-BnfDeUNy.js +3 -0
  47. package/dist-library/limits-CFERRrlC.js +10 -0
  48. package/dist-library/localization-COdJ6lw2.js +6 -0
  49. package/dist-library/mafs-CnzDC5CR.js +3 -0
  50. package/dist-library/math-view-B0jthpRw.js +20 -0
  51. package/dist-library/motion-tokens-Czk0RDmS.js +283 -0
  52. package/dist-library/mount-preset-C_i37FvY.js +24 -0
  53. package/dist-library/numeric-sliders-CkWS0-ja.js +542 -0
  54. package/dist-library/observability-CYLuvFfL.js +502 -0
  55. package/dist-library/observability-core-Bcu7vpnl.js +24 -0
  56. package/dist-library/{package-core-WFK1RhAZ.js → package-core-9UK5ZdqB.js} +57 -46
  57. package/dist-library/parser-9yNJxGip.js +8 -0
  58. package/dist-library/parser-standard-BPIy4HOu.js +4872 -0
  59. package/dist-library/plugin-packs-CZb46nuv.js +19 -0
  60. package/dist-library/preset-core-BW3NWZJ9.js +1300 -0
  61. package/dist-library/props-pJRrfDc6.js +179 -0
  62. package/dist-library/react-BSo0o998.js +32 -0
  63. package/dist-library/reactive-md-authoring.js +274 -263
  64. package/dist-library/reactive-md-build.js +55 -20
  65. package/dist-library/reactive-md-compiler-session.js +4 -0
  66. package/dist-library/reactive-md-compiler-standard.js +6 -6
  67. package/dist-library/reactive-md-compiler.js +3 -3
  68. package/dist-library/reactive-md-contracts.js +6 -0
  69. package/dist-library/reactive-md-default-packs.js +31 -14
  70. package/dist-library/reactive-md-default-preset.js +7 -6
  71. package/dist-library/reactive-md-export.js +6 -5
  72. package/dist-library/reactive-md-minimal-preset.js +2 -2
  73. package/dist-library/reactive-md-minimal-react-preset.js +22 -20
  74. package/dist-library/reactive-md-minimal.css +1 -1
  75. package/dist-library/reactive-md-observability.js +126 -0
  76. package/dist-library/reactive-md-pack-style-manifest.js +797 -0
  77. package/dist-library/reactive-md-plugin-chart.js +6 -5
  78. package/dist-library/reactive-md-plugin-data.js +8 -8
  79. package/dist-library/reactive-md-plugin-diagram.js +7 -6
  80. package/dist-library/reactive-md-plugin-forms.js +14 -13
  81. package/dist-library/reactive-md-plugin-gallery.js +6 -5
  82. package/dist-library/reactive-md-plugin-navigation.js +9 -9
  83. package/dist-library/reactive-md-plugin-network.js +13 -12
  84. package/dist-library/reactive-md-plugin-plot.js +7 -6
  85. package/dist-library/reactive-md-react-component-accordion.js +10 -0
  86. package/dist-library/reactive-md-react-component-alert.js +10 -0
  87. package/dist-library/reactive-md-react-component-anchor.js +10 -0
  88. package/dist-library/reactive-md-react-component-badge.js +10 -0
  89. package/dist-library/reactive-md-react-component-card.js +10 -0
  90. package/dist-library/reactive-md-react-component-chart.js +22 -0
  91. package/dist-library/reactive-md-react-component-checkbox.js +10 -0
  92. package/dist-library/reactive-md-react-component-checklist.js +10 -0
  93. package/dist-library/reactive-md-react-component-choices.js +10 -0
  94. package/dist-library/reactive-md-react-component-column.js +6 -0
  95. package/dist-library/reactive-md-react-component-coordinate.js +21 -0
  96. package/dist-library/reactive-md-react-component-counter.js +10 -0
  97. package/dist-library/reactive-md-react-component-data-table.js +14 -0
  98. package/dist-library/reactive-md-react-component-date.js +10 -0
  99. package/dist-library/reactive-md-react-component-diagram.js +22 -0
  100. package/dist-library/reactive-md-react-component-disclosure.js +10 -0
  101. package/dist-library/reactive-md-react-component-edge.js +22 -0
  102. package/dist-library/reactive-md-react-component-gallery-item.js +10 -0
  103. package/dist-library/reactive-md-react-component-gallery.js +10 -0
  104. package/dist-library/reactive-md-react-component-grid.js +10 -0
  105. package/dist-library/reactive-md-react-component-if.js +10 -0
  106. package/dist-library/reactive-md-react-component-input.js +10 -0
  107. package/dist-library/reactive-md-react-component-jump.js +10 -0
  108. package/dist-library/reactive-md-react-component-multi-select.js +10 -0
  109. package/dist-library/reactive-md-react-component-node.js +22 -0
  110. package/dist-library/reactive-md-react-component-number.js +10 -0
  111. package/dist-library/reactive-md-react-component-option.js +10 -0
  112. package/dist-library/reactive-md-react-component-panel.js +10 -0
  113. package/dist-library/reactive-md-react-component-plot.js +26 -0
  114. package/dist-library/reactive-md-react-component-progress.js +10 -0
  115. package/dist-library/reactive-md-react-component-quiz.js +10 -0
  116. package/dist-library/reactive-md-react-component-radio-group.js +10 -0
  117. package/dist-library/reactive-md-react-component-range-slider.js +10 -0
  118. package/dist-library/reactive-md-react-component-section.js +10 -0
  119. package/dist-library/reactive-md-react-component-select.js +10 -0
  120. package/dist-library/reactive-md-react-component-slider.js +10 -0
  121. package/dist-library/reactive-md-react-component-step.js +10 -0
  122. package/dist-library/reactive-md-react-component-steps.js +10 -0
  123. package/dist-library/reactive-md-react-component-tab.js +10 -0
  124. package/dist-library/reactive-md-react-component-table.js +14 -0
  125. package/dist-library/reactive-md-react-component-tabs.js +10 -0
  126. package/dist-library/reactive-md-react-component-text.js +10 -0
  127. package/dist-library/reactive-md-react-component-textarea.js +10 -0
  128. package/dist-library/reactive-md-react-component-timeline.js +14 -0
  129. package/dist-library/reactive-md-react-component-timer.js +10 -0
  130. package/dist-library/reactive-md-react-component-toggle.js +10 -0
  131. package/dist-library/reactive-md-react-component-tooltip.js +10 -0
  132. package/dist-library/reactive-md-react-component-validation.js +10 -0
  133. package/dist-library/reactive-md-react-minimal.js +4 -4
  134. package/dist-library/reactive-md-react-pack-controls.js +44 -0
  135. package/dist-library/reactive-md-react-pack-data.js +21 -0
  136. package/dist-library/reactive-md-react-pack-layout.js +36 -0
  137. package/dist-library/reactive-md-react-pack-visuals.js +43 -0
  138. package/dist-library/reactive-md-react-packed.js +50 -0
  139. package/dist-library/reactive-md-react-server.js +26 -25
  140. package/dist-library/reactive-md-react-static-server.js +24 -0
  141. package/dist-library/reactive-md-react-static.js +1 -0
  142. package/dist-library/reactive-md-react-unstyled.js +15 -12
  143. package/dist-library/reactive-md-react.js +15 -12
  144. package/dist-library/reactive-md-runtime-browser.js +2 -1
  145. package/dist-library/reactive-md-runtime.js +4 -3
  146. package/dist-library/reactive-md-scan.js +1 -0
  147. package/dist-library/reactive-md-sdk.js +9 -8
  148. package/dist-library/reactive-md-standalone-configured.js +2 -2
  149. package/dist-library/reactive-md-standalone-host.js +2 -2
  150. package/dist-library/reactive-md-testing-browser.js +2 -2
  151. package/dist-library/reactive-md-testing-react.js +32 -32
  152. package/dist-library/reactive-md-testing.js +12 -12
  153. package/dist-library/reactive-md-worker-pool.js +401 -0
  154. package/dist-library/reactive-md.css +1 -1
  155. package/dist-library/reactive-md.js +84 -1361
  156. package/dist-library/registry-core-CziAIP5P.js +125 -0
  157. package/dist-library/render-nodes-DKjg_TR1.js +9369 -0
  158. package/dist-library/{resources-D2GDQS0p.js → requirements-DhIkxAbl.js} +37 -84
  159. package/dist-library/resources-B_nbROgj.js +74 -0
  160. package/dist-library/rmd-pack-controls.css +1032 -0
  161. package/dist-library/rmd-pack-data.css +724 -0
  162. package/dist-library/rmd-pack-layout.css +1825 -0
  163. package/dist-library/rmd-pack-resource-chart.css +300 -0
  164. package/dist-library/rmd-pack-resource-controls.css +781 -0
  165. package/dist-library/rmd-pack-resource-data-visuals.css +501 -0
  166. package/dist-library/rmd-pack-resource-diagram.css +106 -0
  167. package/dist-library/rmd-pack-resource-gallery.css +346 -0
  168. package/dist-library/rmd-pack-resource-graphics.css +516 -0
  169. package/dist-library/rmd-pack-resource-layout.css +1480 -0
  170. package/dist-library/rmd-pack-resource-mafs-core.css +124 -0
  171. package/dist-library/rmd-pack-resource-mafs.css +129 -0
  172. package/dist-library/rmd-pack-resource-visual-base.css +224 -0
  173. package/dist-library/rmd-pack-visuals.css +1394 -0
  174. package/dist-library/{runtime-B2fxeveq.js → runtime-BDnnimPA.js} +17 -16
  175. package/dist-library/{runtime-kcA7bG7G.js → runtime-CuJndKqK.js} +320 -313
  176. package/dist-library/runtime-requirement-C4-vNcf5.js +769 -0
  177. package/dist-library/schema-core-4sd1Vu7V.js +132 -0
  178. package/dist-library/{sdk-core-BoJT1SIt.js → sdk-core-BLsW9cCy.js} +494 -520
  179. package/dist-library/{session-core-nmJHuR9c.js → session-core-DLBRPV7f.js} +33 -31
  180. package/dist-library/{shareable-DpbE-59H.js → shareable-C6mUerpQ.js} +215 -209
  181. package/dist-library/shared-bTzN-F4g.js +3 -0
  182. package/dist-library/structural-views-30-YD_TJ.js +11 -0
  183. package/dist-library/table-surface-CfZn_tk-.js +13 -0
  184. package/dist-library/types/assemblies/compile-cache-key.d.ts +11 -0
  185. package/dist-library/types/assemblies/default-config.d.ts +35 -0
  186. package/dist-library/types/{local/configuration/options.d.ts → assemblies/default-options.d.ts} +4 -4
  187. package/dist-library/types/assemblies/default-registry.d.ts +18 -0
  188. package/dist-library/types/{local/configuration/schema.d.ts → assemblies/default-schema.d.ts} +4 -4
  189. package/dist-library/types/authoring/catalog.d.ts +11 -1
  190. package/dist-library/types/authoring/extensions.d.ts +1 -1
  191. package/dist-library/types/authoring/index.d.ts +3 -3
  192. package/dist-library/types/authoring/templates.d.ts +1 -1
  193. package/dist-library/types/build/diagnostics.d.ts +1 -1
  194. package/dist-library/types/compiler/index.d.ts +1 -0
  195. package/dist-library/types/compiler/session.d.ts +19 -0
  196. package/dist-library/types/compiler/standard.d.ts +1 -0
  197. package/dist-library/types/components/entries/accordion.d.ts +3 -0
  198. package/dist-library/types/components/entries/alert.d.ts +3 -0
  199. package/dist-library/types/components/entries/anchor.d.ts +3 -0
  200. package/dist-library/types/components/entries/badge.d.ts +3 -0
  201. package/dist-library/types/components/entries/card.d.ts +3 -0
  202. package/dist-library/types/components/entries/chart.d.ts +3 -0
  203. package/dist-library/types/components/entries/checkbox.d.ts +3 -0
  204. package/dist-library/types/components/entries/checklist.d.ts +3 -0
  205. package/dist-library/types/components/entries/choices.d.ts +3 -0
  206. package/dist-library/types/components/entries/column.d.ts +3 -0
  207. package/dist-library/types/components/entries/coordinate.d.ts +3 -0
  208. package/dist-library/types/components/entries/counter.d.ts +3 -0
  209. package/dist-library/types/components/entries/data-table.d.ts +3 -0
  210. package/dist-library/types/components/entries/date.d.ts +3 -0
  211. package/dist-library/types/components/entries/diagram.d.ts +3 -0
  212. package/dist-library/types/components/entries/disclosure.d.ts +3 -0
  213. package/dist-library/types/components/entries/edge.d.ts +3 -0
  214. package/dist-library/types/components/entries/gallery-item.d.ts +3 -0
  215. package/dist-library/types/components/entries/gallery.d.ts +3 -0
  216. package/dist-library/types/components/entries/grid.d.ts +3 -0
  217. package/dist-library/types/components/entries/if.d.ts +3 -0
  218. package/dist-library/types/components/entries/input.d.ts +3 -0
  219. package/dist-library/types/components/entries/jump.d.ts +3 -0
  220. package/dist-library/types/components/entries/multi-select.d.ts +3 -0
  221. package/dist-library/types/components/entries/node.d.ts +3 -0
  222. package/dist-library/types/components/entries/number.d.ts +3 -0
  223. package/dist-library/types/components/entries/option.d.ts +3 -0
  224. package/dist-library/types/components/entries/panel.d.ts +3 -0
  225. package/dist-library/types/components/entries/plot.d.ts +3 -0
  226. package/dist-library/types/components/entries/progress.d.ts +3 -0
  227. package/dist-library/types/components/entries/quiz.d.ts +3 -0
  228. package/dist-library/types/components/entries/radio-group.d.ts +3 -0
  229. package/dist-library/types/components/entries/range-slider.d.ts +3 -0
  230. package/dist-library/types/components/entries/section.d.ts +3 -0
  231. package/dist-library/types/components/entries/select.d.ts +3 -0
  232. package/dist-library/types/components/entries/slider.d.ts +3 -0
  233. package/dist-library/types/components/entries/step.d.ts +3 -0
  234. package/dist-library/types/components/entries/steps.d.ts +3 -0
  235. package/dist-library/types/components/entries/tab.d.ts +3 -0
  236. package/dist-library/types/components/entries/table.d.ts +3 -0
  237. package/dist-library/types/components/entries/tabs.d.ts +3 -0
  238. package/dist-library/types/components/entries/text.d.ts +3 -0
  239. package/dist-library/types/components/entries/textarea.d.ts +3 -0
  240. package/dist-library/types/components/entries/timeline.d.ts +3 -0
  241. package/dist-library/types/components/entries/timer.d.ts +3 -0
  242. package/dist-library/types/components/entries/toggle.d.ts +3 -0
  243. package/dist-library/types/components/entries/tooltip.d.ts +3 -0
  244. package/dist-library/types/components/entries/validation.d.ts +3 -0
  245. package/dist-library/types/components/layout/layout.d.ts +1 -3
  246. package/dist-library/types/components/layout/structural-views.d.ts +3 -0
  247. package/dist-library/types/components/mount-preset.d.ts +2 -0
  248. package/dist-library/types/components/packs/controls.d.ts +2 -0
  249. package/dist-library/types/components/packs/data.d.ts +2 -0
  250. package/dist-library/types/components/packs/layout.d.ts +2 -0
  251. package/dist-library/types/components/packs/visuals.d.ts +2 -0
  252. package/dist-library/types/components/shared/data-visuals.d.ts +3 -0
  253. package/dist-library/types/components/shared/table-surface.d.ts +10 -0
  254. package/dist-library/types/components/shared/visual-helpers.d.ts +24 -0
  255. package/dist-library/types/components/shared/visuals.d.ts +0 -2
  256. package/dist-library/types/components/table/data-table-model.d.ts +48 -0
  257. package/dist-library/types/components/table/data-table.d.ts +1 -48
  258. package/dist-library/types/{local/configuration → contracts}/component-kernel.d.ts +4 -2
  259. package/dist-library/types/contracts/index.d.ts +8 -0
  260. package/dist-library/types/{local/configuration → contracts}/limits.d.ts +9 -1
  261. package/dist-library/types/contracts/localization.d.ts +6 -0
  262. package/dist-library/types/contracts/runtime-types.d.ts +19 -0
  263. package/dist-library/types/local/compilation/cache-version.d.ts +1 -0
  264. package/dist-library/types/local/compilation/compile-status.d.ts +2 -0
  265. package/dist-library/types/local/compilation/compiler-bindings.d.ts +1 -1
  266. package/dist-library/types/local/compilation/compiler-capabilities.d.ts +4 -1
  267. package/dist-library/types/local/compilation/compiler-core.d.ts +1 -1
  268. package/dist-library/types/local/compilation/compiler-embedding.d.ts +20 -0
  269. package/dist-library/types/local/compilation/compiler-expressions.d.ts +5 -4
  270. package/dist-library/types/local/compilation/compiler-structure.d.ts +1 -1
  271. package/dist-library/types/local/compilation/compiler-tables.d.ts +3 -2
  272. package/dist-library/types/local/compilation/compiler-validation.d.ts +5 -9
  273. package/dist-library/types/local/compilation/compiler-values.d.ts +1 -1
  274. package/dist-library/types/local/compilation/compiler.d.ts +1 -1
  275. package/dist-library/types/local/compilation/component-usage.d.ts +2 -0
  276. package/dist-library/types/local/compilation/runtime-requirement.d.ts +3 -0
  277. package/dist-library/types/local/compilation/session/incremental.d.ts +5 -1
  278. package/dist-library/types/local/compilation/streaming.d.ts +1 -1
  279. package/dist-library/types/local/configuration/diagnostic-messages.d.ts +55 -0
  280. package/dist-library/types/local/configuration/embedding.d.ts +4 -0
  281. package/dist-library/types/local/configuration/kernel-value-rules.d.ts +1 -1
  282. package/dist-library/types/local/configuration/options-core.d.ts +8 -2
  283. package/dist-library/types/local/index.d.ts +12 -1
  284. package/dist-library/types/local/observability-codes.d.ts +2 -0
  285. package/dist-library/types/local/observability-core.d.ts +44 -0
  286. package/dist-library/types/local/observability-messages.d.ts +6 -0
  287. package/dist-library/types/local/observability.d.ts +45 -0
  288. package/dist-library/types/local/parsing/parse-budget.d.ts +18 -2
  289. package/dist-library/types/local/parsing/parser-internals.d.ts +2 -1
  290. package/dist-library/types/local/parsing/parser-region.d.ts +13 -2
  291. package/dist-library/types/local/parsing/parser-tags.d.ts +6 -1
  292. package/dist-library/types/local/parsing/rmd-recovery.d.ts +8 -0
  293. package/dist-library/types/local/performance-report.d.ts +70 -0
  294. package/dist-library/types/local/runtime/runtime-pool.d.ts +14 -0
  295. package/dist-library/types/local/transport/worker-handler.d.ts +3 -0
  296. package/dist-library/types/local/transport/worker-job.d.ts +12 -2
  297. package/dist-library/types/local/transport/worker-pool.d.ts +68 -0
  298. package/dist-library/types/local/transport/worker.d.ts +66 -1
  299. package/dist-library/types/local/types.d.ts +45 -25
  300. package/dist-library/types/observability.d.ts +8 -0
  301. package/dist-library/types/presets/default-semantics.d.ts +1 -1
  302. package/dist-library/types/presets/identity.d.ts +1 -8
  303. package/dist-library/types/presets/pack-style-entry.d.ts +3 -0
  304. package/dist-library/types/presets/pack-style-manifest.d.ts +11 -0
  305. package/dist-library/types/react/component-api.d.ts +3 -2
  306. package/dist-library/types/react/component-loader.d.ts +61 -0
  307. package/dist-library/types/react/component-primitives.d.ts +5 -5
  308. package/dist-library/types/react/index.d.ts +9 -5
  309. package/dist-library/types/react/localization.d.ts +5 -6
  310. package/dist-library/types/react/minimal.d.ts +2 -2
  311. package/dist-library/types/react/package-core.d.ts +3 -0
  312. package/dist-library/types/react/packed.d.ts +17 -0
  313. package/dist-library/types/react/render-lifecycle.d.ts +9 -0
  314. package/dist-library/types/{local → react}/rendering/document/ExtendedHtmlFragment.d.ts +1 -1
  315. package/dist-library/types/{local → react}/rendering/document/LocalDocumentViewCore.d.ts +11 -4
  316. package/dist-library/types/react/rendering/document/LocalPooledDocumentView.d.ts +8 -0
  317. package/dist-library/types/react/rendering/document/LocalReactiveDocumentCore.d.ts +6 -0
  318. package/dist-library/types/react/rendering/document/LocalStaticDocumentView.d.ts +18 -0
  319. package/dist-library/types/react/rendering/document/StaticExternalSlot.d.ts +25 -0
  320. package/dist-library/types/react/rendering/document/StaticHostData.d.ts +14 -0
  321. package/dist-library/types/{local → react}/rendering/document/render-nodes.d.ts +8 -8
  322. package/dist-library/types/react/rendering/document/static-runtime.d.ts +11 -0
  323. package/dist-library/types/{local → react}/rendering/document/use-author-script.d.ts +2 -2
  324. package/dist-library/types/{local → react}/rendering/document/validation-state.d.ts +2 -2
  325. package/dist-library/types/{local → react}/rendering/document/view-render-context.d.ts +40 -8
  326. package/dist-library/types/{local → react}/rendering/document/view-revision.d.ts +2 -2
  327. package/dist-library/types/{local → react}/rendering/render-types.d.ts +5 -5
  328. package/dist-library/types/react/rendering/table/data-table.d.ts +5 -0
  329. package/dist-library/types/{local → react}/rendering/table/table-numeric-columns.d.ts +3 -3
  330. package/dist-library/types/react/sdk-core.d.ts +12 -3
  331. package/dist-library/types/react/sdk.d.ts +2 -1
  332. package/dist-library/types/react/server.d.ts +3 -10
  333. package/dist-library/types/react/static-server.d.ts +12 -0
  334. package/dist-library/types/scan/index.d.ts +15 -0
  335. package/dist-library/types/sdk/config.d.ts +2 -35
  336. package/dist-library/types/sdk/default-identity.d.ts +3 -0
  337. package/dist-library/types/sdk/index.d.ts +1 -1
  338. package/dist-library/types/sdk/preset.d.ts +9 -0
  339. package/dist-library/types/sdk/props.d.ts +8 -3
  340. package/dist-library/types/sdk/registry-core.d.ts +2 -2
  341. package/dist-library/types/sdk/registry.d.ts +2 -18
  342. package/dist-library/types/sdk/types.d.ts +2 -2
  343. package/dist-library/types/sdk/version.d.ts +2 -0
  344. package/dist-library/types/standalone/session-core.d.ts +1 -1
  345. package/dist-library/{types-BeNtPqdY.js → types-Bza88SGK.js} +1 -1
  346. package/dist-library/types-daDo2c_w.js +3 -0
  347. package/dist-library/use-hydrated-W-laKPhY.js +22975 -0
  348. package/dist-library/validation-XXlb-spV.js +860 -0
  349. package/dist-library/version-B0G1699c.js +138 -0
  350. package/dist-library/visual-frame-y5RFhJ0_.js +19 -0
  351. package/dist-library/visual-helpers-CRmaqCHX.js +75 -0
  352. package/dist-library/visuals-CdHezgh5.js +3 -0
  353. package/dist-library/visuals-CoVSjVD8.js +49159 -0
  354. package/dist-library/worker-D6WMV8xJ.js +1632 -0
  355. package/dist-standalone/reactive-md-standalone.css +1 -1
  356. package/dist-standalone/reactive-md-standalone.js +119 -118
  357. package/docs/README-ch.md +8 -1
  358. package/docs/README.md +8 -1
  359. package/docs/compatibility/api-stability-ch.md +25 -0
  360. package/docs/compatibility/api-stability-en.md +25 -0
  361. package/docs/compatibility/compatibility-ch.md +32 -15
  362. package/docs/compatibility/compatibility-en.md +32 -15
  363. package/docs/compatibility/compatibility-manifest.schema.json +161 -0
  364. package/docs/compatibility/deprecation-ch.md +21 -0
  365. package/docs/compatibility/deprecation-en.md +21 -0
  366. package/docs/compatibility/source-versioning-ch.md +1 -1
  367. package/docs/compatibility/source-versioning-en.md +1 -1
  368. package/docs/compatibility/support-matrix-ch.md +108 -0
  369. package/docs/compatibility/support-matrix-en.md +108 -0
  370. package/docs/development/component-development-ch.md +2 -2
  371. package/docs/development/component-development-en.md +2 -2
  372. package/docs/development/component-development-reference-ch.md +16 -0
  373. package/docs/development/component-development-reference-en.md +16 -0
  374. package/docs/development/component-protocol-ch.md +31 -11
  375. package/docs/development/component-protocol-en.md +31 -11
  376. package/docs/integration/author-tools-ch.md +3 -1
  377. package/docs/integration/author-tools-en.md +3 -1
  378. package/docs/integration/compiler-ch.md +42 -1
  379. package/docs/integration/compiler-en.md +42 -1
  380. package/docs/integration/editor-ch.md +2 -2
  381. package/docs/integration/editor-en.md +2 -2
  382. package/docs/integration/extension-sdk-ch.md +6 -2
  383. package/docs/integration/extension-sdk-en.md +6 -2
  384. package/docs/integration/local-integration-ch.md +4 -2
  385. package/docs/integration/local-integration-en.md +4 -2
  386. package/docs/reference/public-api-ch.md +143 -7
  387. package/docs/reference/public-api-en.md +143 -7
  388. package/docs/releases/release-0.9.2-ch.md +33 -0
  389. package/docs/releases/release-0.9.2-en.md +33 -0
  390. package/docs/releases/release-0.9.3-ch.md +45 -0
  391. package/docs/releases/release-0.9.3-en.md +45 -0
  392. package/examples/integration/README-ch.md +36 -4
  393. package/examples/integration/README.md +36 -4
  394. package/examples/integration/chat-session/index.mjs +91 -0
  395. package/examples/integration/chat-session/package.json +10 -0
  396. package/examples/integration/static-embed/embed.mjs +44 -0
  397. package/examples/integration/static-embed/index.html +12 -0
  398. package/examples/integration/static-embed/main.mjs +24 -0
  399. package/examples/integration/static-embed/references.mjs +5 -0
  400. package/examples/integration/static-embed/render.mjs +10 -0
  401. package/package.json +67 -2
  402. package/dist-library/LocalDocumentView-sthUP0ct.js +0 -109
  403. package/dist-library/LocalReactiveDocumentCore-ZjQSGyHE.js +0 -275
  404. package/dist-library/compiler-eOfcinZs.js +0 -62
  405. package/dist-library/component-state-BoLCGee4.js +0 -801
  406. package/dist-library/controls-CcT6n7k_.js +0 -6740
  407. package/dist-library/mount-preset-KxvtKgJb.js +0 -13
  408. package/dist-library/options-1aDLK7JY.js +0 -121
  409. package/dist-library/parser-standard-Yuf3A_VI.js +0 -9630
  410. package/dist-library/plugin-packs-B1XPWcFs.js +0 -18
  411. package/dist-library/preset-core-CKc5YXSM.js +0 -1443
  412. package/dist-library/props-sJ8vk0cr.js +0 -183
  413. package/dist-library/react-D5iGiUdL.js +0 -7
  414. package/dist-library/schema-BufhKUSM.js +0 -40
  415. package/dist-library/types/local/rendering/document/LocalReactiveDocumentCore.d.ts +0 -6
  416. package/dist-library/types/local/rendering/table/data-table.d.ts +0 -13
  417. package/dist-library/validation-BEBA_HvS.js +0 -1121
  418. package/dist-library/visual-frame-CyV1FXzs.js +0 -48
  419. package/dist-library/visuals-BZbZYA7w.js +0 -72572
  420. /package/dist-library/types/{local/configuration → contracts}/color-values.d.ts +0 -0
  421. /package/dist-library/types/{local/html → contracts}/html-names.d.ts +0 -0
  422. /package/dist-library/types/{local/configuration → contracts}/schema-core.d.ts +0 -0
  423. /package/dist-library/types/{local → react}/rendering/code/code-block.d.ts +0 -0
  424. /package/dist-library/types/{local → react}/rendering/code/code-languages.d.ts +0 -0
  425. /package/dist-library/types/{local → react}/rendering/document/LocalDocumentView.d.ts +0 -0
  426. /package/dist-library/types/{local → react}/rendering/document/use-color-scheme.d.ts +0 -0
  427. /package/dist-library/types/{local → react}/rendering/image/image-view.d.ts +0 -0
  428. /package/dist-library/types/{local → react}/rendering/math-view.d.ts +0 -0
@@ -1,1443 +0,0 @@
1
- // src/local/configuration/limits.ts
2
- var e = 1e6, t = 1e4, n = 2e7, r = 1e3, i = 1e5, a = 1e4, o = 1e5, s = 2e3, c = 16, l = 2e4, u = 2e6, d = 1e3, f = 100, p = 20, m = 2e3, h = 1e4;
3
- function g(e) {
4
- if (e.length > 254 || /\s/.test(e)) return !1;
5
- let t = e.indexOf("@");
6
- if (t < 1 || t !== e.lastIndexOf("@")) return !1;
7
- let n = e.lastIndexOf(".");
8
- return n > t + 1 && n < e.length - 1;
9
- }
10
- // src/sdk/hash.ts
11
- function _(e) {
12
- let t = 2166136261, n = 16777619;
13
- for (let r = 0; r < e.length; r += 1) {
14
- let i = e.charCodeAt(r);
15
- t ^= i, t = Math.imul(t, 16777619) >>> 0, n ^= i + r, n = Math.imul(n, 2246822507) >>> 0;
16
- }
17
- let r = e.length;
18
- return t ^= r, t = Math.imul(t, 16777619) >>> 0, n ^= r, n = Math.imul(n, 3266489909) >>> 0, `rmd-${t.toString(16).padStart(8, "0")}${n.toString(16).padStart(8, "0")}`;
19
- }
20
- // src/sdk/pattern.ts
21
- function v(e, t) {
22
- let n = e[t];
23
- if (n === "*" || n === "+" || n === "?") return { length: e[t + 1] === "?" ? 2 : 1 };
24
- if (n !== "{") return null;
25
- let r = /^\{(\d+)(?:,(\d*))?\}/.exec(e.slice(t));
26
- return r ? { length: r[0].length + +(e[t + r[0].length] === "?") } : null;
27
- }
28
- function y(e) {
29
- let t = [], n = !1, r = !1;
30
- for (let i = 0; i < e.length; i += 1) {
31
- let a = e[i];
32
- if (n) {
33
- n = !1;
34
- continue;
35
- }
36
- if (a === "\\") {
37
- let t = e[i + 1];
38
- if (t !== void 0 && t >= "1" && t <= "9" || t === "k" && e[i + 2] === "<") return !1;
39
- n = !0;
40
- continue;
41
- }
42
- if (r) {
43
- a === "]" && (r = !1);
44
- continue;
45
- }
46
- if (a === "[") {
47
- r = !0;
48
- continue;
49
- }
50
- if (a === "(") {
51
- if (e[i + 1] === "?") {
52
- if (e[i + 2] !== ":") return !1;
53
- t.push({
54
- quantified: !1,
55
- alternation: !1
56
- }), i += 2;
57
- continue;
58
- }
59
- t.push({
60
- quantified: !1,
61
- alternation: !1
62
- });
63
- continue;
64
- }
65
- if (a === "|") {
66
- let e = t[t.length - 1];
67
- e && (e.alternation = !0);
68
- continue;
69
- }
70
- if (a === ")") {
71
- let n = t.pop();
72
- if (!n) return !1;
73
- let r = v(e, i + 1);
74
- if (r && (n.quantified || n.alternation)) return !1;
75
- let a = t[t.length - 1];
76
- a && (a.quantified = a.quantified || n.quantified || r !== null, a.alternation = a.alternation || n.alternation), r && (i += r.length);
77
- continue;
78
- }
79
- let o = v(e, i);
80
- if (o) {
81
- let e = t[t.length - 1];
82
- e && (e.quantified = !0), i += o.length - 1;
83
- }
84
- }
85
- return t.length === 0 && !n && !r;
86
- }
87
- // src/sdk/version.ts
88
- var b = "0.7.0", x = "reactive-md-component/v1", ee = "reactive-md-config/v1", te = "reactive-md-config/v2", S = "reactive-md-preset/v1", ne = "reactive-md-react-preset/v1", re = "reactive-md-assembly/v1", ie = "reactive-md-extensions/v1", ae = 128, oe = 8, se = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/, ce = /^0\d+$/;
89
- function le(e) {
90
- if (e === void 0) return Object.freeze([]);
91
- let t = e.split("."), n = [];
92
- for (let e of t) {
93
- if (e.length === 0 || ce.test(e) && e !== "0" && /^\d+$/.test(e) || /^\d+$/.test(e) && !Number.isSafeInteger(Number(e))) return null;
94
- n.push(/^\d+$/.test(e) ? Number(e) : e);
95
- }
96
- return Object.freeze(n);
97
- }
98
- function C(e) {
99
- let t = se.exec(e);
100
- if (!t) return null;
101
- let [, n, r, i, a] = t;
102
- for (let e of [
103
- n,
104
- r,
105
- i
106
- ]) if (e.length > 1 && e.startsWith("0") || !Number.isSafeInteger(Number(e))) return null;
107
- let o = le(a);
108
- return o === null ? null : {
109
- major: Number(n),
110
- minor: Number(r),
111
- patch: Number(i),
112
- prerelease: o
113
- };
114
- }
115
- function ue(e, t) {
116
- return typeof e == "number" && typeof t == "number" ? e === t ? 0 : e < t ? -1 : 1 : typeof e == "number" ? -1 : typeof t == "number" ? 1 : e === t ? 0 : e < t ? -1 : 1;
117
- }
118
- function de(e, t) {
119
- for (let n of [
120
- "major",
121
- "minor",
122
- "patch"
123
- ]) if (e[n] !== t[n]) return e[n] < t[n] ? -1 : 1;
124
- if (e.prerelease.length === 0 && t.prerelease.length === 0) return 0;
125
- if (e.prerelease.length === 0) return 1;
126
- if (t.prerelease.length === 0) return -1;
127
- let n = Math.min(e.prerelease.length, t.prerelease.length);
128
- for (let r = 0; r < n; r += 1) {
129
- let n = ue(e.prerelease[r], t.prerelease[r]);
130
- if (n !== 0) return n;
131
- }
132
- return e.prerelease.length === t.prerelease.length ? 0 : e.prerelease.length < t.prerelease.length ? -1 : 1;
133
- }
134
- function w(e, t, n) {
135
- return {
136
- major: e,
137
- minor: t,
138
- patch: n,
139
- prerelease: Object.freeze([])
140
- };
141
- }
142
- function fe(e, t) {
143
- if (e === "^") {
144
- let e = t.major > 0 ? w(t.major + 1, 0, 0) : t.minor > 0 ? w(0, t.minor + 1, 0) : w(0, 0, t.patch + 1);
145
- return [{
146
- operator: ">=",
147
- version: t
148
- }, {
149
- operator: "<",
150
- version: e
151
- }];
152
- }
153
- return e === "~" ? [{
154
- operator: ">=",
155
- version: t
156
- }, {
157
- operator: "<",
158
- version: w(t.major, t.minor + 1, 0)
159
- }] : [{
160
- operator: e,
161
- version: t
162
- }];
163
- }
164
- function T(e) {
165
- if (typeof e != "string") return null;
166
- let t = e.trim();
167
- if (t.length === 0 || t.length > 128) return null;
168
- let n = t.split(/\s+/);
169
- if (n.length === 0 || n.length > 8) return null;
170
- let r = [];
171
- try {
172
- for (let e of n) {
173
- let t = "=", n = e;
174
- e.startsWith(">=") || e.startsWith("<=") ? (t = e.slice(0, 2), n = e.slice(2)) : (e.startsWith(">") || e.startsWith("<") || e.startsWith("=") || e.startsWith("^") || e.startsWith("~")) && (t = e[0], n = e.slice(1));
175
- let i = C(n);
176
- if (i === null || (r.push(...fe(t, i)), r.length > 16)) return null;
177
- }
178
- } catch {
179
- return null;
180
- }
181
- return Object.freeze({
182
- source: t,
183
- comparators: Object.freeze(r)
184
- });
185
- }
186
- function E(e) {
187
- return typeof e == "string" && C(e) !== null;
188
- }
189
- function pe(e, t) {
190
- try {
191
- let n = C(e);
192
- if (n === null) return !1;
193
- let r = typeof t == "string" ? T(t) : t;
194
- if (!r || !Array.isArray(r.comparators) || r.comparators.length === 0 || n.prerelease.length && !r.comparators.some(({ version: e }) => e.prerelease.length && e.major === n.major && e.minor === n.minor && e.patch === n.patch)) return !1;
195
- for (let e of r.comparators) {
196
- let t = de(n, e.version);
197
- switch (e.operator) {
198
- case "=":
199
- if (t !== 0) return !1;
200
- break;
201
- case ">":
202
- if (t <= 0) return !1;
203
- break;
204
- case ">=":
205
- if (t < 0) return !1;
206
- break;
207
- case "<":
208
- if (t >= 0) return !1;
209
- break;
210
- case "<=":
211
- if (t > 0) return !1;
212
- break;
213
- default: return !1;
214
- }
215
- }
216
- return !0;
217
- } catch {
218
- return !1;
219
- }
220
- }
221
- function me(e) {
222
- return typeof e == "object" && !!e && typeof e.source == "string" && Array.isArray(e.comparators);
223
- }
224
- // src/sdk/manifest.ts
225
- var he = 64, ge = 64, _e = 128, ve = 160, ye = 64, be = 64, xe = 512, D = 4096, Se = 16, Ce = 32, we = 256, Te = 65536, O = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/, k = /^[a-z0-9][a-z0-9._-]*(?:\/[a-z0-9][a-z0-9._-]*)*$/, Ee = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/, De = /^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/, A = /* @__PURE__ */ new Set([
226
- "__proto__",
227
- "constructor",
228
- "prototype"
229
- ]), j = /* @__PURE__ */ new WeakSet(), Oe = /* @__PURE__ */ new Set([
230
- "string",
231
- "number",
232
- "boolean",
233
- "enum"
234
- ]), ke = /* @__PURE__ */ new Set([
235
- "leaf",
236
- "inline",
237
- "container"
238
- ]), Ae = /* @__PURE__ */ new Set([
239
- "string",
240
- "number",
241
- "boolean",
242
- "null",
243
- "array",
244
- "number-array"
245
- ]), je = /* @__PURE__ */ new Set([
246
- "text",
247
- "number",
248
- "boolean",
249
- "choice",
250
- "date",
251
- "timer",
252
- "checklist",
253
- "tabs",
254
- "diagram",
255
- "multi-select",
256
- "selection",
257
- "steps",
258
- "collection"
259
- ]), Me = /* @__PURE__ */ new Set([
260
- "empty",
261
- "false",
262
- "max-step",
263
- "nearest-zero",
264
- "min",
265
- "first-option",
266
- "first-tab",
267
- "first-step",
268
- "first-node",
269
- "checked",
270
- "duration",
271
- "empty-array",
272
- "none"
273
- ]), Ne = /* @__PURE__ */ new Set([
274
- "none",
275
- "inline",
276
- "markdown"
277
- ]), Pe = /* @__PURE__ */ new Set([
278
- "none",
279
- "any",
280
- "inline",
281
- "content",
282
- "table",
283
- "plot",
284
- "diagram",
285
- "quiz",
286
- "options",
287
- "tabs",
288
- "steps",
289
- "components"
290
- ]), Fe = /* @__PURE__ */ new Set(/* @__PURE__ */ "numeric-range.text-length.date-bounds.nonempty.progress-bounds.timer-duration.option-count.selection-requires.inline-body.no-components.single-table.math-body.options-body.value-sequence.only-children.diagram-body.quiz-body.checklist-body.dynamic-constraints.require-full-interpolation.scoped-expressions.row-values.validation-rule.anchor.navigation.data-table.plot-math.chart-table.timeline-table.table-selection.retain.self-binding-read.inline-math-reads.value-date.value-length.value-required.value-email".split(".")), Ie = /* @__PURE__ */ new Set([
291
- "none",
292
- "required",
293
- "optional"
294
- ]), Le = /* @__PURE__ */ new Set([
295
- "id",
296
- "name",
297
- "version",
298
- "protocol",
299
- "form",
300
- "props",
301
- "bindings",
302
- "children",
303
- "structure",
304
- "rules",
305
- "slotRelations",
306
- "legacyHost",
307
- "capabilities",
308
- "authoring",
309
- "dependencies",
310
- "styles",
311
- "requires",
312
- "replaces"
313
- ]), Re = /* @__PURE__ */ new Set([
314
- "kind",
315
- "required",
316
- "static",
317
- "dynamic",
318
- "default",
319
- "nullable",
320
- "enum",
321
- "values",
322
- "pattern",
323
- "min",
324
- "max",
325
- "integer",
326
- "positive",
327
- "color",
328
- "coerce",
329
- "description"
330
- ]), ze = /* @__PURE__ */ new Set([
331
- "kind",
332
- "family",
333
- "bind",
334
- "initial",
335
- "initialRule",
336
- "required",
337
- "exclusive",
338
- "constraints",
339
- "options",
340
- "maxItems",
341
- "requiresAttributes",
342
- "compare",
343
- "retain"
344
- ]), Be = /* @__PURE__ */ new Set([
345
- "min",
346
- "max",
347
- "step"
348
- ]), Ve = /* @__PURE__ */ new Set([
349
- "interactive",
350
- "static",
351
- "ssr",
352
- "offline"
353
- ]), He = /* @__PURE__ */ new Set([
354
- "title",
355
- "description",
356
- "category",
357
- "insertText"
358
- ]), Ue = /* @__PURE__ */ new Set(["kind", "required"]), We = /* @__PURE__ */ new Set([
359
- "rule",
360
- "label",
361
- "parents",
362
- "child",
363
- "children",
364
- "min",
365
- "max",
366
- "inlineOnly",
367
- "noComponents",
368
- "valueAttribute",
369
- "generatedPrefix",
370
- "forbidSeparator",
371
- "maxItems"
372
- ]), Ge = /* @__PURE__ */ new Set(["id", "version"]), Ke = /* @__PURE__ */ new Set(["kernel"]), qe = /* @__PURE__ */ new Set(["id", "version"]), Je = /^[A-Za-z0-9][A-Za-z0-9._/-]*$/, Ye = /^[A-Za-z][A-Za-z0-9]*$/, M = /* @__PURE__ */ new Set(["setMany"]), Xe = 16, Ze = 32, Qe = 16, $e = 32, et = /* @__PURE__ */ new Set([
373
- "bind",
374
- "initial",
375
- "disabled"
376
- ]);
377
- function N(e, t) {
378
- throw Error(`Invalid local component manifest (${e}): ${t}`);
379
- }
380
- function tt(e) {
381
- try {
382
- let t = JSON.stringify(e);
383
- return typeof t == "string" ? typeof TextEncoder == "function" ? new TextEncoder().encode(t).length : t.length * 2 : Infinity;
384
- } catch {
385
- return Infinity;
386
- }
387
- }
388
- function P(e) {
389
- if (typeof e != "object" || !e || Array.isArray(e)) return !1;
390
- let t = Object.getPrototypeOf(e);
391
- return t === Object.prototype || t === null;
392
- }
393
- function F(e, t, n) {
394
- for (let r of Object.keys(e)) A.has(r) && N(n, `field "${r}" is not allowed.`), t.has(r) || N(n, `unknown field "${r}".`);
395
- }
396
- function I(e, t) {
397
- return typeof e != "boolean" && N(t, "must be a boolean."), e;
398
- }
399
- function L(e, t, n = D) {
400
- return typeof e != "string" && N(t, "must be a string."), e.length > n && N(t, `exceeds the ${n}-character limit.`), e;
401
- }
402
- function R(e, t) {
403
- return typeof e == "number" && Number.isFinite(e) || N(t, "must be a finite number."), e;
404
- }
405
- function z(e, t) {
406
- return typeof e != "string" && N(t, "must be a string."), e.length > 128 && N(t, "exceeds the 128-character limit."), O.test(e) || N(t, "must use lowercase kebab-case."), e;
407
- }
408
- function B(e, t) {
409
- P(e) || N(t, "must be an object.");
410
- let n = {}, r = Object.keys(e).sort();
411
- for (let i of r) A.has(i) && N(t, `locale "${i}" is not allowed.`), De.test(i) || N(t, `locale "${i}" must look like "en" or "zh-CN".`), n[i] = L(e[i], `${t}.${i}`, 256);
412
- return n;
413
- }
414
- function nt(e, t) {
415
- P(e) || N(t, "must be an object."), F(e, He, t);
416
- let n = {};
417
- return e.title !== void 0 && (n.title = B(e.title, `${t}.title`)), e.description !== void 0 && (n.description = B(e.description, `${t}.description`)), e.category !== void 0 && (n.category = L(e.category, `${t}.category`, 64)), e.insertText !== void 0 && (n.insertText = L(e.insertText, `${t}.insertText`, D)), n;
418
- }
419
- function rt(e, t, n) {
420
- P(e) || N(n, "must be an object."), F(e, Ue, n);
421
- let r = e.kind;
422
- typeof r == "string" && Ne.has(r) || N(`${n}.kind`, "must be \"none\", \"inline\" or \"markdown\".");
423
- let i = r;
424
- e.required !== void 0 && I(e.required, `${n}.required`);
425
- let a = e.required === !0;
426
- return t === "leaf" && i !== "none" && N(n, "a leaf component cannot declare body content."), t === "inline" && i === "markdown" && N(n, "an inline component cannot declare Markdown block content."), a && i === "none" && N(n, "cannot require body content of kind \"none\"."), {
427
- kind: i,
428
- ...a ? { required: !0 } : {}
429
- };
430
- }
431
- function it(e) {
432
- if (e !== void 0) return e.kind === "none" ? Object.freeze({
433
- rule: "none",
434
- label: "none"
435
- }) : e.kind === "inline" ? Object.freeze({
436
- rule: "inline",
437
- label: "none",
438
- inlineOnly: !0,
439
- noComponents: !0,
440
- ...e.required ? { min: 1 } : {}
441
- }) : Object.freeze({
442
- rule: "any",
443
- label: "none",
444
- ...e.required ? { min: 1 } : {}
445
- });
446
- }
447
- function V(e, t) {
448
- Array.isArray(e) || N(t, "must be an array of component names."), e.length > 32 && N(t, "accepts at most 32 names.");
449
- let n = /* @__PURE__ */ new Set(), r = [];
450
- for (let i of e) {
451
- let e = z(i, t);
452
- n.has(e) && N(t, `name "${e}" is declared more than once.`), n.add(e), r.push(e);
453
- }
454
- return r;
455
- }
456
- function at(e, t) {
457
- let n = R(e, t);
458
- return (!Number.isInteger(n) || n < 0) && N(t, "must be a nonnegative integer."), n;
459
- }
460
- function ot(e, t, n) {
461
- P(e) || N(n, "must be an object."), F(e, We, n);
462
- let r = e.rule;
463
- typeof r == "string" && Pe.has(r) || N(`${n}.rule`, "is not a supported child rule.");
464
- let i = r;
465
- t === "leaf" && i !== "none" && N(n, "a leaf component cannot declare body content."), t === "inline" && i !== "none" && i !== "inline" && i !== "any" && N(n, "an inline component only supports \"none\", \"inline\" or \"any\".");
466
- let o = { rule: i };
467
- if (e.label !== void 0 && (typeof e.label == "string" && Ie.has(e.label) || N(`${n}.label`, "must be \"none\", \"required\" or \"optional\"."), o.label = e.label), e.parents !== void 0 && (o.parents = V(e.parents, `${n}.parents`)), e.child !== void 0 && (o.child = z(e.child, `${n}.child`)), e.children !== void 0 && (o.children = V(e.children, `${n}.children`)), e.min !== void 0 && (o.min = U(e.min, `${n}.min`, a)), e.max !== void 0 && (o.max = U(e.max, `${n}.max`, a)), o.min !== void 0 && o.max !== void 0 && o.min > o.max && N(n, "\"min\" cannot exceed \"max\"."), e.inlineOnly !== void 0 && (o.inlineOnly = I(e.inlineOnly, `${n}.inlineOnly`)), e.noComponents !== void 0 && (o.noComponents = I(e.noComponents, `${n}.noComponents`)), e.valueAttribute !== void 0 && (o.valueAttribute = z(e.valueAttribute, `${n}.valueAttribute`)), e.generatedPrefix !== void 0) {
468
- let t = L(e.generatedPrefix, `${n}.generatedPrefix`, 128);
469
- t.length === 0 && N(`${n}.generatedPrefix`, "must not be empty."), o.generatedPrefix = t;
470
- }
471
- if (e.forbidSeparator !== void 0) {
472
- let t = L(e.forbidSeparator, `${n}.forbidSeparator`, 4);
473
- t.length === 0 && N(`${n}.forbidSeparator`, "must not be empty."), o.forbidSeparator = t;
474
- }
475
- return e.maxItems !== void 0 && (o.maxItems = U(e.maxItems, `${n}.maxItems`, a)), o;
476
- }
477
- function H(e, t) {
478
- return z(e, t);
479
- }
480
- function st(e, t) {
481
- return at(e, t);
482
- }
483
- function U(e, t, n) {
484
- let r = at(e, t);
485
- return r > n && N(t, `cannot exceed the kernel limit ${n}.`), r;
486
- }
487
- function W(e, t) {
488
- return V(e, t);
489
- }
490
- function ct(e, t) {
491
- return Array.isArray(e) || N(t, "must be an array of strings."), e.length > 32 && N(t, "accepts at most 32 values."), e.map((e) => L(e, t, 128));
492
- }
493
- function lt(e, t) {
494
- P(e) || N(t, "must be an object.");
495
- let n = e.kind;
496
- typeof n == "string" && Fe.has(n) || N(`${t}.kind`, "is not a supported rule.");
497
- let r = (n) => F(e, /* @__PURE__ */ new Set(["kind", ...n]), t), i = (n) => {
498
- let r = {};
499
- for (let i of n) e[i] !== void 0 && (r[i] = H(e[i], `${t}.${i}`));
500
- return r;
501
- };
502
- switch (n) {
503
- case "numeric-range": {
504
- r([
505
- "min",
506
- "max",
507
- "step",
508
- "order",
509
- "integer",
510
- "positiveInteger"
511
- ]);
512
- let a;
513
- return e.order !== void 0 && (e.order !== "nondecreasing" && e.order !== "increasing" && N(`${t}.order`, "must be \"nondecreasing\" or \"increasing\"."), a = e.order), {
514
- kind: n,
515
- ...i([
516
- "min",
517
- "max",
518
- "step",
519
- "integer",
520
- "positiveInteger"
521
- ]),
522
- ...a ? { order: a } : {}
523
- };
524
- }
525
- case "text-length": return r(["min", "max"]), {
526
- kind: n,
527
- ...i(["min", "max"])
528
- };
529
- case "date-bounds": return r([
530
- "min",
531
- "max",
532
- "required"
533
- ]), {
534
- kind: n,
535
- ...i([
536
- "min",
537
- "max",
538
- "required"
539
- ])
540
- };
541
- case "nonempty": return r(["attribute"]), {
542
- kind: n,
543
- attribute: H(e.attribute, `${t}.attribute`)
544
- };
545
- case "progress-bounds": return r([
546
- "value",
547
- "max",
548
- "defaultMax"
549
- ]), {
550
- kind: n,
551
- value: H(e.value, `${t}.value`),
552
- max: H(e.max, `${t}.max`),
553
- defaultMax: R(e.defaultMax, `${t}.defaultMax`)
554
- };
555
- case "timer-duration": return r(["attribute", "default"]), {
556
- kind: n,
557
- attribute: H(e.attribute, `${t}.attribute`),
558
- default: R(e.default, `${t}.default`)
559
- };
560
- case "option-count": return r(["max"]), {
561
- kind: n,
562
- ...e.max === void 0 ? {} : { max: H(e.max, `${t}.max`) }
563
- };
564
- case "selection-requires": return r(["key", "attributes"]), {
565
- kind: n,
566
- key: H(e.key, `${t}.key`),
567
- attributes: W(e.attributes, `${t}.attributes`)
568
- };
569
- case "inline-body": return r(["strict"]), {
570
- kind: n,
571
- ...e.strict === void 0 ? {} : { strict: I(e.strict, `${t}.strict`) }
572
- };
573
- case "no-components":
574
- case "math-body":
575
- case "inline-math-reads": return r([]), { kind: n };
576
- case "single-table": return r(["fallbackSingle"]), {
577
- kind: n,
578
- ...e.fallbackSingle === void 0 ? {} : { fallbackSingle: I(e.fallbackSingle, `${t}.fallbackSingle`) }
579
- };
580
- case "options-body": return r([
581
- "child",
582
- "valueAttribute",
583
- "unique",
584
- "max",
585
- "forbidSeparator"
586
- ]), {
587
- kind: n,
588
- child: H(e.child, `${t}.child`),
589
- valueAttribute: H(e.valueAttribute, `${t}.valueAttribute`),
590
- unique: e.unique === void 0 || I(e.unique, `${t}.unique`),
591
- ...e.max === void 0 ? {} : { max: U(e.max, `${t}.max`, a) },
592
- ...e.forbidSeparator === void 0 ? {} : { forbidSeparator: L(e.forbidSeparator, `${t}.forbidSeparator`, 4) }
593
- };
594
- case "value-sequence": return r([
595
- "child",
596
- "valueAttribute",
597
- "min",
598
- "generatedPrefix",
599
- "unique",
600
- "duplicateCode"
601
- ]), {
602
- kind: n,
603
- child: H(e.child, `${t}.child`),
604
- valueAttribute: H(e.valueAttribute, `${t}.valueAttribute`),
605
- min: st(e.min, `${t}.min`),
606
- generatedPrefix: L(e.generatedPrefix, `${t}.generatedPrefix`, 128),
607
- unique: e.unique === void 0 || I(e.unique, `${t}.unique`),
608
- ...e.duplicateCode === void 0 ? {} : { duplicateCode: L(e.duplicateCode, `${t}.duplicateCode`, 128) }
609
- };
610
- case "only-children": return r([
611
- "children",
612
- "min",
613
- "max",
614
- "maxCode",
615
- "onlyCode"
616
- ]), {
617
- kind: n,
618
- children: W(e.children, `${t}.children`),
619
- min: st(e.min, `${t}.min`),
620
- ...e.max === void 0 ? {} : { max: U(e.max, `${t}.max`, a) },
621
- ...e.maxCode === void 0 ? {} : { maxCode: L(e.maxCode, `${t}.maxCode`, 128) },
622
- ...e.onlyCode === void 0 ? {} : { onlyCode: L(e.onlyCode, `${t}.onlyCode`, 128) }
623
- };
624
- case "diagram-body": return r([
625
- "node",
626
- "edge",
627
- "id",
628
- "from",
629
- "to",
630
- "label"
631
- ]), {
632
- kind: n,
633
- node: H(e.node, `${t}.node`),
634
- edge: H(e.edge, `${t}.edge`),
635
- id: H(e.id, `${t}.id`),
636
- from: H(e.from, `${t}.from`),
637
- to: H(e.to, `${t}.to`),
638
- ...e.label === void 0 ? {} : { label: H(e.label, `${t}.label`) }
639
- };
640
- case "quiz-body": return r([
641
- "type",
642
- "answer",
643
- "tolerance",
644
- "child",
645
- "valueAttribute",
646
- "max"
647
- ]), {
648
- kind: n,
649
- type: H(e.type, `${t}.type`),
650
- answer: H(e.answer, `${t}.answer`),
651
- tolerance: H(e.tolerance, `${t}.tolerance`),
652
- child: H(e.child, `${t}.child`),
653
- valueAttribute: H(e.valueAttribute, `${t}.valueAttribute`),
654
- ...e.max === void 0 ? {} : { max: U(e.max, `${t}.max`, a) }
655
- };
656
- case "checklist-body": return r(["itemLimit"]), {
657
- kind: n,
658
- itemLimit: U(e.itemLimit, `${t}.itemLimit`, a)
659
- };
660
- case "dynamic-constraints":
661
- case "require-full-interpolation": return r(["attributes"]), {
662
- kind: n,
663
- attributes: W(e.attributes, `${t}.attributes`)
664
- };
665
- case "scoped-expressions": return r(["attributes", "scope"]), e.scope !== "row" && e.scope !== "validation" && N(`${t}.scope`, "must be \"row\" or \"validation\"."), {
666
- kind: n,
667
- attributes: W(e.attributes, `${t}.attributes`),
668
- scope: e.scope
669
- };
670
- case "row-values": return r([
671
- "rows",
672
- "key",
673
- "child",
674
- "childValue"
675
- ]), {
676
- kind: n,
677
- rows: H(e.rows, `${t}.rows`),
678
- key: H(e.key, `${t}.key`),
679
- child: H(e.child, `${t}.child`),
680
- childValue: H(e.childValue, `${t}.childValue`)
681
- };
682
- case "validation-rule": return r([
683
- "when",
684
- "fields",
685
- "message",
686
- "placement",
687
- "max"
688
- ]), e.placement !== "container" && e.placement !== "prose" && N(`${t}.placement`, "must be \"container\" or \"prose\"."), {
689
- kind: n,
690
- when: H(e.when, `${t}.when`),
691
- fields: H(e.fields, `${t}.fields`),
692
- message: H(e.message, `${t}.message`),
693
- placement: e.placement,
694
- max: U(e.max, `${t}.max`, 100)
695
- };
696
- case "anchor": return r(["id"]), {
697
- kind: n,
698
- id: H(e.id, `${t}.id`)
699
- };
700
- case "navigation": return r(["target"]), {
701
- kind: n,
702
- target: H(e.target, `${t}.target`)
703
- };
704
- case "data-table": return r([
705
- "rows",
706
- "key",
707
- "child",
708
- "childValue",
709
- "label",
710
- "maxRows",
711
- "defaultMaxRows",
712
- "documentRows",
713
- "documentCells",
714
- "maxColumns"
715
- ]), {
716
- kind: n,
717
- rows: H(e.rows, `${t}.rows`),
718
- key: H(e.key, `${t}.key`),
719
- child: H(e.child, `${t}.child`),
720
- childValue: H(e.childValue, `${t}.childValue`),
721
- label: H(e.label, `${t}.label`),
722
- maxRows: H(e.maxRows, `${t}.maxRows`),
723
- defaultMaxRows: U(e.defaultMaxRows, `${t}.defaultMaxRows`, d),
724
- documentRows: U(e.documentRows, `${t}.documentRows`, m),
725
- documentCells: U(e.documentCells, `${t}.documentCells`, h),
726
- maxColumns: U(e.maxColumns, `${t}.maxColumns`, 20)
727
- };
728
- case "plot-math": return r([
729
- "min",
730
- "max",
731
- "samples",
732
- "samplesAlias",
733
- "curves",
734
- "points"
735
- ]), {
736
- kind: n,
737
- min: H(e.min, `${t}.min`),
738
- max: H(e.max, `${t}.max`),
739
- samples: H(e.samples, `${t}.samples`),
740
- ...e.samplesAlias === void 0 ? {} : { samplesAlias: H(e.samplesAlias, `${t}.samplesAlias`) },
741
- curves: U(e.curves, `${t}.curves`, 16),
742
- points: U(e.points, `${t}.points`, l)
743
- };
744
- case "chart-table": return r([
745
- "chartKind",
746
- "x",
747
- "y"
748
- ]), {
749
- kind: n,
750
- chartKind: H(e.chartKind, `${t}.chartKind`),
751
- x: H(e.x, `${t}.x`),
752
- y: H(e.y, `${t}.y`)
753
- };
754
- case "timeline-table": return r(["headerSets"]), Array.isArray(e.headerSets) || N(`${t}.headerSets`, "must be an array."), {
755
- kind: n,
756
- headerSets: e.headerSets.map((e, n) => ct(e, `${t}.headerSets[${n}]`))
757
- };
758
- case "table-selection": return r(["key", "bindings"]), {
759
- kind: n,
760
- key: H(e.key, `${t}.key`),
761
- bindings: W(e.bindings, `${t}.bindings`)
762
- };
763
- case "retain": return r(["value"]), {
764
- kind: n,
765
- value: I(e.value, `${t}.value`)
766
- };
767
- case "self-binding-read": return r(["mode", "attribute"]), e.mode !== "always" && e.mode !== "attribute" && N(`${t}.mode`, "must be \"always\" or \"attribute\"."), {
768
- kind: n,
769
- mode: e.mode,
770
- ...e.attribute === void 0 ? {} : { attribute: H(e.attribute, `${t}.attribute`) }
771
- };
772
- case "value-date": return r([
773
- "min",
774
- "max",
775
- "required"
776
- ]), {
777
- kind: n,
778
- ...i([
779
- "min",
780
- "max",
781
- "required"
782
- ])
783
- };
784
- case "value-length": return r([
785
- "min",
786
- "max",
787
- "email",
788
- "emailType"
789
- ]), {
790
- kind: n,
791
- ...i([
792
- "min",
793
- "max",
794
- "email"
795
- ]),
796
- ...e.emailType === void 0 ? {} : { emailType: L(e.emailType, `${t}.emailType`, 128) }
797
- };
798
- case "value-required": return r(["required"]), {
799
- kind: n,
800
- required: H(e.required, `${t}.required`)
801
- };
802
- case "value-email": return r(["type", "value"]), {
803
- kind: n,
804
- ...i(["type"]),
805
- ...e.value === void 0 ? {} : { value: L(e.value, `${t}.value`, 128) }
806
- };
807
- default: N(`${t}.kind`, "is not a supported rule.");
808
- }
809
- }
810
- function ut(e) {
811
- Array.isArray(e) || N("rules", "must be an array."), e.length > 32 && N("rules", "accepts at most 32 rules.");
812
- let t = [];
813
- for (let n = 0; n < e.length; n += 1) t.push(lt(e[n], `rules[${n}]`));
814
- return t;
815
- }
816
- function dt(e) {
817
- Array.isArray(e) || N("slotRelations", "must be an array."), e.length > 16 && N("slotRelations", "accepts at most 16 relations.");
818
- let t = [];
819
- for (let n = 0; n < e.length; n += 1) {
820
- let r = e[n], i = `slotRelations[${n}]`;
821
- P(r) || N(i, "must be an object."), F(r, /* @__PURE__ */ new Set(["lower", "upper"]), i), t.push({
822
- lower: z(r.lower, `${i}.lower`),
823
- upper: z(r.upper, `${i}.upper`)
824
- });
825
- }
826
- return t;
827
- }
828
- function ft(e, t) {
829
- P(e) || N(t, "must be an object."), F(e, Ve, t);
830
- let n = (n) => e[n] !== void 0 && I(e[n], `${t}.${n}`);
831
- return {
832
- interactive: n("interactive"),
833
- static: n("static"),
834
- ssr: n("ssr"),
835
- offline: n("offline")
836
- };
837
- }
838
- function pt(e, t) {
839
- P(e) || N(t, "must be an object."), F(e, Re, t);
840
- let n = e.kind;
841
- typeof n == "string" && Oe.has(n) || N(`${t}.kind`, "must be \"string\", \"number\", \"boolean\" or \"enum\".");
842
- let r = n, i = { kind: r };
843
- for (let n of [
844
- "required",
845
- "static",
846
- "dynamic",
847
- "integer",
848
- "positive",
849
- "color",
850
- "nullable"
851
- ]) e[n] !== void 0 && (i[n] = I(e[n], `${t}.${n}`));
852
- i.static === !0 && i.dynamic === !0 && N(t, "cannot be both static and dynamic."), e.coerce !== void 0 && (e.coerce !== "text" && N(`${t}.coerce`, "must be \"text\"."), r !== "string" && N(`${t}.coerce`, "is only valid for kind \"string\"."), i.coerce = "text");
853
- let a = e.enum === void 0 ? e.values : e.enum, o = a !== void 0;
854
- if (r !== "enum") o && N(t, `"enum" is only valid for kind "enum", not "${r}".`);
855
- else {
856
- e.enum !== void 0 && e.values !== void 0 && N(t, "use \"enum\" or \"values\", not both."), Array.isArray(a) && a.length !== 0 || N(`${t}.enum`, "must be a non-empty string array."), a.length > 64 && N(`${t}.enum`, "accepts at most 64 values.");
857
- let n = /* @__PURE__ */ new Set(), r = [];
858
- for (let e of a) {
859
- let i = L(e, `${t}.enum`, 128);
860
- n.has(i) && N(`${t}.enum`, `value "${i}" is declared more than once.`), n.add(i), r.push(i);
861
- }
862
- i.enum = r;
863
- }
864
- let s = e.pattern !== void 0;
865
- if (r !== "string") s && N(t, `"pattern" is only valid for kind "string", not "${r}".`);
866
- else if (s) {
867
- typeof e.pattern != "string" && N(`${t}.pattern`, "must be a string."), e.pattern.length > 512 && N(`${t}.pattern`, "exceeds the 512-character limit.");
868
- try {
869
- new RegExp(e.pattern);
870
- } catch {
871
- N(`${t}.pattern`, "is not a valid regular expression.");
872
- }
873
- y(e.pattern) || N(`${t}.pattern`, "uses unsupported regex syntax; nested quantifiers, quantified alternation, backreferences and lookarounds are rejected."), i.pattern = e.pattern;
874
- }
875
- let c = e.min !== void 0, l = e.max !== void 0;
876
- if (r === "number" ? (c && (i.min = R(e.min, `${t}.min`)), l && (i.max = R(e.max, `${t}.max`)), i.min !== void 0 && i.max !== void 0 && i.min > i.max && N(t, "\"min\" cannot exceed \"max\".")) : ((c || l) && N(t, "\"min\" and \"max\" are only valid for kind \"number\"."), i.integer === !0 && N(t, "\"integer\" is only valid for kind \"number\"."), i.positive === !0 && N(t, "\"positive\" is only valid for kind \"number\".")), i.color === !0 && r !== "string" && N(t, "\"color\" is only valid for kind \"string\"."), e.description !== void 0 && (i.description = B(e.description, `${t}.description`)), e.default !== void 0) {
877
- let n = e.default;
878
- if (n === null) i.nullable !== !0 && N(`${t}.default`, "is null but the prop is not nullable."), i.default = null;
879
- else if (r === "string") i.default = L(n, `${t}.default`);
880
- else if (r === "number") {
881
- let e = R(n, `${t}.default`);
882
- i.integer === !0 && !Number.isInteger(e) && N(`${t}.default`, "must be an integer."), i.positive === !0 && !(e > 0) && N(`${t}.default`, "must be greater than zero."), i.min !== void 0 && e < i.min && N(`${t}.default`, `is below the minimum ${i.min}.`), i.max !== void 0 && e > i.max && N(`${t}.default`, `exceeds the maximum ${i.max}.`), i.default = e;
883
- } else if (r === "boolean") i.default = I(n, `${t}.default`);
884
- else {
885
- let e = L(n, `${t}.default`, 128);
886
- i.enum?.includes(e) || N(`${t}.default`, `"${e}" is not an allowed enum value.`), i.default = e;
887
- }
888
- if (i.pattern !== void 0 && r === "string" && typeof i.default == "string") {
889
- let e = !0;
890
- try {
891
- e = new RegExp(i.pattern).test(i.default);
892
- } catch {
893
- e = !1;
894
- }
895
- e || N(`${t}.default`, `does not match pattern ${i.pattern}.`);
896
- }
897
- }
898
- return i;
899
- }
900
- function mt(e, t) {
901
- P(e) || N(t, "must be an object with \"literal\" or \"prop\".");
902
- let n = Object.keys(e);
903
- n.length !== 1 && N(t, "must contain exactly one of \"literal\" or \"prop\".");
904
- let r = n[0];
905
- if (A.has(r) && N(t, `field "${r}" is not allowed.`), r === "literal") return { literal: R(e.literal, `${t}.literal`) };
906
- if (r === "prop") return { prop: z(e.prop, `${t}.prop`) };
907
- N(t, `unknown field "${r}"; use "literal" or "prop".`);
908
- }
909
- function ht(e, t, n, r) {
910
- P(e) || N(r, "must be an object."), F(e, Be, r);
911
- let i = {};
912
- for (let n of [
913
- "min",
914
- "max",
915
- "step"
916
- ]) {
917
- if (e[n] === void 0) continue;
918
- let a = mt(e[n], `${r}.${n}`);
919
- if ("prop" in a) {
920
- let e = t[a.prop];
921
- e === void 0 && N(`${r}.${n}`, `references undeclared prop "${a.prop}".`), e.kind !== "number" && N(`${r}.${n}`, `references prop "${a.prop}", which is not a number.`);
922
- }
923
- n === "step" && "literal" in a && !(a.literal > 0) && N(`${r}.step`, "must be greater than 0."), i[n] = a;
924
- }
925
- return n !== "number" && (i.min || i.max || i.step) && N(r, "\"min\", \"max\" and \"step\" are only valid for number bindings."), i.min && "literal" in i.min && i.max && "literal" in i.max && i.min.literal > i.max.literal && N(r, "\"min\" cannot exceed \"max\"."), i;
926
- }
927
- function gt(e, t) {
928
- if (e === "number") return t === "timer" ? /* @__PURE__ */ new Set([
929
- "duration",
930
- "min",
931
- "nearest-zero"
932
- ]) : /* @__PURE__ */ new Set([
933
- "min",
934
- "nearest-zero",
935
- "max-step"
936
- ]);
937
- if (e === "boolean") return /* @__PURE__ */ new Set(["false"]);
938
- if (e === "null") return /* @__PURE__ */ new Set(["empty"]);
939
- if (e === "array") return t === "checklist" ? /* @__PURE__ */ new Set(["checked", "empty-array"]) : /* @__PURE__ */ new Set(["empty-array"]);
940
- if (e === "number-array") return /* @__PURE__ */ new Set(["empty-array"]);
941
- switch (t) {
942
- case "choice":
943
- case "selection": return /* @__PURE__ */ new Set(["first-option", "none"]);
944
- case "tabs": return /* @__PURE__ */ new Set(["first-tab"]);
945
- case "steps": return /* @__PURE__ */ new Set(["first-step"]);
946
- case "diagram": return /* @__PURE__ */ new Set(["first-node"]);
947
- case "date": return /* @__PURE__ */ new Set(["empty"]);
948
- default: return /* @__PURE__ */ new Set(["empty"]);
949
- }
950
- }
951
- function _t(e, t, n, r = !1) {
952
- P(e) || N(n, "must be an object."), F(e, ze, n);
953
- let i = e.kind;
954
- typeof i == "string" && Ae.has(i) || N(`${n}.kind`, "must be \"string\", \"number\", \"boolean\", \"array\", \"number-array\" or \"null\".");
955
- let a = i, o = e.family;
956
- typeof o == "string" && je.has(o) || N(`${n}.family`, "must be a supported binding family.");
957
- let s = o;
958
- ({
959
- number: /* @__PURE__ */ new Set(["number", "timer"]),
960
- boolean: /* @__PURE__ */ new Set(["boolean"]),
961
- string: /* @__PURE__ */ new Set([
962
- "text",
963
- "choice",
964
- "date",
965
- "tabs",
966
- "diagram",
967
- "steps",
968
- "selection"
969
- ]),
970
- array: /* @__PURE__ */ new Set([
971
- "multi-select",
972
- "checklist",
973
- "collection"
974
- ]),
975
- "number-array": /* @__PURE__ */ new Set(["collection"]),
976
- null: /* @__PURE__ */ new Set(["text"])
977
- })[a]?.has(s) || N(`${n}.family`, `"${s}" is not supported for a ${a} binding.`);
978
- let c;
979
- if (e.options !== void 0) {
980
- a !== "string" && N(`${n}.options`, "is only valid for a string binding."), s !== "choice" && N(`${n}.options`, "requires family \"choice\".");
981
- let t = e.options;
982
- Array.isArray(t) && t.length !== 0 || N(`${n}.options`, "must be a non-empty string array."), t.length > 64 && N(`${n}.options`, "accepts at most 64 values.");
983
- let r = /* @__PURE__ */ new Set(), i = [];
984
- for (let e of t) {
985
- let t = L(e, `${n}.options`, 128);
986
- t.length === 0 && N(`${n}.options`, "values must be non-empty."), r.has(t) && N(`${n}.options`, `value "${t}" is declared more than once.`), r.add(t), i.push(t);
987
- }
988
- c = i;
989
- }
990
- a === "string" && s === "choice" && c === void 0 && !r && N(`${n}.options`, "is required for a choice binding."), s !== "choice" && c !== void 0 && N(`${n}.options`, "is only valid for family \"choice\".");
991
- let l = z(e.bind, `${n}.bind`), u = z(e.initial, `${n}.initial`);
992
- l === u && N(n, "\"bind\" and \"initial\" must name different attributes."), (M.has(l) || M.has(u)) && N(n, "binding attributes cannot use a reserved slot name."), (Object.hasOwn(t, l) || Object.hasOwn(t, u)) && N(n, "binding attributes are reserved and cannot be declared as props.");
993
- let d = gt(a, s), f;
994
- if (e.initialRule === void 0) switch (a) {
995
- case "number":
996
- f = s === "timer" ? "duration" : "nearest-zero";
997
- break;
998
- case "boolean":
999
- f = "false";
1000
- break;
1001
- case "array":
1002
- f = s === "checklist" ? "checked" : "empty-array";
1003
- break;
1004
- case "number-array":
1005
- f = "empty-array";
1006
- break;
1007
- case "null":
1008
- f = "empty";
1009
- break;
1010
- default: f = s === "choice" ? "first-option" : s === "tabs" ? "first-tab" : s === "steps" ? "first-step" : s === "diagram" ? "first-node" : s === "selection" ? "none" : "empty";
1011
- }
1012
- else typeof e.initialRule == "string" && Me.has(e.initialRule) || N(`${n}.initialRule`, "is not a supported initial rule."), f = e.initialRule;
1013
- d.has(f) || N(`${n}.initialRule`, `is not supported for a ${a} ${s} binding.`), e.required !== void 0 && I(e.required, `${n}.required`), e.exclusive !== void 0 && I(e.exclusive, `${n}.exclusive`), e.retain !== void 0 && I(e.retain, `${n}.retain`);
1014
- let p;
1015
- e.constraints !== void 0 && (p = ht(e.constraints, t, a, `${n}.constraints`));
1016
- let m;
1017
- if (e.maxItems !== void 0) {
1018
- if (a !== "array" && a !== "number-array" && N(`${n}.maxItems`, "is only valid for array or number-array bindings."), m = mt(e.maxItems, `${n}.maxItems`), "prop" in m) {
1019
- let e = t[m.prop];
1020
- e === void 0 && N(`${n}.maxItems`, `references undeclared prop "${m.prop}".`), e.kind !== "number" && N(`${n}.maxItems`, `references prop "${m.prop}", which is not a number.`), e.dynamic === !0 && N(`${n}.maxItems`, "requires a static numeric property.");
1021
- } else (!Number.isInteger(m.literal) || m.literal < 0) && N(`${n}.maxItems`, "must be a nonnegative integer.");
1022
- }
1023
- let h;
1024
- if (e.requiresAttributes !== void 0) {
1025
- h = V(e.requiresAttributes, `${n}.requiresAttributes`);
1026
- for (let e of h) Object.hasOwn(t, e) || N(`${n}.requiresAttributes`, `references undeclared prop "${e}".`);
1027
- }
1028
- let g;
1029
- if (e.compare !== void 0) {
1030
- g = V(e.compare, `${n}.compare`);
1031
- for (let e of g) Object.hasOwn(t, e) || N(`${n}.compare`, `references undeclared prop "${e}".`);
1032
- }
1033
- return {
1034
- kind: a,
1035
- family: s,
1036
- bind: l,
1037
- initial: u,
1038
- initialRule: f,
1039
- ...e.required === !0 ? { required: !0 } : {},
1040
- ...e.exclusive === !0 ? { exclusive: !0 } : {},
1041
- ...c ? { options: c } : {},
1042
- ...p ? { constraints: p } : {},
1043
- ...m ? { maxItems: m } : {},
1044
- ...h ? { requiresAttributes: h } : {},
1045
- ...g ? { compare: g } : {},
1046
- ...e.retain === !1 ? { retain: !1 } : {}
1047
- };
1048
- }
1049
- function vt(e, t) {
1050
- P(e) || N(t, "must be an object."), F(e, Ge, t);
1051
- let n = e.id;
1052
- (typeof n != "string" || !k.test(n) || n.length > 160) && N(`${t}.id`, "must be a lowercase namespaced id.");
1053
- let r;
1054
- if (e.version !== void 0) {
1055
- let n = e.version, i = T(n);
1056
- i === null && N(`${t}.version`, "must be an exact version or a supported range (exact, ^, ~, >=, <=, >, <)."), r = i.source;
1057
- }
1058
- return {
1059
- id: n,
1060
- ...r ? { version: r } : {}
1061
- };
1062
- }
1063
- function yt(e) {
1064
- P(e) || N("requires", "must be an object."), F(e, Ke, "requires");
1065
- let t;
1066
- if (e.kernel !== void 0) {
1067
- let n = T(e.kernel);
1068
- n === null && N("requires.kernel", "must be a supported kernel version range (exact, ^, ~, >=, <=, >, <)."), t = n.source;
1069
- }
1070
- return { ...t ? { kernel: t } : {} };
1071
- }
1072
- function bt(e, t) {
1073
- P(e) || N("replaces", "must be an object."), F(e, qe, "replaces");
1074
- let n = e.id;
1075
- (typeof n != "string" || !k.test(n) || n.length > 160) && N("replaces.id", "must be a lowercase namespaced id."), n !== t && N("replaces.id", "must equal the declaring manifest id.");
1076
- let r;
1077
- if (e.version !== void 0) {
1078
- let t = T(e.version);
1079
- t === null && N("replaces.version", "must be an exact version or a supported range (exact, ^, ~, >=, <=, >, <)."), r = t.source;
1080
- }
1081
- return {
1082
- id: n,
1083
- ...r ? { version: r } : {}
1084
- };
1085
- }
1086
- function xt(e) {
1087
- Array.isArray(e) || N("styles", "must be an array of style-resource ids."), e.length > 32 && N("styles", "accepts at most 32 resources.");
1088
- let t = /* @__PURE__ */ new Set(), n = [];
1089
- for (let r = 0; r < e.length; r += 1) {
1090
- let i = e[r];
1091
- (typeof i != "string" || i.length === 0 || i.length > 256) && N(`styles[${r}]`, "must be a non-empty string of at most 256 characters."), Je.test(i) || N(`styles[${r}]`, "must be a bounded resource id."), t.has(i) && N("styles", `resource "${i}" is declared more than once.`), t.add(i), n.push(i);
1092
- }
1093
- return n;
1094
- }
1095
- function G(e) {
1096
- if (typeof e == "object" && e && j.has(e)) return e;
1097
- P(e) || N("manifest", "must be an object."), F(e, Le, "manifest");
1098
- let t = e.id;
1099
- (typeof t != "string" || t.length > 160 || !k.test(t)) && N("id", "must be a lowercase namespaced id such as \"example/rating\".");
1100
- let n = z(e.name, "name"), r = e.version;
1101
- (typeof r != "string" || r.length > 64 || !Ee.test(r)) && N("version", "must be a semantic version such as 1.0.0."), e.protocol !== "reactive-md-component/v1" && N("protocol", `must be "${x}".`);
1102
- let i = e.form;
1103
- typeof i == "string" && ke.has(i) || N("form", "must be \"leaf\", \"inline\" or \"container\".");
1104
- let a = i;
1105
- P(e.props) || N("props", "must be an object.");
1106
- let o = Object.keys(e.props).sort();
1107
- o.length > 64 && N("props", "accepts at most 64 properties.");
1108
- let s = {};
1109
- for (let t of o) A.has(t) && N("props", `property "${t}" is not allowed.`), (!O.test(t) || t.length > 128) && N("props", `property "${t}" must use lowercase kebab-case.`), s[t] = pt(e.props[t], `props.${t}`);
1110
- let c;
1111
- if (e.bindings !== void 0) {
1112
- P(e.bindings) || N("bindings", "must be an object.");
1113
- let t = Object.keys(e.bindings);
1114
- t.length === 0 && N("bindings", "must declare at least one binding slot."), t.length > 16 && N("bindings", "accepts at most 16 slots.");
1115
- let n = {}, r = /* @__PURE__ */ new Set();
1116
- for (let i of t) {
1117
- A.has(i) && N("bindings", `field "${i}" is not allowed.`), Ye.test(i) || N("bindings", `slot "${i}" must be a letter followed by letters or digits.`), M.has(i) && N("bindings", `slot "${i}" is reserved by the runtime.`);
1118
- let t = _t(e.bindings[i], s, `bindings.${i}`, a === "container" && Array.isArray(e.rules) && e.rules.some((e) => P(e) && e.kind === "options-body"));
1119
- i !== "value" && (t.kind !== "number" || t.family !== "number") && N(`bindings.${i}`, "numeric named slots support kind \"number\" with family \"number\" in this contract."), i !== "value" && P(e.bindings[i]) && e.bindings[i].exclusive === !1 && N(`bindings.${i}.exclusive`, "named slots require exclusive ownership in this contract.");
1120
- for (let e of [t.bind, t.initial]) r.has(e) && N("bindings", `attribute "${e}" is claimed by more than one binding.`), r.add(e);
1121
- n[i] = i === "value" ? t : {
1122
- ...t,
1123
- exclusive: !0
1124
- };
1125
- }
1126
- c = n;
1127
- }
1128
- let l = e.children === void 0 ? void 0 : rt(e.children, a, "children");
1129
- e.children !== void 0 && e.structure !== void 0 && N("manifest", "cannot declare both \"children\" and \"structure\"; use \"structure\".");
1130
- let u = e.structure === void 0 ? it(l) : ot(e.structure, a, "structure"), d = e.rules === void 0 ? void 0 : ut(e.rules), f = e.slotRelations === void 0 ? void 0 : dt(e.slotRelations);
1131
- e.legacyHost !== void 0 && I(e.legacyHost, "legacyHost");
1132
- let p = ft(e.capabilities, "capabilities"), m = e.authoring === void 0 ? void 0 : nt(e.authoring, "authoring"), h = e.styles === void 0 ? void 0 : xt(e.styles), g = e.requires === void 0 ? void 0 : yt(e.requires), _ = e.replaces === void 0 ? void 0 : bt(e.replaces, t), v;
1133
- if (e.dependencies !== void 0) {
1134
- Array.isArray(e.dependencies) || N("dependencies", "must be an array."), e.dependencies.length > 16 && N("dependencies", "accepts at most 16 entries.");
1135
- let t = /* @__PURE__ */ new Set(), n = [];
1136
- for (let r = 0; r < e.dependencies.length; r += 1) {
1137
- let i = vt(e.dependencies[r], `dependencies[${r}]`);
1138
- t.has(i.id) && N("dependencies", `"${i.id}" is declared more than once.`), t.add(i.id), n.push(i);
1139
- }
1140
- v = n;
1141
- }
1142
- let y = {
1143
- id: t,
1144
- name: n,
1145
- version: r,
1146
- protocol: x,
1147
- form: a,
1148
- props: s,
1149
- ...c ? { bindings: c } : {},
1150
- ...l ? { children: l } : {},
1151
- ...u && !l ? { structure: u } : {},
1152
- ...d ? { rules: d } : {},
1153
- ...f ? { slotRelations: f } : {},
1154
- ...e.legacyHost === !0 ? { legacyHost: !0 } : {},
1155
- capabilities: p,
1156
- ...m ? { authoring: m } : {},
1157
- ...h ? { styles: h } : {},
1158
- ...g ? { requires: g } : {},
1159
- ...v ? { dependencies: v } : {},
1160
- ..._ ? { replaces: _ } : {}
1161
- };
1162
- tt(y) > 65536 && N("manifest", `serialized size exceeds the ${Te}-byte budget.`);
1163
- let b = Ct(y);
1164
- return j.add(b), b;
1165
- }
1166
- function St(e) {
1167
- return G(e);
1168
- }
1169
- function Ct(e) {
1170
- if (typeof e != "object" || !e) return e;
1171
- for (let t of Object.keys(e)) Ct(e[t]);
1172
- return Object.freeze(e);
1173
- }
1174
- function wt(e) {
1175
- return {
1176
- kind: e.kind,
1177
- ...e.required === !0 ? { required: !0 } : {},
1178
- ...e.static === !0 ? { static: !0 } : {},
1179
- ...e.dynamic === void 0 ? {} : { dynamic: e.dynamic },
1180
- ...e.default === void 0 ? {} : { default: e.default },
1181
- ...e.nullable === !0 ? { nullable: !0 } : {},
1182
- ...e.enum ? { enum: [...e.enum] } : {},
1183
- ...e.pattern === void 0 ? {} : { pattern: e.pattern },
1184
- ...e.min === void 0 ? {} : { min: e.min },
1185
- ...e.max === void 0 ? {} : { max: e.max },
1186
- ...e.integer === !0 ? { integer: !0 } : {},
1187
- ...e.positive === !0 ? { positive: !0 } : {},
1188
- ...e.color === !0 ? { color: !0 } : {},
1189
- ...e.coerce === void 0 ? {} : { coerce: e.coerce }
1190
- };
1191
- }
1192
- function K(e) {
1193
- return "literal" in e ? { literal: e.literal } : { prop: e.prop };
1194
- }
1195
- function Tt(e) {
1196
- return {
1197
- ...e.min ? { min: K(e.min) } : {},
1198
- ...e.max ? { max: K(e.max) } : {},
1199
- ...e.step ? { step: K(e.step) } : {}
1200
- };
1201
- }
1202
- function Et(e) {
1203
- let t = e.constraints;
1204
- return {
1205
- kind: e.kind,
1206
- family: e.family,
1207
- bind: e.bind,
1208
- initial: e.initial,
1209
- initialRule: e.initialRule,
1210
- ...e.required === !0 ? { required: !0 } : {},
1211
- ...e.exclusive === !0 ? { exclusive: !0 } : {},
1212
- ...e.options ? { options: [...e.options] } : {},
1213
- ...t ? { constraints: Tt(t) } : {},
1214
- ...e.maxItems ? { maxItems: K(e.maxItems) } : {},
1215
- ...e.requiresAttributes ? { requiresAttributes: [...e.requiresAttributes] } : {},
1216
- ...e.compare ? { compare: [...e.compare] } : {},
1217
- ...e.retain === !1 ? { retain: !1 } : {}
1218
- };
1219
- }
1220
- function Dt(e) {
1221
- return {
1222
- rule: e.rule,
1223
- ...e.label === void 0 ? {} : { label: e.label },
1224
- ...e.parents ? { parents: [...e.parents] } : {},
1225
- ...e.child === void 0 ? {} : { child: e.child },
1226
- ...e.children ? { children: [...e.children] } : {},
1227
- ...e.min === void 0 ? {} : { min: e.min },
1228
- ...e.max === void 0 ? {} : { max: e.max },
1229
- ...e.inlineOnly === void 0 ? {} : { inlineOnly: e.inlineOnly },
1230
- ...e.noComponents === void 0 ? {} : { noComponents: e.noComponents },
1231
- ...e.valueAttribute === void 0 ? {} : { valueAttribute: e.valueAttribute },
1232
- ...e.generatedPrefix === void 0 ? {} : { generatedPrefix: e.generatedPrefix },
1233
- ...e.forbidSeparator === void 0 ? {} : { forbidSeparator: e.forbidSeparator },
1234
- ...e.maxItems === void 0 ? {} : { maxItems: e.maxItems }
1235
- };
1236
- }
1237
- function Ot(e) {
1238
- let t = e, n = Object.keys(t).sort(), r = {};
1239
- for (let e of n) {
1240
- let n = t[e];
1241
- r[e] = Array.isArray(n) ? n.map((e) => Array.isArray(e) ? [...e] : e) : n;
1242
- }
1243
- return r;
1244
- }
1245
- function kt(e) {
1246
- let t = {};
1247
- for (let n of Object.keys(e.props).sort()) t[n] = wt(e.props[n]);
1248
- let n = {};
1249
- if (e.bindings) for (let t of Object.keys(e.bindings).sort()) n[t] = Et(e.bindings[t]);
1250
- return {
1251
- protocol: e.protocol,
1252
- id: e.id,
1253
- name: e.name,
1254
- version: e.version,
1255
- form: e.form,
1256
- props: t,
1257
- ...e.bindings ? { bindings: n } : {},
1258
- ...e.children ? { children: {
1259
- kind: e.children.kind,
1260
- ...e.children.required ? { required: !0 } : {}
1261
- } } : {},
1262
- ...e.structure ? { structure: Dt(e.structure) } : {},
1263
- ...e.rules ? { rules: e.rules.map(Ot) } : {},
1264
- ...e.slotRelations ? { slotRelations: e.slotRelations.map((e) => ({ ...e })) } : {},
1265
- capabilities: {
1266
- interactive: e.capabilities.interactive,
1267
- static: e.capabilities.static,
1268
- ssr: e.capabilities.ssr,
1269
- offline: e.capabilities.offline
1270
- },
1271
- ...e.styles ? { styles: [...e.styles] } : {},
1272
- ...e.requires?.kernel ? { requires: { kernel: e.requires.kernel } } : {},
1273
- ...e.dependencies ? { dependencies: [...e.dependencies].map((e) => ({ ...e })).sort((e, t) => e.id < t.id ? -1 : +(e.id > t.id)) } : {},
1274
- ...e.replaces ? { replaces: {
1275
- id: e.replaces.id,
1276
- ...e.replaces.version ? { version: e.replaces.version } : {}
1277
- } } : {}
1278
- };
1279
- }
1280
- var At = /* @__PURE__ */ new WeakMap();
1281
- function q(e) {
1282
- let t = j.has(e) ? e : G(e), n = At.get(t);
1283
- if (n !== void 0) return n;
1284
- let r = _(JSON.stringify(kt(t)));
1285
- return At.set(t, r), r;
1286
- }
1287
- function jt(e) {
1288
- return Object.freeze({
1289
- id: e.id,
1290
- name: e.name,
1291
- version: e.version,
1292
- digest: q(e)
1293
- });
1294
- }
1295
- function Mt(e) {
1296
- return typeof e == "string" && e.length <= 128 && O.test(e);
1297
- }
1298
- function J(e) {
1299
- return typeof e == "string" && e.length > 0 && e.length <= 160 && k.test(e);
1300
- }
1301
- // src/presets/identity.ts
1302
- var Nt = "reactive-md/default", Pt = "reactive-md/minimal", Ft = b, It = 160, Lt = 256, Rt = 32, zt = 256, Bt = 4096, Vt = /^[a-z0-9][a-z0-9._-]*(?:\/[a-z0-9][a-z0-9._-]*)*$/, Ht = /* @__PURE__ */ new Set([
1303
- "__proto__",
1304
- "constructor",
1305
- "prototype"
1306
- ]), Ut = /* @__PURE__ */ new Set([
1307
- "protocol",
1308
- "id",
1309
- "version",
1310
- "components",
1311
- "authoring",
1312
- "themes",
1313
- "dependencies",
1314
- "metadata"
1315
- ]), Wt = /* @__PURE__ */ new Set([
1316
- "title",
1317
- "description",
1318
- "category",
1319
- "insertText"
1320
- ]), Gt = /* @__PURE__ */ new Set(["title", "description"]), Kt = /* @__PURE__ */ new Set(["id", "version"]), qt = /* @__PURE__ */ new WeakSet();
1321
- function Y(e, t) {
1322
- throw Error(`Invalid local preset (${e}): ${t}`);
1323
- }
1324
- function X(e) {
1325
- if (typeof e != "object" || !e || Array.isArray(e)) return !1;
1326
- let t = Object.getPrototypeOf(e);
1327
- return t === Object.prototype || t === null;
1328
- }
1329
- function Z(e, t, n) {
1330
- for (let r of Object.keys(e)) Ht.has(r) && Y(n, `field "${r}" is not allowed.`), t.has(r) || Y(n, `unknown field "${r}".`);
1331
- }
1332
- function Q(e, t) {
1333
- X(e) || Y(t, "must be a locale-keyed string map.");
1334
- let n = {};
1335
- for (let r of Object.keys(e).sort()) {
1336
- Ht.has(r) && Y(t, `locale "${r}" is not allowed.`), /^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/.test(r) || Y(t, `locale "${r}" must look like "en" or "zh-CN".`);
1337
- let i = e[r];
1338
- (typeof i != "string" || i.length > Bt) && Y(t, `locale "${r}" must be a bounded string.`), n[r] = i;
1339
- }
1340
- return Object.freeze(n);
1341
- }
1342
- function Jt(e) {
1343
- X(e) || Y("authoring", "must be an object."), Z(e, Wt, "authoring");
1344
- let t = {};
1345
- return e.title !== void 0 && (t.title = Q(e.title, "authoring.title")), e.description !== void 0 && (t.description = Q(e.description, "authoring.description")), e.category !== void 0 && ((typeof e.category != "string" || e.category.length > 64) && Y("authoring.category", "must be a bounded string."), t.category = e.category), e.insertText !== void 0 && ((typeof e.insertText != "string" || e.insertText.length > Bt) && Y("authoring.insertText", "must be a bounded string."), t.insertText = e.insertText), Object.freeze(t);
1346
- }
1347
- function Yt(e, t) {
1348
- Array.isArray(e) || Y("authoring", "must be an array."), e.length > zt && Y("authoring", `accepts at most ${zt} entries.`);
1349
- let n = new Set(t.map((e) => e.id)), r = /* @__PURE__ */ new Set(), i = [];
1350
- for (let t = 0; t < e.length; t += 1) {
1351
- let a = e[t];
1352
- X(a) || Y(`authoring[${t}]`, "must be an object."), Z(a, /* @__PURE__ */ new Set(["componentId", "authoring"]), `authoring[${t}]`);
1353
- let o = a.componentId;
1354
- typeof o == "string" && J(o) || Y(`authoring[${t}].componentId`, "must be a lowercase namespaced id."), n.has(o) || Y(`authoring[${t}].componentId`, `"${o}" is not declared by this preset.`), r.has(o) && Y("authoring", `component "${o}" is declared more than once.`), r.add(o), i.push(Object.freeze({
1355
- componentId: o,
1356
- authoring: Jt(a.authoring)
1357
- }));
1358
- }
1359
- return Object.freeze(i.sort((e, t) => e.componentId < t.componentId ? -1 : +(e.componentId > t.componentId)));
1360
- }
1361
- function Xt(e) {
1362
- Array.isArray(e) || Y("dependencies", "must be an array."), e.length > Rt && Y("dependencies", `accepts at most ${Rt} entries.`);
1363
- let t = /* @__PURE__ */ new Set(), n = [];
1364
- for (let r = 0; r < e.length; r += 1) {
1365
- let i = e[r];
1366
- X(i) || Y(`dependencies[${r}]`, "must be an object."), Z(i, Kt, `dependencies[${r}]`);
1367
- let a = i.id;
1368
- typeof a == "string" && J(a) || Y(`dependencies[${r}].id`, "must be a lowercase namespaced id."), t.has(a) && Y("dependencies", `"${a}" is declared more than once.`), t.add(a);
1369
- let o = i.version;
1370
- typeof o == "string" && E(o) || Y(`dependencies[${r}].version`, "must be an exact semantic version."), n.push(Object.freeze({
1371
- id: a,
1372
- version: o
1373
- }));
1374
- }
1375
- return Object.freeze(n.sort((e, t) => e.id < t.id ? -1 : +(e.id > t.id)));
1376
- }
1377
- function Zt(e) {
1378
- Array.isArray(e) || Y("themes", "must be an array.");
1379
- let t = [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
1380
- for (let i = 0; i < e.length; i += 1) {
1381
- let a = e[i];
1382
- X(a) || Y(`themes[${i}]`, "must be an object.");
1383
- let o = a.id, s = a.name, c = a.version;
1384
- (typeof o != "string" || o.length === 0) && Y(`themes[${i}].id`, "must be a non-empty string."), (typeof s != "string" || s.length === 0) && Y(`themes[${i}].name`, "must be a non-empty string."), typeof c == "string" && E(c) || Y(`themes[${i}].version`, "must be a semantic version."), n.has(o) && Y("themes", `theme id "${o}" is declared more than once.`), r.has(s) && Y("themes", `theme name "${s}" is declared more than once.`), n.add(o), r.add(s), t.push(Object.freeze({ ...a }));
1385
- }
1386
- return Object.freeze(t.sort((e, t) => e.id < t.id ? -1 : +(e.id > t.id)));
1387
- }
1388
- function Qt(e) {
1389
- return X(e) || Y("metadata", "must be an object."), Z(e, Gt, "metadata"), Object.freeze({
1390
- ...e.title === void 0 ? {} : { title: Q(e.title, "metadata.title") },
1391
- ...e.description === void 0 ? {} : { description: Q(e.description, "metadata.description") }
1392
- });
1393
- }
1394
- function $(e) {
1395
- if (X(e) && qt.has(e)) return e;
1396
- X(e) || Y("preset", "must be an object."), Z(e, Ut, "preset"), e.protocol !== "reactive-md-preset/v1" && Y("protocol", `must be "${S}".`);
1397
- let t = e.id;
1398
- (typeof t != "string" || t.length > It || !Vt.test(t)) && Y("id", "must be a lowercase namespaced id.");
1399
- let n = e.version;
1400
- typeof n == "string" && E(n) || Y("version", "must be a semantic version such as \"1.0.0\"."), Array.isArray(e.components) || Y("components", "must be an array."), e.components.length > Lt && Y("components", `accepts at most ${Lt} components.`);
1401
- let r = [], i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
1402
- for (let t = 0; t < e.components.length; t += 1) {
1403
- let n;
1404
- try {
1405
- n = St(e.components[t]);
1406
- } catch (e) {
1407
- Y(`components[${t}]`, e instanceof Error ? e.message : String(e));
1408
- }
1409
- i.has(n.id) && Y("components", `component id "${n.id}" is declared more than once.`), a.has(n.name) && Y("components", `component name "${n.name}" is declared more than once.`), i.add(n.id), a.add(n.name), r.push(n);
1410
- }
1411
- let o = e.authoring === void 0 ? void 0 : Yt(e.authoring, r), s = e.themes === void 0 ? void 0 : Zt(e.themes), c = e.dependencies === void 0 ? void 0 : Xt(e.dependencies), l = e.metadata === void 0 ? void 0 : Qt(e.metadata), u = e.components, d = Object.isFrozen(u) && u.length === r.length && u.every((e, t) => e === r[t]) ? u : Object.freeze(r), f = Object.freeze({
1412
- protocol: S,
1413
- id: t,
1414
- version: n,
1415
- components: d,
1416
- ...o ? { authoring: o } : {},
1417
- ...s ? { themes: s } : {},
1418
- ...c ? { dependencies: c } : {},
1419
- ...l ? { metadata: l } : {}
1420
- });
1421
- return qt.add(f), f;
1422
- }
1423
- function $t(e) {
1424
- return $(e);
1425
- }
1426
- function en(e) {
1427
- let t = $(e);
1428
- return _(JSON.stringify({
1429
- protocol: S,
1430
- id: t.id,
1431
- version: t.version,
1432
- components: [...t.components].map((e) => ({
1433
- id: e.id,
1434
- version: e.version,
1435
- digest: q(e)
1436
- })).sort((e, t) => e.id < t.id ? -1 : +(e.id > t.id)),
1437
- dependencies: [...t.dependencies ?? []].map((e) => ({
1438
- id: e.id,
1439
- version: e.version
1440
- })).sort((e, t) => e.id < t.id ? -1 : +(e.id > t.id))
1441
- }));
1442
- }
1443
- export { a as $, tt as A, b as B, ye as C, Mt as D, J as E, ee as F, pe as G, ae as H, te as I, _ as J, T as K, ie as L, G as M, re as N, q as O, x as P, t as Q, S as R, we as S, St as T, E as U, oe as V, me as W, r as X, f as Y, n as Z, Ze as _, Ft as a, e as at, $e as b, Xe as c, u as ct, be as d, g as dt, h as et, ve as f, ge as g, xe as h, Nt as i, s as it, it as j, jt as k, he as l, i as lt, _e as m, en as n, p as nt, Pt as o, c as ot, Te as p, y as q, $ as r, d as rt, et as s, l as st, $t as t, m as tt, Se as u, o as ut, Qe as v, kt as w, Ce as x, D as y, ne as z };