@heycys/gallery 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (806) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -2
  3. package/THIRD-PARTY-NOTICES.md +3303 -0
  4. package/assets/writing-preferences.md +107 -0
  5. package/bin/gallery.mjs +10 -0
  6. package/browser/editor/components/bookmark/icons.mjs +6 -0
  7. package/browser/editor/components/bookmark/index.mjs +80 -0
  8. package/browser/editor/components/bookmark/page.mjs +147 -0
  9. package/browser/editor/components/builders.mjs +19 -0
  10. package/browser/editor/components/callout/index.mjs +64 -0
  11. package/browser/editor/components/code/index.mjs +327 -0
  12. package/browser/editor/components/code/page.mjs +561 -0
  13. package/browser/editor/components/colors.mjs +50 -0
  14. package/browser/editor/components/columns/index.mjs +104 -0
  15. package/browser/editor/components/columns/page.mjs +310 -0
  16. package/browser/editor/components/details/index.mjs +73 -0
  17. package/browser/editor/components/details/page.mjs +86 -0
  18. package/browser/editor/components/dialog/index.mjs +84 -0
  19. package/browser/editor/components/dialog/page.mjs +201 -0
  20. package/browser/editor/components/divider/index.mjs +48 -0
  21. package/browser/editor/components/embed/icons.mjs +11 -0
  22. package/browser/editor/components/embed/index.mjs +123 -0
  23. package/browser/editor/components/embed/page.mjs +309 -0
  24. package/browser/editor/components/figure/index.mjs +87 -0
  25. package/browser/editor/components/figure/page.mjs +42 -0
  26. package/browser/editor/components/file/icons.mjs +14 -0
  27. package/browser/editor/components/file/index.mjs +77 -0
  28. package/browser/editor/components/file/page.mjs +114 -0
  29. package/browser/editor/components/flowchart/add.mjs +123 -0
  30. package/browser/editor/components/flowchart/index.mjs +246 -0
  31. package/browser/editor/components/flowchart/page.mjs +453 -0
  32. package/browser/editor/components/heading/index.mjs +53 -0
  33. package/browser/editor/components/heading/page.mjs +6 -0
  34. package/browser/editor/components/highlight/index.mjs +63 -0
  35. package/browser/editor/components/icon/index.mjs +57 -0
  36. package/browser/editor/components/icon/page.mjs +286 -0
  37. package/browser/editor/components/icons.mjs +48 -0
  38. package/browser/editor/components/image/crop.mjs +189 -0
  39. package/browser/editor/components/image/index.mjs +104 -0
  40. package/browser/editor/components/image/page.mjs +385 -0
  41. package/browser/editor/components/image/viewer.mjs +213 -0
  42. package/browser/editor/components/installed/index.mjs +179 -0
  43. package/browser/editor/components/installed/page.mjs +523 -0
  44. package/browser/editor/components/installed/served.mjs +35 -0
  45. package/browser/editor/components/kit.mjs +67 -0
  46. package/browser/editor/components/list/index.mjs +194 -0
  47. package/browser/editor/components/list/join.mjs +68 -0
  48. package/browser/editor/components/list/numbers.mjs +107 -0
  49. package/browser/editor/components/list/page.mjs +632 -0
  50. package/browser/editor/components/math/index.mjs +88 -0
  51. package/browser/editor/components/math/page.mjs +236 -0
  52. package/browser/editor/components/math/tex-logo.mjs +6 -0
  53. package/browser/editor/components/media/icons.mjs +19 -0
  54. package/browser/editor/components/media/page.mjs +192 -0
  55. package/browser/editor/components/media/parts.mjs +60 -0
  56. package/browser/editor/components/media/size.mjs +20 -0
  57. package/browser/editor/components/media/toolbar.mjs +37 -0
  58. package/browser/editor/components/media/write.mjs +7 -0
  59. package/browser/editor/components/pages.mjs +46 -0
  60. package/browser/editor/components/paragraph/index.mjs +43 -0
  61. package/browser/editor/components/paragraph/page.mjs +52 -0
  62. package/browser/editor/components/placeholder-bar.mjs +17 -0
  63. package/browser/editor/components/placeholder.mjs +128 -0
  64. package/browser/editor/components/quote/index.mjs +33 -0
  65. package/browser/editor/components/registry.mjs +859 -0
  66. package/browser/editor/components/rows.mjs +16 -0
  67. package/browser/editor/components/section/index.mjs +42 -0
  68. package/browser/editor/components/section/page.mjs +141 -0
  69. package/browser/editor/components/set-apart.mjs +24 -0
  70. package/browser/editor/components/sheets/index.mjs +137 -0
  71. package/browser/editor/components/sheets/page.mjs +227 -0
  72. package/browser/editor/components/sheets/pills.mjs +226 -0
  73. package/browser/editor/components/table/grid.mjs +73 -0
  74. package/browser/editor/components/table/index.mjs +308 -0
  75. package/browser/editor/components/table/page.mjs +683 -0
  76. package/browser/editor/components/table/slots.mjs +41 -0
  77. package/browser/editor/components/widget/index.mjs +50 -0
  78. package/browser/editor/page/annotate/anchors.mjs +230 -0
  79. package/browser/editor/page/annotate/card.mjs +102 -0
  80. package/browser/editor/page/annotate/index.mjs +1656 -0
  81. package/browser/editor/page/at-menu/index.mjs +317 -0
  82. package/browser/editor/page/autosave.mjs +1023 -0
  83. package/browser/editor/page/beside.mjs +21 -0
  84. package/browser/editor/page/block-info.mjs +63 -0
  85. package/browser/editor/page/block-menu/colors.mjs +84 -0
  86. package/browser/editor/page/block-menu/index.mjs +217 -0
  87. package/browser/editor/page/blocks.mjs +255 -0
  88. package/browser/editor/page/caret.mjs +682 -0
  89. package/browser/editor/page/changes/bar.mjs +102 -0
  90. package/browser/editor/page/changes/ghost.mjs +206 -0
  91. package/browser/editor/page/changes/gone-words.mjs +94 -0
  92. package/browser/editor/page/changes/index.mjs +447 -0
  93. package/browser/editor/page/changes/words.mjs +27 -0
  94. package/browser/editor/page/chip-fills.mjs +126 -0
  95. package/browser/editor/page/clipboard/import/colors.mjs +192 -0
  96. package/browser/editor/page/clipboard/import/html.mjs +792 -0
  97. package/browser/editor/page/clipboard/import/inline.mjs +232 -0
  98. package/browser/editor/page/clipboard/import/languages.mjs +42 -0
  99. package/browser/editor/page/clipboard/import/markdown.mjs +760 -0
  100. package/browser/editor/page/clipboard/import/math.mjs +100 -0
  101. package/browser/editor/page/clipboard/import/office.mjs +245 -0
  102. package/browser/editor/page/clipboard/import/read.mjs +120 -0
  103. package/browser/editor/page/clipboard/import/rich.mjs +29 -0
  104. package/browser/editor/page/clipboard/import/to-blocks.mjs +290 -0
  105. package/browser/editor/page/clipboard/index.mjs +816 -0
  106. package/browser/editor/page/clipboard/own/blocks.mjs +211 -0
  107. package/browser/editor/page/clipboard/own/chart-keys.mjs +58 -0
  108. package/browser/editor/page/clipboard/own/describe.mjs +124 -0
  109. package/browser/editor/page/clipboard/own/export.mjs +167 -0
  110. package/browser/editor/page/clipboard/own/ids.mjs +39 -0
  111. package/browser/editor/page/clipboard/own/index.mjs +13 -0
  112. package/browser/editor/page/clipboard/own/rules.mjs +44 -0
  113. package/browser/editor/page/clipboard/own/selection.mjs +159 -0
  114. package/browser/editor/page/clipboard/own/writers.mjs +315 -0
  115. package/browser/editor/page/columns/index.mjs +360 -0
  116. package/browser/editor/page/commit.mjs +1813 -0
  117. package/browser/editor/page/conflicts.mjs +249 -0
  118. package/browser/editor/page/convert.mjs +831 -0
  119. package/browser/editor/page/core.mjs +1693 -0
  120. package/browser/editor/page/drag/drop.mjs +307 -0
  121. package/browser/editor/page/drag/index.mjs +351 -0
  122. package/browser/editor/page/drag/preview.mjs +126 -0
  123. package/browser/editor/page/edge-scroll.mjs +50 -0
  124. package/browser/editor/page/editor.mjs +1780 -0
  125. package/browser/editor/page/emoji-picker/emoji-tab.mjs +287 -0
  126. package/browser/editor/page/emoji-picker/glyph-html.mjs +26 -0
  127. package/browser/editor/page/emoji-picker/grid.mjs +81 -0
  128. package/browser/editor/page/emoji-picker/icon-tab.mjs +217 -0
  129. package/browser/editor/page/emoji-picker/icons.mjs +31 -0
  130. package/browser/editor/page/emoji-picker/index.mjs +166 -0
  131. package/browser/editor/page/emoji-picker/styles.mjs +161 -0
  132. package/browser/editor/page/emoji-picker/support.mjs +204 -0
  133. package/browser/editor/page/emoji-picker/upload.mjs +236 -0
  134. package/browser/editor/page/export-report.mjs +23 -0
  135. package/browser/editor/page/fills.mjs +62 -0
  136. package/browser/editor/page/find/index.mjs +107 -0
  137. package/browser/editor/page/flags.mjs +70 -0
  138. package/browser/editor/page/fold/index.mjs +348 -0
  139. package/browser/editor/page/fold/rule.mjs +125 -0
  140. package/browser/editor/page/folded.mjs +23 -0
  141. package/browser/editor/page/format-bar/bar.mjs +449 -0
  142. package/browser/editor/page/format-bar/brush.mjs +77 -0
  143. package/browser/editor/page/format-bar/colors.mjs +46 -0
  144. package/browser/editor/page/format-bar/index.mjs +404 -0
  145. package/browser/editor/page/formula/index.mjs +236 -0
  146. package/browser/editor/page/formula/panel.mjs +336 -0
  147. package/browser/editor/page/formula/symbols.mjs +156 -0
  148. package/browser/editor/page/frame.mjs +74 -0
  149. package/browser/editor/page/frames.mjs +196 -0
  150. package/browser/editor/page/geometry.mjs +402 -0
  151. package/browser/editor/page/gesture.mjs +45 -0
  152. package/browser/editor/page/handle/index.mjs +650 -0
  153. package/browser/editor/page/handle-sizes.mjs +14 -0
  154. package/browser/editor/page/hints/index.mjs +84 -0
  155. package/browser/editor/page/history.mjs +401 -0
  156. package/browser/editor/page/insert/index.mjs +256 -0
  157. package/browser/editor/page/kept.mjs +38 -0
  158. package/browser/editor/page/links/address.mjs +40 -0
  159. package/browser/editor/page/links/index.mjs +866 -0
  160. package/browser/editor/page/links/pages.mjs +131 -0
  161. package/browser/editor/page/links/views.mjs +369 -0
  162. package/browser/editor/page/long-runs.mjs +75 -0
  163. package/browser/editor/page/look.mjs +77 -0
  164. package/browser/editor/page/made.mjs +24 -0
  165. package/browser/editor/page/margin.mjs +373 -0
  166. package/browser/editor/page/markdown/index.mjs +88 -0
  167. package/browser/editor/page/markdown/rules.mjs +33 -0
  168. package/browser/editor/page/marks.mjs +377 -0
  169. package/browser/editor/page/media-menu/index.mjs +158 -0
  170. package/browser/editor/page/menu.mjs +544 -0
  171. package/browser/editor/page/merge.mjs +124 -0
  172. package/browser/editor/page/notices.mjs +142 -0
  173. package/browser/editor/page/offered.mjs +32 -0
  174. package/browser/editor/page/outline/folds.mjs +53 -0
  175. package/browser/editor/page/outline/index.mjs +783 -0
  176. package/browser/editor/page/outline/list.mjs +184 -0
  177. package/browser/editor/page/outline/read.mjs +201 -0
  178. package/browser/editor/page/outline/strip.mjs +287 -0
  179. package/browser/editor/page/outline/tree.mjs +248 -0
  180. package/browser/editor/page/overlay-layer.mjs +227 -0
  181. package/browser/editor/page/overlays.mjs +205 -0
  182. package/browser/editor/page/own.mjs +28 -0
  183. package/browser/editor/page/pads.mjs +71 -0
  184. package/browser/editor/page/page-objects.mjs +105 -0
  185. package/browser/editor/page/panel.mjs +65 -0
  186. package/browser/editor/page/placement.mjs +58 -0
  187. package/browser/editor/page/post.mjs +41 -0
  188. package/browser/editor/page/present-links.mjs +50 -0
  189. package/browser/editor/page/quiet.mjs +48 -0
  190. package/browser/editor/page/resize/index.mjs +327 -0
  191. package/browser/editor/page/select-all/index.mjs +262 -0
  192. package/browser/editor/page/selection/delete.mjs +61 -0
  193. package/browser/editor/page/selection/index.mjs +164 -0
  194. package/browser/editor/page/selection/marquee.mjs +174 -0
  195. package/browser/editor/page/session.mjs +168 -0
  196. package/browser/editor/page/slash-menu/index.mjs +291 -0
  197. package/browser/editor/page/storage.mjs +48 -0
  198. package/browser/editor/page/sync-state.mjs +267 -0
  199. package/browser/editor/page/table/aligns.mjs +29 -0
  200. package/browser/editor/page/table/cell-bar.mjs +141 -0
  201. package/browser/editor/page/table/cells.mjs +527 -0
  202. package/browser/editor/page/table/icons.mjs +40 -0
  203. package/browser/editor/page/table/index.mjs +990 -0
  204. package/browser/editor/page/table/lists.mjs +187 -0
  205. package/browser/editor/page/table/widths.mjs +313 -0
  206. package/browser/editor/page/tex.mjs +32 -0
  207. package/browser/editor/page/text-select/index.mjs +671 -0
  208. package/browser/editor/page/tooltip.mjs +98 -0
  209. package/browser/editor/page/type-grid.mjs +83 -0
  210. package/browser/editor/page/typing/code-edges.mjs +274 -0
  211. package/browser/editor/page/typing/index.mjs +282 -0
  212. package/browser/editor/page/typing/leave.mjs +68 -0
  213. package/browser/editor/page/ui.mjs +160 -0
  214. package/browser/shared/annotations.mjs +569 -0
  215. package/browser/shared/code-folds.mjs +14 -0
  216. package/browser/shared/code-languages.mjs +70 -0
  217. package/browser/shared/code-lines.mjs +30 -0
  218. package/browser/shared/colors.mjs +30 -0
  219. package/browser/shared/component-catalog.mjs +573 -0
  220. package/browser/shared/components/bookmark.mjs +26 -0
  221. package/browser/shared/components/callout.mjs +9 -0
  222. package/browser/shared/components/chart.mjs +20 -0
  223. package/browser/shared/components/code.mjs +37 -0
  224. package/browser/shared/components/columns.mjs +16 -0
  225. package/browser/shared/components/details.mjs +15 -0
  226. package/browser/shared/components/dialog.mjs +28 -0
  227. package/browser/shared/components/diff.mjs +18 -0
  228. package/browser/shared/components/divider.mjs +6 -0
  229. package/browser/shared/components/embed.mjs +25 -0
  230. package/browser/shared/components/figure.mjs +14 -0
  231. package/browser/shared/components/file.mjs +23 -0
  232. package/browser/shared/components/heading.mjs +6 -0
  233. package/browser/shared/components/highlight.mjs +9 -0
  234. package/browser/shared/components/icon.mjs +18 -0
  235. package/browser/shared/components/image.mjs +39 -0
  236. package/browser/shared/components/index.mjs +396 -0
  237. package/browser/shared/components/installed.mjs +232 -0
  238. package/browser/shared/components/list.mjs +146 -0
  239. package/browser/shared/components/math.mjs +49 -0
  240. package/browser/shared/components/mention.mjs +33 -0
  241. package/browser/shared/components/page.mjs +46 -0
  242. package/browser/shared/components/paragraph.mjs +9 -0
  243. package/browser/shared/components/quote.mjs +6 -0
  244. package/browser/shared/components/section.mjs +8 -0
  245. package/browser/shared/components/sheets.mjs +80 -0
  246. package/browser/shared/components/state.mjs +20 -0
  247. package/browser/shared/components/table.mjs +49 -0
  248. package/browser/shared/components/text.mjs +14 -0
  249. package/browser/shared/components/widget.mjs +10 -0
  250. package/browser/shared/copy-ids.mjs +72 -0
  251. package/browser/shared/css-references.mjs +110 -0
  252. package/browser/shared/document-look.mjs +178 -0
  253. package/browser/shared/emoji/custom.mjs +91 -0
  254. package/browser/shared/emoji/data/LICENSE-lucide.txt +43 -0
  255. package/browser/shared/emoji/data/LICENSE-mingcute.txt +202 -0
  256. package/browser/shared/emoji/data/LICENSE-tabler.txt +21 -0
  257. package/browser/shared/emoji/data/README.md +28 -0
  258. package/browser/shared/emoji/data/categories.json +1 -0
  259. package/browser/shared/emoji/data/icons.json +1 -0
  260. package/browser/shared/emoji/data/keywords-en.json +1 -0
  261. package/browser/shared/emoji/data/keywords-zh.json +1 -0
  262. package/browser/shared/emoji/data/names.json +1 -0
  263. package/browser/shared/emoji/data/positions.json +1 -0
  264. package/browser/shared/emoji/data/twemoji-index.json +1 -0
  265. package/browser/shared/emoji/data/twemoji-svg.bin +0 -0
  266. package/browser/shared/emoji/data.mjs +194 -0
  267. package/browser/shared/emoji/emoji.mjs +38 -0
  268. package/browser/shared/emoji/glyphs.mjs +134 -0
  269. package/browser/shared/emoji/icon-value.mjs +91 -0
  270. package/browser/shared/escape.mjs +20 -0
  271. package/browser/shared/export-wrap.mjs +89 -0
  272. package/browser/shared/files.mjs +33 -0
  273. package/browser/shared/html-tree.mjs +59 -0
  274. package/browser/shared/http.mjs +22 -0
  275. package/browser/shared/i18n/en.mjs +1223 -0
  276. package/browser/shared/i18n/index.mjs +132 -0
  277. package/browser/shared/ids.mjs +24 -0
  278. package/browser/shared/import-types.mjs +23 -0
  279. package/browser/shared/inline-spacing.mjs +97 -0
  280. package/browser/shared/layers.mjs +42 -0
  281. package/browser/shared/long-runs.mjs +39 -0
  282. package/browser/shared/media.mjs +162 -0
  283. package/browser/shared/new-names.mjs +67 -0
  284. package/browser/shared/number-reading.mjs +92 -0
  285. package/browser/shared/old-names.mjs +143 -0
  286. package/browser/shared/outline.mjs +194 -0
  287. package/browser/shared/page-address.mjs +140 -0
  288. package/browser/shared/page-links.mjs +86 -0
  289. package/browser/shared/paths.mjs +73 -0
  290. package/browser/shared/preferences.mjs +116 -0
  291. package/browser/shared/preview-server.mjs +247 -0
  292. package/browser/shared/qa-levels.mjs +93 -0
  293. package/browser/shared/reading-place.mjs +91 -0
  294. package/browser/shared/renamed-storage.mjs +220 -0
  295. package/browser/shared/reports.mjs +46 -0
  296. package/browser/shared/search.mjs +85 -0
  297. package/browser/shared/session.mjs +77 -0
  298. package/browser/shared/table-chart.mjs +113 -0
  299. package/browser/shared/table-hides.mjs +120 -0
  300. package/browser/shared/table-slots.mjs +75 -0
  301. package/browser/shared/words.mjs +23 -0
  302. package/browser/shared/workspace-look.mjs +91 -0
  303. package/browser/shared/workspace.mjs +535 -0
  304. package/browser/shared/writing-preferences.mjs +68 -0
  305. package/browser/shared/zoom.mjs +57 -0
  306. package/dist/chunk-2B5E4CDJ.mjs +2 -0
  307. package/dist/chunk-342HXE3Q.mjs +2 -0
  308. package/dist/chunk-3HIRPVLU.mjs +2 -0
  309. package/dist/chunk-43B75J5T.mjs +2 -0
  310. package/dist/chunk-4FS7Z7WR.mjs +2 -0
  311. package/dist/chunk-4K5KC6V2.mjs +2 -0
  312. package/dist/chunk-5L7RYZCL.mjs +2 -0
  313. package/dist/chunk-5MHMDLZD.mjs +4 -0
  314. package/dist/chunk-5ZKJ3H4P.mjs +8 -0
  315. package/dist/chunk-64K7IPLO.mjs +255 -0
  316. package/dist/chunk-6QXGZM36.mjs +8 -0
  317. package/dist/chunk-6RGJOMJP.mjs +16 -0
  318. package/dist/chunk-742D2WWJ.mjs +19 -0
  319. package/dist/chunk-7DTINW6U.mjs +48 -0
  320. package/dist/chunk-A55HN5OK.mjs +2 -0
  321. package/dist/chunk-AGDILNWB.mjs +2 -0
  322. package/dist/chunk-AJ73XJF3.mjs +2 -0
  323. package/dist/chunk-AUZGSZJH.mjs +13 -0
  324. package/dist/chunk-BFE45AKL.mjs +2 -0
  325. package/dist/chunk-BGGDRNYQ.mjs +10 -0
  326. package/dist/chunk-BXO2ZY5P.mjs +2 -0
  327. package/dist/chunk-C564NU2H.mjs +77 -0
  328. package/dist/chunk-CEH4MRCC.mjs +2 -0
  329. package/dist/chunk-CY2FNNAB.mjs +16 -0
  330. package/dist/chunk-DFUDV4LX.mjs +2 -0
  331. package/dist/chunk-DKXG4XDG.mjs +2 -0
  332. package/dist/chunk-E7LWZRXY.mjs +4 -0
  333. package/dist/chunk-EZQ34M3F.mjs +124 -0
  334. package/dist/chunk-EZY3WC6Z.mjs +15 -0
  335. package/dist/chunk-FDLXYYG4.mjs +4 -0
  336. package/dist/chunk-FUKQNOQS.mjs +9 -0
  337. package/dist/chunk-GB5SOYQJ.mjs +7 -0
  338. package/dist/chunk-GRAXKKG4.mjs +2 -0
  339. package/dist/chunk-HYMEEXKN.mjs +4 -0
  340. package/dist/chunk-IVDLMMBD.mjs +2 -0
  341. package/dist/chunk-JPOSLGOC.mjs +6 -0
  342. package/dist/chunk-JVHHHGEA.mjs +3 -0
  343. package/dist/chunk-L3QKH4OK.mjs +26 -0
  344. package/dist/chunk-LAE5NQ4B.mjs +2 -0
  345. package/dist/chunk-LCTHTZIL.mjs +960 -0
  346. package/dist/chunk-LEF6DRCK.mjs +59 -0
  347. package/dist/chunk-LKX55H76.mjs +2 -0
  348. package/dist/chunk-LS4F7JUM.mjs +2 -0
  349. package/dist/chunk-MAFIGVXY.mjs +2 -0
  350. package/dist/chunk-NO5NJCHO.mjs +2 -0
  351. package/dist/chunk-NQPVAU63.mjs +2 -0
  352. package/dist/chunk-NSKUTQ5J.mjs +5 -0
  353. package/dist/chunk-O35FIXRB.mjs +2 -0
  354. package/dist/chunk-P2CAZPDP.mjs +3 -0
  355. package/dist/chunk-PL6GHLGD.mjs +15 -0
  356. package/dist/chunk-QAIHRH3I.mjs +13 -0
  357. package/dist/chunk-QJIR2BLP.mjs +6 -0
  358. package/dist/chunk-QR6A54KJ.mjs +3 -0
  359. package/dist/chunk-QUPLVPB2.mjs +7 -0
  360. package/dist/chunk-R7BNENLY.mjs +4 -0
  361. package/dist/chunk-S6O4UHLC.mjs +2 -0
  362. package/dist/chunk-SGJWQKEI.mjs +2 -0
  363. package/dist/chunk-SYGN7GLU.mjs +2 -0
  364. package/dist/chunk-TMYZB6AV.mjs +2 -0
  365. package/dist/chunk-TX6JH7TR.mjs +2 -0
  366. package/dist/chunk-TYK6VNAB.mjs +10 -0
  367. package/dist/chunk-U3SSPL4K.mjs +8 -0
  368. package/dist/chunk-U6KNPJPR.mjs +2 -0
  369. package/dist/chunk-UALRNVSE.mjs +4 -0
  370. package/dist/chunk-UH4SIXTR.mjs +2 -0
  371. package/dist/chunk-UMHUSOPJ.mjs +2 -0
  372. package/dist/chunk-V3HXVQEM.mjs +2 -0
  373. package/dist/chunk-V5JTW2LH.mjs +27 -0
  374. package/dist/chunk-V5VXUJKG.mjs +2 -0
  375. package/dist/chunk-V6XZ4VIR.mjs +2 -0
  376. package/dist/chunk-VBXMADMP.mjs +2 -0
  377. package/dist/chunk-VNV55RUA.mjs +2 -0
  378. package/dist/chunk-VPD2PS35.mjs +2 -0
  379. package/dist/chunk-W3BGBJQW.mjs +2 -0
  380. package/dist/chunk-W4VKN3GF.mjs +7 -0
  381. package/dist/chunk-W5BXXPDJ.mjs +3 -0
  382. package/dist/chunk-W7XHE4CT.mjs +2 -0
  383. package/dist/chunk-XNROSH2T.mjs +4 -0
  384. package/dist/chunk-XUNHRCOG.mjs +6 -0
  385. package/dist/chunk-Y34NR5JL.mjs +2 -0
  386. package/dist/chunk-Y6RLRPG3.mjs +3 -0
  387. package/dist/chunk-YEY3RSFQ.mjs +2 -0
  388. package/dist/cli.mjs +2 -0
  389. package/dist/server.mjs +2 -0
  390. package/dist/worker.mjs +5 -0
  391. package/kit/charts.js +355 -0
  392. package/kit/code.js +164 -0
  393. package/kit/dialogs.js +157 -0
  394. package/kit/math.js +2004 -0
  395. package/kit/report.css +2932 -0
  396. package/kit/runtime.js +1782 -0
  397. package/kit/sheets.js +123 -0
  398. package/kit/state.js +217 -0
  399. package/kit/tables.js +1499 -0
  400. package/kit/tokens.js +29 -0
  401. package/kit/ui.js +658 -0
  402. package/package.json +41 -4
  403. package/release.json +25 -0
  404. package/sdk/column-widths.d.ts +56 -0
  405. package/sdk/doc-charts.d.ts +82 -0
  406. package/sdk/doc-code.d.ts +28 -0
  407. package/sdk/doc-dialogs.d.ts +4 -0
  408. package/sdk/doc-kit.d.ts +147 -0
  409. package/sdk/doc-math.d.ts +3 -0
  410. package/sdk/doc-sheets.d.ts +15 -0
  411. package/sdk/doc-state.d.ts +41 -0
  412. package/sdk/doc-tables.d.ts +24 -0
  413. package/sdk/doc-tokens.d.ts +22 -0
  414. package/sdk/index.d.ts +30 -0
  415. package/skill/SKILL.md +150 -0
  416. package/skill/agents/openai.yaml +5 -0
  417. package/skill/references/building-components.md +367 -0
  418. package/skill/references/example-report.html +356 -0
  419. package/skill/references/writing-html.md +187 -0
  420. package/skill/sdk/column-widths.d.ts +56 -0
  421. package/skill/sdk/doc-charts.d.ts +82 -0
  422. package/skill/sdk/doc-code.d.ts +28 -0
  423. package/skill/sdk/doc-dialogs.d.ts +4 -0
  424. package/skill/sdk/doc-kit.d.ts +147 -0
  425. package/skill/sdk/doc-math.d.ts +3 -0
  426. package/skill/sdk/doc-sheets.d.ts +15 -0
  427. package/skill/sdk/doc-state.d.ts +41 -0
  428. package/skill/sdk/doc-tables.d.ts +24 -0
  429. package/skill/sdk/doc-tokens.d.ts +22 -0
  430. package/skill/sdk/index.d.ts +30 -0
  431. package/starter/doc.html +21 -0
  432. package/starter/doc.json +5 -0
  433. package/vendor/d3.v7.9.0.min.js +2 -0
  434. package/vendor/katex/auto-render.min.js +1 -0
  435. package/vendor/katex/contrib/mhchem.min.js +1 -0
  436. package/vendor/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  437. package/vendor/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  438. package/vendor/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  439. package/vendor/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  440. package/vendor/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  441. package/vendor/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
  442. package/vendor/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  443. package/vendor/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
  444. package/vendor/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
  445. package/vendor/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  446. package/vendor/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
  447. package/vendor/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  448. package/vendor/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  449. package/vendor/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  450. package/vendor/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
  451. package/vendor/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  452. package/vendor/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  453. package/vendor/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  454. package/vendor/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  455. package/vendor/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  456. package/vendor/katex/katex.min.css +1 -0
  457. package/vendor/katex/katex.min.js +1 -0
  458. package/vendor/pdfjs/LICENSE +177 -0
  459. package/vendor/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
  460. package/vendor/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
  461. package/vendor/pdfjs/cmaps/78-H.bcmap +0 -0
  462. package/vendor/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
  463. package/vendor/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
  464. package/vendor/pdfjs/cmaps/78-V.bcmap +0 -0
  465. package/vendor/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
  466. package/vendor/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
  467. package/vendor/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
  468. package/vendor/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
  469. package/vendor/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
  470. package/vendor/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
  471. package/vendor/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
  472. package/vendor/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
  473. package/vendor/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
  474. package/vendor/pdfjs/cmaps/Add-H.bcmap +0 -0
  475. package/vendor/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
  476. package/vendor/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
  477. package/vendor/pdfjs/cmaps/Add-V.bcmap +0 -0
  478. package/vendor/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
  479. package/vendor/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
  480. package/vendor/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
  481. package/vendor/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
  482. package/vendor/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
  483. package/vendor/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
  484. package/vendor/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
  485. package/vendor/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  486. package/vendor/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
  487. package/vendor/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
  488. package/vendor/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
  489. package/vendor/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
  490. package/vendor/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
  491. package/vendor/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
  492. package/vendor/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  493. package/vendor/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
  494. package/vendor/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
  495. package/vendor/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
  496. package/vendor/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
  497. package/vendor/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
  498. package/vendor/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
  499. package/vendor/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
  500. package/vendor/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  501. package/vendor/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
  502. package/vendor/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
  503. package/vendor/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
  504. package/vendor/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  505. package/vendor/pdfjs/cmaps/B5-H.bcmap +0 -0
  506. package/vendor/pdfjs/cmaps/B5-V.bcmap +0 -0
  507. package/vendor/pdfjs/cmaps/B5pc-H.bcmap +0 -0
  508. package/vendor/pdfjs/cmaps/B5pc-V.bcmap +0 -0
  509. package/vendor/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
  510. package/vendor/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
  511. package/vendor/pdfjs/cmaps/CNS1-H.bcmap +0 -0
  512. package/vendor/pdfjs/cmaps/CNS1-V.bcmap +0 -0
  513. package/vendor/pdfjs/cmaps/CNS2-H.bcmap +0 -0
  514. package/vendor/pdfjs/cmaps/CNS2-V.bcmap +3 -0
  515. package/vendor/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
  516. package/vendor/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
  517. package/vendor/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
  518. package/vendor/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
  519. package/vendor/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
  520. package/vendor/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
  521. package/vendor/pdfjs/cmaps/EUC-H.bcmap +0 -0
  522. package/vendor/pdfjs/cmaps/EUC-V.bcmap +0 -0
  523. package/vendor/pdfjs/cmaps/Ext-H.bcmap +0 -0
  524. package/vendor/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
  525. package/vendor/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
  526. package/vendor/pdfjs/cmaps/Ext-V.bcmap +0 -0
  527. package/vendor/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
  528. package/vendor/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
  529. package/vendor/pdfjs/cmaps/GB-H.bcmap +4 -0
  530. package/vendor/pdfjs/cmaps/GB-V.bcmap +0 -0
  531. package/vendor/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
  532. package/vendor/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
  533. package/vendor/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
  534. package/vendor/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
  535. package/vendor/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
  536. package/vendor/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
  537. package/vendor/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
  538. package/vendor/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
  539. package/vendor/pdfjs/cmaps/GBT-H.bcmap +0 -0
  540. package/vendor/pdfjs/cmaps/GBT-V.bcmap +0 -0
  541. package/vendor/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
  542. package/vendor/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
  543. package/vendor/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
  544. package/vendor/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
  545. package/vendor/pdfjs/cmaps/H.bcmap +0 -0
  546. package/vendor/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
  547. package/vendor/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
  548. package/vendor/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
  549. package/vendor/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
  550. package/vendor/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
  551. package/vendor/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
  552. package/vendor/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
  553. package/vendor/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
  554. package/vendor/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
  555. package/vendor/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
  556. package/vendor/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
  557. package/vendor/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
  558. package/vendor/pdfjs/cmaps/Hankaku.bcmap +0 -0
  559. package/vendor/pdfjs/cmaps/Hiragana.bcmap +0 -0
  560. package/vendor/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
  561. package/vendor/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
  562. package/vendor/pdfjs/cmaps/KSC-H.bcmap +0 -0
  563. package/vendor/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
  564. package/vendor/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
  565. package/vendor/pdfjs/cmaps/KSC-V.bcmap +0 -0
  566. package/vendor/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
  567. package/vendor/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  568. package/vendor/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  569. package/vendor/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
  570. package/vendor/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
  571. package/vendor/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
  572. package/vendor/pdfjs/cmaps/Katakana.bcmap +0 -0
  573. package/vendor/pdfjs/cmaps/LICENSE +36 -0
  574. package/vendor/pdfjs/cmaps/NWP-H.bcmap +0 -0
  575. package/vendor/pdfjs/cmaps/NWP-V.bcmap +0 -0
  576. package/vendor/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
  577. package/vendor/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
  578. package/vendor/pdfjs/cmaps/Roman.bcmap +0 -0
  579. package/vendor/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  580. package/vendor/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  581. package/vendor/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  582. package/vendor/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  583. package/vendor/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  584. package/vendor/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  585. package/vendor/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  586. package/vendor/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  587. package/vendor/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
  588. package/vendor/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
  589. package/vendor/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
  590. package/vendor/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
  591. package/vendor/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
  592. package/vendor/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
  593. package/vendor/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
  594. package/vendor/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
  595. package/vendor/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  596. package/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  597. package/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  598. package/vendor/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  599. package/vendor/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  600. package/vendor/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  601. package/vendor/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  602. package/vendor/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  603. package/vendor/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  604. package/vendor/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  605. package/vendor/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  606. package/vendor/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  607. package/vendor/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  608. package/vendor/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  609. package/vendor/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  610. package/vendor/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  611. package/vendor/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  612. package/vendor/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  613. package/vendor/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  614. package/vendor/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  615. package/vendor/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  616. package/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  617. package/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  618. package/vendor/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
  619. package/vendor/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
  620. package/vendor/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
  621. package/vendor/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
  622. package/vendor/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
  623. package/vendor/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
  624. package/vendor/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
  625. package/vendor/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
  626. package/vendor/pdfjs/cmaps/V.bcmap +0 -0
  627. package/vendor/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
  628. package/vendor/pdfjs/legacy/build/pdf.min.mjs +27 -0
  629. package/vendor/pdfjs/legacy/build/pdf.worker.min.mjs +27 -0
  630. package/vendor/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
  631. package/vendor/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
  632. package/vendor/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
  633. package/vendor/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
  634. package/vendor/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
  635. package/vendor/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
  636. package/vendor/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
  637. package/vendor/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
  638. package/vendor/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
  639. package/vendor/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
  640. package/vendor/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
  641. package/vendor/pdfjs/standard_fonts/LICENSE_LIBERATION +363 -0
  642. package/vendor/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
  643. package/vendor/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
  644. package/vendor/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
  645. package/vendor/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
  646. package/vendor/types/@types/d3/LICENSE +21 -0
  647. package/vendor/types/@types/d3/index.d.ts +39 -0
  648. package/vendor/types/@types/d3/package.json +81 -0
  649. package/vendor/types/@types/d3-array/LICENSE +21 -0
  650. package/vendor/types/@types/d3-array/index.d.ts +1118 -0
  651. package/vendor/types/@types/d3-array/package.json +56 -0
  652. package/vendor/types/@types/d3-axis/LICENSE +21 -0
  653. package/vendor/types/@types/d3-axis/index.d.ts +293 -0
  654. package/vendor/types/@types/d3-axis/package.json +47 -0
  655. package/vendor/types/@types/d3-brush/LICENSE +21 -0
  656. package/vendor/types/@types/d3-brush/index.d.ts +255 -0
  657. package/vendor/types/@types/d3-brush/package.json +42 -0
  658. package/vendor/types/@types/d3-chord/LICENSE +21 -0
  659. package/vendor/types/@types/d3-chord/index.d.ts +471 -0
  660. package/vendor/types/@types/d3-chord/package.json +40 -0
  661. package/vendor/types/@types/d3-color/LICENSE +21 -0
  662. package/vendor/types/@types/d3-color/index.d.ts +669 -0
  663. package/vendor/types/@types/d3-color/package.json +55 -0
  664. package/vendor/types/@types/d3-contour/LICENSE +21 -0
  665. package/vendor/types/@types/d3-contour/index.d.ts +222 -0
  666. package/vendor/types/@types/d3-contour/package.json +38 -0
  667. package/vendor/types/@types/d3-delaunay/LICENSE +21 -0
  668. package/vendor/types/@types/d3-delaunay/index.d.ts +316 -0
  669. package/vendor/types/@types/d3-delaunay/package.json +30 -0
  670. package/vendor/types/@types/d3-dispatch/LICENSE +21 -0
  671. package/vendor/types/@types/d3-dispatch/index.d.ts +96 -0
  672. package/vendor/types/@types/d3-dispatch/package.json +51 -0
  673. package/vendor/types/@types/d3-drag/LICENSE +21 -0
  674. package/vendor/types/@types/d3-drag/index.d.ts +395 -0
  675. package/vendor/types/@types/d3-drag/package.json +42 -0
  676. package/vendor/types/@types/d3-dsv/LICENSE +21 -0
  677. package/vendor/types/@types/d3-dsv/index.d.ts +482 -0
  678. package/vendor/types/@types/d3-dsv/package.json +45 -0
  679. package/vendor/types/@types/d3-ease/LICENSE +21 -0
  680. package/vendor/types/@types/d3-ease/index.d.ts +316 -0
  681. package/vendor/types/@types/d3-ease/package.json +40 -0
  682. package/vendor/types/@types/d3-fetch/LICENSE +21 -0
  683. package/vendor/types/@types/d3-fetch/index.d.ts +282 -0
  684. package/vendor/types/@types/d3-fetch/package.json +37 -0
  685. package/vendor/types/@types/d3-force/LICENSE +21 -0
  686. package/vendor/types/@types/d3-force/index.d.ts +899 -0
  687. package/vendor/types/@types/d3-force/package.json +45 -0
  688. package/vendor/types/@types/d3-format/LICENSE +21 -0
  689. package/vendor/types/@types/d3-format/index.d.ts +337 -0
  690. package/vendor/types/@types/d3-format/package.json +45 -0
  691. package/vendor/types/@types/d3-geo/LICENSE +21 -0
  692. package/vendor/types/@types/d3-geo/index.d.ts +1371 -0
  693. package/vendor/types/@types/d3-geo/package.json +48 -0
  694. package/vendor/types/@types/d3-hierarchy/LICENSE +21 -0
  695. package/vendor/types/@types/d3-hierarchy/index.d.ts +928 -0
  696. package/vendor/types/@types/d3-hierarchy/package.json +50 -0
  697. package/vendor/types/@types/d3-interpolate/LICENSE +21 -0
  698. package/vendor/types/@types/d3-interpolate/index.d.ts +387 -0
  699. package/vendor/types/@types/d3-interpolate/package.json +47 -0
  700. package/vendor/types/@types/d3-path/LICENSE +21 -0
  701. package/vendor/types/@types/d3-path/index.d.ts +108 -0
  702. package/vendor/types/@types/d3-path/package.json +41 -0
  703. package/vendor/types/@types/d3-polygon/LICENSE +21 -0
  704. package/vendor/types/@types/d3-polygon/index.d.ts +41 -0
  705. package/vendor/types/@types/d3-polygon/package.json +40 -0
  706. package/vendor/types/@types/d3-quadtree/LICENSE +21 -0
  707. package/vendor/types/@types/d3-quadtree/index.d.ts +204 -0
  708. package/vendor/types/@types/d3-quadtree/package.json +45 -0
  709. package/vendor/types/@types/d3-random/LICENSE +21 -0
  710. package/vendor/types/@types/d3-random/index.d.ts +313 -0
  711. package/vendor/types/@types/d3-random/package.json +41 -0
  712. package/vendor/types/@types/d3-scale/LICENSE +21 -0
  713. package/vendor/types/@types/d3-scale/index.d.ts +2669 -0
  714. package/vendor/types/@types/d3-scale/package.json +53 -0
  715. package/vendor/types/@types/d3-scale-chromatic/LICENSE +21 -0
  716. package/vendor/types/@types/d3-scale-chromatic/index.d.ts +520 -0
  717. package/vendor/types/@types/d3-scale-chromatic/package.json +46 -0
  718. package/vendor/types/@types/d3-selection/LICENSE +21 -0
  719. package/vendor/types/@types/d3-selection/index.d.ts +1210 -0
  720. package/vendor/types/@types/d3-selection/package.json +56 -0
  721. package/vendor/types/@types/d3-shape/LICENSE +21 -0
  722. package/vendor/types/@types/d3-shape/index.d.ts +2792 -0
  723. package/vendor/types/@types/d3-shape/package.json +53 -0
  724. package/vendor/types/@types/d3-time/LICENSE +21 -0
  725. package/vendor/types/@types/d3-time/index.d.ts +697 -0
  726. package/vendor/types/@types/d3-time/package.json +46 -0
  727. package/vendor/types/@types/d3-time-format/LICENSE +21 -0
  728. package/vendor/types/@types/d3-time-format/index.d.ts +202 -0
  729. package/vendor/types/@types/d3-time-format/package.json +40 -0
  730. package/vendor/types/@types/d3-timer/LICENSE +21 -0
  731. package/vendor/types/@types/d3-timer/index.d.ts +68 -0
  732. package/vendor/types/@types/d3-timer/package.json +45 -0
  733. package/vendor/types/@types/d3-transition/LICENSE +21 -0
  734. package/vendor/types/@types/d3-transition/index.d.ts +664 -0
  735. package/vendor/types/@types/d3-transition/package.json +47 -0
  736. package/vendor/types/@types/d3-zoom/LICENSE +21 -0
  737. package/vendor/types/@types/d3-zoom/index.d.ts +611 -0
  738. package/vendor/types/@types/d3-zoom/package.json +48 -0
  739. package/vendor/types/@types/geojson/LICENSE +21 -0
  740. package/vendor/types/@types/geojson/index.d.ts +202 -0
  741. package/vendor/types/@types/geojson/package.json +46 -0
  742. package/vendor/typescript/LICENSE.txt +55 -0
  743. package/vendor/typescript/lib.decorators.d.ts +384 -0
  744. package/vendor/typescript/lib.decorators.legacy.d.ts +22 -0
  745. package/vendor/typescript/lib.dom.d.ts +39429 -0
  746. package/vendor/typescript/lib.dom.iterable.d.ts +571 -0
  747. package/vendor/typescript/lib.es2015.collection.d.ts +147 -0
  748. package/vendor/typescript/lib.es2015.core.d.ts +597 -0
  749. package/vendor/typescript/lib.es2015.d.ts +28 -0
  750. package/vendor/typescript/lib.es2015.generator.d.ts +77 -0
  751. package/vendor/typescript/lib.es2015.iterable.d.ts +605 -0
  752. package/vendor/typescript/lib.es2015.promise.d.ts +81 -0
  753. package/vendor/typescript/lib.es2015.proxy.d.ts +128 -0
  754. package/vendor/typescript/lib.es2015.reflect.d.ts +144 -0
  755. package/vendor/typescript/lib.es2015.symbol.d.ts +46 -0
  756. package/vendor/typescript/lib.es2015.symbol.wellknown.d.ts +326 -0
  757. package/vendor/typescript/lib.es2016.array.include.d.ts +116 -0
  758. package/vendor/typescript/lib.es2016.d.ts +21 -0
  759. package/vendor/typescript/lib.es2016.intl.d.ts +31 -0
  760. package/vendor/typescript/lib.es2017.arraybuffer.d.ts +21 -0
  761. package/vendor/typescript/lib.es2017.d.ts +26 -0
  762. package/vendor/typescript/lib.es2017.date.d.ts +31 -0
  763. package/vendor/typescript/lib.es2017.intl.d.ts +44 -0
  764. package/vendor/typescript/lib.es2017.object.d.ts +49 -0
  765. package/vendor/typescript/lib.es2017.sharedmemory.d.ts +135 -0
  766. package/vendor/typescript/lib.es2017.string.d.ts +45 -0
  767. package/vendor/typescript/lib.es2017.typedarrays.d.ts +53 -0
  768. package/vendor/typescript/lib.es2018.asyncgenerator.d.ts +77 -0
  769. package/vendor/typescript/lib.es2018.asynciterable.d.ts +53 -0
  770. package/vendor/typescript/lib.es2018.d.ts +24 -0
  771. package/vendor/typescript/lib.es2018.intl.d.ts +83 -0
  772. package/vendor/typescript/lib.es2018.promise.d.ts +30 -0
  773. package/vendor/typescript/lib.es2018.regexp.d.ts +37 -0
  774. package/vendor/typescript/lib.es2019.array.d.ts +79 -0
  775. package/vendor/typescript/lib.es2019.d.ts +24 -0
  776. package/vendor/typescript/lib.es2019.intl.d.ts +23 -0
  777. package/vendor/typescript/lib.es2019.object.d.ts +33 -0
  778. package/vendor/typescript/lib.es2019.string.d.ts +37 -0
  779. package/vendor/typescript/lib.es2019.symbol.d.ts +24 -0
  780. package/vendor/typescript/lib.es2020.bigint.d.ts +765 -0
  781. package/vendor/typescript/lib.es2020.d.ts +27 -0
  782. package/vendor/typescript/lib.es2020.date.d.ts +42 -0
  783. package/vendor/typescript/lib.es2020.intl.d.ts +474 -0
  784. package/vendor/typescript/lib.es2020.number.d.ts +28 -0
  785. package/vendor/typescript/lib.es2020.promise.d.ts +47 -0
  786. package/vendor/typescript/lib.es2020.sharedmemory.d.ts +99 -0
  787. package/vendor/typescript/lib.es2020.string.d.ts +44 -0
  788. package/vendor/typescript/lib.es2020.symbol.wellknown.d.ts +41 -0
  789. package/vendor/typescript/lib.es2021.d.ts +23 -0
  790. package/vendor/typescript/lib.es2021.intl.d.ts +166 -0
  791. package/vendor/typescript/lib.es2021.promise.d.ts +48 -0
  792. package/vendor/typescript/lib.es2021.string.d.ts +33 -0
  793. package/vendor/typescript/lib.es2021.weakref.d.ts +78 -0
  794. package/vendor/typescript/lib.es2022.array.d.ts +121 -0
  795. package/vendor/typescript/lib.es2022.d.ts +25 -0
  796. package/vendor/typescript/lib.es2022.error.d.ts +75 -0
  797. package/vendor/typescript/lib.es2022.intl.d.ts +145 -0
  798. package/vendor/typescript/lib.es2022.object.d.ts +26 -0
  799. package/vendor/typescript/lib.es2022.regexp.d.ts +39 -0
  800. package/vendor/typescript/lib.es2022.string.d.ts +25 -0
  801. package/vendor/typescript/lib.es5.d.ts +4601 -0
  802. package/vendor/typescript/package.json +4 -0
  803. package/vendor/typescript/typescript.js +446 -0
  804. package/web/assets/index-Bh74DfsV.css +1 -0
  805. package/web/assets/index-UW0RyFFt.js +13 -0
  806. package/web/index.html +14 -0
@@ -0,0 +1,59 @@
1
+ import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
2
+ import{a as w}from"./chunk-TX6JH7TR.mjs";import{c as O}from"./chunk-64K7IPLO.mjs";import{a as k,b as d,f as N}from"./chunk-NSKUTQ5J.mjs";import{i as S}from"./chunk-BGGDRNYQ.mjs";import{c as $,g as b,o as A,p as C,r as x}from"./chunk-W4VKN3GF.mjs";import y from"node:fs";import v from"node:path";import{blocksHidden as K}from"../browser/editor/components/registry.mjs";import{PACKAGE_ID as B,SLOT as L}from"../browser/shared/components/installed.mjs";import{DEVICE_NAMES as R,layoutOf as T,PACKAGE_MANIFEST as U,shallowPackages as F}from"../browser/shared/workspace.mjs";var M=(t,e,{script:o,flow:s})=>`{
3
+ "id": "${t}",
4
+ "apiVersion": 1,
5
+ "version": "0.1.0",
6
+ "name": { "zh": "${e}", "en": "${e}" },
7
+ "description": { "zh": "\u4E00\u4E2A\u53EF\u4EE5\u53CD\u590D\u4F7F\u7528\u7684\u5757", "en": "A block to use again" },
8
+ "words": "${e}",
9
+ "parts": {
10
+ "title": { "at": ":scope > h3", "edit": "text" },
11
+ ${s?'"body": { "edit": "flow" }':'"text": { "at": ":scope > p", "edit": "text", "optional": true }'}
12
+ },${o?`
13
+ "runtime": { "generated": [".component-drawn"] },`:""}
14
+ "markdown": "parts"
15
+ }
16
+ `,P=(t,e,o,s)=>`<div data-doc-component="${t}">
17
+ <h3>${e}</h3>
18
+ ${s?` <div data-doc-slot="body">
19
+ ${s.map(n=>` ${n}
20
+ `).join("")} </div>`:` <p>${o}</p>`}
21
+ </div>
22
+ `,W=["<p>\u8FD9\u91CC\u5199\u8FD9\u4E2A\u5757\u5728\u4E00\u4EFD\u6587\u6863\u91CC\u7684\u6837\u5B50\u3002</p>","<ul>"," <li>\u63D2\u69FD\u91CC\u5199\u6587\u6863\u81EA\u5DF1\u7684\u5757</li>"," <li>\u6BB5\u843D\u3001\u5217\u8868\u3001\u8868\u683C\u90FD\u53EF\u4EE5</li>","</ul>"],_=(t,e)=>`/* Every selector starts at the instance, so that nothing here reaches the rest of the page.${e?` Each step is
23
+ a >, so that none reaches into the slot, whose blocks read as the page's.`:""} */
24
+ [data-doc-component="${t}"] { padding: 12px 16px; border: 1px solid var(--doc-border); border-radius: 8px; }
25
+ [data-doc-component="${t}"] > h3 { margin-top: 0; }
26
+ `,G=(t,e,{script:o,flow:s})=>`# ${e}
27
+
28
+ What this block is for, and when a document uses it rather than a block of Gallery's own.
29
+
30
+ ## How to write it
31
+
32
+ Write the element as example.html does: \`gallery component show ${t}\` prints it. Each part, and what goes in it:
33
+
34
+ - the title, its \`h3\`: required.
35
+ ${s?'- the body, its `<div data-doc-slot="body">`: required, the document\'s own blocks, written as anywhere in the document (paragraphs, lists, tables, formulas).\n':"- the text, its `p`: optional.\n"}
36
+ ## How it looks
37
+
38
+ What a reader sees of it, and what it shows while it is empty.
39
+ ${o?`
40
+ ## Its script
41
+
42
+ kit.js runs with the rights of a document's own script. What it draws, it draws in what the manifest's \`runtime\` names${s?", outside the slot: it reads the slot and never writes in it":""}.
43
+ `:""}`,D=t=>`// Starts each instance from what the file says, and draws in a node the manifest's runtime names:
44
+ // the kit takes that off an instance before it starts one again, as an undo may put one back.
45
+ DocKit.component({
46
+ id: "${t}",
47
+ on: ["source"],
48
+ mount(host, context) {
49
+ const drawn = document.createElement("div");
50
+ drawn.className = "component-drawn";
51
+ host.append(drawn);
52
+ const draw = () => { drawn.textContent = context.part("title")?.textContent ?? ""; };
53
+ draw();
54
+ return { update: draw };
55
+ },
56
+ });
57
+ `;function I(t,{script:e=!1,flow:o=!1}={}){let s=t.split("/")[1],n={script:e,flow:o};return{"component.json":M(t,s,n),"template.html":P(t,"\u6807\u9898","\u5199\u5728\u8FD9\u91CC\u3002",o&&["<p></p>"]),"example.html":P(t,"\u4E00\u4E2A\u4F8B\u5B50","\u8FD9\u91CC\u5199\u8FD9\u4E2A\u5757\u5728\u4E00\u4EFD\u6587\u6863\u91CC\u7684\u6837\u5B50\u3002",o&&W),"writing.md":G(t,s,n),"style.css":_(t,o),...e?{"kit.js":D(t)}:{}}}var j="local";function q(t){let e=t.includes("/")?t:`${j}/${t}`;if(!B.test(e))throw new d(`Not a component's id: ${t} (<scope>/<name>, each in lowercase letters, digits and hyphens; a <name> alone is ${j}/<name>).`);let o=e.split("/").find(s=>R.has(s));if(o)throw new d(`Not a component's id: ${t} (Windows keeps ${o} for a device).`);return e}var V=(t,e)=>v.join(T(t).components,...e.split("/")),H=({name:t,file:e})=>`${w(e)} is one level too shallow, and no catalog reads it: a package is components/<scope>/<name>/, so move it to components/${j}/${t}/`;function Y(t,e){let o=F(t).find(({name:s})=>s===e.split("/")[1]);return o?H(o):`No component ${e} in ${w(T(t).components)}: gallery component list says which there are.`}function X(t,e,{script:o,flow:s}){let n=V(t,e);if(y.existsSync(n)||$(t).problems.has(e)){let i=!y.existsSync(v.join(n,U));console.error(i?`A folder is there with no component.json: ${w(n)}: move it, or give this component another name.`:`Component already exists: ${w(n)}: gallery component show ${e} says what it is; give a new one another name.`),process.exit(1)}let a=I(e,{script:o,flow:s});try{y.mkdirSync(n,{recursive:!0});for(let[i,c]of Object.entries(a).reverse())y.writeFileSync(v.join(n,i),c)}catch(i){if(!i.code)throw i;console.error(`Cannot write ${w(n)} (${i.code}).`),process.exit(1)}console.log(`Created ${w(n)}: ${Object.keys(a).join(", ")}`),console.log(`Next: say in component.json what it is (its name, description and parts), write template.html, what "/" puts in a document, and example.html, an instance as a writer would fill it, then writing.md and style.css${o?" and kit.js":""} (references/building-components.md has every field and the rules${s?", and Slots what its slot body holds":""}), and run gallery component check ${e}, which passes as it stands now.`)}var u=({zh:t,en:e})=>t===e?t:`${t} / ${e}`;function z(t){if(C(t))return null;let e=A(t);return e?b("en",e):"it has no template.html"}var J={disabled:"disabled: its instances show as they stand, no script and no style",hidden:"hidden: the menus do not offer it, and the instances there go on running"};function Q(t){let e=$(t),o=x(e),s=o.filter(({reason:r})=>r),n=o.filter(({reason:r})=>!r),a=n.filter(({state:r})=>r==="normal"),i=F(t),c=K(e.settings.hidden),p=()=>{c.length&&console.log(`Hidden by the user, not to write unless asked for: ${c.join(", ")}`)};if(console.log(`\u5DE5\u4F5C\u533A\uFF1A${w(t)}`),n.length+s.length+i.length===0){console.log("No component packages yet. A document is written with Gallery's blocks and whole blocks; gallery component new <id> starts a package when the user wants a block to use again."),p();return}console.log(a.length?`${a.length} component${a.length===1?"":"s"} to write with (gallery component show <id> says how):`:"No component to write with now.");for(let{id:r,name:l,version:m,description:f}of a){console.log(`${r} ${u(l)}`),console.log(` \u7248\u672C\uFF1A${m}\uFF08available\uFF09`),console.log(` \u8BF4\u660E\uFF1A${u(f)}`);let E=z(e.packages.get(r));E&&console.log(` \u6A21\u677F\uFF1Athe menus cannot insert it, and a document can still write it: ${E}`)}let h=n.filter(({state:r})=>r!=="normal");h.length+s.length+i.length>0&&console.log("Not to write with now:");for(let{id:r,name:l,version:m,state:f}of h)console.log(`${r} ${u(l)} ${m} ${J[f]}`);for(let{id:r,reason:l,version:m}of s)console.log(`${r}${m?` ${m}`:""} does not load: ${l.en}`);for(let r of i)console.log(H(r));p()}var Z=(t,{at:e,edit:o,optional:s,min:n,max:a})=>{let i=[s?"optional":"",n!==void 0?`at least ${n}`:"",a!==void 0?`at most ${a}`:""].filter(Boolean),c=o==="flow"?`${L}="${t}"`:e;return` ${t} ${c} ${o==="flow"?"flow (blocks of the document: write any block in it)":o}${i.length?` (${i.join(", ")})`:""}`};function tt(t,e){let o=$(t),s=o.problems.get(e),n=o.packages.get(e)??(s?.off?s:void 0);if(!n){let h=s?.problem;console.error(h?`${e} does not load: ${b("en",h)}`:Y(t,e)),process.exit(1)}let{state:a}=x(o).find(h=>h.id===e);console.log(`${e} ${u(n.name)}`),console.log(` \u7248\u672C\uFF1A${n.version}\uFF08${a==="normal"?"available":a}\uFF09`),console.log(` \u8BF4\u660E\uFF1A${u(n.description)}`),console.log(` ${w(n.folder)}`);let i=Object.entries(n.parts);console.log(i.length?"Parts (edit text: the user types there; flow: blocks of the document; none, or data: the component's):":"No parts.");for(let[h,r]of i)console.log(Z(h,r));let c=S(n,"writing.md")?.trimEnd();console.log(c?`How to write it (writing.md):
58
+ ${c}`:"How to write it: the package has no writing.md.");let p=S(n,"example.html")?.trimEnd();console.log(p?`The example (example.html):
59
+ ${p}`:"The example: the package has no example.html."),console.log("In a document: write the element as the example does, straight in the page or a section, with no data-block-id, which the export gives it.")}var g={new:(t,e,o)=>X(t,e,o),list:Q,show:tt,check:async(t,e)=>(await import("./chunk-R7BNENLY.mjs")).checkCommand(t,e),try:async(t,e)=>(await import("./chunk-FUKQNOQS.mjs")).tryCommand(t,e)},et=["--press","--drag","--to","--key"];function ot(t){let e=t.indexOf("--"),o=(e===-1?t:t.slice(0,e)).findIndex(a=>a==="--key"||a.startsWith("--key="));if(o===-1)return{argv:t,key:null};let s=o+(t[o].includes("=")?1:2),n=t[s];if(n===void 0||s===e||k(n))throw new d("--key takes a selector and a key: --key <selector> <key> (Enter, Space, ArrowRight, a letter, Shift+Tab).");return{argv:t.filter((a,i)=>i!==s),key:n}}async function gt(t,{workspace:e}){try{return await nt(t,e)}catch(o){throw o instanceof d&&t.find(s=>!k(s))==="try"&&(o.synopsis=O),o}}async function nt(t,e){let{argv:o,key:s}=ot(t),{positional:n,options:a,values:i}=N({options:["--script","--flow","--keep"],values:et,argv:o}),[c,p,...h]=n,r=Object.keys(g).join(", ");if(!c)throw new d(`Say what to do: ${r}.`);if(!Object.hasOwn(g,c))throw new d(`No such component command: ${c} (${r}).`);let l=g[c];for(let f of["--script","--flow"])if(a.has(f)&&l!==g.new)throw new d(`${f} goes with new, not ${c}.`);let m=[...i.keys(),...a.has("--keep")?["--keep"]:[]];if(l===g.try)return l(e,{named:n.slice(1),values:i,key:s,keep:a.has("--keep")});if(m.length)throw new d(`${m[0]} goes with try, not ${c}.`);if(l===g.list){if(p!==void 0)throw new d(`gallery component ${c} takes nothing else.`);return l(e)}if(p===void 0||h.length>0)throw new d(`gallery component ${c} takes one id.`);return l(e,q(p),{script:a.has("--script"),flow:a.has("--flow")})}export{q as a,V as b,H as c,Y as d,ot as e,gt as f};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-742D2WWJ.mjs";import"./chunk-5L7RYZCL.mjs";export{a as Browser,b as BrowserPlatform,c as BrowserTag,o as CDP_WEBSOCKET_ENDPOINT_REGEX,y as CLI,k as Cache,d as ChromeReleaseChannel,s as DefaultProvider,j as InstalledBrowser,q as Process,r as TimeoutError,p as WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX,z as buildArchiveFilename,w as canDownload,l as computeExecutablePath,m as computeSystemExecutablePath,f as createProfile,i as detectBrowserPlatform,x as getDownloadUrl,v as getInstalledBrowsers,h as getVersionComparator,t as install,n as launch,e as resolveBuildId,g as resolveDefaultUserDataDir,u as uninstall};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
2
+ import{a as f,b as g,c as h,d as $,e as v,f as y,g as r,h as x}from"./chunk-S6O4UHLC.mjs";import{b as c,f as p}from"./chunk-NSKUTQ5J.mjs";import"./chunk-5L7RYZCL.mjs";import{descendantsIn as A}from"../browser/shared/outline.mjs";async function N(L){let{positional:u,options:I,values:T}=p({options:["--top","--first"],values:["--under","--after"],argv:L});if(u.length!==1)throw new c("Name the document to move, one.");let e=x(T,I);if(e.under===void 0&&!e.top&&e.after===void 0&&!e.first)throw new c("Say where it goes: --under <document> or --top, and --after <document> or --first.");let s=await f(),a=async(b,k)=>{let d=await $(b,k,s);return d.refused&&(console.error(d.refused),process.exit(1)),d.slug},t=await a(u[0],"the document to move"),l=e.under!==void 0?await a(e.under,"--under"):e.top?"":void 0,m=e.after!==void 0?await a(e.after,"--after"):null,o=await y(t,{parent:l,after:m,first:e.first});o.ok||(console.error(v(s,t,o.reason,{parent:l,after:m,message:o.message})),process.exit(1));let n=await f(),i=A(n.children,t).length,w=`${g(n,t)}${i?` with the ${i} document${i===1?"":"s"} under it`:""}`;o.moved?console.log(`Moved ${w}: now ${r(n,o)}; it was ${r(s,o.from)}.`):console.log(`${w} is there already: ${r(n,o)}.`),console.log(h(n,t))}export{N as run};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
2
+ import{d as e}from"./chunk-742D2WWJ.mjs";function a(r){switch(r){case"chrome":return e.STABLE;case"chrome-dev":return e.DEV;case"chrome-beta":return e.BETA;case"chrome-canary":return e.CANARY}}export{a};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
2
+ import{a as u,d as T,e as h,f as j,g as D,h as S}from"./chunk-S6O4UHLC.mjs";import{a as p,b as C}from"./chunk-TX6JH7TR.mjs";import{a as E,b as I,c as O,i as b}from"./chunk-5ZKJ3H4P.mjs";import{b as v,f as k,g as L}from"./chunk-NSKUTQ5J.mjs";import{b as N}from"./chunk-UALRNVSE.mjs";import{existsSync as R}from"node:fs";import a from"node:path";import{reportsDirectory as w}from"../browser/shared/paths.mjs";import{keptName as U,layoutOf as M,listTrash as X}from"../browser/shared/workspace.mjs";import{parentIn as _}from"../browser/shared/outline.mjs";var z="\u65B0\u6587\u6863";async function q(o,r=w){return U(o)?`"${o}" is a name the workspace keeps for itself: choose another slug.`:R(a.join(M(r).pages,o))?`"${o}" is the \u5199\u4F5C\u504F\u597D page's slug: choose another slug.`:R(a.join(r,o))?`Document already exists: ${p(a.join(r,o))}`:(await X(r)).some(s=>s.slug===o)?`"${o}" is a document's in the trash: choose another slug.`:null}async function te(o){let{positional:r,options:s,values:A}=k({options:["--no-preview","--no-browser","--first"],values:["--under","--after"],argv:o}),[t,g,y=z]=r;if(r.length<2||r.length>3||!t||!g?.trim()||!y.trim())throw new v("Name the slug and the title (then a description, if you choose one), each quoted when it has spaces.");L(t);let n=S(A,s,{top:!1}),$=await q(t);$&&(console.error($),process.exit(1));let F=n.under!==void 0||n.after!==void 0||n.first,c=null;if(F){let e=await u(),i=async(H,P)=>{let m=await T(H,P,e);return m.refused&&(console.error(`${m.refused} Nothing made.`),process.exit(1)),m.slug},l=n.under!==void 0?await i(n.under,"--under"):void 0,f=n.after!==void 0?await i(n.after,"--after"):null;f!==null&&l!==void 0&&_(e.children,f)!==l&&(console.error(`${h(e,t,"level",{parent:l,after:f})} Nothing made.`),process.exit(1)),c={parent:l,after:f,first:n.first}}try{await N(t,g,y)}catch(e){if(e.code!=="EEXIST")throw e;console.error(await q(t)??`Document already exists: ${p(a.join(w,t))}`),process.exit(1)}if(await import("./chunk-CEH4MRCC.mjs").then(({noteNew:e})=>e(t)),console.log(`Created ${p(a.join(w,t,"doc.html"))} and doc.json`),c){let e=await j(t,c),i=await u();e.ok?console.log(`Placed it ${D(i,e)}.`):(console.log(`Not placed (${h(i,t,e.reason,{...c,message:e.message})}): it is at the top level, last; gallery move ${t} puts it where it goes.`),process.exitCode=1)}for(let e of await C())console.log(e);let d=await b(t,{skipped:O(s),command:`gallery new ${t}`});console.log(E(d,"replace the starter section with the document's skeleton (each section's heading) as soon as you can outline it, then write it a section at a time, as ordinary HTML, so that the user watches it grow (gallery check fails while the starter section remains).")),console.log(`Hand in: gallery export ${t}, then gallery qa ${t}`);let x=await I(d,s);x&&console.log(x);for(let e of d)console.log(e)}export{z as a,q as b,te as c};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
2
+ import{a as E,b as F,c as H}from"./chunk-QJIR2BLP.mjs";import{b as L,c as O,d as b,e as D}from"./chunk-W4VKN3GF.mjs";import{existsSync as K}from"node:fs";var Q=120;function R(n,h){let r=({packages:s,problems:l})=>new Map([...s,...l].map(([e,{stamp:m}])=>[e,m])),[o,p]=[r(n),r(h)];return[...new Set([...o.keys(),...p.keys()])].filter(s=>o.get(s)!==p.get(s)).sort()}function v({root:n,tell:h,delay:r=Q,quiet:o=H,hold:p=E,limit:s=F,now:l=Date.now}){let e=null,m=0,f=null,c=new Map;b(n);let I=i=>{e&&m<=l()+i||(clearTimeout(e),m=l()+i,e=setTimeout(y,i),e.unref?.())};function y({settled:i=!1}={}){e=null;let u=b(n),a=O(n,u.settings),M=l();a.stamp!==f?.stamp&&(f={stamp:a.stamp,at:M});let T=M-f.at;if(T<o&&!i)return I(o-T);let d=new Map(a.packages),g=new Map(a.problems),k=1/0;for(let[t,S]of u.packages){if(!(!a.settings.disabled.includes(t)&&(g.has(t)||!d.has(t)&&K(S.folder)))){c.delete(t);continue}c.has(t)||c.set(t,f.at);let x=Math.min(p-T,s-(M-c.get(t)));if(x<=0){c.delete(t);continue}d.set(t,S),g.delete(t),k=Math.min(k,x)}let{settings:w}=a,C=L({packages:d,problems:g,settings:w});if(C!==u.stamp){let t={packages:d,problems:g,settings:w,stamp:C};D(n,t),h(t,R(u,t))}k!==1/0&&I(k)}return{changed:()=>I(r),taken(){clearTimeout(e),y({settled:!0})},close(){clearTimeout(e),e=null}}}export{Q as a,v as b};
@@ -0,0 +1,5 @@
1
+ import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
2
+ import $ from"node:fs";import{fileURLToPath as y}from"node:url";import{namedPlace as h}from"../browser/shared/page-address.mjs";import{pageLinks as w}from"../browser/shared/page-links.mjs";import{reportsDirectory as b}from"../browser/shared/paths.mjs";import{listReportSlugs as g,slugPattern as x}from"../browser/shared/reports.mjs";import{RESERVED as v,isSlugName as N,listTrash as O}from"../browser/shared/workspace.mjs";var d=e=>/^--.|^-[A-Za-z]/.test(e),i=class extends Error{constructor(n){super(n),this.name="UsageError"}};function A(e){let n=$.readFileSync(y(e),"utf8").split(/\r?\n/),t=n.findIndex(s=>!s.startsWith("//"));return n.slice(0,t===-1?n.length:t).map(s=>s.replace(/^\/\/ ?/,"")).join(`
3
+ `)}var E=e=>/^Usage: (gallery \S+|npm run \S+|node \S+)/.exec(e)?.[1]??"this command",P=e=>e.split(`
4
+ `)[0],R=(e,n,t=P(e))=>{let s=E(e);return`${n}
5
+ ${t} (${s}${s.startsWith("npm run")?" --":""} --help says more)`},T=e=>{let n=e.indexOf("--");return(n===-1?e:e.slice(0,n)).some(t=>t==="--help"||t==="-h")};function k({options:e=[],values:n=[],argv:t=process.argv.slice(2)}={}){let s=t.indexOf("--"),[o,a]=s===-1?[t,[]]:[t.slice(0,s),t.slice(s+1)],u=[],l=new Set,p=new Map;for(let c=0;c<o.length;c++){let r=o[c],[f,S]=r.startsWith("--")&&r.includes("=")?[r.slice(0,r.indexOf("=")),r.slice(r.indexOf("=")+1)]:[r,void 0];if(!d(r))u.push(r);else if(n.includes(f)){let m=S??(c+1<o.length&&!d(o[c+1])?o[++c]:void 0);if(!m)throw new i(`${f} takes a value`);p.set(f,m)}else if(e.includes(r))l.add(r);else throw new i(`Unknown option: ${r}`)}return{positional:[...u,...a],options:l,values:p}}function U(e){if(!x.test(e))throw new i(`Not a document's slug: ${e} (lowercase kebab-case).`);if(v.has(e))throw new i(`Not a document's slug: ${e} (a name the workspace keeps for itself).`);return e}async function L(e){let n=await O(b),t=h(e,w(n));return t&&`${e} is a document in the trash ("${n.find(({slug:s})=>s===t.slug).title}"): it has to be restored in the workbench first.`}async function W(e){let n=(await g()).filter(N),t=h(e,w(n.map(o=>({slug:o}))));if(t)return t;let s=await L(e);if(s)throw new i(s);if(!x.test(e))throw new i(`Not a document's slug, link or address: ${e} (gallery list shows them).`);return{slug:U(e),block:null}}async function D({options:e=[],values:n=[],argv:t,noneIsAll:s=!1}={}){let{positional:o,options:a,values:u}=k({options:["--all",...e],values:n,argv:t}),l=a.has("--all");if(l&&o.length>0)throw new i("Name documents or pass --all, not both.");if(!l&&o.length===0&&!s)throw new i("Name a document (or pass --all).");let p=await Promise.all(o.map(W));return{slugs:l||o.length===0?await g():[...new Set(p.map(({slug:c})=>c))],options:a,values:u}}async function Z(e,{documents:n=!1,...t}={}){let s=A(e),o=t.argv??process.argv.slice(2);T(o)&&(console.log(s),process.exit(0));try{return n?await D({...t,argv:o}):k({...t,argv:o})}catch(a){if(!(a instanceof i))throw a;console.error(R(s,a.message)),process.exit(2)}}export{d as a,i as b,A as c,R as d,T as e,k as f,U as g,L as h,W as i,D as j,Z as k};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
2
+ import{a,b,c,d,e,f,g,h,i,j}from"./chunk-CY2FNNAB.mjs";import"./chunk-UMHUSOPJ.mjs";import"./chunk-L3QKH4OK.mjs";import"./chunk-W4VKN3GF.mjs";import"./chunk-A55HN5OK.mjs";import"./chunk-5L7RYZCL.mjs";export{g as changeLines,c as handedInSource,f as headerChanged,e as inStep,a as naturalize,d as pendingBlockIds,h as readOnlyTexts,j as scriptKept,b as shownSource,i as writingNotes};
@@ -0,0 +1,3 @@
1
+ import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
2
+ import W from"node:http";import ot from"node:https";import it from"node:tls";import R from"node:zlib";import{Readable as st}from"node:stream";import{execFile as at}from"node:child_process";import{promisify as ct}from"node:util";var q=ct(at),lt=/^(localhost|127\.|10\.|192\.168\.|172\.(1[6-9]|2\d|3[01])\.|\[?::1\]?$|0\.0\.0\.0)/i;function ut(t,e){let r=t.toLowerCase();for(let o of e){let n=o.trim().toLowerCase();if(!n)continue;if(n==="*")return!0;if(n==="<local>"){if(!r.includes("."))return!0;continue}if(n.includes("*")){if(new RegExp(`^${n.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*")}$`).test(r))return!0;continue}let i=n.replace(/^\./,"").replace(/:\d+$/,"");if(r===i||r.endsWith(`.${i}`))return!0}return!1}var D=t=>/^[a-z]+:\/\//i.test(t)?t:`http://${t}`;function ft(t=process.env){let e=t.HTTPS_PROXY||t.https_proxy||t.HTTP_PROXY||t.http_proxy||t.ALL_PROXY||t.all_proxy;return e?{url:D(e),bypass:(t.NO_PROXY||t.no_proxy||"").split(",")}:null}async function pt(){let{stdout:t}=await q("reg",["query","HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"],{windowsHide:!0,timeout:3e3}),e=n=>new RegExp(`^\\s*${n}\\s+REG_\\w+\\s+(.*)$`,"mi").exec(t)?.[1]?.trim();if(Number.parseInt(e("ProxyEnable")||"0",16)!==1)return null;let r=e("ProxyServer");if(!r)return null;let o=r;if(r.includes("=")){let n=Object.fromEntries(r.split(";").map(i=>i.split("=").map(s=>s.trim())));if(o=n.https||n.http,!o)return null}return{url:D(o),bypass:(e("ProxyOverride")||"").split(";")}}async function mt(){let{stdout:t}=await q("scutil",["--proxy"],{timeout:3e3}),e=o=>new RegExp(`\\b${o}\\s*:\\s*(\\S+)`).exec(t)?.[1];if(e("HTTPSEnable")!=="1"||!e("HTTPSProxy"))return null;let r=[...t.matchAll(/^\s*\d+\s*:\s*(\S+)\s*$/gm)].map(o=>o[1]);return{url:`http://${e("HTTPSProxy")}:${e("HTTPSPort")||80}`,bypass:r}}var I=null,H=0;async function dt(){let t=ft();if(t)return t;if(I!==null&&Date.now()-H<3e4)return I||null;let e=null;try{process.platform==="win32"?e=await pt():process.platform==="darwin"&&(e=await mt())}catch{e=null}return I=e||!1,H=Date.now(),e}async function ht(t){let e;try{e=new URL(t).hostname}catch{return null}if(lt.test(e))return null;let r=await dt();return r&&!ut(e,r.bypass)&&/^http:/i.test(r.url)?r.url:null}var M=t=>t.username?{"proxy-authorization":`Basic ${Buffer.from(`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`).toString("base64")}`}:{};function gt(t,e,r,o){return new Promise((n,i)=>{let s=W.request({host:t.hostname,port:t.port||80,method:"CONNECT",path:`${e}:${r}`,headers:{host:`${e}:${r}`,...M(t)},signal:o});s.once("connect",(l,m)=>{l.statusCode===200?n(m):(m.destroy(),i(new Error(`the proxy answered ${l.statusCode}`)))}),s.once("error",i),s.end()})}function yt(t,{method:e,headers:r,signal:o},n){let i=new URL(t),s=new URL(n),l={"accept-encoding":"gzip, deflate, br",...r};return new Promise((m,u)=>{let d=g=>{g.once("response",m),g.once("error",u),g.end()};if(i.protocol==="http:"){d(W.request({host:s.hostname,port:s.port||80,method:e,path:i.href,headers:{...l,host:i.host,...M(s)},signal:o}));return}gt(s,i.hostname,i.port||443,o).then(g=>{d(ot.request(i,{method:e,headers:{...l,host:i.host},defaultPort:443,signal:o,createConnection:()=>it.connect({socket:g,servername:i.hostname,ALPNProtocols:["http/1.1"]})}))},u)})}function wt(t,e){let r=new Headers;for(let[m,u]of Object.entries(t.headers))r.set(m,Array.isArray(u)?u.join(", "):String(u));let o=(t.headers["content-encoding"]||"").toLowerCase(),n={gzip:R.createGunzip,"x-gzip":R.createGunzip,deflate:R.createInflate,br:R.createBrotliDecompress}[o],i=n?t.pipe(n()):t;n&&(t.on("error",m=>i.destroy(m)),r.delete("content-encoding"),r.delete("content-length"));let s=[101,204,205,304].includes(t.statusCode);s&&t.resume();let l=new Response(s?null:st.toWeb(i),{status:t.statusCode,statusText:t.statusMessage,headers:r});return Object.defineProperty(l,"url",{value:e}),l}async function bt(t,{method:e="GET",headers:r={},signal:o}={},n){for(let i=0;;i++){let s=await yt(t,{method:e,headers:r,signal:o},n),l=s.headers.location;if([301,302,303,307,308].includes(s.statusCode)&&l&&i<10){s.resume(),t=new URL(l,t).href,s.statusCode===303&&(e="GET");continue}return wt(s,t)}}async function xt(t,e={}){let r=await ht(t);if(r)try{return await bt(t,e,r)}catch(o){if(e.signal?.aborted)throw o}return fetch(t,e)}var $t="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0 Safari/537.36";async function L(t,{timeout:e=1e4,accept:r="*/*",headers:o={},unreachable:n="\u6253\u4E0D\u5F00\u8FD9\u4E2A\u7F51\u9875",protocols:i=["http:","https:"]}={}){let s;try{s=new URL(t)}catch{throw Object.assign(new Error("\u4E0D\u662F\u7F51\u5740"),{reason:"url"})}if(!i.includes(s.protocol))throw Object.assign(new Error("\u53EA\u652F\u6301 http(s) \u7F51\u5740"),{reason:"url"});return xt(s,{redirect:"follow",signal:AbortSignal.timeout(e),headers:{"user-agent":$t,accept:r,...o}}).catch(()=>{throw Object.assign(new Error(n),{reason:"download"})})}async function _(t,e){let r=t.body.getReader(),o=[],n=0;for(;;){let{done:i,value:s}=await r.read();if(i)break;if(o.push(Buffer.from(s)),n+=s.length,n>=e){r.cancel().catch(()=>{});break}}return Buffer.concat(o)}async function j(t,e){let r=await _(t,e+1);return r.length<=e?r:null}import{createHash as Tt,randomUUID as Rt}from"node:crypto";import b from"node:fs/promises";import P from"node:path";import{refusal as jt,said as Q,saying as vt}from"../browser/shared/i18n/index.mjs";import{extensionOf as Ft,imageExtension as It,imageFile as Y,mediaTypeOf as _t,UPLOAD_LIMITS as S}from"../browser/shared/media.mjs";import{slugPattern as z}from"../browser/shared/reports.mjs";import{documentDirectory as J,documentFiles as zt,layoutOf as At}from"../browser/shared/workspace.mjs";import{refusal as Pt,said as St}from"../browser/shared/i18n/index.mjs";var Lt={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "},G=t=>t.replace(/&(#x[0-9a-f]+|#\d+|\w+);/gi,(e,r)=>{if(r[0]==="#"){let o=r[1]==="x"||r[1]==="X"?parseInt(r.slice(2),16):Number(r.slice(1));return Number.isFinite(o)&&o>0&&o<=1114111?String.fromCodePoint(o):e}return Lt[r.toLowerCase()]??e}),B=t=>G(String(t??"")).replace(/\s+/g," ").trim();function Ot(t){let e={};for(let r of t.matchAll(/([\w:-]+)\s*=\s*("([^"]*)"|'([^']*)'|([^\s>]+))/g))e[r[1].toLowerCase()]=r[3]??r[4]??r[5]??"";return e}function Et(t,e){let r=/charset=([\w-]+)/i.exec(e??"")?.[1];r||(r=/<meta[^>]+charset=["']?([\w-]+)/i.exec(t.subarray(0,4096).toString("latin1"))?.[1]);try{return new TextDecoder(r||"utf-8").decode(t)}catch{return new TextDecoder("utf-8").decode(t)}}function Ct(t,e){let r=t.search(/<\/head>/i),o=r>0?t.slice(0,r):t.slice(0,3e5),n={},i=[];for(let[u]of o.matchAll(/<(meta|link)\b[^>]*>/gi)){let d=Ot(u);if(/^<meta/i.test(u)){let g=(d.property||d.name||d.itemprop||"").toLowerCase();g&&d.content!==void 0&&!(g in n)&&(n[g]=d.content)}else d.rel&&d.href&&/(^|\s)(icon|shortcut icon|apple-touch-icon)(\s|$)/i.test(d.rel)&&i.push({rel:d.rel.toLowerCase(),href:d.href})}let s=u=>{try{return u?new URL(G(u),e).href:null}catch{return null}},l=/<title[^>]*>([\s\S]*?)<\/title>/i.exec(o)?.[1],m=i.find(u=>/(^|\s)icon(\s|$)/.test(u.rel))??i.find(u=>u.rel.includes("icon"));return{title:B(n["og:title"]||n["twitter:title"]||l||"").slice(0,300),description:B(n["og:description"]||n["twitter:description"]||n.description||"").slice(0,600),icon:s(m?.href)||s("/favicon.ico"),cover:s(n["og:image"]||n["og:image:url"]||n["og:image:secure_url"]||n["twitter:image"]||n["twitter:image:src"])}}async function kt(t){if(!t)return null;try{let e=await L(t,{timeout:8e3,accept:"image/*,*/*;q=0.5",protocols:["http:","https:","data:"]}),r=(e.headers.get("content-type")??"").split(";")[0].trim();if(!e.ok||!/^image\//.test(r))return null;let o=await j(e,5*1024*1024);return o?.length?o:null}catch{return null}}async function X(t){try{let e=await L(t,{timeout:8e3,accept:"text/html,*/*;q=0.8"});e.body?.cancel().catch(()=>{});let r=(e.headers.get("x-frame-options")??"").toLowerCase(),o=/frame-ancestors([^;]*)/i.exec(e.headers.get("content-security-policy")??"")?.[1]?.trim().toLowerCase();return/deny|sameorigin/.test(r)?{frameable:!1,reason:"x-frame-options"}:o!==void 0&&!/(^|\s)\*(\s|$)/.test(o)?{frameable:!1,reason:"frame-ancestors"}:{frameable:!0}}catch(e){return e.reason==="url"?{frameable:!1,reason:"url"}:{frameable:!0,reason:"unknown"}}}async function K(t,e,{icon:r=!0,cover:o=!0}={}){let n=await L(t,{accept:"text/html,application/xhtml+xml;q=0.9,*/*;q=0.8",headers:{"accept-language":"zh-CN,zh;q=0.9,en;q=0.8"}}),i=n.url||new URL(t).href,s=n.headers.get("content-type")??"";if(!n.ok)throw Pt(St("\u7F51\u9875\u8FD4\u56DE {0}",n.status),{reason:"download"});if(!/html|xml/i.test(s))return n.body?.cancel().catch(()=>{}),{url:i,title:"",description:"",icon:null,cover:null};let l=Ct(Et(await _(n,1.5*1024*1024),s),i),m=async(g,F)=>{let C=await kt(g);try{return C?await e(C,F):null}catch{return null}},[u,d]=await Promise.all([r?m(l.icon,"bookmark-icon"):null,o?m(l.cover,"bookmark-cover"):null]);return{url:i,title:l.title,description:l.description,icon:u,cover:d}}var Z=t=>Ft(String(t??"").replace(/[?#].*$/,"")),Nt=t=>{let e=String(t??"").replace(/[?#].*$/,"");e=e.slice(e.lastIndexOf("/")+1);try{e=decodeURIComponent(e)}catch{}return e.replace(/[\u0000-\u001f<>:"/\\|?*]/g,"").trim().slice(0,120)||"file"};function Ut(t){let e=t.subarray(0,16);return e[0]===137&&e.toString("latin1",1,4)==="PNG"?"image/png":e[0]===0&&e[1]===0&&e[2]===1&&e[3]===0?"image/x-icon":e[0]===255&&e[1]===216?"image/jpeg":e.toString("latin1",0,4)==="GIF8"?"image/gif":e.toString("latin1",0,4)==="RIFF"&&e.toString("latin1",8,12)==="WEBP"?"image/webp":e.toString("latin1",4,12)==="ftypavif"?"image/avif":/^\s*(<\?xml[^>]*>\s*)?(<!--[\s\S]*?-->\s*)*<svg\b/i.test(t.subarray(0,512).toString("utf8"))?"image/svg+xml":null}var E=(t,e)=>jt(e,{reason:t}),A=(t,e)=>{let r=Ut(t);if(!r)throw E("type","\u4EC5\u652F\u6301\u56FE\u7247");return It(r)},Ht=(t,e)=>Z(e),Wt=(t,e)=>{let r=Z(e);if(!["html","htm","pdf"].includes(r)||r==="pdf"&&t.subarray(0,5).toString("latin1")!=="%PDF-")throw E("type","\u53EA\u80FD\u5D4C\u5165 HTML \u6216 PDF \u6587\u4EF6");return r},v={big:t=>Q("\u56FE\u7247\u592A\u5927\uFF08\u6700\u591A {0} MB\uFF09",t),unreachable:"\u4E0B\u8F7D\u4E0D\u4E86\u8FD9\u5F20\u56FE\u7247"},V={big:t=>Q("\u6587\u4EF6\u592A\u5927\uFF08\u6700\u591A {0} MB\uFF09",t),unreachable:"\u4E0B\u8F7D\u4E0D\u4E86\u8FD9\u4E2A\u6587\u4EF6"},N={icon:{limit:S.icon,words:v,extension:A},image:{limit:S.image,words:v,extension:A},file:{limit:S.file,words:V,extension:Ht,named:!0},embed:{limit:S.embed,words:V,extension:Wt,named:!0}};function le(t,e,r,o){let n=N[t].extension(r,o);return`${t}-${e.slice(0,12)}${n?`.${n}`:""}`}function ue({reportsDirectory:t}){let e=At(t).emojiLibrary,r=async a=>{let c=J(a,t);return await b.stat(zt(c).html).catch(()=>null)?c:null},o=P.join(e,"library.json"),n=(a,c,f)=>[a,{ok:!1,reason:c,...vt(f)}];async function i(a,c,{stem:f,limit:p,words:y=v,extension:h=A,given:x}){let w=h(c,x);if(c.length>p)throw E("size",y.big(p/1024/1024));let O=`${f}-${Tt("sha256").update(c).digest("hex").slice(0,12)}${w?`.${w}`:""}`;await b.mkdir(a,{recursive:!0});let k=P.join(a,O);return await b.stat(k).catch(()=>null)||await b.writeFile(k,c),O}let s=(a,c,f,p=S.icon)=>i(a,c,{stem:f,limit:p});async function l(a,c,f=v){let p=await L(a,{unreachable:f.unreachable});if(!p.ok)throw E("download",f.unreachable);let y=await j(p,c);if(!y)throw E("size",f.big(c/1024/1024));return y}async function m(){try{let a=JSON.parse(await b.readFile(o,"utf8"));return Array.isArray(a)?a:[]}catch{return[]}}let u=a=>({id:a.id,name:a.name,url:`/__gallery/edit/emoji-library/${a.file}`,created_time:a.created,alive:!0});async function d(a){let{slug:c,data:f,url:p,library:y}=a??{},h=Object.hasOwn(N,a?.kind)?a.kind:"icon";if(typeof c!="string"||!z.test(c))return n(400,"body");let x=await r(c);if(!x)return n(404,"missing");let{limit:w,words:O,extension:k,named:rt}=N[h];try{let $,T;if(typeof f=="string")$=Buffer.from(f,"base64"),T=a.name;else if(typeof p=="string")$=await l(p,w,O),T=p;else if(typeof y=="string"){let U=(await m()).find(nt=>nt.id===y);if(!U)return n(404,"library","\u8FD9\u4E2A\u81EA\u5B9A\u4E49\u8868\u60C5\u5DF2\u4E0D\u5728\u8868\u60C5\u5E93\u91CC");$=await b.readFile(P.join(e,U.file))}else return n(400,"body");return[200,{ok:!0,path:`assets/${await i(P.join(x,"assets"),$,{stem:h,limit:w,words:O,extension:k,given:T})}`,...rt?{name:Nt(T),size:$.length}:{}}]}catch($){return n(422,$.reason??"write",$)}}async function g(a){let{slug:c,url:f,parts:p="all"}=a??{};if(typeof c!="string"||!z.test(c)||typeof f!="string"||!["all","icon","title"].includes(p))return n(400,"body");let y=await r(c);if(!y)return n(404,"missing");try{return[200,{ok:!0,...await K(f,async(x,w)=>`assets/${await s(P.join(y,"assets"),x,w,S.image)}`,{icon:p!=="title",cover:p==="all"})}]}catch(h){return n(422,h.reason??"download",h)}}async function F(a){return typeof a?.url!="string"?n(400,"body"):[200,{ok:!0,...await X(a.url)}]}async function C(a){let{slug:c,name:f,url:p}=a??{};if(typeof f!="string"||!/^[\p{Ll}\p{Lo}\d_-]{1,49}$/u.test(f)||typeof p!="string")return n(400,"body");let y=await m();if(y.some(h=>h.name===f))return n(409,"name","\u540D\u79F0\u5DF2\u88AB\u5360\u7528");try{let h;Y(p)&&typeof c=="string"&&z.test(c)?h=await b.readFile(P.join(J(c,t),p)):h=await l(p,S.icon);let x=await s(e,h,"emoji"),w={id:Rt(),name:f,file:x,created:Date.now()};return await b.writeFile(o,`${JSON.stringify([...y,w],null,2)}
3
+ `),[200,{ok:!0,entry:u(w)}]}catch(h){return n(422,h.reason??"write",h)}}let tt=async()=>[200,{ok:!0,list:(await m()).map(u)}];async function et(a){if(!Y(`assets/${a}`))return null;let c=await b.readFile(P.join(e,a)).catch(()=>null);return c&&{type:_t(a),body:c}}return{upload:d,unfurl:g,frameable:F,addEmoji:C,listEmojis:tt,readEmoji:et}}export{L as a,j as b,le as c,ue as d};
@@ -0,0 +1,15 @@
1
+ import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
2
+ import{a as Fe}from"./chunk-TX6JH7TR.mjs";import{a as _e,b as He,c as Be,d as We,e as qe,f as Ge}from"./chunk-DFUDV4LX.mjs";import{g as Ie}from"./chunk-E7LWZRXY.mjs";import{o as Re}from"./chunk-AUZGSZJH.mjs";import{a as me}from"./chunk-HYMEEXKN.mjs";import{b as Ce}from"./chunk-CY2FNNAB.mjs";import{l as Pe}from"./chunk-W4VKN3GF.mjs";import D from"node:fs/promises";import Ue from"node:os";import S from"node:path";import{pathToFileURL as Ye}from"node:url";import{instancesOf as ze}from"../browser/shared/components/index.mjs";import{FALLBACK as it,INSTANCE as ke,SLOT as rt,SLOT_PART as lt}from"../browser/shared/components/installed.mjs";import{layoutOf as ct,PACKAGE_MANIFEST as dt}from"../browser/shared/workspace.mjs";var ht="in a browser, under the export's policy",te="component-check",ne=[360,736,1024],ge=["light","dark"],pt=[1024,360],Ke=1e4,ut=6e4,ye=3e4,Xe=2e3,ft=3e3,wt=60,mt=2,gt=8,kt=ye/2,$t=/^(?:wasm-)?eval$/,yt=new Set(["TargetCloseError","ConnectionClosedError"]),$e=t=>String(t?.message??t).split(`
3
+ `)[0],bt=(t,a)=>`<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>${t}</title></head><body><main class="doc-page" data-doc-id="${t}">${a}
4
+ </main></body></html>
5
+ `,xt=({example:t,template:a})=>`<p>example.html</p>${t}
6
+ <hr><p>template.html</p>${a}`,Qe=(t,a)=>ze(me(t),a).map(({sourceCodeLocation:{startLine:i,startOffset:r,endOffset:n}})=>({line:i,markup:t.slice(r,n)}));async function vt(t,a){let i=S.join(a,"components",...t.id.split("/"));for(let r of[dt,"template.html",...t.files]){let n=Pe(t,r);if(!n)continue;let s=await D.readFile(n);await D.mkdir(S.dirname(S.join(i,r)),{recursive:!0}),await D.writeFile(S.join(i,r),r==="kit.js"?`${s}
7
+ //# sourceURL=kit.js
8
+ `:s)}}async function Tt(t,{example:a,template:i},r){await vt(t,r);let n=S.join(r,te);await D.mkdir(n);let s=`${a}
9
+ `,p=Ce(bt(te,xt({example:a,template:i}))).text;await D.writeFile(S.join(n,"doc.html"),p),await D.writeFile(S.join(n,"doc.json"),JSON.stringify({title:te,description:te,type:"component"}));let u=await(await Re({directory:r}))(te),l=S.join(r,"export.html");await D.writeFile(l,u);let w=s.split(`
10
+ `).length-1,k=Qe(p,t).map(({line:c})=>c>w?{file:"template.html",line:c-w}:{file:"example.html",line:c});return{html:u,file:l,places:k,source:p}}async function jt({match:t,instance:a,slotPart:i,slotName:r,fallback:n,parts:s,at:p,source:h,still:u,step:l,times:w,typed:k,typing:c}){let d=()=>[...document.querySelectorAll(t)].filter(e=>!e.parentElement.closest(a)),T=e=>new Promise(o=>setTimeout(o,e)),g=()=>new Promise(e=>{requestAnimationFrame(e),setTimeout(e,100)}),$=async e=>{await g(),await g();let o=e.outerHTML;for(let m=0,y=Date.now()+u;m<3;){if(Date.now()>y)return null;await T(l);let b=e.outerHTML;m=b===o?m+1:0,o=b}return o},f=e=>{let o=document.createElement("template");return o.innerHTML=e,o.content.firstElementChild},x=e=>`<${e.localName}${e.classList.length?` class="${e.getAttribute("class")}"`:""}>`,P=e=>e.nodeType===1?x(e):`the words "${e.data.trim().slice(0,40)}"`,q=e=>[...e.childNodes].filter(o=>o.nodeType===1||o.nodeType===3&&o.data.trim()),R=(e,o)=>["style","class"].includes(o)&&!e.getAttribute(o)?.trim()?null:e.getAttribute(o),V=(e,o)=>{for(let b of new Set([...e.getAttributeNames(),...o.getAttributeNames()]))if(R(e,b)!==R(o,b))return`${b} on ${x(o)}, ${JSON.stringify(R(e,b))} then ${JSON.stringify(R(o,b))}`;let[m,y]=[q(e),q(o)];for(let b=0;b<Math.max(m.length,y.length);b++){let[j,L]=[m[b],y[b]];if(!j||!L)return`${x(o)} ${j?`without ${P(j)}`:`with ${P(L)} more`}`;if(j.nodeType!==L.nodeType||j.localName!==L.localName||j.nodeType===3&&j.data.trim()!==L.data.trim())return`in ${x(o)}, ${P(j)} then ${P(L)}`;let I=j.nodeType===1?V(j,L):null;if(I)return I}return null},se=e=>{let o=new Map;for(let m of e)o.set(x(m),(o.get(x(m))??0)+1);return o},be=()=>[...document.querySelectorAll("*")].filter(e=>!e.closest(a)),xe=e=>[...e.at(-1).keys()].filter(o=>e.length>2&&e.every((m,y)=>y===0||(m.get(o)??0)>(e[y-1].get(o)??0))),ve=e=>e.parentElement?.closest(`${a}, ${i}`)??null,Te=e=>[...e.querySelectorAll(i)].filter(o=>ve(o)===e),H=e=>{let o=e.cloneNode(!0);return Te(o).forEach(m=>m.replaceChildren()),o},X=e=>Te(e).map(o=>{let m=[];for(let y=o.parentElement;y&&y!==e;y=y.parentElement)m.unshift(x(y));return{name:o.getAttribute(r),place:m.join(" > "),blocks:[...DocKit.dehydrate(o.cloneNode(!0)).children].map(y=>y.localName).join(" "),html:o.outerHTML}}),ie=(e,o,m,{markup:y=!0}={})=>e.flatMap(({name:b,place:j,blocks:L,html:I})=>{let N=o.find(F=>F.name===b),z=N?N.place!==j?`moved the slot ${b} (${N.place?`in ${N.place}`:"straight in the instance"}, where the file has it ${j?`in ${j}`:"straight in the instance"})`:N.blocks!==L?`changed the blocks the slot ${b} holds (${L||"none"}, then ${N.blocks||"none"})`:y&&N.html!==I?`changed what the slot ${b} holds`:null:`took the slot ${b} off the instance`;return z?[{kind:"written-in",part:b,how:`${z}, ${m}`}]:[]}),je=e=>o=>ve(o)===e,re=(e,o=()=>!0)=>Object.entries(s).filter(([,{edit:m}])=>o(m)).flatMap(([m,y])=>[...e.querySelectorAll(y.at)].filter(je(e)).map(b=>({name:m,node:b}))),Q=e=>re(e,o=>o==="text"),J=e=>Object.entries(s).filter(([,{edit:o}])=>o==="data").map(([o,m])=>({name:o,node:[...e.querySelectorAll(m.at)].find(je(e))})).filter(({node:o})=>o),C=[],G=d()[p];if(!G)return[{kind:"gone"}];if(G.hasAttribute(n))return[{kind:"fallback"}];let le=await $(G);if(le===null)return[{kind:"moving"}];let ae=f(h),Ee=X(G);C.push(...ie(X(ae),Ee,"as it mounts",{markup:!1}));let ce=Q(ae);Q(G).forEach(({name:e,node:o},m)=>{ce[m]&&ce[m].node.innerHTML!==o.innerHTML&&C.push({kind:"redrawn",part:e,how:`the file says ${JSON.stringify(ce[m].node.textContent.trim())}, the page ${JSON.stringify(o.textContent.trim())}`})});let de=DocKit.dehydrate(G.cloneNode(!0)),[Se,Ne]=[H(ae),H(de)],he=V(Se,Ne);if(he){let e=re(Ne),o=re(Se).find(({node:m},y)=>e[y]&&V(m,e[y].node))?.name;C.push({kind:"left",what:he,...o?{part:o}:{}})}let tt=J(de);for(let[e,{name:o,node:m}]of J(ae).entries())!he&&tt[e]?.node.innerHTML!==m.innerHTML&&C.push({kind:"data",part:o});let Y=[],pe=new MutationObserver(e=>Y.push(...e));pe.observe(document.documentElement,{subtree:!0,childList:!0,characterData:!0});let Ae=new Set,Oe=e=>{Y.push(...pe.takeRecords());for(let{name:o,node:m}of e)(!m.isConnected||Y.some(({target:y})=>m.contains(y)))&&Ae.add(o);Y.length=0},ue=[le],fe=[se(be())],Le=e=>{ue.push(e),fe.push(se(be())),C.push(...ie(Ee,X(v),"as it mounts again"))},v=de,we=Q(v);Y.length=0,G.replaceWith(v);let B=await $(v);if(Oe(we),B!==null){Le(B);for(let e=0;e<w&&B!==null;e++){let o=v.cloneNode(!0);we=Q(o),Y.length=0,v.replaceWith(o),v=o,B=await $(v),Oe(we),B!==null&&Le(B)}}pe.disconnect(),B===null&&C.push({kind:"moving"});for(let e of Ae)C.push({kind:"redrawn",part:e,how:"a mount changes it"});let Me=ue.map(e=>se(H(f(e)).querySelectorAll("*"))),De=xe(Me);for(let e of De)C.push({kind:"piles",what:e,counts:Me.map(o=>o.get(e)??0)});for(let e of xe(fe))C.push({kind:"piles",what:e,outside:!0,counts:fe.map(o=>o.get(e)??0)});if(!De.length){let e=ue.slice(1).map(o=>V(H(f(le)),H(f(o)))).find(Boolean);e&&C.push({kind:"changed",what:e})}let oe=B===null?[]:Q(v).filter(({node:e})=>e.textContent.trim()),nt=[...new Set([...new Map(oe.map(e=>[e.name,e])).values(),...oe])].slice(0,k),at=Date.now()+c;for(let{node:e}of nt){if(Date.now()>at)break;let o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT).nextNode(),m=o.data;o.data=`${m}\u2026`;let y=oe.map(({node:j})=>j.textContent);await $(v);let b=oe.find(({node:j},L)=>!j.isConnected||j.textContent!==y[L]);if(b){C.push({kind:"redrawn",part:b.name,how:"a change of its words does not stand"});break}o.data=m,await $(v)}return B!==null&&J(v).length>0&&C.push(...await ot()),C;async function ot(){let e=[],o=null,m=!1,y="as it hears that it can write (the editable signal)",b=[],j=I=>{if(I.target!==v)return;let{parts:N,run:z}=I.detail,F=N.map(({part:E})=>E.innerHTML),M=N.map(({part:E})=>E.cloneNode(!0)),Z=z(Object.fromEntries(N.map(({name:E},A)=>[E,M[A]]))),W=N.find(({part:E},A)=>E.innerHTML!==F[A]),U=N.find(({part:E},A)=>M[A].cloneNode(!1).outerHTML!==E.cloneNode(!1).outerHTML);if(W&&N.forEach(({part:E},A)=>{E.innerHTML=F[A]}),!m){let E=W??U??N.find((A,ee)=>M[ee].innerHTML!==F[ee]);E&&!b.some(A=>A.when===y)?b.push({kind:"unasked",part:E.name,when:y}):Z&&!E&&I.preventDefault();return}W?o??=`it writes the part ${W.name} on the page, not the draft context.edit hands it, so the editor refuses the edit`:Z&&U&&(o??=`it changes the part ${U.name}'s own tag or attributes, which are the file's: a change writes what a part holds, so the editor refuses the edit`),!(W||!Z||U)&&(N.forEach(({part:E},A)=>{e.push({part:E,before:F[A]}),E.replaceChildren(...M[A].childNodes)}),I.preventDefault())};document.addEventListener("doc-component-edit",j);try{return[...await L(),...b]}finally{document.removeEventListener("doc-component-edit",j)}async function L(){dispatchEvent(new Event("doc-editable")),await $(v),y="as it mounts";let I=v.cloneNode(!0);v.replaceWith(I),v=I;let N=await $(v);y="as it hears its part changed (the source signal)";let z=X(v),F=DocKit.dehydrate(v.cloneNode(!0)),M=[];m=!0;try{if(!DocKit.example(v))return[{kind:"no-example"}]}catch(_){return[{kind:"example",what:`it throws: ${_?.message??_}`}]}finally{m=!1}let Z=await $(v),W=DocKit.dehydrate(v.cloneNode(!0)),U=Object.fromEntries(J(W).map(({name:_,node:K},st)=>[_,K.innerHTML,J(F)[st]?.node.innerHTML]).filter(([,_,K])=>_!==K));o?M.push({kind:"example",what:o}):e.length===0?M.push({kind:"example",what:"context.edit was not taken: it was not called, or it answered false, and the console says why"}):Object.keys(U).length===0?M.push({kind:"example",what:"it changes nothing a part holds"}):M.push({kind:"wrote",parts:U});for(let _ of[F,W])for(let{node:K}of J(_))K.textContent="";let E=V(H(F),H(W));E&&M.push({kind:"example",what:`it changes what is no data part: ${E}`}),M.push(...ie(z,X(v),"as its example makes its edit"));for(let{part:_,before:K}of e.reverse())_.innerHTML=K;let A=await $(v),ee=N!==null&&A!==null?V(H(f(N)),H(f(A))):null;return Z===null||A===null?M.push({kind:"moving"}):ee&&!E&&M.push({kind:"undo",what:ee}),M}}}var Et=t=>t.map(({name:a,removed:i,added:r,lines:n})=>`${a} (-${i} +${r} of its ${n} line${n===1?"":"s"})`).join(" and "),St="a write changes the lines it means and no others, a row moved with the blank before it, JSON written back by jsonIn and laid out in template.html and example.html as jsonIn writes it (building-components.md, Two examples)";function Nt({kind:t,what:a,part:i,how:r,when:n,counts:s,outside:p,parts:h,back:u,line:l},w,{script:k}){let c=T=>({...w,what:T}),d=T=>({...w,what:T,note:!0});switch(t){case"wrote":return{...w,told:!0,what:`its example wrote ${Et(h)}; the server took it${u?"; put back as an undo does, it shows what it showed":""}`};case"laid":return d(`its example's write lays the part ${i} out anew (${r}): ${St}`);case"drops":return{...d(`${a} listens for dragover and not for dragenter: a drop goes where both are cancelled, and the move that enters it asks dragenter alone, so that a release then (on a card's words, its padding) drops nothing: cancel dragenter as dragover is cancelled (preventDefault)`),file:"kit.js",line:l};case"gone":return c("the page does not hold this instance");case"fallback":return c(k?"its component failed or never started: the instance shows what it holds, read-only":"the instance shows as one of no package");case"moving":return d("what it shows never holds still (an animation?), so its mounts could not be compared");case"redrawn":return c(`the component redraws its text part ${i}: ${r}. A text part is the file's, what the user types in: read it, and draw in what is the component's`);case"left":return c(`dehydrate does not leave it as the file has it, so a copy of the view would hold what the kit made of it: ${a}. ${i?`That stands in its part ${i}, which is the file's: read a part, and draw in what is the component's`:"Name what it draws in the manifest's runtime, or take it off in dehydrate"}`);case"data":return c(`a mount changes its data part ${i}, so that a page would write what the component left there, with nothing edited: read a data part, and change it by context.edit alone`);case"no-example":return d("it has a data part and its component offers no example of an edit, so nothing has tried the way back to the file: give DocKit.component an example(host, context) that makes a small context.edit");case"example":return c(`its example: ${a}`);case"refused":return c("what its example wrote cannot go in the file: a script, a handler, an address of code, data-block-id or data-ge-*, what does not read back as itself, or what is no JSON in a script of data");case"undo":return c(`with what its example wrote put back, as an undo does, it does not show what it showed: ${a}: draw from the part, and on the source signal`);case"unasked":return c(`it writes its data part ${i} with no reader's gesture, ${n}, once the page takes edits: a page would write it each time it opened. Call context.edit on a gesture alone, a press, a drop or a key, and draw what the part holds as it is`);case"written-in":return c(`kit.js ${r}: a slot is the document's, its blocks the reader's: read it with context.part, never write in it or move it, and draw outside it`);case"piles":return c(p?`${a} piles up outside the instance on each put-back (${s.join(", then ")} of them), so an undo adds another: a component draws in its instance, and what it has to put elsewhere it takes away again in destroy`:`${a} piles up on each put-back (${s.join(", then ")} of them): it is declared in neither the manifest's runtime nor dehydrate, so an undo adds another`);default:return c(`a mount does not give the same DOM again: ${a}`)}}var At=t=>[...new Map(t.toReversed().map(a=>[`${a.finding.kind}|${a.finding.part??""}|${["piles","example"].includes(a.finding.kind)?a.finding.what:""}|${a.finding.when??""}|${a.finding.line??""}`,a])).values()].toReversed(),Ot=4e6;function Ze(t,a,i=(r,n)=>r===n){let[r,n]=[t.split(`
11
+ `),a.split(`
12
+ `)],s=0;for(;s<r.length&&s<n.length&&i(r[s],n[s]);)s++;let p=0;for(;p<r.length-s&&p<n.length-s&&i(r[r.length-1-p],n[n.length-1-p]);)p++;let[h,u]=[r.slice(s,r.length-p),n.slice(s,n.length-p)];if(h.length===0&&u.length===0)return[];if(h.length*u.length>Ot)return[{removed:h,added:u}];let l=Array.from({length:h.length+1},()=>new Uint32Array(u.length+1));for(let c=h.length-1;c>=0;c--)for(let d=u.length-1;d>=0;d--)l[c][d]=i(h[c],u[d])?l[c+1][d+1]+1:Math.max(l[c+1][d],l[c][d+1]);let w=[],k=null;for(let c=0,d=0;c<h.length||d<u.length;)c<h.length&&d<u.length&&i(h[c],u[d])?(k=null,c++,d++):(k||w.push(k={removed:[],added:[]}),d<u.length&&(c===h.length||l[c][d+1]>=l[c+1][d])?k.added.push(u[d++]):k.removed.push(h[c++]));return w}function Lt(t,a){let i=n=>n.filter(s=>s.trim()).length,r=Ze(t,a);return{removed:r.reduce((n,s)=>n+i(s.removed),0),added:r.reduce((n,s)=>n+i(s.added),0),lines:i(t.split(`
13
+ `))}}function Ve(t,a){let i=0,r=0;for(let[n,s]of t.entries())if(n>0&&i>0&&i<a&&r++,i+=s.replace(/\s+/g,"").length,i>=a)break;return r}function Mt(t,a){let i=r=>r.filter(n=>!n.trim()).length;for(let{removed:r,added:n}of Ze(t,a,(s,p)=>s.trim()===p.trim())){if(i(n)>i(r))return"a line left blank";let[s,p]=[r.join("").replace(/\s+/g,""),n.join("").replace(/\s+/g,"")],h=0;for(;h<s.length&&h<p.length&&s[h]===p[h];)h++;let u=0;for(;u<s.length-h&&u<p.length-h&&s[s.length-1-u]===p[p.length-1-u];)u++;for(let[l,w,k]of[[h,r,n],[u,r.toReversed(),n.toReversed()]]){let[c,d]=[Ve(w,l)+1,Ve(k,l)+1];if(c!==d)return`${c} line${c===1?"":"s"} became ${d}`}}return null}function Dt(t,{source:a,found:i,at:r,findings:n}){let s=Ie(a,ze(me(a),i)[r],t.parts,new Map([[i.id,i]]));if(!s)return[{kind:"refused"}];let p=Object.keys(t.parts),h=s.map(({start:l,end:w,text:k},c)=>({name:p[c],before:a.slice(l,w),after:k}));return[{kind:"wrote",back:!n.some(({kind:l})=>l==="undo"||l==="moving"),parts:h.map(({name:l,before:w,after:k})=>({name:l,...Lt(w,k)}))},...h.flatMap(({name:l,before:w,after:k})=>{let c=Mt(w,k);return c?[{kind:"laid",part:l,how:c}]:[]})]}var Pt=2e3;function Rt({match:t,instance:a,at:i,most:r}){let n=[...document.querySelectorAll(t)].filter(s=>!s.parentElement.closest(a))[i];return n?[window,document,n,...n.querySelectorAll("*")].slice(0,r):[]}function Ct(t){return t.map((a,i)=>i<2?{parent:i-1,named:""}:{parent:i===2?1:t.indexOf(a.parentElement),named:`<${a.localName}${a.classList.length?` class="${a.getAttribute("class")}"`:""}>`})}function It(){let t=new DragEvent("dragenter",{bubbles:!0,cancelable:!0,composed:!0,dataTransfer:new DataTransfer});return this.dispatchEvent(t),t.defaultPrevented}async function Ft(t,{match:a,at:i}){let r=new Map,n=({scriptId:s,url:p})=>r.set(s,p);t.on("Debugger.scriptParsed",n);try{await t.send("Debugger.enable"),await t.send("Debugger.setSkipAllPauses",{skip:!0});let{result:s}=await t.send("Runtime.evaluate",{expression:`(${Rt})(${JSON.stringify({match:a,instance:ke,at:i,most:Pt})})`,objectGroup:"drops"}),{result:p}=await t.send("Runtime.callFunctionOn",{objectId:s.objectId,functionDeclaration:String(Ct),arguments:[{objectId:s.objectId}],returnByValue:!0}),{result:h}=await t.send("Runtime.getProperties",{objectId:s.objectId,ownProperties:!0}),u=h.filter(({name:c,value:d})=>/^\d+$/.test(c)&&d?.objectId).sort((c,d)=>Number(c.name)-Number(d.name)),l=[];for(let{value:c}of u)l.push((await t.send("DOMDebugger.getEventListeners",{objectId:c.objectId})).listeners);let w=(c,d)=>l[c]?.some(T=>T.type===d),k=[];for(let c=2;c<l.length;c++){let d=l[c].find(g=>g.type==="dragover"&&r.get(g.scriptId)==="kit.js");if(!d)continue;let T=!1;for(let g=c;g>=2&&!T;g=p.value[g].parent)T=w(g,"dragenter");if(!T&&(w(0,"dragenter")||w(1,"dragenter"))){let{result:g}=await t.send("Runtime.callFunctionOn",{objectId:u[c].value.objectId,functionDeclaration:String(It),returnByValue:!0});T=g.value===!0}T||k.push({kind:"drops",what:p.value[c].named,line:d.lineNumber+1})}return k}finally{t.off("Debugger.scriptParsed",n),await t.send("Runtime.releaseObjectGroup",{objectGroup:"drops"}).catch(()=>{}),await t.send("Debugger.disable").catch(()=>{})}}function _t(t,a){let i={errors:new Map,notes:new Set,failed:new Set,dialogs:new Set,windows:0,opened:[],asked:1,pending:[]},r=n=>{let[s]=n.split(`
14
+ `);i.errors.has(s)||i.errors.set(s,Number(/\bkit\.js:(\d+)/.exec(n)?.[1])||null)};return t.on("pageerror",n=>r(n.stack??n.message)),t.on("console",n=>{let s=n.type();!["error","warn","warning"].includes(s)||!Be(n,a,["kit.js"])||i.pending.push(Promise.all(n.args().map(p=>p.evaluate(h=>h instanceof Error?h.stack:String(h)).catch(()=>""))).then(p=>{let h=p.join(" ")||n.text();s==="error"?r(h):i.notes.add(h.split(`
15
+ `)[0])}))}),t.on("requestfailed",n=>{n.frame()===t.mainFrame()&&!n.isNavigationRequest()&&i.failed.add(n.url())}),t.on("request",n=>{n.isNavigationRequest()&&n.frame()===t.mainFrame()&&i.opened.push(n.url())}),i}async function Ht(t,a){let i=await t.createCDPSession();return await i.send("Page.enable"),i.on("Page.javascriptDialogOpening",({type:r})=>{a.add(r),i.send("Page.handleJavaScriptDialog",{accept:!1}).catch(()=>{})}),i}function O(t,a,i=ye){let r=0,n=()=>Object.assign(new Error(a),{stuck:!0,doing:a}),s=new Promise((h,u)=>{r=setTimeout(()=>u(n()),i)}),p=t.catch(h=>{throw yt.has(h.name)?n():Object.assign(h,{doing:a})});return Promise.race([p,s]).finally(()=>clearTimeout(r))}var et=t=>new Promise(a=>{if(!t.connected)return a(!0);t.once("disconnected",()=>a(!0)),setTimeout(()=>a(!1),Xe)});function Bt({match:t,instance:a}){let{clientWidth:i,scrollWidth:r}=document.documentElement;if(r<=i+1)return null;let n=[...document.querySelectorAll(t)].filter(s=>!s.parentElement.closest(a));return{wide:r,at:n.findIndex(s=>[s,...s.querySelectorAll("*")].some(p=>p.getBoundingClientRect().right>i+1))}}var Je=16,Wt="#8f8f8f";async function qt(t,a,i){let r=await Promise.all(a.map(async n=>`data:image/png;base64,${(await D.readFile(n)).toString("base64")}`));await t.setViewport({width:ne.reduce((n,s)=>n+s,0)+Je*(ne.length-1),height:900}),await t.setContent(`<!doctype html><body style="margin: 0; display: flex; align-items: flex-start; gap: ${Je}px; background: ${Wt}">${r.map((n,s)=>`<img src="${n}" width="${ne[s]}" alt="" style="display: block">`).join("")}</body>`,{waitUntil:"load"}),await t.screenshot({path:i,fullPage:!0})}async function Gt(t,{file:a,html:i,source:r,places:n,found:s,out:p,loading:h}){let u=await t.createBrowserContext(),l=await u.newPage(),w=Ye(a).href,k=_t(l,w),c=await Ht(l,k.dialogs);u.on("targetcreated",g=>{g.type()==="page"&&(k.windows+=1,g.page().then($=>$?.close()).then(()=>l.bringToFront()).catch(()=>{}))});let d={heard:k,blocked:[],late:[],taken:[],overviews:[],edited:[],asExport:[],answers:[],wide:[],stuck:null,stopped:null,gone:null},T=async g=>d.late.push(...await O(Ge(l,{timeout:Ke}),g,3*Ke+ye));await We(l),await l.setViewport({width:736,height:900}),await l.emulateMediaFeatures([{name:"prefers-color-scheme",value:"light"}]);try{await O(l.goto(w,{waitUntil:"load",timeout:0}),"the page opened",h),await T("the page opened");for(let f of ge){await O(l.emulateMediaFeatures([{name:"prefers-color-scheme",value:f}]),`the ${f} theme came`);for(let x of ne){if(await O(l.setViewport({width:x,height:900}),`the window went to ${x}px`),await T(`it was drawn at ${x}px`),f===ge[0]){let q=await O(l.evaluate(Bt,{match:s.match,instance:ke}),`it was measured at ${x}px`);q&&d.wide.push({width:x,...q})}let P=S.join(p,`${x}-${f}.png`);await O(l.screenshot({path:P,fullPage:!0}),`it was pictured at ${x}px`),d.taken.push(P)}}await O(l.emulateMediaFeatures([{name:"prefers-color-scheme",value:"light"}]),"the light theme came"),await O(l.setViewport({width:736,height:900}),"the window went to 736px");let g=Qe(i,s),$=s.files.includes("kit.js")&&Object.values(s.parts).some(({edit:f})=>f==="data");for(let f=0;f<g.length;f++){let x=await O(l.evaluate(jt,{match:s.match,instance:ke,slotPart:lt,slotName:rt,fallback:it,parts:s.parts,at:f,source:g[f].markup,still:ft,step:wt,times:mt,typed:gt,typing:kt}),"an instance was put back"),P=x.find(({kind:R})=>R==="wrote"),q=[...x.filter(R=>R!==P),...P?Dt(P,{source:r,found:s,at:f,findings:x}):[]];$&&!x.some(({kind:R})=>R==="gone"||R==="fallback")&&q.push(...await O(Ft(c,{match:s.match,at:f}),"the page was asked what an instance listens to")),d.answers.push(...q.map(R=>({finding:R,place:n[f]})))}d.blocked=await O(l.evaluate(()=>globalThis.__qaViolations),"the page was asked what it blocked"),k.asked+=1,await O(l.goto(w,{waitUntil:"load",timeout:0}),"the page opened again",h),await T("the page opened again"),await O(l.evaluate(()=>dispatchEvent(new Event("doc-editable"))),"the page was told it takes edits"),await T("it was drawn as the editing page draws it");for(let f of pt){await O(l.setViewport({width:f,height:900}),`the window went to ${f}px`),await T(`it was drawn at ${f}px as the editing page draws it`);let x=S.join(p,`edit-${f}-light.png`);await O(l.screenshot({path:x,fullPage:!0}),`it was pictured at ${f}px as the editing page draws it`),d.edited.push(x),(await D.readFile(x)).equals(await D.readFile(S.join(p,`${f}-light.png`)))&&d.asExport.push(x)}d.blocked.push(...await O(l.evaluate(()=>globalThis.__qaViolations),"the page was asked what it blocked"));for(let f of ge){let x=S.join(p,`overview-${f}.png`);await O(qt(l,ne.map(P=>S.join(p,`${P}-${f}.png`)),x),`the ${f} pictures were put side by side`),d.overviews.push(x)}}catch(g){if(g.syscall)throw g;await et(t)?d.gone=g.doing??"the page answered":g.stuck?d.stuck=g.doing:d.stopped=$e(g)}return await Promise.race([Promise.all(k.pending),new Promise(g=>setTimeout(g,Xe).unref())]),d}var Ut=(t,a)=>t.startsWith(a)?t.slice(a.length):t;function Kt(t,a,i){let r=new Map;for(let{url:n,directive:s,source:p,line:h}of t){if($t.test(n)){let l=!p&&h>0;r.set(`${n}|${p}|${h}`,{file:l?"kit.js":"the page",...l?{line:h}:{},what:"the export's policy blocks code made from words (eval, new Function, a string given to setTimeout): an export runs none"});continue}let u=/^[a-z][a-z0-9+.-]*$/.test(n)?a.filter(l=>l.startsWith(`${n}:`)):[];for(let l of u.length?u:[n])r.set(`${l}|${s}`,{file:"the page",what:`the export's policy blocks ${Ut(l,i)||"something"} (${s}): ${s==="img-src"?"a picture of an instance is a data: address, or a file its style names":"an export holds all it needs"}`})}return[...r.values()]}function Vt({heard:t,blocked:a,late:i,answers:r,wide:n,stuck:s,stopped:p},{places:h,script:u,folder:l}){let w=At(r).map(({finding:$,place:f})=>Nt($,f,{script:u})),k=[...t.failed],c=k.filter($=>!a.some(f=>f.url&&$.startsWith(f.url))),d=t.opened.length>t.asked?"it loads itself again (location.reload(), a new location.href), so a reader's page would not stay":s?`it stopped answering while waiting until ${s}${u?": a script that never ends, or a component that changes what it hears (a text part, on its source signal)":""}`:p&&`the look at it stopped: ${p}`,T=n.map(({width:$,wide:f})=>`${f}px wide in a ${$}px window`).join(", "),g=h[n.find(({at:$})=>$>=0)?.at]??{file:"the page"};return{problems:[...[...t.errors].map(([$,f])=>({file:f?"kit.js":"the page",line:f,what:`the console says ${$}`})),...Kt(a,k,l),...c.map($=>({file:"the page",what:`it could not load ${$.slice(0,120)}`})),...[...t.dialogs].map($=>({file:"the page",what:`it opens a dialog (${$}), which stops a reader's page until it is answered: show what it says in the instance`})),...t.windows?[{file:"the page",what:"it opens a window, which takes a reader away from the page: show it in the instance, or link to it"}]:[],...d?[{file:"the page",what:d}]:[],...n.length?[{...g,what:`the page is ${T}: a reader scrolls the whole page sideways, and gallery qa fails it: let it fit the window (max-width: 100%), or put what is wider in a frame of its own that scrolls`}]:[],...w.filter(({note:$,told:f})=>!$&&!f)],notes:[...[...t.notes].map($=>({file:"the page",what:`the console says ${$}`})),...w.filter(({note:$})=>$),...i.map($=>({file:"the page",what:`waited for ${$}`}))],told:w.filter(({told:$})=>$)}}async function ln(t,a,{example:i,template:r},{find:n=_e,start:s=qe,loading:p=ut}={}){let h=ht,u=null,l=null;try{u=await D.mkdtemp(S.join(Ue.tmpdir(),"gallery-component-check-"));let w=await Tt(a,{example:i,template:r},u),k=n();if(!k)return{title:h,unverified:"no Chrome, Edge or Chromium found (GALLERY_BROWSER=<its executable> picks one)"};try{l=await s({executablePath:k,args:He()})}catch(g){return{title:h,unverified:`the browser ${k} did not start, twice, each time with a fresh profile (${$e(g)}; GALLERY_BROWSER=<its executable> picks another)`}}let c=S.join(ct(t).qa,"components",...a.id.split("/"));await D.rm(c,{recursive:!0,force:!0}),await D.mkdir(c,{recursive:!0});let d=await Gt(l.browser,{...w,found:a,out:c,loading:p}),T=Vt(d,{places:w.places,script:a.files.includes("kit.js"),folder:Ye(`${u}${S.sep}`).href});return d.gone?{title:h,...T,unverified:`the browser went while waiting until ${d.gone}, so it says nothing of the package`}:{title:h,...T,...d.taken.length?{pictures:{folder:c,overviews:d.overviews.map(g=>S.basename(g)),each:d.taken.map(g=>S.basename(g)),edited:d.edited.map(g=>S.basename(g)),asExport:d.asExport.map(g=>S.basename(g))}}:{}}}catch(w){return w.reason==="check"?{title:h,problems:w.failures.map(k=>({file:"the export",what:k}))}:w.syscall?{title:h,unverified:`cannot write ${Fe(w.syscall==="mkdtemp"?Ue.tmpdir():w.path)} (${w.code})`}:l&&await et(l.browser)?{title:h,unverified:"the browser went before the page opened"}:{title:h,problems:[{file:"the page",what:`the look at it stopped: ${$e(w)}`}]}}finally{await l?.close(),u&&await D.rm(u,{recursive:!0,force:!0,maxRetries:5,retryDelay:200}).catch(()=>{})}}export{ht as a,ut as b,ft as c,wt as d,$e as e,bt as f,Et as g,St as h,Lt as i,Mt as j,Ht as k,O as l,et as m,ln as n};
@@ -0,0 +1,13 @@
1
+ import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
2
+ import{c as Lu,e as cu}from"./chunk-5L7RYZCL.mjs";var gu=Lu((Mt,tD)=>{tD.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var yD=Lu((hn,xD)=>{"use strict";xD.exports=function(D){if(D===void 0&&(D=2),D>=Error.stackTraceLimit)throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+D+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");var e=Error.prepareStackTrace;Error.prepareStackTrace=function(n,a){return a};var r=new Error().stack;if(Error.prepareStackTrace=e,r!==null&&typeof r=="object")return r[D]?r[D].getFileName():void 0}});import{format as UD}from"util";import{normalize as qD,resolve as KD}from"path";function P(u){if(u!==u.toLowerCase()&&u!==u.toUpperCase()||(u=u.toLowerCase()),u.indexOf("-")===-1&&u.indexOf("_")===-1)return u;{let e="",r=!1,n=u.match(/^-+/);for(let a=n?n[0].length:0;a<u.length;a++){let l=u.charAt(a);r&&(r=!1,l=l.toUpperCase()),a!==0&&(l==="-"||l==="_")?r=!0:l!=="-"&&l!=="_"&&(e+=l)}return e}}function Z(u,D){let e=u.toLowerCase();D=D||"-";let r="";for(let n=0;n<u.length;n++){let a=e.charAt(n),l=u.charAt(n);a!==l&&n>0?r+=`${D}${e.charAt(n)}`:r+=l}return r}function X(u){return u==null?!1:typeof u=="number"||/^0x[0-9a-f]+$/i.test(u)?!0:/^0[^.]/.test(u)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(u)}function $u(u){if(Array.isArray(u))return u.map(l=>typeof l!="string"?l+"":l);u=u.trim();let D=0,e=null,r=null,n=null,a=[];for(let l=0;l<u.length;l++){if(e=r,r=u.charAt(l),r===" "&&!n){e!==" "&&D++;continue}r===n?n=null:(r==="'"||r==='"')&&!n&&(n=r),a[D]||(a[D]=""),a[D]+=r}return a}var N;(function(u){u.BOOLEAN="boolean",u.STRING="string",u.NUMBER="number",u.ARRAY="array"})(N||(N={}));var I,uu=class{constructor(D){I=D}parse(D,e){let r=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},e),n=$u(D),a=typeof D=="string",l=zD(Object.assign(Object.create(null),r.alias)),o=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},r.configuration),p=Object.assign(Object.create(null),r.default),A=r.configObjects||[],B=r.envPrefix,b=o["populate--"],O=b?"--":"_",y=Object.create(null),$=Object.create(null),S=r.__||I.format,c={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},T=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,su=new RegExp("^--"+o["negation-prefix"]+"(.+)");[].concat(r.array||[]).filter(Boolean).forEach(function(t){let s=typeof t=="object"?t.key:t,f=Object.keys(t).map(function(F){return{boolean:"bools",string:"strings",number:"numbers"}[F]}).filter(Boolean).pop();f&&(c[f][s]=!0),c.arrays[s]=!0,c.keys.push(s)}),[].concat(r.boolean||[]).filter(Boolean).forEach(function(t){c.bools[t]=!0,c.keys.push(t)}),[].concat(r.string||[]).filter(Boolean).forEach(function(t){c.strings[t]=!0,c.keys.push(t)}),[].concat(r.number||[]).filter(Boolean).forEach(function(t){c.numbers[t]=!0,c.keys.push(t)}),[].concat(r.count||[]).filter(Boolean).forEach(function(t){c.counts[t]=!0,c.keys.push(t)}),[].concat(r.normalize||[]).filter(Boolean).forEach(function(t){c.normalize[t]=!0,c.keys.push(t)}),typeof r.narg=="object"&&Object.entries(r.narg).forEach(([t,s])=>{typeof s=="number"&&(c.nargs[t]=s,c.keys.push(t))}),typeof r.coerce=="object"&&Object.entries(r.coerce).forEach(([t,s])=>{typeof s=="function"&&(c.coercions[t]=s,c.keys.push(t))}),typeof r.config<"u"&&(Array.isArray(r.config)||typeof r.config=="string"?[].concat(r.config).filter(Boolean).forEach(function(t){c.configs[t]=!0}):typeof r.config=="object"&&Object.entries(r.config).forEach(([t,s])=>{(typeof s=="boolean"||typeof s=="function")&&(c.configs[t]=s)})),LD(r.key,l,r.default,c.arrays),Object.keys(p).forEach(function(t){(c.aliases[t]||[]).forEach(function(s){p[s]=p[t]})});let W=null;PD();let Q=[],x=Object.assign(Object.create(null),{_:[]}),ju={};for(let t=0;t<n.length;t++){let s=n[t],f=s.replace(/^-{3,}/,"---"),F,i,C,E,d,_;if(s!=="--"&&/^-/.test(s)&&Y(s))ou(s);else if(f.match(/^---+(=|$)/)){ou(s);continue}else if(s.match(/^--.+=/)||!o["short-option-groups"]&&s.match(/^-.+=/))E=s.match(/^--?([^=]+)=([\s\S]*)$/),E!==null&&Array.isArray(E)&&E.length>=3&&(h(E[1],c.arrays)?t=J(t,E[1],n,E[2]):h(E[1],c.nargs)!==!1?t=H(t,E[1],n,E[2]):g(E[1],E[2],!0));else if(s.match(su)&&o["boolean-negation"])E=s.match(su),E!==null&&Array.isArray(E)&&E.length>=2&&(i=E[1],g(i,h(i,c.arrays)?[!1]:!1));else if(s.match(/^--.+/)||!o["short-option-groups"]&&s.match(/^-[^-]+/))E=s.match(/^--?(.+)/),E!==null&&Array.isArray(E)&&E.length>=2&&(i=E[1],h(i,c.arrays)?t=J(t,i,n):h(i,c.nargs)!==!1?t=H(t,i,n):(d=n[t+1],d!==void 0&&(!d.match(/^-/)||d.match(T))&&!h(i,c.bools)&&!h(i,c.counts)||/^(true|false)$/.test(d)?(g(i,d),t++):g(i,G(i))));else if(s.match(/^-.\..+=/))E=s.match(/^-([^=]+)=([\s\S]*)$/),E!==null&&Array.isArray(E)&&E.length>=3&&g(E[1],E[2]);else if(s.match(/^-.\..+/)&&!s.match(T))d=n[t+1],E=s.match(/^-(.\..+)/),E!==null&&Array.isArray(E)&&E.length>=2&&(i=E[1],d!==void 0&&!d.match(/^-/)&&!h(i,c.bools)&&!h(i,c.counts)?(g(i,d),t++):g(i,G(i)));else if(s.match(/^-[^-]+/)&&!s.match(T)){C=s.slice(1,-1).split(""),F=!1;for(let w=0;w<C.length;w++){if(d=s.slice(w+2),C[w+1]&&C[w+1]==="="){_=s.slice(w+3),i=C[w],h(i,c.arrays)?t=J(t,i,n,_):h(i,c.nargs)!==!1?t=H(t,i,n,_):g(i,_),F=!0;break}if(d==="-"){g(C[w],d);continue}if(/[A-Za-z]/.test(C[w])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(d)&&h(d,c.bools)===!1){g(C[w],d),F=!0;break}if(C[w+1]&&C[w+1].match(/\W/)){g(C[w],d),F=!0;break}else g(C[w],G(C[w]))}i=s.slice(-1)[0],!F&&i!=="-"&&(h(i,c.arrays)?t=J(t,i,n):h(i,c.nargs)!==!1?t=H(t,i,n):(d=n[t+1],d!==void 0&&(!/^(-|--)[^-]/.test(d)||d.match(T))&&!h(i,c.bools)&&!h(i,c.counts)||/^(true|false)$/.test(d)?(g(i,d),t++):g(i,G(i))))}else if(s.match(/^-[0-9]$/)&&s.match(T)&&h(s.slice(1),c.bools))i=s.slice(1),g(i,G(i));else if(s==="--"){Q=n.slice(t+1);break}else if(o["halt-at-non-option"]){Q=n.slice(t);break}else ou(s)}Nu(x,!0),Nu(x,!1),SD(x),ND(),Wu(x,c.aliases,p,!0),WD(x),o["set-placeholder-key"]&&RD(x),Object.keys(c.counts).forEach(function(t){U(x,t.split("."))||g(t,0)}),b&&Q.length&&(x[O]=[]),Q.forEach(function(t){x[O].push(t)}),o["camel-case-expansion"]&&o["strip-dashed"]&&Object.keys(x).filter(t=>t!=="--"&&t.includes("-")).forEach(t=>{delete x[t]}),o["strip-aliased"]&&[].concat(...Object.keys(l).map(t=>l[t])).forEach(t=>{o["camel-case-expansion"]&&t.includes("-")&&delete x[t.split(".").map(s=>P(s)).join(".")],delete x[t]});function ou(t){let s=k("_",t);(typeof s=="string"||typeof s=="number")&&x._.push(s)}function H(t,s,f,F){let i,C=h(s,c.nargs);if(C=typeof C!="number"||isNaN(C)?1:C,C===0)return M(F)||(W=Error(S("Argument unexpected for: %s",s))),g(s,G(s)),t;let E=M(F)?0:1;if(o["nargs-eats-options"])f.length-(t+1)+E<C&&(W=Error(S("Not enough arguments following: %s",s))),E=C;else{for(i=t+1;i<f.length&&(!f[i].match(/^-[^0-9]/)||f[i].match(T)||Y(f[i]));i++)E++;E<C&&(W=Error(S("Not enough arguments following: %s",s)))}let d=Math.min(E,C);for(!M(F)&&d>0&&(g(s,F),d--),i=t+1;i<d+t+1;i++)g(s,f[i]);return t+d}function J(t,s,f,F){let i=[],C=F||f[t+1],E=h(s,c.nargs);if(h(s,c.bools)&&!/^(true|false)$/.test(C))i.push(!0);else if(M(C)||M(F)&&/^-/.test(C)&&!T.test(C)&&!Y(C)){if(p[s]!==void 0){let d=p[s];i=Array.isArray(d)?d:[d]}}else{M(F)||i.push(Fu(s,F,!0));for(let d=t+1;d<f.length&&!(!o["greedy-arrays"]&&i.length>0||E&&typeof E=="number"&&i.length>=E||(C=f[d],/^-/.test(C)&&!T.test(C)&&!Y(C)));d++)t=d,i.push(Fu(s,C,a))}return typeof E=="number"&&(E&&i.length<E||isNaN(E)&&i.length===0)&&(W=Error(S("Not enough arguments following: %s",s))),g(s,i),t}function g(t,s,f=a){if(/-/.test(t)&&o["camel-case-expansion"]){let C=t.split(".").map(function(E){return P(E)}).join(".");Su(t,C)}let F=Fu(t,s,f),i=t.split(".");q(x,i,F),c.aliases[t]&&c.aliases[t].forEach(function(C){let E=C.split(".");q(x,E,F)}),i.length>1&&o["dot-notation"]&&(c.aliases[i[0]]||[]).forEach(function(C){let E=C.split("."),d=[].concat(i);d.shift(),E=E.concat(d),(c.aliases[t]||[]).includes(E.join("."))||q(x,E,F)}),h(t,c.normalize)&&!h(t,c.arrays)&&[t].concat(c.aliases[t]||[]).forEach(function(E){Object.defineProperty(ju,E,{enumerable:!0,get(){return s},set(d){s=typeof d=="string"?I.normalize(d):d}})})}function Su(t,s){c.aliases[t]&&c.aliases[t].length||(c.aliases[t]=[s],y[s]=!0),c.aliases[s]&&c.aliases[s].length||Su(s,t)}function Fu(t,s,f){f&&(s=GD(s)),(h(t,c.bools)||h(t,c.counts))&&typeof s=="string"&&(s=s==="true");let F=Array.isArray(s)?s.map(function(i){return k(t,i)}):k(t,s);return h(t,c.counts)&&(M(F)||typeof F=="boolean")&&(F=lu()),h(t,c.normalize)&&h(t,c.arrays)&&(Array.isArray(s)?F=s.map(i=>I.normalize(i)):F=I.normalize(s)),F}function k(t,s){return!o["parse-positional-numbers"]&&t==="_"||!h(t,c.strings)&&!h(t,c.bools)&&!Array.isArray(s)&&(X(s)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${s}`)))||!M(s)&&h(t,c.numbers))&&(s=Number(s)),s}function SD(t){let s=Object.create(null);Wu(s,c.aliases,p),Object.keys(c.configs).forEach(function(f){let F=t[f]||s[f];if(F)try{let i=null,C=I.resolve(I.cwd(),F),E=c.configs[f];if(typeof E=="function"){try{i=E(C)}catch(d){i=d}if(i instanceof Error){W=i;return}}else i=I.require(C);au(i)}catch(i){i.name==="PermissionDenied"?W=i:t[f]&&(W=Error(S("Invalid JSON config file: %s",F)))}})}function au(t,s){Object.keys(t).forEach(function(f){let F=t[f],i=s?s+"."+f:f;typeof F=="object"&&F!==null&&!Array.isArray(F)&&o["dot-notation"]?au(F,i):(!U(x,i.split("."))||h(i,c.arrays)&&o["combine-arrays"])&&g(i,F)})}function ND(){typeof A<"u"&&A.forEach(function(t){au(t)})}function Nu(t,s){if(typeof B>"u")return;let f=typeof B=="string"?B:"",F=I.env();Object.keys(F).forEach(function(i){if(f===""||i.lastIndexOf(f,0)===0){let C=i.split("__").map(function(E,d){return d===0&&(E=E.substring(f.length)),P(E)});(s&&c.configs[C.join(".")]||!s)&&!U(t,C)&&g(C.join("."),F[i])}})}function WD(t){let s,f=new Set;Object.keys(t).forEach(function(F){if(!f.has(F)&&(s=h(F,c.coercions),typeof s=="function"))try{let i=k(F,s(t[F]));[].concat(c.aliases[F]||[],F).forEach(C=>{f.add(C),t[C]=i})}catch(i){W=i}})}function RD(t){return c.keys.forEach(s=>{~s.indexOf(".")||typeof t[s]>"u"&&(t[s]=void 0)}),t}function Wu(t,s,f,F=!1){Object.keys(f).forEach(function(i){U(t,i.split("."))||(q(t,i.split("."),f[i]),F&&($[i]=!0),(s[i]||[]).forEach(function(C){U(t,C.split("."))||q(t,C.split("."),f[i])}))})}function U(t,s){let f=t;o["dot-notation"]||(s=[s.join(".")]),s.slice(0,-1).forEach(function(i){f=f[i]||{}});let F=s[s.length-1];return typeof f!="object"?!1:F in f}function q(t,s,f){let F=t;o["dot-notation"]||(s=[s.join(".")]),s.slice(0,-1).forEach(function(_){_=Tu(_),typeof F=="object"&&F[_]===void 0&&(F[_]={}),typeof F[_]!="object"||Array.isArray(F[_])?(Array.isArray(F[_])?F[_].push({}):F[_]=[F[_],{}],F=F[_][F[_].length-1]):F=F[_]});let i=Tu(s[s.length-1]),C=h(s.join("."),c.arrays),E=Array.isArray(f),d=o["duplicate-arguments-array"];!d&&h(i,c.nargs)&&(d=!0,(!M(F[i])&&c.nargs[i]===1||Array.isArray(F[i])&&F[i].length===c.nargs[i])&&(F[i]=void 0)),f===lu()?F[i]=lu(F[i]):Array.isArray(F[i])?d&&C&&E?F[i]=o["flatten-duplicate-arrays"]?F[i].concat(f):(Array.isArray(F[i][0])?F[i]:[F[i]]).concat([f]):!d&&!!C==!!E?F[i]=f:F[i]=F[i].concat([f]):F[i]===void 0&&C?F[i]=E?f:[f]:d&&!(F[i]===void 0||h(i,c.counts)||h(i,c.bools))?F[i]=[F[i],f]:F[i]=f}function LD(...t){t.forEach(function(s){Object.keys(s||{}).forEach(function(f){c.aliases[f]||(c.aliases[f]=[].concat(l[f]||[]),c.aliases[f].concat(f).forEach(function(F){if(/-/.test(F)&&o["camel-case-expansion"]){let i=P(F);i!==f&&c.aliases[f].indexOf(i)===-1&&(c.aliases[f].push(i),y[i]=!0)}}),c.aliases[f].concat(f).forEach(function(F){if(F.length>1&&/[A-Z]/.test(F)&&o["camel-case-expansion"]){let i=Z(F,"-");i!==f&&c.aliases[f].indexOf(i)===-1&&(c.aliases[f].push(i),y[i]=!0)}}),c.aliases[f].forEach(function(F){c.aliases[F]=[f].concat(c.aliases[f].filter(function(i){return F!==i}))}))})})}function h(t,s){let f=[].concat(c.aliases[t]||[],t),F=Object.keys(s),i=f.find(C=>F.includes(C));return i?s[i]:!1}function Ru(t){let s=Object.keys(c);return[].concat(s.map(F=>c[F])).some(function(F){return Array.isArray(F)?F.includes(t):F[t]})}function $D(t,...s){return[].concat(...s).some(function(F){let i=t.match(F);return i&&Ru(i[1])})}function TD(t){if(t.match(T)||!t.match(/^-[^-]+/))return!1;let s=!0,f,F=t.slice(1).split("");for(let i=0;i<F.length;i++){if(f=t.slice(i+2),!Ru(F[i])){s=!1;break}if(F[i+1]&&F[i+1]==="="||f==="-"||/[A-Za-z]/.test(F[i])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(f)||F[i+1]&&F[i+1].match(/\W/))break}return s}function Y(t){return o["unknown-options-as-args"]&&MD(t)}function MD(t){return t=t.replace(/^-{3,}/,"--"),t.match(T)||TD(t)?!1:!$D(t,/^-+([^=]+?)=[\s\S]*$/,su,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function G(t){return!h(t,c.bools)&&!h(t,c.counts)&&`${t}`in p?p[t]:ID(vD(t))}function ID(t){return{[N.BOOLEAN]:!0,[N.STRING]:"",[N.NUMBER]:void 0,[N.ARRAY]:[]}[t]}function vD(t){let s=N.BOOLEAN;return h(t,c.strings)?s=N.STRING:h(t,c.numbers)?s=N.NUMBER:h(t,c.bools)?s=N.BOOLEAN:h(t,c.arrays)&&(s=N.ARRAY),s}function M(t){return t===void 0}function PD(){Object.keys(c.counts).find(t=>h(t,c.arrays)?(W=Error(S("Invalid configuration: %s, opts.count excludes opts.array.",t)),!0):h(t,c.nargs)?(W=Error(S("Invalid configuration: %s, opts.count excludes opts.narg.",t)),!0):!1)}return{aliases:Object.assign({},c.aliases),argv:Object.assign(ju,x),configuration:o,defaulted:Object.assign({},$),error:W,newAliases:Object.assign({},y)}}};function zD(u){let D=[],e=Object.create(null),r=!0;for(Object.keys(u).forEach(function(n){D.push([].concat(u[n],n))});r;){r=!1;for(let n=0;n<D.length;n++)for(let a=n+1;a<D.length;a++)if(D[n].filter(function(o){return D[a].indexOf(o)!==-1}).length){D[n]=D[n].concat(D[a]),D.splice(a,1),r=!0;break}}return D.forEach(function(n){n=n.filter(function(l,o,p){return p.indexOf(l)===o});let a=n.pop();a!==void 0&&typeof a=="string"&&(e[a]=n)}),e}function lu(u){return u!==void 0?u+1:1}function Tu(u){return u==="__proto__"?"___proto___":u}function GD(u){return typeof u=="string"&&(u[0]==="'"||u[0]==='"')&&u[u.length-1]===u[0]?u.substring(1,u.length-1):u}import{readFileSync as VD}from"fs";import{createRequire as Mu}from"node:module";var fu,Eu,Cu,Iu=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):20,vu=(Eu=(fu=process==null?void 0:process.versions)===null||fu===void 0?void 0:fu.node)!==null&&Eu!==void 0?Eu:(Cu=process==null?void 0:process.version)===null||Cu===void 0?void 0:Cu.slice(1);if(vu&&Number(vu.match(/^([^.]+)/)[1])<Iu)throw Error(`yargs parser supports a minimum Node.js version of ${Iu}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var QD=process?process.env:{},Pu=Mu?Mu(import.meta.url):void 0,zu=new uu({cwd:process.cwd,env:()=>QD,format:UD,normalize:qD,resolve:KD,require:u=>{if(typeof Pu<"u")return Pu(u);if(u.match(/\.json$/))return JSON.parse(VD(u,"utf8"));throw Error("only .json config files are supported in ESM")}}),K=function(D,e){return zu.parse(D.slice(),e).argv};K.detailed=function(u,D){return zu.parse(u.slice(),D)};K.camelCase=P;K.decamelize=Z;K.looksLikeNumber=X;var Gu=K;function Uu(){return HD()?0:1}function HD(){return JD()&&!process.defaultApp}function JD(){return!!process.versions.electron}function ht(u){return u.slice(Uu()+1)}function qu(){return process.argv[Uu()]}import{notStrictEqual as ze,strictEqual as Ge}from"assert";var kD={right:De,center:ee},YD=0,Du=1,ZD=2,eu=3,du=class{constructor(D){var e;this.width=D.width,this.wrap=(e=D.wrap)!==null&&e!==void 0?e:!0,this.rows=[]}span(...D){let e=this.div(...D);e.span=!0}resetOutput(){this.rows=[]}div(...D){if(D.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...D)&&typeof D[0]=="string")return this.applyLayoutDSL(D[0]);let e=D.map(r=>typeof r=="string"?this.colFromString(r):r);return this.rows.push(e),e}shouldApplyLayoutDSL(...D){return D.length===1&&typeof D[0]=="string"&&/[\t\n]/.test(D[0])}applyLayoutDSL(D){let e=D.split(`
3
+ `).map(n=>n.split(" ")),r=0;return e.forEach(n=>{n.length>1&&j.stringWidth(n[0])>r&&(r=Math.min(Math.floor(this.width*.5),j.stringWidth(n[0])))}),e.forEach(n=>{this.div(...n.map((a,l)=>({text:a.trim(),padding:this.measurePadding(a),width:l===0&&n.length>1?r:void 0})))}),this.rows[this.rows.length-1]}colFromString(D){return{text:D,padding:this.measurePadding(D)}}measurePadding(D){let e=j.stripAnsi(D);return[0,e.match(/\s*$/)[0].length,0,e.match(/^\s*/)[0].length]}toString(){let D=[];return this.rows.forEach(e=>{this.rowToString(e,D)}),D.filter(e=>!e.hidden).map(e=>e.text).join(`
4
+ `)}rowToString(D,e){return this.rasterize(D).forEach((r,n)=>{let a="";r.forEach((l,o)=>{let{width:p}=D[o],A=this.negatePadding(D[o]),B=l;if(A>j.stringWidth(l)&&(B+=" ".repeat(A-j.stringWidth(l))),D[o].align&&D[o].align!=="left"&&this.wrap){let O=kD[D[o].align];B=O(B,A),j.stringWidth(B)<A&&(B+=" ".repeat((p||0)-j.stringWidth(B)-1))}let b=D[o].padding||[0,0,0,0];b[eu]&&(a+=" ".repeat(b[eu])),a+=Ku(D[o],B,"| "),a+=B,a+=Ku(D[o],B," |"),b[Du]&&(a+=" ".repeat(b[Du])),n===0&&e.length>0&&(a=this.renderInline(a,e[e.length-1]))}),e.push({text:a.replace(/ +$/,""),span:D.span})}),e}renderInline(D,e){let r=D.match(/^ */),n=r?r[0].length:0,a=e.text,l=j.stringWidth(a.trimRight());return e.span?this.wrap?n<l?D:(e.hidden=!0,a.trimRight()+" ".repeat(n-l)+D.trimLeft()):(e.hidden=!0,a+D):D}rasterize(D){let e=[],r=this.columnWidths(D),n;return D.forEach((a,l)=>{a.width=r[l],this.wrap?n=j.wrap(a.text,this.negatePadding(a),{hard:!0}).split(`
5
+ `):n=a.text.split(`
6
+ `),a.border&&(n.unshift("."+"-".repeat(this.negatePadding(a)+2)+"."),n.push("'"+"-".repeat(this.negatePadding(a)+2)+"'")),a.padding&&(n.unshift(...new Array(a.padding[YD]||0).fill("")),n.push(...new Array(a.padding[ZD]||0).fill(""))),n.forEach((o,p)=>{e[p]||e.push([]);let A=e[p];for(let B=0;B<l;B++)A[B]===void 0&&A.push("");A.push(o)})}),e}negatePadding(D){let e=D.width||0;return D.padding&&(e-=(D.padding[eu]||0)+(D.padding[Du]||0)),D.border&&(e-=4),e}columnWidths(D){if(!this.wrap)return D.map(l=>l.width||j.stringWidth(l.text));let e=D.length,r=this.width,n=D.map(l=>{if(l.width)return e--,r-=l.width,l.width}),a=e?Math.floor(r/e):0;return n.map((l,o)=>l===void 0?Math.max(a,XD(D[o])):l)}};function Ku(u,D,e){return u.border?/[.']-+[.']/.test(D)?"":D.trim().length!==0?e:" ":""}function XD(u){let D=u.padding||[],e=1+(D[eu]||0)+(D[Du]||0);return u.border?e+4:e}function ue(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function De(u,D){u=u.trim();let e=j.stringWidth(u);return e<D?" ".repeat(D-e)+u:u}function ee(u,D){u=u.trim();let e=j.stringWidth(u);return e>=D?u:" ".repeat(D-e>>1)+u}var j;function Vu(u,D){return j=D,new du({width:u?.width||ue(),wrap:u?.wrap})}function hu({onlyFirst:u=!1}={}){let n="(?:\\u001B\\][^\\u0007\\u001B\\u009C]*(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(n,u?void 0:"g")}var te=hu();function R(u){if(typeof u!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof u}\``);return!u.includes("\x1B")&&!u.includes("\x9B")?u:u.replace(te,"")}var Qu=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Hu=12288,Ju=65510,ku=[12288,12288,65281,65376,65504,65510];var Yu=4352,Zu=262141,pu=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101594,101631,101664,101760,101874,101888,102801,102816,102866,110576,110579,110581,110587,110589,110590,110592,110888,110898,110898,110928,110930,110933,110933,110948,110952,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127406,127406,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128729,128732,128735,128747,128748,128756,128764,128986,128986,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129734,129736,129736,129740,129757,129759,129771,129775,129786,131072,196605,196608,262141];var tu=(u,D)=>{let e=0,r=Math.floor(u.length/2)-1;for(;e<=r;){let n=Math.floor((e+r)/2),a=n*2;if(D<u[a])r=n-1;else if(D>u[a+1])e=n+1;else return!0}return!1};var Xu=19968,[ie,se]=oe(pu);function oe(u){let D=u[0],e=u[1];for(let r=0;r<u.length;r+=2){let n=u[r],a=u[r+1];if(Xu>=n&&Xu<=a)return[n,a];a-n>e-D&&(D=n,e=a)}return[D,e]}var uD=u=>u<161||u>1114109?!1:tu(Qu,u),DD=u=>u<Hu||u>Ju?!1:tu(ku,u);var eD=u=>u>=ie&&u<=se?!0:u<Yu||u>Zu?!1:tu(pu,u);function Fe(u){if(!Number.isSafeInteger(u))throw new TypeError(`Expected a code point, got \`${typeof u}\`.`)}function v(u,{ambiguousAsWide:D=!1}={}){return Fe(u),DD(u)||eD(u)||D&&uD(u)?2:1}var nD=cu(gu(),1),ae=new Intl.Segmenter,ce=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function mu(u,D={}){if(typeof u!="string"||u.length===0)return 0;let{ambiguousIsNarrow:e=!0,countAnsiEscapeCodes:r=!1}=D;if(r||(u=R(u)),u.length===0)return 0;let n=0,a={ambiguousAsWide:!e};for(let{segment:l}of ae.segment(u)){let o=l.codePointAt(0);if(!(o<=31||o>=127&&o<=159)&&!(o>=8203&&o<=8207||o===65279)&&!(o>=768&&o<=879||o>=6832&&o<=6911||o>=7616&&o<=7679||o>=8400&&o<=8447||o>=65056&&o<=65071)&&!(o>=55296&&o<=57343)&&!(o>=65024&&o<=65039)&&!ce.test(l)){if((0,nD.default)().test(l)){n+=2;continue}n+=v(o,a)}}return n}var rD=cu(gu(),1),le=new Intl.Segmenter,fe=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function z(u,D={}){if(typeof u!="string"||u.length===0)return 0;let{ambiguousIsNarrow:e=!0,countAnsiEscapeCodes:r=!1}=D;if(r||(u=R(u)),u.length===0)return 0;let n=0,a={ambiguousAsWide:!e};for(let{segment:l}of le.segment(u)){let o=l.codePointAt(0);if(!(o<=31||o>=127&&o<=159)&&!(o>=8203&&o<=8207||o===65279)&&!(o>=768&&o<=879||o>=6832&&o<=6911||o>=7616&&o<=7679||o>=8400&&o<=8447||o>=65056&&o<=65071)&&!(o>=55296&&o<=57343)&&!(o>=65024&&o<=65039)&&!fe.test(l)){if((0,rD.default)().test(l)){n+=2;continue}n+=v(o,a)}}return n}var iD=(u=0)=>D=>`\x1B[${D+u}m`,sD=(u=0)=>D=>`\x1B[${38+u};5;${D}m`,oD=(u=0)=>(D,e,r)=>`\x1B[${38+u};2;${D};${e};${r}m`,m={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},qt=Object.keys(m.modifier),Ee=Object.keys(m.color),Ce=Object.keys(m.bgColor),Kt=[...Ee,...Ce];function de(){let u=new Map;for(let[D,e]of Object.entries(m)){for(let[r,n]of Object.entries(e))m[r]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},e[r]=m[r],u.set(n[0],n[1]);Object.defineProperty(m,D,{value:e,enumerable:!1})}return Object.defineProperty(m,"codes",{value:u,enumerable:!1}),m.color.close="\x1B[39m",m.bgColor.close="\x1B[49m",m.color.ansi=iD(),m.color.ansi256=sD(),m.color.ansi16m=oD(),m.bgColor.ansi=iD(10),m.bgColor.ansi256=sD(10),m.bgColor.ansi16m=oD(10),Object.defineProperties(m,{rgbToAnsi256:{value(D,e,r){return D===e&&e===r?D<8?16:D>248?231:Math.round((D-8)/247*24)+232:16+36*Math.round(D/255*5)+6*Math.round(e/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(D){let e=/[a-f\d]{6}|[a-f\d]{3}/i.exec(D.toString(16));if(!e)return[0,0,0];let[r]=e;r.length===3&&(r=[...r].map(a=>a+a).join(""));let n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:D=>m.rgbToAnsi256(...m.hexToRgb(D)),enumerable:!1},ansi256ToAnsi:{value(D){if(D<8)return 30+D;if(D<16)return 90+(D-8);let e,r,n;if(D>=232)e=((D-232)*10+8)/255,r=e,n=e;else{D-=16;let o=D%36;e=Math.floor(D/36)/5,r=Math.floor(o/6)/5,n=o%6/5}let a=Math.max(e,r,n)*2;if(a===0)return 30;let l=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(e));return a===2&&(l+=60),l},enumerable:!1},rgbToAnsi:{value:(D,e,r)=>m.ansi256ToAnsi(m.rgbToAnsi256(D,e,r)),enumerable:!1},hexToAnsi:{value:D=>m.ansi256ToAnsi(m.hexToAnsi256(D)),enumerable:!1}}),m}var he=de(),FD=he;var ru=new Set(["\x1B","\x9B"]),pe=39,Au="\x07",lD="[",ge="]",fD="m",nu=`${ge}8;;`,aD=u=>`${ru.values().next().value}${lD}${u}${fD}`,cD=u=>`${ru.values().next().value}${nu}${u}${Au}`,me=u=>u.split(" ").map(D=>z(D)),Bu=(u,D,e)=>{let r=[...D],n=!1,a=!1,l=z(R(u.at(-1)));for(let[o,p]of r.entries()){let A=z(p);if(l+A<=e?u[u.length-1]+=p:(u.push(p),l=0),ru.has(p)&&(n=!0,a=r.slice(o+1,o+1+nu.length).join("")===nu),n){a?p===Au&&(n=!1,a=!1):p===fD&&(n=!1);continue}l+=A,l===e&&o<r.length-1&&(u.push(""),l=0)}!l&&u.at(-1).length>0&&u.length>1&&(u[u.length-2]+=u.pop())},Be=u=>{let D=u.split(" "),e=D.length;for(;e>0&&!(z(D[e-1])>0);)e--;return e===D.length?u:D.slice(0,e).join(" ")+D.slice(e).join("")},Ae=(u,D,e={})=>{if(e.trim!==!1&&u.trim()==="")return"";let r="",n,a,l=me(u),o=[""];for(let[b,O]of u.split(" ").entries()){e.trim!==!1&&(o[o.length-1]=o.at(-1).trimStart());let y=z(o.at(-1));if(b!==0&&(y>=D&&(e.wordWrap===!1||e.trim===!1)&&(o.push(""),y=0),(y>0||e.trim===!1)&&(o[o.length-1]+=" ",y++)),e.hard&&l[b]>D){let $=D-y,S=1+Math.floor((l[b]-$-1)/D);Math.floor((l[b]-1)/D)<S&&o.push(""),Bu(o,O,D);continue}if(y+l[b]>D&&y>0&&l[b]>0){if(e.wordWrap===!1&&y<D){Bu(o,O,D);continue}o.push("")}if(y+l[b]>D&&e.wordWrap===!1){Bu(o,O,D);continue}o[o.length-1]+=O}e.trim!==!1&&(o=o.map(b=>Be(b)));let p=o.join(`
7
+ `),A=[...p],B=0;for(let[b,O]of A.entries()){if(r+=O,ru.has(O)){let{groups:$}=new RegExp(`(?:\\${lD}(?<code>\\d+)m|\\${nu}(?<uri>.*)${Au})`).exec(p.slice(B))||{groups:{}};if($.code!==void 0){let S=Number.parseFloat($.code);n=S===pe?void 0:S}else $.uri!==void 0&&(a=$.uri.length===0?void 0:$.uri)}let y=FD.codes.get(Number(n));A[b+1]===`
8
+ `?(a&&(r+=cD("")),n&&y&&(r+=aD(y))):O===`
9
+ `&&(n&&y&&(r+=aD(n)),a&&(r+=cD(a))),B+=O.length}return r};function bu(u,D,e){return String(u).normalize().replaceAll(`\r
10
+ `,`
11
+ `).split(`
12
+ `).map(r=>Ae(r,D,e)).join(`
13
+ `)}function xu(u){return Vu(u,{stringWidth:mu,stripAnsi:R,wrap:bu})}import{dirname as ED,resolve as CD}from"path";import{readdirSync as be,statSync as xe}from"fs";function dD(u,D){let e=CD(".",u),r;for(xe(e).isDirectory()||(e=ED(e));;){if(r=D(e,be(e)),r)return CD(e,r);if(e=ED(r=e),r===e)break}}import{inspect as Ue}from"util";import{fileURLToPath as wD}from"url";import{basename as qe,dirname as Ke,extname as Ve,relative as Qe,resolve as _D,join as He}from"path";var ye=new Intl.Segmenter,hD=new RegExp("[^\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Nonspacing_Mark}\\p{Enclosing_Mark}\\p{Surrogate}]","v"),_e=new RegExp("\\p{Spacing_Mark}","v"),we=new RegExp("^\\p{RGI_Emoji}$","v"),Oe=/^[\d#*]\u20E3$/,je=new RegExp("\\p{Extended_Pictographic}","gu");function Se(u){if(u.length>50)return!1;if(Oe.test(u))return!0;if(u.includes("\u200D")){let D=u.match(je);return D!==null&&D.length>=2}return!1}function Ne(u){let D=u.search(hD);return D===-1?void 0:u.slice(D)}function pD(u){return u>=4352&&u<=4447||u>=43360&&u<=43388}function gD(u){return u>=4448&&u<=4519||u>=55216&&u<=55238}function mD(u){return u>=4520&&u<=4607||u>=55243&&u<=55291}function We(u){return pD(u)||gD(u)||mD(u)}function Re(u,D){let e=[];for(let n of u)hD.test(n)&&e.push(n.codePointAt(0));if(e.length===0)return;let r=0;for(let n=0;n<e.length;n++){let a=e[n];if(!We(a)){if(r===0)return;for(let l=n;l<e.length;l++)r+=v(e[l],D);return r}if(pD(a)&&gD(e[n+1])){r+=2,n+=mD(e[n+2])?2:1;continue}r+=v(a,D)}return r}function Le(u,D){let e=0,r=!0;for(let n of u){if(r){r=!1;continue}(_e.test(n)||n>="\uFF00"&&n<="\uFFEF")&&(e+=v(n.codePointAt(0),D))}return e}function yu(u,D={}){if(typeof u!="string"||u.length===0)return 0;let{ambiguousIsNarrow:e=!0,countAnsiEscapeCodes:r=!1}=D,n=u;if(!r&&(n.includes("\x1B")||n.includes("\x9B"))&&(n=R(n)),n.length===0)return 0;if(/^[\u0020-\u007E]*$/.test(n))return n.length;let a=0,l={ambiguousAsWide:!e};for(let{segment:o}of ye.segment(n)){let p=Ne(o);if(p===void 0)continue;if(we.test(o)||Se(o)){a+=2;continue}let A=Re(p,l);if(A!==void 0){a+=A;continue}let B=p.codePointAt(0);a+=v(B,l),a+=Le(p,l)}return a}import{readFileSync as $e,statSync as Te,writeFile as Me}from"fs";import{format as Ie}from"util";import{resolve as ve}from"path";var BD={fs:{readFileSync:$e,writeFile:Me},format:Ie,resolve:ve,exists:u=>{try{return Te(u).isFile()}catch{return!1}}};var L,_u=class{constructor(D){D=D||{},this.directory=D.directory||"./locales",this.updateFiles=typeof D.updateFiles=="boolean"?D.updateFiles:!0,this.locale=D.locale||"en",this.fallbackToLanguage=typeof D.fallbackToLanguage=="boolean"?D.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...D){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let e=D.shift(),r=function(){};return typeof D[D.length-1]=="function"&&(r=D.pop()),r=r||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]=e,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:r})):r(),L.format.apply(L.format,[this.cache[this.locale][e]||e].concat(D))}__n(){let D=Array.prototype.slice.call(arguments),e=D.shift(),r=D.shift(),n=D.shift(),a=function(){};typeof D[D.length-1]=="function"&&(a=D.pop()),this.cache[this.locale]||this._readLocaleFile();let l=n===1?e:r;this.cache[this.locale][e]&&(l=this.cache[this.locale][e][n===1?"one":"other"]),!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]={one:e,other:r},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:a})):a();let o=[l];return~l.indexOf("%d")&&o.push(n),L.format.apply(L.format,o.concat(D))}setLocale(D){this.locale=D}getLocale(){return this.locale}updateLocale(D){this.cache[this.locale]||this._readLocaleFile();for(let e in D)Object.prototype.hasOwnProperty.call(D,e)&&(this.cache[this.locale][e]=D[e])}_taggedLiteral(D,...e){let r="";return D.forEach(function(n,a){let l=e[a+1];r+=n,typeof l<"u"&&(r+="%s")}),this.__.apply(this,[r].concat([].slice.call(e,1)))}_enqueueWrite(D){this.writeQueue.push(D),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let D=this,e=this.writeQueue[0],r=e.directory,n=e.locale,a=e.cb,l=this._resolveLocaleFile(r,n),o=JSON.stringify(this.cache[n],null,2);L.fs.writeFile(l,o,"utf-8",function(p){D.writeQueue.shift(),D.writeQueue.length>0&&D._processWriteQueue(),a(p)})}_readLocaleFile(){let D={},e=this._resolveLocaleFile(this.directory,this.locale);try{L.fs.readFileSync&&(D=JSON.parse(L.fs.readFileSync(e,"utf-8")))}catch(r){if(r instanceof SyntaxError&&(r.message="syntax error in "+e),r.code==="ENOENT")D={};else throw r}this.cache[this.locale]=D}_resolveLocaleFile(D,e){let r=L.resolve(D,"./",e+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(r)&&~e.lastIndexOf("_")){let n=L.resolve(D,"./",e.split("_")[0]+".json");this._fileExistsSync(n)&&(r=n)}return r}_fileExistsSync(D){return L.exists(D)}};function AD(u,D){L=D;let e=new _u(u);return{__:e.__.bind(e),__n:e.__n.bind(e),setLocale:e.setLocale.bind(e),getLocale:e.getLocale.bind(e),updateLocale:e.updateLocale.bind(e),locale:e.locale}}var Pe=u=>AD(u,BD),bD=Pe;var OD=cu(yD(),1);import{createRequire as Je}from"node:module";import{readFileSync as ke,readdirSync as Ye}from"node:fs";var wu=wD(import.meta.url),Ze=wu.substring(0,wu.lastIndexOf("node_modules")),Xe=Je(import.meta.url),Sn={assert:{notStrictEqual:ze,strictEqual:Ge},cliui:xu,findUp:dD,getEnv:u=>process.env[u],inspect:Ue,getProcessArgvBin:qu,mainFilename:Ze||process.cwd(),Parser:Gu,path:{basename:qe,dirname:Ke,extname:Ve,relative:Qe,resolve:_D,join:He},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(u,D)=>process.emitWarning(u,D),execPath:()=>process.execPath,exit:u=>{process.exit(u)},nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:ke,readdirSync:Ye,require:Xe,getCallerFile:()=>{let u=(0,OD.default)(3);return u.match(/^file:\/\//)?wD(u):u},stringWidth:yu,y18n:bD({directory:_D(wu,"../../../locales"),updateFiles:!1})};var iu=class u extends Error{constructor(D){super(D||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,u)}};var Ou=[],V;function ut(u,D,e,r){V=r;let n={};if(Object.prototype.hasOwnProperty.call(u,"extends")){if(typeof u.extends!="string")return n;let a=/\.json|\..*rc$/.test(u.extends),l=null;if(a)l=et(D,u.extends);else try{l=import.meta.resolve(u.extends)}catch{return u}Dt(l),Ou.push(l),n=a?JSON.parse(V.readFileSync(l,"utf8")):r.require(u.extends),delete u.extends,n=ut(n,V.path.dirname(l),e,V)}return Ou=[],e?jD(n,u):Object.assign({},n,u)}function Dt(u){if(Ou.indexOf(u)>-1)throw new iu(`Circular extended configurations: '${u}'.`)}function et(u,D){return V.path.resolve(u,D)}function jD(u,D){let e={};function r(n){return n&&typeof n=="object"&&!Array.isArray(n)}Object.assign(e,u);for(let n of Object.keys(D))n!=="__proto__"&&(r(D[n])&&r(e[n])?e[n]=jD(u[n],D[n]):e[n]=D[n]);return e}export{Gu as a,ht as b,Sn as c,iu as d,ut as e};
@@ -0,0 +1,6 @@
1
+ import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
2
+ import{b as O}from"./chunk-E7LWZRXY.mjs";import{a as M}from"./chunk-L3QKH4OK.mjs";var b=3e4,j=12e4,k=1500,S=1e4,W=h=>h.reduce((a,{key:c,tag:r})=>a.set(`${c}
3
+ ${r}`,(a.get(`${c}
4
+ ${r}`)??0)+1),new Map);function U({now:h=Date.now,hold:a=b,limit:c=j,quiet:r=k}={}){let i=new Map,l=new Map,w=new Map,$=new Map,p=new Map;return{wrote(t,e){$.set(t,M(e))},judge(t,{source:e,mtime:m}){if(e===null)return i.delete(t),w.delete(t),{held:!1,signs:[],wait:0,own:!1};let d=M(e),n=p.get(t)?.hash===d?p.get(t).signs:null;n||(n=O(e),p.set(t,{hash:d,signs:n}));let f=h(),x=(o,s=!1)=>(i.delete(t),l.set(t,W(n)),w.set(t,e),{held:!1,signs:[],wait:o,own:s});if($.get(t)===d)return x(0,!0);let g=l.get(t)??new Map,I=W(n);if([...I].some(([o,s])=>s>(g.get(o)??0))){let o=Math.min(m,f),s=i.get(t)??o;i.set(t,s);let T=Math.min(a-(f-o),c-(f-s));if(T>0)return{held:!0,signs:n.filter(({key:D,tag:L})=>I.get(`${D}
5
+ ${L}`)>(g.get(`${D}
6
+ ${L}`)??0)),wait:T,own:!1,taken:w.get(t)}}return x(Math.min(r,Math.max(0,r-(f-m))))}}}export{b as a,j as b,k as c,S as d,U as e};
@@ -0,0 +1,3 @@
1
+ import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
2
+ import"./chunk-5L7RYZCL.mjs";var re="file",fe="link",ue="symlink",Q="directory",Xe={file:"0",link:"1",symlink:"2","character-device":"3","block-device":"4",directory:"5",fifo:"6","pax-header":"x","pax-global-header":"g","gnu-long-name":"L","gnu-long-link-name":"K"},Ze={0:re,1:fe,2:ue,3:"character-device",4:"block-device",5:Q,6:"fifo",x:"pax-header",g:"pax-global-header",L:"gnu-long-name",K:"gnu-long-link-name"},Ge=new Uint8Array(512),he=new Uint8Array(0),ie=new TextEncoder,ye=new TextDecoder;function te(e,t,n,i){if(i)for(let r=0;r<i.length&&r<n;r++){let s=i.charCodeAt(r);if(s>127){ie.encodeInto(i,e.subarray(t,t+n));return}e[t+r]=s}}function le(e,t,n,i){if(i===void 0)return;let r=i;for(let s=t+n-2;s>=t;s--)e[s]=48+r%8,r=Math.floor(r/8);r===0&&i%1===0||ie.encodeInto(i.toString(8).padStart(n-1,"0"),e.subarray(t,t+n-1))}function J(e,t,n){if(e[t]===0)return"";let i=e.indexOf(0,t),r=i===-1||i>t+n?t+n:i;return ye.decode(e.subarray(t,r))}function Te(e,t,n){let i=0,r=t+n;for(let s=t;s<r;s++){let c=e[s];if(c===0)break;c!==32&&(i=i*8+(c-48))}return i}function me(e,t,n){if(e[t]&128){let i=0;i=e[t]&127;for(let r=1;r<n;r++)i=i*256+e[t+r];if(!Number.isSafeInteger(i))throw new Error("TAR number too large");return i}return Te(e,t,n)}var ze=e=>e.type==="directory"||e.type==="symlink"||e.type==="link"||e.type==="character-device"||e.type==="block-device"||e.type==="fifo";async function Ce(e){if(e==null)return he;if(e instanceof Uint8Array)return e;if(typeof e=="string")return ie.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(e instanceof Blob)return new Uint8Array(await e.arrayBuffer());throw new TypeError("Unsupported content type for entry body.")}var Ie=(e,t)=>{let n=e.split("/").filter(Boolean);return t>=n.length?"":n.slice(t).join("/")};function De(e,t){let{strip:n,filter:i,map:r}=t;if(!n&&!i&&!r)return e;let s={...e};if(n&&n>0){let a=Ie(s.name,n);if(!a)return null;if(s.name=s.type==="directory"&&!a.endsWith("/")?`${a}/`:a,s.linkname){let d=s.linkname.startsWith("/");if(d||s.type==="link"){let h=Ie(s.linkname,n);s.linkname=d?`/${h}`||"/":h}}}if(i?.(s)===!1)return null;let c=r?r(s):s;return c&&(!c.name?.trim()||c.name==="."||c.name==="/")?null:c}var Se=256;function qe(){let e=new Array(Se),t=e.length-1,n=0,i=0,r=0,s=a=>{let d=e[n];a===d.length?(e[n]=he,n=n+1&t):e[n]=d.subarray(a),r-=a,r===0&&e.length>Se&&(e=new Array(Se),t=255,n=0,i=0)};function c(a,d){if(d){let E=0,o=Math.min(a,r);for(;o>0;){let m=e[n],f=Math.min(o,m.length),l=f===m.length?m:m.subarray(0,f);if(s(f),o-=f,E+=f,!d(l))break}return E}if(r<a)return null;if(a===0)return he;let h=e[n];if(h.length>=a){let E=h.length===a?h:h.subarray(0,a);return s(a),E}let v=new Uint8Array(a),w=0,T=a;for(;T>0;){let E=e[n],o=Math.min(T,E.length);v.set(o===E.length?E:E.subarray(0,o),w),w+=o,T-=o,s(o)}return v}return{push:a=>{if(a.length===0)return;let d=i+1&t;if(d===n){let h=e.length,v=h*2,w=new Array(v),T=i-n+h&h-1;if(n<i)for(let E=0;E<T;E++)w[E]=e[n+E];else{let E=h-n;for(let o=0;o<E;o++)w[o]=e[n+o];for(let o=0;o<i;o++)w[E+o]=e[o]}e=w,t=v-1,n=0,i=T,d=i+1&t}e[i]=a,i=d,r+=a.length},available:()=>r,peek:a=>{if(r<a)return null;if(a===0)return he;let d=e[n];if(d.length>=a)return d.length===a?d:d.subarray(0,a);let h=new Uint8Array(a),v=0,w=n;for(;v<a;){let T=e[w],E=Math.min(a-v,T.length);E===T.length?h.set(T,v):h.set(T.subarray(0,E),v),v+=E,w=w+1&t}return h},discard:a=>{if(a>r)throw new Error("Too many bytes consumed");if(a===0)return;let d=a;for(;d>0;){let h=e[n],v=Math.min(d,h.length);s(v),d-=v}},pull:c}}var ve=32,Je=48;function Qe(e){let t=Te(e,148,8),n=0;for(let i=0;i<e.length;i++)i>=148&&i<156?n+=ve:n+=e[i];return t===n}function Ve(e){e.fill(ve,148,156);let t=0;for(let n=e.length;n>0;)t+=e[--n];for(let n=153;n>=148;n--)e[n]=(t&7)+Je,t>>=3;e[154]=0,e[155]=ve}var je=256,et=/[^\x00-\x7f]/;function ne(e,t){return e.length*3<=t?!1:e.length>t?!0:et.test(e)?ie.encode(e).length>t:!1}function tt(e){let t={};ne(e.name,100)&&be(e.name)===null&&(t.path=e.name),e.linkname&&ne(e.linkname,100)&&(t.linkpath=e.linkname),e.uname&&ne(e.uname,32)&&(t.uname=e.uname),e.gname&&ne(e.gname,32)&&(t.gname=e.gname),e.uid!=null&&e.uid>2097151&&(t.uid=String(e.uid)),e.gid!=null&&e.gid>2097151&&(t.gid=String(e.gid)),e.size!=null&&e.size>8589934591&&(t.size=String(e.size)),e.pax&&Object.assign(t,e.pax);let n=Object.entries(t);if(n.length===0)return null;let i=ie.encode(n.map(([r,s])=>{let c=`${r}=${s}
3
+ `,a=ie.encode(c).length+1,d=a+String(a).length;return d=a+String(d).length,`${d} ${c}`}).join(""));return{paxHeader:Be({name:ye.decode(ie.encode(`PaxHeader/${e.name}`).slice(0,100)),size:i.length,type:"pax-header",mode:420,mtime:e.mtime,uname:e.uname,gname:e.gname,uid:e.uid,gid:e.gid}),paxBody:i}}function be(e){if(!ne(e,100)||ne(e,je))return null;for(let t=e.length-1;t>0;t--){if(e[t]!=="/")continue;let n=e.slice(0,t),i=e.slice(t+1);if(!ne(n,155)&&!ne(i,100))return{prefix:n,name:i}}return null}function Be(e){let t=new Uint8Array(512),n=ze(e)?0:e.size??0,i=e.name,r="";if(!e.pax?.path){let s=be(i);s&&(i=s.name,r=s.prefix)}return te(t,0,100,i),le(t,100,8,e.mode??(e.type==="directory"?493:420)),le(t,108,8,e.uid??0),le(t,116,8,e.gid??0),le(t,124,12,n),le(t,136,12,Math.floor((e.mtime?.getTime()??Date.now())/1e3)),te(t,156,1,Xe[e.type??"file"]),te(t,157,100,e.linkname),te(t,257,6,"ustar\0"),te(t,263,2,"00"),te(t,265,32,e.uname),te(t,297,32,e.gname),te(t,345,155,r),Ve(t),t}function nt(e,t){if(t&&!Qe(e))throw new Error("Invalid tar header checksum.");let n=J(e,156,1),i={name:J(e,0,100),mode:Te(e,100,8),uid:me(e,108,8),gid:me(e,116,8),size:me(e,124,12),mtime:new Date(me(e,136,12)*1e3),type:Ze[n]||"file",linkname:J(e,157,100)},r=J(e,257,6);return r.trim()==="ustar"&&(i.uname=J(e,265,32),i.gname=J(e,297,32)),r==="ustar"&&(i.prefix=J(e,345,155)),i}var Oe={path:["name",e=>e],linkpath:["linkname",e=>e],size:["size",e=>/^\d+$/.test(e)&&Number.isSafeInteger(+e)?+e:NaN],mtime:["mtime",parseFloat],uid:["uid",e=>parseInt(e,10)],gid:["gid",e=>parseInt(e,10)],uname:["uname",e=>e],gname:["gname",e=>e]};function rt(e){let t=Object.create(null),n=Object.create(null),i=!1,r=0;for(;r<e.length;){let s=e.indexOf(32,r);if(s===-1)break;let c=parseInt(ye.decode(e.subarray(r,s)),10);if(!(c>0))break;let a=r+c,d=ye.decode(e.subarray(s+1,a-1)),h=d.indexOf("=");if(h>0){let v=d.slice(0,h),w=d.slice(h+1);if(n[v]=w,i=!0,Object.hasOwn(Oe,v)){let[T,E]=Oe[v],o=E(w);(typeof o=="string"||!Number.isNaN(o))&&(t[T]=o)}}r=a}return i&&(t.pax=n),t}function Pe(e,t){t.name!==void 0&&(e.name=t.name),t.linkname!==void 0&&(e.linkname=t.linkname),t.size!==void 0&&(e.size=t.size),t.mtime!==void 0&&(e.mtime=new Date(t.mtime*1e3)),t.uid!==void 0&&(e.uid=t.uid),t.gid!==void 0&&(e.gid=t.gid),t.uname!==void 0&&(e.uname=t.uname),t.gname!==void 0&&(e.gname=t.gname),t.pax&&(e.pax=Object.assign({},e.pax??{},t.pax))}function it(e){switch(e){case"pax-global-header":case"pax-header":return rt;case"gnu-long-name":return t=>({name:J(t,0,t.length)});case"gnu-long-link-name":return t=>({linkname:J(t,0,t.length)});default:return}}function at(e){let t=Be(e),n=tt(e);if(!n)return[t];let i=-n.paxBody.length&511,r=i>0?[Ge.subarray(0,i)]:[];return[n.paxHeader,n.paxBody,...r,t]}var xe=0,ce=1,st=8388608,pe=new Error("Tar archive is truncated.");function Le(e={}){let t=e.strict??!1,{available:n,peek:i,push:r,discard:s,pull:c}=qe(),a=xe,d=!1,h=!1,v=!1,w=null,T={},E={},o={isEntryActive:()=>a===ce,isBodyComplete:()=>!w||w.remaining===0,canFinish:()=>!w||n()>=w.remaining+w.padding,bodyBytes:()=>w&&w.remaining>0?Math.min(w.remaining,n()):0,available:n,write(m){if(d)throw new Error("Archive already ended.");r(m)},end(){d=!0},readHeader(){if(a!==xe)throw new Error("Cannot read header while an entry is active");if(!h)for(;!h;){if(n()<512){if(d){if(n()>0&&t)throw pe;h=!0;return}return null}let m=i(512);if(Ne(m)){if(n()<1024){if(d){if(t)throw pe;h=!0;return}return null}if(Ne(i(1024).subarray(512))){s(1024),h=!0,v=!0;return}if(t)throw new Error("Invalid tar header.");s(512);continue}let f;try{f=nt(m,t)}catch(I){if(t)throw I;s(512);continue}let l=it(f.type);if(l){if(f.size>st)throw new Error("Tar metadata entry exceeds maximum size.");let I=f.size+(-f.size&511);if(n()<512+I){if(d&&t)throw pe;return null}s(512);let O=l(c(I).subarray(0,f.size));E.pax&&(E={});let z=f.type==="pax-global-header"?T:E;for(let A in O)z[A]=O[A];continue}s(512);let u=f;f.prefix&&(u.name=`${f.prefix}/${u.name}`),Pe(u,T),Pe(u,E);let k=u.size;return ze(u)?(k=0,u.size=0):u.name.endsWith("/")&&u.type==="file"&&(u.type=Q,u.size=0),E={},w={header:u,remaining:k,padding:-k&511},a=ce,u}},streamBody(m){if(a!==ce||!w||w.remaining===0)return 0;let f=Math.min(w.remaining,n());if(f===0)return 0;let l=c(f,m);return w.remaining-=l,l},skipPadding(){if(a!==ce||!w)return!0;if(w.remaining>0)throw new Error("Body not fully consumed");return n()<w.padding?!1:(s(w.padding),w=null,a=xe,!0)},skipEntry(){if(a!==ce||!w)return!0;let m=Math.min(w.remaining,n());return m>0&&(s(m),w.remaining-=m),w.remaining>0?!1:o.skipPadding()},validateEOF(){if(t){if(!v)throw pe;if(n()>0&&c(n()).some(m=>m!==0))throw new Error("Invalid EOF.")}}};return o}function Ne(e){if(e[0]!==0)return!1;if(e.byteOffset%8===0){let t=new BigUint64Array(e.buffer,e.byteOffset,e.length/8);for(let n=0;n<t.length;n++)if(t[n]!==0n)return!1;return!0}for(let t=0;t<e.length;t++)if(e[t]!==0)return!1;return!0}var ot=new Uint8Array(1024);function $e(e){let t=null,n=0,i=!1,r=s=>{throw new Error(s)};return{add(s){i&&r("No new tar entries after finalize."),t!==null&&r("Previous entry must be completed before adding a new one");let c=ze(s)?0:s.size;(!Number.isSafeInteger(c)||c<0)&&r("Invalid tar entry size.");let a=at({...s,size:c});for(let d of a)e(d);t={...s,size:c},n=0},write(s){t||r("No active tar entry."),i&&r("Cannot write data after finalize.");let c=n+s.length;c>t.size&&r(`"${t.name}" exceeds given size of ${t.size} bytes.`),n=c,e(s)},endEntry(){t||r("No active entry to end."),i&&r("Cannot end entry after finalize."),n!==t.size&&r(`Size mismatch for "${t.name}".`);let s=-t.size&511;s>0&&e(new Uint8Array(s)),t=null,n=0},finalize(){i&&r("Archive has already been finalized"),t!==null&&r("Cannot finalize while an entry is still active"),e(ot),i=!0}}}import*as C from"node:fs";import*as y from"node:fs/promises";import{cpus as Ye}from"node:os";import*as S from"node:path";import{Readable as se,Writable as lt}from"node:stream";function V(e,t,n){let i=S.resolve(e),r=S.resolve(t);if(i!==r&&!i.startsWith(r+S.sep))throw new Error(n)}var ct={":":"\uF03A","<":"\uF03C",">":"\uF03E","|":"\uF07C","?":"\uF03F","*":"\uF02A",'"':"\uF022"},ft=/\/\/|(?:^|\/)\.(?:\/|$)/;function Ke(e){let t=e.replace(/\\/g,"/");if(t.split("/").includes("..")||/^[a-zA-Z]:\.\./.test(t))throw new Error(`${e} points outside extraction directory`);let n=t;return/^[a-zA-Z]:/.test(n)?n=n.replace(/^[a-zA-Z]:[/\\]?/,""):n.startsWith("/")&&(n=n.replace(/^\/+/,"")),process.platform==="win32"?n.replace(/[<>:"|?*]/g,i=>ct[i]):n}var ut=e=>{let t=Ke(e.replace(/[\\/]+$/,""));return ft.test(t)?S.posix.normalize(t):t},ae={bigint:!0},_e={withFileTypes:!0},xt=dt;function dt(e,t={}){let n=new Map,i=new Map,r=new Set,s=null,c=null,a=null,d,h=()=>{let l=s;s=null,c=null,l?.()},v=()=>{a?.(),a=null},w=(l,u)=>{r.delete(l),l.destroy(u)},T=l=>{let u=i.get(l);if(u!==null)return u;let k=l.close().finally(()=>i.delete(l));return i.set(l,k),k},E=async l=>{for(let k of r)w(k,l);let u=Promise.allSettled([...i.keys()].map(T));n.clear(),v();for(let k of await u)if(k.status==="rejected")throw k.reason},o=new se({highWaterMark:8388608,read:h,destroy(l,u){d=l??AbortSignal.abort().reason,h(),E(d).then(()=>u(l),k=>u(l??k))}}),m=l=>o.destroy(l),f=$e(l=>{if(o.destroyed)throw d;!o.push(Buffer.from(l))&&!c&&(c=new Promise(u=>{s=u}))});return(async()=>{let{dereference:l=!1,filter:u,map:k,baseDir:I,concurrency:O=Ye().length||8}=t,z,A,P;if(typeof e=="string"){let p=S.resolve(e);z=p;let U=await y.stat(p,ae);if(o.destroyed)return;let x=await y.readdir(p,_e);if(o.destroyed)return;let W=await y.stat(p,ae);if(o.destroyed)return;P=U.dev===W.dev&&U.ino===W.ino?x.map(_=>({type:_.isDirectory()?Q:re,source:S.join(p,_.name),target:_.name})):[]}else P=e.map(p=>({...p}));let b=new Map,N=0,F=0,$=0,g=!1,B=async p=>{try{for await(let U of p){if(o.destroyed)return;f.write(U instanceof Uint8Array?U:Buffer.from(U)),c&&await c}}finally{p.off("error",m),r.delete(p)}},D=async()=>{let p=Buffer.alloc(65536),U=null;for(;;){if(o.destroyed)return;if(g&&F>=P.length)break;if(!n.has(F)){await new Promise(W=>{a=W});continue}let x=n.get(F);if(n.delete(F),!x){F++,X();continue}if(x.hardlinkId){let W=x.header.name,_=b.get(x.hardlinkId);_&&(x.body&&!(x.body instanceof Uint8Array)&&!(x.body instanceof se)&&await T(x.body.handle),x.body=void 0,x.header.type=fe,x.header.linkname=_.originalName,x.header.size=0),k&&(x.header=k(x.header)),_?x.header.linkname===_.originalName&&(x.header.linkname=_.mappedName):b.set(x.hardlinkId,{originalName:W,mappedName:x.header.name})}if(f.add(x.header),c&&await c,o.destroyed)return;if(x.body)if(x.body instanceof Uint8Array)x.body.length>0&&(f.write(x.body),c&&await c);else if(x.body instanceof se)await B(x.body);else{let{handle:W,size:_}=x.body,L=_>1048576?U??=Buffer.alloc(1048576):p;try{let H=_;for(;H>0&&!o.destroyed;){let{bytesRead:ee}=await W.read(L,0,Math.min(H,L.length),null);if(ee===0)break;f.write(L.subarray(0,ee)),H-=ee,c&&await c}}finally{await T(W)}}if(o.destroyed)return;f.endEntry(),c&&await c,F++,X()}},X=()=>{if(!(o.destroyed||g)){for(;$<O&&N<P.length&&N-F<O;){$++;let p=N++;G(P[p],p).catch(m).finally(()=>{$--,X()})}$===0&&N>=P.length&&(g=!0,v())}},G=async(p,U)=>{let x=null,W=Ke(p.target);try{if(p.type==="content"||p.type==="stream"){let M,Y,R=W.endsWith("/");if(p.type==="stream"){if(!R&&p.size<=0||R&&p.size!==0)throw new Error(R?"Streams for directories must have size 0.":"Streams require a positive size.");Y=p.size}else{let oe=await Ce(p.content);Y=oe.length,M=oe}let K={size:R?0:Y,isFile:()=>!R,isDirectory:()=>R,isSymbolicLink:()=>!1,mode:p.mode,mtime:p.mtime??new Date,uid:p.uid??0,gid:p.gid??0};if(o.destroyed||u&&!u(W,K)||o.destroyed)return;let Z={name:W,type:R?Q:re,size:R?0:Y,mode:K.mode,mtime:K.mtime,uid:K.uid,gid:K.gid,uname:p.uname,gname:p.gname};if(k&&(Z=k(Z)),o.destroyed)return;!R&&p.type==="stream"&&(M=p.content instanceof se?p.content:se.fromWeb(p.content),M.once("error",m),r.add(M)),x={header:Z,body:R?void 0:M};return}let _=p.source,L=await y.lstat(_,ae);if(o.destroyed)return;if(l&&L.isSymbolicLink()){if(_=await y.realpath(_),o.destroyed||(A??=await y.realpath(I??z??process.cwd()),o.destroyed))return;let M=S.relative(A,_);if(M===".."||M.startsWith(".."+S.sep)||S.isAbsolute(M)||(L=await y.lstat(_,ae),L.isSymbolicLink()))return}if(o.destroyed||u&&!u(p.source,L)||o.destroyed)return;let H={name:W,size:0,mode:(p.mode??Number(L.mode))&4095,mtime:p.mtime===void 0?L.mtime:new Date(p.mtime.getTime()),uid:p.uid??Number(L.uid),gid:p.gid??Number(L.gid),uname:p.uname,gname:p.gname,type:re},ee,Ee;if(L.isDirectory()){H.type=Q,H.name=W.endsWith("/")?W:`${W}/`;try{let M=await y.readdir(_,_e);if(o.destroyed)return;let Y=await y.lstat(_,ae);if(o.destroyed||!Y.isDirectory()||L.dev!==Y.dev||L.ino!==Y.ino)return;for(let R of M)P.push({type:R.isDirectory()?Q:re,source:S.join(_,R.name),target:`${H.name}${R.name}`,mtime:p.mtime,uid:p.uid,gid:p.gid,uname:p.uname,gname:p.gname,mode:p.mode})}catch(M){let Y=M.code;if(Y!=="ENOENT"&&Y!=="ENOTDIR")throw M}}else if(L.isSymbolicLink())H.type=ue,H.linkname=await y.readlink(p.source);else if(L.isFile()){H.size=Number(L.size);let M;L.nlink>1n&&(process.platform!=="win32"||L.dev!==0n&&L.ino!==-1n)&&(Ee=`${L.dev}:${L.ino}`);try{let Y;try{H.size===0?Y=await y.lstat(_,ae):(M=await y.open(_,C.constants.O_NOFOLLOW??0),i.set(M,null))}catch(R){let K=R.code;if(K==="ELOOP"||K==="ENOENT")return;throw R}if(o.destroyed)return;if(Y){if(!Y.isFile()||L.dev!==Y.dev||L.ino!==Y.ino)return}else{let{dev:R,ino:K}=await M.stat(ae);if(o.destroyed||L.dev!==R||L.ino!==K)return}if(H.size>0){let R=M;if(H.size<32768){let K=Buffer.allocUnsafe(H.size),Z=0;for(;Z<K.length&&!o.destroyed;){let{bytesRead:oe}=await R.read(K,Z,K.length-Z,Z);if(oe===0)break;Z+=oe}ee=Z===K.length?K:K.subarray(0,Z)}else ee={handle:R,size:H.size},M=void 0}}finally{M&&await T(M)}}else return;if(o.destroyed)return;Ee?x={header:H,body:ee,hardlinkId:Ee}:(k&&(H=k(H)),x={header:H,body:ee})}finally{o.destroyed?x?.body instanceof se?w(x.body,d):x?.body&&!(x.body instanceof Uint8Array)&&await T(x.body.handle):(n.set(U,x),U===F&&v())}};X(),await D(),o.destroyed||(f.finalize(),o.push(null))})().catch(m),o}var mt=e=>{let t=0,n=[],i=0,r=null,s=null,c=()=>r??=new Promise(d=>s=d),a=()=>{for(;t<e&&i<n.length;){let d=n[i++];t++,d().finally(()=>{t--,a()})}i===n.length&&(n.length=0,i=0,t===0&&s&&(s(),r=null,s=null))};return{add(d){let h=t===0&&i===n.length;return new Promise((v,w)=>{n.push(()=>Promise.resolve().then(d).then(v,w)),h&&c(),a()})},onIdle(){return t===0&&i===n.length?Promise.resolve():c()}}},Fe=262144,Ae=8388608,we=1024,Me=C.constants.O_WRONLY|C.constants.O_CREAT|C.constants.O_TRUNC|(C.constants.O_NOFOLLOW??0)|C.constants.O_EXCL,ge=1,j=2,de=3,Re=4,He=Promise.resolve(),Ue=e=>C.ftruncate(e,0,()=>C.close(e));function pt(e,{mode:t=438,mtime:n}={},i){let r=ge,s=!1,c=null,a=[],d=[],h=0,v=null,w=null,T=null,E=null,o=null,m=null,f=null,l=null,u=g=>{if(!m)return;let B=f,D=l;m=null,f=null,l=null,g?D?.(g):B?.()},k=()=>{h=0,a.length=0,d.length=0},I=()=>{r!==Re&&(r=de,E?.(),u())},O=g=>{if(v)return;v=g,r=Re;let B=s;k();let D=c;c=null,D!==null&&(B?w=D:Ue(D)),s=!1,o?o(g):i?.(g),u(g)},z=()=>{if(c===null){I();return}let g=c;c=null,n?C.futimes(g,n,n,B=>{if(r!==j){C.close(g);return}if(B){C.close(g,()=>O(B));return}C.close(g,D=>{r===j&&(D?O(D):I())})}):C.close(g,B=>{r===j&&(B?O(B):I())})},A=()=>{if(s||a.length===0||r!==j)return;s=!0;let g=a;a=d,d=g,a.length=0;let B=h,D=(X,G=0)=>{if(r!==j){if(w!==null){let p=w;w=null,Ue(p)}return}if(X){s=!1,O(X);return}if(G<=0||G>B){s=!1,O(new Error("File write made no progress."));return}if(h-=G,B-=G,B>0){let p=G,U=0;for(;p>=g[U].length;)p-=g[U++].length;if(g=g.slice(U),p>0&&(g[0]=g[0].subarray(p)),g.length===1){let x=g[0];C.write(c,x,0,x.length,null,D)}else C.writev(c,g,D);return}s=!1,d.length=0,h<Ae&&u(),a.length>0?A():E&&z()};if(g.length===1){let X=g[0];C.write(c,X,0,X.length,null,D)}else C.writev(c,g,D)},P=(g,B)=>{if(g)return O(g);if(r>=de){C.close(B);return}c=B,r=j,E?a.length>0?A():z():h>=Fe||a.length>=we?A():u()},b=g=>r>=de||E?!1:(a.push(g),h+=g.length,r===j&&!s&&(h>=Fe||a.length>=we)&&A(),h<Ae&&a.length<we),N=()=>v?Promise.reject(v):r===ge||r===j&&(h>=Ae||a.length>=we)?m??=new Promise((g,B)=>{f=g,l=B}):He,F=()=>v?Promise.reject(v):r>=de?He:T||(T=new Promise((g,B)=>{E=g,o=B,r===j&&!s&&(a.length>0?A():z())}),T),$=g=>{if(g){O(g);return}if(!(r>=de)){if(k(),s=!1,c!==null){let B=c;c=null,C.close(B)}I()}};return C.open(e,Me,t,(g,B)=>{if(g?.code!=="EEXIST")return P(g,B);r===ge&&C.rm(e,{force:!0},D=>{if(D)return O(D);r===ge&&C.open(e,Me,t,P)})}),{write:b,end:F,destroy:$,waitDrain:N}}var We=()=>{let e=new Map;return{get(t){let n=e.get(t);return e.delete(t)&&e.set(t,n),n},set(t,n){e.set(t,n).size>1e4&&e.delete(e.keys().next().value)},clear(){e.clear()}}},q="ENOENT",ht=64,yt=process.platform==="win32"?/[/\\]/:"/",ke=e=>e.split(yt).filter(t=>t&&t!=="."),wt=(e,t,n,i)=>{let{maxDepth:r=1024,dmode:s}=t,c=We(),a=new Map,d=[],h,v=We(),T=(async m=>{let f=S.resolve(m);try{await y.mkdir(f,{recursive:!0})}catch(l){if(l.code===q){let u=S.dirname(f);if(u===f)throw l;await y.mkdir(u,{recursive:!0}),await y.mkdir(f,{recursive:!0})}else throw l}try{return{symbolic:f,real:await y.realpath(f)}}catch(l){if(l.code===q)return{symbolic:f,real:f};throw l}})(e);T.catch(()=>{});let E=async(m,f)=>{let l=await T;if(m===l.symbolic)return l.real;let u=v.get(m);return u||(u=y.realpath(m).then(k=>(V(k,l.real,f),k)),v.set(m,u)),u},o=async(m,f)=>{let l=c.get(m);return l||(l=(async()=>{if(m!==(await T).symbolic){await o(S.dirname(m));try{let u=await y.lstat(m);if(u.isDirectory())return;if(u.isSymbolicLink())try{let k=await E(m,`Symlink "${m}" points outside the extraction directory.`);if((await y.stat(k)).isDirectory())return}catch(k){throw k.code===q?new Error(`Symlink "${m}" points outside the extraction directory.`):k}throw new Error(`"${m}" is not a valid directory component.`)}catch(u){if(u.code===q){await y.mkdir(m,{mode:f??t.dmode});return}throw u}}})(),c.set(m,l),l)};return{async ready(){await T},async preparePath(m){let{name:f,linkname:l,type:u,mode:k,mtime:I}=m,O=ut(f),z=await T,A=S.join(z.symbolic,O);if(r!==1/0){let N=1;for(let F of O)if(F==="/"&&++N>r)throw new Error("Tar exceeds max specified depth.")}let P=a.get(O);if(P){if(P==="directory"&&u!=="directory"||P!=="directory"&&u==="directory")throw new Error(`Path conflict ${u} over existing ${P} at "${f}"`);return}let b=S.dirname(A);switch(u){case Q:{a.set(O,Q);let N=k===void 0?void 0:k&511;await o(A,s??N),I&&await y.lutimes(A,I,I).catch(()=>{});return}case re:return a.set(O,re),await o(b),S.join(await E(b,`File "${f}" points outside the extraction directory.`),S.basename(A));case ue:{if(a.set(O,ue),!l)return;V(S.resolve(b,l),z.symbolic,`Symlink "${l}" points outside the extraction directory.`),await o(b);let N=await y.realpath(b);V(N,z.real,"Symlink parent changed."),V(S.resolve(N,l),z.real,`Symlink "${l}" points outside the extraction directory.`);let F=S.join(N,S.basename(A));try{await y.symlink(l,F)}catch($){if($.code!=="EEXIST")throw $;if(await y.rm(F,{force:!0}),await y.realpath(b)!==N)throw new Error("Symlink parent changed.");await y.symlink(l,F)}(h??=[]).push([O,l]),c.clear(),v.clear(),I&&await y.lutimes(A,I,I).catch(()=>{});return}case fe:{if(a.set(O,fe),!l)return;if(S.isAbsolute(l))throw new Error(`Hardlink "${l}" points outside the extraction directory.`);let N=S.join(z.symbolic,l);V(N,z.symbolic,`Hardlink "${l}" points outside the extraction directory.`),await o(b),N!==A&&d.push({linkTarget:N,outPath:A});return}default:return}},async checkSymlinks(){if(!h)return;let{symbolic:m,real:f}=await T,l=f+S.sep,u=S.parse(f).root,k=ke(f.slice(u.length)).length,I=(z,A,P)=>{if(!S.isAbsolute(z))return ke(z);V(z,f,P),A.length=0;let b=ke(z.slice(u.length));return b.splice(0,k),b},O=async([z,A])=>{let P=S.join(m,z);try{try{let D=await y.realpath(P);if(D!==f&&!D.startsWith(l))throw new Error(`Symlink "${A}" points outside the extraction directory.`);return}catch(D){if(D.code!==q)throw D}if(!(await y.lstat(P)).isSymbolicLink())return;let b=await y.readlink(P),N=`Symlink "${b}" points outside the extraction directory.`,F=await y.realpath(S.dirname(P));V(F,f,N);let $=ke(S.relative(f,F)),g=I(b,$,N),B=0;for(let D=0;D<g.length;D++){let X=g[D];if(X===".."){if(!$.length)throw new Error(N);$.pop();continue}$.push(X);let G=S.join(f,...$),p;try{p=await y.lstat(G)}catch(x){if(x.code===q)continue;throw x}if(!p.isSymbolicLink())continue;if(++B>ht)throw new Error(N);let U=await y.readlink(G);$.pop(),g.splice(D+1,0,...I(U,$,N))}}catch(b){if(b.code!==q)return b}};for(let z=0;z<h.length;z+=i){let A=h.slice(z,z+i),P=await Promise.all(A.map(b=>n.add(()=>O(b))));for(let[b,N]of P.entries())if(N!==void 0)throw await y.rm(S.join(m,A[b][0]),{force:!0}),N}},async applyLinks(){let m=(await T).real;for(let{linkTarget:f,outPath:l}of d)try{let u=await y.realpath(S.dirname(f));V(u,m,`Hardlink "${f}" points outside the extraction directory.`);let k=S.join(u,S.basename(f)),[I,O]=await Promise.allSettled([n.add(()=>y.lstat(k)),n.add(()=>y.realpath(S.dirname(l)))]);if(I.status==="rejected")throw I.reason;let z=I.value;if(z.isSymbolicLink())throw new Error(`Hardlink "${f}" is a symlink.`);if(O.status==="rejected")throw O.reason;let A=O.value;V(A,m,`Hardlink "${l}" points outside the extraction directory.`);let P=S.join(A,S.basename(l));try{await y.link(k,P)}catch(N){let F=N.code;if(F!=="EEXIST"&&F!==q)throw N;try{let $=await y.lstat(P);if($.dev===z.dev&&$.ino===z.ino)continue;await y.rm(P,{force:!0})}catch($){if($.code!==q)throw $}await y.link(k,P)}let b=await y.lstat(P);if(b.dev!==z.dev||b.ino!==z.ino)throw await y.rm(P,{force:!0}),new Error(`Hardlink target "${f}" changed during creation for link at "${l}".`)}catch(u){throw u.code===q?new Error(`Hardlink target "${f}" does not exist for link at "${l}".`):u}}}};function vt(e,t={}){let n=Le(t),i=t.concurrency||Ye().length||8,r=mt(i),s,c=wt(e,t,r,i),a=null,d=new Set,h=!1,v=o=>{let m=a.write(o);return m||(h=!0),m},w=o=>{E.destroyed||E.destroy(o)},T=()=>{let o=a;a=null,r.add(()=>o.end()).then(()=>d.delete(o),m=>{d.delete(o),w(m)})},E=new lt({async write(o,m,f){let l,u;try{if(n.write(o),n.isEntryActive()){if(a){for(;!n.isBodyComplete();){h=!1;let k=n.streamBody(v);if(h)await a.waitDrain();else if(k===0)return}if(!n.skipPadding())return;T()}else if(!n.skipEntry())return}for(;;){let k=n.readHeader();if(k==null)return;let I=De(k,t);if(!I){if(!n.skipEntry())return;continue}let O=await r.add(()=>c.preparePath(I));if(s)throw s;if(O){let z=I.mode===void 0?void 0:I.mode&511;for(a=pt(O,{mode:t.fmode??z,mtime:I.mtime??void 0},w),d.add(a),(l??=[]).push(a.waitDrain().catch(A=>A));!n.isBodyComplete();){h=!1;let A=n.streamBody(v);if(h)await a.waitDrain();else if(A===0)return}if(!n.skipPadding())return;T()}else if(!n.skipEntry())return}}catch(k){u=k}finally{let k=l?(await Promise.all(l)).find(I=>I):void 0;f(s??k??u)}},async final(o){try{if(n.end(),n.validateEOF(),a&&T(),await c.ready(),await r.onIdle(),s)throw s;await c.checkSymlinks(),await c.applyLinks(),o()}catch(m){o(m)}},destroy(o,m){let f=d.size>0||E.writableLength>0||E.writableEnded&&!E.writableFinished;if(!o&&!f){m(null);return}s=o??AbortSignal.abort().reason;for(let l of d)l.destroy(s);d.clear(),a=null,m(s)}});return E}export{dt as packTar,xt as packTarSources,vt as unpackTar};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
2
+ import{k as st}from"./chunk-6QXGZM36.mjs";import{a as ot}from"./chunk-UMHUSOPJ.mjs";import I from"node:fs/promises";import ct from"node:path";import{writeAtomic as lt}from"../browser/shared/files.mjs";import{documentFiles as ht}from"../browser/shared/workspace.mjs";var kt=l=>I.access(l).then(()=>!0,()=>!1);async function Dt(l,{create:p,slugOf:c,folderOf:O,fill:L,place:U,under:b="",said:o="\u5BFC\u5165\u81EA {0}",lang:$=null}){let F=[],S=[];async function h(u,P,B){let E=await c(u,B);await p(E,u.title,o.replace("{0}",()=>u.from),{lang:$});let J=O(E),{html:W,json:T}=ht(J),k=await I.readFile(W,"utf8");await lt(W,st(await L({source:k,nodes:u.nodes,icon:u.icon,own:u.own,raws:u.raws,lang:u.lang}))),u.files.length&&await I.mkdir(ct.join(J,"assets"),{recursive:!0});for(let{from:g,name:Z}of u.files){let A=ct.join(J,"assets",Z);await kt(A)||await I.copyFile(g,A)}if(u.icon){let g=JSON.parse(await I.readFile(T,"utf8"));await lt(T,`${JSON.stringify({...g,icon:u.icon},null,2)}
3
+ `)}await U(E,P),F.push(E);for(let g of u.children??[])await h(g,E,null);return E}for(let[u,P]of l.entries())S.push(await h(P,b,u));return{made:F,top:S}}import{randomBytes as Ot}from"node:crypto";import d from"node:fs/promises";import m from"node:path";import{writeAtomic as G}from"../browser/shared/files.mjs";import{sendJson as Y}from"../browser/shared/http.mjs";import{said as z,saying as jt}from"../browser/shared/i18n/index.mjs";import{reportsDirectory as gt}from"../browser/shared/paths.mjs";import{moveDocument as vt,readOutline as bt,validOutline as ut,withOutlineLock as St,writeOutline as xt,writtenAs as Nt}from"../browser/shared/outline.mjs";import{sameDirectory as Et}from"../browser/shared/preview-server.mjs";import{listReportSlugs as Ft,slugPattern as N}from"../browser/shared/reports.mjs";import{COMPONENTS_FOLDER as D,DOCUMENT_FOLDERS as Pt,PAGE_SLUG as At,documentDirectory as Lt,documentFiles as V,layoutOf as $t,listTrash as Jt,packageFolders as Tt,pageSlug as Mt,slugTaken as Rt,trashIdPattern as ft}from"../browser/shared/workspace.mjs";import{effectiveLook as tt,ownLookFor as Ct,ownLookOf as It,sameLook as Gt,withLookField as wt}from"../browser/shared/document-look.mjs";import{workspaceLook as nt,writeWorkspaceLook as Ut}from"../browser/shared/workspace-look.mjs";import{MENTION as Bt}from"../browser/shared/components/mention.mjs";import{findIn as Wt,reportLines as _t,tidyQuery as Ht}from"../browser/shared/search.mjs";import{countWords as Kt}from"../browser/shared/words.mjs";var Qt=([l,p,c,...O])=>O.length?z("\u68C0\u67E5\u6CA1\u6709\u901A\u8FC7\uFF1A{0}\uFF1B{1}\uFF1B{2} \u7B49 {3} \u6761",l,p,c,O.length+3):c!==void 0?z("\u68C0\u67E5\u6CA1\u6709\u901A\u8FC7\uFF1A{0}\uFF1B{1}\uFF1B{2}",l,p,c):p!==void 0?z("\u68C0\u67E5\u6CA1\u6709\u901A\u8FC7\uFF1A{0}\uFF1B{1}",l,p):z("\u68C0\u67E5\u6CA1\u6709\u901A\u8FC7\uFF1A{0}",l),mt=l=>l==="en"?"en":null;async function X(l,p){for(let c=0;;c++)try{return await d.rename(l,p)}catch(O){if(!["EPERM","EBUSY","EACCES"].includes(O.code))throw O;if(c>=5)break;await new Promise(L=>setTimeout(L,60*(c+1)))}await d.cp(l,p,{recursive:!0,errorOnExist:!0,force:!1}),await d.rm(l,{recursive:!0,force:!0,maxRetries:5})}var Yt=l=>m.resolve(l);function On({edits:l,reports:p,reportsDirectory:c=gt,server:O={kind:"dev",version:null,stop:null},components:L=null,changed:U=()=>{}}){let{trash:b}=$t(c),o=(t,n,e)=>[t,{ok:!1,reason:n,...jt(e)}],$=t=>d.readFile(t,"utf8").then(JSON.parse).catch(()=>null),F=t=>Lt(t,c),S=t=>V(F(t)),h=t=>m.join(c,t),u=t=>A(V(h(t)).html),P=t=>Promise.resolve(l.forgetChanges?.(t)).catch(()=>{}),B=async t=>{let n=await d.readdir(h(t),{withFileTypes:!0});if(t!==D)return n.map(({name:r})=>r);let e=new Set(Tt(c).map(({id:r})=>r.split("/")[0]));return n.filter(r=>r.isFile()||Pt.includes(r.name)&&!e.has(r.name)).map(({name:r})=>r)},E=async(t,n,e)=>{await d.mkdir(e,{recursive:!0});let r=[];try{for(let i of t)await X(m.join(n,i),m.join(e,i)),r.push(i)}catch(i){for(let a of r)await X(m.join(e,a),m.join(n,a));throw i}},J=async(t,n)=>{if(t!==D)return X(h(t),n);await E(await B(t),h(t),n),await d.rmdir(h(t)).catch(()=>{})},W=async(t,n)=>t===D&&!await u(t)&&(await Promise.all((await d.readdir(n)).map(e=>A(m.join(h(t),e))))).every(e=>!e),T=async t=>await $(V(t).json)??{},k=async t=>{let{title:n=t,description:e="",type:r,instructions:i,icon:a,look:s}=await T(F(t)),y=i===!0?{}:tt(s,nt(c));return{slug:t,title:n,description:e,...r?{type:r}:{},...typeof a=="string"&&a?{icon:a}:{},...i===!0?{instructions:!0}:{},...Object.keys(y).length?{look:y}:{}}},g=()=>Mt(c),Z=async(t,n)=>{let e=await T(F(t));await G(S(t).json,`${JSON.stringify({...e,[n]:!0},null,2)}
4
+ `)},A=t=>d.access(t).then(()=>!0,()=>!1),M=async(t,{own:n=null}={})=>{let e=new Set((await R()).map(({slug:r})=>r));e.delete(n);for(let r=1;;r++){let i=r===1?t:`${t}-${r}`;if(!Rt(i,c)&&!e.has(i))return i}},et=async(t,n)=>{let e=S(t).html,r=await d.readFile(e,"utf8"),i=ot(r).replace(`data-doc-id="${n}"`,`data-doc-id="${t}"`);i!==r&&await G(e,i)},x=()=>bt(c),_=async t=>{await xt(c,t),U()},H=t=>St(c,t);async function K(t,n="",e=1/0){await H(async()=>{let r=await x();for(let s of Object.values(r.children))s.includes(t)&&s.splice(s.indexOf(t),1);let i=n!==t&&(n===""||Object.values(r.children).some(s=>s.includes(n))),a=r.children[i?n:""]??=[];a.splice(Math.max(0,Math.min(e,a.length)),0,t),await _(r)})}function dt(t){return H(async()=>{let n=await x();for(let[e,r]of Object.entries(n.children)){let i=r.indexOf(t);if(!(i<0))return r.splice(i,1,...n.children[t]??[]),delete n.children[t],await _(n),{parent:e,index:i}}return{parent:"",index:1/0}})}let rt=new Map;async function yt(t,n){let e=S(t).html,r=await d.stat(e).catch(()=>null);if(!r)return null;let i=rt.get(t);if(i?.at===r.mtimeMs&&(i.titles===null||i.titles===n))return i.lines;let a=(await l.read(t))?.text??"",s=_t(p.words(a,t));return rt.set(t,{at:r.mtimeMs,titles:a.includes(Bt)?n:null,lines:s}),s}let it=t=>$(m.join(b,t,"entry.json")),R=()=>Jt(c),at={info:async()=>[200,{ok:!0,version:1,gallery:O.version,token:l.token,commands:[...Object.keys(q)],server:{pid:process.pid,workspace:m.resolve(c),kind:O.kind}}],async outline(){let t=await x(),n=await g(),e=[...Object.values(t.children).flat(),...n?[n]:[]],r=async i=>[i,await k(i)];return[200,{ok:!0,outline:t,instructions:n,reports:Object.fromEntries(await Promise.all(e.map(r))),trash:await R()}]},trash:async()=>[200,{ok:!0,entries:await R()}],async stats(t){let n=t.get("slug")??"",e=N.test(n)?S(n).html:"",[r,i]=N.test(n)?await Promise.all([d.stat(e),l.read(n)]).catch(()=>[]):[];return!r||!i?o(404,"missing","\u627E\u4E0D\u5230\u8FD9\u4EFD\u6587\u6863"):[200,{ok:!0,edited:Math.round(r.mtimeMs),words:Kt(i.text)}]},components:async()=>[200,{ok:!0,...L.read()}],async source(t){let n=t.get("slug")??"";if(!N.test(n))return o(404,"missing","\u627E\u4E0D\u5230\u8FD9\u4EFD\u6587\u6863");let e=m.resolve(S(n).html);return await A(e)?[200,{ok:!0,path:e}]:o(404,"missing","\u627E\u4E0D\u5230\u8FD9\u4EFD\u6587\u6863")},async search(t){let n=Ht(t.get("q")??"");if(!n)return[200,{ok:!0,results:[]}];let{children:e}=await x(),r=[],i=w=>(e[w]??[]).forEach(j=>{r.push(j),i(j)});i("");let a=n.toLowerCase(),s=new Map(await Promise.all(r.map(async w=>[w,await k(w)]))),y=JSON.stringify([...s].map(([w,{title:j}])=>[w,j])),f=(await Promise.all(r.map(async w=>{let j=await yt(w,y);if(!j)return null;let C=String(s.get(w).title).toLowerCase().includes(a),{count:v,hits:Q}=Wt(j,n);return C||v?{slug:w,title:C,count:v,hits:Q}:null}))).filter(Boolean);return f.sort((w,j)=>Number(j.title)-Number(w.title)||j.count-w.count),[200,{ok:!0,results:f.slice(0,50)}]}},q={async outline({outline:t,base:n}){return!ut(t)||n!==void 0&&!ut(n)?o(400,"outline","\u6587\u6863\u76EE\u5F55\u7684\u7ED3\u6784\u4E0D\u5BF9\uFF1A\u6BCF\u4EFD\u6587\u6863\u53EA\u80FD\u51FA\u73B0\u4E00\u6B21"):await H(async()=>n!==void 0&&!Nt(n.children,(await x()).children)?!1:(await _(t),!0))?[200,{ok:!0,outline:await x()}]:o(409,"stale","\u6587\u6863\u76EE\u5F55\u521A\u5728\u522B\u5904\u6539\u8FC7")},async move({slug:t,parent:n,after:e=null,first:r=!1,workspace:i}){if(typeof i=="string"&&!Et(i,c))return o(409,"elsewhere","\u8FD9\u4E2A\u9884\u89C8\u670D\u52A1\u5668\u7BA1\u7684\u662F\u53E6\u4E00\u4E2A\u76EE\u5F55\u7684\u6587\u6863");let a=f=>typeof f=="string"&&N.test(f);if(!a(t)||n!==void 0&&n!==""&&!a(n)||e!==null&&!a(e)||typeof r!="boolean")return o(400,"body","\u8BF7\u6C42\u683C\u5F0F\u4E0D\u5BF9");let s=await g();if(s!==null&&[t,n,e].includes(s))return o(409,"instructions","\u5199\u4F5C\u504F\u597D\u4E0D\u5728\u6587\u6863\u76EE\u5F55\u91CC\uFF0C\u4E0D\u80FD\u79FB\u52A8\uFF0C\u4E0B\u9762\u4E5F\u4E0D\u80FD\u653E\u6587\u6863");let y=await vt(c,t,{parent:n,after:e,first:r});if(y.written&&U(),!y.ok){let[f,w]={missing:[404,"\u627E\u4E0D\u5230\u8FD9\u4EFD\u6587\u6863"],parent:[404,"\u627E\u4E0D\u5230\u8981\u653E\u5230\u5B83\u4E0B\u9762\u7684\u6587\u6863"],after:[404,"\u627E\u4E0D\u5230\u8981\u653E\u5728\u5B83\u540E\u9762\u7684\u6587\u6863"],level:[409,"\u8981\u653E\u5728\u5B83\u540E\u9762\u7684\u6587\u6863\u4E0D\u5728\u8FD9\u4E00\u5C42"],itself:[409,"\u6587\u6863\u4E0D\u80FD\u653E\u5728\u5B83\u81EA\u5DF1\u540E\u9762"],inside:[409,"\u6587\u6863\u4E0D\u80FD\u79FB\u5230\u5B83\u81EA\u5DF1\u6216\u5B83\u4E0B\u9762\u7684\u6587\u6863\u4E0B\u9762"]}[y.reason];return o(f,y.reason,w)}return[200,{ok:!0,...y,outline:await x()}]},async create({title:t,description:n,parent:e="",language:r}){let i=typeof t=="string"&&t.trim()?t.trim():"\u672A\u547D\u540D\u6587\u6863",a=await M("doc");return await P(a),await p.create(a,i,typeof n=="string"&&n.trim()?n.trim():"\u65B0\u6587\u6863",{lang:mt(r)}),await K(a,typeof e=="string"?e:""),[200,{ok:!0,report:await k(a)}]},async instructions({title:t,description:n,language:e}){let r=await g();if(r)return[200,{ok:!0,report:await k(r)}];let i=await M(At),a=(s,y)=>typeof s=="string"&&s.trim()?s.trim().slice(0,200):y;return await p.create(i,a(t,"\u5199\u4F5C\u504F\u597D"),a(n,"Agent \u6BCF\u6B21\u5199\u62A5\u544A\u524D\u90FD\u4F1A\u5148\u8BFB\u7684\u5199\u4F5C\u504F\u597D"),{lang:mt(e),page:!0}),await Z(i,"instructions"),[200,{ok:!0,report:await k(i)}]},async components({id:t,hidden:n,disabled:e}){try{return[200,{ok:!0,...await L.write({id:t,hidden:n,disabled:e})}]}catch(r){return o(409,"components",r)}},async duplicate({slug:t,suffix:n}){if(typeof t!="string"||!N.test(t)||!await u(t))return o(404,"missing","\u627E\u4E0D\u5230\u8FD9\u4EFD\u6587\u6863");let e=await M(`${t}-copy`);await P(e);let r=new Set(["",...await B(t)]);await d.cp(h(t),h(e),{recursive:!0,errorOnExist:!0,filter:w=>r.has(m.relative(h(t),w).split(m.sep)[0])}),await et(e,t);let{title:i}=await k(t),a=await l.renameReport(e,`${i}${typeof n=="string"&&n.length>0&&n.length<=20?n:"\uFF08\u526F\u672C\uFF09"}`),s=await x(),[y,f]=Object.entries(s.children).find(([,w])=>w.includes(t))??["",null];return await K(e,y,f?f.indexOf(t)+1:1/0),[200,{ok:!0,report:await k(e),notes:a.notes??[]}]},async look({slug:t,look:n}){if(typeof t!="string"||!N.test(t)||!await u(t))return o(404,"missing","\u627E\u4E0D\u5230\u8FD9\u4EFD\u6587\u6863");if(t===await g())return o(409,"instructions","\u5199\u4F5C\u504F\u597D\u6CA1\u6709\u5B57\u4F53\u4E0E\u5E03\u5C40");if(n!==null&&(typeof n!="object"||Array.isArray(n)))return o(400,"look","\u5B57\u4F53\u4E0E\u5E03\u5C40\u4E0D\u5BF9");let e=S(t).json,r=null;try{r=JSON.parse(await d.readFile(e,"utf8"))}catch{}if(!r||typeof r!="object"||Array.isArray(r))return o(409,"metadata","\u8FD9\u4EFD\u6587\u6863\u7684\u6807\u9898\u548C\u8BF4\u660E\u8BFB\u4E0D\u51FA\u6765");let i=wt(r,Ct(n,nt(c)));return JSON.stringify(i)!==JSON.stringify(r)&&await G(e,`${JSON.stringify(i,null,2)}
5
+ `),[200,{ok:!0,report:await k(t)}]},async looks({slug:t}){if(typeof t!="string"||!N.test(t)||!await u(t))return o(404,"missing","\u627E\u4E0D\u5230\u8FD9\u4EFD\u6587\u6863");let n=await g();if(t===n)return o(409,"instructions","\u5199\u4F5C\u504F\u597D\u6CA1\u6709\u5B57\u4F53\u4E0E\u5E03\u5C40");let e=await $(S(t).json);if(!e||typeof e!="object"||Array.isArray(e))return o(409,"metadata","\u8FD9\u4EFD\u6587\u6863\u7684\u6807\u9898\u548C\u8BF4\u660E\u8BFB\u4E0D\u51FA\u6765");let r=nt(c),i=tt(e.look,r);try{await Ut(c,i)}catch(f){return o(409,"workspace",f)}let a=0,s=(await Ft(c)).filter(f=>f!==n).map(f=>({json:S(f).json,self:f===t})),y=(await R()).map(({id:f})=>({json:V(m.join(b,f,"report")).json,self:!1}));for(let{json:f,self:w}of[...s,...y])for(let j=0;j<3;j++){let C=await d.readFile(f,"utf8").catch(()=>null),v=null;try{v=JSON.parse(C??"")}catch{}if(!v||typeof v!="object"||Array.isArray(v)||!Object.hasOwn(v,"look")||v.instructions===!0)break;let Q=await G(f,`${JSON.stringify(wt(v,{}),null,2)}
6
+ `,{expect:C}).catch(()=>null);if(Q===null)break;if(Q){!w&&Object.keys(It(v.look)).length>0&&!Gt(tt(v.look,r),i)&&a++;break}}return[200,{ok:!0,look:i,replaced:a,report:await k(t)}]},async rename({slug:t,title:n}){if(typeof t!="string"||!N.test(t))return o(400,"slug","\u6587\u6863\u540D\u4E0D\u5BF9");let e=await l.renameReport(t,n);return e.ok?[200,{ok:!0,report:await k(t),notes:e.notes}]:o({title:400,missing:404}[e.reason]??409,e.reason,e.message??"\u6539\u540D\u6CA1\u6709\u6210\u529F")},async trash({slug:t}){if(typeof t!="string"||!N.test(t))return o(404,"missing","\u627E\u4E0D\u5230\u8FD9\u4EFD\u6587\u6863");if(t===await g())return o(409,"instructions","\u5199\u4F5C\u504F\u597D\u4E0D\u80FD\u79FB\u5230\u56DE\u6536\u533A");if(!await u(t))return o(404,"missing","\u627E\u4E0D\u5230\u8FD9\u4EFD\u6587\u6863");let{title:n}=await k(t),e=`${Date.now().toString(36)}-${Ot(3).toString("hex")}`,r=await x(),{parent:i,index:a}=await dt(t);try{await d.mkdir(m.join(b,e),{recursive:!0}),await J(t,m.join(b,e,"report"))}catch(y){throw await H(()=>_(r)),await d.rm(m.join(b,e),{recursive:!0,force:!0}).catch(()=>{}),y}let s={id:e,slug:t,title:n,at:Date.now(),parent:i,index:Number.isFinite(a)?a:-1};return await G(m.join(b,e,"entry.json"),`${JSON.stringify(s,null,2)}
7
+ `),[200,{ok:!0,entry:s}]},async restore({id:t}){let n=typeof t=="string"&&ft.test(t)?await it(t):null;if(!n)return o(404,"missing","\u56DE\u6536\u533A\u91CC\u6CA1\u6709\u8FD9\u4E00\u9879");let e=m.join(b,t,"report"),r=await W(n.slug,e),i=r?n.slug:await M(n.slug,{own:n.slug});return r?await E(await d.readdir(e),e,h(i)):await X(e,h(i)),i!==n.slug&&await et(i,n.slug),await d.rm(m.join(b,t),{recursive:!0,force:!0}),await K(i,n.parent,n.index<0?1/0:n.index),[200,{ok:!0,report:await k(i),entry:{...n,slug:i}}]},async destroy({id:t}){let n=typeof t=="string"&&ft.test(t)?await it(t):null;return n?(await u(n.slug)||await P(n.slug),await d.rm(m.join(b,t),{recursive:!0,force:!0}),[200,{ok:!0}]):o(404,"missing","\u56DE\u6536\u533A\u91CC\u6CA1\u6709\u8FD9\u4E00\u9879")},async export({slug:t}){if(typeof t!="string"||!N.test(t)||!await A(F(t)))return o(404,"missing","\u627E\u4E0D\u5230\u8FD9\u4EFD\u6587\u6863");let{problems:n=[],file:e,refused:r}=await p.export(t);return r?o(r.reason==="missing"?404:409,r.reason,r.message):n.length?o(422,"check",Qt(n)):[200,{ok:!0,path:Yt(e)}]}};function pt(t,n,e){if(t.method==="GET"&&Object.hasOwn(at,e)){let r=t.headers.host??"",i=t.socket.localPort;return r!==`127.0.0.1:${i}`&&r!==`localhost:${i}`?Y(n,403,{ok:!1,reason:"host"}):at[e](new URL(t.url??"/","http://localhost").searchParams).then(([a,s])=>Y(n,a,s),a=>Y(n,...o(500,"read",a)))}return t.method==="POST"&&e==="stop"?l.respond(async r=>{let i=await l.check(r);return i.error?i.error:O.kind!=="cli"||typeof O.stop!="function"?o(409,"dev","\u8FD9\u662F npm run dev \u7684\u670D\u52A1\u5668\uFF1A\u5728\u8FD0\u884C\u5B83\u7684\u5730\u65B9\u505C\u6B62\u5B83"):(n.once("finish",()=>O.stop()),[200,{ok:!0,pid:process.pid}])})(t,n):t.method==="POST"&&Object.hasOwn(q,e)?l.respond(async r=>{let i=await l.check(r);return i.error?i.error:q[e](i.body&&typeof i.body=="object"?i.body:{})})(t,n):Y(n,404,{ok:!1,reason:"unknown"})}return{handle:pt,outline:x,trashEntries:R,place:K,freeSlug:M}}export{Dt as a,On as b};