@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.
- package/LICENSE +21 -0
- package/README.md +50 -2
- package/THIRD-PARTY-NOTICES.md +3303 -0
- package/assets/writing-preferences.md +107 -0
- package/bin/gallery.mjs +10 -0
- package/browser/editor/components/bookmark/icons.mjs +6 -0
- package/browser/editor/components/bookmark/index.mjs +80 -0
- package/browser/editor/components/bookmark/page.mjs +147 -0
- package/browser/editor/components/builders.mjs +19 -0
- package/browser/editor/components/callout/index.mjs +64 -0
- package/browser/editor/components/code/index.mjs +327 -0
- package/browser/editor/components/code/page.mjs +561 -0
- package/browser/editor/components/colors.mjs +50 -0
- package/browser/editor/components/columns/index.mjs +104 -0
- package/browser/editor/components/columns/page.mjs +310 -0
- package/browser/editor/components/details/index.mjs +73 -0
- package/browser/editor/components/details/page.mjs +86 -0
- package/browser/editor/components/dialog/index.mjs +84 -0
- package/browser/editor/components/dialog/page.mjs +201 -0
- package/browser/editor/components/divider/index.mjs +48 -0
- package/browser/editor/components/embed/icons.mjs +11 -0
- package/browser/editor/components/embed/index.mjs +123 -0
- package/browser/editor/components/embed/page.mjs +309 -0
- package/browser/editor/components/figure/index.mjs +87 -0
- package/browser/editor/components/figure/page.mjs +42 -0
- package/browser/editor/components/file/icons.mjs +14 -0
- package/browser/editor/components/file/index.mjs +77 -0
- package/browser/editor/components/file/page.mjs +114 -0
- package/browser/editor/components/flowchart/add.mjs +123 -0
- package/browser/editor/components/flowchart/index.mjs +246 -0
- package/browser/editor/components/flowchart/page.mjs +453 -0
- package/browser/editor/components/heading/index.mjs +53 -0
- package/browser/editor/components/heading/page.mjs +6 -0
- package/browser/editor/components/highlight/index.mjs +63 -0
- package/browser/editor/components/icon/index.mjs +57 -0
- package/browser/editor/components/icon/page.mjs +286 -0
- package/browser/editor/components/icons.mjs +48 -0
- package/browser/editor/components/image/crop.mjs +189 -0
- package/browser/editor/components/image/index.mjs +104 -0
- package/browser/editor/components/image/page.mjs +385 -0
- package/browser/editor/components/image/viewer.mjs +213 -0
- package/browser/editor/components/installed/index.mjs +179 -0
- package/browser/editor/components/installed/page.mjs +523 -0
- package/browser/editor/components/installed/served.mjs +35 -0
- package/browser/editor/components/kit.mjs +67 -0
- package/browser/editor/components/list/index.mjs +194 -0
- package/browser/editor/components/list/join.mjs +68 -0
- package/browser/editor/components/list/numbers.mjs +107 -0
- package/browser/editor/components/list/page.mjs +632 -0
- package/browser/editor/components/math/index.mjs +88 -0
- package/browser/editor/components/math/page.mjs +236 -0
- package/browser/editor/components/math/tex-logo.mjs +6 -0
- package/browser/editor/components/media/icons.mjs +19 -0
- package/browser/editor/components/media/page.mjs +192 -0
- package/browser/editor/components/media/parts.mjs +60 -0
- package/browser/editor/components/media/size.mjs +20 -0
- package/browser/editor/components/media/toolbar.mjs +37 -0
- package/browser/editor/components/media/write.mjs +7 -0
- package/browser/editor/components/pages.mjs +46 -0
- package/browser/editor/components/paragraph/index.mjs +43 -0
- package/browser/editor/components/paragraph/page.mjs +52 -0
- package/browser/editor/components/placeholder-bar.mjs +17 -0
- package/browser/editor/components/placeholder.mjs +128 -0
- package/browser/editor/components/quote/index.mjs +33 -0
- package/browser/editor/components/registry.mjs +859 -0
- package/browser/editor/components/rows.mjs +16 -0
- package/browser/editor/components/section/index.mjs +42 -0
- package/browser/editor/components/section/page.mjs +141 -0
- package/browser/editor/components/set-apart.mjs +24 -0
- package/browser/editor/components/sheets/index.mjs +137 -0
- package/browser/editor/components/sheets/page.mjs +227 -0
- package/browser/editor/components/sheets/pills.mjs +226 -0
- package/browser/editor/components/table/grid.mjs +73 -0
- package/browser/editor/components/table/index.mjs +308 -0
- package/browser/editor/components/table/page.mjs +683 -0
- package/browser/editor/components/table/slots.mjs +41 -0
- package/browser/editor/components/widget/index.mjs +50 -0
- package/browser/editor/page/annotate/anchors.mjs +230 -0
- package/browser/editor/page/annotate/card.mjs +102 -0
- package/browser/editor/page/annotate/index.mjs +1656 -0
- package/browser/editor/page/at-menu/index.mjs +317 -0
- package/browser/editor/page/autosave.mjs +1023 -0
- package/browser/editor/page/beside.mjs +21 -0
- package/browser/editor/page/block-info.mjs +63 -0
- package/browser/editor/page/block-menu/colors.mjs +84 -0
- package/browser/editor/page/block-menu/index.mjs +217 -0
- package/browser/editor/page/blocks.mjs +255 -0
- package/browser/editor/page/caret.mjs +682 -0
- package/browser/editor/page/changes/bar.mjs +102 -0
- package/browser/editor/page/changes/ghost.mjs +206 -0
- package/browser/editor/page/changes/gone-words.mjs +94 -0
- package/browser/editor/page/changes/index.mjs +447 -0
- package/browser/editor/page/changes/words.mjs +27 -0
- package/browser/editor/page/chip-fills.mjs +126 -0
- package/browser/editor/page/clipboard/import/colors.mjs +192 -0
- package/browser/editor/page/clipboard/import/html.mjs +792 -0
- package/browser/editor/page/clipboard/import/inline.mjs +232 -0
- package/browser/editor/page/clipboard/import/languages.mjs +42 -0
- package/browser/editor/page/clipboard/import/markdown.mjs +760 -0
- package/browser/editor/page/clipboard/import/math.mjs +100 -0
- package/browser/editor/page/clipboard/import/office.mjs +245 -0
- package/browser/editor/page/clipboard/import/read.mjs +120 -0
- package/browser/editor/page/clipboard/import/rich.mjs +29 -0
- package/browser/editor/page/clipboard/import/to-blocks.mjs +290 -0
- package/browser/editor/page/clipboard/index.mjs +816 -0
- package/browser/editor/page/clipboard/own/blocks.mjs +211 -0
- package/browser/editor/page/clipboard/own/chart-keys.mjs +58 -0
- package/browser/editor/page/clipboard/own/describe.mjs +124 -0
- package/browser/editor/page/clipboard/own/export.mjs +167 -0
- package/browser/editor/page/clipboard/own/ids.mjs +39 -0
- package/browser/editor/page/clipboard/own/index.mjs +13 -0
- package/browser/editor/page/clipboard/own/rules.mjs +44 -0
- package/browser/editor/page/clipboard/own/selection.mjs +159 -0
- package/browser/editor/page/clipboard/own/writers.mjs +315 -0
- package/browser/editor/page/columns/index.mjs +360 -0
- package/browser/editor/page/commit.mjs +1813 -0
- package/browser/editor/page/conflicts.mjs +249 -0
- package/browser/editor/page/convert.mjs +831 -0
- package/browser/editor/page/core.mjs +1693 -0
- package/browser/editor/page/drag/drop.mjs +307 -0
- package/browser/editor/page/drag/index.mjs +351 -0
- package/browser/editor/page/drag/preview.mjs +126 -0
- package/browser/editor/page/edge-scroll.mjs +50 -0
- package/browser/editor/page/editor.mjs +1780 -0
- package/browser/editor/page/emoji-picker/emoji-tab.mjs +287 -0
- package/browser/editor/page/emoji-picker/glyph-html.mjs +26 -0
- package/browser/editor/page/emoji-picker/grid.mjs +81 -0
- package/browser/editor/page/emoji-picker/icon-tab.mjs +217 -0
- package/browser/editor/page/emoji-picker/icons.mjs +31 -0
- package/browser/editor/page/emoji-picker/index.mjs +166 -0
- package/browser/editor/page/emoji-picker/styles.mjs +161 -0
- package/browser/editor/page/emoji-picker/support.mjs +204 -0
- package/browser/editor/page/emoji-picker/upload.mjs +236 -0
- package/browser/editor/page/export-report.mjs +23 -0
- package/browser/editor/page/fills.mjs +62 -0
- package/browser/editor/page/find/index.mjs +107 -0
- package/browser/editor/page/flags.mjs +70 -0
- package/browser/editor/page/fold/index.mjs +348 -0
- package/browser/editor/page/fold/rule.mjs +125 -0
- package/browser/editor/page/folded.mjs +23 -0
- package/browser/editor/page/format-bar/bar.mjs +449 -0
- package/browser/editor/page/format-bar/brush.mjs +77 -0
- package/browser/editor/page/format-bar/colors.mjs +46 -0
- package/browser/editor/page/format-bar/index.mjs +404 -0
- package/browser/editor/page/formula/index.mjs +236 -0
- package/browser/editor/page/formula/panel.mjs +336 -0
- package/browser/editor/page/formula/symbols.mjs +156 -0
- package/browser/editor/page/frame.mjs +74 -0
- package/browser/editor/page/frames.mjs +196 -0
- package/browser/editor/page/geometry.mjs +402 -0
- package/browser/editor/page/gesture.mjs +45 -0
- package/browser/editor/page/handle/index.mjs +650 -0
- package/browser/editor/page/handle-sizes.mjs +14 -0
- package/browser/editor/page/hints/index.mjs +84 -0
- package/browser/editor/page/history.mjs +401 -0
- package/browser/editor/page/insert/index.mjs +256 -0
- package/browser/editor/page/kept.mjs +38 -0
- package/browser/editor/page/links/address.mjs +40 -0
- package/browser/editor/page/links/index.mjs +866 -0
- package/browser/editor/page/links/pages.mjs +131 -0
- package/browser/editor/page/links/views.mjs +369 -0
- package/browser/editor/page/long-runs.mjs +75 -0
- package/browser/editor/page/look.mjs +77 -0
- package/browser/editor/page/made.mjs +24 -0
- package/browser/editor/page/margin.mjs +373 -0
- package/browser/editor/page/markdown/index.mjs +88 -0
- package/browser/editor/page/markdown/rules.mjs +33 -0
- package/browser/editor/page/marks.mjs +377 -0
- package/browser/editor/page/media-menu/index.mjs +158 -0
- package/browser/editor/page/menu.mjs +544 -0
- package/browser/editor/page/merge.mjs +124 -0
- package/browser/editor/page/notices.mjs +142 -0
- package/browser/editor/page/offered.mjs +32 -0
- package/browser/editor/page/outline/folds.mjs +53 -0
- package/browser/editor/page/outline/index.mjs +783 -0
- package/browser/editor/page/outline/list.mjs +184 -0
- package/browser/editor/page/outline/read.mjs +201 -0
- package/browser/editor/page/outline/strip.mjs +287 -0
- package/browser/editor/page/outline/tree.mjs +248 -0
- package/browser/editor/page/overlay-layer.mjs +227 -0
- package/browser/editor/page/overlays.mjs +205 -0
- package/browser/editor/page/own.mjs +28 -0
- package/browser/editor/page/pads.mjs +71 -0
- package/browser/editor/page/page-objects.mjs +105 -0
- package/browser/editor/page/panel.mjs +65 -0
- package/browser/editor/page/placement.mjs +58 -0
- package/browser/editor/page/post.mjs +41 -0
- package/browser/editor/page/present-links.mjs +50 -0
- package/browser/editor/page/quiet.mjs +48 -0
- package/browser/editor/page/resize/index.mjs +327 -0
- package/browser/editor/page/select-all/index.mjs +262 -0
- package/browser/editor/page/selection/delete.mjs +61 -0
- package/browser/editor/page/selection/index.mjs +164 -0
- package/browser/editor/page/selection/marquee.mjs +174 -0
- package/browser/editor/page/session.mjs +168 -0
- package/browser/editor/page/slash-menu/index.mjs +291 -0
- package/browser/editor/page/storage.mjs +48 -0
- package/browser/editor/page/sync-state.mjs +267 -0
- package/browser/editor/page/table/aligns.mjs +29 -0
- package/browser/editor/page/table/cell-bar.mjs +141 -0
- package/browser/editor/page/table/cells.mjs +527 -0
- package/browser/editor/page/table/icons.mjs +40 -0
- package/browser/editor/page/table/index.mjs +990 -0
- package/browser/editor/page/table/lists.mjs +187 -0
- package/browser/editor/page/table/widths.mjs +313 -0
- package/browser/editor/page/tex.mjs +32 -0
- package/browser/editor/page/text-select/index.mjs +671 -0
- package/browser/editor/page/tooltip.mjs +98 -0
- package/browser/editor/page/type-grid.mjs +83 -0
- package/browser/editor/page/typing/code-edges.mjs +274 -0
- package/browser/editor/page/typing/index.mjs +282 -0
- package/browser/editor/page/typing/leave.mjs +68 -0
- package/browser/editor/page/ui.mjs +160 -0
- package/browser/shared/annotations.mjs +569 -0
- package/browser/shared/code-folds.mjs +14 -0
- package/browser/shared/code-languages.mjs +70 -0
- package/browser/shared/code-lines.mjs +30 -0
- package/browser/shared/colors.mjs +30 -0
- package/browser/shared/component-catalog.mjs +573 -0
- package/browser/shared/components/bookmark.mjs +26 -0
- package/browser/shared/components/callout.mjs +9 -0
- package/browser/shared/components/chart.mjs +20 -0
- package/browser/shared/components/code.mjs +37 -0
- package/browser/shared/components/columns.mjs +16 -0
- package/browser/shared/components/details.mjs +15 -0
- package/browser/shared/components/dialog.mjs +28 -0
- package/browser/shared/components/diff.mjs +18 -0
- package/browser/shared/components/divider.mjs +6 -0
- package/browser/shared/components/embed.mjs +25 -0
- package/browser/shared/components/figure.mjs +14 -0
- package/browser/shared/components/file.mjs +23 -0
- package/browser/shared/components/heading.mjs +6 -0
- package/browser/shared/components/highlight.mjs +9 -0
- package/browser/shared/components/icon.mjs +18 -0
- package/browser/shared/components/image.mjs +39 -0
- package/browser/shared/components/index.mjs +396 -0
- package/browser/shared/components/installed.mjs +232 -0
- package/browser/shared/components/list.mjs +146 -0
- package/browser/shared/components/math.mjs +49 -0
- package/browser/shared/components/mention.mjs +33 -0
- package/browser/shared/components/page.mjs +46 -0
- package/browser/shared/components/paragraph.mjs +9 -0
- package/browser/shared/components/quote.mjs +6 -0
- package/browser/shared/components/section.mjs +8 -0
- package/browser/shared/components/sheets.mjs +80 -0
- package/browser/shared/components/state.mjs +20 -0
- package/browser/shared/components/table.mjs +49 -0
- package/browser/shared/components/text.mjs +14 -0
- package/browser/shared/components/widget.mjs +10 -0
- package/browser/shared/copy-ids.mjs +72 -0
- package/browser/shared/css-references.mjs +110 -0
- package/browser/shared/document-look.mjs +178 -0
- package/browser/shared/emoji/custom.mjs +91 -0
- package/browser/shared/emoji/data/LICENSE-lucide.txt +43 -0
- package/browser/shared/emoji/data/LICENSE-mingcute.txt +202 -0
- package/browser/shared/emoji/data/LICENSE-tabler.txt +21 -0
- package/browser/shared/emoji/data/README.md +28 -0
- package/browser/shared/emoji/data/categories.json +1 -0
- package/browser/shared/emoji/data/icons.json +1 -0
- package/browser/shared/emoji/data/keywords-en.json +1 -0
- package/browser/shared/emoji/data/keywords-zh.json +1 -0
- package/browser/shared/emoji/data/names.json +1 -0
- package/browser/shared/emoji/data/positions.json +1 -0
- package/browser/shared/emoji/data/twemoji-index.json +1 -0
- package/browser/shared/emoji/data/twemoji-svg.bin +0 -0
- package/browser/shared/emoji/data.mjs +194 -0
- package/browser/shared/emoji/emoji.mjs +38 -0
- package/browser/shared/emoji/glyphs.mjs +134 -0
- package/browser/shared/emoji/icon-value.mjs +91 -0
- package/browser/shared/escape.mjs +20 -0
- package/browser/shared/export-wrap.mjs +89 -0
- package/browser/shared/files.mjs +33 -0
- package/browser/shared/html-tree.mjs +59 -0
- package/browser/shared/http.mjs +22 -0
- package/browser/shared/i18n/en.mjs +1223 -0
- package/browser/shared/i18n/index.mjs +132 -0
- package/browser/shared/ids.mjs +24 -0
- package/browser/shared/import-types.mjs +23 -0
- package/browser/shared/inline-spacing.mjs +97 -0
- package/browser/shared/layers.mjs +42 -0
- package/browser/shared/long-runs.mjs +39 -0
- package/browser/shared/media.mjs +162 -0
- package/browser/shared/new-names.mjs +67 -0
- package/browser/shared/number-reading.mjs +92 -0
- package/browser/shared/old-names.mjs +143 -0
- package/browser/shared/outline.mjs +194 -0
- package/browser/shared/page-address.mjs +140 -0
- package/browser/shared/page-links.mjs +86 -0
- package/browser/shared/paths.mjs +73 -0
- package/browser/shared/preferences.mjs +116 -0
- package/browser/shared/preview-server.mjs +247 -0
- package/browser/shared/qa-levels.mjs +93 -0
- package/browser/shared/reading-place.mjs +91 -0
- package/browser/shared/renamed-storage.mjs +220 -0
- package/browser/shared/reports.mjs +46 -0
- package/browser/shared/search.mjs +85 -0
- package/browser/shared/session.mjs +77 -0
- package/browser/shared/table-chart.mjs +113 -0
- package/browser/shared/table-hides.mjs +120 -0
- package/browser/shared/table-slots.mjs +75 -0
- package/browser/shared/words.mjs +23 -0
- package/browser/shared/workspace-look.mjs +91 -0
- package/browser/shared/workspace.mjs +535 -0
- package/browser/shared/writing-preferences.mjs +68 -0
- package/browser/shared/zoom.mjs +57 -0
- package/dist/chunk-2B5E4CDJ.mjs +2 -0
- package/dist/chunk-342HXE3Q.mjs +2 -0
- package/dist/chunk-3HIRPVLU.mjs +2 -0
- package/dist/chunk-43B75J5T.mjs +2 -0
- package/dist/chunk-4FS7Z7WR.mjs +2 -0
- package/dist/chunk-4K5KC6V2.mjs +2 -0
- package/dist/chunk-5L7RYZCL.mjs +2 -0
- package/dist/chunk-5MHMDLZD.mjs +4 -0
- package/dist/chunk-5ZKJ3H4P.mjs +8 -0
- package/dist/chunk-64K7IPLO.mjs +255 -0
- package/dist/chunk-6QXGZM36.mjs +8 -0
- package/dist/chunk-6RGJOMJP.mjs +16 -0
- package/dist/chunk-742D2WWJ.mjs +19 -0
- package/dist/chunk-7DTINW6U.mjs +48 -0
- package/dist/chunk-A55HN5OK.mjs +2 -0
- package/dist/chunk-AGDILNWB.mjs +2 -0
- package/dist/chunk-AJ73XJF3.mjs +2 -0
- package/dist/chunk-AUZGSZJH.mjs +13 -0
- package/dist/chunk-BFE45AKL.mjs +2 -0
- package/dist/chunk-BGGDRNYQ.mjs +10 -0
- package/dist/chunk-BXO2ZY5P.mjs +2 -0
- package/dist/chunk-C564NU2H.mjs +77 -0
- package/dist/chunk-CEH4MRCC.mjs +2 -0
- package/dist/chunk-CY2FNNAB.mjs +16 -0
- package/dist/chunk-DFUDV4LX.mjs +2 -0
- package/dist/chunk-DKXG4XDG.mjs +2 -0
- package/dist/chunk-E7LWZRXY.mjs +4 -0
- package/dist/chunk-EZQ34M3F.mjs +124 -0
- package/dist/chunk-EZY3WC6Z.mjs +15 -0
- package/dist/chunk-FDLXYYG4.mjs +4 -0
- package/dist/chunk-FUKQNOQS.mjs +9 -0
- package/dist/chunk-GB5SOYQJ.mjs +7 -0
- package/dist/chunk-GRAXKKG4.mjs +2 -0
- package/dist/chunk-HYMEEXKN.mjs +4 -0
- package/dist/chunk-IVDLMMBD.mjs +2 -0
- package/dist/chunk-JPOSLGOC.mjs +6 -0
- package/dist/chunk-JVHHHGEA.mjs +3 -0
- package/dist/chunk-L3QKH4OK.mjs +26 -0
- package/dist/chunk-LAE5NQ4B.mjs +2 -0
- package/dist/chunk-LCTHTZIL.mjs +960 -0
- package/dist/chunk-LEF6DRCK.mjs +59 -0
- package/dist/chunk-LKX55H76.mjs +2 -0
- package/dist/chunk-LS4F7JUM.mjs +2 -0
- package/dist/chunk-MAFIGVXY.mjs +2 -0
- package/dist/chunk-NO5NJCHO.mjs +2 -0
- package/dist/chunk-NQPVAU63.mjs +2 -0
- package/dist/chunk-NSKUTQ5J.mjs +5 -0
- package/dist/chunk-O35FIXRB.mjs +2 -0
- package/dist/chunk-P2CAZPDP.mjs +3 -0
- package/dist/chunk-PL6GHLGD.mjs +15 -0
- package/dist/chunk-QAIHRH3I.mjs +13 -0
- package/dist/chunk-QJIR2BLP.mjs +6 -0
- package/dist/chunk-QR6A54KJ.mjs +3 -0
- package/dist/chunk-QUPLVPB2.mjs +7 -0
- package/dist/chunk-R7BNENLY.mjs +4 -0
- package/dist/chunk-S6O4UHLC.mjs +2 -0
- package/dist/chunk-SGJWQKEI.mjs +2 -0
- package/dist/chunk-SYGN7GLU.mjs +2 -0
- package/dist/chunk-TMYZB6AV.mjs +2 -0
- package/dist/chunk-TX6JH7TR.mjs +2 -0
- package/dist/chunk-TYK6VNAB.mjs +10 -0
- package/dist/chunk-U3SSPL4K.mjs +8 -0
- package/dist/chunk-U6KNPJPR.mjs +2 -0
- package/dist/chunk-UALRNVSE.mjs +4 -0
- package/dist/chunk-UH4SIXTR.mjs +2 -0
- package/dist/chunk-UMHUSOPJ.mjs +2 -0
- package/dist/chunk-V3HXVQEM.mjs +2 -0
- package/dist/chunk-V5JTW2LH.mjs +27 -0
- package/dist/chunk-V5VXUJKG.mjs +2 -0
- package/dist/chunk-V6XZ4VIR.mjs +2 -0
- package/dist/chunk-VBXMADMP.mjs +2 -0
- package/dist/chunk-VNV55RUA.mjs +2 -0
- package/dist/chunk-VPD2PS35.mjs +2 -0
- package/dist/chunk-W3BGBJQW.mjs +2 -0
- package/dist/chunk-W4VKN3GF.mjs +7 -0
- package/dist/chunk-W5BXXPDJ.mjs +3 -0
- package/dist/chunk-W7XHE4CT.mjs +2 -0
- package/dist/chunk-XNROSH2T.mjs +4 -0
- package/dist/chunk-XUNHRCOG.mjs +6 -0
- package/dist/chunk-Y34NR5JL.mjs +2 -0
- package/dist/chunk-Y6RLRPG3.mjs +3 -0
- package/dist/chunk-YEY3RSFQ.mjs +2 -0
- package/dist/cli.mjs +2 -0
- package/dist/server.mjs +2 -0
- package/dist/worker.mjs +5 -0
- package/kit/charts.js +355 -0
- package/kit/code.js +164 -0
- package/kit/dialogs.js +157 -0
- package/kit/math.js +2004 -0
- package/kit/report.css +2932 -0
- package/kit/runtime.js +1782 -0
- package/kit/sheets.js +123 -0
- package/kit/state.js +217 -0
- package/kit/tables.js +1499 -0
- package/kit/tokens.js +29 -0
- package/kit/ui.js +658 -0
- package/package.json +41 -4
- package/release.json +25 -0
- package/sdk/column-widths.d.ts +56 -0
- package/sdk/doc-charts.d.ts +82 -0
- package/sdk/doc-code.d.ts +28 -0
- package/sdk/doc-dialogs.d.ts +4 -0
- package/sdk/doc-kit.d.ts +147 -0
- package/sdk/doc-math.d.ts +3 -0
- package/sdk/doc-sheets.d.ts +15 -0
- package/sdk/doc-state.d.ts +41 -0
- package/sdk/doc-tables.d.ts +24 -0
- package/sdk/doc-tokens.d.ts +22 -0
- package/sdk/index.d.ts +30 -0
- package/skill/SKILL.md +150 -0
- package/skill/agents/openai.yaml +5 -0
- package/skill/references/building-components.md +367 -0
- package/skill/references/example-report.html +356 -0
- package/skill/references/writing-html.md +187 -0
- package/skill/sdk/column-widths.d.ts +56 -0
- package/skill/sdk/doc-charts.d.ts +82 -0
- package/skill/sdk/doc-code.d.ts +28 -0
- package/skill/sdk/doc-dialogs.d.ts +4 -0
- package/skill/sdk/doc-kit.d.ts +147 -0
- package/skill/sdk/doc-math.d.ts +3 -0
- package/skill/sdk/doc-sheets.d.ts +15 -0
- package/skill/sdk/doc-state.d.ts +41 -0
- package/skill/sdk/doc-tables.d.ts +24 -0
- package/skill/sdk/doc-tokens.d.ts +22 -0
- package/skill/sdk/index.d.ts +30 -0
- package/starter/doc.html +21 -0
- package/starter/doc.json +5 -0
- package/vendor/d3.v7.9.0.min.js +2 -0
- package/vendor/katex/auto-render.min.js +1 -0
- package/vendor/katex/contrib/mhchem.min.js +1 -0
- package/vendor/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/vendor/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/vendor/katex/katex.min.css +1 -0
- package/vendor/katex/katex.min.js +1 -0
- package/vendor/pdfjs/LICENSE +177 -0
- package/vendor/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Add-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Add-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- package/vendor/pdfjs/cmaps/B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/B5pc-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/B5pc-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS1-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS1-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/CNS2-V.bcmap +3 -0
- package/vendor/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
- package/vendor/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Ext-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Ext-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GB-H.bcmap +4 -0
- package/vendor/pdfjs/cmaps/GB-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBT-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBT-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Hankaku.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Hiragana.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Katakana.bcmap +0 -0
- package/vendor/pdfjs/cmaps/LICENSE +36 -0
- package/vendor/pdfjs/cmaps/NWP-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/NWP-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/Roman.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
- package/vendor/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/V.bcmap +0 -0
- package/vendor/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
- package/vendor/pdfjs/legacy/build/pdf.min.mjs +27 -0
- package/vendor/pdfjs/legacy/build/pdf.worker.min.mjs +27 -0
- package/vendor/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
- package/vendor/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
- package/vendor/pdfjs/standard_fonts/LICENSE_LIBERATION +363 -0
- package/vendor/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
- package/vendor/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
- package/vendor/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
- package/vendor/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
- package/vendor/types/@types/d3/LICENSE +21 -0
- package/vendor/types/@types/d3/index.d.ts +39 -0
- package/vendor/types/@types/d3/package.json +81 -0
- package/vendor/types/@types/d3-array/LICENSE +21 -0
- package/vendor/types/@types/d3-array/index.d.ts +1118 -0
- package/vendor/types/@types/d3-array/package.json +56 -0
- package/vendor/types/@types/d3-axis/LICENSE +21 -0
- package/vendor/types/@types/d3-axis/index.d.ts +293 -0
- package/vendor/types/@types/d3-axis/package.json +47 -0
- package/vendor/types/@types/d3-brush/LICENSE +21 -0
- package/vendor/types/@types/d3-brush/index.d.ts +255 -0
- package/vendor/types/@types/d3-brush/package.json +42 -0
- package/vendor/types/@types/d3-chord/LICENSE +21 -0
- package/vendor/types/@types/d3-chord/index.d.ts +471 -0
- package/vendor/types/@types/d3-chord/package.json +40 -0
- package/vendor/types/@types/d3-color/LICENSE +21 -0
- package/vendor/types/@types/d3-color/index.d.ts +669 -0
- package/vendor/types/@types/d3-color/package.json +55 -0
- package/vendor/types/@types/d3-contour/LICENSE +21 -0
- package/vendor/types/@types/d3-contour/index.d.ts +222 -0
- package/vendor/types/@types/d3-contour/package.json +38 -0
- package/vendor/types/@types/d3-delaunay/LICENSE +21 -0
- package/vendor/types/@types/d3-delaunay/index.d.ts +316 -0
- package/vendor/types/@types/d3-delaunay/package.json +30 -0
- package/vendor/types/@types/d3-dispatch/LICENSE +21 -0
- package/vendor/types/@types/d3-dispatch/index.d.ts +96 -0
- package/vendor/types/@types/d3-dispatch/package.json +51 -0
- package/vendor/types/@types/d3-drag/LICENSE +21 -0
- package/vendor/types/@types/d3-drag/index.d.ts +395 -0
- package/vendor/types/@types/d3-drag/package.json +42 -0
- package/vendor/types/@types/d3-dsv/LICENSE +21 -0
- package/vendor/types/@types/d3-dsv/index.d.ts +482 -0
- package/vendor/types/@types/d3-dsv/package.json +45 -0
- package/vendor/types/@types/d3-ease/LICENSE +21 -0
- package/vendor/types/@types/d3-ease/index.d.ts +316 -0
- package/vendor/types/@types/d3-ease/package.json +40 -0
- package/vendor/types/@types/d3-fetch/LICENSE +21 -0
- package/vendor/types/@types/d3-fetch/index.d.ts +282 -0
- package/vendor/types/@types/d3-fetch/package.json +37 -0
- package/vendor/types/@types/d3-force/LICENSE +21 -0
- package/vendor/types/@types/d3-force/index.d.ts +899 -0
- package/vendor/types/@types/d3-force/package.json +45 -0
- package/vendor/types/@types/d3-format/LICENSE +21 -0
- package/vendor/types/@types/d3-format/index.d.ts +337 -0
- package/vendor/types/@types/d3-format/package.json +45 -0
- package/vendor/types/@types/d3-geo/LICENSE +21 -0
- package/vendor/types/@types/d3-geo/index.d.ts +1371 -0
- package/vendor/types/@types/d3-geo/package.json +48 -0
- package/vendor/types/@types/d3-hierarchy/LICENSE +21 -0
- package/vendor/types/@types/d3-hierarchy/index.d.ts +928 -0
- package/vendor/types/@types/d3-hierarchy/package.json +50 -0
- package/vendor/types/@types/d3-interpolate/LICENSE +21 -0
- package/vendor/types/@types/d3-interpolate/index.d.ts +387 -0
- package/vendor/types/@types/d3-interpolate/package.json +47 -0
- package/vendor/types/@types/d3-path/LICENSE +21 -0
- package/vendor/types/@types/d3-path/index.d.ts +108 -0
- package/vendor/types/@types/d3-path/package.json +41 -0
- package/vendor/types/@types/d3-polygon/LICENSE +21 -0
- package/vendor/types/@types/d3-polygon/index.d.ts +41 -0
- package/vendor/types/@types/d3-polygon/package.json +40 -0
- package/vendor/types/@types/d3-quadtree/LICENSE +21 -0
- package/vendor/types/@types/d3-quadtree/index.d.ts +204 -0
- package/vendor/types/@types/d3-quadtree/package.json +45 -0
- package/vendor/types/@types/d3-random/LICENSE +21 -0
- package/vendor/types/@types/d3-random/index.d.ts +313 -0
- package/vendor/types/@types/d3-random/package.json +41 -0
- package/vendor/types/@types/d3-scale/LICENSE +21 -0
- package/vendor/types/@types/d3-scale/index.d.ts +2669 -0
- package/vendor/types/@types/d3-scale/package.json +53 -0
- package/vendor/types/@types/d3-scale-chromatic/LICENSE +21 -0
- package/vendor/types/@types/d3-scale-chromatic/index.d.ts +520 -0
- package/vendor/types/@types/d3-scale-chromatic/package.json +46 -0
- package/vendor/types/@types/d3-selection/LICENSE +21 -0
- package/vendor/types/@types/d3-selection/index.d.ts +1210 -0
- package/vendor/types/@types/d3-selection/package.json +56 -0
- package/vendor/types/@types/d3-shape/LICENSE +21 -0
- package/vendor/types/@types/d3-shape/index.d.ts +2792 -0
- package/vendor/types/@types/d3-shape/package.json +53 -0
- package/vendor/types/@types/d3-time/LICENSE +21 -0
- package/vendor/types/@types/d3-time/index.d.ts +697 -0
- package/vendor/types/@types/d3-time/package.json +46 -0
- package/vendor/types/@types/d3-time-format/LICENSE +21 -0
- package/vendor/types/@types/d3-time-format/index.d.ts +202 -0
- package/vendor/types/@types/d3-time-format/package.json +40 -0
- package/vendor/types/@types/d3-timer/LICENSE +21 -0
- package/vendor/types/@types/d3-timer/index.d.ts +68 -0
- package/vendor/types/@types/d3-timer/package.json +45 -0
- package/vendor/types/@types/d3-transition/LICENSE +21 -0
- package/vendor/types/@types/d3-transition/index.d.ts +664 -0
- package/vendor/types/@types/d3-transition/package.json +47 -0
- package/vendor/types/@types/d3-zoom/LICENSE +21 -0
- package/vendor/types/@types/d3-zoom/index.d.ts +611 -0
- package/vendor/types/@types/d3-zoom/package.json +48 -0
- package/vendor/types/@types/geojson/LICENSE +21 -0
- package/vendor/types/@types/geojson/index.d.ts +202 -0
- package/vendor/types/@types/geojson/package.json +46 -0
- package/vendor/typescript/LICENSE.txt +55 -0
- package/vendor/typescript/lib.decorators.d.ts +384 -0
- package/vendor/typescript/lib.decorators.legacy.d.ts +22 -0
- package/vendor/typescript/lib.dom.d.ts +39429 -0
- package/vendor/typescript/lib.dom.iterable.d.ts +571 -0
- package/vendor/typescript/lib.es2015.collection.d.ts +147 -0
- package/vendor/typescript/lib.es2015.core.d.ts +597 -0
- package/vendor/typescript/lib.es2015.d.ts +28 -0
- package/vendor/typescript/lib.es2015.generator.d.ts +77 -0
- package/vendor/typescript/lib.es2015.iterable.d.ts +605 -0
- package/vendor/typescript/lib.es2015.promise.d.ts +81 -0
- package/vendor/typescript/lib.es2015.proxy.d.ts +128 -0
- package/vendor/typescript/lib.es2015.reflect.d.ts +144 -0
- package/vendor/typescript/lib.es2015.symbol.d.ts +46 -0
- package/vendor/typescript/lib.es2015.symbol.wellknown.d.ts +326 -0
- package/vendor/typescript/lib.es2016.array.include.d.ts +116 -0
- package/vendor/typescript/lib.es2016.d.ts +21 -0
- package/vendor/typescript/lib.es2016.intl.d.ts +31 -0
- package/vendor/typescript/lib.es2017.arraybuffer.d.ts +21 -0
- package/vendor/typescript/lib.es2017.d.ts +26 -0
- package/vendor/typescript/lib.es2017.date.d.ts +31 -0
- package/vendor/typescript/lib.es2017.intl.d.ts +44 -0
- package/vendor/typescript/lib.es2017.object.d.ts +49 -0
- package/vendor/typescript/lib.es2017.sharedmemory.d.ts +135 -0
- package/vendor/typescript/lib.es2017.string.d.ts +45 -0
- package/vendor/typescript/lib.es2017.typedarrays.d.ts +53 -0
- package/vendor/typescript/lib.es2018.asyncgenerator.d.ts +77 -0
- package/vendor/typescript/lib.es2018.asynciterable.d.ts +53 -0
- package/vendor/typescript/lib.es2018.d.ts +24 -0
- package/vendor/typescript/lib.es2018.intl.d.ts +83 -0
- package/vendor/typescript/lib.es2018.promise.d.ts +30 -0
- package/vendor/typescript/lib.es2018.regexp.d.ts +37 -0
- package/vendor/typescript/lib.es2019.array.d.ts +79 -0
- package/vendor/typescript/lib.es2019.d.ts +24 -0
- package/vendor/typescript/lib.es2019.intl.d.ts +23 -0
- package/vendor/typescript/lib.es2019.object.d.ts +33 -0
- package/vendor/typescript/lib.es2019.string.d.ts +37 -0
- package/vendor/typescript/lib.es2019.symbol.d.ts +24 -0
- package/vendor/typescript/lib.es2020.bigint.d.ts +765 -0
- package/vendor/typescript/lib.es2020.d.ts +27 -0
- package/vendor/typescript/lib.es2020.date.d.ts +42 -0
- package/vendor/typescript/lib.es2020.intl.d.ts +474 -0
- package/vendor/typescript/lib.es2020.number.d.ts +28 -0
- package/vendor/typescript/lib.es2020.promise.d.ts +47 -0
- package/vendor/typescript/lib.es2020.sharedmemory.d.ts +99 -0
- package/vendor/typescript/lib.es2020.string.d.ts +44 -0
- package/vendor/typescript/lib.es2020.symbol.wellknown.d.ts +41 -0
- package/vendor/typescript/lib.es2021.d.ts +23 -0
- package/vendor/typescript/lib.es2021.intl.d.ts +166 -0
- package/vendor/typescript/lib.es2021.promise.d.ts +48 -0
- package/vendor/typescript/lib.es2021.string.d.ts +33 -0
- package/vendor/typescript/lib.es2021.weakref.d.ts +78 -0
- package/vendor/typescript/lib.es2022.array.d.ts +121 -0
- package/vendor/typescript/lib.es2022.d.ts +25 -0
- package/vendor/typescript/lib.es2022.error.d.ts +75 -0
- package/vendor/typescript/lib.es2022.intl.d.ts +145 -0
- package/vendor/typescript/lib.es2022.object.d.ts +26 -0
- package/vendor/typescript/lib.es2022.regexp.d.ts +39 -0
- package/vendor/typescript/lib.es2022.string.d.ts +25 -0
- package/vendor/typescript/lib.es5.d.ts +4601 -0
- package/vendor/typescript/package.json +4 -0
- package/vendor/typescript/typescript.js +446 -0
- package/web/assets/index-Bh74DfsV.css +1 -0
- package/web/assets/index-UW0RyFFt.js +13 -0
- package/web/index.html +14 -0
|
@@ -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{a as he,b as qt}from"./chunk-342HXE3Q.mjs";import{c as ce,d as de}from"./chunk-FDLXYYG4.mjs";import{b as oe}from"./chunk-4FS7Z7WR.mjs";import{a as ne,b as se,c as ae,d as ie,e as re,f as le}from"./chunk-DFUDV4LX.mjs";import{a as We,b as Vt,c as Qt,d as Zt,f as te,g as je,h as ee,k as Le,l as Ie}from"./chunk-Y6RLRPG3.mjs";import"./chunk-6RGJOMJP.mjs";import"./chunk-QJIR2BLP.mjs";import"./chunk-P2CAZPDP.mjs";import"./chunk-E7LWZRXY.mjs";import{b as Wt,j as Kt}from"./chunk-NSKUTQ5J.mjs";import"./chunk-AUZGSZJH.mjs";import{g as Jt}from"./chunk-BGGDRNYQ.mjs";import"./chunk-6QXGZM36.mjs";import"./chunk-UALRNVSE.mjs";import"./chunk-W3BGBJQW.mjs";import"./chunk-JVHHHGEA.mjs";import{a as Xt}from"./chunk-HYMEEXKN.mjs";import"./chunk-TYK6VNAB.mjs";import"./chunk-CY2FNNAB.mjs";import{a as Pt}from"./chunk-UMHUSOPJ.mjs";import"./chunk-L3QKH4OK.mjs";import"./chunk-W4VKN3GF.mjs";import"./chunk-A55HN5OK.mjs";import"./chunk-5L7RYZCL.mjs";import{spawnSync as Fe}from"node:child_process";import vt from"node:fs/promises";import ht from"node:path";import{pathToFileURL as Pe}from"node:url";import{MATH_IGNORED_TAGS as Ve}from"../browser/shared/components/math.mjs";import{exportPackagesOf as _e,exportSourceOf as De,packagesSaid as He}from"../browser/shared/export-wrap.mjs";import{sha256 as fe}from"../browser/shared/files.mjs";import{attr as ue}from"../browser/shared/html-tree.mjs";import{projectRoot as ze,qaDirectory as Ue,reportsDirectory as Rt}from"../browser/shared/paths.mjs";import{documentDirectory as jt,documentFiles as Lt}from"../browser/shared/workspace.mjs";import{KINDS as Uo,LEVELS as At,LOOKS as pe,WIDE as Go,WIDTHS as ge,layoutNotesOf as Ge,levelOf as Me}from"../browser/shared/qa-levels.mjs";import{tableHidesScript as Ye}from"../browser/shared/table-hides.mjs";var Ke=new Set(["code-scrolls","formula-scrolls"]),Ce=(e,n)=>e.level??Me(e.kind,n),Xe=(e,n)=>["fail","warn"].includes(Ce(e,n))||Ke.has(e.kind)&&Me(e.kind,n)==="info",Je=4,Ee=12,Qe=8,Ze=2,me=200,to=2e3,we=600;function eo({block:e,above:n=null,below:s=null}){let c=[e,n,s].filter(Boolean),r=Math.min(...c.map(h=>h.left)),u=Math.max(...c.map(h=>h.right)),w=n?Math.max(Math.min(n.top,e.top),e.top-me):e.top,d=s?Math.min(Math.max(s.bottom,e.bottom),e.bottom+me):e.bottom,$=(h,q)=>({x:Math.max(0,r),y:Math.max(0,h),width:u-r,height:q-Math.max(0,h)});return e.bottom-e.top<=to?[{part:"",clip:$(w,d)}]:[{part:"top",clip:$(w,e.top+we)},{part:"bottom",clip:$(e.bottom-we,d)}]}function $e(e,n=""){if(e.startsWith("data:"))return`${e.slice(0,30)}\u2026 (${e.length} characters)`;let s=n.slice(0,n.lastIndexOf("/")+1);if(s&&e.startsWith(s)&&e.length>s.length)try{return decodeURIComponent(e.slice(s.length))}catch{return e.slice(s.length)}return e.length>60?`\u2026${e.slice(-59)}`:e}var It=e=>String(e??"").replace(/\s+/g," ").trim(),Mt=(e,n=40)=>{let s=It(e);return`"${s.length>n?`${s.slice(0,n-1)}\u2026`:s}"`},oo=e=>String(e??"").replace(/\s+/g,"").slice(0,120);function no(e,n="doc.html"){let s=new Map,c=new Map,r=new Map,u=($,h)=>(h&&$.sourceCodeLocation.attrs?.[h]||$.sourceCodeLocation).startLine,w=new Map,d=$=>{if($.nodeName==="#text")return $.value;if(!$.tagName&&$.nodeName!=="#document"||$.tagName==="template")return"";let h=($.childNodes??[]).map(d).join("");if(!$.tagName||!$.sourceCodeLocation)return h;let q=ue($,"data-block-id");q!==void 0&&!s.has(q)&&s.set(q,u($,"data-block-id"));let L=ue($,"id");L!==void 0&&!c.has(L)&&c.set(L,u($,"id"));let U=oo(h);if(U.length>=2){let m=`${$.tagName}|${U}`;w.has(m)||w.set(m,[]),w.get(m).push($.sourceCodeLocation)}return h};d(Xt(e));for(let[$,h]of w)r.set($,h.sort((q,L)=>q.startOffset-L.startOffset).map(q=>q.startLine));return{blocks:s,ids:c,texts:r,name:n}}function so(e,n){if(!e)return"the page";let s=n.name??"doc.html",c=h=>{let q=h&&n.texts.get(`${h.tag}|${h.words}`);return q?.[Math.min(h.nth??0,q.length-1)]},r=e.table||e.header?.text,u=e.card?` card ${Mt(e.card.text)}`:r?` table ${Mt(r)}`:"",w=e.blocks?.find(h=>n.blocks.has(h));if(w!==void 0)return`${s}:${n.blocks.get(w)} [data-block-id="${w}"]${u}`;if(c(e.card))return`${s}:${c(e.card)} card ${Mt(e.card.text)}`;if(c(e.header))return`${s}:${c(e.header)} table ${Mt(r)}`;let d=e.texts?.find(c);if(d)return`${s}:${c(d)} ${d===e.texts[0]&&d.tag===e.tag?"":`${e.element} in `}<${d.tag}> ${Mt(d.text,32)}`;let $=e.ids?.find(h=>n.ids.has(h));return $!==void 0?`${s}:${n.ids.get($)} #${$}${u}`:c(e.section)?`${s}:${c(e.section)} ${e.element} in the section ${Mt(e.section.text)}`:`${e.element}${u} (not found in ${s})`}function Ut(e){let n=new Date(e),s=u=>String(u).padStart(2,"0"),c=-n.getTimezoneOffset(),r=`${c<0?"-":"+"}${s(Math.floor(Math.abs(c)/60))}:${s(Math.abs(c)%60)}`;return`${n.getFullYear()}-${s(n.getMonth()+1)}-${s(n.getDate())}T${s(n.getHours())}:${s(n.getMinutes())}:${s(n.getSeconds())}${r}`}function ao(e,n,s={said:"",now:""}){return e===n?s.said===s.now?{stale:!1,why:""}:{stale:!0,packaged:!0,why:`it holds ${s.said||"no component package"}, the workspace has ${s.now||"none of them"}`}:{stale:!0,why:e?`made from a text whose sha256 is ${e.slice(0,12)}\u2026, the file's is ${n.slice(0,12)}\u2026`:"it does not say which text it was made from: made before exports said it, or before the kit's names were doc-* (2026-10-26), whose pages gallery qa no longer reads"}}async function Gt(e,{made:n=!1}={}){let s=Lt(jt(e,Rt)).html,c=qt(e),[r,u]=await Promise.all([vt.readFile(s).catch(()=>null),vt.stat(c).catch(()=>null)]);if(!r)return{problem:`${e}: no document (${s})`};if(!u)return{problem:`${e}: no export (${c}): run gallery export ${e} first`,missing:!0};let w=await vt.readFile(c),d=w.toString("utf8"),$=De(d),h={said:_e(d),now:He(Jt(r.toString("utf8")))},{stale:q,why:L,packaged:U=!1}=ao($,fe(r),h);return q&&!n?{problem:`${e}: ${c} is not of ${s} as it is now (${L}): run gallery export ${e} first`,stale:!0,why:L,edited:!!$&&!U,packaged:U}:{file:c,sha256:fe(w),time:u.mtimeMs}}function io(e,n){let s=e.map((w,d)=>({length:1,weight:n[d],previous:-1})),c=(w,d)=>w.length>d.length||w.length===d.length&&w.weight>d.weight;e.forEach((w,d)=>{for(let $=0;$<d;$++){if(e[$]>=w)continue;let h={length:s[$].length+1,weight:s[$].weight+n[d],previous:$};c(h,s[d])&&(s[d]=h)}});let r=-1;s.forEach((w,d)=>{(r<0||c(w,s[r]))&&(r=d)});let u=[];for(let w=r;w>=0;w=s[w].previous)u.unshift(w);return u}function qe(e,n){let s=n?.places??{},c=new Set((n?.moved??[]).filter(u=>e.has(u))),r=new Map;for(let[u,{parent:w,size:d=0}]of e){let $=s[u];if($){if($[0]!==w){c.add(u);continue}r.has(w)||r.set(w,[]),r.get(w).push({id:u,at:$[1],size:d})}}for(let u of r.values()){let w=new Set(io(u.map(({at:d})=>d),u.map(({size:d})=>d)).map(d=>u[d].id));for(let{id:d}of u)w.has(d)||c.add(d)}return c}function ro(e,n,s,{named:c=null,verified:r=!0,failed:u=!1,seen:w=null,page:d=void 0,packages:$=void 0}={}){if(!r||u||c&&!n)return null;let h=w??new Set([...s.ids,...[...s.held?.values()??[]].flat()]),q=!n,L=q||s.pageChanged?s.cards??[]:[],U=[...n?.unseen??[],...L],m={blocks:{},places:{},moved:q?[]:[...qe(e,n)].filter(x=>!h.has(x)),unseen:[...new Set(U)].filter(x=>e.has(x)&&!h.has(x))};for(let[x,{hash:H,parent:M,at:Z}]of e){let X=q||h.has(x)?H:n.blocks[x];X!==void 0&&(m.blocks[x]=X),m.places[x]=[M,Z]}let C=!q&&(c||s.tiles)?n.page:d;typeof C=="string"&&(m.page=C);let D=!q&&(c||s.tiles)?n.packages:$&&Object.fromEntries(Object.entries($).map(([x,H])=>[x,(s.restyled?.get(x)??[]).every(M=>h.has(M))?H:n.packages[x]]));return D&&Object.keys(D).length&&(m.packages=D),m}function Ae(e){let n=new Map;for(let s of e){let c=new Set(s.held?.covered??[]);for(let r of s.held?.missed??[])c.has(r)||n.set(r,[...n.get(r)??[],s.label??String(s.width)])}return n}function lo(e,n){let s=Ae(n);return new Set([...e.ids,...[...e.held?.values()??[]].flat().filter(c=>!s.has(c))])}function xe(e){let n=e.time?` of ${Ut(e.time)}`:"";return e.from==="export"?`the export${n} (the document before these changes)`:e.from==="preview"?`gallery open${n} (the document before these changes)`:"the last look"}var co=3;function ho(e,n,s=null,{tiles:c=!1,page:r=void 0,packages:u=void 0}={}){let w={rest:[],unknown:[],moved:new Set,around:new Map,held:new Map,groups:[],cards:[],pageChanged:!1,changed:new Set,restyled:new Map,left:null},d=[...e.keys()],$=new Map(d.map((a,O)=>[a,O])),h=n?qe(e,n):new Set,q=a=>typeof n?.packages?.[a]=="string"&&typeof u?.[a]=="string"&&n.packages[a]!==u[a],L=n?d.filter(a=>q(e.get(a).package)&&n.blocks[a]===e.get(a).hash&&!h.has(a)):[],U=new Map;for(let a of L)U.set(e.get(a).package,[...U.get(e.get(a).package)??[],a]);let m=new Set(L),C=n?d.filter(a=>n.blocks[a]!==e.get(a).hash||h.has(a)||m.has(a)):[],D=new Set((n?.unseen??[]).filter(a=>e.has(a)&&!C.includes(a))),x=(a,O)=>{let G=null;for(let et=e.get(a).parent;et!==null&&e.has(et);et=e.get(et).parent)O.has(et)&&(G=et);return G},H=new Set(C),M=new Set(C.filter(a=>e.get(a).card||h.has(a))),Z=a=>H.has(a)&&!h.has(a)&&x(a,M)===null,X=new Map;for(let a of d)for(let O=e.get(a).parent;O!==null&&e.has(O);O=e.get(O).parent){let G=X.get(O)??{all:0,changed:0};G.all+=1,Z(a)&&(G.changed+=1),X.set(O,G)}let gt=d.filter(a=>!e.get(a).card&&X.has(a)&&X.get(a).changed>=co&&X.get(a).changed*2>=X.get(a).all);if(s){let a=[...new Set(s)].filter(o=>e.has(o)),O=new Set(a),G=new Map;for(let o of d){let l=O.has(o)?null:x(o,O);l!==null&&G.set(l,[...G.get(l)??[],o])}let et="the blocks named",$t=new Set([...a,...[...G.values()].flat()]),yt=!!n&&typeof n.page=="string"&&typeof r=="string"&&n.page!==r,xt=new Set([...C.filter(o=>e.get(o).card||h.has(o)),...gt]),bt=!n||yt?d.filter(o=>e.get(o).card&&!C.includes(o)):[],Ft=new Set([...xt,...bt]),Nt=[...C,...gt.filter(o=>!H.has(o))].sort((o,l)=>$.get(o)-$.get(l)).filter(o=>!$t.has(o)&&x(o,xt)===null),Tt=Nt.filter(o=>m.has(o)),t={changed:Nt.filter(o=>!m.has(o)),...Tt.length?{restyled:Tt,packages:[...new Set(Tt.map(o=>e.get(o).package))]}:{},cards:bt.filter(o=>!$t.has(o)&&x(o,Ft)===null).sort((o,l)=>e.get(o).rank-e.get(l).rank||$.get(o)-$.get(l)),since:n?xe(n):"",first:!n};return{...w,ids:a,why:et,groups:[{kind:"named",why:et,ids:a,rest:[]}],held:G,pageChanged:yt,changed:new Set(C),restyled:U,left:t,unknown:[...new Set(s)].filter(o=>!e.has(o))}}if(e.size===0)return{...w,ids:[],why:"the document has no block ids (never handed in): the whole page in tiles instead",tiles:!0};if(c)return{...w,ids:[],why:null,tiles:!0};let p=(...a)=>(O,G)=>a.reduce((et,$t)=>et||$t(O)-$t(G),0),A=a=>e.get(a).rank,J=a=>$.get(a),Q=n?xe(n):"",k=!!n&&typeof n.page=="string"&&typeof r=="string"&&n.page!==r,v=d.filter(a=>e.get(a).card&&!C.includes(a)),F=!n||k||C.length===0?v:v.filter(a=>D.has(a)),tt=new Set([...C.filter(a=>e.get(a).card||h.has(a)),...gt]),ct=new Set([...tt,...F]),nt=new Map,at=(a,O)=>a.filter(G=>{let et=x(G,O);return et!==null&&nt.set(et,[...nt.get(et)??[],G]),et===null}),_=[...at(C,tt),...gt.filter(a=>!H.has(a)&&x(a,tt)===null)].sort(p(a=>+!h.has(a),A,J)),ft=_.filter(a=>m.has(a)),dt=_.filter(a=>!m.has(a)),it=at(F,ct).sort(p(a=>+!D.has(a),A,J)),rt="the cards (chart cards, code blocks, whole blocks, components, flowcharts and Sheet areas, then columns and the other figures, then tables)",b=it.some(a=>D.has(a))?", those no look has pictured yet first":"",z=typeof n?.page=="string"&&typeof r=="string",P=n?k?`${rt.replace("the cards","the cards, not changed themselves")}${b}: the document's own <script> or <style> changed since ${Q}, which may draw any of them`:C.length?"the cards no look has pictured yet (not changed themselves)":`${rt}${b}: no block changed since ${Q}${z?", nor the document's own <script> or <style>":""}`:`${rt}: no earlier look to compare with`,K=[...dt.length?[{kind:"changed",why:`the blocks changed since ${Q}${h.size?" (a moved block pictured with the edges of the blocks before and after it, the moved ones first)":""}`,all:dt}]:[],...ft.length?[{kind:"changed",why:`the instances of a package changed since ${Q} (${[...new Set(ft.map(a=>e.get(a).package))].join(", ")})`,all:ft}]:[],...it.length||!_.length?[{kind:"cards",why:P,all:it}]:[]],R=Ee;for(let a of K)a.ids=a.all.slice(0,R),a.rest=a.all.slice(a.ids.length),R-=a.ids.length,delete a.all;let I=K.flatMap(a=>a.ids),i=a=>{let{parent:O,at:G}=e.get(a),et=$t=>d.find(yt=>e.get(yt).parent===O&&e.get(yt).at===G+$t)??null;return[et(-1),et(1)]},T=new Map(I.filter(a=>h.has(a)).map(a=>[a,i(a)])),N=new Map(I.filter(a=>nt.has(a)).map(a=>[a,nt.get(a)]));return{...w,ids:I,why:K[0].why,groups:K,rest:K.flatMap(a=>a.rest),moved:new Set(I.filter(a=>h.has(a))),around:T,held:N,cards:F,pageChanged:k,changed:new Set(C),restyled:U}}function fo(e){let n=m=>!!m.closest("[data-doc-dev]"),s=[...document.querySelectorAll("details")].filter(m=>!n(m)),c=s.filter(m=>!m.open).length;s.forEach(m=>{m.open||m.setAttribute("data-qa-closed",""),m.open=!0});let r=[...document.images].filter(m=>!n(m));r.forEach(m=>{m.loading==="lazy"&&(m.loading="eager")});let u=[...document.querySelectorAll("dialog")].filter(m=>!n(m)&&!m.open);u.forEach((m,C)=>{m.dataset.qaCard=String(C)});let w=m=>m.parentElement?.closest("dialog[data-qa-card]")??null,d=[...document.querySelectorAll("[data-doc-sheets] > .doc-sheet-tabs > [data-sheet-tab]")].filter(m=>!n(m));d.forEach((m,C)=>{m.dataset.qaTab=String(C)});let $=m=>m.parentElement.parentElement,h=m=>{let C=[];for(let D=m.closest("[data-doc-sheet]");D;D=D.parentElement.closest("[data-doc-sheet]")){let x=d.find(H=>$(H)===D.parentElement&&H.getAttribute("data-sheet-tab")===D.getAttribute("data-doc-sheet"));x&&C.unshift(Number(x.dataset.qaTab))}return C},q=d.map((m,C)=>{let D=[...h($(m)),C],x=[...$(m).children].find(M=>M.getAttribute("data-doc-sheet")===m.getAttribute("data-sheet-tab"));x&&(x.dataset.qaPanel=String(C));let H=w(m);return{index:C,chain:D,card:H?Number(H.dataset.qaCard):null,label:(m.textContent??"").replace(/\s+/g," ").trim(),shown:D.every(M=>d[M].getAttribute("aria-selected")==="true"),panel:!!x}}),L=u.map((m,C)=>{let D=`[href="#${CSS.escape(m.id)}"]`,x=[...m.querySelectorAll("h1, h2, h3, h4")].find(M=>M.textContent.trim())??document.querySelector(D),H=[];for(let M=w(m);M;M=w(M))H.unshift(Number(M.dataset.qaCard));return{index:C,chain:h(m),within:H,label:(x?.textContent||m.id||"").replace(/\s+/g," ").trim()}}),U=Promise.all(r.map(m=>m.decode().catch(()=>{})));return Promise.race([U.then(()=>!0),new Promise(m=>setTimeout(()=>m(!1),e))]).then(m=>({details:s.length,closed:c,images:r.length,loaded:m,sheets:q,cards:L}))}function ye(e){let n=document.querySelector(`[data-qa-card="${e}"]`);return n?(n.open||(globalThis.DocDialogs?globalThis.DocDialogs.open(n,null):typeof n.showModal=="function"?n.showModal():n.setAttribute("open","")),document.activeElement?.blur?.(),Promise.all(n.getAnimations({subtree:!0}).map(s=>s.finished.catch(()=>{}))).then(()=>n.open&&n.getClientRects().length>0)):Promise.resolve(!1)}function _t(e){let n=document.querySelector(`[data-qa-card="${e}"]`);n?.open&&(globalThis.DocDialogs?globalThis.DocDialogs.close(n):typeof n.close=="function"?n.close():n.removeAttribute("open"))}async function uo({selector:e,up:n=0,margin:s=0,frames:c=2}){let r=document.querySelector(e);for(let v=0;v<n&&r;v++)r=r.parentElement;if(!r||r.getClientRects().length===0)return null;let u=r.getBoundingClientRect();r.scrollIntoView({block:"nearest",inline:"nearest"});let w=r.getBoundingClientRect();if(u.top!==w.top||u.left!==w.left){let v=()=>new Promise(Y=>{requestAnimationFrame(()=>Y()),setTimeout(Y,100)});for(let Y=0;Y<c;Y++)await v()}let d=v=>v===document.body||v===document.documentElement,$=(v,Y,F)=>{let{left:tt,top:ct,right:nt,bottom:at}=v;for(let _=Y;_&&!d(_);_=_.parentElement){let ft=getComputedStyle(_),dt=ft.overflowX!=="visible",it=ft.overflowY!=="visible";if(dt||it){let rt=_.getBoundingClientRect();dt&&([tt,nt]=[Math.max(tt,rt.left),Math.min(nt,rt.right)]),it&&([ct,at]=[Math.max(ct,rt.top),Math.min(at,rt.bottom)])}if(_===F)break}return nt>tt&&at>ct?{left:tt,top:ct,right:nt,bottom:at}:null},h=v=>parseFloat(v)||0,q=(v,Y)=>{let F=getComputedStyle(v,Y);if(["none","normal"].includes(F.content)||F.display==="none"||!["absolute","fixed"].includes(F.position))return null;let tt=F.position==="fixed"?null:getComputedStyle(v).position!=="static"?v:v.offsetParent,ct=tt?tt.getBoundingClientRect():{left:0,top:0,right:innerWidth,bottom:innerHeight},nt=tt?getComputedStyle(tt):null,at={left:ct.left+h(nt?.borderLeftWidth),top:ct.top+h(nt?.borderTopWidth),right:ct.right-h(nt?.borderRightWidth),bottom:ct.bottom-h(nt?.borderBottomWidth)},_=(b,z)=>F.boxSizing==="border-box"?0:h(F[`padding${b}`])+h(F[`padding${z}`])+h(F[`border${b}Width`])+h(F[`border${z}Width`]),ft=h(F.width)+_("Left","Right"),dt=h(F.height)+_("Top","Bottom"),it=F.left!=="auto"?at.left+h(F.left)+h(F.marginLeft):F.right!=="auto"?at.right-h(F.right)-h(F.marginRight)-ft:null,rt=F.top!=="auto"?at.top+h(F.top)+h(F.marginTop):F.bottom!=="auto"?at.bottom-h(F.bottom)-h(F.marginBottom)-dt:null;return it===null||rt===null||!(ft>0)||!(dt>0)?null:$({left:it,top:rt,right:it+ft,bottom:rt+dt},v,r)},L=[r.getBoundingClientRect()],U=[r];for(let v of r.querySelectorAll("*"))v instanceof SVGElement&&v.ownerSVGElement||v.matches("script, style, template")||v.getClientRects().length===0||getComputedStyle(v).visibility!=="hidden"&&(U.push(v),L.push($(v.getBoundingClientRect(),v.parentElement,r)));for(let v of U)L.push(q(v,"::before"),q(v,"::after"));let m=document.createRange(),C=document.createTreeWalker(r,NodeFilter.SHOW_TEXT);for(let v=C.nextNode();v;v=C.nextNode())if(!(!v.nodeValue.trim()||!v.parentElement||v.parentElement.closest("svg, script, style, template"))){m.selectNodeContents(v);for(let Y of m.getClientRects())L.push($(Y,v.parentElement,r))}m.detach();let D=L.filter(Boolean),x={left:Math.min(...D.map(v=>v.left)),top:Math.min(...D.map(v=>v.top)),right:Math.max(...D.map(v=>v.right)),bottom:Math.max(...D.map(v=>v.bottom))},H=$(x,r.parentElement,null)??x,M=!1;for(let v=r;v&&!M;v=v.parentElement)M=getComputedStyle(v).position==="fixed";let Z=visualViewport.pageLeft,X=visualViewport.pageTop,[gt,p]=M?[Z+innerWidth,X+innerHeight]:[document.documentElement.scrollWidth,document.documentElement.scrollHeight],A=Math.max(M?Z:0,H.left+Z-s),J=Math.max(M?X:0,H.top+X-s),Q=Math.min(gt,H.right+Z+s),k=Math.min(p,H.bottom+X+s);return Q>A&&k>J?{clip:{x:A,y:J,width:Q-A,height:k-J},fixed:M}:null}function be(e){for(let s of e){let c=document.querySelector(`[data-qa-tab="${s}"]`);c&&c.getAttribute("aria-selected")!=="true"&&c.click()}let n=document.querySelector(`[data-qa-panel="${e.at(-1)}"]`);return!!(n&&!n.hidden&&n.getClientRects().length>0)}function Dt({scope:e,next:n,ignored:s=[],place:c,slack:r=4,whole:u=[],drawn:w=[]}){let d=e?document.querySelector(e):document.body,$=[];if(!d)return{found:$,next:n};let h=document.documentElement.clientWidth,q=Math.round,L=t=>String(t??"").replace(/\s+/g," ").trim(),U=(t,o=32)=>{let l=L(t);return`"${l.length>o?`${l.slice(0,o-1)}\u2026`:l}"`},m=t=>!!t.closest?.("[data-doc-dev]"),C=t=>{if(!t.isConnected||t.getClientRects().length===0)return!1;for(let o=t;o&&o.nodeType===1;o=o.parentElement){let l=getComputedStyle(o);if(l.visibility==="hidden"||l.display==="none"||Number(l.opacity)===0||o.matches(".katex-mathml, .sr-only, [role=tooltip], [data-doc-dev]"))return!1}return!0},D=t=>`${t.localName}${[...t.classList].filter(o=>!o.startsWith("is-")).slice(0,2).map(o=>`.${o}`).join("")}`,x=t=>(t.textContent??"").replace(/\s+/g,"").slice(0,120),H=new Map,M=t=>{let o=x(t);if(!H.has(t.localName)){let y=new Map;for(let B of document.getElementsByTagName(t.localName)){if(m(B))continue;let j=x(B);y.has(j)||y.set(j,[]),y.get(j).push(B)}H.set(t.localName,y)}let l=H.get(t.localName).get(o)?.indexOf(t)??0;return{tag:t.localName,words:o,nth:Math.max(0,l),text:L(t.textContent).slice(0,80)}},Z=t=>{let o=t.cloneNode(!0);for(let l of o.querySelectorAll(".doc-tab"))l.before(" \xB7 ");return L(o.textContent).replace(/^· /,"")},X=t=>{let o=t.matches("table")?t:t.querySelector("table"),l=t.closest(".doc-table-wrap")??t,y=l.getAttribute("data-doc-chart-source")?.trim(),j=(y?[...document.querySelectorAll("[data-doc-chart-data]")].find(S=>S.getAttribute("data-doc-chart-data").trim()===y&&!m(S)):null)?.closest("figure")?.querySelector(":scope > h2, :scope > h3, :scope > h4, :scope > figcaption"),f=l.previousElementSibling;return L(o?.caption?.textContent)||L(j?.textContent)||(f?.matches("p.doc-note")?Z(f):"")||L(o?.querySelector("th")?.textContent??o?.rows[0]?.cells[0]?.textContent)},gt=t=>{let o=t.nodeType===1?t:t.parentElement,l=[],y=[];for(let g=o;g&&g!==document.documentElement;g=g.parentElement)g.hasAttribute("data-block-id")&&l.push(g.getAttribute("data-block-id")),g.id&&!g.hasAttribute("data-qa-tab")&&!g.hasAttribute("data-qa-panel")&&y.push(g.id);let B=[];for(let g=o,W=0;g&&W<4&&!g.matches("body, main, section, [data-doc-sheet], [data-doc-sheets], .doc-columns, .doc-column");g=g.parentElement,W++){let ot=M(g);ot.words.length>=2&&B.push(ot)}let j=o.closest("figure")?.querySelector(":scope > h3, :scope > figcaption, :scope > .doc-figure-caption"),f=o.closest(".doc-table-wrap, table"),S=f?.querySelector("th"),E=o.closest("section")?.querySelector(":scope > h2, :scope > h3, :scope > h4");return{blocks:l,ids:y,texts:B,tag:o.localName,element:D(o),card:j?M(j):null,header:S?M(S):null,table:f?X(f).slice(0,80):null,section:E?M(E):null}};if(c){let t=document.querySelector(c);return{found:$,next:n,anchor:t?gt(t):null}}let p=t=>(t.dataset.qaShot||(t.dataset.qaShot=String(++n)),Number(t.dataset.qaShot)),A=(t,o,l,{picture:y=o,url:B,measured:j,scroll:f,level:S}={})=>$.push({kind:t,what:l,anchor:o?gt(o):null,shot:y?p(y):null,seen:!!(y&&C(y)),url:B,measured:j,scroll:f,...S?{level:S}:{}}),J=t=>t.closest("figure")??t.closest("[data-doc-chart]")??t,Q=t=>{let o=t.getBoundingClientRect();return o.width>0&&o.height>0},k=(t,o,{x:l=!0,y=!0}={})=>Math.max(l?o.left-t.left:-1/0,l?t.right-o.right:-1/0,y?o.top-t.top:-1/0,y?t.bottom-o.bottom:-1/0),v=t=>({left:Math.min(...t.map(o=>o.x)),right:Math.max(...t.map(o=>o.x)),top:Math.min(...t.map(o=>o.y)),bottom:Math.max(...t.map(o=>o.y))}),Y=t=>{let o=t.getBBox(),l=t.getScreenCTM();return v([[o.x,o.y],[o.x+o.width,o.y],[o.x+o.width,o.y+o.height],[o.x,o.y+o.height]].map(([y,B])=>new DOMPoint(y,B).matrixTransform(l)))},F=t=>{let o=[];for(let l=t.parentElement;l&&l!==document.documentElement;l=l.parentElement){let y=getComputedStyle(l);l instanceof SVGSVGElement&&y.overflow!=="visible"&&o.push(["the svg's edge",l.getBoundingClientRect(),{}]);let B=/url\(\s*["']?#([^)"']+)/.exec(`${l.getAttribute?.("clip-path")??""} ${y.clipPath??""}`)?.[1],j=B?document.getElementById(B):null,f=j?.getAttribute("clipPathUnits")!=="objectBoundingBox"?j?.querySelector("rect"):null;if(f&&l.getScreenCTM){let[S,E,g,W]=["x","y","width","height"].map(ot=>f[ot].baseVal.value);o.push(["a clip-path",v([[S,E],[S+g,E+W]].map(([ot,lt])=>new DOMPoint(ot,lt).matrixTransform(l.getScreenCTM()))),{}])}if(!(l instanceof SVGElement)){let S=/hidden|clip/.test(y.overflowX),E=/hidden|clip/.test(y.overflowY);(S||E)&&o.push([D(l),l.getBoundingClientRect(),{x:S,y:E}])}}return o},tt=t=>`${t.slice(0,4).join("; ")}${t.length>4?`; ${t.length-4} more`:""}`,ct=t=>!t.matches("script, [data-doc-dev]")&&(t.matches("svg, canvas")||t.querySelector("svg, canvas")||C(t)&&Q(t));for(let t of d.querySelectorAll("[data-doc-chart]"))m(t)||!C(t)||[...t.children].some(ct)||A("chart-empty",t,`the ${t.getAttribute("data-doc-chart")||"chart"} chart drew nothing`,{picture:J(t)});let nt=[...d.querySelectorAll("svg")].filter(t=>{if(t.parentElement.closest("svg")||m(t)||t.closest(".katex, .doc-icon, button")||!C(t))return!1;let o=t.getBoundingClientRect();return t.closest("[data-doc-chart], figure")||o.width>=120&&o.height>=60}),at={across:.6,down:.25},_=new Map;for(let t of nt){let o=J(t),l=o.getBoundingClientRect(),y=[],B=[],j=[...t.querySelectorAll("text")].filter(E=>!E.closest("defs, clipPath, mask, pattern, marker, symbol")&&L(E.textContent)&&C(E));for(let E of j){let g=Y(E),W=F(E).map(([ot,lt,ut])=>[ot,k(g,lt,ut)]).find(([,ot])=>ot>1.5);W?y.push(`${U(E.textContent,24)} ${q(W[1])}px past ${W[0]}`):k(g,l)>1.5&&B.push(`${U(E.textContent,24)} ${q(k(g,l))}px past the card's edge`)}y.length&&A("chart-text-clipped",t,tt(y),{picture:o}),B.length&&A("chart-text-outside",t,tt(B),{picture:o});let f=E=>{let g=/^(-?)[$¥€£]?(\d[\d,]*(?:\.\d+)?)\s*(?:%|‰|[kKMBG]|万|亿)?$/.exec(E.replace(/[−–]/g,"-"));return g?+`${g[1]}${g[2].replace(/,/g,"")}`:NaN},S=E=>E.every(Number.isFinite)&&E[1]!==E[0]&&E.slice(2).every((g,W)=>Math.abs(g-E[W+1]-(E[1]-E[0]))<=1e-9*Math.max(1,Math.abs(g)));for(let E of t.querySelectorAll("g")){let g=[...E.children].filter(V=>V.matches("g.tick")&&C(V)),W=g.map(V=>V.querySelector("text")).filter(V=>V&&L(V.textContent)&&C(V)),ot=W.map(V=>L(V.textContent));if(ot.length<2||ot.length!==g.length||!S(ot.map(f)))continue;let lt=W.map(V=>{let kt=V.getScreenCTM(),Ne=(parseFloat(getComputedStyle(V).fontSize)||0)*(kt?Math.hypot(kt.c,kt.d):1);return{label:V,box:Y(V),size:Ne,turned:!!kt&&Math.abs(kt.b)>.001*Math.abs(kt.a)}});if(lt.some(V=>V.turned||!(V.size>0)))continue;let ut=lt.map(({box:V})=>[(V.left+V.right)/2,(V.top+V.bottom)/2]),st=Math.max(...ut.map(([V])=>V))-Math.min(...ut.map(([V])=>V))>=Math.max(...ut.map(([,V])=>V))-Math.min(...ut.map(([,V])=>V)),mt=({box:V,size:kt})=>st?[V.left,V.right]:[(V.top+V.bottom-kt)/2,(V.top+V.bottom+kt)/2],St=[...lt].sort((V,kt)=>mt(V)[0]-mt(kt)[0]),wt=null;for(let V=1;V<St.length;V++){let kt=mt(St[V])[0]-mt(St[V-1])[1];(!wt||kt<wt.gap)&&(wt={gap:kt,pair:[St[V-1],St[V]]})}let Ct=Math.max(...lt.map(V=>V.size));if(!wt||wt.gap>=at[st?"across":"down"]*Ct)continue;for(let{label:V}of lt)_.set(V,E);let[Bt,Et]=wt.pair.map(({label:V})=>U(V.textContent,16)),Te=wt.gap<0?`${Bt} and ${Et} overlapping by ${q(-wt.gap)}px`:`${Bt} and ${Et} ${q(wt.gap)}px apart`;A("ticks",t,`${ot.length} tick labels ${st?"across":"down"} a ${q(st?t.getBoundingClientRect().width:t.getBoundingClientRect().height)}px chart crowd: ${Te}, under ${st?"a digit's width and a hair":"a quarter of a line"} at their ${q(Ct)}px (${ot.slice(0,6).join(", ")}${ot.length>6?", \u2026":""})`,{picture:o})}}let ft=t=>{let o=t.getBBox(),l=t instanceof SVGTextElement&&parseFloat(getComputedStyle(t).fontSize)||o.height,y=o.y+Math.max(0,(o.height-l)/2),B=y+Math.min(o.height,l),j=t.getScreenCTM();return[[o.x,y],[o.x+o.width,y],[o.x+o.width,B],[o.x,B]].map(([f,S])=>new DOMPoint(f,S).matrixTransform(j))},dt=(t,o)=>{let l=1/0;for(let y of[t,o])for(let B=0;B<y.length;B++){let j=y[B],f=y[(B+1)%y.length],S=Math.hypot(f.x-j.x,f.y-j.y);if(S===0)continue;let E={x:-(f.y-j.y)/S,y:(f.x-j.x)/S},g=ut=>ut.map(st=>st.x*E.x+st.y*E.y),[W,ot]=[g(t),g(o)],lt=Math.min(Math.max(...W),Math.max(...ot))-Math.max(Math.min(...W),Math.min(...ot));if(lt<=0)return 0;l=Math.min(l,lt)}return l===1/0?0:l},it=t=>[...t.querySelectorAll("text")].filter(o=>!o.closest("defs, clipPath, mask, pattern, marker, symbol")&&L(o.textContent)&&C(o));for(let t of nt){let o=it(t).map(y=>({label:y,outline:ft(y)})),l=[];o.forEach(({label:y,outline:B},j)=>{for(let f of o.slice(j+1))_.has(y)&&_.get(y)===_.get(f.label)||dt(B,f.outline)>1.5&&l.push(`${U(y.textContent,20)} and ${U(f.label.textContent,20)} overlap`)}),l.length&&A("chart-text-overlap",t,tt(l),{picture:J(t)})}let rt=11;for(let t of nt){if(!t.hasAttribute("viewBox"))continue;let o=[];for(let B of it(t)){let j=B.getScreenCTM(),f=parseFloat(getComputedStyle(B).fontSize);if(!j||!(f>0))continue;let S=f*Math.hypot(j.c,j.d);S<rt-.05&&o.push(`${U(B.textContent,24)} at ${S.toFixed(1)}px (font-size ${+f.toFixed(2)})`)}if(!o.length)continue;let l=t.viewBox.baseVal,y=`${o.length} text${o.length>1?"s":""}`;A("svg-text-small",t,`${y} of a drawing scaled by its viewBox (${+l.width.toFixed(2)}\xD7${+l.height.toFixed(2)} drawn ${q(t.getBoundingClientRect().width)}px wide) render below ${rt}px: ${tt(o)}`,{picture:J(t)})}let b=new Set;for(let t of d.querySelectorAll(".doc-table-wrap")){if(m(t)||!C(t))continue;b.add(t);let o=t.querySelector("table");if(!o)continue;let l=Math.max(t.clientWidth,o.offsetWidth),y=Math.max(t.clientHeight,o.offsetHeight),B=l>t.clientWidth+r,j=y>t.clientHeight+r,f=X(t);(B||j)&&A("table-scrolls",t,[B&&`${l}px wide in a ${t.clientWidth}px frame`,j&&`${y}px tall in a ${t.clientHeight}px frame`].filter(Boolean).join(", "),{scroll:{sideways:B,down:j,name:f}});let S=globalThis.__qaTableHides(t,o);S.said&&A("table-columns",t,`${S.said}: the table is ${l}px wide in a ${t.clientWidth}px frame`),S.shown<S.rows&&!t.style.getPropertyValue("--doc-table-height")&&A("table-rows",t,`the frame shows ${S.shown} of ${S.rows} rows: a reader scrolls inside it for the other ${S.rows-S.shown}; style="--doc-table-height: none" on its div.doc-table-wrap shows every row (or split the table where its content divides)`)}let z=t=>!!t.closest("details[data-qa-closed]"),P="in a disclosure closed in the file: a reader who opens it scrolls";for(let t of d.querySelectorAll(".doc-code, .doc-diff")){if(m(t)||!C(t))continue;let o=t.querySelector(":scope > pre, :scope > .doc-diff-body");if(o&&C(o)){let y=z(t);if(o.scrollHeight>o.clientHeight+r){let B=[t,o].map(E=>E.style.getPropertyValue("--doc-code-height").trim()).find(Boolean),j=o.getBoundingClientRect().top+o.clientTop+o.clientHeight,f=[...o.querySelectorAll(".doc-code-line")].filter(E=>E.getClientRects().length>0&&E.getBoundingClientRect().top>=j-1).length,S=y?`, ${P} inside it for the rest`:B?`, the block's own height (--doc-code-height: ${B}, the author's or the reader's): a reader scrolls inside it for the rest`:": a reader scrolls inside it for the rest";A("code-scrolls",t,`the code is ${o.scrollHeight}px tall, its frame ${o.clientHeight}px${f?` (its last ${f} line${f===1?"":"s"} below it)`:""}${S}`,{level:y||B?"info":void 0})}if(o.scrollWidth>o.clientWidth+r){let B=t.classList.contains("doc-code--nowrap"),j=y?`, ${P} sideways for the rest`:B?", its lines left unwrapped (doc-code--nowrap, the author's or the reader's choice): a reader scrolls sideways for the rest of its long lines":": a reader scrolls sideways for the rest";A("code-scrolls",t,`the code is ${o.scrollWidth}px wide, its frame ${o.clientWidth}px${j}`,{level:y||B?"info":void 0})}}let l=t.querySelector(":scope > .doc-code-title");l&&C(l)&&l.scrollWidth>l.clientWidth+1&&A("code-title-cut",t,`its title ${U(l.textContent,48)} is cut to fit its header (${l.scrollWidth}px of words in ${l.clientWidth}px)`)}for(let t of d.querySelectorAll(".doc-math-block")){if(m(t)||!C(t)||t.scrollWidth<=t.clientWidth+r)continue;let o=z(t);A("formula-scrolls",t,`the formula is ${t.scrollWidth}px wide, its frame ${t.clientWidth}px${o?`, ${P} it sideways for the rest`:": a reader scrolls it sideways for the rest"}`,{level:o?"info":void 0})}for(let t of d.querySelectorAll("[data-doc-layout]"))m(t)||!C(t)||A("layout",t,t.getAttribute("data-doc-layout"),{picture:t.closest("figure, .doc-table-wrap")??t,measured:b.has(t)});let K=document.createTreeWalker(d,NodeFilter.SHOW_TEXT),R=new Map;for(let t=K.nextNode();t;t=K.nextNode()){if(!/\\\(|\\\[|\$\$/.test(t.nodeValue))continue;let o=t.parentElement;if(!o||o.closest([...s,".katex","[data-doc-dev]"].join(", "))||!C(o))continue;let l=o.closest("p, li, h1, h2, h3, h4, td, th, figcaption, summary, blockquote, dd, dt")??o;R.has(l)||R.set(l,t.nodeValue)}for(let[t,o]of R){let l=o.search(/\\\(|\\\[|\$\$/);A("raw-formula",t,`${U(o.slice(l,l+40),40)} is shown as written: the kit's math did not render it`)}for(let t of d.querySelectorAll(".katex-error"))m(t)||!C(t)||A("formula-error",t,`${U(t.textContent,32)}: ${L(t.getAttribute("title"))||"KaTeX could not read it"}`);let I=t=>`"${globalThis.__qaUrlName?.(t,document.baseURI)??t}"`,i=t=>{try{return new URL(t,document.baseURI).href}catch{return t}},T=t=>[...["src","href","poster","data"].filter(o=>t.hasAttribute(o)&&!(o==="href"&&t.matches("a, area"))).map(o=>t.getAttribute(o)),...(t.getAttribute("srcset")??"").split(",").map(o=>o.trim().split(/\s+/)[0]),...[t.getAttribute("style"),t.localName==="style"?t.textContent:""].flatMap(o=>[...String(o??"").matchAll(/url\(\s*["']?([^"')]+)/g)].map(l=>l[1]))].filter(o=>o&&!o.trim().startsWith("#")).map(i),N=[...document.querySelectorAll("*")].filter(t=>!m(t)).flatMap(t=>T(t).map(o=>({node:t,address:o}))),a=new Set;for(let{url:t,directive:o}of globalThis.__qaViolations??[]){let l=/^[a-z][a-z\d+.-]*$/i.test(t)?`${t.toLowerCase()}:`:null,y=N.find(j=>l?!a.has(j)&&j.address.startsWith(l):j.address===t);y&&l&&a.add(y);let B=y?.node??null;e&&!(B&&d.contains(B))||A("blocked",B,`${o} blocked ${I(y?.address??t)}${B?` (${D(B)})`:""}: the export holds every file it shows`,{url:y?.address??t})}for(let t of d.querySelectorAll("img")){if(m(t)||t.complete&&t.naturalWidth>0)continue;let o=t.currentSrc||t.src?i(t.currentSrc||t.src):"";A("image",t,`${o?I(o):"a picture with no src"} did not load`,{picture:t.closest("figure")??t,url:o})}let O=new Set(u),G=new Set(w),et=document.createRange(),$t="button, select, input, textarea, [data-doc-dev]",yt=(t,o)=>t!==o&&(t.matches($t)||[...t.classList].some(l=>l.startsWith("doc-"))),xt=(t,o,l)=>{let y=[],B=!1;for(let j=t,f=!0;j&&j!==document.body&&j!==document.documentElement;j=j.parentElement,f=!1){let S=getComputedStyle(j);if((!f||l)&&(B&&(S.position!=="static"||S.transform!=="none")&&(B=!1),!B)){if(/auto|scroll/.test(S.overflowY))break;/hidden|clip/.test(S.overflowY)&&!yt(j,o)&&y.push(j)}if(S.position==="fixed")break;S.position==="absolute"&&(B=!0)}return y},bt=t=>t.getBoundingClientRect().bottom-(parseFloat(getComputedStyle(t).borderBottomWidth)||0),Ft=t=>{let o=getComputedStyle(t),l=y=>!/^(transparent|rgba\(.*,\s*0\))$/.test(y);return l(o.backgroundColor)||o.backgroundImage!=="none"||["Top","Right","Bottom","Left"].some(y=>parseFloat(o[`border${y}Width`])>0&&o[`border${y}Style`]!=="none"&&l(o[`border${y}Color`]))},Nt="rect, circle, ellipse, line, polyline, polygon, path, use",Tt=(t,o)=>{let l=new Map,y=(f,S,E,g)=>{if(!l.has(f)&&l.size>=3)return;let W=l.get(f)??{words:[],marks:[],depth:0,height:f.getBoundingClientRect().height};E&&W.words.push(E),g&&W.marks.push(g),W.depth=Math.max(W.depth,S),l.set(f,W)},B=f=>f.getBoundingClientRect().height>1.5,j=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(let f=j.nextNode();f;f=j.nextNode()){let S=f.parentElement;if(!f.nodeValue.trim()||!S||S.closest("svg, script, style, template, .katex")||!C(S)||o(S))continue;let E=xt(S,t,!0).filter(B);if(E.length===0)continue;let g=getComputedStyle(S),W=parseFloat(g.lineHeight);for(let ot of f.nodeValue.matchAll(/\S+/g)){let lt=ot.index+ot[0].length;et.setStart(f,ot.index),et.setEnd(f,lt);let ut=[...et.getClientRects()];for(let st of ut){let mt=Number.isFinite(W)?Math.max(0,(st.height-W)/2):0,St=E.find(Ct=>st.bottom-bt(Ct)>1.5+mt);if(!St)continue;let wt=ot.index;if(ut.length>1){let Ct=bt(St)+1.5+mt;for(let Bt=lt-1;wt<Bt;){let Et=wt+Bt>>1;et.setStart(f,Et),et.setEnd(f,Et+1),(et.getClientRects()[0]?.bottom??0)>Ct?Bt=Et:wt=Et+1}}y(St,Math.max(...ut.map(Ct=>Ct.bottom))-bt(St),f.nodeValue.slice(wt,lt),null);break}}}for(let f of t.querySelectorAll("*")){let S=f instanceof SVGElement&&f.matches(Nt)&&!f.closest("defs, clipPath, mask, pattern, marker, symbol"),E=!S&&!(f instanceof SVGElement)&&!f.matches("img, picture, video, canvas, iframe, object, embed, script, style, template")&&f.children.length===0&&!f.textContent.trim()&&Ft(f);if(!S&&!E||!C(f))continue;let g=f.getBoundingClientRect();if(g.width<=0&&g.height<=0)continue;let W=S?f.ownerSVGElement:null,ot=[...W&&getComputedStyle(W).overflowY!=="visible"?[W]:[],...xt(W??f,t,!!W)].filter(B),lt=st=>{let mt=st.getBoundingClientRect();return g.left>=mt.left-1.5&&g.right<=mt.right+1.5&&g.top>=mt.top-1.5},ut=ot.find(st=>g.bottom-bt(st)>1.5&<(st));ut&&y(ut,g.bottom-bt(ut),null,S?f.localName:D(f))}return l};for(let t of d.querySelectorAll("[data-block-id]")){let o=t.getAttribute("data-block-id"),l=G.has(o);if(!l&&!O.has(o)||m(t)||!C(t))continue;let y=f=>f.closest(".doc-chart-message")||f.closest("h2, h3, h4, p, figcaption")?.parentElement===t,B=new Map,j=document.createTreeWalker(t,NodeFilter.SHOW_TEXT);for(let f=j.nextNode();f&&B.size<3;f=j.nextNode()){let S=f.parentElement;if(!f.nodeValue.trim()||!S||S.closest("svg, script, style, template, .katex")||!C(S)||l&&y(S))continue;let E=S;for(;E!==t&&["inline","contents"].includes(getComputedStyle(E).display);)E=E.parentElement;let g=!1;for(let st=S;st&&!g;st=st===t?null:st.parentElement){let mt=getComputedStyle(st);g=mt.overflowX!=="visible"||mt.overflowY!=="visible"}if(g)continue;let W=getComputedStyle(E),ot=E.getBoundingClientRect(),lt=ot.left+parseFloat(W.borderLeftWidth)+parseFloat(W.paddingLeft),ut=ot.right-parseFloat(W.borderRightWidth)-parseFloat(W.paddingRight);for(let st of f.nodeValue.matchAll(/\S+/g)){et.setStart(f,st.index),et.setEnd(f,st.index+st[0].length);let mt=[...et.getClientRects()],St=Math.max(0,...mt.flatMap(Ct=>[Ct.right-ut,lt-Ct.left]));if(St<=1.5||mt.some(Ct=>Ct.right>h+1))continue;let wt=B.get(E)??{words:[],reach:0,width:ut-lt};wt.words.push(st[0]),wt.reach=Math.max(wt.reach,St),B.set(E,wt)}}for(let[f,{words:S,reach:E,width:g}]of B)A("overflow-in-block",f,`the words ${U(S.join(" "),40)} run ${q(E)}px past the side of ${D(f)} (${q(g)}px wide for its words), over what is beside it`,{picture:t});for(let[f,{words:S,marks:E,depth:g,height:W}]of Tt(t,l?y:()=>!1)){let ot=[S.length&&`the words ${U(S.join(" "),40)}`,E.length&&`${E.length===1?"a mark":`${E.length} marks`} (${[...new Set(E)].slice(0,3).join(", ")})`].filter(Boolean).join(" and "),lt=S.length===0&&E.length===1;A("cut-in-block",f,`${ot} ${lt?"reaches":"reach"} ${q(g)}px past the bottom of ${D(f)} (${q(W)}px tall, its overflow ${getComputedStyle(f).overflowY}), cut off there`,{picture:t})}}if(et.detach(),document.documentElement.scrollWidth>h+1){let t=g=>{for(let W=g.parentElement;W&&W!==document.body;W=W.parentElement)if(getComputedStyle(W).overflowX!=="visible")return!1;return g.nodeType!==1||getComputedStyle(g).position!=="fixed"},o=[...d.querySelectorAll("*")].filter(g=>!(g instanceof SVGElement&&g.ownerSVGElement)&&!m(g)&&g.getBoundingClientRect().right>h+1&&C(g)&&t(g)),l=o.filter(g=>!o.includes(g.parentElement)).slice(0,3),y=`the page is ${document.documentElement.scrollWidth}px wide in a ${h}px window`,B=new Set(o),j=g=>{for(let W=g.parentElement;W;W=W.parentElement)if(B.has(W))return!0;return!1},f=new Map,S=document.createRange(),E=document.createTreeWalker(d,NodeFilter.SHOW_TEXT);for(let g=E.nextNode();g&&f.size<3;g=E.nextNode()){let W=g.parentElement;if(!W||!g.nodeValue.trim()||W.closest("svg, script, style, template")||m(W)||j(g)||!C(W)||!t(g)||(S.selectNodeContents(g),![...S.getClientRects()].some(st=>st.right>h+1)))continue;let ot=W.closest("[data-block-id]")??W;if(f.has(ot))continue;let lt=[],ut=0;for(let st of g.nodeValue.matchAll(/\S+/g)){S.setStart(g,st.index),S.setEnd(g,st.index+st[0].length);let mt=Math.max(...[...S.getClientRects()].map(St=>St.right),0);mt<=h+1||(lt.push(st[0]),ut=Math.max(ut,mt))}lt.length&&f.set(ot,{node:W,words:lt.join(" "),right:ut})}S.detach(),l.length===0&&f.size===0&&!e&&A("overflow",null,y);for(let g of l)A("overflow",g,`${y}: ${D(g)} ${U(g.textContent,24)} reaches ${q(g.getBoundingClientRect().right)}px`);for(let[g,{node:W,words:ot,right:lt}]of f)A("overflow",W,`${y}: the words ${U(ot,60)} in ${D(g)} run past its edge to ${q(lt)}px (a text that cannot break)`,{picture:g})}return{found:$,next:n}}function po(){let e=s=>!!s.closest("[data-doc-dev]"),n=s=>[...document.querySelectorAll(s)].filter(c=>!e(c)).length;return{charts:n("[data-doc-chart]"),tables:n(".doc-table-wrap"),height:document.documentElement.scrollHeight}}var Ot=2e4,Se=1800;function ke(e,n,s){let c=0,r=new Promise((u,w)=>{c=setTimeout(()=>w(new Error(`${s}: no answer in ${n/1e3}s`)),n)});return Promise.race([e,r]).finally(()=>clearTimeout(c))}var Yt=e=>`${e.kind}|${JSON.stringify(e.anchor)}|${e.what}`;async function go(e,n,s,{out:c,tiles:r=!1,blocks:u=[],around:w=new Map,held:d=new Map,whole:$=[],drawn:h=[],known:q=null}){let{width:L,height:U=900,label:m=String(L)}=typeof s=="number"?{width:s}:s,C=m.replace("\xD7","x"),D=await e.createBrowserContext(),x=await D.newPage();x.setDefaultTimeout(Ot);let H=[],M=[],Z=new Set,X=new Map,gt=new Set,p=new Set,A=new Set,J="",Q=0,k=(b,z,P={})=>H.push({kind:b,what:z,anchor:null,shot:null,seen:!1,state:J,...P}),v=Pe(n).href,Y=b=>`"${$e(b,v)}"`,F=b=>c.folders?.get(b)??c.blocks,tt=b=>b.replace(/[^\w-]/g,"_");x.on("pageerror",b=>k("error",`uncaught ${It(b.message).slice(0,200)}`)),x.on("console",b=>{b.type()==="error"&&ae(b,v)&&k("error",`console: ${It(b.text()).slice(0,200)}`)}),x.on("requestfailed",b=>{b.frame()===x.mainFrame()&&k("request",`${Y(b.url())}: ${b.failure()?.errorText??"failed"}`,{url:b.url()})}),x.on("response",b=>{b.status()>=400&&b.request().frame()===x.mainFrame()&&k("request",`${Y(b.url())}: HTTP ${b.status()}`,{url:b.url()})}),await ie(x),await x.evaluateOnNewDocument(`globalThis.__qaUrlName = ${$e}; globalThis.__qaTableHides = ${Ye()};`),await x.setViewport({width:L,height:U}),await x.emulateMediaFeatures([{name:"prefers-color-scheme",value:"light"}]);let ct=async b=>{for(let z of await le(x,{timeout:Ot}))k("unverified",`${b}: waited for ${z}`)},nt=async(b,z,P,K)=>ke(x.screenshot({path:P,clip:b,captureBeyondViewport:!z}),Ot,"the picture").then(()=>!0,R=>(k("unverified",`no picture of ${K} (${R.message})`),!1)),at=async(b,z,P,K=0)=>{let R=await x.evaluate(uo,{selector:b,up:K,margin:Qe,frames:Ze}).catch(I=>({error:I}));return R?.clip?await nt(R.clip,R.fixed,z,P)?R.clip:null:(k("unverified",`no picture of ${P} (${R?.error?.message??"the element is gone or shows nothing"})`),null)},_=(b,z)=>b.left<z.x+z.width&&b.right>z.x&&b.top<z.y+z.height&&b.bottom>z.y,ft=async()=>{let b=u.filter(P=>!gt.has(P)),z=await x.evaluate((P,K,R)=>{let I=new Map(P.map((O,G)=>[O,G])),i=O=>!!O&&!O.closest("[data-doc-dev], dialog:not([open])")&&O.getClientRects().length>0,T=O=>O===null?null:[...document.querySelectorAll("[data-block-id]")].find(G=>G.getAttribute("data-block-id")===O&&i(G))??null,N=O=>{if(!O)return null;let G=O.getBoundingClientRect();return{left:G.left+scrollX,right:G.right+scrollX,top:G.top+scrollY,bottom:G.bottom+scrollY}},a=[];for(let O of document.querySelectorAll("[data-block-id]")){let G=I.get(O.getAttribute("data-block-id"));if(G===void 0||!i(O))continue;I.delete(O.getAttribute("data-block-id")),O.setAttribute("data-qa-block",String(G));let[et,$t]=K[G]??[],yt=(R[G]??[]).map(xt=>[xt,[...O.querySelectorAll("[data-block-id]")].find(bt=>bt.getAttribute("data-block-id")===xt&&i(bt))]).filter(([,xt])=>xt);a.push({index:G,boxes:K[G]?{block:N(O),above:N(T(et)),below:N(T($t))}:null,held:yt.map(([xt,bt])=>({id:xt,box:N(bt)}))})}return a},b,b.map(P=>w.get(P)??null),b.map(P=>d.get(P)??[]));for(let{index:P,boxes:K,held:R}of z){let I=b[P];gt.add(I);let i=`${C}-${tt(I)}`,T=[];if(!K){let N=ht.join(F(I),`${i}.png`),a=await at(`[data-qa-block="${P}"]`,N,`the block ${I}`);a&&(M.push({block:I,file:N}),T.push(a))}for(let{part:N,clip:a}of K?eo(K):[]){let O=ht.join(F(I),`${i}${N?`-${N}`:""}.png`);await nt(a,!1,O,`the block ${I}${N?` (its ${N})`:""}`)&&(M.push({block:I,file:O}),T.push(a))}for(let{id:N,box:a}of R)T.some(O=>_(a,O))?p.add(N):p.has(N)||A.add(N);await x.evaluate(N=>document.querySelector(`[data-qa-block="${N}"]`)?.removeAttribute("data-qa-block"),P)}},dt=async(b,z,P)=>{let K=[...d].filter(([I])=>gt.has(I)).map(([I,i])=>[I,i.filter(T=>!p.has(T))]).filter(([,I])=>I.length);if(!K.length)return;let R=await x.evaluate((I,i)=>{let T=document.querySelector(I);if(!T)return[];let N=a=>[...T.querySelectorAll("[data-block-id]")].some(O=>O.getAttribute("data-block-id")===a&&O.getClientRects().length>0);return i.map(([a,O])=>[a,O.filter(N)]).filter(([,a])=>a.length)},b,K);for(let[I,i]of R){let T=ht.join(F(I),`${C}-${tt(I)}-${z}.png`);if(await at(b,T,`the block ${I} (${z})`,P)){M.push({block:I,part:z,file:T});for(let N of i)p.add(N),A.delete(N)}}},it=async b=>{let z=await x.evaluate(Dt,{scope:b,next:Q,ignored:Ve,slack:Je,whole:$,drawn:h});Q=z.next;let P=z.found.flatMap(R=>R.kind!=="layout"?[R]:Ge(R.what,L).filter(({kind:I})=>!(R.measured&&["table-columns","table-rows"].includes(I))).map(({kind:I,note:i})=>({...R,kind:I,what:`the kit notes ${i}`})));for(let R of P){let I=R.shot===null?null:`${R.kind}|${R.shot}|${R.what}`,i=I&&X.get(I);if(i)!i.seen&&R.seen&&Object.assign(i,R,{state:J});else{let T={...R,state:J};H.push(T),I&&X.set(I,T)}}let K=new Set(H.filter(R=>R.kind==="blocked").map(R=>R.url));for(let R of H){if(R.shot===null||!R.seen||Z.has(R.shot)||!Xe(R,L)||q?.has(Yt(R))||["request","image"].includes(R.kind)&&K.has(R.url))continue;Z.add(R.shot);let I=ht.join(c.flagged,`${C}-${String(R.shot).padStart(2,"0")}-${R.kind}.png`);await at(`[data-qa-shot="${R.shot}"]`,I,R.kind)&&M.push({shot:R.shot,file:I})}u.length&&await ft()},rt=b=>{let z=new Set(H.filter(K=>K.kind==="blocked").map(K=>K.url));return{findings:H.filter(K=>!(["request","image"].includes(K.kind)&&z.has(K.url))&&!q?.has(Yt(K))),counts:b,pictures:M,held:{covered:[...p],missed:[...A]}}};try{try{let i=new Promise(N=>x.once("domcontentloaded",N)),T=x.goto(v,{waitUntil:"load",timeout:6e4});if(T.catch(()=>{}),await Promise.race([i,T]),x.url()!==v)throw new Error(`the browser shows ${x.url()}`)}catch(i){return k("unverified",`the page did not load: ${i.message}`),rt(null)}await ct("the page as it opens");let b=await x.evaluate(fo,Ot);b.loaded||k("unverified",`the pictures (${b.images}) not all loaded in ${Ot/1e3}s`),b.closed&&await ct(`the page with its ${b.closed} closed disclosure${b.closed===1?"":"s"} opened`),await it(null);let z=async(i,T,N,a=null)=>{for(let O=i,G=1;O<T;O+=Se,G++){let et=ht.join(c.tiles,`${C}-${N}${String(G).padStart(2,"0")}.png`);await ke(x.screenshot({path:et,clip:{x:0,y:O,width:L,height:Math.min(Se,T-O)},captureBeyondViewport:!0}),Ot,"a tile").then(()=>M.push({tile:!0,sheet:a,file:et}),$t=>k("unverified",`no tile ${N}${G} (${$t.message})`))}};r&&await z(0,await x.evaluate(()=>document.documentElement.scrollHeight),"");let P=async(i,T=null)=>{if(!await x.evaluate(be,i.chain)){let{anchor:N}=await x.evaluate(Dt,{next:Q,place:`[data-qa-tab="${i.index}"]`});return k("unverified","this Sheet could not be shown: its tab was clicked and its panel stayed hidden",{anchor:N}),!1}if(await ct("the Sheet shown"),await it(`[data-qa-panel="${i.index}"]`),await dt(`[data-qa-panel="${i.index}"]`,`sheet${i.index+1}`,1),r&&T)await K(T,`sheet${i.index+1}-`);else if(r){let N=await x.evaluate(a=>{let O=document.querySelector(`[data-qa-panel="${a}"]`)?.getBoundingClientRect();return O&&O.height>0?{top:Math.max(0,O.top+scrollY),bottom:O.bottom+scrollY}:null},i.index);N&&await z(N.top,N.bottom,`sheet${i.index+1}-`,{number:i.index+1,label:i.label})}return!0},K=async(i,T="")=>{for(let N=1;N<=20;N++){let a=await x.evaluate((G,et)=>{let $t=document.querySelector(`[data-qa-card="${G}"]`),yt=$t?.querySelector(".doc-dialog-content")??$t;if(!yt)return null;if(et)yt.scrollTop=0;else{let bt=yt.scrollTop;if(yt.scrollTop+=Math.max(40,yt.clientHeight-24),yt.scrollTop===bt)return null}let xt=$t.getBoundingClientRect();return{x:xt.left+visualViewport.pageLeft,y:xt.top+visualViewport.pageTop,width:xt.width,height:xt.height}},i.index,N===1);if(!a)break;let O=ht.join(c.tiles,`${C}-card${i.index+1}-${T}${String(N).padStart(2,"0")}.png`);await nt(a,!0,O,`the detail card ${Mt(i.label,24)}, tile ${T}${N}`)&&M.push({tile:!0,card:{number:i.index+1,label:i.label,part:T},file:O})}},R=0;for(let i of b.sheets)i.shown||!i.panel||i.card!==null||(J=`Sheet ${Mt(i.label,24)}`,await P(i)&&(R+=1));let I=0;for(let i of b.cards){J=`detail card ${Mt(i.label,24)}`;let T=`[data-qa-card="${i.index}"]`;i.chain.length&&await x.evaluate(be,i.chain);for(let N of i.within)await x.evaluate(ye,N);if(!await x.evaluate(ye,i.index)){let{anchor:N}=await x.evaluate(Dt,{next:Q,place:T});k("unverified","this detail card could not be opened",{anchor:N});for(let a of i.within.toReversed())await x.evaluate(_t,a);continue}I+=1,await ct("the detail card opened"),await it(T),await dt(T,`card${i.index+1}`,0),r&&await K(i);for(let N of b.sheets)N.card!==i.index||N.shown||!N.panel||(J=`detail card ${Mt(i.label,24)}, Sheet ${Mt(N.label,24)}`,await P(N,i)&&(R+=1));await x.evaluate(_t,i.index);for(let N of i.within.toReversed())await x.evaluate(_t,N)}return J="",rt({...await x.evaluate(po),details:b.details,closed:b.closed,sheets:R,cards:b.cards.length,cardsOpened:I})}catch(b){return k("unverified",`the look ended early: ${b.message}`),rt(null)}finally{await D.close().catch(()=>{})}}var Be=e=>e.split(ht.sep).join("/"),pt=(e,n,s=`${n}s`)=>`${e} ${e===1?n:s}`,Ht=e=>`${e.join(", ")}px`,mo=e=>e.includes("\xD7")?e:`${e}px`;function wo({details:e,closed:n}){if(e===0)return"0 disclosures";let s=n===0?"open in the file":`${n===e?"":`${n} `}closed in the file, opened for the pictures`;return`${pt(e,"disclosure")} (${s})`}function $o(e,n=null){let s=new Map;for(let c of e){let r=n?ht.relative(n,c):"",u=Be(n&&r&&!r.startsWith("..")&&!ht.isAbsolute(r)?r:c),w=/^(.*\/)?(\d+(?:x\d+)?)-([^/]+)$/.exec(u),d=w?`${w[1]??""}\0${w[3]}`:u;s.has(d)||s.set(d,w?{head:w[1]??"",tail:w[3],looks:[]}:{whole:u});let $=s.get(d);w&&!$.looks.includes(w[2])&&$.looks.push(w[2])}return[...s.values()].map(c=>c.whole??`${c.head}${c.looks.length>1?`{${c.looks.join(",")}}`:c.looks[0]}-${c.tail}`)}var Oe=(e="<slug>")=>`more pictures: gallery qa ${e} --tiles (the page, each Sheet panel and each detail card in tiles), gallery qa ${e} --blocks <id,\u2026> (the blocks you name)`,en=Oe(),Re=he,ve='look at the export yourself at 1024, 736 and 360px, its disclosures and detail cards opened (SKILL.md, "Export, check and look"), and say so when you hand the document over.',xo=e=>It(e?.message).replace(/\s*Use a different `?userDataDir`? or stop the running browser first\.?/gi,"").slice(0,300),zt={overflow:"a reader scrolls the whole page sideways. Words that cannot break where they stand (a long path, URL or name): wrap each in <code>, which breaks where it must and keeps it whole for the reader to copy; an element wider than the window (a picture, a drawing, a width of your own): let it fit (max-width: 100%) or put it in a frame that scrolls; never cut or rewrite a path to silence this","table-columns":"not a failure. If the reader must see the column on a desktop, write its long values compactly (a cell of numbers stays on one line, so its longest value sets the column's width: a range as a\u2013b, fewer digits), move a unit out of its header into the line above the table, shorten the header, or split the table; never delete a column to silence this","chart-text-overlap":"not a failure. If the reader must read both, shorten the labels (a unit belongs in the axis's title), move one (above its row, or a leader line) or give the drawing more room at this width; never delete a label or a category to silence this","code-scrolls":'not a failure. A reader scrolls inside the frame (40 lines) for the rest; if every line must show at once, write style="--doc-code-height: none" on its <pre>; never delete code to silence this',"formula-scrolls":"not a failure. A reader scrolls the formula sideways for the rest; if it must show whole at this width, break it into lines (\\begin{aligned} \u2026 \\end{aligned}) or into two formulas; never cut a term to silence this","overflow-in-block":"not a failure. If the words run over others in the picture, give their box room at this width (a wider column in an @media rule of your <style>, or a smaller font there), or let them break (a dash or a space where a line may end); never cut the words to silence this","cut-in-block":"not a failure. If the reader must see what is cut, let the box grow with what it holds (min-height instead of height or max-height, or none), give it room at this width in an @media rule of your <style>, or let it scroll (overflow: auto); never delete the words to silence this",ticks:"not a failure. If the numbers crowd in the picture, give that axis fewer ticks at this width with axis.tickValues([...]), at most four on a phone (the domain's ends and middle; ticks(n) is only a hint to d3 and can still draw five or more), or shorter numbers (the unit in the axis's title: 2k, 1.5\u4E07); never take the axis out to silence this","svg-text-small":"not a failure. The viewBox scales the drawing's text with it: give the text a larger font-size in the viewBox's units (a viewBox 800 wide drawn 340px wide scales by 0.43, so 26 units read as 11px), or lay the drawing out for narrow widths (a viewBox of its own under an @media rule, a chart of your own drawn from its width, or HTML that wraps); never drop the labels to silence this"},yo='not a failure. A reader scrolls sideways for the rest of its long lines; if the reader must see them whole at this width, let them wrap (take data-wrap="false" off its <pre>) or break them where the code allows; a tree or a log whose lines must stay whole may scroll; never cut a line to silence this';function bo(e){if(e.kind!=="code-scrolls")return zt[e.kind]?[zt[e.kind]]:[];let n=[...e.said.keys()],s=n.some(c=>/ wide, its frame /.test(c));return[...!s||n.some(c=>/ tall, its frame /.test(c))?[zt["code-scrolls"]]:[],...s?[yo]:[]]}var So="none is a failure: each says what to do if it matters to the reader (never delete a column or a label to silence one)",ko="a reader scrolls it: not a problem";function vo(e,n,s=null,{folder:c=null,slug:r="<slug>"}={}){let u=[],w=Object.fromEntries(At.map(p=>[p,0])),d=new Map,$=new Set,h=new Map,q=[],L=p=>$o(p,c),U=p=>p.label??String(p.width),m=new Map(e.flatMap(p=>p.pictures.filter(A=>A.shot!==void 0).map(A=>[`${U(p)}|${A.shot}`,A.file])));for(let p of e){let{width:A,findings:J,counts:Q}=p,k=U(p),v=new Set,Y=Object.fromEntries(At.map(_=>[_,0])),F={right:0,down:0,all:0};for(let _ of J){let ft=`${_.kind}|${_.shot??""}|${_.what}`;if(v.has(ft))continue;v.add(ft);let dt=Ce(_,A);Y[dt]+=1;let it=so(_.anchor,n);if(_.kind==="table-scrolls"){let{sideways:R=!1,down:I=!1,name:i=""}=_.scroll??{};Object.assign(F,{all:F.all+1,right:F.right+Number(R),down:F.down+Number(I)});let T=`${it}|${i}`;h.has(T)||h.set(T,{place:it,name:i,right:[],down:[]}),R&&!h.get(T).right.includes(k)&&h.get(T).right.push(k),I&&!h.get(T).down.includes(k)&&h.get(T).down.push(k)}if(dt==="info"&&$.add(`${_.kind}|${it}`),dt==="info"&&["table-scrolls","table-columns","table-rows"].includes(_.kind))continue;let rt=`${At.indexOf(dt)}|${_.kind}|${it}`;d.has(rt)||(d.set(rt,{level:dt,kind:_.kind,place:it,said:new Map}),dt!=="info"&&(w[dt]+=1));let b=d.get(rt).said,z=`${_.state?`[${_.state}] `:""}${_.what}`;b.has(z)||b.set(z,{labels:[],pictures:[]});let P=b.get(z);P.labels.includes(k)||P.labels.push(k);let K=m.get(`${k}|${_.shot}`);K&&!P.pictures.includes(K)&&P.pictures.push(K)}let tt=[F.right&&`\u2192 ${F.right}`,F.down&&`\u2193 ${F.down}`].filter(Boolean).join(", "),ct=`${pt(F.all,"table scrolls","tables scroll")}${tt?` (${tt})`:""}`,nt=Q?.cards?`, ${pt(Q.cards,"detail card")} (${Q.cardsOpened===Q.cards?"closed in the file, opened in turn":`${Q.cardsOpened??0} of them opened`})`:"",at=p.laptop?"; only what the 1024px look did not find":Q?`; ${pt(Q.charts,"chart")}, ${pt(Q.tables,"table")}, ${wo(Q)}, ${pt(Q.sheets,"Sheet")} shown besides the first${nt}, page ${Q.height}px tall`:"";q.push({label:k,fail:Y.fail,warn:Y.warn,line:`${p.laptop?k:`${k.padStart(4)}px`} fail ${Y.fail} \xB7 warn ${Y.warn} \xB7 unverified ${Y.unverified} \xB7 ${ct}${at}`})}let C=[...d.values()].sort((p,A)=>At.indexOf(p.level)-At.indexOf(A.level)),D=e.flatMap(p=>p.pictures);if(c&&D.length&&u.push(`Pictures of this run in ${Be(c)}/ (each path below is in it):`),s){let p=new Map;for(let k of D)k.block!==void 0&&p.set(k.block,[...p.get(k.block)??[],k.file]);let A=Ae(e),J=k=>`${s.tags?.get(k)?`${s.tags.get(k)} `:""}${k}`,Q=`at ${ge.slice(0,-1).join(", ")} and ${ge.at(-1)}px`;s.tiles&&s.why&&u.push(`${s.why[0].toUpperCase()}${s.why.slice(1)}.`);for(let k of s.groups??[]){if(!k.ids.length&&!k.rest.length)continue;let v=!k.ids.length&&s.groups.some(Y=>Y!==k&&Y.ids.length)?`: none this run (the ${Ee} blocks a run pictures went to the changed blocks above)`:"";u.push(`${k.why[0].toUpperCase()}${k.why.slice(1)}${k.ids.length?`, ${Q}`:v}:`);for(let Y of k.ids){let F=n.blocks.get(Y),tt=`${F?`${n.name??"doc.html"}:${F}`:`(not in ${n.name??"doc.html"})`} ${Y}${s.tags?.get(Y)?` ${s.tags.get(Y)}`:""}`,ct=p.get(Y)??[],nt=s.moved?.has(Y)?" (moved: with the edges of the blocks before and after it)":"",at=s.held?.get(Y)??[],_=at.filter(P=>s.changed?.has(P)).length,ft=k.kind==="named"?pt(at.length,"block"):[_&&pt(_,"changed block"),at.length-_&&pt(at.length-_,"card")].filter(Boolean).join(" and "),dt=D.some(P=>P.block===Y&&P.part)?", pictured again with each Sheet panel or detail card that holds one":"",it=at.filter(P=>A.has(P)),rt=[...new Set(it.flatMap(P=>A.get(P)))].map(P=>P.includes("\xD7")?P:`${P}px`).join(", "),b=it.length?`; ${it.length} of them not pictured at ${rt}: gallery qa ${r} --blocks ${it.join(",")}`:"",z=at.length?` (with the ${ft} it holds${dt}${b})`:"";u.push(ct.length?` ${tt}${nt}${z}: ${L(ct).join(", ")}`:` ${tt}${nt}${z}: not shown at any width (hidden)`)}if(k.rest.length){let Y=pt(k.rest.length,{changed:"changed block",cards:"card"}[k.kind]??"block"),F=`${k.rest.slice(0,6).map(J).join(", ")}${k.rest.length>6?", \u2026":""}`;u.push(` ${k.ids.length?"and ":""}${Y}${k.ids.length?" more":""}, not pictured (${F}): gallery qa ${r} --blocks ${k.rest.join(",")}`)}}s.unknown.length&&u.push(` no block of ${n.name??"doc.html"} has the id${s.unknown.length===1?"":"s"} ${s.unknown.join(", ")}`)}let x=[];for(let p of C)for(let{pictures:A}of p.said.values())x.push(...A.filter(J=>!x.includes(J)));x.length&&u.push("The elements flagged below, look at these first:",...L(x).map(p=>` ${p}`));let H=D.filter(p=>p.tile),M=H.filter(p=>!p.sheet&&!p.card);M.length&&u.push(`The page as it opens (each Sheet area with the panel it shows first): ${pt(M.length,"tile")} in ${L([ht.dirname(M[0].file)])[0]}/ (<width>-<n>.png)`);let Z=new Map;for(let{sheet:p}of H)p&&Z.set(p.number,{...p,count:(Z.get(p.number)?.count??0)+1});Z.size&&u.push(`Each other Sheet panel, shown in turn: ${pt(H.filter(p=>p.sheet).length,"tile")} in ${L([ht.dirname(H.find(p=>p.sheet).file)])[0]}/ (<width>-sheet<i>-<n>.png): ${[...Z.values()].map(({number:p,label:A,count:J})=>`sheet${p} ${Mt(A,24)} ${pt(J,"tile")}`).join(", ")}`);let X=new Map;for(let{card:p}of H)p&&X.set(p.number,{...p,count:(X.get(p.number)?.count??0)+1});X.size&&u.push(`Each detail card, opened in turn as the window shows it, its content scrolled a tile at a time: ${pt(H.filter(p=>p.card).length,"tile")} in ${L([ht.dirname(H.find(p=>p.card).file)])[0]}/ (<width>-card<i>-<n>.png${H.some(p=>p.card?.part)?"; with another panel of a Sheet in it shown, <width>-card<i>-sheet<j>-<n>.png":""}): ${[...X.values()].map(({number:p,label:A,count:J})=>`card${p} ${Mt(A,24)} ${pt(J,"tile")}`).join(", ")}`);for(let{place:p,name:A,right:J,down:Q}of h.values()){let k=/^(?:doc|report)\.html:\d+/.exec(p)?.[0]??p;u.push(`${"INFO".padEnd(10)} table-scrolls: ${k}${A?` ${Mt(A,32)}`:""}: ${[J.length&&`\u2192 ${Ht(J)}`,Q.length&&`\u2193 ${Ht(Q)}`].filter(Boolean).join("; ")} (${ko})`)}for(let p of C){u.push(`${p.level.toUpperCase().padEnd(10)} ${p.kind}: ${p.place}`);for(let[A,{labels:J,pictures:Q}]of p.said)u.push(` ${Ht(J)}: ${A}${Q.length?` (${L(Q).join(", ")})`:""}`);for(let A of bo(p))u.push(` ${A}`)}u.push(...q.map(({line:p})=>p));let gt=Mo(s,r);return gt&&u.push(gt),w.info=$.size,{lines:u,levels:w,looks:q.map(({label:p,fail:A,warn:J})=>({label:p,fail:A,warn:J}))}}function Mo(e,n="<slug>"){let{changed:s=[],restyled:c=[],packages:r=[],cards:u=[],since:w="the last look",first:d=!1}=e?.left??{};if(!s.length&&!c.length&&!u.length)return null;let $=q=>`${q.slice(0,6).map(L=>`${e.tags?.get(L)?`${e.tags.get(L)} `:""}${L}`).join(", ")}${q.length>6?", \u2026":""}`;return`Not pictured by this run, which pictures the blocks named alone: ${[s.length&&`${pt(s.length,"block")} changed or moved since ${w} (${$(s)})`,c.length&&`${pt(c.length,"instance")} of a package changed since ${w}, ${r.join(", ")} (${$(c)})`,u.length&&(d?`no earlier look: ${pt(u.length,"card")} never pictured (${$(u)})`:`${pt(u.length,"card")} the change of the document's own <script> or <style> since ${w} may draw again (${$(u)})`)].filter(Boolean).join("; ")}. gallery qa ${n} pictures them.`}function Co(e,n,s=[],{unpictured:c=!1}={}){let r=n.map(({label:q,fail:L,warn:U})=>`${mo(q)} fail ${L}, warn ${U}`).join("; "),u=r?` (${r})`:"",w=Oe(s.length===1?s[0].slug:void 0),d={stale:"its file had changed since its export",missing:"it had none yet"},$=s.filter(({first:q})=>q).map(({slug:q,first:L})=>`${s.length>1?`${q} was`:"It was"} exported first by this run (${d[L]}).`),h=`${$.length?`. ${$.join(" ")}`:""}${s.map(({file:q})=>`
|
|
3
|
+
${Re}${q}`).join("")}`;if(e.fail)return`failures at ${pt(e.fail,"place")}${u}: fix them in the document's doc.html (report.html in an older document), then run this again (it exports first); ${w}${h}`;if(e.unverified)return`nothing failed${u}; not verified at ${pt(e.unverified,"place")}: say so when you hand the document over; ${w}${h}`;if(e.warn)return`nothing failed${u}; warnings at ${pt(e.warn,"place")} to look at, ${So}; ${w}${h}`;if(c){let q=s.length===1?s[0].slug:"<slug>";return`nothing found${u}, and no picture taken: a plain run pictures the cards and the blocks changed since the last look, and the document has no card (a chart or a drawing, code, a whole block, a component, a flowchart, a Sheet area, columns, a figure, a table) and no block changed; run gallery qa ${q} --tiles to picture the page, each Sheet panel and each detail card in tiles, open those pictures and look at the document once yourself; gallery qa ${q} --blocks <id,\u2026> pictures the blocks you name${h}`}return`nothing found${u}: open the pictures above and look at the document once yourself; ${w}${h}`}function Eo(e,{missing:n=!1,edited:s=!1,packaged:c=!1}={}){let r=qt(e),u=ht.basename(Lt(jt(e,Rt)).html);return`exporting first: ${n?`no export yet (${r})`:s?`${u} changed since the last export (${r})`:c?`a component package it uses changed since the last export (${r})`:`the last export (${r}) does not say which text it was made from (an older Gallery's)`}, as gallery export ${e} does (--no-export: refuse instead)`}async function qo(e){for(let[r,{missing:u,edited:w,packaged:d}]of e)console.log(`${r}: ${Eo(r,{missing:u,edited:w,packaged:d})}`);let n=new Map(await Promise.all(e.map(async([r])=>[r,await vt.stat(qt(r)).then(u=>u.mtimeMs,()=>null)]))),s=Fe(process.execPath,[ht.join(ze,"bin","gallery.mjs"),"export",...e.map(([r])=>r)],{cwd:Rt,encoding:"utf8",env:{...process.env,GALLERY_WORKSPACE:Rt},maxBuffer:256*1024*1024});s.stdout&&process.stdout.write(s.stdout),s.stderr&&process.stderr.write(s.stderr),s.error&&console.error(`the export did not run: ${s.error.message}`);let c=[];for(let[r]of e){let u=await vt.stat(qt(r)).then(w=>w.mtimeMs,()=>null);u!==null&&u!==n.get(r)&&!(await Gt(r,{made:!0})).problem&&c.push(r)}return c}var Ao=e=>String(e??"").split(/[\s,]+/).filter(Boolean);function Bo(e,n){let s=Vt(e);return[...new Set(n)].filter(c=>!s.has(c))}var Oo=(e,n)=>`--blocks: no block of ${e} has the id${n.length===1?"":"s"} ${n.join(", ")}: nothing was looked at and no picture removed. Name ids as gallery qa prints them (data-block-id in the file).`;async function on(e){let{slugs:n,options:s,values:c}=await Kt({options:["--tiles","--no-export"],values:["--blocks"],argv:e}),r=c.has("--blocks")?Ao(c.get("--blocks")):null;if(r?.length===0)throw new Wt("--blocks takes block ids: --blocks <id,\u2026>");if(r&&n.length!==1)throw new Wt("--blocks names blocks of one document: name one.");let u=new Map,w=[];for(let M of n){let Z=await Gt(M);Z.problem&&!((Z.stale||Z.missing)&&!s.has("--no-export"))&&w.push(Z.problem),u.set(M,Z)}if(w.length&&(console.error(w.join(`
|
|
4
|
+
`)),process.exit(2)),r){let M=Lt(jt(n[0],Rt)).html,Z=Bo(Pt(await vt.readFile(M,"utf8").catch(()=>"")),r);if(Z.length)throw new Wt(Oo(ht.resolve(M),Z))}await oe(n),await ce(n),await de(n);let d=[...u].filter(([,M])=>M.stale||M.missing),$=new Map(d.map(([M,Z])=>[M,Z.missing?"missing":"stale"]));if(d.length){let M=await qo(d),Z=d.map(([X])=>X).filter(X=>!M.includes(X));for(let X of M)u.set(X,await Gt(X,{made:!0}));Z.length&&(console.error(`${Z.join(", ")}: the export failed (above), so nothing was looked at: fix what it says, then run this again`),process.exit(1))}let h=u,q=[...h].map(([M,{file:Z}])=>({slug:M,file:Z,first:$.get(M)??null})),L=(M,Z)=>{for(let[X,{sha256:gt,time:p}]of h)console.log(`${X}: ${qt(X)} sha256 ${gt}, exported ${Ut(p)}`);console.log(`UNVERIFIED ${M}: nothing was looked at. ${Z}`);for(let{file:X}of q)console.log(`${Re}${X}`);process.exit(3)},U=ne();U||L("no Chrome, Edge or Chromium found (GALLERY_BROWSER=<its executable> picks one)",`Install Chrome or Edge, or ${ve}`);let m=await re({executablePath:U,args:se()}).catch(M=>L(`the browser ${U} did not start, twice, each time with a fresh profile (${xo(M)}; GALLERY_BROWSER=<its executable> picks another)`,`Run gallery qa once more; if it says UNVERIFIED again, ${ve}`)),{browser:C}=m,D=Object.fromEntries(At.map(M=>[M,0])),x=new Map,H=!1;try{for(let[M,{file:Z,sha256:X,time:gt}]of h){let p=ht.join(Ue,M),A=ht.join(p,"blocks.json");console.log(`${M}: ${qt(M)} sha256 ${X}, exported ${Ut(gt)} (${ht.basename(U)}, headless)`);let J=Lt(jt(M,Rt)).html,Q=Pt(await vt.readFile(J,"utf8")),k=Vt(Q),v=ee(k,te(await vt.readFile(A,"utf8").catch(()=>null))),Y=Qt(Q),F=Zt(Q),tt=ho(k,v,r,{tiles:s.has("--tiles")&&!r,page:Y,packages:F}),ct=s.has("--tiles")||!!tt.tiles;(ct||tt.ids.length)&&(H=!0);let nt={flagged:ht.join(p,"flagged"),blocks:ht.join(p,r?"blocks":"changed"),tiles:ht.join(p,"tiles")},at=ht.join(p,"cards");nt.folders=new Map(tt.groups.flatMap(i=>i.ids.map(T=>[T,i.kind==="cards"?at:nt.blocks])));let _=[nt.flagged,...r?[nt.blocks]:tt.tiles?[]:[nt.blocks,at],...ct?[nt.tiles]:[]],ft=(await Promise.all(_.map(async i=>[i,(await vt.readdir(i).catch(()=>[])).filter(T=>T.endsWith(".png")).length]))).filter(([,i])=>i>0);ft.length&&console.log(`The pictures of the run before in ${ft.map(([i])=>`${ht.basename(i)}/`).join(", ")} (${pt(ft.reduce((i,[,T])=>i+T,0),"file")}) were removed: this run's replace them.`);for(let i of _)await vt.rm(i,{recursive:!0,force:!0});for(let i of await vt.readdir(p).catch(()=>[]))i.endsWith(".png")&&await vt.rm(ht.join(p,i),{force:!0});for(let i of _)await vt.mkdir(i,{recursive:!0});let dt=[...k].filter(([,{whole:i}])=>i).map(([i])=>i),it=[...k].filter(([,{figure:i}])=>i).map(([i])=>i),rt=[],b=null;for(let i of pe){let T=await go(C,Z,i,{out:nt,tiles:ct&&!i.laptop,blocks:i.laptop?[]:tt.ids,around:tt.around,held:i.laptop?new Map:tt.held,whole:dt,drawn:it,known:i.laptop?b:null});rt.push({...i,...T}),T.pictures.length&&(H=!0),!i.laptop&&i.width===pe.find(N=>N.laptop)?.width&&(b=new Set(T.findings.map(Yt)))}let{lines:z,levels:P,looks:K}=vo(rt,no(Q,ht.basename(J)),{...tt,tags:new Map([...k].map(([i,{tag:T}])=>[i,T]))},{folder:p,slug:M});console.log(z.join(`
|
|
5
|
+
`));for(let i of At)D[i]+=P[i];for(let{label:i,fail:T,warn:N}of K){let a=x.get(i)??{label:i,fail:0,warn:0};x.set(i,{label:i,fail:a.fail+T,warn:a.warn+N})}let R=rt.every(i=>i.counts&&!i.findings.some(T=>T.kind==="unverified")),I=ro(k,v,tt,{named:r,verified:R,failed:P.fail>0,seen:lo(tt,rt),page:Y,packages:F})??v;I&&await vt.writeFile(A,`${JSON.stringify(I)}
|
|
6
|
+
`)}}finally{await m.close()}console.log(Co(D,[...x.values()],q,{unpictured:!H})),process.exitCode=D.fail?1:D.unverified?3:0}export{zt as ADVICE,Ee as BLOCK_PICTURES,yo as CODE_SIDEWAYS,Re as HAND_OVER,Qe as INK_MARGIN,Uo as KINDS,At as LEVELS,pe as LOOKS,ve as LOOK_YOURSELF,en as MORE_PICTURES,co as MOSTLY_CHANGED,we as MOVED_PART,to as MOVED_WHOLE,me as NEIGHBOUR_EDGE,Ke as PICTURED_INFO,ko as SCROLLS,Ze as SCROLL_FRAMES,Je as SCROLL_SLACK,So as WARNED,Go as WIDE,ge as WIDTHS,ee as adoptIdless,bo as adviceOf,je as baselineOf,xe as baselineSaid,Vt as blocksOf,ho as blocksToPicture,vo as describeLooks,wo as disclosuresSaid,Le as exportBaselines,Gt as exportOf,Eo as exportingFirst,Yt as findingKey,Ce as findingLevel,uo as inkOf,Ge as layoutNotesOf,Me as levelOf,go as lookAt,Ae as missedWidths,Oe as morePictures,qe as movedBlocks,eo as movedClips,Ao as namedBlocks,ro as nextBaseline,Mo as notPicturedLine,Qt as pageOf,Xe as picturedAt,$o as picturesSaid,so as placeOf,Ie as previewBaseline,We as rankOf,te as readBaseline,on as run,lo as seenOf,no as sourceIndex,ao as staleExport,xo as startFailure,Ut as timeOf,Bo as unknownBlocks,Oo as unknownBlocksSaid,$e as urlName,Co as verdictOf,oo as wordsOf};
|
|
@@ -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{a as v,b as j}from"./chunk-HYMEEXKN.mjs";import c from"node:fs";import f from"node:path";import V from"node:zlib";import{escapeAttribute as $,escapeMarkup as _}from"../browser/shared/escape.mjs";import{componentOf as b,instancesOf as L,partOf as O}from"../browser/shared/components/index.mjs";import{ICON_COLOR_VALUES as I,TAB_ICON as N,glyphOf as T,iconKind as u,iconUrl as A,iconValueOf as h,tabIconValue as R}from"../browser/shared/emoji/icon-value.mjs";import{mediaTypeOf as B,mediaUrl as z}from"../browser/shared/media.mjs";import{emojiDataDirectory as J,reportsDirectory as E}from"../browser/shared/paths.mjs";import{slugPattern as P}from"../browser/shared/reports.mjs";import{documentDirectory as D}from"../browser/shared/workspace.mjs";var g=J,k=String.fromCodePoint(65039),C=null,x=null;function G(){return C??={positions:JSON.parse(c.readFileSync(f.join(g,"positions.json"),"utf8")),index:JSON.parse(c.readFileSync(f.join(g,"twemoji-index.json"),"utf8")),svg:V.gunzipSync(c.readFileSync(f.join(g,"twemoji-svg.bin")))},C}function F(t){let{positions:e,index:n,svg:o}=G(),r=[t,t.replaceAll(k,""),`${t}${k}`].find(a=>e[a]),i=r&&n[e[r][0]];return i?o.subarray(i[0],i[0]+i[1]):null}function U(t){let e=F(t);return e?`data:image/svg+xml;base64,${e.toString("base64")}`:null}function mt(t){return d(""),[...x.keys()].filter(e=>e.startsWith(`${t}/`)).map(e=>e.slice(t.length+1))}function d(t,e="currentColor"){x??=new Map(JSON.parse(c.readFileSync(f.join(g,"icons.json"),"utf8")).icons.flatMap(([,r,i,a,l])=>[[`mingcute/${r}`,a],[`tabler/${i}`,l]].filter(([,s])=>s)));let n=T(t),o=n&&x.get(`${n.set}/${n.name}`);return o?o.split("#COLOR").join(e).replace("<svg ",'<svg aria-hidden="true" '):null}function H(t){let[e,n]=I[T(t)?.color]??I.gray,o=d(t);return o&&o.replace(/<svg\b[^>]*>/,r=>`${r.replace(/ aria-hidden="true"/,"").replace(/^<svg /,'<svg xmlns="http://www.w3.org/2000/svg" ').replace(/ xmlns="http:\/\/www\.w3\.org\/2000\/svg"(?=.* xmlns=)/,"")}<style>svg{color:${e}}@media (prefers-color-scheme:dark){svg{color:${n}}}</style>`)}var K=t=>`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><text x="18" y="18" text-anchor="middle" dominant-baseline="central" font-size="30" font-family="'Apple Color Emoji','Segoe UI Emoji','Noto Color Emoji',sans-serif">${_(t)}</text></svg>`;function W({value:t,slug:e=null,tab:n=!1,reportsDirectory:o=E}){let r=u(t);if(r==="emoji")return{type:"image/svg+xml",body:F(t)??Buffer.from(K(t))};if(r==="glyph"){let a=n?H(t):d(t,"#000");return a&&{type:"image/svg+xml",body:Buffer.from(a)}}if(r!=="image"||!e||!P.test(e))return null;let i=f.join(D(e,o),t);return c.existsSync(i)?{type:B(t),body:c.readFileSync(i)}:null}var M=/(<div\b[^>]*\bclass="doc-icon"[^>]*>)([\s\S]*?)(<\/div>)/g;function gt(t,{slug:e,mode:n="export",reportsDirectory:o=E}){return tt(Q(t,{mode:n}).replace(M,(r,i,a,l)=>{let s=h(r),y=u(s);if(!y)return r;let p=null;if(y==="emoji"){let m=U(s);p=m&&`<img alt="${$(s)}" src="${m}">`}else if(y==="glyph")p=d(s);else if(n==="preview")p=`<img src="${z("asset",e,s)}" alt="">`;else{let m=f.join(D(e,o),s),S=c.existsSync(m)?c.readFileSync(m):null;p=S&&`<img src="data:${B(s)};base64,${S.toString("base64")}" alt="">`}let w=n==="preview"?i.replace(/>$/,` data-ge-icon="${$(s)}">`):i;return p?`${w}${p}${l}`:`${w}${a}${l}`}),Z(Y(t),{slug:e,mode:n,reportsDirectory:o}))}var ut=t=>[...t.matchAll(M)].flatMap(e=>{let n=u(h(e[0]))==="image"?/<img\b[^>]*\bsrc="/.exec(e[2]):null;return n?[e.index+e[1].length+n.index]:[]}),q=/<button\b[^>]*\bdata-tab-icon="([^"]*)"[^>]*>/g;function Q(t,{mode:e="export"}={}){return t.replace(q,(n,o)=>{if(u(o)!=="emoji"||n.includes(N))return n;let r=e==="preview"?A(o):U(o);if(!r)return n;let i=`${N}: ${R(r)}`;return/\sstyle="/.test(n)?n.replace(/\sstyle="([^"]*)"/,(a,l)=>` style="${l.replace(/;?\s*$/,"; ")}${i}"`):n.replace(/>$/,` style="${i}">`)})}function X(t){let e=O(t,b("page").header)[0];return{all:L(t,b("icon")),own:e?O(e,b("icon").match):[]}}function Y(t){let[e]=X(v(t)).own;return e?h(j(t,e)):null}function Z(t,{slug:e,mode:n,reportsDirectory:o}){if(!t)return null;if(n==="preview")return A(t,e,{tab:!0});let r=W({value:t,slug:e,tab:!0,reportsDirectory:o});return r&&`data:${r.type};base64,${Buffer.from(r.body).toString("base64")}`}var tt=(t,e)=>e&&/<\/head>/i.test(t)&&!t.includes("data-doc-tab-icon")?t.replace(/<\/head>/i,()=>` <link rel="icon" href="${$(e)}" data-doc-tab-icon>
|
|
3
|
+
</head>`):t;export{U as a,mt as b,d as c,W as d,gt as e,ut as f,X as g,Y as h};
|
|
@@ -0,0 +1,26 @@
|
|
|
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 J,n as Ft,p as Ut}from"./chunk-W4VKN3GF.mjs";import{b as z,c as H,e as ot}from"./chunk-A55HN5OK.mjs";import{createHash as Qe}from"node:crypto";import{BLOCK_LEVEL as q}from"../browser/shared/html-tree.mjs";var at=t=>Qe("sha256").update(t).digest("hex").slice(0,16),R=t=>t.nodeName==="#text"&&!t.value.trim();function Nt(t,e){for(let s of t.childNodes??[]){if(s.tagName===e)return s;let o=s.tagName&&Nt(s,e);if(o)return o}return null}import{ATTRIBUTES as Cn,BOX_CLASSES as Sn,COMPONENT_ATTRIBUTES as En,COMPONENT_CLASSES as In,GROUPING as wn,IDENTITY as F,TOGGLES as An,UNIT_KINDS as Bn}from"../browser/editor/components/registry.mjs";import{attr as w,hasClass as Bt}from"../browser/shared/html-tree.mjs";import{idsNamed as _n}from"../browser/shared/copy-ids.mjs";import{DIALOG as Mn,PAGE as jn,SECTION as Rn,SHEETS as X,TABLE as De}from"../browser/editor/components/kit.mjs";import{matchesNode as et,partOf as It}from"../browser/shared/components/index.mjs";import{escapeMarkup as rt}from"../browser/shared/escape.mjs";import{imageFile as ts}from"../browser/shared/media.mjs";import{emptyFigure as es}from"../browser/editor/components/media/write.mjs";var ss=t=>typeof t=="string"&&t.length<=2e3&&/^https?:\/\/[^\s"<>]+$/.test(t),zt=(t,e)=>typeof t=="string"&&t.length<=e&&!/[\u0000-\u001f]/.test(t),Ht=t=>t.href===""&&!t.title&&!t.description&&!t.icon&&!t.cover&&t.caption==="",Gt=t=>t==null||ts(t),Kt={bookmark:{check:(t,{validLeaf:e})=>Ht(t)||ss(t.href)&&zt(t.title,300)&&zt(t.description??"",600)&&Gt(t.icon)&&Gt(t.cover)&&typeof t.caption=="string"&&(t.caption===""||e({tag:"figcaption"},t.caption)),write(t,e){if(Ht(t))return es("bookmark",e);let s=t.title.trim()||new URL(t.href).hostname,o=[`<span class="doc-bookmark-title">${rt(s)}</span>`,t.description?`<span class="doc-bookmark-description">${rt(t.description)}</span>`:"",`<span class="doc-bookmark-url">${t.icon?`<img class="doc-bookmark-icon" src="${t.icon}" alt="">`:""}<span class="doc-bookmark-href">${rt(t.href)}</span></span>`].join(""),a=t.cover?`<span class="doc-bookmark-cover"><img src="${t.cover}" alt=""></span>`:"",n=`<a class="doc-bookmark-card" href="${rt(t.href)}" target="_blank" rel="noopener noreferrer"><span class="doc-bookmark-text">${o}</span>${a}</a>`;return e.block(`<figure class="doc-bookmark"${e.id}>`,[n,`<figcaption>${t.caption}</figcaption>`],"</figure>")}}};import{BLOCK_TYPES as ns,sizeValue as os}from"../browser/editor/components/registry.mjs";import{LINE_START as Vt,lineStart as as}from"../browser/shared/code-lines.mjs";import{hasClass as qt}from"../browser/shared/html-tree.mjs";import{CODE_HEIGHT as $t,FOLDED_LINES as Xt,validFolded as rs,validLanguage as is}from"../browser/editor/components/code/index.mjs";var cs=(t,e,s,o,a="",n="",r="",l="")=>`<div class="${t.className}"${s?` data-language="${s}"`:""}${l?` ${Vt}="${l}"`:""}${r?` ${Xt}="${r}"`:""}${o?` style="${$t}: ${o}"`:""}${a}><div class="doc-code-title">${n}</div><pre><code>${e}</code></pre></div>`,ls=(t,e)=>t==="data-language"||t===Xt||t===Vt||t==="style"&&new RegExp(`^\\s*${$t}\\s*:[^;]*;?\\s*$`).test(e??""),fs=t=>typeof t=="string"&&t.length<=200&&!/[<>\n]|&(?!(amp|lt|gt|quot|#39);)/.test(t),ds=t=>(t.language===void 0||is(t.language))&&(t.folded===void 0||rs(t.folded))&&(t.height===void 0||os("code",$t,t.height)===t.height)&&(t.title===void 0||fs(t.title))&&(t.lineStart===void 0||typeof t.lineStart=="string"&&String(as(t.lineStart))===t.lineStart);function us(t){let{node:e}=t;if(t.tag!=="div"||t.nested||!qt(e,ns.code.className))return!1;let s=(a,n)=>{let r=a.childNodes??[],l=r.filter(u=>u.tagName);return l.length===n.length&&l.every((u,d)=>u.tagName===n[d])&&r.every(u=>u.tagName||!(u.value??"").trim())?l:null},o=s(e,["div","pre"]);return!!o&&qt(o[0],"doc-code-title")&&!!s(o[1],["code"])}var Yt={code:{fields:["language","folded","height","title","lineStart"],check:ds,leaf:(t,e,s)=>cs(t,e.html,e.language,e.height,s,e.title,e.folded,e.lineStart),written:us,attribute:ls}};import{sizeValue as ms}from"../browser/editor/components/registry.mjs";import{MIN_COLUMNS as ps,RATIO as Zt}from"../browser/editor/components/columns/index.mjs";var Jt={columns:{check:t=>t.children.length>=ps&&t.children.every(e=>e.type==="column")},column:{check:t=>t.ratio===void 0||ms("column",Zt,t.ratio)===t.ratio,write(t,e){let s=t.ratio===void 0?"":` style="${Zt}: ${t.ratio}"`;return e.block(`<div class="doc-column"${s}${e.id}>`,e.children(e.inner),"</div>")}}};var Qt={details:{empty:!0,check:(t,{validLeaf:e})=>t.title===""||e({tag:"span"},t.title),write(t,e){let s=e.inner===null?null:e.inner+e.step,o=e.block('<div class="doc-details-content">',e.children(s),"</div>",e.inner,s),a=t.classes?.length?` ${t.classes.join(" ")}`:"";return e.block(`<details class="doc-details${a}"${e.id}>`,[`<summary><span class="doc-details-summary-label">${t.title}</span></summary>`,t.children.length>0?o:'<div class="doc-details-content"></div>'],"</details>")}}};var te={dialog:{empty:!0,check(t,{usedIds:e}){return typeof t.id!="string"||!/^[A-Za-z][\w-]{0,63}$/.test(t.id)||e.has(t.id)?!1:(e.add(t.id),!0)},write(t,e){let s=t.children.length>0?e.block('<div class="doc-dialog-content">',e.children(e.deep(3)),"</div>",e.deep(2),e.deep(3)):'<div class="doc-dialog-content"></div>',o=e.block('<div class="doc-dialog-panel">',[s],"</div>",e.deep(1),e.deep(2));return e.block(`<dialog class="doc-dialog" id="${t.id}">`,[o],"</dialog>")}}};import{escapeAttribute as gs}from"../browser/shared/escape.mjs";import{embedFile as ee}from"../browser/shared/media.mjs";import{emptyFigure as hs}from"../browser/editor/components/media/write.mjs";import{FILE_SANDBOX as Ns,WEB_SANDBOX as $s}from"../browser/editor/components/embed/index.mjs";var bs=t=>typeof t=="string"&&t.length<=2e3&&/^https:\/\/[^\s"<>]+$/.test(t),se=t=>t.src===""&&t.height===void 0&&t.caption==="",ne={embed:{check:(t,{validLeaf:e})=>se(t)||(bs(t.src)||ee(t.src))&&(t.height===void 0||/^\d{2,4}px$/.test(t.height))&&typeof t.caption=="string"&&(t.caption===""||e({tag:"figcaption"},t.caption)),write(t,e){if(se(t))return hs("embed",e);let s=ee(t.src),o=s?/\.pdf$/i.test(t.src)?"":` sandbox="${Ns}"`:` sandbox="${$s}" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen`,a=`<iframe class="doc-embed-frame" src="${gs(t.src)}"${o} loading="lazy"></iframe>`,n=t.height?` style="--doc-embed-height: ${t.height}"`:"";return e.block(`<figure class="doc-embed${s?" doc-embed--file":""}"${n}${e.id}>`,[a,`<figcaption>${t.caption}</figcaption>`],"</figure>")}}};import{escapeMarkup as oe}from"../browser/shared/escape.mjs";import{assetFile as Os}from"../browser/shared/media.mjs";import{emptyFigure as xs}from"../browser/editor/components/media/write.mjs";var ae=t=>t.href===""&&t.name===""&&t.size===void 0&&t.caption==="",ks=t=>typeof t=="string"&&t.trim()!==""&&t.length<=120&&!/[\u0000-\u001f<>:"/\\|?*]/.test(t),re={file:{check:(t,{validLeaf:e})=>ae(t)||Os(t.href)&&ks(t.name)&&(t.size===void 0||/^\d+(\.\d)? (B|KiB|MiB|GiB)$/.test(t.size))&&typeof t.caption=="string"&&(t.caption===""||e({tag:"figcaption"},t.caption)),write(t,e){if(ae(t))return xs("file",e);let s=t.size?`<span class="doc-file-size">${t.size}</span>`:"",o=`<a class="doc-file-link" href="${t.href}" download="${oe(t.name)}"><span class="doc-file-name">${oe(t.name)}</span>${s}</a>`;return e.block(`<figure class="doc-file"${e.id}>`,[o,`<figcaption>${t.caption}</figcaption>`],"</figure>")}}};import{FLOW as Ts,FLOW_DIRECTION as ie,FLOW_RATIO as ce}from"../browser/editor/components/flowchart/index.mjs";import{START as Ls,validDirection as le,validStart as ys}from"../browser/editor/components/list/index.mjs";import{sizeValue as vs,TOGGLES as Cs}from"../browser/editor/components/registry.mjs";var fe={flowchart:{check:t=>(t.start===void 0||ys(t.start))&&(t.direction===void 0||le(t.direction))&&t.children.length>0,write:(t,e)=>e.block(`<ol class="${Ts}"${t.start?` ${Ls}="${t.start}"`:""}${t.direction?` ${ie}="${t.direction}"`:""}${e.id}>`,e.children(e.inner),"</ol>")},step:{check:t=>(t.classes===void 0||Array.isArray(t.classes)&&new Set(t.classes).size===t.classes.length&&t.classes.every(e=>(Cs.step??[]).includes(e)))&&(t.ratio===void 0||vs("step",ce,t.ratio)===t.ratio)&&(t.direction===void 0||le(t.direction))&&t.children.length>0,write(t,e){let s=t.classes?.length?` class="${t.classes.join(" ")}"`:"",o=t.direction?` ${ie}="${t.direction}"`:"",a=t.ratio===void 0?"":` style="${ce}: ${t.ratio}"`;return e.block(`<li${s}${o}${a}${e.id}>`,e.children(e.inner),"</li>")}}};import{SPAN as Ss,SPAN_SIZE as de,imageFile as ue}from"../browser/shared/media.mjs";import{emptyFigure as Es}from"../browser/editor/components/media/write.mjs";var Is=/^\d{1,3}(\.\d{1,3})?( \d{1,3}(\.\d{1,3})?){3}$/,me=t=>t.src===""&&t.caption===""&&t.span===void 0&&t.original===void 0&&t.classes===void 0,ws=t=>typeof t=="number"&&Number.isFinite(t)&&t>=de.min&&t<=de.max,pe={image:{check:(t,{validLeaf:e})=>me(t)||ue(t.src)&&typeof t.caption=="string"&&(t.caption===""||e({tag:"figcaption"},t.caption))&&(t.span===void 0||ws(t.span))&&(t.original===void 0||ue(t.original)&&typeof t.crop=="string"&&Is.test(t.crop)),write(t,e){if(me(t))return Es("image",e);let s=["doc-image",...t.classes??[]].join(" "),o=t.span===void 0?"":` style="${Ss}: ${Math.round(t.span*1e3)/1e3}"`,a=t.original===void 0?"":` data-original="${t.original}" data-crop="${t.crop}"`;return e.block(`<figure class="${s}"${o}${e.id}>`,[`<img src="${t.src}" alt=""${a}>`,`<figcaption>${t.caption}</figcaption>`],"</figure>")}}};ot();import{heldByNode as As,instanceSlots as Bs,isInstance as Ot,isSlot as _s,ownSlots as Ms,partOf as xt}from"../browser/shared/components/index.mjs";import{ATTRIBUTE as tt,DATA_MOST as js,NO_TEXT as Rs,PACKAGE_ID as ge,SCHEMA as he,SLOT as Ne,fitsDataScript as Ds,isDataScript as Ws,noDataPart as Ps,refusedInCopy as Fs,refusedInData as Us,schemaAhead as $e}from"../browser/shared/components/installed.mjs";import{attr as M,walk as be}from"../browser/shared/html-tree.mjs";var Q=(t,e)=>{for(let s=t.parentNode;s;s=s.parentNode)if(s===e)return!0;return!1},zs=t=>{let e=t.parentNode;for(;e&&!Ot(e);)e=e.parentNode;return e??null},kt=(t,e)=>zs(t)===e&&As(t)===e&&!_s(t);function bt(t,e){let o=Object.entries(e.get(M(t,tt))?.parts??{}).filter(([,{edit:a}])=>a==="data").map(([a,{at:n}])=>[a,xt(t,n).find(r=>r.sourceCodeLocation&&!Ot(r)&&kt(r,t))]).filter(([,a])=>a);return o.filter(([,a],n)=>!o.some(([,r],l)=>Q(a,r)||r===a&&l<n))}var Hs=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]),Gs="http://www.w3.org/1999/xhtml",Ks=t=>(t.content??t).childNodes;function Oe(t,e,s,o){let a=s;for(let n of Ks(t)){let r=n.sourceCodeLocation;if(r?.startOffset!==a)return!1;if(n.tagName){let{startTag:l,endTag:u}=r,d=Hs.has(n.tagName)||n.namespaceURI!==Gs&&e.startsWith("/>",r.endOffset-2);if(u?!Oe(n,e,l.endOffset,u.startOffset):!d)return!1}a=r.endOffset}return a===o}function qs(t,e,s){if(e.tagName==="script")return Ws(e.tagName,e.attrs)&&Ds(s);if(Ps(e.tagName))return!1;let{startTag:o,endTag:a}=e.sourceCodeLocation,n=t.slice(o.startOffset,o.endOffset),r=`${n}${s}${t.slice(a.startOffset,a.endOffset)}`,[l,...u]=H(e.parentNode,r,{sourceCodeLocationInfo:!0}).childNodes;if(u.length>0||l?.tagName!==e.tagName||l.sourceCodeLocation?.endOffset!==r.length||!l.sourceCodeLocation.endTag||!Oe(l,r,n.length,n.length+s.length))return!1;let d=!1;return be(l,m=>{d||=Us(m.tagName,m.attrs)}),!d}var Vs=(t,e)=>Object.values(e.get(M(t,tt))?.parts??{}).filter(({edit:s})=>s==="text"||s==="data").flatMap(({at:s})=>xt(t,s).filter(o=>kt(o,t))),xe={installed:{slots(t,e){let s=Vs(t,e);return Bs(t).filter(o=>!s.some(a=>Q(o,a)))},boxes(t,e){return this.slots(t,e).map(s=>({element:s,kind:"slot",key:M(s,Ne)}))},textParts(t,e){let s=e.get(M(t,tt));if($e(M(t,he),s?.schema))return[];let o=Object.values(s?.parts??{}).filter(({edit:r})=>r==="text"),a=bt(t,e).map(([,r])=>r),n=[...new Set(o.flatMap(({at:r})=>xt(t,r)))].filter(r=>r.sourceCodeLocation&&!Ot(r)&&!Rs.has(r.tagName)&&kt(r,t)).filter(r=>!a.some(l=>l===r||Q(r,l)||Q(l,r)));return n.filter(r=>!n.some(l=>Q(r,l))).map(r=>({kind:"installed",part:r}))},source({package:t,html:e,children:s,boxKeys:o},{packages:a,written:n}){if(typeof t!="string"||!ge.test(t))return null;let r=s!==void 0;if(r&&!(Array.isArray(s)&&Array.isArray(o)&&o.length===s.length))return null;let l=e===void 0?a.has(t)?Ut(a.get(t)):null:e,u=typeof l=="string"?Ft(l,t):null;if(!u)return null;let d=Ms(u.root),m=b=>!b.childNodes.every(S=>S.nodeName==="#text"&&!S.value.trim());if((e!==void 0||!r)&&d.some(m)||r&&!o.every(b=>d.some(S=>M(S,Ne)===b)))return null;if(e!==void 0){let b=!1;if(be({childNodes:[u.root]},S=>{b||=Fs(S.tagName,S.attrs)}),b)return null}let g=d.map(b=>b.sourceCodeLocation).sort((b,S)=>S.startOffset-b.startOffset).reduce((b,{startTag:S,endTag:y})=>b.slice(0,S.endOffset)+b.slice(y.startOffset),u.markup);return n(r?g:u.markup)},unwritten:({package:t,html:e},{packages:s})=>e===void 0&&ge.test(t)&&!s.has(t)?"no-package":"invalid",definition:(t,e)=>e.get(M(t,tt))?.definition,dataOf(t,e,s){let o=bt(e,s).filter(([,a])=>a.sourceCodeLocation.endTag);return o.length>0?Object.fromEntries(o.map(([a,n])=>[a,t.slice(n.sourceCodeLocation.startTag.endOffset,n.sourceCodeLocation.endTag.startOffset)])):null},rewrite(t,e,s,{packages:o}){let a=new Map(bt(e,o)),n=Object.keys(s),r=n.map(u=>s[u]);if($e(M(e,he),o.get(M(e,tt))?.schema)||n.length===0||!r.every(u=>typeof u=="string")||!n.every(u=>a.has(u))||r.reduce((u,d)=>u+Buffer.byteLength(d),0)>js||!n.every(u=>a.get(u).sourceCodeLocation.endTag&&qs(t,a.get(u),s[u])))return null;let l=t.includes(`\r
|
|
3
|
+
`)?`\r
|
|
4
|
+
`:`
|
|
5
|
+
`;return n.map(u=>{let{startTag:d,endTag:m}=a.get(u).sourceCodeLocation;return{start:d.endOffset,end:m.startOffset,text:s[u].replace(/\r?\n/g,l)}})}}};ot();import{IDENTITY as Xs}from"../browser/editor/components/registry.mjs";import{SHEETS as it,TABLE as ke}from"../browser/editor/components/kit.mjs";import{escapeAttribute as ct,escapeText as Te}from"../browser/shared/escape.mjs";import{isInstance as Ys,matchesNode as Tt}from"../browser/shared/components/index.mjs";import{attr as D}from"../browser/shared/html-tree.mjs";import{CHART_DATA as Zs,CHART_SOURCE as Le}from"../browser/shared/table-chart.mjs";import{freshPrefix as Js,referencedIds as Qs,rewrite as tn}from"../browser/shared/copy-ids.mjs";var ye=(t={})=>Object.entries(t).map(([e,s])=>s===""?` ${e}`:` ${e}="${ct(String(s))}"`).join(""),ft=(t,e)=>t[e-1]==="/"?e-1:e;function lt(t,e,s){let o=e;for(;o>0&&/\s/.test(t[o-1]);)o--;return{start:o,end:s}}function ya(t){let e=s=>s.nodeName==="#text"?s.value:(s.childNodes??[]).map(e).join("");return e(H(t)).replace(/\s+/g," ").trim()}function va(t,{from:e,to:s}){let a=ve(z(t,{sourceCodeLocationInfo:!0}))?.sourceCodeLocation;if(!a?.endTag||!e)return null;let n=t.slice(a.startTag.endOffset,a.endTag.startOffset),r=Te(e),l=n.indexOf(r);if(l<0||n.indexOf(r,l+1)>=0)return null;let u=a.startTag.endOffset+l;return{start:u,end:u+r.length,text:Te(s)}}function ve(t){for(let e of t.childNodes??[]){if(e.tagName==="title")return e;if(e.tagName==="body")continue;let s=e.tagName&&ve(e);if(s)return s}return null}function en(t){let e=[],s=0,o=null,a=0;for(let n=0;n<t.length;n++){let r=t[n];if(r==="&"){let l=/^&(#\d+|#x[\da-f]+|[a-z]\w*);/i.exec(t.slice(n));l&&(n+=l[0].length-1)}else o?r===o?o=null:r==="\\"&&n++:r==='"'||r==="'"?o=r:r==="("?s++:r===")"?s=Math.max(0,s-1):r===";"&&s===0&&(e.push(t.slice(a,n)),a=n+1)}return e.push(t.slice(a)),e.map(n=>n.trim()).filter(Boolean)}function vt(t,e){let s=en(t);for(let[o,a]of e){let n=s.findIndex(r=>r.slice(0,r.indexOf(":")).trim()===o);a===null?n>=0&&s.splice(n,1):n>=0?s[n]=`${o}: ${a}`:s.push(`${o}: ${a}`)}return s.join("; ")}var sn=new Set(["pre","textarea","script","style"]);function Ca(t){if(typeof t!="string"||!t.trim())return null;let s=H(t,{sourceCodeLocationInfo:!0}).childNodes.filter(u=>u.nodeName!=="#comment"&&!(u.nodeName==="#text"&&!u.value.trim())),[o,a]=s;if(s.length===2&&o.tagName==="button"&&Tt(o,it.tab)&&a.tagName&&a.sourceCodeLocation?.endTag&&D(o,it.tabKey)&&D(a,it.panelKey)===D(o,it.tabKey)){let u=o.sourceCodeLocation.endOffset;return{element:o,source:t.slice(0,u),panel:t.slice(u).replace(/^\s+/,""),kind:"tab"}}let n=s.at(-1),r=s.length===2?s[0]:null;if(!n?.tagName||!n.sourceCodeLocation?.startTag||s.length>2||r&&!(r.tagName&&Tt(r,ke.lead)&&Tt(n,ke.frame)))return null;let l=W(n);return{element:n,source:t,kind:l}}function nn(t){let e=[],s=o=>{for(let a of o.childNodes??[]){if(!a.tagName)continue;let n=D(a,"id");n&&e.push(n),s(a.tagName==="template"?a.content:a)}};return s(z(t)),e}var Sa=(t,e)=>`${Lt(t.slice(e.start,e.end),G(t,e.start),"")}
|
|
6
|
+
${Lt(t.slice(e.companion.start,e.companion.end),G(t,e.companion.start),"")}`;function Ea(t,e,{keys:s=null,taken:o=null}={}){let a=t.slice(e.start,e.end),n=[],r=H(a,{sourceCodeLocationInfo:!0}),l=[],u=y=>{for(let T of y.childNodes??[])T.tagName&&(l.push(T),u(T.tagName==="template"?T.content:T))};u(r);let d=Qs(l.flatMap(y=>y.attrs)),m=new Set(l.map(y=>D(y,"id")).filter(y=>y&&d.has(y))),g=new Map;if(m.size>0){let y=o??new Set(nn(t)),T=Js(y);for(let C of m)g.set(C,`${T}${C}`),y.add(`${T}${C}`)}let b=y=>{for(let T of y.childNodes??[])if(T.tagName){for(let C of[Xs,"id"]){let h=T.sourceCodeLocation?.attrs?.[C];h&&(C==="id"&&g.has(D(T,"id"))?n.push({start:h.startOffset,end:h.endOffset,text:`id="${ct(g.get(D(T,"id")))}"`}):n.push(lt(a,h.startOffset,h.endOffset)))}for(let{name:C,prefix:h,value:O}of g.size>0?T.attrs:[]){let p=h?`${h}:${C}`:C,i=tn(p,O,g),f=T.sourceCodeLocation?.attrs?.[p];i!==null&&f&&n.push({start:f.startOffset,end:f.endOffset,text:`${p}="${ct(i)}"`})}for(let C of[Zs,Le]){let h=T.sourceCodeLocation?.attrs?.[C],O=D(T,C);!h||!s||!Object.hasOwn(s,O)||(s[O]!==null?n.push({start:h.startOffset,end:h.endOffset,text:`${C}="${ct(s[O])}"`}):C===Le&&n.push(lt(a,h.startOffset,h.endOffset)))}b(T.tagName==="template"?T.content:T)}};b(r);let S=n.sort((y,T)=>T.start-y.start).reduce((y,{start:T,end:C,text:h=""})=>y.slice(0,T)+h+y.slice(C),a);return Lt(S,G(t,e.start),"")}function Lt(t,e,s){if(e===null||s===null||e===s||!t.includes(`
|
|
7
|
+
`))return t;let o=[],a=l=>{for(let u of l.childNodes??[]){if(!u.tagName)continue;let d=u.sourceCodeLocation;(sn.has(u.tagName)||Ys(u))&&d?.startTag&&d.endTag?o.push([d.startTag.endOffset,d.endTag.startOffset]):a(u.tagName==="template"?u.content:u)}};a(H(t,{sourceCodeLocationInfo:!0}));let n="",r=0;for(let l of t.split(/(?<=\n)/)){let u=o.some(([m,g])=>r>m&&r<=g),d=l===`
|
|
8
|
+
`||l===`\r
|
|
9
|
+
`;n+=r>0&&!u&&!d&&l.startsWith(e)?s+l.slice(e.length):l,r+=l.length}return n}function G(t,e){let s=t.slice(t.lastIndexOf(`
|
|
10
|
+
`,e-1)+1,e);return/^[ \t]*$/.test(s)?s:null}function on(t,e,s){let o=t.lastIndexOf(`
|
|
11
|
+
`,e-1)+1,a=t.indexOf(`
|
|
12
|
+
`,s),n=a<0?t.length:a+1;return/^[ \t]*$/.test(t.slice(o,e))&&/^[ \t]*\r?\n?$/.test(t.slice(s,n))?{start:o,end:n,text:""}:{start:e,end:s,text:""}}function Ia(t,e,s){let o=/^\s*(?=<\/li\s*>)/i.exec(t.slice(s,s+400));if(o)return{start:e-/\s*$/.exec(t.slice(Math.max(0,e-400),e))[0].length,end:s+o[0].length,text:""};let a=on(t,e,s);if(a.start===e&&a.end===s)return a;let n=/^[ \t]*\r?\n$/,r=t.indexOf(`
|
|
13
|
+
`,a.end),l=r>=0&&n.test(t.slice(a.end,r+1)),u=t.lastIndexOf(`
|
|
14
|
+
`,a.start-2)+1,d=a.start>0&&n.test(t.slice(u,a.start)),m=t.slice(0,e).trimEnd(),g=m.endsWith(">")?m.slice(m.lastIndexOf("<")):"",b=/^<[a-z]/i.test(g)&&!/\/\s*>$/.test(g)&&!yt.has(g.match(/^<([a-z0-9-]+)/i)?.[1].toLowerCase()),S=/^\s*<\//.test(t.slice(s,s+200));return l&&(d||b)?{...a,end:r+1}:d&&S?{...a,start:u}:a}import{CONTINUE as an,START as rn,validStart as cn}from"../browser/editor/components/list/index.mjs";var Ce={item:{children:(t,e)=>t.children.length>0&&t.children.every(s=>e(s,"nest")),write:(t,e)=>e.block(`<li${t.classes?.length?` class="${t.classes.join(" ")}"`:""}${ye(t.attributes)}${e.id}>${t.html}`,e.children(e.inner),"</li>")},numbers:{check:t=>(t.start===void 0||cn(t.start))&&(t.continue===void 0||t.continue===!0),write:(t,e)=>e.block(`<ol${t.start?` ${rn}="${t.start}"`:""}${t.continue?` ${an}`:""}${e.id}>`,e.children(e.inner),"</ol>")}};import{iconKind as ln}from"../browser/shared/emoji/icon-value.mjs";import{SHEETS_LABEL as fn}from"../browser/shared/components/sheets.mjs";var Se=/^[a-z0-9][a-z0-9_-]{0,63}$/i,dn=(t,e="")=>`<button class="doc-sheet-tab" type="button" data-sheet-tab="${t.sheet}"${t.icon?` data-tab-icon="${t.icon}"`:""}${e}>${t.title}</button>`,Ee={sheets:{check:t=>typeof t.name=="string"&&Se.test(t.name)&&t.children.length>=1&&t.children.every(e=>e.type==="tab")&&new Set(t.children.map(e=>e.sheet)).size===t.children.length,write(t,e){let s=e.inner===null?null:e.inner+e.step,o=fn[e.language],a=e.block(`<div class="doc-sheet-tabs" aria-label="${o}">`,t.children.map(r=>dn(r,e.idOf(r))),"</div>",e.inner,s),n=t.children.map(r=>r.children.length===0?`<div data-doc-sheet="${r.sheet}"></div>`:e.block(`<div data-doc-sheet="${r.sheet}">`,r.children.map(l=>e.render(l,s)),"</div>",e.inner,s));return e.block(`<section class="doc-sheet-shell" data-doc-sheets="${t.name}" aria-label="${o}"${e.id}>`,[a,...n],"</section>")}},tab:{empty:!0,check:t=>typeof t.title=="string"&&t.title.trim()!==""&&t.title.length<=200&&!/[<>\r\n]/.test(t.title)&&typeof t.sheet=="string"&&Se.test(t.sheet)&&(t.icon===void 0||ln(t.icon)==="emoji")}};import{COLUMN_WIDTH as On,NUMBERS as xn,tableTiling as kn,validTable as Tn}from"../browser/editor/components/table/index.mjs";import{CHART_SOURCE as Ln}from"../browser/shared/table-chart.mjs";import{widthHolder as yn}from"../browser/shared/table-slots.mjs";import{CELL_LOOKS as pn,COLUMN_WIDTH as Ae,validLook as gn,validWidth as hn}from"../browser/editor/components/table/index.mjs";import{tileSpans as Be}from"../browser/shared/table-slots.mjs";import{attr as St}from"../browser/shared/html-tree.mjs";function un(t,e){let s=t.slice(e.startOffset,e.endOffset),o=/^[^=\s]+\s*=\s*(["'])([\s\S]*)\1$/.exec(s);return o?{value:o[2],quote:o[1]}:{value:s.replace(/^[^=\s]+\s*=?\s*/,""),quote:'"'}}function mn(t,e,s){let o=ft(t,e.endOffset-1);for(;o-1>e.startOffset&&/\s/.test(t[o-1]);)o--;let a=[];for(let[n,r]of s){let l=e.attrs?.[n],u=l?un(t,l):null,d=typeof r=="function"?r(u):r,m=u&&typeof r=="function"?u.quote:'"',g=d===null?"":d===""&&typeof r!="function"?n:`${n}=${m}${d}${m}`;l&&d===null?a.push({...lt(t,l.startOffset,l.endOffset),text:g}):l?a.push({start:l.startOffset,end:l.endOffset,text:g}):d!==null&&a.push({start:o,end:o,text:` ${g}`})}return a}function Ie(t,e,s,o){let a=e.sourceCodeLocation.startTag,n=t.slice(a.startOffset,a.endOffset),r=mn(t,a,s).map((l,u)=>({...l,index:u}));for(let{start:l,end:u,text:d}of r.sort((m,g)=>g.start-m.start||g.index-m.index))n=n.slice(0,l-a.startOffset)+d+n.slice(u-a.startOffset);return o?n.replace(/^<\w+/,`<${o}`):n}function Et(t){let e=t?.tagName==="table"?t:t?.childNodes?.find(g=>g.tagName==="table"),s=g=>!!(g?.sourceCodeLocation?.startTag&&g.sourceCodeLocation.endTag),o=g=>g.childNodes.filter(b=>b.tagName),a=g=>g.childNodes.every(b=>b.tagName||R(b));if(!s(e)||!a(e))return null;let n=o(e);if(n.some(g=>!["thead","tbody","colgroup","caption"].includes(g.tagName)))return null;let r=n.filter(g=>g.tagName==="thead"),l=n.filter(g=>g.tagName==="tbody");if(r.length>1||l.length!==1||r.length===1&&n.indexOf(r[0])>n.indexOf(l[0]))return null;let u=g=>g.tagName==="tr"&&s(g)&&a(g)&&o(g).every(b=>(b.tagName==="td"||b.tagName==="th")&&s(b)&&V(b,"rowspan")!==null&&V(b,"colspan")!==null),d=[...r,...l];if(!d.every(g=>s(g)&&a(g)&&o(g).every(u)))return null;let m=d.flatMap(g=>o(g).map(b=>({node:b,head:g.tagName==="thead",cells:o(b)})));return Be(m.map(g=>({head:g.head,cells:g.cells.map(b=>[V(b,"rowspan"),V(b,"colspan")])})))?{table:e,head:r[0]??null,body:l[0],rows:m}:null}var _e=1e3;function V(t,e){let s=St(t,e);return s===void 0?1:/^\s*\d{1,4}\s*$/.test(s)&&Number(s)>=1&&Number(s)<=_e?Number(s):null}var we=t=>t===void 0||Number.isInteger(t)&&t>=1&&t<=_e,Ct=(t,e)=>t.slice(e.sourceCodeLocation.startTag.startOffset,e.sourceCodeLocation.startTag.endOffset),Nn=(t,e)=>t.slice(e.sourceCodeLocation.startTag.endOffset,e.sourceCodeLocation.endTag.startOffset),Me=(t,e)=>[...(t??"").split(/\s+/).filter(s=>s&&!pn.includes(s)),...e.split(" ").filter(Boolean)].join(" "),$n=(t,e)=>`${e>1?` colspan="${e}"`:""}${t>1?` rowspan="${t}"`:""}`,bn=(t,e,s,o,a,n,r)=>Ie(t,e,[...a!==void 0?[["class",l=>Me(l?.value,a)||null]]:[],...n!==void 0?[["style",l=>vt(l?.value??"",[[Ae,n]])||null]]:[],["scope",o],...r!==void 0?[["colspan",r[1]>1?String(r[1]):null],["rowspan",r[0]>1?String(r[0]):null]]:[]],s);function je(t,e,s,{validCell:o}){let a=Et(e);if(!a||!Array.isArray(s?.rows)||s.rows.length===0||s.rows.length>2e3)return null;let{table:n,rows:r}=a,l=new Set;if(!s.rows.every((c,N)=>c&&typeof c.head=="boolean"&&(N===0||!c.head||s.rows[N-1].head)&&(c.from===null||Number.isInteger(c.from)&&r[c.from])&&Array.isArray(c.cells)&&c.cells.length<=5e3&&c.cells.every(L=>{if(!L||!["td","th"].includes(L.tag)||![void 0,null,"row","col"].includes(L.scope)||L.look!==void 0&&!gn(L.look)||L.width!==void 0&&!hn(L.width)||!we(L.rowspan)||!we(L.colspan)||L.rowspan===void 0!=(L.colspan===void 0)||L.scope&&L.tag!=="th")return!1;if(L.from!==null){let[x,E]=Array.isArray(L.from)?L.from:[];if(!r[x]?.cells[E]||l.has(`${x}:${E}`))return!1;l.add(`${x}:${E}`)}else if(typeof L.html!="string")return!1;return L.html===void 0||typeof L.html=="string"&&L.html.length<=1e5&&(L.html===""||o(L.tag,L.html))}))||!s.rows.some(c=>!c.head))return null;let d=c=>c.rowspan!==void 0?[c.rowspan,c.colspan]:c.from===null?[1,1]:[V(r[c.from[0]].cells[c.from[1]],"rowspan"),V(r[c.from[0]].cells[c.from[1]],"colspan")],m=Be(s.rows.map(c=>({head:c.head,cells:c.cells.map(d)})));if(!m||s.rows.length*m.columns>5e3)return null;let g=r[0]?.node,b=g?G(t,g.sourceCodeLocation.startOffset):null,S=G(t,a.body.sourceCodeLocation.startOffset),y=G(t,n.sourceCodeLocation.startOffset),T=t.includes(`\r
|
|
15
|
+
`)?`\r
|
|
16
|
+
`:`
|
|
17
|
+
`,C=c=>{if(c.from===null){let gt=c.look?` class="${Me("",c.look)}"`:"",v=c.width?` style="${vt("",[[Ae,c.width]])}"`:"";return`<${c.tag}${gt}${v}${c.scope?` scope="${c.scope}"`:""}${$n(c.rowspan??1,c.colspan??1)}>${c.html}</${c.tag}>`}let[N,L]=c.from,x=r[N].cells[L],E=c.tag==="th"?c.scope??null:null;return`${x.tagName===c.tag&&(St(x,"scope")??null)===E&&c.look===void 0&&c.width===void 0&&c.rowspan===void 0?Ct(t,x):bn(t,x,c.tag,E,c.look,c.width,c.rowspan===void 0?void 0:[c.rowspan,c.colspan])}${c.html??Nn(t,x)}</${c.tag}>`},h=c=>{let N=c.from===null?null:r[c.from];return N&&N.cells.length===c.cells.length&&c.cells.every((x,E)=>x.from?.[0]===c.from&&x.from[1]===E&&x.html===void 0&&x.look===void 0&&x.width===void 0&&x.rowspan===void 0&&x.tag===N.cells[E].tagName&&(x.tag!=="th"||(x.scope??null)===(St(N.cells[E],"scope")??null)))?t.slice(N.node.sourceCodeLocation.startOffset,N.node.sourceCodeLocation.endOffset):`${N?Ct(t,N.node):"<tr>"}${c.cells.map(C).join("")}</tr>`},O=(c,N,L)=>{let x=L?Ct(t,L):`<${c}>`;return b===null||S===null?`${x}${N.map(h).join("")}</${c}>`:`${x}${N.map(E=>`${T}${b}${h(E)}`).join("")}${T}${S}</${c}>`},p=s.rows.filter(c=>c.head),i=s.rows.filter(c=>!c.head),$=[...n.childNodes.filter(c=>c.tagName==="caption"||c.tagName==="colgroup").map(c=>t.slice(c.sourceCodeLocation.startOffset,c.sourceCodeLocation.endOffset)),...p.length?[O("thead",p,a.head)]:[],O("tbody",i,a.body)],k=S===null||y===null?$.join(""):`${$.map(c=>`${T}${S}${c}`).join("")}${T}${y}`;return{start:n.sourceCodeLocation.startTag.endOffset,end:n.sourceCodeLocation.endTag.startOffset,text:k}}var Re={table:{rewrite:je,plain:t=>Et(t)!==null,check:(t,{validLeaf:e})=>Tn(t,s=>typeof s=="string"&&e({tag:"td"},s,{empty:!0})),write(t,e){let s=kn(t),o=(y,T)=>t.spans?.[y]?.[T]??[1,1],a=new Map((t.widths??[]).map((y,T)=>[yn(s,T),y]).filter(([y,T])=>y&&T)),n=(y,T)=>{let[C,h]=o(y,T),O=a.get(`${y}:${T}`);return`${t.looks?.[y]?.[T]?` class="${t.looks[y][T]}"`:""}${O?` style="${On}: ${O}"`:""}${h>1?` colspan="${h}"`:""}${C>1?` rowspan="${C}"`:""}`},r=(y,T,C)=>`<tr>${y.map((h,O)=>T?`<th${n(C,O)}>${h}</th>`:t.column&&s.places.get(`${C}:${O}`).c===0?`<th${n(C,O)} scope="row">${h}</th>`:`<td${n(C,O)}>${h}</td>`).join("")}</tr>`,l=e.inner===null?null:e.inner+e.step,u=l===null?null:l+e.step,[d,...m]=t.rows,g=[];t.header&&g.push(e.block("<thead>",[r(d,!0,0)],"</thead>",l,u));let b=t.header?m:t.rows,S=t.header?1:0;return b.length>0&&g.push(e.block("<tbody>",b.map((y,T)=>r(y,!1,T+S)),"</tbody>",l,u)),e.block(`<div class="doc-table-wrap"${t.numbers===!1?` ${xn}="off"`:""}${t.chart?` ${Ln}="${t.chart}"`:""}${e.id}>`,[e.block('<table class="doc-table">',g,"</table>",e.inner,l)],"</div>")}}};var P={...Kt,...Yt,...Jt,...Qt,...te,...ne,...re,...fe,...pe,...xe,...Ce,...Ee,...Re},vn=Object.entries(P).flatMap(([t,e])=>(e.fields??[]).map(s=>[s,t])),dr=t=>vn.some(([e,s])=>t[e]!==void 0&&t.type!==s);import{FLOW as dt,HELD_TAGS as At}from"../browser/editor/components/list/index.mjs";var Dn=new Set(["section","div","blockquote","ul","ol","aside","article"]),Fe=new Set(["script","style","template","noscript","link","meta","header","dialog","form","fieldset","label","input","select","textarea","button","summary","main","caption","dd","dt","tbody","thead","tfoot","tr","td","th","figcaption"]),Ue=new Set(["img","picture","svg","canvas","video","audio","iframe","object"]),yt=new Set(["hr","img"]),Wn=new Set(["label","input","select","textarea","button"]),st=t=>In.some(e=>Bt(t,e))||En.some(e=>w(t,e)!==void 0);function _t(t){let e=t.childNodes??[],s=e.findIndex(a=>At.has(a.tagName));if(s<0)return[];let o=e.slice(s);return o.every(a=>At.has(a.tagName)||R(a))?o.filter(a=>a.tagName):null}function Mt(t){return t.tagName==="li"&&t.parentNode?.tagName==="ol"&&Bt(t.parentNode,dt)&&t.childNodes.some(e=>e.tagName)&&t.childNodes.every(e=>e.tagName?At.has(e.tagName):e.nodeName!=="#text"||!e.value.trim())}function We(t){let e=t.tagName,s=t.sourceCodeLocation;return Fe.has(e)||!(q.has(e)||Ue.has(e))||w(t,"contenteditable")!==void 0?!1:!!(s?.startTag&&(s.endTag||yt.has(e)))}var jt=(t,e=W(t))=>(P[e]?.boxes?.(t,J().packages)??[]).filter(({element:s})=>Rt(s)||s.sourceCodeLocation?.endTag&&s.childNodes.every(R));function Rt(t){if(!t.childNodes.every(s=>s.nodeName!=="#text"||!s.value.trim()))return!1;let e=t.childNodes.filter(s=>s.tagName);return e.length>0&&!e.some(s=>Wn.has(s.tagName)||!(q.has(s.tagName)||Ue.has(s.tagName)||Fe.has(s.tagName)))}function wt(t,e=null){let s=t.tagName;if(!Dn.has(s)||st(t)||w(t,"contenteditable")!==void 0)return null;let o=(w(t,"class")??"").split(/\s+/).filter(Boolean),a=t.childNodes.filter(d=>d.tagName),n=()=>a.every(d=>d.tagName==="li")&&t.childNodes.every(d=>d.tagName||!d.value?.trim());if(s==="ol"&&o.includes(dt))return o.every(d=>d===dt)&&n()?"flowchart":null;if(s==="ul"||s==="ol")return o.every(d=>(An.list??[]).includes(d))&&n()?"list":null;let r=t.childNodes.every(d=>d.nodeName!=="#text"||!d.value.trim()),l=et(t,Rn.match);if(s==="section"&&(o.length===0||l))return r&&(a.length>0||l)?"section":null;let u=Sn.find(([d])=>o.includes(d))?.[1];return u&&r&&a.length===0?u:Rt(t)?u||(o.length>0?null:s==="blockquote"?"quote":wn.has(e)?"plain":null):null}var Pn=(t,e,s=()=>!1)=>Object.entries(e.sourceCodeLocation.attrs??{}).filter(([o])=>o!=="class"&&o!==F&&!s(o,w(e,o))).sort((o,a)=>o[1].startOffset-a[1].startOffset).map(([,o])=>` ${t.slice(o.startOffset,o.endOffset)}`).join("");function W(t,e=t.parentNode){let s=(a,n,r)=>(!n||[n].flat().includes(a?.tagName))&&(!r||Bt(a,r));return Bn.find(({tag:a,class:n,attr:r,parent:l})=>s(t,a,n)&&(!r||w(t,r)!==void 0)&&(!l||e?.tagName&&s(e,l.tag,l.class)))?.kind??"block"}var Fn={flowchart:{tagName:"ol",attrs:[{name:"class",value:dt}]}},kr=(t,e)=>W(t,Fn[e]??null);function ze(t,e){let s=[],o=[],a=i=>i.parentNode.childNodes,n=i=>a(i)[a(i).indexOf(i)-1]??null,r=i=>/^[ \t]*$/.test(e.slice(e.lastIndexOf(`
|
|
18
|
+
`,i-1)+1,i)),l=i=>{let f=n(i);for(;f&&R(f);)f=n(f);return f?.tagName?f:null},u=i=>{if(!et(i,De.frame))return null;let f=l(i);return f&&et(f,De.lead)&&f.sourceCodeLocation?.endTag?f:null},d=(i,f)=>{let $=i.sourceCodeLocation.startOffset;for(let k=n(i);k;)if(R(k)&&(k.value.match(/\n/g)?.length??0)<=1)k=n(k);else if(k.nodeName==="#comment"&&k.sourceCodeLocation&&r(k.sourceCodeLocation.startOffset))f.add(k),$=k.sourceCodeLocation.startOffset,k=n(k);else break;return $},m=(i,f,$,k)=>{let c=i.sourceCodeLocation,N=u(i),L=c.attrs?.class,x={id:s.length,tag:i.tagName,kind:W(i),box:f.id,parent:$?.id??null,start:d(N??i,k),end:c.endOffset,elStart:c.startOffset,at:c.startTag.endOffset-1,lead:N?N.sourceCodeLocation.startTag.endOffset-1:null,classAttr:L?{start:L.startOffset,end:L.endOffset,value:w(i,"class")}:null,attrs:i.attrs.map(({name:E,value:A})=>({name:E,value:A})),blockId:w(i,F)??null,carried:Pn(e,i,E=>!!Cn[W(i)]?.[E]),blockIdAttr:c.attrs?.[F]?{start:c.attrs[F].startOffset,end:c.attrs[F].endOffset}:null,companion:null,keep:null,node:i,nodes:N?[N,i]:[i]};return s.push(x),N&&k.add(N),x},g=(i,f,$,k=null)=>{let c=i.sourceCodeLocation,N={id:o.length,kind:f,unit:$?.id??null,key:k,at:c.startTag.endOffset-1,innerEnd:c.endTag?.startOffset??null,pure:!0};return o.push(N),N},b=(i,f,$)=>{let k=g(i,"tabs",f),c=new Set;for(let N of i.childNodes){if(!N.tagName){N.nodeName==="#text"&&N.value.trim()&&(k.pure=!1);continue}let L=w(N,X.tabKey),x=L&&$.find(j=>w(j,X.panelKey)===L);if(N.tagName!=="button"||!et(N,X.tab)||!x?.sourceCodeLocation?.endTag||!N.sourceCodeLocation?.endTag){k.pure=!1;continue}let E=m(N,k,f,c);E.kind="tab",E.key=L;let A=x.sourceCodeLocation;E.companion={tag:x.tagName,start:d(x,new Set),end:A.endOffset,elStart:A.startOffset},E.nodes.push(x)}for(let N of i.childNodes)N.nodeName==="#comment"&&!c.has(N)&&(k.pure=!1)},S=(i,f,$,k=null)=>{let c=g(i,f,$,k),N=new Set,L=i.childNodes.filter(x=>x.tagName);L.forEach((x,E)=>{if(L[E+1]&&u(L[E+1])===x)return;if(f==="header"&&x.tagName==="h1"||!We(x)){c.pure=!1,x.tagName==="dialog"&&T(x,$),f==="main"&&et(x,jn.header)&&x.sourceCodeLocation?.endTag&&S(x,"header",null);return}y(x,m(x,c,$,N),f)});for(let x of i.childNodes)(x.nodeName==="#text"?x.value.trim():!x.tagName&&!N.has(x))&&(c.pure=!1)},y=(i,f,$)=>{if(f.kind==="sheets"){let k=It(i,X.panels),[c]=It(i,X.row);c&&b(c,f,k);for(let N of k)(Rt(N)||N.sourceCodeLocation?.endTag&&N.childNodes.every(R))&&S(N,"panel",f,w(N,X.panelKey))}else if(i.tagName==="details")for(let k of i.childNodes)k.tagName&&wt(k)==="details"&&S(k,"details",f);else if(i.tagName==="li"&&Mt(i))S(i,"node",f);else if(i.tagName==="li")C.push([i,f]);else{let k=wt(i,$);k&&S(i,k,f);for(let c of P[f.kind]?.boxes?jt(i,f.kind):[])S(c.element,c.kind,f,c.key)}},T=(i,f)=>{let[$]=It(i,Mn.content);$&&wt($)==="dialog"&&S($,"dialog",f,w(i,"id")??null)},C=[],h=(i,f)=>{let $=_t(i);if($===null||!i.sourceCodeLocation?.endTag)return;let k=g(i,"nest",f);k.pure=!1,f.nested=$.length>0;let c=new Set;for(let N of $)We(N)&&y(N,m(N,k,f,c),"nest")},O=Nt(t,"main");O?.sourceCodeLocation?.startTag&&S(O,"main",null);for(let i=0;i<C.length;i++)h(...C[i]);let p=Vn(t,s);return{units:s,boxes:o,referenced:p}}var Un=t=>t===void 0||/^\s*(?:module|(?:text|application)\/(?:x-)?(?:javascript|ecmascript)|text\/javascript1\.[0-5]|text\/(?:jscript|livescript))?\s*$/i.test(t);function zn(t){let e=Hn(t),s=new Set,o=[],a=/(["'`])((?:(?!\1)[^\\\n]|\\.)*)\1/g,n=m=>m.split(/\s+/).filter(Boolean).forEach(g=>s.add(g)),r=/(?:\bclassList\s*\.\s*(?:add|remove|toggle|contains|replace)|\.classed|\bgetElementsByClassName|\.(?:has|add|remove|toggle)Class|\bclassName\s*\.\s*(?:includes|indexOf|startsWith|endsWith)|\bclassName\s*\.\s*split\s*\([^)]*\)\s*\.\s*(?:includes|indexOf))\s*\(\s*((?:(["'`])(?:(?!\2)[^\\\n]|\\.)*\2\s*,?\s*)+)/g;for(let[,m]of t.matchAll(r))for(let[,,g]of m.matchAll(a))n(g);if(/(["'`])[^"'`\n]*\.\1\s*\+|\.\$\{/.test(t)||/(?:\bclassList\s*\.\s*(?:add|remove|toggle|contains|replace)|\.classed|\.(?:has|add|remove|toggle)Class)\s*\(\s*[A-Za-z_$][\w$.]*\s*[,)]/.test(t))for(let m of e)/^-?[A-Za-z_][\w-]*$/.test(m)&&s.add(m);let u=/\bclassName\s*(?:[!=]==?|=)\s*(["'`])((?:(?!\1)[^\\\n]|\\.)*)\1|(["'`])((?:(?!\3)[^\\\n]|\\.)*)\3\s*[!=]==?\s*[\w$.]*\bclassName\b/g;for(let m of t.matchAll(u))n(m[2]??m[4]);let d=/\[\s*class\s*([~|^$*]?)=\s*(?:"([^"]*)"|'([^']*)'|([^\]\s]+))\s*(?:[is]\s*)?\]/g;for(let m of e)for(let g of m.matchAll(d)){let b=g[2]??g[3]??g[4];g[1]===""||g[1]==="~"||g[1]==="|"?n(b):o.push(b)}return{names:s,partial:o,selectors:e.join(`
|
|
19
|
+
`)}}function Hn(t){let e=[],s=[],o=0,a="",n=0,r=l=>{let u="";for(let d=l;d<t.length;d++){let m=t[d];if(m==="\\"){u+=t.slice(d,d+2),d++;continue}if(m==="`")return e.push(u),d+1;if(m==="$"&&t[d+1]==="{")return e.push(u),s.push(o),d+2;u+=m}return e.push(u),t.length};for(;n<t.length;){let l=t[n],u=t[n+1];if(l==="/"&&u==="/"){let d=t.indexOf(`
|
|
20
|
+
`,n);n=d<0?t.length:d;continue}if(l==="/"&&u==="*"){let d=t.indexOf("*/",n+2);n=d<0?t.length:d+2;continue}if(l==='"'||l==="'"){let d=n+1,m="";for(;d<t.length&&t[d]!==l&&t[d]!==`
|
|
21
|
+
`;)t[d]==="\\"?(m+=t.slice(d,d+2),d+=2):m+=t[d++];e.push(m),n=d+1,a="a";continue}if(l==="`"){n=r(n+1),a="a";continue}if(l==="}"&&s.length&&s.at(-1)===o){s.pop(),n=r(n+1),a="a";continue}if(l==="/"&&(!/[\w$)\]}]/.test(a)||/(?:^|[^\w$.])(?:return|typeof|case|in|of|void|delete|throw|yield|await|else|do)\s*$/.test(t.slice(Math.max(0,n-12),n)))){let d=n+1,m=!1;for(;d<t.length&&t[d]!==`
|
|
22
|
+
`&&(m||t[d]!=="/");)t[d]==="\\"?d++:t[d]==="["?m=!0:t[d]==="]"&&(m=!1),d++;if(t[d]==="/"){for(n=d+1;/[a-z]/i.test(t[n]??"");)n++;a="a";continue}}l==="{"?o++:l==="}"&&o--,/\s/.test(l)||(a=l),n++}return e}var Gn=/\bDocSheets\b|["'`]sheets-|\bactiveSheet\b|data-active-sheet|["'`]sheet["'`]|\bsheet\s*:/,Kn=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function qn(t,e){if(!Gn.test(e))return!1;let s=Kn(t),o=`(["'\`])${s}\\1`;return[`\\bsheet["'\`]?\\s*:\\s*${o}`,`\\.set\\(\\s*(["'\`])${s}\\1`,`\\.set\\(\\s*(["'\`])sheet\\1\\s*,\\s*(["'\`])${s}\\2`,`[!=]==?\\s*${o}`,`${o}\\s*[!=]==?`,`\\bcase\\s+${o}\\s*:`,`active-sheet\\s*=\\s*["']?${s}["'\\]]`].some(a=>new RegExp(a).test(e))}function Vn(t,e){let s=[],o=new Map,a=h=>{for(let O of h.childNodes??[]){if(!O.tagName)continue;let p=O.sourceCodeLocation?.startOffset??-1;O.tagName==="script"&&w(O,"src")===void 0&&s.push({at:p,code:Un(w(O,"type")),text:O.childNodes.map(i=>i.value??"").join("")});for(let{name:i,value:f}of O.attrs)if(!(i==="aria-labelledby"&&O.tagName==="section"))for(let $ of _n(i,f))(o.get($)??o.set($,[]).get($)).push(p);a(O.tagName==="template"?O.content:O)}};a(t);let n=h=>h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=h=>h.slice(5).replace(/-([a-z])/g,(O,p)=>p.toUpperCase()),l=s.filter(h=>h.code),u=l.map(h=>h.text).join(`
|
|
23
|
+
`),d=h=>l.some(O=>h(O.at))?l.filter(O=>!h(O.at)).map(O=>O.text).join(`
|
|
24
|
+
`):u,m=new Map,g=(h,O)=>(p,i)=>{if(i!==u)return O(p,i);let f=`${h} ${p}`;return m.has(f)||m.set(f,O(p,i)),m.get(f)},b=g("id",(h,O)=>new RegExp(`#${n(h)}(?![\\w-])|(["'\`])${n(h)}\\1`).test(O)),S=g("data",(h,O)=>new RegExp(`${n(h)}(?![\\w-])|dataset\\.${r(h)}(?![\\w$])`).test(O)),y=new Map,T=g("class",(h,O)=>{y.has(O)||y.set(O,zn(O));let{names:p,partial:i,selectors:f}=y.get(O);return p.has(h)||i.some($=>$.includes(h))||new RegExp(`\\.${n(h)}(?![\\w-])`).test(f)}),C=h=>h.split(/\s+/).filter(O=>O&&!/^(doc-|katex)/.test(O));for(let h of e){let O=[[h.start,h.end],...h.companion?[[h.companion.start,h.companion.end]]:[]],p=v=>O.some(([I,_])=>v>=I&&v<_),i=new Map,f=new Map,$=new Map,k=(v,I,_)=>(v.get(I)??v.set(I,[]).get(I)).push(_),c=v=>{if(!v.tagName)return;let I=v.sourceCodeLocation?.startOffset??h.start;for(let{name:_,value:U}of v.attrs)_==="id"&&U?k(i,U,I):_.startsWith("data-")&&_!==F?k(f,_,I):_==="class"&&C(U).forEach(ht=>k($,ht,I));(v.tagName==="template"?v.content:v).childNodes?.forEach(c)};h.nodes.forEach(c);let N=d(p),L=(v,I,_)=>[...v].filter(([U])=>I(U)).map(([U,ht])=>({name:_(U),at:ht})),x=[...h.key&&s.some(v=>!p(v.at)&&qn(h.key,v.text))?[{name:`"${h.key}"`,at:[h.start]}]:[],...L(i,v=>b(v,N),v=>`#${v}`),...L(f,v=>S(v,N),v=>`[${v}]`),...L($,v=>T(v,N),v=>`.${v}`)],E=L(i,v=>(o.get(v)??[]).some(I=>!p(I)),v=>`#${v}`),A=x.length>0?x:E,j=A.flatMap(v=>v.at),gt=j.some(v=>!e.some(I=>I!==h&&h.start<=I.start&&I.end<=h.end&&I.start<=v&&v<I.end));h.keep=A.length>0?{reason:x.length>0?"script":"ref",names:A.map(v=>v.name),at:j,own:gt}:null}return h=>{let O=h.sourceCodeLocation;if(!O||!h.attrs.some(({name:$})=>$==="id"||$==="class"||$.startsWith("data-")))return null;let p=$=>$>=O.startOffset&&$<O.endOffset,i=d(p),f=null;for(let{name:$,value:k}of h.attrs)if($==="id"&&k){if(b(k,i))return"script";(o.get(k)??[]).some(c=>!p(c))&&(f="ref")}else{if($.startsWith("data-")&&$!==F&&S($,i))return"script";if($==="class"&&C(k).some(c=>T(c,i)))return"script"}return f}}function Xn(t,e){let s=[],o=a=>{let n=a.sourceCodeLocation?.attrs?.[F];if(n){let r=n.startOffset>0&&/\s/.test(t[n.startOffset-1])?n.startOffset-1:n.startOffset;s.push({start:r,end:n.endOffset})}for(let r of a.content?.childNodes??a.childNodes??[])o(r)};return e.forEach(o),s.sort((a,n)=>a.start-n.start)}var Pe=(t,e,s,o)=>{let a="",n=e;for(let r of o)r.start<n||r.end>s||(a+=t.slice(n,r.start),n=r.end);return a+t.slice(n,s)},Tr=(t,e)=>{let s=Xn(t,e.nodes),o=Pe(t,e.start,e.end,s);return at(e.companion?`${o}\0${Pe(t,e.companion.start,e.companion.end,s)}`:o)};ot();import{HOSTS as mt,IDENTITY as Yn}from"../browser/editor/components/registry.mjs";import{CODE as Zn,MATH as qe,MEDIA as Jn,PAGE as Qn,TABLE as to}from"../browser/editor/components/kit.mjs";import{TAB as eo}from"../browser/editor/components/paragraph/index.mjs";import{componentOf as so,isInstance as ut,matchesNode as K,partOf as no}from"../browser/shared/components/index.mjs";import{texSource as oo}from"../browser/editor/components/math/index.mjs";import{MENTION as Wt,MENTION_ICON as He,MENTION_PAGE as Ge}from"../browser/shared/components/mention.mjs";import{imageFile as ao}from"../browser/shared/media.mjs";import{isFileLink as ro}from"../browser/shared/page-address.mjs";import{isInkClass as io}from"../browser/editor/page/marks.mjs";import{ownInline as co}from"../browser/editor/page/own.mjs";import{attr as B,hasClass as lo}from"../browser/shared/html-tree.mjs";var fo=new Set(["h1","h2","h3","h4","p","li"]),uo=new Set(["h3","h4","p","figcaption"]),mo=Object.entries(mt).flatMap(([t,e])=>(e.parts??[]).map(([s,o])=>{let a=so(s);if(a?.parts?.[o]?.edit!=="text")throw new Error(`Host ${t}: ${s} has no part ${o} edited as text`);return{kind:t,match:a.match,at:a.parts[o].at}})),po=t=>mo.filter(({match:e})=>K(t,e)).flatMap(({kind:e,at:s})=>no(t,s).map(o=>({kind:e,part:o}))),go=t=>t.sort((e,s)=>e.part.sourceCodeLocation.startOffset-s.part.sourceCodeLocation.startOffset),ho=new Set(["strong","em","b","i","u","s","code","a","br","sup","sub"]),No=new Set(["ul","ol","blockquote"]),Dt=new Set(["pre","summary","button","label","select","textarea","form","template","script","style","svg","math","iframe","object","noscript","canvas","video","audio"]),Fr={p:"p",h1:"p",h2:"p",h3:"p",h4:"p",li:"li"};function $o(t,e,s){let o=mt[t];if(!o)throw new Error(`Unknown block kind ${t}`);return o.caps({bound:s,blockLevel:q.has(e)})}var Ve=t=>t.tagName==="span"&&K(t,qe.inline),bo=t=>t.tagName==="a"&&lo(t,Wt),Oo=/^https?:\/\/[^\s"<>]+$/i,nt=t=>t.attrs.map(e=>e.name).sort().join(),xo=t=>B(t,"class")===Wt&&t.childNodes.length===0&&(nt(t)==="class"||nt(t)===`class,${Ge}`&&B(t,Ge)==="");function ko(t){if(xo(t))return null;if(nt(t)!=="class,href"||B(t,"class")!==Wt||!(Oo.test(B(t,"href"))||ro(B(t,"href"))))return"mention";let[e,...s]=t.childNodes;return(e?.tagName==="img"?nt(e)==="alt,class,src"&&B(e,"class")===He&&B(e,"alt")===""&&ao(B(e,"src")):e?.tagName==="span"&&nt(e)==="class"&&B(e,"class")===He&&e.childNodes.length===0)&&s.length>0&&s.every(a=>a.nodeName==="#text")&&s.some(a=>a.value.trim())?null:"mention"}var To=t=>t.tagName==="span"&&t.attrs.length===1&&t.attrs[0].name==="class"&&t.attrs[0].value.trim().split(/\s+/).every(io),Lo=t=>t.tagName==="span"&&t.attrs.length===1&&t.attrs[0].name==="class"&&t.attrs[0].value===eo,Xe=t=>ho.has(t.tagName)||To(t)||Lo(t),pt=t=>(t.childNodes??[]).some(e=>e.nodeName==="#text"?e.value.trim()!=="":pt(e)),Ye=t=>co(t.tagName,t.attrs,pt(t)),Ke=t=>t.attrs.some(e=>e.name==="id"||e.name.startsWith("data-")&&e.name!==Yn),yo=t=>/^(javascript|vbscript|data):/i.test(t.replace(/[\u0000- ]/g,"")),vo=(t,e,s={})=>t==="text"?q.has(e)?!1:"atoms":t==="title"||t==="code"||t==="codeTitle"||t==="tex"||!!s.plain;function Pt(t,e,s=!1,{lists:o=!1,known:a=null}={}){for(let n of t.childNodes){if(n.nodeName==="#text")continue;if(!n.tagName)return"comment";if(s===!0)return`tag:${n.tagName}`;if(n.attrs.some(l=>/^on/i.test(l.name)))return"markup";if(s==="atoms"){if(!n.sourceCodeLocation?.endTag&&n.tagName!=="br")return"markup";if(a&&!a(n.sourceCodeLocation))return`tag:${n.tagName}`;e.push(n.sourceCodeLocation);continue}if(o&&(n.tagName==="ul"||n.tagName==="ol")){let l=Co(n,e,a);if(l)return l;continue}if(Ve(n)){if(n.childNodes.some(l=>l.nodeName!=="#text"))return"markup";e.push(n.sourceCodeLocation);continue}if(bo(n)){let l=ko(n);if(l)return l;e.push(n.sourceCodeLocation);continue}if(Ye(n)){if(!n.sourceCodeLocation?.endTag)return"markup";if(a&&!a(n.sourceCodeLocation))return`tag:${n.tagName}`;e.push(n.sourceCodeLocation);continue}if(!Xe(n))return`tag:${n.tagName}`;if(n.tagName!=="br"&&!n.sourceCodeLocation?.endTag)return"markup";if(n.tagName==="a"&&yo(B(n,"href")??""))return"link";let r=Pt(n,e,!1,{known:a});if(r)return r}return null}function Co(t,e,s){if(t.attrs.length>0||!t.sourceCodeLocation?.endTag)return"markup";for(let o of t.childNodes){if(o.nodeName==="#text"&&!o.value.trim())continue;if(o.tagName!=="li")return`tag:${o.tagName??"text"}`;if(o.attrs.length>0||!o.sourceCodeLocation?.endTag)return"markup";let a=Pt(o,e,!1,{known:s});if(a)return a}return null}function Y(t){let e=[],s=[],o=new Map,a=null,n=(p,i,f=null)=>{let $=p.sourceCodeLocation;if(!mt[i]||!$?.startTag||B(p,"contenteditable")!==void 0)return!1;let k=[],c=vo(i,p.tagName),N=f?{childNodes:p.childNodes.slice(0,p.childNodes.indexOf(f))}:p,L=$.endTag?Pt(N,k,c,{lists:i==="cell"}):"markup";if(L)return s.push({at:$.startTag.endOffset-1,reason:L}),!1;let x=$.startTag.endOffset,E=f?x+t.slice(x,f.sourceCodeLocation.startOffset).replace(/[ \t\r\n\f]+$/,"").length:$.endTag.startOffset,A={id:e.length,tag:p.tagName,kind:i,bound:!1,caps:{},start:$.startOffset,end:$.endOffset,innerStart:x,innerEnd:E,atoms:k.map(j=>[j.startOffset-x,j.endOffset-x]),wrapper:null,nested:!!f,node:p};return e.push(A),o.set(p,A),!0},r=p=>(p.childNodes??[]).filter(i=>i.tagName),l=p=>{let i=p.sourceCodeLocation;return i?.startTag&&i.endTag?t.slice(i.startTag.endOffset,i.endTag.startOffset):null},u=p=>p.tagName!=="a"&&!Ke(p)&&pt(p)&&r(p).every(i=>Ye(i)?!pt(i):Xe(i)||Ve(i)),d=p=>{for(let i of r(p))i.tagName==="td"||i.tagName==="th"?n(i,"cell"):["thead","tbody","tfoot","tr"].includes(i.tagName)&&d(i)},m=p=>{for(let i of r(p))i.tagName==="table"?d(i):!Dt.has(i.tagName)&&!ut(i)&&m(i)},g=p=>{let i=r(p);i.length===1&&i[0].tagName==="code"&&p.childNodes.every(f=>f.tagName||!f.value?.trim())?n(i[0],"code"):i.length===0?n(p,"code"):p.sourceCodeLocation?.startTag&&s.push({at:p.sourceCodeLocation.startTag.endOffset-1,reason:"markup"})},b=(p,i=!0)=>{for(let f of r(p)){let $=f.tagName,k=ut(f);for(let{kind:c,part:N}of go(k?P[W(f)].textParts(f,a??=J().packages):po(f)))n(N,c);if(k){for(let{element:c}of jt(f))b(c,i);continue}if($==="div"&&K(f,Zn.match)){for(let c of r(f))c.tagName==="pre"&&B(c,"contenteditable")===void 0&&g(c);continue}if(!(Dt.has($)||B(f,"contenteditable")!==void 0))if($==="table")d(f);else if($==="figure"){let c=K(f,Jn);for(let N of r(f))if(!(c&&N.tagName==="figcaption"))if(uo.has(N.tagName))n(N,"field");else if(N.tagName==="table")d(N);else{if(Dt.has(N.tagName))continue;ut(N)?b({childNodes:[N]},i):c||st(N)||Ke(N)?m(N):b({childNodes:[N]},i)}}else if($==="details")for(let c of r(f))ut(c)?b({childNodes:[c]},i):c.tagName!=="summary"&&b(c,i);else if($==="h1"&&(p.tagName==="header"||K(f,Qn.title)))n(f,"title");else if($==="li"&&Mt(f))b({childNodes:r(f)},i);else if(fo.has($)){let c=$==="li"?_t(f):[];c?.length>0?(n(f,"flow",c[0]),b({childNodes:c},i)):n(f,"flow")||b(f,!1)}else if($==="div"&&K(f,qe.block)&&r(f).length===0&&oo(l(f)))n(f,"tex");else if($==="div"&&K(f,to.lead))for(let c of r(f))c.tagName==="span"&&n(c,"field");else i&&!st(f)&&u(f)?n(f,"text"):(b(f,i&&!st(f)),No.has($)&&S(f))}},S=p=>{let i=p.sourceCodeLocation,f=r(p).map(c=>o.get(c));if(!(f.length>0&&f.every(Boolean)&&p.childNodes.every(c=>c.tagName||c.nodeName==="#text"&&!c.value.trim()))||!i?.endTag)return;let k={start:i.startOffset,end:i.endOffset,ids:f.map(c=>c.id)};f.forEach(c=>c.wrapper=k)},y=p=>{for(let i of r(p))(i.tagName==="main"?b:y)(i)},T=z(t,{sourceCodeLocationInfo:!0});y(T);let{units:C,boxes:h,referenced:O}=ze(T,t);for(let p of C)p.grid=!!P[p.kind]?.plain?.(p.node);for(let p of C){let i=P[p.kind]?.dataOf?.(t,p.node,a??=J().packages);i&&(p.parts=Object.fromEntries(Object.entries(i).map(([f,$])=>[f,at($)])))}for(let p of e){let i=null;for(let f of C)f.start<=p.start&&p.start<f.end&&(!i||f.start>i.start)&&(i=f);p.unit=i?.id??null,p.self=i&&i.at===p.innerStart-1?i.id:null,p.self!==null&&(i.text=p.id),p.path=i&&p.self===null?So(i,p.node):null,mt.text&&p.kind==="flow"&&p.self===null&&(i?.kind==="block"||i?.kind==="figure")&&(p.kind="text"),p.bound=O(p.node)!==null,p.caps=Object.fromEntries($o(p.kind,p.tag,p.bound).map(f=>[f,!0]))}return{blocks:e,locks:s,units:C,boxes:h}}function So(t,e){let s=[],o=e;for(;o&&!t.nodes.includes(o);o=o.parentNode){let a=(o.parentNode?.childNodes??[]).filter(n=>n.tagName===o.tagName);s.unshift([o.tagName,a.indexOf(o),a.length])}return o?[o===t.node?"unit":o===t.nodes[0]&&t.lead!==null?"lead":"panel",...s]:null}var Ur=t=>Y(t).blocks;function zr(t){let{units:e,boxes:s}=Y(t);return{units:e,boxes:s}}ot();import{randomBlockId as Eo}from"../browser/shared/ids.mjs";import{IDENTITY as Z}from"../browser/editor/components/registry.mjs";var Io=/\sdata-block-id\s*=\s*(?:"([^"]*)"|'([^']*)')/gi;function Yr(t,e=Eo){let{units:s}=Y(t),o=new Set([...t.matchAll(Io)].map(m=>m[1]??m[2])),a=()=>{for(;;){let m=e();if(!o.has(m))return o.add(m)&&m}},n=new Set,r=[],l=[],u=[];for(let m of s)if(m.blockId)n.has(m.blockId)&&m.blockIdAttr?(l.push(m.blockId),r.push({start:m.blockIdAttr.start,end:m.blockIdAttr.end,text:`${Z}="${a()}"`})):n.add(m.blockId);else{let g=a();if(m.blockIdAttr)r.push({start:m.blockIdAttr.start,end:m.blockIdAttr.end,text:`${Z}="${g}"`});else{let b=ft(t,m.at);r.push({start:b,end:b,text:` ${Z}="${g}"`})}u.push({id:g,tag:Je(m.tag,m.attrs),at:m.elStart})}let d=t;for(let m of r.sort((g,b)=>b.start-g.start))d=d.slice(0,m.start)+m.text+d.slice(m.end);return u.sort((m,g)=>m.at-g.at),{text:d,added:u.length,renamed:l,given:u.map(({id:m,tag:g})=>({id:m,tag:g}))}}function Zr(t){let e=Ze(t);return Y(t).units.filter(s=>!s.blockId).sort((s,o)=>s.elStart-o.elStart).map(s=>({line:e(s.elStart),tag:Je(s.tag,s.attrs)}))}function Jr(t,e){let s=new Map(e.map(a=>[a.id,a])),o=Ze(t);return Y(t).units.filter(a=>s.has(a.blockId)).sort((a,n)=>a.elStart-n.elStart).map(a=>({...s.get(a.blockId),line:o(a.elStart)}))}function Ze(t){let e=[0];for(let s=t.indexOf(`
|
|
25
|
+
`);s!==-1;s=t.indexOf(`
|
|
26
|
+
`,s+1))e.push(s+1);return s=>{let[o,a]=[0,e.length-1];for(;o<a;){let n=o+a+1>>1;e[n]<=s?o=n:a=n-1}return o+1}}function Je(t,e=[]){let s=e.filter(({name:n})=>n!==Z&&n!=="style"),o=n=>{let r=n.replace(/\s+/g," "),l=r.length>32?`${r.slice(0,31)}\u2026`:r;return l===""?"":/[\s"'=<>`]/.test(l)?`="${l.replaceAll('"',""")}"`:`=${l}`},a=s.slice(0,3).map(({name:n,value:r})=>`${n}${o(r)}`);return`<${[t,...a,...s.length>3?["\u2026"]:[]].join(" ")}>`}function Qr(t){let e=new Map,s=o=>{let a=o.attrs?.find(r=>r.name===Z)?.value,n=o.sourceCodeLocation?.attrs?.[Z]??o.sourceCodeLocation;a!==void 0&&e.set(a,[...e.get(a)??[],n]);for(let r of o.content?.childNodes??o.childNodes??[])s(r)};return s(z(t,{sourceCodeLocationInfo:!0})),[...e].filter(([,o])=>o.length>1).map(([o,a])=>({id:o,lines:a.map(n=>n?.startLine),columns:a.map(n=>n?.startCol)}))}export{at as a,Nt as b,q as c,st as d,jt as e,Pn as f,kr as g,Xn as h,Tr as i,ye as j,ft as k,lt as l,ya as m,va as n,vt as o,Ca as p,nn as q,Sa as r,Ea as s,Lt as t,G as u,on as v,Ia as w,dn as x,mn as y,P as z,dr as A,Fr as B,vo as C,Pt as D,Y as E,Ur as F,zr as G,Eo as H,Io as I,Yr as J,Zr as K,Jr as L,Qr as M};
|
|
@@ -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 L from"node:fs";import{pipeline as F}from"node:stream/promises";import z from"node:zlib";import{refusal as B,said as k}from"../browser/shared/i18n/index.mjs";var Z=67324752,O=33639248,A=101010256,P=101075792,W=117853008,I=4294967295,D=2048;function v(t=new Date){let o=t.getHours()<<11|t.getMinutes()<<5|Math.floor(t.getSeconds()/2),n=Math.max(1980,t.getFullYear())-1980<<9|t.getMonth()+1<<5|t.getDate();return[o,n]}function K(t){let[o,n]=v(),c=[],d=[],r=0;for(let a of t){let u=Buffer.isBuffer(a.data)?a.data:Buffer.from(a.data??"","utf8"),e=Buffer.from(a.name,"utf8"),w=u.length>64?z.deflateRawSync(u):null,h=w&&w.length<u.length?w:u,m=h===u?0:8,g=z.crc32(u);if(u.length>=I||r>=I)throw new Error("\u538B\u7F29\u5305\u592A\u5927\uFF08\u8D85\u8FC7 4GB\uFF09");let l=Buffer.alloc(30);l.writeUInt32LE(Z,0),l.writeUInt16LE(20,4),l.writeUInt16LE(D,6),l.writeUInt16LE(m,8),l.writeUInt16LE(o,10),l.writeUInt16LE(n,12),l.writeUInt32LE(g,14),l.writeUInt32LE(h.length,18),l.writeUInt32LE(u.length,22),l.writeUInt16LE(e.length,26),l.writeUInt16LE(0,28);let s=Buffer.alloc(46);s.writeUInt32LE(O,0),s.writeUInt16LE(20,4),s.writeUInt16LE(20,6),s.writeUInt16LE(D,8),s.writeUInt16LE(m,10),s.writeUInt16LE(o,12),s.writeUInt16LE(n,14),s.writeUInt32LE(g,16),s.writeUInt32LE(h.length,20),s.writeUInt32LE(u.length,24),s.writeUInt16LE(e.length,28),s.writeUInt32LE(r,42),c.push(l,e,h),d.push(s,e),r+=l.length+e.length+h.length}if(t.length>=65535)throw new Error("\u538B\u7F29\u5305\u91CC\u7684\u6587\u4EF6\u592A\u591A");let i=Buffer.concat(d),f=Buffer.alloc(22);return f.writeUInt32LE(A,0),f.writeUInt16LE(t.length,8),f.writeUInt16LE(t.length,10),f.writeUInt32LE(i.length,12),f.writeUInt32LE(r,16),Buffer.concat([...c,i,f])}var G=new TextDecoder("utf-8",{fatal:!0}),H=new TextDecoder("gbk");function X(t,o){if(o&D)return t.toString("utf8");try{return G.decode(t)}catch{return H.decode(t)}}var U=()=>new Error("ZIP \u6587\u4EF6\u5DF2\u635F\u574F"),E=(t,o)=>Number(t.readBigUInt64LE(o));function C(t,o){let n=Math.min(o,65557),c=t(o-n,n),d=-1;for(let e=c.length-22;e>=0;e-=1)if(c.readUInt32LE(e)===A){d=e;break}if(d<0)throw new Error("\u4E0D\u662F\u6709\u6548\u7684 ZIP \u6587\u4EF6");let r=c.readUInt16LE(d+10),i=c.readUInt32LE(d+12),f=c.readUInt32LE(d+16);if(r===65535||i===I||f===I){let e=t(o-n+d-20,20);if(e.readUInt32LE(0)!==W)throw U();let w=t(E(e,8),56);if(w.readUInt32LE(0)!==P)throw U();r=E(w,32),i=E(w,40),f=E(w,48)}let a=t(f,i),u=[];for(let e=0,w=0;w<r;w+=1){if(a.readUInt32LE(e)!==O)throw U();let h=a.readUInt16LE(e+8),m=a.readUInt16LE(e+10),g=a.readUInt32LE(e+20),l=a.readUInt32LE(e+24),s=a.readUInt16LE(e+28),T=a.readUInt16LE(e+30),N=a.readUInt16LE(e+32),R=a.readUInt32LE(e+42),b=X(a.subarray(e+46,e+46+s),h),p=a.subarray(e+46+s,e+46+s+T);for(let x=0;x+4<=p.length;x+=4+p.readUInt16LE(x+2)){if(p.readUInt16LE(x)!==1)continue;let S=x+4;l===I&&(l=E(p,S),S+=8),g===I&&(g=E(p,S),S+=8),R===I&&(R=E(p,S))}if(e+=46+s+T+N,!b.endsWith("/")){if(h&1)throw B(k("{0} \u5DF2\u52A0\u5BC6",b));if(m!==0&&m!==8)throw B(k("{0}\uFF1A\u4E0D\u652F\u6301\u7684\u538B\u7F29\u65B9\u5F0F",b));u.push({name:b,method:m,packedSize:g,size:l,local:R})}}return u}function M(t,o){let n=t(o.local,30);if(n.readUInt32LE(0)!==Z)throw U();return o.local+30+n.readUInt16LE(26)+n.readUInt16LE(28)}function Q(t){let o=(n,c)=>{if(n<0||n+c>t.length)throw U();return t.subarray(n,n+c)};return C(o,t.length).map(n=>{let c=o(M(o,n),n.packedSize),d=n.method===0?Buffer.from(c):z.inflateRawSync(c);if(d.length!==n.size)throw B(k("{0}\uFF1A\u5927\u5C0F\u4E0D\u7B26",n.name));return{name:n.name,data:d}})}function V(t){let o=L.openSync(t,"r"),n=L.fstatSync(o).size,c=(r,i)=>{if(r<0||r+i>n)throw U();let f=Buffer.alloc(i);for(let a=0;a<i;){let u=L.readSync(o,f,a,i-a,r+a);if(u===0)throw U();a+=u}return f},d;try{d=C(c,n)}catch(r){throw L.closeSync(o),r}return{entries:d,read(r){let i=c(M(c,r),r.packedSize),f=r.method===0?i:z.inflateRawSync(i);if(f.length!==r.size)throw B(k("{0}\uFF1A\u5927\u5C0F\u4E0D\u7B26",r.name));return f},async extract(r,i){let f=M(c,r);if(r.packedSize===0)await L.promises.writeFile(i,"");else{let a=L.createReadStream(null,{fd:o,start:f,end:f+r.packedSize-1,autoClose:!1});await F(...r.method===0?[a]:[a,z.createInflateRaw()],L.createWriteStream(i))}if((await L.promises.stat(i)).size!==r.size)throw B(k("{0}\uFF1A\u5927\u5C0F\u4E0D\u7B26",r.name))},close:()=>L.closeSync(o)}}export{K as a,Q as b,V as c};
|