@softistx/alxia-react-router 0.0.0-stage → 0.83.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (609) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2085 -2
  3. package/dist/api-keys/api-keys.d.ts +93 -0
  4. package/dist/api-keys/api-keys.d.ts.map +1 -0
  5. package/dist/api-keys/index.d.ts +9 -0
  6. package/dist/api-keys/index.d.ts.map +1 -0
  7. package/dist/api-keys/index.js +66 -0
  8. package/dist/api-keys/index.js.map +10 -0
  9. package/dist/assets.d.ts +14 -0
  10. package/dist/assets.d.ts.map +1 -0
  11. package/dist/chunks/index-0786n4qe.js +25 -0
  12. package/dist/chunks/index-0786n4qe.js.map +10 -0
  13. package/dist/chunks/index-1nw5yeek.js +169 -0
  14. package/dist/chunks/index-1nw5yeek.js.map +11 -0
  15. package/dist/chunks/index-59vhfj6n.js +10 -0
  16. package/dist/chunks/index-59vhfj6n.js.map +10 -0
  17. package/dist/chunks/index-5gqcpyyg.js +34 -0
  18. package/dist/chunks/index-5gqcpyyg.js.map +10 -0
  19. package/dist/chunks/index-6jf7zpxz.js +119 -0
  20. package/dist/chunks/index-6jf7zpxz.js.map +11 -0
  21. package/dist/chunks/index-8as4j8m3.js +340 -0
  22. package/dist/chunks/index-8as4j8m3.js.map +16 -0
  23. package/dist/chunks/index-9xv2a8et.js +108 -0
  24. package/dist/chunks/index-9xv2a8et.js.map +11 -0
  25. package/dist/chunks/index-ajtvyq35.js +16 -0
  26. package/dist/chunks/index-ajtvyq35.js.map +10 -0
  27. package/dist/chunks/index-c55hxgr5.js +124 -0
  28. package/dist/chunks/index-c55hxgr5.js.map +14 -0
  29. package/dist/chunks/index-d42p3mdp.js +19 -0
  30. package/dist/chunks/index-d42p3mdp.js.map +10 -0
  31. package/dist/chunks/index-gac44rs5.js +42 -0
  32. package/dist/chunks/index-gac44rs5.js.map +11 -0
  33. package/dist/chunks/index-j4ktpcke.js +62 -0
  34. package/dist/chunks/index-j4ktpcke.js.map +10 -0
  35. package/dist/chunks/index-mscfme4r.js +12 -0
  36. package/dist/chunks/index-mscfme4r.js.map +10 -0
  37. package/dist/chunks/index-pghmb2dm.js +30 -0
  38. package/dist/chunks/index-pghmb2dm.js.map +10 -0
  39. package/dist/chunks/index-rfr02vg4.js +40 -0
  40. package/dist/chunks/index-rfr02vg4.js.map +10 -0
  41. package/dist/chunks/index-sfhshxqz.js +31 -0
  42. package/dist/chunks/index-sfhshxqz.js.map +10 -0
  43. package/dist/chunks/index-skwypsjz.js +357 -0
  44. package/dist/chunks/index-skwypsjz.js.map +12 -0
  45. package/dist/chunks/index-sxh06ged.js +118 -0
  46. package/dist/chunks/index-sxh06ged.js.map +11 -0
  47. package/dist/chunks/index-t2ph23wk.js +96 -0
  48. package/dist/chunks/index-t2ph23wk.js.map +13 -0
  49. package/dist/chunks/index-thyabr5n.js +19 -0
  50. package/dist/chunks/index-thyabr5n.js.map +10 -0
  51. package/dist/chunks/index-tx36swjx.js +134 -0
  52. package/dist/chunks/index-tx36swjx.js.map +11 -0
  53. package/dist/chunks/index-v2z5k640.js +54 -0
  54. package/dist/chunks/index-v2z5k640.js.map +11 -0
  55. package/dist/chunks/index-vr82typq.js +23 -0
  56. package/dist/chunks/index-vr82typq.js.map +11 -0
  57. package/dist/chunks/index-whj6h5eg.js +9 -0
  58. package/dist/chunks/index-whj6h5eg.js.map +10 -0
  59. package/dist/chunks/index-wyypkfdv.js +130 -0
  60. package/dist/chunks/index-wyypkfdv.js.map +13 -0
  61. package/dist/chunks/index-xd5aqy3g.js +90 -0
  62. package/dist/chunks/index-xd5aqy3g.js.map +10 -0
  63. package/dist/chunks/index-zdbqzcjp.js +97 -0
  64. package/dist/chunks/index-zdbqzcjp.js.map +12 -0
  65. package/dist/chunks/index-zyg8amjc.js +23 -0
  66. package/dist/chunks/index-zyg8amjc.js.map +10 -0
  67. package/dist/cli/index.d.ts +3 -0
  68. package/dist/cli/index.d.ts.map +1 -0
  69. package/dist/cli/index.js +215 -0
  70. package/dist/cli/index.js.map +13 -0
  71. package/dist/cli/main.d.ts +13 -0
  72. package/dist/cli/main.d.ts.map +1 -0
  73. package/dist/cli/reveal.d.ts +18 -0
  74. package/dist/cli/reveal.d.ts.map +1 -0
  75. package/dist/cli/template.d.ts +8 -0
  76. package/dist/cli/template.d.ts.map +1 -0
  77. package/dist/context.d.ts +104 -0
  78. package/dist/context.d.ts.map +1 -0
  79. package/dist/document/index.d.ts +11 -0
  80. package/dist/document/index.d.ts.map +1 -0
  81. package/dist/document/index.js +19 -0
  82. package/dist/document/index.js.map +9 -0
  83. package/dist/document/inline-script.d.ts +27 -0
  84. package/dist/document/inline-script.d.ts.map +1 -0
  85. package/dist/document/language-store.d.ts +8 -0
  86. package/dist/document/language-store.d.ts.map +1 -0
  87. package/dist/document/nonce.d.ts +34 -0
  88. package/dist/document/nonce.d.ts.map +1 -0
  89. package/dist/document/page-language.d.ts +39 -0
  90. package/dist/document/page-language.d.ts.map +1 -0
  91. package/dist/document/text-direction.d.ts +10 -0
  92. package/dist/document/text-direction.d.ts.map +1 -0
  93. package/dist/entry/abort.d.ts +21 -0
  94. package/dist/entry/abort.d.ts.map +1 -0
  95. package/dist/entry/create-entry.d.ts +41 -0
  96. package/dist/entry/create-entry.d.ts.map +1 -0
  97. package/dist/entry/index.d.ts +8 -0
  98. package/dist/entry/index.d.ts.map +1 -0
  99. package/dist/entry/index.js +154 -0
  100. package/dist/entry/index.js.map +13 -0
  101. package/dist/entry/root-data.d.ts +27 -0
  102. package/dist/entry/root-data.d.ts.map +1 -0
  103. package/dist/entry/whole-page.d.ts +10 -0
  104. package/dist/entry/whole-page.d.ts.map +1 -0
  105. package/dist/errors/api-error.d.ts +117 -0
  106. package/dist/errors/api-error.d.ts.map +1 -0
  107. package/dist/errors/api-errors.d.ts +122 -0
  108. package/dist/errors/api-errors.d.ts.map +1 -0
  109. package/dist/errors/call-failure.d.ts +45 -0
  110. package/dist/errors/call-failure.d.ts.map +1 -0
  111. package/dist/errors/catalogue-check.d.ts +24 -0
  112. package/dist/errors/catalogue-check.d.ts.map +1 -0
  113. package/dist/errors/catalogue-read.d.ts +33 -0
  114. package/dist/errors/catalogue-read.d.ts.map +1 -0
  115. package/dist/errors/catalogue.d.ts +59 -0
  116. package/dist/errors/catalogue.d.ts.map +1 -0
  117. package/dist/errors/code-resolver.d.ts +44 -0
  118. package/dist/errors/code-resolver.d.ts.map +1 -0
  119. package/dist/errors/cross-site.d.ts +8 -0
  120. package/dist/errors/cross-site.d.ts.map +1 -0
  121. package/dist/errors/describe-refusal.d.ts +6 -0
  122. package/dist/errors/describe-refusal.d.ts.map +1 -0
  123. package/dist/errors/describe.d.ts +3 -0
  124. package/dist/errors/describe.d.ts.map +1 -0
  125. package/dist/errors/fetcher-result.d.ts +33 -0
  126. package/dist/errors/fetcher-result.d.ts.map +1 -0
  127. package/dist/errors/field-placement.d.ts +12 -0
  128. package/dist/errors/field-placement.d.ts.map +1 -0
  129. package/dist/errors/form-errors.d.ts +8 -0
  130. package/dist/errors/form-errors.d.ts.map +1 -0
  131. package/dist/errors/form-refusal.d.ts +25 -0
  132. package/dist/errors/form-refusal.d.ts.map +1 -0
  133. package/dist/errors/index.d.ts +21 -0
  134. package/dist/errors/index.d.ts.map +1 -0
  135. package/dist/errors/index.js +588 -0
  136. package/dist/errors/index.js.map +26 -0
  137. package/dist/errors/json-actions.d.ts +38 -0
  138. package/dist/errors/json-actions.d.ts.map +1 -0
  139. package/dist/errors/log.d.ts +8 -0
  140. package/dist/errors/log.d.ts.map +1 -0
  141. package/dist/errors/message-values.d.ts +11 -0
  142. package/dist/errors/message-values.d.ts.map +1 -0
  143. package/dist/errors/messages.d.ts +63 -0
  144. package/dist/errors/messages.d.ts.map +1 -0
  145. package/dist/errors/page-path.d.ts +9 -0
  146. package/dist/errors/page-path.d.ts.map +1 -0
  147. package/dist/errors/problem-error.d.ts +50 -0
  148. package/dist/errors/problem-error.d.ts.map +1 -0
  149. package/dist/errors/provider.d.ts +20 -0
  150. package/dist/errors/provider.d.ts.map +1 -0
  151. package/dist/errors/request-id.d.ts +5 -0
  152. package/dist/errors/request-id.d.ts.map +1 -0
  153. package/dist/errors/route-error.d.ts +33 -0
  154. package/dist/errors/route-error.d.ts.map +1 -0
  155. package/dist/errors/route-refusal.d.ts +20 -0
  156. package/dist/errors/route-refusal.d.ts.map +1 -0
  157. package/dist/errors/same-site.d.ts +49 -0
  158. package/dist/errors/same-site.d.ts.map +1 -0
  159. package/dist/errors/section-action.d.ts +46 -0
  160. package/dist/errors/section-action.d.ts.map +1 -0
  161. package/dist/errors/standard-schema.d.ts +34 -0
  162. package/dist/errors/standard-schema.d.ts.map +1 -0
  163. package/dist/errors/submit-form.d.ts +16 -0
  164. package/dist/errors/submit-form.d.ts.map +1 -0
  165. package/dist/errors/upstream-headers.d.ts +18 -0
  166. package/dist/errors/upstream-headers.d.ts.map +1 -0
  167. package/dist/errors/use-json-fetcher.d.ts +18 -0
  168. package/dist/errors/use-json-fetcher.d.ts.map +1 -0
  169. package/dist/fetcher/auth-refusal.d.ts +29 -0
  170. package/dist/fetcher/auth-refusal.d.ts.map +1 -0
  171. package/dist/fetcher/index.d.ts +20 -0
  172. package/dist/fetcher/index.d.ts.map +1 -0
  173. package/dist/fetcher/index.js +392 -0
  174. package/dist/fetcher/index.js.map +21 -0
  175. package/dist/fetcher/section-form.d.ts +24 -0
  176. package/dist/fetcher/section-form.d.ts.map +1 -0
  177. package/dist/fetcher/section-reload.d.ts +17 -0
  178. package/dist/fetcher/section-reload.d.ts.map +1 -0
  179. package/dist/fetcher/section-save.d.ts +29 -0
  180. package/dist/fetcher/section-save.d.ts.map +1 -0
  181. package/dist/fetcher/use-debounced-fetcher.d.ts +57 -0
  182. package/dist/fetcher/use-debounced-fetcher.d.ts.map +1 -0
  183. package/dist/fetcher/use-fetcher-answer.d.ts +16 -0
  184. package/dist/fetcher/use-fetcher-answer.d.ts.map +1 -0
  185. package/dist/fetcher/use-fetcher-done.d.ts +15 -0
  186. package/dist/fetcher/use-fetcher-done.d.ts.map +1 -0
  187. package/dist/fetcher/use-fetcher-promise.d.ts +48 -0
  188. package/dist/fetcher/use-fetcher-promise.d.ts.map +1 -0
  189. package/dist/fetcher/use-form-refusal.d.ts +20 -0
  190. package/dist/fetcher/use-form-refusal.d.ts.map +1 -0
  191. package/dist/fetcher/use-revalidate-on-focus.d.ts +20 -0
  192. package/dist/fetcher/use-revalidate-on-focus.d.ts.map +1 -0
  193. package/dist/fetcher/use-row-save.d.ts +32 -0
  194. package/dist/fetcher/use-row-save.d.ts.map +1 -0
  195. package/dist/fetcher/use-section-save.d.ts +46 -0
  196. package/dist/fetcher/use-section-save.d.ts.map +1 -0
  197. package/dist/fetcher/use-visible-interval.d.ts +24 -0
  198. package/dist/fetcher/use-visible-interval.d.ts.map +1 -0
  199. package/dist/fetcher/use-visible-revalidation.d.ts +10 -0
  200. package/dist/fetcher/use-visible-revalidation.d.ts.map +1 -0
  201. package/dist/health.d.ts +21 -0
  202. package/dist/health.d.ts.map +1 -0
  203. package/dist/help/check/check.d.ts +35 -0
  204. package/dist/help/check/check.d.ts.map +1 -0
  205. package/dist/help/check/index.d.ts +8 -0
  206. package/dist/help/check/index.d.ts.map +1 -0
  207. package/dist/help/check/index.js +17 -0
  208. package/dist/help/check/index.js.map +9 -0
  209. package/dist/help/check/routes.d.ts +22 -0
  210. package/dist/help/check/routes.d.ts.map +1 -0
  211. package/dist/help/guide.d.ts +33 -0
  212. package/dist/help/guide.d.ts.map +1 -0
  213. package/dist/help/index.d.ts +16 -0
  214. package/dist/help/index.d.ts.map +1 -0
  215. package/dist/help/index.js +192 -0
  216. package/dist/help/index.js.map +14 -0
  217. package/dist/help/load.d.ts +39 -0
  218. package/dist/help/load.d.ts.map +1 -0
  219. package/dist/help/panel.d.ts +69 -0
  220. package/dist/help/panel.d.ts.map +1 -0
  221. package/dist/help/parse-flow.d.ts +27 -0
  222. package/dist/help/parse-flow.d.ts.map +1 -0
  223. package/dist/help/react.d.ts +12 -0
  224. package/dist/help/react.d.ts.map +1 -0
  225. package/dist/help/resolve.d.ts +24 -0
  226. package/dist/help/resolve.d.ts.map +1 -0
  227. package/dist/help/types.d.ts +50 -0
  228. package/dist/help/types.d.ts.map +1 -0
  229. package/dist/help/yaml.d.ts +18 -0
  230. package/dist/help/yaml.d.ts.map +1 -0
  231. package/dist/index.d.ts +7 -0
  232. package/dist/index.d.ts.map +1 -0
  233. package/dist/index.js +197 -0
  234. package/dist/index.js.map +14 -0
  235. package/dist/link/index.d.ts +7 -0
  236. package/dist/link/index.d.ts.map +1 -0
  237. package/dist/link/index.js +16 -0
  238. package/dist/link/index.js.map +10 -0
  239. package/dist/link/router-link.d.ts +27 -0
  240. package/dist/link/router-link.d.ts.map +1 -0
  241. package/dist/lists/connection-page.d.ts +50 -0
  242. package/dist/lists/connection-page.d.ts.map +1 -0
  243. package/dist/lists/index.d.ts +13 -0
  244. package/dist/lists/index.d.ts.map +1 -0
  245. package/dist/lists/index.js +205 -0
  246. package/dist/lists/index.js.map +15 -0
  247. package/dist/lists/newest-first.d.ts +5 -0
  248. package/dist/lists/newest-first.d.ts.map +1 -0
  249. package/dist/lists/nodes-of.d.ts +21 -0
  250. package/dist/lists/nodes-of.d.ts.map +1 -0
  251. package/dist/lists/or-failed.d.ts +19 -0
  252. package/dist/lists/or-failed.d.ts.map +1 -0
  253. package/dist/lists/use-paged-rows.d.ts +40 -0
  254. package/dist/lists/use-paged-rows.d.ts.map +1 -0
  255. package/dist/lists/use-same-route-loading.d.ts +8 -0
  256. package/dist/lists/use-same-route-loading.d.ts.map +1 -0
  257. package/dist/lists/use-search-change.d.ts +20 -0
  258. package/dist/lists/use-search-change.d.ts.map +1 -0
  259. package/dist/mcp/index.d.ts +8 -0
  260. package/dist/mcp/index.d.ts.map +1 -0
  261. package/dist/mcp/index.js +105 -0
  262. package/dist/mcp/index.js.map +11 -0
  263. package/dist/mcp/mcp-relay.d.ts +58 -0
  264. package/dist/mcp/mcp-relay.d.ts.map +1 -0
  265. package/dist/mcp/relay.d.ts +38 -0
  266. package/dist/mcp/relay.d.ts.map +1 -0
  267. package/dist/media/client/error.d.ts +29 -0
  268. package/dist/media/client/error.d.ts.map +1 -0
  269. package/dist/media/client/index.d.ts +8 -0
  270. package/dist/media/client/index.d.ts.map +1 -0
  271. package/dist/media/client/index.js +133 -0
  272. package/dist/media/client/index.js.map +11 -0
  273. package/dist/media/client/upload.d.ts +32 -0
  274. package/dist/media/client/upload.d.ts.map +1 -0
  275. package/dist/media/forward.d.ts +14 -0
  276. package/dist/media/forward.d.ts.map +1 -0
  277. package/dist/media/headers.d.ts +11 -0
  278. package/dist/media/headers.d.ts.map +1 -0
  279. package/dist/media/index.d.ts +9 -0
  280. package/dist/media/index.d.ts.map +1 -0
  281. package/dist/media/index.js +396 -0
  282. package/dist/media/index.js.map +16 -0
  283. package/dist/media/options.d.ts +114 -0
  284. package/dist/media/options.d.ts.map +1 -0
  285. package/dist/media/path.d.ts +12 -0
  286. package/dist/media/path.d.ts.map +1 -0
  287. package/dist/media/read.d.ts +11 -0
  288. package/dist/media/read.d.ts.map +1 -0
  289. package/dist/media/refusal.d.ts +11 -0
  290. package/dist/media/refusal.d.ts.map +1 -0
  291. package/dist/media/respond.d.ts +8 -0
  292. package/dist/media/respond.d.ts.map +1 -0
  293. package/dist/media/write.d.ts +13 -0
  294. package/dist/media/write.d.ts.map +1 -0
  295. package/dist/navigation/index.d.ts +9 -0
  296. package/dist/navigation/index.d.ts.map +1 -0
  297. package/dist/navigation/index.js +48 -0
  298. package/dist/navigation/index.js.map +11 -0
  299. package/dist/navigation/use-focus-on-navigate.d.ts +16 -0
  300. package/dist/navigation/use-focus-on-navigate.d.ts.map +1 -0
  301. package/dist/navigation/use-route-transition.d.ts +19 -0
  302. package/dist/navigation/use-route-transition.d.ts.map +1 -0
  303. package/dist/nonce.d.ts +16 -0
  304. package/dist/nonce.d.ts.map +1 -0
  305. package/dist/oauth/answer.d.ts +33 -0
  306. package/dist/oauth/answer.d.ts.map +1 -0
  307. package/dist/oauth/binding.d.ts +43 -0
  308. package/dist/oauth/binding.d.ts.map +1 -0
  309. package/dist/oauth/consent.d.ts +134 -0
  310. package/dist/oauth/consent.d.ts.map +1 -0
  311. package/dist/oauth/grants.d.ts +88 -0
  312. package/dist/oauth/grants.d.ts.map +1 -0
  313. package/dist/oauth/index.d.ts +16 -0
  314. package/dist/oauth/index.d.ts.map +1 -0
  315. package/dist/oauth/index.js +207 -0
  316. package/dist/oauth/index.js.map +12 -0
  317. package/dist/oauth/model.d.ts +13 -0
  318. package/dist/oauth/model.d.ts.map +1 -0
  319. package/dist/oauth/react/index.d.ts +7 -0
  320. package/dist/oauth/react/index.d.ts.map +1 -0
  321. package/dist/oauth/react/index.js +99 -0
  322. package/dist/oauth/react/index.js.map +10 -0
  323. package/dist/oauth/react/use-consent.d.ts +52 -0
  324. package/dist/oauth/react/use-consent.d.ts.map +1 -0
  325. package/dist/oidc/dpop.d.ts +80 -0
  326. package/dist/oidc/dpop.d.ts.map +1 -0
  327. package/dist/oidc/errors.d.ts +16 -0
  328. package/dist/oidc/errors.d.ts.map +1 -0
  329. package/dist/oidc/flow.d.ts +59 -0
  330. package/dist/oidc/flow.d.ts.map +1 -0
  331. package/dist/oidc/index.d.ts +11 -0
  332. package/dist/oidc/index.d.ts.map +1 -0
  333. package/dist/oidc/index.js +742 -0
  334. package/dist/oidc/index.js.map +15 -0
  335. package/dist/oidc/oidc.d.ts +132 -0
  336. package/dist/oidc/oidc.d.ts.map +1 -0
  337. package/dist/oidc/revoke.d.ts +28 -0
  338. package/dist/oidc/revoke.d.ts.map +1 -0
  339. package/dist/oidc/seal.d.ts +20 -0
  340. package/dist/oidc/seal.d.ts.map +1 -0
  341. package/dist/pwa/build/build-worker.d.ts +41 -0
  342. package/dist/pwa/build/build-worker.d.ts.map +1 -0
  343. package/dist/pwa/build/index.d.ts +9 -0
  344. package/dist/pwa/build/index.d.ts.map +1 -0
  345. package/dist/pwa/build/index.js +9 -0
  346. package/dist/pwa/build/index.js.map +9 -0
  347. package/dist/pwa/build/precache.d.ts +17 -0
  348. package/dist/pwa/build/precache.d.ts.map +1 -0
  349. package/dist/pwa/index.d.ts +16 -0
  350. package/dist/pwa/index.d.ts.map +1 -0
  351. package/dist/pwa/index.js +110 -0
  352. package/dist/pwa/index.js.map +12 -0
  353. package/dist/pwa/model/caching.d.ts +46 -0
  354. package/dist/pwa/model/caching.d.ts.map +1 -0
  355. package/dist/pwa/model/clear-app-caches.d.ts +9 -0
  356. package/dist/pwa/model/clear-app-caches.d.ts.map +1 -0
  357. package/dist/pwa/model/font-precache.d.ts +15 -0
  358. package/dist/pwa/model/font-precache.d.ts.map +1 -0
  359. package/dist/pwa/model/manifest.d.ts +80 -0
  360. package/dist/pwa/model/manifest.d.ts.map +1 -0
  361. package/dist/pwa/model/precache-list.d.ts +40 -0
  362. package/dist/pwa/model/precache-list.d.ts.map +1 -0
  363. package/dist/pwa/model/registration.d.ts +39 -0
  364. package/dist/pwa/model/registration.d.ts.map +1 -0
  365. package/dist/pwa/model/start-service-worker.d.ts +24 -0
  366. package/dist/pwa/model/start-service-worker.d.ts.map +1 -0
  367. package/dist/pwa/model/storable.d.ts +8 -0
  368. package/dist/pwa/model/storable.d.ts.map +1 -0
  369. package/dist/pwa/model/theme-color.d.ts +20 -0
  370. package/dist/pwa/model/theme-color.d.ts.map +1 -0
  371. package/dist/pwa/model/update-notice.d.ts +38 -0
  372. package/dist/pwa/model/update-notice.d.ts.map +1 -0
  373. package/dist/pwa/model/worker-contract.d.ts +61 -0
  374. package/dist/pwa/model/worker-contract.d.ts.map +1 -0
  375. package/dist/pwa/react/index.d.ts +9 -0
  376. package/dist/pwa/react/index.d.ts.map +1 -0
  377. package/dist/pwa/react/index.js +75 -0
  378. package/dist/pwa/react/index.js.map +13 -0
  379. package/dist/pwa/react/use-online.d.ts +6 -0
  380. package/dist/pwa/react/use-online.d.ts.map +1 -0
  381. package/dist/pwa/react/use-service-worker.d.ts +33 -0
  382. package/dist/pwa/react/use-service-worker.d.ts.map +1 -0
  383. package/dist/pwa/react/use-update-notice.d.ts +14 -0
  384. package/dist/pwa/react/use-update-notice.d.ts.map +1 -0
  385. package/dist/pwa/server/index.d.ts +7 -0
  386. package/dist/pwa/server/index.d.ts.map +1 -0
  387. package/dist/pwa/server/index.js +18 -0
  388. package/dist/pwa/server/index.js.map +10 -0
  389. package/dist/pwa/server/no-cache.d.ts +22 -0
  390. package/dist/pwa/server/no-cache.d.ts.map +1 -0
  391. package/dist/pwa/worker/index.d.ts +9 -0
  392. package/dist/pwa/worker/index.d.ts.map +1 -0
  393. package/dist/pwa/worker/index.js +144 -0
  394. package/dist/pwa/worker/index.js.map +12 -0
  395. package/dist/pwa/worker/injected.d.ts +15 -0
  396. package/dist/pwa/worker/injected.d.ts.map +1 -0
  397. package/dist/pwa/worker/plan.d.ts +65 -0
  398. package/dist/pwa/worker/plan.d.ts.map +1 -0
  399. package/dist/pwa/worker/scope.d.ts +18 -0
  400. package/dist/pwa/worker/scope.d.ts.map +1 -0
  401. package/dist/pwa/worker/start-worker.d.ts +17 -0
  402. package/dist/pwa/worker/start-worker.d.ts.map +1 -0
  403. package/dist/react-router.d.ts +68 -0
  404. package/dist/react-router.d.ts.map +1 -0
  405. package/dist/server.d.ts +127 -0
  406. package/dist/server.d.ts.map +1 -0
  407. package/dist/session/codes.d.ts +9 -0
  408. package/dist/session/codes.d.ts.map +1 -0
  409. package/dist/session/cookies.d.ts +128 -0
  410. package/dist/session/cookies.d.ts.map +1 -0
  411. package/dist/session/flow-types.d.ts +235 -0
  412. package/dist/session/flow-types.d.ts.map +1 -0
  413. package/dist/session/guard.d.ts +10 -0
  414. package/dist/session/guard.d.ts.map +1 -0
  415. package/dist/session/index.d.ts +22 -0
  416. package/dist/session/index.d.ts.map +1 -0
  417. package/dist/session/index.js +1090 -0
  418. package/dist/session/index.js.map +27 -0
  419. package/dist/session/land.d.ts +28 -0
  420. package/dist/session/land.d.ts.map +1 -0
  421. package/dist/session/link-json.d.ts +22 -0
  422. package/dist/session/link-json.d.ts.map +1 -0
  423. package/dist/session/link-land.d.ts +20 -0
  424. package/dist/session/link-land.d.ts.map +1 -0
  425. package/dist/session/link-token.d.ts +24 -0
  426. package/dist/session/link-token.d.ts.map +1 -0
  427. package/dist/session/link-types.d.ts +142 -0
  428. package/dist/session/link-types.d.ts.map +1 -0
  429. package/dist/session/links.d.ts +14 -0
  430. package/dist/session/links.d.ts.map +1 -0
  431. package/dist/session/model/index.d.ts +8 -0
  432. package/dist/session/model/index.d.ts.map +1 -0
  433. package/dist/session/model/index.js +35 -0
  434. package/dist/session/model/index.js.map +9 -0
  435. package/dist/session/model/link-post.d.ts +35 -0
  436. package/dist/session/model/link-post.d.ts.map +1 -0
  437. package/dist/session/model/paths.d.ts +24 -0
  438. package/dist/session/model/paths.d.ts.map +1 -0
  439. package/dist/session/model/safe-next.d.ts +15 -0
  440. package/dist/session/model/safe-next.d.ts.map +1 -0
  441. package/dist/session/model/second-factor.d.ts +16 -0
  442. package/dist/session/model/second-factor.d.ts.map +1 -0
  443. package/dist/session/model/site-path.d.ts +10 -0
  444. package/dist/session/model/site-path.d.ts.map +1 -0
  445. package/dist/session/model/step-up-answers.d.ts +45 -0
  446. package/dist/session/model/step-up-answers.d.ts.map +1 -0
  447. package/dist/session/model/step-up-props.d.ts +22 -0
  448. package/dist/session/model/step-up-props.d.ts.map +1 -0
  449. package/dist/session/model/step-up.d.ts +48 -0
  450. package/dist/session/model/step-up.d.ts.map +1 -0
  451. package/dist/session/react/index.d.ts +13 -0
  452. package/dist/session/react/index.d.ts.map +1 -0
  453. package/dist/session/react/index.js +196 -0
  454. package/dist/session/react/index.js.map +14 -0
  455. package/dist/session/react/step-up/answers.d.ts +9 -0
  456. package/dist/session/react/step-up/answers.d.ts.map +1 -0
  457. package/dist/session/react/step-up/dialog-props.d.ts +27 -0
  458. package/dist/session/react/step-up/dialog-props.d.ts.map +1 -0
  459. package/dist/session/react/step-up/index.d.ts +7 -0
  460. package/dist/session/react/step-up/index.d.ts.map +1 -0
  461. package/dist/session/react/step-up/pending-runs.d.ts +21 -0
  462. package/dist/session/react/step-up/pending-runs.d.ts.map +1 -0
  463. package/dist/session/react/step-up/phase.d.ts +8 -0
  464. package/dist/session/react/step-up/phase.d.ts.map +1 -0
  465. package/dist/session/react/step-up/use-step-up-replay.d.ts +59 -0
  466. package/dist/session/react/step-up/use-step-up-replay.d.ts.map +1 -0
  467. package/dist/session/react/step-up/use-step-up-runner.d.ts +70 -0
  468. package/dist/session/react/step-up/use-step-up-runner.d.ts.map +1 -0
  469. package/dist/session/react/step-up/use-step-up.d.ts +51 -0
  470. package/dist/session/react/step-up/use-step-up.d.ts.map +1 -0
  471. package/dist/session/react/use-code-field.d.ts +37 -0
  472. package/dist/session/react/use-code-field.d.ts.map +1 -0
  473. package/dist/session/react/use-link-fragment.d.ts +22 -0
  474. package/dist/session/react/use-link-fragment.d.ts.map +1 -0
  475. package/dist/session/react/use-link-param.d.ts +26 -0
  476. package/dist/session/react/use-link-param.d.ts.map +1 -0
  477. package/dist/session/react/use-link-post.d.ts +39 -0
  478. package/dist/session/react/use-link-post.d.ts.map +1 -0
  479. package/dist/session/react/use-sign-out.d.ts +46 -0
  480. package/dist/session/react/use-sign-out.d.ts.map +1 -0
  481. package/dist/session/second-factor.d.ts +22 -0
  482. package/dist/session/second-factor.d.ts.map +1 -0
  483. package/dist/session/serialize.d.ts +42 -0
  484. package/dist/session/serialize.d.ts.map +1 -0
  485. package/dist/session/sign-in.d.ts +19 -0
  486. package/dist/session/sign-in.d.ts.map +1 -0
  487. package/dist/session/signed.d.ts +44 -0
  488. package/dist/session/signed.d.ts.map +1 -0
  489. package/dist/session/social-flow.d.ts +22 -0
  490. package/dist/session/social-flow.d.ts.map +1 -0
  491. package/dist/session/social-land.d.ts +31 -0
  492. package/dist/session/social-land.d.ts.map +1 -0
  493. package/dist/session/social-types.d.ts +136 -0
  494. package/dist/session/social-types.d.ts.map +1 -0
  495. package/dist/session/social.d.ts +32 -0
  496. package/dist/session/social.d.ts.map +1 -0
  497. package/dist/session/step-up-codes.d.ts +9 -0
  498. package/dist/session/step-up-codes.d.ts.map +1 -0
  499. package/dist/session/step-up-signed-out.d.ts +21 -0
  500. package/dist/session/step-up-signed-out.d.ts.map +1 -0
  501. package/dist/session/step-up-types.d.ts +127 -0
  502. package/dist/session/step-up-types.d.ts.map +1 -0
  503. package/dist/session/step-up.d.ts +17 -0
  504. package/dist/session/step-up.d.ts.map +1 -0
  505. package/dist/session/step.d.ts +22 -0
  506. package/dist/session/step.d.ts.map +1 -0
  507. package/dist/session/throttle.d.ts +73 -0
  508. package/dist/session/throttle.d.ts.map +1 -0
  509. package/dist/session/timed-wait.d.ts +4 -0
  510. package/dist/session/timed-wait.d.ts.map +1 -0
  511. package/dist/session/viewer.d.ts +34 -0
  512. package/dist/session/viewer.d.ts.map +1 -0
  513. package/dist/subscription/documents.d.ts +3 -0
  514. package/dist/subscription/documents.d.ts.map +1 -0
  515. package/dist/subscription/index.d.ts +7 -0
  516. package/dist/subscription/index.d.ts.map +1 -0
  517. package/dist/subscription/index.js +359 -0
  518. package/dist/subscription/index.js.map +14 -0
  519. package/dist/subscription/proxy.d.ts +54 -0
  520. package/dist/subscription/proxy.d.ts.map +1 -0
  521. package/dist/subscription/react/backoff.d.ts +8 -0
  522. package/dist/subscription/react/backoff.d.ts.map +1 -0
  523. package/dist/subscription/react/classify.d.ts +15 -0
  524. package/dist/subscription/react/classify.d.ts.map +1 -0
  525. package/dist/subscription/react/controller.d.ts +40 -0
  526. package/dist/subscription/react/controller.d.ts.map +1 -0
  527. package/dist/subscription/react/fake-timers.d.ts +8 -0
  528. package/dist/subscription/react/fake-timers.d.ts.map +1 -0
  529. package/dist/subscription/react/index.d.ts +15 -0
  530. package/dist/subscription/react/index.d.ts.map +1 -0
  531. package/dist/subscription/react/index.js +227 -0
  532. package/dist/subscription/react/index.js.map +17 -0
  533. package/dist/subscription/react/reconnect.d.ts +9 -0
  534. package/dist/subscription/react/reconnect.d.ts.map +1 -0
  535. package/dist/subscription/react/scheduler.d.ts +13 -0
  536. package/dist/subscription/react/scheduler.d.ts.map +1 -0
  537. package/dist/subscription/react/timers.d.ts +7 -0
  538. package/dist/subscription/react/timers.d.ts.map +1 -0
  539. package/dist/subscription/react/use-live-subscription.d.ts +36 -0
  540. package/dist/subscription/react/use-live-subscription.d.ts.map +1 -0
  541. package/dist/subscription/react/versions.d.ts +6 -0
  542. package/dist/subscription/react/versions.d.ts.map +1 -0
  543. package/dist/subscription/read.d.ts +17 -0
  544. package/dist/subscription/read.d.ts.map +1 -0
  545. package/dist/subscription/refusal.d.ts +11 -0
  546. package/dist/subscription/refusal.d.ts.map +1 -0
  547. package/dist/subscription/relay.d.ts +16 -0
  548. package/dist/subscription/relay.d.ts.map +1 -0
  549. package/dist/vite/bun.d.ts +21 -0
  550. package/dist/vite/bun.d.ts.map +1 -0
  551. package/dist/vite/bundle.d.ts +33 -0
  552. package/dist/vite/bundle.d.ts.map +1 -0
  553. package/dist/vite/compress.d.ts +18 -0
  554. package/dist/vite/compress.d.ts.map +1 -0
  555. package/dist/vite/config.d.ts +33 -0
  556. package/dist/vite/config.d.ts.map +1 -0
  557. package/dist/vite/dev.d.ts +28 -0
  558. package/dist/vite/dev.d.ts.map +1 -0
  559. package/dist/vite/entry.d.ts +20 -0
  560. package/dist/vite/entry.d.ts.map +1 -0
  561. package/dist/vite/hosts.d.ts +16 -0
  562. package/dist/vite/hosts.d.ts.map +1 -0
  563. package/dist/vite/index.d.ts +68 -0
  564. package/dist/vite/index.d.ts.map +1 -0
  565. package/dist/vite/index.js +635 -0
  566. package/dist/vite/index.js.map +22 -0
  567. package/dist/vite/inline.d.ts +18 -0
  568. package/dist/vite/inline.d.ts.map +1 -0
  569. package/dist/vite/node.d.ts +16 -0
  570. package/dist/vite/node.d.ts.map +1 -0
  571. package/dist/vite/preview.d.ts +8 -0
  572. package/dist/vite/preview.d.ts.map +1 -0
  573. package/dist/vite/runtime.d.ts +8 -0
  574. package/dist/vite/runtime.d.ts.map +1 -0
  575. package/dist/vite/socket.d.ts +75 -0
  576. package/dist/vite/socket.d.ts.map +1 -0
  577. package/dist/vite/worker.d.ts +16 -0
  578. package/dist/vite/worker.d.ts.map +1 -0
  579. package/dist/with-alxia.d.ts +36 -0
  580. package/dist/with-alxia.d.ts.map +1 -0
  581. package/docs/README.md +42 -0
  582. package/docs/guide/api-keys.md +216 -0
  583. package/docs/guide/beside-the-pages.md +201 -0
  584. package/docs/guide/csp-nonce.md +166 -0
  585. package/docs/guide/customising-the-server.md +324 -0
  586. package/docs/guide/deploying.md +102 -0
  587. package/docs/guide/document.md +334 -0
  588. package/docs/guide/errors.md +1147 -0
  589. package/docs/guide/fetcher.md +355 -0
  590. package/docs/guide/getting-started.md +112 -0
  591. package/docs/guide/help.md +325 -0
  592. package/docs/guide/how-it-works.md +274 -0
  593. package/docs/guide/link.md +32 -0
  594. package/docs/guide/lists.md +225 -0
  595. package/docs/guide/mcp.md +173 -0
  596. package/docs/guide/media.md +273 -0
  597. package/docs/guide/navigation.md +52 -0
  598. package/docs/guide/oauth.md +342 -0
  599. package/docs/guide/oidc.md +262 -0
  600. package/docs/guide/openapi.md +51 -0
  601. package/docs/guide/pwa.md +670 -0
  602. package/docs/guide/session.md +2105 -0
  603. package/docs/guide/subscriptions.md +211 -0
  604. package/docs/guide/testing.md +42 -0
  605. package/docs/guide/typing-the-loaders.md +311 -0
  606. package/docs/guide.md +82 -0
  607. package/docs/roadmap.md +474 -0
  608. package/docs/troubleshooting.md +3837 -0
  609. package/package.json +301 -5
@@ -0,0 +1,357 @@
1
+ // src/help/yaml.ts
2
+ class YamlError extends Error {
3
+ line;
4
+ constructor(line, message) {
5
+ super(message);
6
+ this.line = line;
7
+ this.name = "YamlError";
8
+ }
9
+ }
10
+ function scalar(text, line) {
11
+ const value = text.trim();
12
+ if (value.startsWith('"') || value.startsWith("'")) {
13
+ const quote = value[0];
14
+ if (value.length < 2 || !value.endsWith(quote)) {
15
+ throw new YamlError(line, `unterminated quoted string: ${value}`);
16
+ }
17
+ const inner = value.slice(1, -1);
18
+ return quote === '"' ? inner.replace(/\\(["\\nt])/g, (_, c) => c === "n" ? `
19
+ ` : c === "t" ? "\t" : c) : inner.replace(/''/g, "'");
20
+ }
21
+ if (value === "true")
22
+ return true;
23
+ if (value === "false")
24
+ return false;
25
+ if (/^-?\d+(\.\d+)?$/.test(value))
26
+ return Number(value);
27
+ return value;
28
+ }
29
+ function splitFlow(text) {
30
+ const parts = [];
31
+ let current = "";
32
+ let quote = "";
33
+ let depth = 0;
34
+ for (const char of text) {
35
+ if (quote) {
36
+ if (char === quote)
37
+ quote = "";
38
+ } else if (char === '"' || char === "'")
39
+ quote = char;
40
+ else if (char === "[" || char === "{")
41
+ depth++;
42
+ else if (char === "]" || char === "}")
43
+ depth--;
44
+ else if (char === "," && depth === 0) {
45
+ parts.push(current);
46
+ current = "";
47
+ continue;
48
+ }
49
+ current += char;
50
+ }
51
+ if (current.trim() !== "")
52
+ parts.push(current);
53
+ return parts;
54
+ }
55
+ function inline(text, line) {
56
+ const value = text.trim();
57
+ if (value.startsWith("[")) {
58
+ if (!value.endsWith("]"))
59
+ throw new YamlError(line, `unclosed list: ${value}`);
60
+ return splitFlow(value.slice(1, -1)).map((item) => inline(item, line));
61
+ }
62
+ if (value.startsWith("{")) {
63
+ if (!value.endsWith("}"))
64
+ throw new YamlError(line, `unclosed map: ${value}`);
65
+ const map = {};
66
+ for (const pair of splitFlow(value.slice(1, -1))) {
67
+ const [key, rest] = keyValue(pair, line);
68
+ map[key] = inline(rest, line);
69
+ }
70
+ return map;
71
+ }
72
+ return scalar(value, line);
73
+ }
74
+ function keyValue(text, line) {
75
+ const match = /^\s*([A-Za-z_][\w-]*)\s*:(?:\s+(.*))?$/.exec(text);
76
+ if (!match)
77
+ throw new YamlError(line, `expected "key: value", got: ${text.trim()}`);
78
+ return [match[1], match[2] ?? ""];
79
+ }
80
+ function stripComment(text) {
81
+ let quote = "";
82
+ for (let i = 0;i < text.length; i++) {
83
+ const char = text[i];
84
+ if (quote) {
85
+ if (char === quote)
86
+ quote = "";
87
+ } else if (char === '"' || char === "'")
88
+ quote = char;
89
+ else if (char === "#" && (i === 0 || /\s/.test(text[i - 1]))) {
90
+ return text.slice(0, i);
91
+ }
92
+ }
93
+ return text;
94
+ }
95
+ function readRows(source, firstLine) {
96
+ const rows = [];
97
+ source.split(`
98
+ `).forEach((raw, index) => {
99
+ const text = stripComment(raw.replace(/\r$/, "")).trimEnd();
100
+ if (text.trim() === "")
101
+ return;
102
+ if (/^ *\t/.test(text)) {
103
+ throw new YamlError(firstLine + index, "indent with spaces, not tabs");
104
+ }
105
+ rows.push({
106
+ indent: text.length - text.trimStart().length,
107
+ text: text.trim(),
108
+ line: firstLine + index
109
+ });
110
+ });
111
+ return rows;
112
+ }
113
+
114
+ class Reader {
115
+ rows;
116
+ at = 0;
117
+ constructor(rows) {
118
+ this.rows = rows;
119
+ }
120
+ get row() {
121
+ return this.rows[this.at];
122
+ }
123
+ block(indent) {
124
+ const row = this.row;
125
+ return row.text.startsWith("- ") || row.text === "-" ? this.list(indent) : this.map(indent);
126
+ }
127
+ map(indent) {
128
+ const result = {};
129
+ for (let row = this.row;row?.indent === indent; row = this.row) {
130
+ if (row.text.startsWith("-"))
131
+ break;
132
+ const [key, rest] = keyValue(row.text, row.line);
133
+ if (key in result)
134
+ throw new YamlError(row.line, `duplicate key "${key}"`);
135
+ this.at++;
136
+ const next = this.row;
137
+ if (rest !== "") {
138
+ result[key] = inline(rest, row.line);
139
+ } else if (next && next.indent > indent) {
140
+ result[key] = this.block(next.indent);
141
+ } else if (next?.indent === indent && next.text.startsWith("- ")) {
142
+ result[key] = this.list(indent);
143
+ } else {
144
+ result[key] = "";
145
+ }
146
+ }
147
+ return result;
148
+ }
149
+ list(indent) {
150
+ const result = [];
151
+ for (let row = this.row;row; row = this.row) {
152
+ if (row.indent !== indent || !(row.text.startsWith("- ") || row.text === "-"))
153
+ break;
154
+ const rest = row.text.slice(1).trim();
155
+ if (rest === "") {
156
+ this.at++;
157
+ result.push(this.block(this.row.indent));
158
+ } else if (/^[A-Za-z_][\w-]*\s*:(\s|$)/.test(rest) && !rest.startsWith("{")) {
159
+ const inner = indent + 2;
160
+ this.rows[this.at] = { indent: inner, text: rest, line: row.line };
161
+ result.push(this.map(inner));
162
+ } else {
163
+ this.at++;
164
+ result.push(inline(rest, row.line));
165
+ }
166
+ }
167
+ return result;
168
+ }
169
+ }
170
+ function parseYaml(source, firstLine = 1) {
171
+ const rows = readRows(source, firstLine);
172
+ if (rows.length === 0)
173
+ return {};
174
+ const first = rows[0];
175
+ if (first.indent !== 0)
176
+ throw new YamlError(first.line, "the first line must not be indented");
177
+ const reader = new Reader(rows);
178
+ const result = reader.block(0);
179
+ const left = reader.row;
180
+ if (left)
181
+ throw new YamlError(left.line, `unexpected line: ${left.text}`);
182
+ if (Array.isArray(result) || typeof result !== "object") {
183
+ throw new YamlError(first.line, "the front-matter must be a map of keys");
184
+ }
185
+ return result;
186
+ }
187
+
188
+ // src/help/parse-flow.ts
189
+ class FlowFormatError2 extends Error {
190
+ file;
191
+ line;
192
+ constructor(file, message, line) {
193
+ super(`${file}${line === undefined ? "" : `:${line}`}: ${message}`);
194
+ this.file = file;
195
+ this.line = line;
196
+ this.name = "FlowFormatError";
197
+ }
198
+ }
199
+ var ID = /^[a-z0-9]+(?:[-_.][a-z0-9]+)*$/;
200
+ var CAPTURE_NAME = /^[a-z0-9]+(?:[-_][a-z0-9]+)*$/;
201
+ var KNOWN = ["id", "title", "roles", "routes", "overview", "captures"];
202
+ function fail(file, message, line) {
203
+ throw new FlowFormatError2(file, message, line);
204
+ }
205
+ function strings(file, key, value, required) {
206
+ if (value === undefined) {
207
+ if (required)
208
+ fail(file, `front-matter "${key}" is missing`);
209
+ return [];
210
+ }
211
+ if (!Array.isArray(value) || value.some((item) => typeof item !== "string" || item === "")) {
212
+ fail(file, `front-matter "${key}" must be a list of non-empty strings, e.g. ${key}: [a, b]`);
213
+ }
214
+ return value;
215
+ }
216
+ function langOfFile(file) {
217
+ return /(?:^|\/)[^/]+\.([a-z]{2}(?:-[A-Za-z0-9]+)?)\.md$/.exec(file)?.[1];
218
+ }
219
+ function splitFrontMatter(text, file) {
220
+ const open = /^---[ \t]*\n/.exec(text);
221
+ if (!open)
222
+ fail(file, 'the file must start with a "---" front-matter block', 1);
223
+ const rest = text.slice(open[0].length);
224
+ const close = /^---[ \t]*$/m.exec(rest);
225
+ if (!close)
226
+ fail(file, 'the front-matter is not closed by a "---" line');
227
+ return {
228
+ head: rest.slice(0, close.index),
229
+ markdown: rest.slice(close.index + close[0].length).replace(/^\n/, "")
230
+ };
231
+ }
232
+ function readHead(head, file) {
233
+ let data;
234
+ try {
235
+ data = parseYaml(head, 2);
236
+ } catch (error) {
237
+ if (error instanceof YamlError)
238
+ fail(file, error.message, error.line);
239
+ throw error;
240
+ }
241
+ for (const key of Object.keys(data)) {
242
+ if (!KNOWN.includes(key)) {
243
+ fail(file, `unknown front-matter key "${key}" (known: ${KNOWN.join(", ")})`);
244
+ }
245
+ }
246
+ const { id, title, overview } = data;
247
+ if (typeof id !== "string" || !ID.test(id)) {
248
+ fail(file, 'front-matter "id" is required: lowercase words joined by - _ or .');
249
+ }
250
+ if (typeof title !== "string" || title.trim() === "") {
251
+ fail(file, 'front-matter "title" is required');
252
+ }
253
+ const roles = strings(file, "roles", data["roles"], true);
254
+ if (roles.length === 0)
255
+ fail(file, 'front-matter "roles" lists at least one role');
256
+ const routes = strings(file, "routes", data["routes"], false);
257
+ if (overview !== undefined && typeof overview !== "boolean") {
258
+ fail(file, 'front-matter "overview" is true or false');
259
+ }
260
+ if (overview !== true && routes.length === 0) {
261
+ fail(file, 'front-matter "routes" lists the route ids the flow covers (or set overview: true)');
262
+ }
263
+ return {
264
+ id,
265
+ title: title.trim(),
266
+ roles,
267
+ routes,
268
+ overview: overview === true,
269
+ captureRows: data["captures"]
270
+ };
271
+ }
272
+ function splitSteps(markdown) {
273
+ let fence = "";
274
+ const intro = [];
275
+ const steps = [];
276
+ for (const line of markdown.split(`
277
+ `)) {
278
+ const marker = /^\s*(```+|~~~+)/.exec(line)?.[1];
279
+ if (marker) {
280
+ if (fence === "")
281
+ fence = marker[0];
282
+ else if (marker.startsWith(fence))
283
+ fence = "";
284
+ }
285
+ const heading = fence === "" ? /^##\s+(.+?)\s*#*\s*$/.exec(line) : null;
286
+ if (heading)
287
+ steps.push({ title: heading[1], body: [] });
288
+ else
289
+ (steps.at(-1)?.body ?? intro).push(line);
290
+ }
291
+ return { intro, steps };
292
+ }
293
+ function readCaptures(rows, stepCount, file) {
294
+ const captures = [];
295
+ if (rows === undefined)
296
+ return captures;
297
+ if (!Array.isArray(rows)) {
298
+ fail(file, 'front-matter "captures" must be a list of { step, name, alt }');
299
+ }
300
+ for (const row of rows) {
301
+ if (typeof row !== "object" || row === null || Array.isArray(row)) {
302
+ fail(file, "each capture is a map: - step: 1, name: open-form, alt: …");
303
+ }
304
+ const { step, name, alt } = row;
305
+ if (typeof step !== "number" || !Number.isInteger(step) || step < 1 || step > stepCount) {
306
+ fail(file, `capture step ${String(step)} is not a step of this flow (it has ${stepCount})`);
307
+ }
308
+ if (typeof name !== "string" || !CAPTURE_NAME.test(name)) {
309
+ fail(file, `capture name ${JSON.stringify(name)} must be lowercase words joined by - or _ (no extension, width or theme)`);
310
+ }
311
+ if (typeof alt !== "string" || alt.trim() === "") {
312
+ fail(file, `capture "${name}" needs an "alt" text`);
313
+ }
314
+ if (captures.some((c) => c.step === step)) {
315
+ fail(file, `step ${step} has two captures; a step has one`);
316
+ }
317
+ captures.push({ step, name, alt });
318
+ }
319
+ return captures;
320
+ }
321
+ function parseFlow2(source, file) {
322
+ const lang = langOfFile(file);
323
+ if (lang === undefined) {
324
+ fail(file, "the file name must be <role>.<lang>.md, e.g. editor.fr.md");
325
+ }
326
+ const text = source.replace(/^\uFEFF/, "").replace(/\r\n/g, `
327
+ `);
328
+ const { head, markdown } = splitFrontMatter(text, file);
329
+ const { captureRows, ...meta } = readHead(head, file);
330
+ const { intro, steps } = splitSteps(markdown);
331
+ return {
332
+ ...meta,
333
+ lang,
334
+ body: intro.join(`
335
+ `).trim(),
336
+ steps: steps.map((step, i) => ({
337
+ index: i + 1,
338
+ title: step.title,
339
+ body: step.body.join(`
340
+ `).trim()
341
+ })),
342
+ captures: readCaptures(captureRows, steps.length, file),
343
+ file
344
+ };
345
+ }
346
+
347
+ // src/help/types.ts
348
+ var CAPTURE_WIDTHS2 = [1440, 360];
349
+ var CAPTURE_THEMES2 = ["light", "dark"];
350
+ function captureFile2(name, width, theme) {
351
+ return `${name}.${width}.${theme}.webp`;
352
+ }
353
+
354
+ export { FlowFormatError2, langOfFile, parseFlow2, CAPTURE_WIDTHS2, CAPTURE_THEMES2, captureFile2 };
355
+
356
+ //# debugId=484163F375EBB66D64756E2164756E21
357
+ //# sourceMappingURL=index-skwypsjz.js.map
@@ -0,0 +1,12 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/help/yaml.ts", "../src/help/parse-flow.ts", "../src/help/types.ts"],
4
+ "sourcesContent": [
5
+ "/**\n * The small YAML a flow's front-matter uses: `key: value` lines, inline\n * lists (`[a, b]`), block lists (`- a`) and block lists of maps\n * (`- key: value`, then the map's other keys indented). Scalars are strings,\n * `true`/`false` or numbers; `\"…\"` and `'…'` quote one. No anchors, no\n * multi-line scalars: a flow's front-matter has no need of them.\n */\nexport type YamlValue =\n\t| string\n\t| number\n\t| boolean\n\t| readonly YamlValue[]\n\t| { readonly [key: string]: YamlValue };\n\n/** A syntax error, with its 1-based line in the front-matter. */\nexport class YamlError extends Error {\n\tconstructor(\n\t\treadonly line: number,\n\t\tmessage: string,\n\t) {\n\t\tsuper(message);\n\t\tthis.name = 'YamlError';\n\t}\n}\n\nfunction scalar(text: string, line: number): YamlValue {\n\tconst value = text.trim();\n\tif (value.startsWith('\"') || value.startsWith(\"'\")) {\n\t\tconst quote = value[0] as string;\n\t\tif (value.length < 2 || !value.endsWith(quote)) {\n\t\t\tthrow new YamlError(line, `unterminated quoted string: ${value}`);\n\t\t}\n\t\tconst inner = value.slice(1, -1);\n\t\treturn quote === '\"'\n\t\t\t? inner.replace(/\\\\([\"\\\\nt])/g, (_, c: string) =>\n\t\t\t\t\tc === 'n' ? '\\n' : c === 't' ? '\\t' : c,\n\t\t\t\t)\n\t\t\t: inner.replace(/''/g, \"'\");\n\t}\n\tif (value === 'true') return true;\n\tif (value === 'false') return false;\n\tif (/^-?\\d+(\\.\\d+)?$/.test(value)) return Number(value);\n\treturn value;\n}\n\n/** Splits on commas outside quotes. */\nfunction splitFlow(text: string): string[] {\n\tconst parts: string[] = [];\n\tlet current = '';\n\tlet quote = '';\n\tlet depth = 0;\n\tfor (const char of text) {\n\t\tif (quote) {\n\t\t\tif (char === quote) quote = '';\n\t\t} else if (char === '\"' || char === \"'\") quote = char;\n\t\telse if (char === '[' || char === '{') depth++;\n\t\telse if (char === ']' || char === '}') depth--;\n\t\telse if (char === ',' && depth === 0) {\n\t\t\tparts.push(current);\n\t\t\tcurrent = '';\n\t\t\tcontinue;\n\t\t}\n\t\tcurrent += char;\n\t}\n\tif (current.trim() !== '') parts.push(current);\n\treturn parts;\n}\n\nfunction inline(text: string, line: number): YamlValue {\n\tconst value = text.trim();\n\tif (value.startsWith('[')) {\n\t\tif (!value.endsWith(']'))\n\t\t\tthrow new YamlError(line, `unclosed list: ${value}`);\n\t\treturn splitFlow(value.slice(1, -1)).map((item) => inline(item, line));\n\t}\n\tif (value.startsWith('{')) {\n\t\tif (!value.endsWith('}'))\n\t\t\tthrow new YamlError(line, `unclosed map: ${value}`);\n\t\tconst map: Record<string, YamlValue> = {};\n\t\tfor (const pair of splitFlow(value.slice(1, -1))) {\n\t\t\tconst [key, rest] = keyValue(pair, line);\n\t\t\tmap[key] = inline(rest, line);\n\t\t}\n\t\treturn map;\n\t}\n\treturn scalar(value, line);\n}\n\nfunction keyValue(text: string, line: number): [string, string] {\n\tconst match = /^\\s*([A-Za-z_][\\w-]*)\\s*:(?:\\s+(.*))?$/.exec(text);\n\tif (!match)\n\t\tthrow new YamlError(line, `expected \"key: value\", got: ${text.trim()}`);\n\treturn [match[1] as string, match[2] ?? ''];\n}\n\n/** Drops a trailing ` # comment` that is not inside quotes. */\nfunction stripComment(text: string): string {\n\tlet quote = '';\n\tfor (let i = 0; i < text.length; i++) {\n\t\tconst char = text[i] as string;\n\t\tif (quote) {\n\t\t\tif (char === quote) quote = '';\n\t\t} else if (char === '\"' || char === \"'\") quote = char;\n\t\telse if (char === '#' && (i === 0 || /\\s/.test(text[i - 1] as string))) {\n\t\t\treturn text.slice(0, i);\n\t\t}\n\t}\n\treturn text;\n}\n\ninterface Row {\n\treadonly indent: number;\n\treadonly text: string;\n\treadonly line: number;\n}\n\n/** The non-blank rows of the source, comments stripped. */\nfunction readRows(source: string, firstLine: number): Row[] {\n\tconst rows: Row[] = [];\n\tsource.split('\\n').forEach((raw, index) => {\n\t\tconst text = stripComment(raw.replace(/\\r$/, '')).trimEnd();\n\t\tif (text.trim() === '') return;\n\t\tif (/^ *\\t/.test(text)) {\n\t\t\tthrow new YamlError(firstLine + index, 'indent with spaces, not tabs');\n\t\t}\n\t\trows.push({\n\t\t\tindent: text.length - text.trimStart().length,\n\t\t\ttext: text.trim(),\n\t\t\tline: firstLine + index,\n\t\t});\n\t});\n\treturn rows;\n}\n\n/** A cursor over the rows: `block`, `map` and `list` read what is at it. */\nclass Reader {\n\tat = 0;\n\tconstructor(readonly rows: Row[]) {}\n\n\tget row(): Row | undefined {\n\t\treturn this.rows[this.at];\n\t}\n\n\tblock(indent: number): YamlValue {\n\t\tconst row = this.row as Row;\n\t\treturn row.text.startsWith('- ') || row.text === '-'\n\t\t\t? this.list(indent)\n\t\t\t: this.map(indent);\n\t}\n\n\tmap(indent: number): Record<string, YamlValue> {\n\t\tconst result: Record<string, YamlValue> = {};\n\t\tfor (let row = this.row; row?.indent === indent; row = this.row) {\n\t\t\tif (row.text.startsWith('-')) break;\n\t\t\tconst [key, rest] = keyValue(row.text, row.line);\n\t\t\tif (key in result)\n\t\t\t\tthrow new YamlError(row.line, `duplicate key \"${key}\"`);\n\t\t\tthis.at++;\n\t\t\tconst next = this.row;\n\t\t\tif (rest !== '') {\n\t\t\t\tresult[key] = inline(rest, row.line);\n\t\t\t} else if (next && next.indent > indent) {\n\t\t\t\tresult[key] = this.block(next.indent);\n\t\t\t} else if (next?.indent === indent && next.text.startsWith('- ')) {\n\t\t\t\tresult[key] = this.list(indent);\n\t\t\t} else {\n\t\t\t\tresult[key] = '';\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tlist(indent: number): YamlValue[] {\n\t\tconst result: YamlValue[] = [];\n\t\tfor (let row = this.row; row; row = this.row) {\n\t\t\tif (\n\t\t\t\trow.indent !== indent ||\n\t\t\t\t!(row.text.startsWith('- ') || row.text === '-')\n\t\t\t)\n\t\t\t\tbreak;\n\t\t\tconst rest = row.text.slice(1).trim();\n\t\t\tif (rest === '') {\n\t\t\t\tthis.at++;\n\t\t\t\tresult.push(this.block((this.row as Row).indent));\n\t\t\t} else if (\n\t\t\t\t/^[A-Za-z_][\\w-]*\\s*:(\\s|$)/.test(rest) &&\n\t\t\t\t!rest.startsWith('{')\n\t\t\t) {\n\t\t\t\t// `- key: value`: a map whose first key sits on the dash's line.\n\t\t\t\tconst inner = indent + 2;\n\t\t\t\tthis.rows[this.at] = { indent: inner, text: rest, line: row.line };\n\t\t\t\tresult.push(this.map(inner));\n\t\t\t} else {\n\t\t\t\tthis.at++;\n\t\t\t\tresult.push(inline(rest, row.line));\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n}\n\n/** Parses a front-matter block to a map; `firstLine` offsets error lines. */\nexport function parseYaml(\n\tsource: string,\n\tfirstLine = 1,\n): Record<string, YamlValue> {\n\tconst rows = readRows(source, firstLine);\n\tif (rows.length === 0) return {};\n\tconst first = rows[0] as Row;\n\tif (first.indent !== 0)\n\t\tthrow new YamlError(first.line, 'the first line must not be indented');\n\tconst reader = new Reader(rows);\n\tconst result = reader.block(0);\n\tconst left = reader.row;\n\tif (left) throw new YamlError(left.line, `unexpected line: ${left.text}`);\n\tif (Array.isArray(result) || typeof result !== 'object') {\n\t\tthrow new YamlError(first.line, 'the front-matter must be a map of keys');\n\t}\n\treturn result as Record<string, YamlValue>;\n}\n",
6
+ "import type { HelpFlow } from './types';\nimport { parseYaml, YamlError, type YamlValue } from './yaml';\n\n/** A flow file the format refuses; the message names the file and line. */\nexport class FlowFormatError extends Error {\n\tconstructor(\n\t\treadonly file: string,\n\t\tmessage: string,\n\t\treadonly line?: number,\n\t) {\n\t\tsuper(`${file}${line === undefined ? '' : `:${line}`}: ${message}`);\n\t\tthis.name = 'FlowFormatError';\n\t}\n}\n\n/** A capture reference of the front-matter: the step it belongs to. */\nexport interface RawCapture {\n\treadonly step: number;\n\treadonly name: string;\n\treadonly alt: string;\n}\n\n/** What a flow file says before its captures are resolved to URLs. */\nexport interface ParsedFlow extends Omit<HelpFlow, 'steps'> {\n\treadonly steps: readonly {\n\t\treadonly index: number;\n\t\treadonly title: string;\n\t\treadonly body: string;\n\t}[];\n\treadonly captures: readonly RawCapture[];\n}\n\nconst ID = /^[a-z0-9]+(?:[-_.][a-z0-9]+)*$/;\nconst CAPTURE_NAME = /^[a-z0-9]+(?:[-_][a-z0-9]+)*$/;\nconst KNOWN = ['id', 'title', 'roles', 'routes', 'overview', 'captures'];\n\nfunction fail(file: string, message: string, line?: number): never {\n\tthrow new FlowFormatError(file, message, line);\n}\n\nfunction strings(\n\tfile: string,\n\tkey: string,\n\tvalue: YamlValue | undefined,\n\trequired: boolean,\n): string[] {\n\tif (value === undefined) {\n\t\tif (required) fail(file, `front-matter \"${key}\" is missing`);\n\t\treturn [];\n\t}\n\tif (\n\t\t!Array.isArray(value) ||\n\t\tvalue.some((item) => typeof item !== 'string' || item === '')\n\t) {\n\t\tfail(\n\t\t\tfile,\n\t\t\t`front-matter \"${key}\" must be a list of non-empty strings, e.g. ${key}: [a, b]`,\n\t\t);\n\t}\n\treturn value as string[];\n}\n\n/** `<role>.<lang>.md` → its language, or undefined when the name has none. */\nexport function langOfFile(file: string): string | undefined {\n\treturn /(?:^|\\/)[^/]+\\.([a-z]{2}(?:-[A-Za-z0-9]+)?)\\.md$/.exec(file)?.[1];\n}\n\n/** Splits the file into its front-matter text and its Markdown. */\nfunction splitFrontMatter(text: string, file: string) {\n\tconst open = /^---[ \\t]*\\n/.exec(text);\n\tif (!open)\n\t\tfail(file, 'the file must start with a \"---\" front-matter block', 1);\n\tconst rest = text.slice(open[0].length);\n\tconst close = /^---[ \\t]*$/m.exec(rest);\n\tif (!close) fail(file, 'the front-matter is not closed by a \"---\" line');\n\treturn {\n\t\thead: rest.slice(0, close.index),\n\t\tmarkdown: rest.slice(close.index + close[0].length).replace(/^\\n/, ''),\n\t};\n}\n\n/** Validates the front-matter keys other than the captures. */\nfunction readHead(head: string, file: string) {\n\tlet data: Record<string, YamlValue>;\n\ttry {\n\t\tdata = parseYaml(head, 2);\n\t} catch (error) {\n\t\tif (error instanceof YamlError) fail(file, error.message, error.line);\n\t\tthrow error;\n\t}\n\tfor (const key of Object.keys(data)) {\n\t\tif (!KNOWN.includes(key)) {\n\t\t\tfail(\n\t\t\t\tfile,\n\t\t\t\t`unknown front-matter key \"${key}\" (known: ${KNOWN.join(', ')})`,\n\t\t\t);\n\t\t}\n\t}\n\tconst { id, title, overview } = data;\n\tif (typeof id !== 'string' || !ID.test(id)) {\n\t\tfail(\n\t\t\tfile,\n\t\t\t'front-matter \"id\" is required: lowercase words joined by - _ or .',\n\t\t);\n\t}\n\tif (typeof title !== 'string' || title.trim() === '') {\n\t\tfail(file, 'front-matter \"title\" is required');\n\t}\n\tconst roles = strings(file, 'roles', data['roles'], true);\n\tif (roles.length === 0)\n\t\tfail(file, 'front-matter \"roles\" lists at least one role');\n\tconst routes = strings(file, 'routes', data['routes'], false);\n\tif (overview !== undefined && typeof overview !== 'boolean') {\n\t\tfail(file, 'front-matter \"overview\" is true or false');\n\t}\n\tif (overview !== true && routes.length === 0) {\n\t\tfail(\n\t\t\tfile,\n\t\t\t'front-matter \"routes\" lists the route ids the flow covers (or set overview: true)',\n\t\t);\n\t}\n\treturn {\n\t\tid,\n\t\ttitle: title.trim(),\n\t\troles,\n\t\troutes,\n\t\toverview: overview === true,\n\t\tcaptureRows: data['captures'],\n\t};\n}\n\n/** The `##` sections of the Markdown, outside fenced code. */\nfunction splitSteps(markdown: string) {\n\tlet fence = '';\n\tconst intro: string[] = [];\n\tconst steps: { title: string; body: string[] }[] = [];\n\tfor (const line of markdown.split('\\n')) {\n\t\tconst marker = /^\\s*(```+|~~~+)/.exec(line)?.[1];\n\t\tif (marker) {\n\t\t\tif (fence === '') fence = marker[0] as string;\n\t\t\telse if (marker.startsWith(fence)) fence = '';\n\t\t}\n\t\tconst heading = fence === '' ? /^##\\s+(.+?)\\s*#*\\s*$/.exec(line) : null;\n\t\tif (heading) steps.push({ title: heading[1] as string, body: [] });\n\t\telse (steps.at(-1)?.body ?? intro).push(line);\n\t}\n\treturn { intro, steps };\n}\n\n/** Validates the `captures` list against the number of steps. */\nfunction readCaptures(\n\trows: YamlValue | undefined,\n\tstepCount: number,\n\tfile: string,\n): RawCapture[] {\n\tconst captures: RawCapture[] = [];\n\tif (rows === undefined) return captures;\n\tif (!Array.isArray(rows)) {\n\t\tfail(file, 'front-matter \"captures\" must be a list of { step, name, alt }');\n\t}\n\tfor (const row of rows) {\n\t\tif (typeof row !== 'object' || row === null || Array.isArray(row)) {\n\t\t\tfail(file, 'each capture is a map: - step: 1, name: open-form, alt: …');\n\t\t}\n\t\tconst { step, name, alt } = row as Record<string, YamlValue>;\n\t\tif (\n\t\t\ttypeof step !== 'number' ||\n\t\t\t!Number.isInteger(step) ||\n\t\t\tstep < 1 ||\n\t\t\tstep > stepCount\n\t\t) {\n\t\t\tfail(\n\t\t\t\tfile,\n\t\t\t\t`capture step ${String(step)} is not a step of this flow (it has ${stepCount})`,\n\t\t\t);\n\t\t}\n\t\tif (typeof name !== 'string' || !CAPTURE_NAME.test(name)) {\n\t\t\tfail(\n\t\t\t\tfile,\n\t\t\t\t`capture name ${JSON.stringify(name)} must be lowercase words joined by - or _ (no extension, width or theme)`,\n\t\t\t);\n\t\t}\n\t\tif (typeof alt !== 'string' || alt.trim() === '') {\n\t\t\tfail(file, `capture \"${name}\" needs an \"alt\" text`);\n\t\t}\n\t\tif (captures.some((c) => c.step === step)) {\n\t\t\tfail(file, `step ${step} has two captures; a step has one`);\n\t\t}\n\t\tcaptures.push({ step, name, alt });\n\t}\n\treturn captures;\n}\n\n/** Parses one flow file; throws a `FlowFormatError` naming file and line. */\nexport function parseFlow(source: string, file: string): ParsedFlow {\n\tconst lang = langOfFile(file);\n\tif (lang === undefined) {\n\t\tfail(file, 'the file name must be <role>.<lang>.md, e.g. editor.fr.md');\n\t}\n\tconst text = source.replace(/^\\uFEFF/, '').replace(/\\r\\n/g, '\\n');\n\tconst { head, markdown } = splitFrontMatter(text, file);\n\tconst { captureRows, ...meta } = readHead(head, file);\n\tconst { intro, steps } = splitSteps(markdown);\n\treturn {\n\t\t...meta,\n\t\tlang,\n\t\tbody: intro.join('\\n').trim(),\n\t\tsteps: steps.map((step, i) => ({\n\t\t\tindex: i + 1,\n\t\t\ttitle: step.title,\n\t\t\tbody: step.body.join('\\n').trim(),\n\t\t})),\n\t\tcaptures: readCaptures(captureRows, steps.length, file),\n\t\tfile,\n\t};\n}\n",
7
+ "/** The widths a capture is taken at. */\nexport type CaptureWidth = 360 | 1440;\n/** The themes a capture is taken in. */\nexport type CaptureTheme = 'light' | 'dark';\n\nexport const CAPTURE_WIDTHS = [1440, 360] as const;\nexport const CAPTURE_THEMES = ['light', 'dark'] as const;\n\n/** The file name of one capture variant: `<name>.<width>.<theme>.webp`. */\nexport function captureFile(\n\tname: string,\n\twidth: CaptureWidth,\n\ttheme: CaptureTheme,\n): string {\n\treturn `${name}.${width}.${theme}.webp`;\n}\n\n/**\n * One step's screenshot: the URL of each variant and its alt text. The\n * shape `HelpSheet` of `@softistx/material` takes.\n */\nexport interface HelpCapture {\n\treadonly name: string;\n\treadonly alt: string;\n\treadonly light: { readonly 360: string; readonly 1440: string };\n\treadonly dark: { readonly 360: string; readonly 1440: string };\n}\n\n/** One numbered step: a `##` section of the flow's Markdown. */\nexport interface HelpStep {\n\t/** 1-based, in reading order. */\n\treadonly index: number;\n\treadonly title: string;\n\t/** The section's Markdown, without its heading. */\n\treadonly body: string;\n\treadonly capture?: HelpCapture;\n}\n\n/** One flow: a file `docs/flows/<role>.<lang>.md`. */\nexport interface HelpFlow {\n\treadonly id: string;\n\treadonly title: string;\n\treadonly roles: readonly string[];\n\t/** React Router route ids this flow covers. */\n\treadonly routes: readonly string[];\n\t/** The role's overview: shown when no flow covers the screen. */\n\treadonly overview: boolean;\n\treadonly lang: string;\n\t/** The Markdown before the first step. */\n\treadonly body: string;\n\treadonly steps: readonly HelpStep[];\n\t/** The source file, for messages. */\n\treadonly file: string;\n}\n"
8
+ ],
9
+ "mappings": ";AAeO,MAAM,kBAAkB,MAAM;AAAA,EAE1B;AAAA,EADV,WAAW,CACD,MACT,SACC;AAAA,IACD,MAAM,OAAO;AAAA,IAHJ;AAAA,IAIT,KAAK,OAAO;AAAA;AAEd;AAEA,SAAS,MAAM,CAAC,MAAc,MAAyB;AAAA,EACtD,MAAM,QAAQ,KAAK,KAAK;AAAA,EACxB,IAAI,MAAM,WAAW,GAAG,KAAK,MAAM,WAAW,GAAG,GAAG;AAAA,IACnD,MAAM,QAAQ,MAAM;AAAA,IACpB,IAAI,MAAM,SAAS,KAAK,CAAC,MAAM,SAAS,KAAK,GAAG;AAAA,MAC/C,MAAM,IAAI,UAAU,MAAM,+BAA+B,OAAO;AAAA,IACjE;AAAA,IACA,MAAM,QAAQ,MAAM,MAAM,GAAG,EAAE;AAAA,IAC/B,OAAO,UAAU,M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,EACtD,QAAQ,gBAAgB,SAAS,SAAS,MAAM,IAAI;AAAA,EACpD,QAAQ,OAAO,UAAU,WAAW,QAAQ;AAAA,EAC5C,OAAO;AAAA,OACH;AAAA,IACH;AAAA,IACA,MAAM,MAAM,KAAK;AAAA,CAAI,EAAE,KAAK;AAAA,IAC5B,OAAO,MAAM,IAAI,CAAC,MAAM,OAAO;AAAA,MAC9B,OAAO,IAAI;AAAA,MACX,OAAO,KAAK;AAAA,MACZ,MAAM,KAAK,KAAK,KAAK;AAAA,CAAI,EAAE,KAAK;AAAA,IACjC,EAAE;AAAA,IACF,UAAU,aAAa,aAAa,MAAM,QAAQ,IAAI;AAAA,IACtD;AAAA,EACD;AAAA;;;ACjNM,IAAM,kBAAiB,CAAC,MAAM,GAAG;AACjC,IAAM,kBAAiB,CAAC,SAAS,MAAM;AAGvC,SAAS,YAAW,CAC1B,MACA,OACA,OACS;AAAA,EACT,OAAO,GAAG,QAAQ,SAAS;AAAA;",
10
+ "debugId": "484163F375EBB66D64756E2164756E21",
11
+ "names": []
12
+ }
@@ -0,0 +1,118 @@
1
+ // src/session/model/step-up.ts
2
+ var INITIAL_STEP_UP2 = {
3
+ phase: "idle",
4
+ locked: false,
5
+ pending: false,
6
+ resent: false
7
+ };
8
+ function requested(state, answer) {
9
+ if (!answer.ok) {
10
+ return {
11
+ ...state,
12
+ phase: state.challenge ? "code" : "idle",
13
+ error: answer.error,
14
+ message: answer.message,
15
+ retryAfter: answer.retryAfter,
16
+ pending: false,
17
+ resent: false
18
+ };
19
+ }
20
+ return {
21
+ phase: "code",
22
+ via: answer.via,
23
+ challenge: answer.challenge,
24
+ locked: false,
25
+ pending: false,
26
+ resent: state.challenge !== undefined
27
+ };
28
+ }
29
+ function refused(state, answer) {
30
+ const none = answer.attemptsLeft === 0;
31
+ const over = answer.error !== "throttled" && (answer.error === "expired" || none);
32
+ if (over) {
33
+ return {
34
+ phase: "idle",
35
+ ...state.via ? { via: state.via } : {},
36
+ locked: false,
37
+ error: "expired",
38
+ message: answer.message,
39
+ pending: false,
40
+ resent: false
41
+ };
42
+ }
43
+ if (answer.error === "throttled") {
44
+ return {
45
+ ...state,
46
+ phase: "code",
47
+ error: "throttled",
48
+ message: answer.message,
49
+ retryAfter: answer.retryAfter,
50
+ pending: false,
51
+ resent: false
52
+ };
53
+ }
54
+ return {
55
+ ...state,
56
+ phase: "code",
57
+ error: answer.error,
58
+ message: answer.message,
59
+ retryAfter: undefined,
60
+ attemptsLeft: answer.attemptsLeft,
61
+ locked: answer.locked,
62
+ pending: false,
63
+ resent: false
64
+ };
65
+ }
66
+ function stepUpReducer2(state, action) {
67
+ switch (action.type) {
68
+ case "start":
69
+ return {
70
+ ...state,
71
+ phase: state.challenge ? "code" : "requesting",
72
+ error: undefined,
73
+ message: undefined,
74
+ retryAfter: undefined,
75
+ pending: true,
76
+ resent: false
77
+ };
78
+ case "requested":
79
+ return requested(state, action.answer);
80
+ case "submit":
81
+ return {
82
+ ...state,
83
+ phase: "confirming",
84
+ error: undefined,
85
+ message: undefined,
86
+ retryAfter: undefined,
87
+ pending: true
88
+ };
89
+ case "confirmed":
90
+ return action.answer.ok ? {
91
+ phase: "done",
92
+ ...state.via ? { via: state.via } : {},
93
+ locked: false,
94
+ pending: false,
95
+ resent: false
96
+ } : refused(state, action.answer);
97
+ case "release":
98
+ return INITIAL_STEP_UP2;
99
+ }
100
+ }
101
+
102
+ // src/session/model/step-up-props.ts
103
+ function stepUpProps2(state) {
104
+ return {
105
+ ...state.via ? { via: state.via } : {},
106
+ ...state.attemptsLeft === undefined ? {} : { attemptsLeft: state.attemptsLeft },
107
+ locked: state.locked,
108
+ ...state.error ? { error: state.error } : {},
109
+ ...state.retryAfter === undefined ? {} : { retryAfter: state.retryAfter },
110
+ pending: state.pending,
111
+ resent: state.resent
112
+ };
113
+ }
114
+
115
+ export { INITIAL_STEP_UP2, stepUpReducer2, stepUpProps2 };
116
+
117
+ //# debugId=25970F9F933107D464756E2164756E21
118
+ //# sourceMappingURL=index-sxh06ged.js.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/session/model/step-up.ts", "../src/session/model/step-up-props.ts"],
4
+ "sourcesContent": [
5
+ "import type { StepUpVia } from './second-factor';\nimport type {\n\tStepUpConfirmAnswer,\n\tStepUpError,\n\tStepUpRequestAnswer,\n} from './step-up-answers';\n\n/** Where a step-up is. */\nexport type StepUpPhase =\n\t| 'idle'\n\t| 'requesting'\n\t| 'code'\n\t| 'confirming'\n\t| 'done';\n\nexport interface StepUpState {\n\treadonly phase: StepUpPhase;\n\t/** How the challenge held (or the last one) is confirmed. */\n\treadonly via?: StepUpVia | undefined;\n\t/** The challenge held. A secret: never in a URL, a log or loader data. */\n\treadonly challenge?: string | undefined;\n\t/** The tries the last refused code left. */\n\treadonly attemptsLeft?: number | undefined;\n\t/** @deprecated No longer read: always `false`. */\n\treadonly locked: boolean;\n\treadonly error?: StepUpError | undefined;\n\t/** The last refusal worded for the page, until the next step or the release. */\n\treadonly message?: string | undefined;\n\t/** The seconds a throttled request asks to wait before asking again. */\n\treadonly retryAfter?: number | undefined;\n\t/** A request or a code is in flight. */\n\treadonly pending: boolean;\n\t/** The last request replaced a challenge that was held. */\n\treadonly resent: boolean;\n}\n\nexport type StepUpAction =\n\t| { readonly type: 'start' }\n\t| { readonly type: 'requested'; readonly answer: StepUpRequestAnswer }\n\t| { readonly type: 'submit' }\n\t| { readonly type: 'confirmed'; readonly answer: StepUpConfirmAnswer }\n\t| { readonly type: 'release' };\n\nexport const INITIAL_STEP_UP: StepUpState = {\n\tphase: 'idle',\n\tlocked: false,\n\tpending: false,\n\tresent: false,\n};\n\nfunction requested(\n\tstate: StepUpState,\n\tanswer: StepUpRequestAnswer,\n): StepUpState {\n\tif (!answer.ok) {\n\t\t// A resend refused leaves the code form up, and says why in it.\n\t\treturn {\n\t\t\t...state,\n\t\t\tphase: state.challenge ? 'code' : 'idle',\n\t\t\terror: answer.error,\n\t\t\tmessage: answer.message,\n\t\t\tretryAfter: answer.retryAfter,\n\t\t\tpending: false,\n\t\t\tresent: false,\n\t\t};\n\t}\n\treturn {\n\t\tphase: 'code',\n\t\tvia: answer.via,\n\t\tchallenge: answer.challenge,\n\t\tlocked: false,\n\t\tpending: false,\n\t\tresent: state.challenge !== undefined,\n\t};\n}\n\n/** A refused code. At 0 tries left the challenge is spent, whatever the factor: ask again. A timed wait arrives as `throttled`. */\nfunction refused(\n\tstate: StepUpState,\n\tanswer: Extract<StepUpConfirmAnswer, { ok: false }>,\n): StepUpState {\n\tconst none = answer.attemptsLeft === 0;\n\tconst over =\n\t\tanswer.error !== 'throttled' && (answer.error === 'expired' || none);\n\tif (over) {\n\t\treturn {\n\t\t\tphase: 'idle',\n\t\t\t...(state.via ? { via: state.via } : {}),\n\t\t\tlocked: false,\n\t\t\terror: 'expired',\n\t\t\tmessage: answer.message,\n\t\t\tpending: false,\n\t\t\tresent: false,\n\t\t};\n\t}\n\tif (answer.error === 'throttled') {\n\t\t// Asking too often spends nothing: the challenge and its tries stay.\n\t\treturn {\n\t\t\t...state,\n\t\t\tphase: 'code',\n\t\t\terror: 'throttled',\n\t\t\tmessage: answer.message,\n\t\t\tretryAfter: answer.retryAfter,\n\t\t\tpending: false,\n\t\t\tresent: false,\n\t\t};\n\t}\n\treturn {\n\t\t...state,\n\t\tphase: 'code',\n\t\terror: answer.error,\n\t\tmessage: answer.message,\n\t\tretryAfter: undefined,\n\t\tattemptsLeft: answer.attemptsLeft,\n\t\tlocked: answer.locked,\n\t\tpending: false,\n\t\tresent: false,\n\t};\n}\n\n/**\n * The step-up's transitions, pure. `start` (a request in flight) forgets the\n * last error but keeps a challenge held, so a refused \"Resend code\" leaves\n * the code form up; a refusal keeps its `message` (and a throttle its\n * `retryAfter`) until the next step; a granted request replaces the challenge; a code accepted\n * spends it; an expired or spent one leaves \"ask again\"; at 0 tries left the\n * challenge is `expired` for any factor, and a throttle keeps the challenge.\n */\nexport function stepUpReducer(\n\tstate: StepUpState,\n\taction: StepUpAction,\n): StepUpState {\n\tswitch (action.type) {\n\t\tcase 'start':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tphase: state.challenge ? 'code' : 'requesting',\n\t\t\t\terror: undefined,\n\t\t\t\tmessage: undefined,\n\t\t\t\tretryAfter: undefined,\n\t\t\t\tpending: true,\n\t\t\t\tresent: false,\n\t\t\t};\n\t\tcase 'requested':\n\t\t\treturn requested(state, action.answer);\n\t\tcase 'submit':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tphase: 'confirming',\n\t\t\t\terror: undefined,\n\t\t\t\tmessage: undefined,\n\t\t\t\tretryAfter: undefined,\n\t\t\t\tpending: true,\n\t\t\t};\n\t\tcase 'confirmed':\n\t\t\treturn action.answer.ok\n\t\t\t\t? {\n\t\t\t\t\t\tphase: 'done',\n\t\t\t\t\t\t...(state.via ? { via: state.via } : {}),\n\t\t\t\t\t\tlocked: false,\n\t\t\t\t\t\tpending: false,\n\t\t\t\t\t\tresent: false,\n\t\t\t\t\t}\n\t\t\t\t: refused(state, action.answer);\n\t\tcase 'release':\n\t\t\treturn INITIAL_STEP_UP;\n\t}\n}\n",
6
+ "import type { StepUpVia } from './second-factor';\nimport type { StepUpState } from './step-up';\nimport type { StepUpError } from './step-up-answers';\n\n/**\n * The props of `@nxgt/material`'s `VerificationCode` and `StepUpDialog` that\n * the state decides. The state's `message` is not one: the dialog words its\n * own texts from `error`, `attemptsLeft`, `locked` and `retryAfter`. The callbacks (`onSubmit`, `onResend`) are the app's.\n */\nexport interface StepUpProps {\n\treadonly via?: StepUpVia;\n\treadonly attemptsLeft?: number;\n\t/** @deprecated No longer read: always `false`. */\n\treadonly locked: boolean;\n\treadonly error?: StepUpError;\n\t/** The seconds to wait when `error` is `throttled` and the API said how long. */\n\treadonly retryAfter?: number;\n\treadonly pending: boolean;\n\treadonly resent: boolean;\n}\n\n/** The state as the dialog's props: `{ ...stepUpProps(state), onSubmit, onResend }`. */\nexport function stepUpProps(state: StepUpState): StepUpProps {\n\treturn {\n\t\t...(state.via ? { via: state.via } : {}),\n\t\t...(state.attemptsLeft === undefined\n\t\t\t? {}\n\t\t\t: { attemptsLeft: state.attemptsLeft }),\n\t\tlocked: state.locked,\n\t\t...(state.error ? { error: state.error } : {}),\n\t\t...(state.retryAfter === undefined ? {} : { retryAfter: state.retryAfter }),\n\t\tpending: state.pending,\n\t\tresent: state.resent,\n\t};\n}\n"
7
+ ],
8
+ "mappings": ";AA2CO,IAAM,mBAA+B;AAAA,EAC3C,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AACT;AAEA,SAAS,SAAS,CACjB,OACA,QACc;AAAA,EACd,IAAI,CAAC,OAAO,IAAI;AAAA,IAEf,OAAO;AAAA,SACH;AAAA,MACH,OAAO,MAAM,YAAY,SAAS;AAAA,MAClC,OAAO,OAAO;AAAA,MACd,SAAS,OAAO;AAAA,MAChB,YAAY,OAAO;AAAA,MACnB,SAAS;AAAA,MACT,QAAQ;AAAA,IACT;AAAA,EACD;AAAA,EACA,OAAO;AAAA,IACN,OAAO;AAAA,IACP,KAAK,OAAO;AAAA,IACZ,WAAW,OAAO;AAAA,IAClB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,QAAQ,MAAM,cAAc;AAAA,EAC7B;AAAA;AAID,SAAS,OAAO,CACf,OACA,QACc;AAAA,EACd,MAAM,OAAO,OAAO,iBAAiB;AAAA,EACrC,MAAM,OACL,OAAO,UAAU,gBAAgB,OAAO,UAAU,aAAa;AAAA,EAChE,IAAI,MAAM;AAAA,IACT,OAAO;AAAA,MACN,OAAO;AAAA,SACH,MAAM,MAAM,EAAE,KAAK,MAAM,IAAI,IAAI,CAAC;AAAA,MACtC,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,SAAS,OAAO;AAAA,MAChB,SAAS;AAAA,MACT,QAAQ;AAAA,IACT;AAAA,EACD;AAAA,EACA,IAAI,OAAO,UAAU,aAAa;AAAA,IAEjC,OAAO;AA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AAc,MAAM,aAAa;AAAA,IACtC,QAAQ,MAAM;AAAA,OACV,MAAM,QAAQ,EAAE,OAAO,MAAM,MAAM,IAAI,CAAC;AAAA,OACxC,MAAM,eAAe,YAAY,CAAC,IAAI,EAAE,YAAY,MAAM,WAAW;AAAA,IACzE,SAAS,MAAM;AAAA,IACf,QAAQ,MAAM;AAAA,EACf;AAAA;",
9
+ "debugId": "25970F9F933107D464756E2164756E21",
10
+ "names": []
11
+ }
@@ -0,0 +1,96 @@
1
+ import {
2
+ HOME2,
3
+ safeNext2
4
+ } from "./index-0786n4qe.js";
5
+
6
+ // src/session/model/link-post.ts
7
+ var LINK_JSON_HEADER2 = "x-alxia-link";
8
+ var text = (value) => typeof value === "string" ? value : undefined;
9
+ var UNREACHABLE = "Something went wrong. Try again.";
10
+ async function postLinkArgs2(path, body, fields, options = {}) {
11
+ const send = options.fetch ?? fetch;
12
+ const unreachable = options.unreachable ?? UNREACHABLE;
13
+ let answer;
14
+ let ok = false;
15
+ try {
16
+ const response = await send(path, {
17
+ method: "POST",
18
+ headers: {
19
+ "content-type": "application/json",
20
+ [LINK_JSON_HEADER2]: "json"
21
+ },
22
+ body: JSON.stringify(body),
23
+ credentials: "same-origin"
24
+ });
25
+ ok = response.ok;
26
+ const parsed = await response.json().catch(() => {
27
+ return;
28
+ });
29
+ if (parsed && typeof parsed === "object") {
30
+ answer = parsed;
31
+ }
32
+ } catch {
33
+ return { form: unreachable };
34
+ }
35
+ const redirect = text(answer?.["redirect"]);
36
+ if (ok && redirect !== undefined) {
37
+ const replace = answer?.["replace"] === true;
38
+ (options.navigate ?? ((to, how) => how.replace ? globalThis.location.replace(to) : globalThis.location.assign(to)))(redirect, { replace });
39
+ return;
40
+ }
41
+ if (ok && answer?.["sent"] === true)
42
+ return;
43
+ const refusal = {
44
+ form: text(answer?.["formError"]),
45
+ retryAfter: typeof answer?.["retryAfter"] === "number" ? answer["retryAfter"] : undefined
46
+ };
47
+ const errors = answer?.["fieldErrors"];
48
+ if (errors && typeof errors === "object") {
49
+ for (const field of fields) {
50
+ refusal[field] = text(errors[field]);
51
+ }
52
+ }
53
+ if (refusal["form"] === undefined && !fields.some((f) => refusal[f])) {
54
+ refusal["form"] = unreachable;
55
+ }
56
+ return refusal;
57
+ }
58
+ var postLinkRequest2 = (path, email, options) => postLinkArgs2(path, { input: { email } }, ["email"], options);
59
+ // src/session/model/site-path.ts
60
+ function sitePath(path, {
61
+ label,
62
+ query = false
63
+ }) {
64
+ if (safeNext2(path) !== path || !query && /[?#]/.test(path)) {
65
+ const shown = query ? path : path.replace(/[?#].*$/s, "?…");
66
+ throw new TypeError(`${label} must be a path of this site${query ? "" : " with no query or fragment"}, starting with a single "/"; got ${JSON.stringify(shown)}.`);
67
+ }
68
+ return path;
69
+ }
70
+
71
+ // src/session/model/paths.ts
72
+ var SIGN_IN_PATHS2 = {
73
+ signIn: "/sign-in",
74
+ secondFactor: "/sign-in/second-factor"
75
+ };
76
+ function withNext(path, next, query) {
77
+ const params = new URLSearchParams(query);
78
+ const target = safeNext2(next);
79
+ if (target !== HOME2)
80
+ params.set("next", target);
81
+ const search = params.toString();
82
+ return search ? `${path}?${search}` : path;
83
+ }
84
+ function signInPath2(next, options = {}) {
85
+ const path = options.path === undefined ? SIGN_IN_PATHS2.signIn : sitePath(options.path, { label: "signInPath(): options.path" });
86
+ return withNext(path, next, options.query);
87
+ }
88
+ function secondFactorPath2(next, path = SIGN_IN_PATHS2.secondFactor) {
89
+ return withNext(path, next);
90
+ }
91
+ // src/session/model/second-factor.ts
92
+ var TOTP_CODE2 = /^\d{6}$/;
93
+ export { LINK_JSON_HEADER2, postLinkArgs2, postLinkRequest2, sitePath, SIGN_IN_PATHS2, signInPath2, secondFactorPath2, TOTP_CODE2 };
94
+
95
+ //# debugId=E3526C4DF7133D6B64756E2164756E21
96
+ //# sourceMappingURL=index-t2ph23wk.js.map