wherdr 2.2.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{AgentView.CfD2RWZY.css → AgentView.B12D6ccj.css} +1 -1
- package/.output/public/_nuxt/AgentView.B12D6ccj.css.br +0 -0
- package/.output/public/_nuxt/AgentView.B12D6ccj.css.gz +0 -0
- package/.output/public/_nuxt/{DuVQjOfc.js → B2KlcBQ-.js} +1 -1
- package/.output/public/_nuxt/B2KlcBQ-.js.br +0 -0
- package/.output/public/_nuxt/{DuVQjOfc.js.gz → B2KlcBQ-.js.gz} +0 -0
- package/.output/public/_nuxt/BDTOz37p.js +1 -0
- package/.output/public/_nuxt/BDTOz37p.js.br +0 -0
- package/.output/public/_nuxt/BDTOz37p.js.gz +0 -0
- package/.output/public/_nuxt/BGD5AamG.js +25 -0
- package/.output/public/_nuxt/BGD5AamG.js.br +0 -0
- package/.output/public/_nuxt/BGD5AamG.js.gz +0 -0
- package/.output/public/_nuxt/BdJIc1Xf.js +1 -0
- package/.output/public/_nuxt/BdJIc1Xf.js.br +0 -0
- package/.output/public/_nuxt/BdJIc1Xf.js.gz +0 -0
- package/.output/public/_nuxt/BxlzUs1i.js +23 -0
- package/.output/public/_nuxt/BxlzUs1i.js.br +0 -0
- package/.output/public/_nuxt/BxlzUs1i.js.gz +0 -0
- package/.output/public/_nuxt/C-BDzEtI.js +3 -0
- package/.output/public/_nuxt/C-BDzEtI.js.br +0 -0
- package/.output/public/_nuxt/C-BDzEtI.js.gz +0 -0
- package/.output/public/_nuxt/{CML5cHwz.js → CLf2i_DM.js} +1 -1
- package/.output/public/_nuxt/CO4sDeSt.js +62 -0
- package/.output/public/_nuxt/CO4sDeSt.js.br +0 -0
- package/.output/public/_nuxt/CO4sDeSt.js.gz +0 -0
- package/.output/public/_nuxt/{CoRTPMqP.js → CPlkxpge.js} +42 -42
- package/.output/public/_nuxt/CPlkxpge.js.br +0 -0
- package/.output/public/_nuxt/CPlkxpge.js.gz +0 -0
- package/.output/public/_nuxt/CTPNZj4T.js +9 -0
- package/.output/public/_nuxt/CTPNZj4T.js.br +0 -0
- package/.output/public/_nuxt/CTPNZj4T.js.gz +0 -0
- package/.output/public/_nuxt/CV6ukk-M.js +1 -0
- package/.output/public/_nuxt/CgUSTIM1.js +1 -0
- package/.output/public/_nuxt/CgUSTIM1.js.br +0 -0
- package/.output/public/_nuxt/CgUSTIM1.js.gz +0 -0
- package/.output/public/_nuxt/CwurhZnh.js +123 -0
- package/.output/public/_nuxt/CwurhZnh.js.br +0 -0
- package/.output/public/_nuxt/CwurhZnh.js.gz +0 -0
- package/.output/public/_nuxt/D7fCPncR.js +1 -0
- package/.output/public/_nuxt/D7fCPncR.js.br +0 -0
- package/.output/public/_nuxt/D7fCPncR.js.gz +0 -0
- package/.output/public/_nuxt/DFe-cDm2.js +1 -0
- package/.output/public/_nuxt/DFe-cDm2.js.br +0 -0
- package/.output/public/_nuxt/DFe-cDm2.js.gz +0 -0
- package/.output/public/_nuxt/Dpe9TNcA.js +31 -0
- package/.output/public/_nuxt/Dpe9TNcA.js.br +0 -0
- package/.output/public/_nuxt/Dpe9TNcA.js.gz +0 -0
- package/.output/public/_nuxt/{board.CeTYM1XN.css → board.fZYj3O-m.css} +1 -1
- package/.output/public/_nuxt/board.fZYj3O-m.css.br +0 -0
- package/.output/public/_nuxt/board.fZYj3O-m.css.gz +0 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/75cc4ea7-3027-463a-aa3e-29e474ed7173.json +1 -0
- package/.output/public/_nuxt/entry.KNdllmoL.css +2 -0
- package/.output/public/_nuxt/entry.KNdllmoL.css.br +0 -0
- package/.output/public/_nuxt/entry.KNdllmoL.css.gz +0 -0
- package/.output/public/sw.js +1 -1
- package/.output/server/chunks/_/branding.mjs +1 -1
- package/.output/server/chunks/_/package.mjs +1 -1
- package/.output/server/chunks/_/selfupdate.mjs +1 -1
- package/.output/server/chunks/_/updates.mjs +18 -5
- package/.output/server/chunks/_/worktrees.mjs +1 -1
- package/.output/server/chunks/_/ws.mjs +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +1109 -609
- package/.output/server/chunks/raw/install-claude-statusline.mjs +1 -1
- package/.output/server/chunks/routes/api/search.get.mjs +55 -2
- package/.output/server/chunks/routes/api/seen.post.mjs +1 -1
- package/.output/server/chunks/routes/api/send-now.post.mjs +53 -0
- package/.output/server/chunks/routes/api/sessions.get.mjs +1 -1
- package/.output/server/chunks/routes/api/sessions.post.mjs +1 -1
- package/.output/server/chunks/routes/api/settings-tab.post.mjs +1 -1
- package/.output/server/chunks/routes/api/settings.get.mjs +1 -1
- package/.output/server/chunks/routes/api/settings.post.mjs +1 -1
- package/.output/server/chunks/routes/api/space.post.mjs +1 -177
- package/.output/server/chunks/routes/api/split-command.post.mjs +157 -0
- package/.output/server/chunks/routes/api/tasks/action.post.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/add.post.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/after.post.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/approve.post.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/archive-done.post.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/archived.get.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/autopilot.get.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/autopilot.post.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/board-settings.get.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/board-settings.post.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/coordinator.get.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/coordinator.post.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/describe.post.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/details.get.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/limit.post.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/links.get.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/models.get.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/pick.post.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/project.get.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/project.post.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/question.post.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/scheduled.get.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/settings.get.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/start.get.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks/tell.post.mjs +1 -1
- package/.output/server/chunks/routes/api/tasks.get.mjs +1 -1
- package/.output/server/chunks/routes/api/unqueue.post.mjs +1 -1
- package/.output/server/chunks/routes/icons/_name_.get.mjs +1 -1
- package/.output/server/chunks/routes/renderer.mjs +2 -2
- package/.output/server/chunks/routes/uploads/_...name_.get.mjs +1 -1
- package/.output/server/chunks/routes/ws/_..._.mjs +1 -1
- package/.output/server/chunks/routes/ws/events.mjs +5 -1
- package/.output/server/chunks/routes/ws/term.mjs +1 -1
- package/.output/server/chunks/virtual/precomputed.mjs +1 -1
- package/.output/server/index.mjs +1 -1
- package/.output/server/package.json +1 -1
- package/README.md +3 -1
- package/docs/README.md +5 -0
- package/docs/RELEASING.md +18 -10
- package/docs/board.md +8 -1
- package/docs/design.md +112 -0
- package/docs/devices.md +5 -0
- package/docs/herdr-projects-1x.md +28 -0
- package/docs/home.md +9 -0
- package/docs/installation.md +12 -0
- package/docs/quotas.md +6 -0
- package/docs/release-notes-2.3.0.md +23 -0
- package/docs/release-notes-2.4.0.md +37 -0
- package/package.json +1 -1
- package/.output/public/_nuxt/30nuHmZs.js +0 -1
- package/.output/public/_nuxt/30nuHmZs.js.br +0 -0
- package/.output/public/_nuxt/30nuHmZs.js.gz +0 -0
- package/.output/public/_nuxt/4gY2mLGX.js +0 -62
- package/.output/public/_nuxt/4gY2mLGX.js.br +0 -0
- package/.output/public/_nuxt/4gY2mLGX.js.gz +0 -0
- package/.output/public/_nuxt/AgentView.CfD2RWZY.css.br +0 -0
- package/.output/public/_nuxt/AgentView.CfD2RWZY.css.gz +0 -0
- package/.output/public/_nuxt/B8eSr-59.js +0 -1
- package/.output/public/_nuxt/B8eSr-59.js.br +0 -0
- package/.output/public/_nuxt/B8eSr-59.js.gz +0 -0
- package/.output/public/_nuxt/BsbsvkAK.js +0 -1
- package/.output/public/_nuxt/BsbsvkAK.js.br +0 -0
- package/.output/public/_nuxt/BsbsvkAK.js.gz +0 -0
- package/.output/public/_nuxt/CN39A7L5.js +0 -3
- package/.output/public/_nuxt/CN39A7L5.js.br +0 -0
- package/.output/public/_nuxt/CN39A7L5.js.gz +0 -0
- package/.output/public/_nuxt/CfQgQDOp.js +0 -9
- package/.output/public/_nuxt/CfQgQDOp.js.br +0 -0
- package/.output/public/_nuxt/CfQgQDOp.js.gz +0 -0
- package/.output/public/_nuxt/CoRTPMqP.js.br +0 -0
- package/.output/public/_nuxt/CoRTPMqP.js.gz +0 -0
- package/.output/public/_nuxt/CvGCN0_f.js +0 -23
- package/.output/public/_nuxt/CvGCN0_f.js.br +0 -0
- package/.output/public/_nuxt/CvGCN0_f.js.gz +0 -0
- package/.output/public/_nuxt/DmYihq1h.js +0 -1
- package/.output/public/_nuxt/DoX0nZZb.js +0 -105
- package/.output/public/_nuxt/DoX0nZZb.js.br +0 -0
- package/.output/public/_nuxt/DoX0nZZb.js.gz +0 -0
- package/.output/public/_nuxt/DuVQjOfc.js.br +0 -0
- package/.output/public/_nuxt/Y-4S7Nuf.js +0 -1
- package/.output/public/_nuxt/Y-4S7Nuf.js.br +0 -0
- package/.output/public/_nuxt/Y-4S7Nuf.js.gz +0 -0
- package/.output/public/_nuxt/board.CeTYM1XN.css.br +0 -0
- package/.output/public/_nuxt/board.CeTYM1XN.css.gz +0 -0
- package/.output/public/_nuxt/builds/meta/fd79ea32-8bac-487a-afa1-7a6e336fff3f.json +0 -1
- package/.output/public/_nuxt/entry.Cd2iNkBC.css +0 -2
- package/.output/public/_nuxt/entry.Cd2iNkBC.css.br +0 -0
- package/.output/public/_nuxt/entry.Cd2iNkBC.css.gz +0 -0
- package/.output/public/_nuxt/hSqNtAW9.js +0 -25
- package/.output/public/_nuxt/hSqNtAW9.js.br +0 -0
- package/.output/public/_nuxt/hSqNtAW9.js.gz +0 -0
- package/.output/public/_nuxt/o1wml4Rx.js +0 -31
- package/.output/public/_nuxt/o1wml4Rx.js.br +0 -0
- package/.output/public/_nuxt/o1wml4Rx.js.gz +0 -0
package/docs/design.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Design rules
|
|
2
|
+
|
|
3
|
+
This is the single design reference for wherdr interface changes. Follow the
|
|
4
|
+
existing app rather than introducing a second visual system. Source examples below
|
|
5
|
+
are in [main.css](../app/assets/css/main.css), unless linked separately.
|
|
6
|
+
|
|
7
|
+
## Structure and typography
|
|
8
|
+
|
|
9
|
+
Keep the brutalist herdr.dev style: square corners and thin, 1 px rules separating
|
|
10
|
+
surfaces. Use the existing font tokens: Archivo for display headings (`--display`),
|
|
11
|
+
Inter for body text (`--sans`), and JetBrains Mono for technical text and labels
|
|
12
|
+
(`--mono`). Labels are uppercase mono, with the existing letter spacing; do not
|
|
13
|
+
uppercase body copy. Examples: `.hw-sheet-title`, `.menu-group`, `.task-chip` and
|
|
14
|
+
the `--font-display`, `--font-sans`, `--font-mono` definitions.
|
|
15
|
+
|
|
16
|
+
## Theme colors
|
|
17
|
+
|
|
18
|
+
Use theme variables only in interface styling: `--text`, `--text-2`, `--muted`,
|
|
19
|
+
`--dim`, `--line`, `--line-soft`, `--accent`, `--on-accent`, `--bg`, `--surface`
|
|
20
|
+
and the semantic state tokens. Do not add hardcoded hex, RGB or named colors to
|
|
21
|
+
components. Palette values belong in the theme definitions in `main.css` and
|
|
22
|
+
[themes.ts](../app/utils/themes.ts); themes can override the state colors too.
|
|
23
|
+
Examples: `.menu button:active` uses `--surface-2`, `.task-chip` uses `--line`,
|
|
24
|
+
and `.card-state.working` uses `--working`.
|
|
25
|
+
|
|
26
|
+
## Agent and pane state
|
|
27
|
+
|
|
28
|
+
Use the small square indicator, never a circle, rounded dot or circular status
|
|
29
|
+
icon. Reuse `.card-state i` or `.pill i`, as in
|
|
30
|
+
[AgentCard.vue](../app/components/AgentCard.vue) and
|
|
31
|
+
[AgentView.vue](../app/components/AgentView.vue). Their base size is **7 × 7 px**.
|
|
32
|
+
Keep the label alongside the indicator so color is not the only signal.
|
|
33
|
+
|
|
34
|
+
| State | Theme token | Shape and behavior | Source example |
|
|
35
|
+
| --- | --- | --- | --- |
|
|
36
|
+
| Ready (`idle` in CSS) | `--idle` (green by default) | Hollow square, inset outline | `.card-state.idle i`, `.pill.idle i` |
|
|
37
|
+
| Working | `--working` (purple by default) | Filled square, 1.3 s pulse | `.card-state.working i`, `.pill.working i` |
|
|
38
|
+
| Blocked | `--blocked` (orange by default) | Filled square, 0.9 s pulse | `.card-state.blocked i`, `.pill.blocked i` |
|
|
39
|
+
| Done | `--done` (green by default) | Filled square | `.card-state.done`, `.pill.done` |
|
|
40
|
+
| Inactive | `--muted` | Hollow square | `.pill.inactive i` |
|
|
41
|
+
| Unknown / shell | `--dim` | Filled square | `.card-state.unknown`, `.card-state.shell`, `.pill.unknown`, `.pill.shell` |
|
|
42
|
+
|
|
43
|
+
Preserve the existing deliberate size variations rather than copying them into a
|
|
44
|
+
new status system: `.card-state.blocked i` is 8 px; compact home lead indicators
|
|
45
|
+
are 9 px (10 px when blocked) under `.card.compact.home-lead`. The shape remains
|
|
46
|
+
square. The color names above describe the default Titanium palette, not fixed
|
|
47
|
+
colors to impose on other themes.
|
|
48
|
+
|
|
49
|
+
## Icons and buttons
|
|
50
|
+
|
|
51
|
+
Use Lucide icons (`i-lucide-*`) for interface actions. Reuse the icon already used
|
|
52
|
+
for the same action; search existing components before choosing one.
|
|
53
|
+
|
|
54
|
+
| Action | Icon | Existing example |
|
|
55
|
+
| --- | --- | --- |
|
|
56
|
+
| Send | `i-lucide-arrow-up` | `UChatPromptSubmit` in [Composer.vue](../app/components/Composer.vue) (Nuxt UI submit icon) |
|
|
57
|
+
| Back | `i-lucide-chevron-left` | [AgentView.vue](../app/components/AgentView.vue), `.back` |
|
|
58
|
+
| More / options | `i-lucide-ellipsis` | [SpaceMenu.vue](../app/components/SpaceMenu.vue), `.space-menu` |
|
|
59
|
+
|
|
60
|
+
Agent branding and the existing `i-herdr-stop` glyph in `Composer.vue` are not
|
|
61
|
+
alternative action icon libraries to extend.
|
|
62
|
+
|
|
63
|
+
Buttons have square corners: no circular or pill-shaped buttons. Use existing
|
|
64
|
+
Nuxt UI controls with the app's classes, such as `.mono-btn`, `.icon-btn` and
|
|
65
|
+
`.task-sheet-actions > button`, rather than introducing a new button style.
|
|
66
|
+
|
|
67
|
+
Every touch target must be at least **44 × 44 px**. The drawn control can be
|
|
68
|
+
smaller if its actual hit area reaches that minimum. Example: `.prompt-send` is
|
|
69
|
+
32 px with `::after { inset: -8px }`, producing a 48 px hit area. Reserve space
|
|
70
|
+
for the expanded target: it must not overlap a neighbor's hit area. Coarse-pointer
|
|
71
|
+
`.icon-btn` controls are 44 × 44 px; `.hw-sheet-handle` draws a small bar within
|
|
72
|
+
a 44 px-high button. Check hit geometry, not just the visible icon.
|
|
73
|
+
|
|
74
|
+
## Phone headers and sheets
|
|
75
|
+
|
|
76
|
+
Phone header bars must be **44 px high**, excluding safe-area insets. Build around
|
|
77
|
+
the existing 44 px `.icon-btn` controls and `.agent-top` / `.board-panel-head`
|
|
78
|
+
structure; do not add padding that unnecessarily increases the bar height. These
|
|
79
|
+
selectors are the integration points, not evidence that every current header
|
|
80
|
+
already meets this rule.
|
|
81
|
+
|
|
82
|
+
Reuse [AppSheet.vue](../app/components/AppSheet.vue) for drawers and sheets:
|
|
83
|
+
outside tap and downward swipe close a phone sheet; the handle also supports tap,
|
|
84
|
+
and Escape closes the modal. **Do not add a cross close button to sheets.**
|
|
85
|
+
The gesture implementation is `dragStart` / `dragMove` / `dragEnd`, with the
|
|
86
|
+
`.hw-sheet-handle` target. Current implementation gap: `AppSheet` still renders
|
|
87
|
+
`.hw-sheet-close` with `i-lucide-x`; this is not a pattern to copy. Full-screen
|
|
88
|
+
`screen` views disable sheet dragging, so retain an explicit navigation action
|
|
89
|
+
when using that mode.
|
|
90
|
+
|
|
91
|
+
Reuse [MenuSheet.vue](../app/components/MenuSheet.vue), `.menu`, `.menu-group`,
|
|
92
|
+
`.menu-sep` and `.menu-note` for action lists and grouped menus. Use
|
|
93
|
+
[SpaceMenu.vue](../app/components/SpaceMenu.vue) as the example of a menu that
|
|
94
|
+
adapts between phone sheets and desktop dropdowns. Avoid parallel sheet or menu
|
|
95
|
+
implementations.
|
|
96
|
+
|
|
97
|
+
## Text and layout checks
|
|
98
|
+
|
|
99
|
+
Follow [Contributing: Conventions](../CONTRIBUTING.md#conventions) for English
|
|
100
|
+
keys, mandatory French translations and `t()` / `tl()` usage. Do not duplicate
|
|
101
|
+
those translation rules here. Examples: the translated Send label in
|
|
102
|
+
[Composer.vue](../app/components/Composer.vue) and Back in
|
|
103
|
+
[AgentView.vue](../app/components/AgentView.vue).
|
|
104
|
+
|
|
105
|
+
For every interface change, inspect the layout on an iPhone-sized phone and a
|
|
106
|
+
computer (iPhone 13 and 1440 × 900 are the repository's screenshot sizes). Check
|
|
107
|
+
text wrapping, header height, touch targets and their neighbors, menu and sheet
|
|
108
|
+
dismissal, scrolling, keyboard and safe areas. Use the existing responsive
|
|
109
|
+
`.agent-top` and `.hw-sheet.screen` styles as integration examples. Follow the
|
|
110
|
+
[device guide](devices.md) and the [iOS convention](../CONTRIBUTING.md#conventions);
|
|
111
|
+
use the isolated demo screenshot workflow in
|
|
112
|
+
[Contributing](../CONTRIBUTING.md#the-browser-demo) for visual evidence.
|
package/docs/devices.md
CHANGED
|
@@ -56,3 +56,8 @@
|
|
|
56
56
|
pane has the key bar; with the keyboard open the tab fits the visible area above it.
|
|
57
57
|
- **Hardware keyboard**: Enter sends (Shift+Enter adds a line) once a key only a hardware
|
|
58
58
|
keyboard sends (arrows, Esc, a ⌘ chord) has been typed.
|
|
59
|
+
|
|
60
|
+
The terminal key bar also has **Ctrl**, **Alt** and **Shift** toggles. Select one or
|
|
61
|
+
several, then tap a key or type one ASCII character on the phone keyboard. The
|
|
62
|
+
modifiers reset after that key; tapping a selected modifier cancels it. Pasting
|
|
63
|
+
or entering composed text clears the selection and keeps the text unchanged.
|
|
@@ -276,3 +276,31 @@ devices open keep working.
|
|
|
276
276
|
|
|
277
277
|
Follow [Migrate a 1.x Docker install](migrate-from-1.x-docker.md): back up, stop the container,
|
|
278
278
|
install the native service, check, and go back if needed. It is written so an AI agent can run it.
|
|
279
|
+
|
|
280
|
+
## Shepherdr 2
|
|
281
|
+
|
|
282
|
+
Shepherdr 2.x retains the `herdr-projects` plugin id but uses a different CLI and
|
|
283
|
+
store. wherdr detects its version or manifest and reports **Shepherdr 2 detected:
|
|
284
|
+
wherdr’s Board does not support it**, rather than asking for an update. Agents,
|
|
285
|
+
terminal, files and machines remain available. wherdr never starts Shepherdr or
|
|
286
|
+
migrates its data automatically.
|
|
287
|
+
|
|
288
|
+
To return to the Board's supported herdr-projects 1.2.x release:
|
|
289
|
+
|
|
290
|
+
1. Finish or stop ongoing work, then stop Shepherdr using its own controls.
|
|
291
|
+
2. Back up both data stores (`~/.herdr-projects` and `~/.shepherdr`), worktrees and
|
|
292
|
+
Herdr configuration. Keep the takeover backup made by Shepherdr too.
|
|
293
|
+
3. On the affected machine, reinstall the pinned release yourself:
|
|
294
|
+
|
|
295
|
+
```sh
|
|
296
|
+
herdr plugin uninstall herdr-projects && herdr plugin install eliasstravik/herdr-projects --ref v1.2.21 --yes
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
4. Check Herdr configuration against the takeover backup; restore only the required
|
|
300
|
+
sidebar/configuration entries, preserving subsequent changes, then reload Herdr's
|
|
301
|
+
configuration and open the 1.x board. Refresh wherdr to check detection.
|
|
302
|
+
|
|
303
|
+
Reinstalling the plugin does not import Shepherdr tasks, undo its configuration or
|
|
304
|
+
network changes, or restore the state of ongoing agents. Keep the 2.x store and
|
|
305
|
+
backups; do not delete them to make the Board work. Avoid an unpinned plugin update:
|
|
306
|
+
it can replace 1.x with Shepherdr 2 again.
|
package/docs/home.md
CHANGED
|
@@ -48,5 +48,14 @@
|
|
|
48
48
|
first online machine), or the empty view. All always keeps the current conversation. Phones keep
|
|
49
49
|
the list first and check the same rule when reopening a conversation through browser history.
|
|
50
50
|
Explicit choices from search, cards or links open the chosen conversation. Unsent drafts stay saved.
|
|
51
|
+
- **Global search** (magnifier, ⌘K) finds agents, conversations and Board tasks: a task's name
|
|
52
|
+
(`WHR-12`), title or description, with its machine, project and state. Choosing a task opens it on the Board.
|
|
51
53
|
- **Named Herdr sessions**, **quotas** (remaining Claude and Codex usage limits), **Herdr plugin
|
|
52
54
|
actions** in the menus, **passkey lock** (Face ID, Touch ID, Windows Hello, Android…).
|
|
55
|
+
|
|
56
|
+
Settings › Appearance › Home screen › **Individual agents** expands standalone
|
|
57
|
+
agent spaces into one row per pane, using their pane or tab labels. Workspace
|
|
58
|
+
cards remain the default. Board tasks and repository headers keep their existing
|
|
59
|
+
grouping, and **Show terminals** still controls plain terminal rows. The setting
|
|
60
|
+
follows you across devices. Workspace drag reordering is disabled in this view;
|
|
61
|
+
switch it off to reorder spaces.
|
package/docs/installation.md
CHANGED
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
[Documentation](README.md) · [Project](../README.md)
|
|
6
6
|
|
|
7
|
+
**Shepherdr 2.x is not supported by the Board**, even though its plugin id is still
|
|
8
|
+
`herdr-projects`. wherdr shows a compatibility message and a manual command pinned
|
|
9
|
+
to herdr-projects 1.2.21, without starting or migrating anything. Agents, terminal,
|
|
10
|
+
files and machines remain available. See [returning from Shepherdr 2](herdr-projects-1x.md#shepherdr-2)
|
|
11
|
+
for backups, reinstallation and configuration limitations. Do not use an unpinned
|
|
12
|
+
plugin update to restore Board compatibility.
|
|
13
|
+
|
|
7
14
|
## Requirements
|
|
8
15
|
|
|
9
16
|
- **Herdr ≥ 0.9.1** running on the server (`herdr` or `herdr server`), with its Claude Code /
|
|
@@ -172,3 +179,8 @@ and the app says so. Every step is logged in `~/wherdr/update.log`.
|
|
|
172
179
|
| `wherdr` command (npm) | `npm install -g wherdr@latest && wherdr restart` (npx: stop it, then `npx wherdr@latest`) |
|
|
173
180
|
| `wherdr` command (Homebrew) | `brew upgrade wherdr`, then `brew services restart wherdr` |
|
|
174
181
|
| From source | `git pull && npm ci && npm run build`, then restart wherdr |
|
|
182
|
+
|
|
183
|
+
Update notices also show the number of newer stable releases and up to four
|
|
184
|
+
additional version numbers besides the latest. This measures published releases,
|
|
185
|
+
not Git commits or whether a fork has merged develop. When GitHub returns a full
|
|
186
|
+
100-entry page, the count is labelled as a lower bound.
|
package/docs/quotas.md
CHANGED
|
@@ -60,6 +60,12 @@ week, with reset times), for every online machine.
|
|
|
60
60
|
with Claude to produce the new snapshot. The status line also requires `python3` in Claude’s
|
|
61
61
|
`PATH` at runtime.
|
|
62
62
|
|
|
63
|
+
**API billing** (API key or Anthropic Console credits): Claude Code passes no rate limits, so
|
|
64
|
+
once a session has had an API response the status line keeps its snapshot without them, and
|
|
65
|
+
the machine reads **API usage (no quota)** in Settings and *Claude · API usage, no quota* on the
|
|
66
|
+
home screen (no gauge, no setup prompt); switching back to a subscription shows the gauges
|
|
67
|
+
again after the next exchange. Status lines installed before this need **Update**.
|
|
68
|
+
|
|
63
69
|
**New machine**: run `sh scripts/install-claude-statusline.sh` on it once (or **Install** in
|
|
64
70
|
Settings › Agents › Claude quotas), then send a message to any Claude agent there; its quotas
|
|
65
71
|
appear on the home screen.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
## New
|
|
2
|
+
|
|
3
|
+
Settings › Agents groups worktrees by machine and project in collapsible sections, making larger worktree lists easier to browse.
|
|
4
|
+
|
|
5
|
+
## Improved
|
|
6
|
+
|
|
7
|
+
Projects show a lightweight header even without a coordinator. Coordinator headers display the project key on their accent square when one is known.
|
|
8
|
+
|
|
9
|
+
Notification state appears in row menus as Mute notifications or Unmute notifications, available with a right click or long press. Rows no longer show a muted bell, and card menus show the notification action only once.
|
|
10
|
+
|
|
11
|
+
The README introduction has a new WebP animation showing the current interface.
|
|
12
|
+
|
|
13
|
+
## Fixed
|
|
14
|
+
|
|
15
|
+
When creating an agent, the name you type now labels the new space or the pane in an existing space, including spaces in the name. Thanks to [@SunnySydeUp](https://github.com/SunnySydeUp) for the contribution.
|
|
16
|
+
|
|
17
|
+
npm publication starts only after the GitHub release and its package are public, preventing the previous "release not found" race. The TaskSheet model and effort test now waits for menu focus to return before opening the next menu, preventing timing-dependent CI failures.
|
|
18
|
+
|
|
19
|
+
## Update
|
|
20
|
+
|
|
21
|
+
This release adds features to 2.2.0 and therefore uses version 2.3.0 rather than 2.2.1. No migration is required from 2.2.0; existing tasks and settings are kept. Node.js 22 or newer and Herdr 0.9.1 or newer are still required. Users upgrading from 1.x should follow the [2.0 migration guide](https://github.com/afloury/wherdr/blob/v2.3.0/docs/herdr-projects-1x.md).
|
|
22
|
+
|
|
23
|
+
[Full changelog](https://github.com/afloury/wherdr/blob/v2.3.0/CHANGELOG.md)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
## New
|
|
2
|
+
|
|
3
|
+
**Protection for users who upgraded to Shepherdr 2.** wherdr recognizes Shepherdr 2.x and displays **Shepherdr 2 detected: wherdr’s Board does not support it**, instead of saying the plugin is too old. It refuses to install or update herdr-projects over Shepherdr 2. Agents, terminal, files and machines remain available; wherdr does not start Shepherdr or migrate its data automatically.
|
|
4
|
+
|
|
5
|
+
To return manually to the supported herdr-projects 1.2.21, first finish or stop ongoing work, stop Shepherdr using its own controls, and back up both data stores, worktrees and Herdr configuration, including Shepherdr's takeover backup. On the affected machine, run:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
herdr plugin uninstall herdr-projects && herdr plugin install eliasstravik/herdr-projects --ref v1.2.21 --yes
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Follow the [Shepherdr 2 return checklist](https://github.com/afloury/wherdr/blob/v2.4.0/docs/herdr-projects-1x.md#shepherdr-2) to check and restore the required configuration entries before reloading Herdr and refreshing wherdr. Reinstalling does not import Shepherdr tasks, undo its configuration or network changes, or restore ongoing agents. Keep the 2.x store and backups, and avoid an unpinned plugin update that could install Shepherdr 2 again.
|
|
12
|
+
|
|
13
|
+
Global search (⌘K) now finds Board tasks by key, title or description and opens the selected task on the Board. Terminal Ctrl, Alt and Shift can be armed for the next key, and an optional individual-agent list shows standalone agents as separate rows. Thanks to [@followcat](https://github.com/followcat) for the modifier controls and individual-agent list.
|
|
14
|
+
|
|
15
|
+
## Improved
|
|
16
|
+
|
|
17
|
+
Swipe between machine and group tabs on Home. Task panels combine conversation and terminal in one Agent tab, queued Claude messages can be sent immediately, and chat commands run in a verified wherdr-managed split terminal.
|
|
18
|
+
|
|
19
|
+
A device-local beta setting enables smooth terminal touch scrolling, while the existing behavior remains the default. Transcript notices can be dismissed, and update banners show how many newer stable releases are available. Thanks to [@followcat](https://github.com/followcat) for these contributions, including the original scrolling work.
|
|
20
|
+
|
|
21
|
+
Claude sessions billed through an API key or Console credits show API usage with no quota on Home and in Settings. Update the Claude status line on those machines to enable detection. A shared keyboard shortcut reference and refreshed narrated tutorials, including “wherdr in one minute”, help you find your way around.
|
|
22
|
+
|
|
23
|
+
## Fixed
|
|
24
|
+
|
|
25
|
+
Connections recover after the device wakes without competing socket probes. Starting a command just after creating a split or tab no longer falsely reports that it did not start while the new pane is being discovered.
|
|
26
|
+
|
|
27
|
+
The WebGL terminal stays sharp and correctly sized on high-density screens, and long agent state lines fit phone headers. Wrapped task titles keep their height, and Autopilot messages show their copy button only on hover.
|
|
28
|
+
|
|
29
|
+
Codex self-updates are detected with Ubuntu shell prompts, status reset information remains visible alongside footer warnings, and passive reads leave shell history alone. A folder used as a transcript path returns “no conversation”. omp 18.14 tool approval cards are recognized again, including grants and expanded details, while older dialogs remain supported.
|
|
30
|
+
|
|
31
|
+
Settings navigation tests wait for phone history transitions before teardown. Tutorial fonts are pinned and checksum-verified, CI actions use Node 24 runtimes on Ubuntu 24.04, and contributors share one interface design reference.
|
|
32
|
+
|
|
33
|
+
## Update
|
|
34
|
+
|
|
35
|
+
No migration is required from 2.3.0; existing tasks and settings are kept. Node.js 22 or newer and Herdr 0.9.1 or newer are still required. The Board supports herdr-projects 1.2.x, not Shepherdr 2.x; use the checklist above if you already upgraded that plugin. Users upgrading wherdr from 1.x should follow the [2.0 migration guide](https://github.com/afloury/wherdr/blob/v2.4.0/docs/herdr-projects-1x.md).
|
|
36
|
+
|
|
37
|
+
[Full changelog](https://github.com/afloury/wherdr/blob/v2.4.0/CHANGELOG.md)
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ot as e,P as t,gr as n,j as r}from"./C25ROUa9.js";import{t as i}from"./BDNMzG2s.js";import{lt as a}from"#entry";var o={class:`antialiased bg-white dark:bg-[#020420] dark:text-white font-sans grid min-h-screen overflow-hidden place-content-center text-[#020420] tracking-wide`},s={class:`max-w-520px text-center`},c=[`textContent`],l=[`textContent`],u=[`textContent`],d=i({__name:`error-500`,props:{appName:{type:String,default:`Nuxt`},status:{type:Number,default:500},statusText:{type:String,default:`Internal server error`},description:{type:String,default:`This page is temporarily unavailable.`},refresh:{type:String,default:`Refresh this page`}},setup(i){let d=i;return a({title:`${d.status} - ${d.statusText} | ${d.appName}`,script:[{innerHTML:`!function(){let e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(let e of document.querySelectorAll('link[rel="modulepreload"]'))r(e);new MutationObserver(e=>{for(let t of e)if("childList"===t.type)for(let e of t.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&r(e)}).observe(document,{childList:!0,subtree:!0})}function r(e){if(e.ep)return;e.ep=!0;let r=function(e){let r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),r.credentials="use-credentials"===e.crossOrigin?"include":"anonymous"===e.crossOrigin?"omit":"same-origin",r}(e);fetch(e.href,r)}}();`}],style:[{innerHTML:`*,:after,:before{box-sizing:border-box;border-style:solid;border-width:0;border-color:var(--un-default-border-color,#e5e7eb)}:after,:before{--un-content:""}html{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{line-height:inherit;margin:0}h1,h2{font-size:inherit;font-weight:inherit}h1,h2,p{margin:0}*,:after,:before{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 #0000;--un-ring-shadow:0 0 #0000;--un-shadow-inset: ;--un-shadow:0 0 #0000;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:#93c5fd80;--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }`}]}),(a,d)=>(e(),t(`div`,o,[r(`div`,s,[r(`h1`,{class:`font-semibold leading-none mb-4 sm:text-[110px] tabular-nums text-[80px]`,textContent:n(i.status)},null,8,c),r(`h2`,{class:`font-semibold mb-2 sm:text-3xl text-2xl`,textContent:n(i.statusText)},null,8,l),r(`p`,{class:`mb-4 px-2 text-[#64748B] text-md`,textContent:n(i.description)},null,8,u)])]))}},[[`__scopeId`,`data-v-f91406c7`]]);export{d as default};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import{A as e,Et as t,Ft as n,Hn as r,M as i,Mn as a,Ot as o,P as s,St as c,U as l,V as u,fr as d,ht as f,nn as p,sn as ee,vt as te}from"./C25ROUa9.js";import{B as m,N as h,U as ne,V as re,Y as g,pn as _,q as ie,z as ae}from"./CvGCN0_f.js";import{An as oe,C as v,Cn as y,Dn as se,Jt as ce,On as le,Sn as ue,Tn as de,Tt as fe,i as pe,ii as b,kn as me,qt as he,ri as ge,t as _e,xn as ve,xt as x}from"./DoX0nZZb.js";var ye=l({__name:`RovingFocusItem`,props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(a){let s=a,l=h(),d=g(),te=e(()=>s.tabStopId||d),_=e(()=>l.currentTabStopId.value===te.value),{getItems:oe,CollectionItem:v}=ne();c(()=>{s.focusable&&l.onFocusableItemAdd()}),t(()=>{s.focusable&&l.onFocusableItemRemove()}),p(()=>s.focusable,(e,t)=>{e!==t&&(e?l.onFocusableItemAdd():l.onFocusableItemRemove())});function y(e){if(e.key===`Tab`&&e.shiftKey){l.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=m(e,l.orientation.value,l.dir.value);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!s.allowShiftKey&&e.shiftKey)return;e.preventDefault();let n=[...oe().map(e=>e.ref).filter(e=>e.dataset.disabled!==``)];if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=l.loop.value?re(n,r+1):n.slice(r+1)}f(()=>ae(n))}}return(e,t)=>(o(),i(r(v),null,{default:ee(()=>[u(r(ie),{tabindex:_.value?0:-1,"data-orientation":r(l).orientation.value,"data-active":e.active?``:void 0,"data-disabled":e.focusable?void 0:``,as:e.as,"as-child":e.asChild,onMousedown:t[0]||=t=>{e.focusable?r(l).onItemFocus(te.value):t.preventDefault()},onFocus:t[1]||=e=>r(l).onItemFocus(te.value),onKeydown:y},{default:ee(()=>[n(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`data-active`,`data-disabled`,`as`,`as-child`])]),_:3}))}}),be=[`innerHTML`],xe=Object.assign(l({__name:`ChatMarkdown`,props:{html:{},typing:{},speed:{default:void 0},cipher:{type:Boolean,default:void 0}},emits:[`done`],setup(e,{emit:t}){let n=e,r=t,i=a(null),l=null,u=0,f=e=>e.classList?.contains(`code-head`),ee=e=>/^T[DH]$/.test(e.tagName||``),m=[],h=``,ne=0;function re(){for(let e of m)e.box.remove();m=[],h=``}function g(e,t,n,r){let i=`${t}:${n}`;if(i!==h){re(),h=i;for(let r of ue(e,t,n)){let e=r.node;if(!e.parentNode)continue;let t=document.createElement(`span`);t.className=`tw-trail`,t.setAttribute(`aria-hidden`,`true`);let n=[],i=le(r.text);Array.from(r.text).forEach((e,r)=>{if(/\s/.test(e))return t.append(e);let a=document.createElement(`span`);a.textContent=e,a.setAttribute(`data-g`,i[r]),n.push(a),t.append(a)}),e.parentNode.insertBefore(t,e.nextSibling),m.push({box:t,cells:n})}m.at(-1)?.cells.at(-1)?.classList.add(`tw-front`),ne=r}else if(r-ne>=60){ne=r;for(let e of m){let t=le(e.cells.map(e=>e.textContent||``).join(``));e.cells.forEach((e,n)=>e.setAttribute(`data-g`,t[n]))}}}function _(){cancelAnimationFrame(u),u=0,re(),l&&y(l),l=null}function ie(e){if(_(),!i.value)return;l=de(i.value,{atomic:f,keep:ee});let t=l,a=n.speed??fe.value,o=me(t.total,a),s=n.cipher??v.value,c=()=>{if(l!==t)return;let n=Date.now()-e,i=s?oe(t.total,n,a):null,d=i?.written??se(t.stops,n,o),f=i?.decrypted??d;ve(t,f,s,d),s&&g(t,f,d,performance.now()),i?.done||!s&&n>=o?(_(),r(`done`)):u=requestAnimationFrame(c)};c()}function ae(){l&&(_(),r(`done`))}return c(()=>{n.typing!==null&&ie(n.typing)}),p(()=>n.typing,e=>{e===null?_():ie(e)}),p(()=>n.html,()=>{l&&(cancelAnimationFrame(u),re(),l=null,r(`done`))},{flush:`pre`}),te(()=>{cancelAnimationFrame(u),re(),l=null}),(t,n)=>(o(),s(`div`,{ref_key:`el`,ref:i,class:d([`md-body`,{typing:e.typing!==null}]),onClickCapture:ae,innerHTML:e.html},null,42,be))}}),{__name:`ChatMarkdown`});function Se(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ce=Se();function we(e){Ce=e}var Te={exec:()=>null};function S(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(C.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var C={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`)},w=/^(?:[ \t]*(?:\n|$))+/,Ee=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,T=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,De=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,E=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,D=/(?:[*+-]|\d{1,9}[.)])/,Oe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,O=S(Oe).replace(/bull/g,D).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),ke=S(Oe).replace(/bull/g,D).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ae=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,je=/^[^\n]+/,Me=/(?!\s*\])(?:\\.|[^\[\]\\])+/,k=S(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Me).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ne=S(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,D).getRegex(),A=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,Pe=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Fe=S(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,Pe).replace(`tag`,A).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ie=S(Ae).replace(`hr`,De).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,A).getRegex(),Le={blockquote:S(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Ie).getRegex(),code:Ee,def:k,fences:T,heading:E,hr:De,html:Fe,lheading:O,list:Ne,newline:w,paragraph:Ie,table:Te,text:je},Re=S(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,De).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,A).getRegex(),ze={...Le,lheading:ke,table:Re,paragraph:S(Ae).replace(`hr`,De).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Re).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,A).getRegex()},Be={...Le,html:S(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Pe).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Te,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:S(Ae).replace(`hr`,De).replace(`heading`,` *#{1,6} *[^
|
|
2
|
-
]`).replace(`lheading`,O).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Ve=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,He=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ue=/^( {2,}|\\)\n(?!\s*$)/,We=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ge=/[\p{P}\p{S}]/u,j=/[\s\p{P}\p{S}]/u,Ke=/[^\s\p{P}\p{S}]/u,qe=S(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,j).getRegex(),Je=/(?!~)[\p{P}\p{S}]/u,Ye=/(?!~)[\s\p{P}\p{S}]/u,Xe=/(?:[^\s\p{P}\p{S}]|~)/u,Ze=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Qe=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,$e=S(Qe,`u`).replace(/punct/g,Ge).getRegex(),M=S(Qe,`u`).replace(/punct/g,Je).getRegex(),et=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,tt=S(et,`gu`).replace(/notPunctSpace/g,Ke).replace(/punctSpace/g,j).replace(/punct/g,Ge).getRegex(),nt=S(et,`gu`).replace(/notPunctSpace/g,Xe).replace(/punctSpace/g,Ye).replace(/punct/g,Je).getRegex(),rt=S(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,Ke).replace(/punctSpace/g,j).replace(/punct/g,Ge).getRegex(),it=S(/\\(punct)/,`gu`).replace(/punct/g,Ge).getRegex(),at=S(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ot=S(Pe).replace(`(?:-->|$)`,`-->`).getRegex(),st=S(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,ot).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ct=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,lt=S(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace(`label`,ct).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ut=S(/^!?\[(label)\]\[(ref)\]/).replace(`label`,ct).replace(`ref`,Me).getRegex(),N=S(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Me).getRegex(),P={_backpedal:Te,anyPunctuation:it,autolink:at,blockSkip:Ze,br:Ue,code:He,del:Te,emStrongLDelim:$e,emStrongRDelimAst:tt,emStrongRDelimUnd:rt,escape:Ve,link:lt,nolink:N,punctuation:qe,reflink:ut,reflinkSearch:S(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,ut).replace(`nolink`,N).getRegex(),tag:st,text:We,url:Te},dt={...P,link:S(/^!?\[(label)\]\((.*?)\)/).replace(`label`,ct).getRegex(),reflink:S(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,ct).getRegex()},ft={...P,emStrongRDelimAst:nt,emStrongLDelim:M,url:S(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,`i`).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},pt={...ft,br:S(Ue).replace(`{2,}`,`*`).getRegex(),text:S(ft.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},mt={normal:Le,gfm:ze,pedantic:Be},ht={normal:P,gfm:ft,breaks:pt,pedantic:dt},gt={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},_t=e=>gt[e];function F(e,t){if(t){if(C.escapeTest.test(e))return e.replace(C.escapeReplace,_t)}else if(C.escapeTestNoEncode.test(e))return e.replace(C.escapeReplaceNoEncode,_t);return e}function vt(e){try{e=encodeURI(e).replace(C.percentDecode,`%`)}catch{return null}return e}function I(e,t){let n=e.replace(C.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(C.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(C.slashPipe,`|`);return n}function yt(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function bt(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function L(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function xt(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
3
|
-
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
4
|
-
`)}var St=class{options;rules;lexer;constructor(e){this.options=e||Ce}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:yt(e,`
|
|
5
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=xt(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=yt(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:yt(t[0],`
|
|
6
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=yt(t[0],`
|
|
7
|
-
`).split(`
|
|
8
|
-
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
9
|
-
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
11
|
-
${s}`:s,r=r?`${r}
|
|
12
|
-
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
|
|
13
|
-
`+e.join(`
|
|
14
|
-
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
|
15
|
-
`+e.join(`
|
|
16
|
-
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
17
|
-
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
|
|
18
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,e=>` `.repeat(3*e.length)),l=e.split(`
|
|
19
|
-
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
20
|
-
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d);for(;e;){let f=e.split(`
|
|
21
|
-
`,1)[0],p;if(l=f,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),p=l):p=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||t.test(l)||n.test(l))break;if(p.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
22
|
-
`+p.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
23
|
-
`+l}!u&&!l.trim()&&(u=!0),r+=f+`
|
|
24
|
-
`,e=e.substring(f.length+1),c=p.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0));let f=null,p;this.options.gfm&&(f=this.rules.other.listIsTask.exec(s),f&&(p=f[0]!==`[ ] `,s=s.replace(this.rules.other.listReplaceTask,``))),i.items.push({type:`list_item`,raw:r,task:!!f,checked:p,loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=I(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
25
|
-
`):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(I(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
26
|
-
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=yt(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=bt(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),L(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return L(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&!(r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:`del`,raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},R=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ce,this.options.tokenizer=this.options.tokenizer||new St,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:C,block:mt.normal,inline:ht.normal};this.options.pedantic?(t.block=mt.pedantic,t.inline=ht.pedantic):this.options.gfm&&(t.block=mt.gfm,t.inline=this.options.breaks?ht.breaks:ht.gfm),this.tokenizer.rules=t}static get rules(){return{block:mt,inline:ht}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(C.carriageReturn,`
|
|
27
|
-
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(C.tabCharGlobal,` `).replace(C.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
|
|
28
|
-
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=`
|
|
29
|
-
`+r.raw,n.text+=`
|
|
30
|
-
`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=`
|
|
31
|
-
`+r.raw,n.text+=`
|
|
32
|
-
`+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=`
|
|
33
|
-
`+r.raw,a.text+=`
|
|
34
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=`
|
|
35
|
-
`+r.raw,n.text+=`
|
|
36
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a=``;for(;e;){i||(a=``),i=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,a)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let o=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(o)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(a=r.raw.slice(-1)),i=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},Ct=class{options;parser;constructor(e){this.options=e||Ce}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(C.notSpaceStart)?.[0],i=e.replace(C.endingNewline,``)+`
|
|
37
|
-
`;return r?`<pre><code class="language-`+F(r)+`">`+(n?i:F(i,!0))+`</code></pre>
|
|
38
|
-
`:`<pre><code>`+(n?i:F(i,!0))+`</code></pre>
|
|
39
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
40
|
-
${this.parser.parse(e)}</blockquote>
|
|
41
|
-
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
42
|
-
`}hr(e){return`<hr>
|
|
43
|
-
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
44
|
-
`+r+`</`+i+`>
|
|
45
|
-
`}listitem(e){let t=``;if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type===`paragraph`?(e.tokens[0].text=n+` `+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type===`text`&&(e.tokens[0].tokens[0].text=n+` `+F(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:`text`,raw:n+` `,text:n+` `,escaped:!0}):t+=n+` `}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
|
46
|
-
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox">`}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
47
|
-
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
48
|
-
<thead>
|
|
49
|
-
`+t+`</thead>
|
|
50
|
-
`+r+`</table>
|
|
51
|
-
`}tablerow({text:e}){return`<tr>
|
|
52
|
-
${e}</tr>
|
|
53
|
-
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
54
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${F(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=vt(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+F(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=vt(e);if(i===null)return F(n);e=i;let a=`<img src="${e}" alt="${n}"`;return t&&(a+=` title="${F(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:F(e.text)}},wt=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}},z=class e{options;renderer;textRenderer;constructor(e){this.options=e||Ce,this.options.renderer=this.options.renderer||new Ct,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new wt}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(t!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`paragraph`,`text`].includes(e.type)){n+=t||``;continue}}let a=i;switch(a.type){case`space`:n+=this.renderer.space(a);continue;case`hr`:n+=this.renderer.hr(a);continue;case`heading`:n+=this.renderer.heading(a);continue;case`code`:n+=this.renderer.code(a);continue;case`table`:n+=this.renderer.table(a);continue;case`blockquote`:n+=this.renderer.blockquote(a);continue;case`list`:n+=this.renderer.list(a);continue;case`html`:n+=this.renderer.html(a);continue;case`paragraph`:n+=this.renderer.paragraph(a);continue;case`text`:{let i=a,o=this.renderer.text(i);for(;r+1<e.length&&e[r+1].type===`text`;)i=e[++r],o+=`
|
|
55
|
-
`+this.renderer.text(i);n+=t?this.renderer.paragraph({type:`paragraph`,raw:o,text:o,tokens:[{type:`text`,raw:o,text:o,escaped:!0}]}):o;continue}default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}parseInline(e,t=this.renderer){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Tt=class{options;block;constructor(e){this.options=e||Ce}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?R.lex:R.lexInline}provideParser(){return this.block?z.parse:z.parseInline}},B=new class{defaults=Se();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=z;Renderer=Ct;TextRenderer=wt;Lexer=R;Tokenizer=St;Hooks=Tt;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Ct(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new St(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Tt;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=Tt.passThroughHooks.has(n)?e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then(e=>a.call(t,e));let n=i.call(t,e);return a.call(t,n)}:(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return R.lex(e,t??this.defaults)}parser(e,t){return z.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(t==null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));i.hooks&&(i.hooks.options=i,i.hooks.block=e);let o=i.hooks?i.hooks.provideLexer():e?R.lex:R.lexInline,s=i.hooks?i.hooks.provideParser():e?z.parse:z.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(e=>o(e,i)).then(e=>i.hooks?i.hooks.processAllTokens(e):e).then(e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then(()=>e):e).then(e=>s(e,i)).then(e=>i.hooks?i.hooks.postprocess(e):e).catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let e=o(t,i);i.hooks&&(e=i.hooks.processAllTokens(e)),i.walkTokens&&this.walkTokens(e,i.walkTokens);let n=s(e,i);return i.hooks&&(n=i.hooks.postprocess(n)),n}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
56
|
-
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+F(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function V(e,t){return B.parse(e,t)}V.options=V.setOptions=function(e){return B.setOptions(e),V.defaults=B.defaults,we(V.defaults),V},V.getDefaults=Se,V.defaults=Ce,V.use=function(...e){return B.use(...e),V.defaults=B.defaults,we(V.defaults),V},V.walkTokens=function(e,t){return B.walkTokens(e,t)},V.parseInline=B.parseInline,V.Parser=z,V.parser=z.parse,V.Renderer=Ct,V.TextRenderer=wt,V.Lexer=R,V.lexer=R.lex,V.Tokenizer=St,V.Hooks=Tt,V.parse=V,V.options,V.setOptions,V.use,V.walkTokens,V.parseInline,z.parse,R.lex;function Et(e,t){this.v=e,this.k=t}function Dt(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function H(e){if(Array.isArray(e))return e}function Ot(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function kt(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
57
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function At(e,t){return H(e)||Ot(e,t)||jt(e,t)||kt()}function jt(e,t){if(e){if(typeof e==`string`)return Dt(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dt(e,t):void 0}}function U(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof Et;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}U.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},U.prototype.next=function(e){return this._invoke(`next`,e)},U.prototype.throw=function(e){return this._invoke(`throw`,e)},U.prototype.return=function(e){return this._invoke(`return`,e)};var Mt=Object.entries,Nt=Object.setPrototypeOf,Pt=Object.isFrozen,Ft=Object.getPrototypeOf,It=Object.getOwnPropertyDescriptor,W=Object.freeze,G=Object.seal,Lt=Object.create,Rt=typeof Reflect<`u`&&Reflect,zt=Rt.apply,Bt=Rt.construct;W||=function(e){return e},G||=function(e){return e},zt||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},Bt||=function(e){return new e(...[...arguments].slice(1))};var Vt=J(Array.prototype.forEach);Array.prototype.indexOf;var Ht=J(Array.prototype.lastIndexOf),Ut=J(Array.prototype.pop),Wt=J(Array.prototype.push);Array.prototype.slice;var Gt=J(Array.prototype.splice),Kt=Array.isArray,qt=J(String.prototype.toLowerCase),Jt=J(String.prototype.toString),Yt=J(String.prototype.match),Xt=J(String.prototype.replace),Zt=J(String.prototype.indexOf),Qt=J(String.prototype.trim),$t=J(Number.prototype.toString),en=J(Boolean.prototype.toString),tn=typeof BigInt>`u`?null:J(BigInt.prototype.toString),nn=typeof Symbol>`u`?null:J(Symbol.prototype.toString),K=J(Object.prototype.hasOwnProperty),rn=J(Object.prototype.toString),q=J(RegExp.prototype.test),an=on(TypeError);function J(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return zt(e,t,n)}}function on(e){return function(){return Bt(e,[...arguments])}}function Y(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:qt;if(Nt&&Nt(e,null),!Kt(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Pt(t)||(t[r]=e),i=e)}e[i]=!0}return e}function sn(e){for(let t=0;t<e.length;t++)K(e,t)||(e[t]=null);return e}function X(e){let t=Lt(null);for(let r of Mt(e)){var n=At(r,2);let i=n[0],a=n[1];K(e,i)&&(t[i]=Kt(a)?sn(a):a&&typeof a==`object`&&a.constructor===Object?X(a):a)}return t}function cn(e){switch(typeof e){case`string`:return e;case`number`:return $t(e);case`boolean`:return en(e);case`bigint`:return tn?tn(e):`0`;case`symbol`:return nn?nn(e):`Symbol()`;case`undefined`:return rn(e);case`function`:case`object`:{if(e===null)return rn(e);let t=e,n=Z(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:rn(e)}return rn(e)}default:return rn(e)}}function Z(e,t){for(;e!==null;){let n=It(e,t);if(n){if(n.get)return J(n.get);if(typeof n.value==`function`)return J(n.value)}e=Ft(e)}function n(){return null}return n}function ln(e){try{return q(e,``),!0}catch{return!1}}var un=W(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),dn=W(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),fn=W([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),pn=W([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),mn=W(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),hn=W([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),gn=W([`#text`]),_n=W(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),vn=W(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),yn=W(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),bn=W([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),xn=G(/{{[\w\W]*|^[\w\W]*}}/g),Sn=G(/<%[\w\W]*|^[\w\W]*%>/g),Cn=G(/\${[\w\W]*/g),wn=G(/^data-[\-\w.\u00B7-\uFFFF]+$/),Tn=G(/^aria-[\-\w]+$/),En=G(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Dn=G(/^(?:\w+script|data):/i),On=G(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),kn=G(/^html$/i),An=G(/^[a-z][.\w]*(-[.\w]+)+$/i),jn=G(/<[/\w!]/g),Mn=G(/<[/\w]/g),Nn=G(/<\/no(script|embed|frames)/i),Pn=G(/\/>/i),Q={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Fn=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],In=W(Y({},Fn)),Ln=function(){let e={};return Vt(Fn,t=>{e[t]=G(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),W(e)}(),Rn=function(){return typeof window>`u`?null:window},zn=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Bn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Vn=function(e,t,n,r){return K(e,t)&&Kt(e[t])?Y(r.base?X(r.base):{},e[t],r.transform):n},Hn=function(e,t,n){let r=K(e,t)?e[t]:void 0;return r&&typeof r==`object`?X(r):n()};function Un(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Rn(),t=e=>Un(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==Q.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Z(d,`cloneNode`),p=Z(d,`remove`),ee=Z(d,`removeAttributeNode`),te=Z(d,`nextSibling`),m=Z(d,`childNodes`),h=Z(d,`parentNode`),ne=Z(d,`shadowRoot`),re=Z(d,`attributes`),g=o&&o.prototype?Z(o.prototype,`nodeType`):null,_=o&&o.prototype?Z(o.prototype,`nodeName`):null,ie=o&&o.prototype?Z(o.prototype,`ownerDocument`):null,ae=function(e){return g?g(e):e.nodeType},oe=function(e){return _?_(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let v,y=``,se,ce=!1,le=0,ue=function(){if(le>0)throw an(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},de=function(e){ue(),le++;try{return v.createHTML(e)}finally{le--}},fe=function(e){ue(),le++;try{return v.createScriptURL(e)}finally{le--}},pe=function(){return ce||=(se=zn(u,i),!0),se},b=n,me=b.implementation,he=b.createNodeIterator,ge=b.createDocumentFragment,_e=b.getElementsByTagName,ve=r.importNode,x=Bn();t.isSupported=typeof Mt==`function`&&typeof h==`function`&&me&&me.createHTMLDocument!==void 0;let ye=xn,be=Sn,xe=Cn,Se=wn,Ce=Tn,we=Dn,Te=On,S=An,C=En,w=null,Ee=Y({},[...un,...dn,...fn,...mn,...gn]),T=null,De=Y({},[..._n,...vn,...yn,...bn]),E=Object.seal(Lt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),D=null,Oe=null,O=Object.seal(Lt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ke=!0,Ae=!0,je=!1,Me=!0,k=!1,Ne=!0,A=!1,Pe=!1,Fe=null,Ie=null,Le=!1,Re=!1,ze=!1,Be=!1,Ve=!0,He=!1,Ue=`user-content-`,We=!0,Ge=!1,j={},Ke=null,qe=Y({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Je=null,Ye=Y({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Xe=null,Ze=Y({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Qe=`http://www.w3.org/1998/Math/MathML`,$e=`http://www.w3.org/2000/svg`,M=`http://www.w3.org/1999/xhtml`,et=M,tt=!1,nt=null,rt=Y({},[Qe,$e,M],Jt),it=W([`mi`,`mo`,`mn`,`ms`,`mtext`]),at=Y({},it),ot=W([`annotation-xml`]),st=Y({},ot),ct=Y({},[`title`,`style`,`font`,`a`,`script`]),lt=null,ut=[`application/xhtml+xml`,`text/html`],N=null,P=null,dt=n.createElement(`form`),ft=function(e){return e instanceof RegExp||e instanceof Function},pt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(P&&P===e)return;(!e||typeof e!=`object`)&&(e={}),e=X(e),lt=ut.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,N=lt===`application/xhtml+xml`?Jt:qt,w=Vn(e,`ALLOWED_TAGS`,Ee,{transform:N}),T=Vn(e,`ALLOWED_ATTR`,De,{transform:N}),nt=Vn(e,`ALLOWED_NAMESPACES`,rt,{transform:Jt}),Xe=Vn(e,`ADD_URI_SAFE_ATTR`,Ze,{transform:N,base:Ze}),Je=Vn(e,`ADD_DATA_URI_TAGS`,Ye,{transform:N,base:Ye}),Ke=Vn(e,`FORBID_CONTENTS`,qe,{transform:N}),D=Vn(e,`FORBID_TAGS`,X({}),{transform:N}),Oe=Vn(e,`FORBID_ATTR`,X({}),{transform:N}),j=K(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?X(e.USE_PROFILES):e.USE_PROFILES:!1,ke=e.ALLOW_ARIA_ATTR!==!1,Ae=e.ALLOW_DATA_ATTR!==!1,je=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,k=e.SAFE_FOR_TEMPLATES||!1,Ne=e.SAFE_FOR_XML!==!1,A=e.WHOLE_DOCUMENT||!1,Re=e.RETURN_DOM||!1,ze=e.RETURN_DOM_FRAGMENT||!1,Be=e.RETURN_TRUSTED_TYPE||!1,Le=e.FORCE_BODY||!1,Ve=e.SANITIZE_DOM!==!1,He=e.SANITIZE_NAMED_PROPS||!1,We=e.KEEP_CONTENT!==!1,Ge=e.IN_PLACE||!1,C=ln(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:En,et=typeof e.NAMESPACE==`string`?e.NAMESPACE:M,at=Hn(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>Y({},it)),st=Hn(e,`HTML_INTEGRATION_POINTS`,()=>Y({},ot));let t=Hn(e,`CUSTOM_ELEMENT_HANDLING`,()=>Lt(null));if(E=Lt(null),K(t,`tagNameCheck`)&&ft(t.tagNameCheck)&&(E.tagNameCheck=t.tagNameCheck),K(t,`attributeNameCheck`)&&ft(t.attributeNameCheck)&&(E.attributeNameCheck=t.attributeNameCheck),K(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(E.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),G(E),k&&(Ae=!1),ze&&(Re=!0),j&&(w=Y({},gn),T=Lt(null),j.html===!0&&(Y(w,un),Y(T,_n)),j.svg===!0&&(Y(w,dn),Y(T,vn),Y(T,bn)),j.svgFilters===!0&&(Y(w,fn),Y(T,vn),Y(T,bn)),j.mathMl===!0&&(Y(w,mn),Y(T,yn),Y(T,bn))),O.tagCheck=null,O.attributeCheck=null,K(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?O.tagCheck=e.ADD_TAGS:Kt(e.ADD_TAGS)&&(w===Ee&&(w=X(w)),Y(w,e.ADD_TAGS,N))),K(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?O.attributeCheck=e.ADD_ATTR:Kt(e.ADD_ATTR)&&(T===De&&(T=X(T)),Y(T,e.ADD_ATTR,N))),K(e,`ADD_FORBID_CONTENTS`)&&Kt(e.ADD_FORBID_CONTENTS)&&(Ke===qe&&(Ke=X(Ke)),Y(Ke,e.ADD_FORBID_CONTENTS,N)),We&&(w[`#text`]=!0),A&&Y(w,[`html`,`head`,`body`]),w.table&&(Y(w,[`tbody`]),delete D.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw an(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw an(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=v;v=e.TRUSTED_TYPES_POLICY;try{y=de(``)}catch(e){throw v=t,e}}else e.TRUSTED_TYPES_POLICY===null?(v=void 0,y=``):(v===void 0&&(v=pe()),v&&typeof y==`string`&&(y=de(``)));W&&W(e),P=e},mt=Y({},[...dn,...fn,...pn]),ht=Y({},[...mn,...hn]),gt=function(e,t,n){return t.namespaceURI===M?e===`svg`:t.namespaceURI===Qe?e===`svg`&&(n===`annotation-xml`||at[n]):!!mt[e]},_t=function(e,t,n){return t.namespaceURI===M?e===`math`:t.namespaceURI===$e?e===`math`&&st[n]:!!ht[e]},F=function(e,t,n){return t.namespaceURI===$e&&!st[n]||t.namespaceURI===Qe&&!at[n]?!1:!ht[e]&&(ct[e]||!mt[e])},vt=function(e){let t=h(e);(!t||!t.tagName)&&(t={namespaceURI:et,tagName:`template`});let n=qt(e.tagName),r=qt(t.tagName);return nt[e.namespaceURI]?e.namespaceURI===$e?gt(n,t,r):e.namespaceURI===Qe?_t(n,t,r):e.namespaceURI===M?F(n,t,r):!!(lt===`application/xhtml+xml`&&nt[e.namespaceURI]):!1},I=function(e){Wt(t.removed,{element:e});try{h(e).removeChild(e)}catch{if(p(e),!h(e))throw an(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},yt=function(e,t,n){try{ee(e,t)}catch{try{e.removeAttribute(n)}catch{}}},bt=function(e){St(e);let t=m(e);if(t){let e=[];Vt(t,t=>{Wt(e,t)}),Vt(e,e=>{try{p(e)}catch{}})}let n=re(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&yt(e,r,i)}},L=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}Wt(t.removed,{attribute:r||null,from:n});try{r?ee(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Re||ze)try{I(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},xt=function(e){let t=re(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||T[N(i)]||yt(e,r,i)}},St=function(e){let t=[e];for(;t.length>0;){let e=t.pop();ae(e)===Q.element&&xt(e);let n=m(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},R=function(e,t){return Ne?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Ct=function(e){if(!Ne)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=ae(e);if(n===Q.processingInstruction||n===Q.comment&&q(Mn,e.data)){try{p(e)}catch{}continue}if(n===Q.element){let t=e,n=N(oe(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&R(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=m(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},wt=function(e){let t=null,r=null;if(Le)e=`<remove></remove>`+e;else{let t=Yt(e,/^[\r\n\t ]+/);r=t&&t[0]}lt===`application/xhtml+xml`&&et===M&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=v?de(e):e;if(et===M)try{t=new l().parseFromString(i,lt)}catch{}if(!t||!t.documentElement){t=me.createDocument(et,`template`,null);try{t.documentElement.innerHTML=tt?y:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),et===M?_e.call(t,A?`html`:`body`)[0]:A?t.documentElement:a},z=function(e){let t=ie?ie(e):e.ownerDocument;return he.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Tt=function(e){return e=Xt(e,ye,` `),e=Xt(e,be,` `),e=Xt(e,xe,` `),e},B=function(e){e.normalize();let t=ie?ie(e):e.ownerDocument,n=he.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Tt(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&Vt(i,e=>{Et(e.content)&&B(e.content)})},V=function(e){let t=_?_(e):null;return typeof t!=`string`||N(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==re(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==g(e)||e.childNodes!==m(e)},Et=function(e){if(!g||typeof e!=`object`||!e)return!1;try{return g(e)===Q.documentFragment}catch{return!1}},Dt=function(e){if(!g||typeof e!=`object`||!e)return!1;try{return typeof g(e)==`number`}catch{return!1}};function H(e,n,r){e.length!==0&&Vt(e,e=>{e.call(t,n,r,P)})}let Ot=function(e,t){return!!(Ne&&e.hasChildNodes()&&!Dt(e.firstElementChild)&&q(jn,e.textContent)&&q(jn,e.innerHTML)||Ne&&e.namespaceURI===M&&In[t]&&(Dt(e.firstElementChild)||typeof e.textContent==`string`&&q(Ln[t],e.textContent))||e.nodeType===Q.processingInstruction||Ne&&e.nodeType===Q.comment&&q(Mn,e.data))},kt=function(e,t){return e instanceof RegExp?q(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},At=function(e,t,n){if(!D[t]&&It(t)&&kt(E.tagNameCheck,t))return!1;if(We&&!Ke[t]){let t=h(e),r=m(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,te(e))}}}return I(e),!0},jt=function(e,t,n,r){return e.length===0?t:t===n||t===r?X(t):t},U=function(e,t){return e===t||h(e)!==null?!1:(Ge&&St(e),!0)},Nt=function(e,n){if(H(x.beforeSanitizeElements,e,null),U(e,n))return!0;if(V(e))return I(e),!0;let r=N(oe(e));if(w=jt(x.uponSanitizeElement,w,Ee,Fe),H(x.uponSanitizeElement,e,{tagName:r,allowedTags:w}),U(e,n))return!0;if(Ot(e,r))return I(e),!0;if(D[r]||!(O.tagCheck instanceof Function&&O.tagCheck(r))&&!w[r]){let t=At(e,r,n);return t===!1&&(H(x.afterSanitizeElements,e,null),U(e,n))?!0:t}if(ae(e)===Q.element&&!vt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&q(Nn,e.innerHTML))return I(e),!0;if(k&&e.nodeType===Q.text){let n=Tt(e.textContent);e.textContent!==n&&(Wt(t.removed,{element:e.cloneNode()}),e.textContent=n)}return H(x.afterSanitizeElements,e,null),U(e,n)},Pt=function(e,t,r){if(Oe[t]||R(t,e)||Ve&&(t===`id`||t===`name`)&&(r in n||r in dt))return!1;let i=T[t]||O.attributeCheck instanceof Function&&O.attributeCheck(t,e);return Ae&&q(Se,t)||ke&&q(Ce,t)?!0:i?Xe[t]||q(C,Xt(r,Te,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Zt(r,`data:`)===0&&Je[e]||je&&!q(we,Xt(r,Te,``))?!0:!r:It(e)&&kt(E.tagNameCheck,e)&&kt(E.attributeNameCheck,t,e)||t===`is`&&E.allowCustomizedBuiltInElements&&kt(E.tagNameCheck,r)},Ft=Y({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),It=function(e){return!Ft[qt(e)]&&q(S,e)},Rt=function(e,t,n,r){if(v&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return de(r);case`TrustedScriptURL`:return fe(r)}return r},zt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!V(e)||(I(e),!1)}catch{return L(t,e),!1}},Bt=function(e,n){if(H(x.beforeSanitizeAttributes,e,null),U(e,n))return;let r=e.attributes;if(!r||V(e))return;T=jt(x.uponSanitizeAttribute,T,De,Ie);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:T,forceKeepAttr:void 0},a=r.length,o=N(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=N(s),d=l,f=s===`value`?d:Qt(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,H(x.uponSanitizeAttribute,e,i),f=i.attrValue,He&&(u===`id`||u===`name`)&&Zt(f,Ue)!==0&&(L(s,e,n),f=Ue+f,p=!0),Ne&&q(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){L(s,e,n);continue}if(u===`attributename`&&Yt(f,`href`)){L(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){L(s,e,n);continue}if(!Me&&q(Pn,f)){L(s,e,n);continue}if(k&&(f=Tt(f)),!Pt(o,u,f)){L(s,e,n);continue}f=Rt(o,u,c,f),f!==d&&zt(e,s,c,f)&&p&&Ut(t.removed)}}H(x.afterSanitizeAttributes,e,null),U(e,n)},$t=function(e){let t=null,n=z(e);for(H(x.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(H(x.uponSanitizeShadowNode,t,null),Nt(t,e),Bt(t,e),Et(t.content)&&$t(t.content),ae(t)===Q.element){let e=ne(t);Et(e)&&(en(e),$t(e))}H(x.afterSanitizeShadowDOM,e,null)},en=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){$t(e.shadow);continue}let n=e.node,r=ae(n)===Q.element,i=m(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=_?_(n):null;if(typeof e==`string`&&N(e)===`template`){let e=n.content;Et(e)&&t.push({node:e,shadow:null})}}if(r){let e=ne(n);Et(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(tt=!e,tt&&(e=`<!-->`),typeof e!=`string`&&!Dt(e)&&(e=cn(e),typeof e!=`string`))throw an(`dirty is not a string, aborting`);if(!t.isSupported)return e;Pe?(w=Fe,T=Ie):pt(n),(x.uponSanitizeElement.length>0||x.uponSanitizeAttribute.length>0)&&(w=X(w)),x.uponSanitizeAttribute.length>0&&(T=X(T)),t.removed=[];let c=Ge&&typeof e!=`string`&&Dt(e);if(c){Ct(e);let t=oe(e);if(typeof t==`string`){let n=N(t);if(!w[n]||D[n])throw bt(e),an(`root node is forbidden and cannot be sanitized in-place`)}if(V(e))throw bt(e),an(`root node is clobbered and cannot be sanitized in-place`);try{en(e)}catch(t){throw bt(e),t}}else if(Dt(e))i=wt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===Q.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),en(i);else{if(!Re&&!k&&!A&&e.indexOf(`<`)===-1)return v&&Be?de(e):e;if(i=wt(e),!i)return Re?null:Be?y:``}i&&Le&&I(i.firstChild);let l=c?e:i;try{let e=z(l);for(;o=e.nextNode();)Nt(o,l),Bt(o,l),Et(o.content)&&$t(o.content)}catch(n){throw c&&(bt(e),Vt(t.removed,e=>{e.element&&St(e.element)})),n}if(c){let n=!1;if(Vt(t.removed,t=>{t.element&&(t.element===e&&(n=!0),St(t.element))}),n)throw an(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return k&&B(e),e}if(Re){if(k&&B(i),ze)for(s=ge.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(T.shadowroot||T.shadowrootmode)&&(s=ve.call(r,s,!0)),s}let u=A?i.outerHTML:i.innerHTML;return A&&w[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&q(kn,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
58
|
-
`+u),k&&(u=Tt(u)),v&&Be?de(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};pt(e),Pe=!0,Fe=w,Ie=T},t.clearConfig=function(){P=null,Pe=!1,Fe=null,Ie=null,v=se,y=``},t.isValidAttribute=function(e,t,n){P||pt({});let r=N(e),i=N(t);return Pt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&K(x,e)&&Wt(x[e],t)},t.removeHook=function(e,t){if(K(x,e)){if(t!==void 0){let n=Ht(x[e],t);return n===-1?void 0:Gt(x[e],n,1)[0]}return Ut(x[e])}},t.removeHooks=function(e){K(x,e)&&(x[e]=[])},t.removeAllHooks=function(){x=Bn()},t}var Wn=Un(),Gn=new Set(`ts.tsx.js.jsx.mjs.cjs.vue.svelte.json.jsonl.md.mdx.txt.html.htm.css.scss.less.py.rb.rs.go.java.kt.swift.c.h.cpp.hpp.cs.php.sh.bash.zsh.fish.yml.yaml.toml.ini.conf.cfg.lock.xml.svg.csv.tsv.sql.pdf.png.jpg.jpeg.gif.webp.mp4.m4v.mov.webm.zip.gz.tgz.docx.xlsx.pptx.ipynb.dockerfile.patch.diff`.split(`.`)),Kn=new Set([`Dockerfile`,`Makefile`,`LICENSE`,`Gemfile`,`Procfile`,`Justfile`,`.env`,`.gitignore`]),qn=/[\0\n\r\t`"<>|*?$;&{}[\]()\\]|:\/\//,Jn=/:\d+(?::\d+)?$/,Yn=/^[\w@+~.,=%#-]+$/,Xn=e=>e.replace(Jn,``);function Zn(e){let t=String(e||``).trim();if(t.length<2||t.length>1024||qn.test(t))return null;let n=Xn(t);if(n.length<2||n.startsWith(`-`))return null;let r=n.startsWith(`/`)||n.startsWith(`~/`);if(/\s/.test(n)&&!r||/\s{2,}|^\S+\s+-/.test(n))return null;let i=n.replace(/^~\//,``).replace(/^\/+/,``).split(`/`),a=i.filter((e,t)=>e!==``||t!==i.length-1);if(!a.length||a.some(e=>e===``||!Yn.test(e.replace(/ /g,`_`))))return null;if(r)return n.startsWith(`/`)&&a.length===1&&!/\.\w+$/.test(a[0])?null:n;if(n.startsWith(`./`)||n.startsWith(`../`))return n;let o=a[a.length-1],s=/\.([A-Za-z0-9]{1,10})$/.exec(o)?.[1]?.toLowerCase(),c=Kn.has(o)||!!(s&&Gn.has(s));return a.length===1?c&&!/^\d/.test(o)?n:null:(c||n.endsWith(`/`)||a.length>=3)&&a.every(e=>/[A-Za-z_]/.test(e))?n:null}var Qn=new Set(`git.gh.npm.npx.pnpm.yarn.bun.node.deno.python.python3.pip.uv.cargo.go.make.docker.kubectl.cd.ls.cat.grep.rg.find.sed.awk.curl.wget.ssh.scp.rsync.tar.chmod.chown.mkdir.rm.mv.cp.echo.export.sudo.brew.apt.apk.systemctl.journalctl.flock.tmux.herdr.claude.codex.omp.vitest.jest.tsc.eslint.prettier.nuxt.vite.swift.xcodebuild.open.kill.ps.top.du.df.free.uptime.touch.head.tail.jq.env.source.bash.sh.zsh`.split(`.`)),$n=`ctrl|control|cmd|command|alt|option|opt|shift|meta|super|fn`,er=RegExp(`^(?:${$n})(?:[+-](?:${$n}|esc|escape|enter|return|tab|space|backspace|delete|del|home|end|pgup|pgdn|up|down|left|right|f\\d{1,2}|.))+$|^[⌘⌃⌥⇧]+\\S{0,2}$|^[↵⏎⇥⌫⎋↑↓←→]$`,`i`),tr=/^(?:Esc|Escape|Enter|Return|Tab|Space|Backspace|Delete|Home|End|PgUp|PgDn|F\d{1,2}|ESC|ENTER|TAB)$/,nr=`ms|µs|ns|s|sec|min|h|d|%|x|×|k|m|kb|ko|mb|mo|gb|go|tb|b|px|em|rem|lines|tests|files`,rr=RegExp(`^[~≈<>+−-]?\\d[\\d_.,]*\\s?(?:${nr})?(?:\\s\\d[\\d.,]*\\s?(?:${nr}))*$`,`i`);function ir(e){let t=String(e||``).trim();if(!t||t.length>400)return null;if(/^(?:exit|code|status)\s+0$|^(?:ok|pass(?:ed)?|✓)$/i.test(t))return`ok`;if(/^(?:exit|code|status)\s+[1-9]\d*$|^(?:fail(?:ed)?|error|✗)$/i.test(t)||/^(?:E[A-Z]{3,}|SIG[A-Z]+)$/.test(t))return`err`;if(er.test(t)||tr.test(t))return`key`;if(/^t-\d{3,}$|^[A-Z][A-Z0-9]+-\d+$|^(?=[0-9a-f]*[a-f])(?=[0-9a-f]*\d)[0-9a-f]{7,40}$/.test(t))return`id`;if(rr.test(t))return`num`;if(Zn(t))return`path`;if(/^[$!❯]\s|^\/[a-z][\w-]*(?:\s|$)/.test(t))return`cmd`;let n=t.split(/\s+/)[0];return Qn.has(n)&&/\s/.test(t)||/\s--?[a-z]/.test(t)&&/^[a-z][\w.-]*\s/.test(t)?`cmd`:null}var ar={c:{comment:String.raw`\/\/[^\n]*|\/\*[\s\S]*?\*\/`,keywords:`if.else.for.while.do.return.break.continue.switch.case.default.function.const.let.var.class.extends.implements.interface.type.enum.import.export.from.as.new.this.super.try.catch.finally.throw.throws.async.await.yield.typeof.instanceof.in.of.void.static.public.private.protected.readonly.abstract.true.false.null.undefined.nil.fn.pub.struct.impl.trait.mod.use.mut.match.loop.where.self.Self.func.package.go.defer.chan.map.range.select.int.long.char.bool.boolean.float.double.string.auto.union.namespace.using.template.override.final.val.when.guard.some.any.unknown.never.declare.keyof.satisfies`.split(`.`)},hash:{comment:String.raw`#[^\n]*`,keywords:`if.elif.else.for.while.in.not.and.or.is.return.def.class.import.from.as.with.try.except.finally.raise.pass.break.continue.lambda.yield.async.await.global.nonlocal.del.assert.True.False.None.then.fi.do.done.case.esac.function.local.export.readonly.source.echo.exit.set.unset.shift.until.begin.end.module.require.unless.nil.self.true.false.null.yes.no.on.off`.split(`.`)},sql:{comment:String.raw`--[^\n]*|\/\*[\s\S]*?\*\/`,keywords:`select.from.where.and.or.not.in.is.null.as.join.left.right.inner.outer.on.group.by.order.having.limit.offset.insert.into.values.update.set.delete.create.table.index.view.drop.alter.add.primary.key.foreign.references.unique.default.distinct.union.all.case.when.then.else.end.begin.commit.rollback.with.returning.integer.text.varchar.boolean.true.false.local.function.return.if.for.while.do.nil.repeat.until`.split(`.`),caseless:!0},markup:{comment:String.raw`<!--[\s\S]*?-->`,keywords:[],tags:!0}},or={};for(let e of`js.javascript.mjs.cjs.jsx.ts.typescript.tsx.json.jsonc.json5.java.c.h.cpp.c++.cc.hpp.cs.csharp.go.golang.rust.rs.swift.kotlin.kt.scala.dart.php.css.scss.less.groovy.zig`.split(`.`))or[e]=`c`;for(let e of`sh.bash.zsh.fish.shell.console.shellsession.py.python.python3.rb.ruby.yaml.yml.toml.ini.conf.dockerfile.docker.makefile.make.perl.pl.r.nix.elixir.ex.exs.nim.powershell.ps1.cmake.gitignore.env.dotenv`.split(`.`))or[e]=`hash`;for(let e of[`sql`,`mysql`,`postgres`,`postgresql`,`sqlite`,`plsql`,`lua`,`haskell`,`hs`,`elm`])or[e]=`sql`;for(let e of[`html`,`xml`,`svg`,`vue`,`svelte`,`xhtml`,`plist`])or[e]=`markup`;var sr=String.raw`"(?:[^"\\\n]|\\.)*"|'(?:[^'\\\n]|\\.)*'|\`(?:[^\`\\]|\\[\s\S])*\``,cr=String.raw`\b(?:0x[\da-fA-F_]+|\d[\d_]*(?:\.\d+)?(?:[eE][+-]?\d+)?)\b`,lr=String.raw`[A-Za-z_$][\w$]*`,ur=String.raw`<\/?[A-Za-z][\w:-]*|\/?>`,dr=new Map;function fr(e){let t=or[e.toLowerCase()];if(!t)return null;let n=dr.get(t);if(!n){let e=ar[t],r=[`(${e.comment})`,`(${sr})`,`(${cr})`,`(${e.tags?ur:lr})`];n={re:new RegExp(r.join(`|`),`g`),words:new Set(e.caseless?e.keywords.map(e=>e.toLowerCase()):e.keywords),caseless:!!e.caseless},dr.set(t,n)}return n}var pr=e=>e.replace(/[&<>"']/g,e=>({"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`})[e]),mr=(e,t)=>`<span class="hl-${e}">${pr(t)}</span>`;function hr(e,t){let n=e.length>65536?null:fr(t);if(!n)return pr(e);let r=``,i=0;n.re.lastIndex=0;for(let t=n.re.exec(e);t;t=n.re.exec(e)){if(!t[0]){n.re.lastIndex++;continue}r+=pr(e.slice(i,t.index)),i=t.index+t[0].length,t[1]?r+=mr(`c`,t[0]):t[2]?r+=mr(`s`,t[0]):t[3]?r+=mr(`n`,t[0]):t[0].startsWith(`<`)||t[0].endsWith(`>`)?r+=mr(`t`,t[0]):n.words.has(n.caseless?t[0].toLowerCase():t[0])?r+=mr(`k`,t[0]):r+=pr(t[0])}return r+pr(e.slice(i))}var gr={bash:!0,sh:!0,zsh:!0,shell:!0,console:!0,shellsession:!0},_r=/^\s*(?:!(?=\s*[^\s=])\s*|\$\s+|❯\s+)/;function vr(e){let t=e.some(e=>_r.test(e)),n=[],r=!1;for(let i of e){if(!t||r)n.push(i);else if(_r.test(i))n.push(i.replace(_r,``));else continue;r=t&&/\\\s*$/.test(i)}let i=n.join(`
|
|
59
|
-
`).replace(/^\s*\n|\s+$/g,``);return i.trim()?i:null}function yr(e,t){let n=String(t||``).trim().split(/\s/)[0].toLowerCase(),r=String(e||``).split(`
|
|
60
|
-
`);if(gr[n])return vr(r);if(n)return null;let i=vr(r);if(!i)return null;if(r.some(e=>_r.test(e)))return i;let a=i.replace(/\\\s*\n/g,` `).split(`
|
|
61
|
-
`).map(e=>e.trim()).filter(e=>e&&!e.startsWith(`#`));return a.length&&a.every(e=>ir(e)===`cmd`&&!e.startsWith(`/`))?i:null}function br(e){let t=String(e||``).trim();if(!t||t.includes(`
|
|
62
|
-
`))return null;let n=t.match(/^([!$❯])(\s*)(.+)$/);if(n){let e=n[3].trim();return n[2]||n[1]===`!`&&ir(e)===`cmd`&&!e.startsWith(`/`)?e:null}return ir(t)===`cmd`&&!t.startsWith(`/`)?t:null}var xr={claude:!0,codex:!0,omp:!0},Sr=e=>!!xr[e||``];function Cr(e,t){let n=t.trim();return n&&Sr(e)?`! ${n}`:null}var wr=!1,Tr=he(5e3,4e6),Er=ce(),Dr=new Set;function Or(e){Dr.add(e)}var kr={FORBID_TAGS:[`style`,`form`,`textarea`,`select`,`option`,`optgroup`,`fieldset`,`legend`,`label`,`datalist`,`output`,`dialog`],FORBID_ATTR:[`style`]},Ar=!1,jr=!1,Mr=e=>!/^[a-z][a-z\d+.-]*:/i.test(e)&&!e.startsWith(`//`)&&!e.startsWith(`#`),$=e=>e.replace(/[&<>"']/g,e=>({"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`})[e]);function Nr(e,t={}){let n=t.doc?`\0doc\0${e}`:t.plain?`\0plain\0${e}`:e,r=Tr.get(n);if(r!==void 0)return r;wr||(wr=!0,V.use({renderer:{code({text:e,lang:t}){let n=$((t||``).split(/\s/)[0]||``);if(jr)return`<div class="code-block"><div class="code-head"><span>${n||`code`}</span><span class="code-tools"><button type="button" class="code-copy">${$(ge(`Copy`))}</button></span></div><pre><code${n?` class="language-${n}"`:``}>${hr(e,n)}</code></pre></div>`;let r=yr(e,t),i=r===null?``:`<button type="button" class="code-run">${$(b(`Run`,`Lancer`))}</button>`;return`<div class="code-block"${r===null?``:` data-cmd="${$(r)}"`}><div class="code-head"><span>${n||`code`}</span><span class="code-tools">${i}<button type="button" class="code-copy">${$(ge(`Copy`))}</button></span></div><pre><code${n?` class="language-${n}"`:``}>${$(e)}</code></pre></div>`},codespan({text:e}){let t=$(e);if(jr){let n=ir(e);return`<code${n?` data-k="${n}"`:``}>${t}</code>`}if(Zn(e))return`<code class="md-path" data-k="path" role="button" tabindex="0">${t}</code>`;let n=br(e);if(n!==null)return`<code class="md-cmd" data-k="cmd" data-cmd="${$(n)}" role="button" tabindex="0">${t}</code>`;let r=ir(e);return`<code${r?` data-k="${r}"`:``}>${t}</code>`}}}),Wn.addHook(`uponSanitizeElement`,(e,t)=>{if(!Ar||t.tagName!==`input`)return;let n=e;n.getAttribute(`type`)===`checkbox`&&n.hasAttribute(`disabled`)||n.parentNode?.removeChild(n)}),Wn.addHook(`afterSanitizeAttributes`,e=>{if(jr&&e.tagName===`IMG`){let t=e.getAttribute(`src`);t&&Mr(t)&&(e.setAttribute(`data-src`,t),e.removeAttribute(`src`))}e.tagName===`A`&&(e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`))}));let i;Ar=!!(t.plain||t.doc),jr=!!t.doc;try{let t=V.parse(e,{breaks:!jr,gfm:!0,async:!1});i=Ar?Wn.sanitize(t,kr):Wn.sanitize(t)}catch{i=`<p>${$(e)}</p>`}finally{Ar=!1,jr=!1}for(let e of Er(n)){let t=Tr.delete(e);if(t!==void 0&&t!==i)for(let e of Dr)e(t)}return Tr.set(n,i,n.length+i.length),i}var Pr=`pasteJournalEnabled`;function Fr(){try{return typeof localStorage<`u`&&localStorage.getItem(Pr)===`1`}catch{return!1}}var Ir=a(Fr()),Lr=a([]);function Rr(e){Ir.value=e,e||(Lr.value=[]);try{localStorage.setItem(Pr,e?`1`:`0`)}catch{}}function zr(e,t,n,r,i){if(!Ir.value)return;let a=r.value,o=i(),s={time:new Date().toISOString(),event:e.type,types:[...t?.types||[]],textLength:n,prevented:!1,focus:document.activeElement?.tagName||`NONE`,fieldFocused:document.activeElement===r,modified:!1,fieldLength:r.value.length,connected:r.isConnected};setTimeout(()=>{Ir.value&&(s.prevented=e.defaultPrevented,s.modified=r.value!==a||i()!==o,s.fieldLength=r.value.length,s.connected=r.isConnected,Lr.value=[...Lr.value.slice(-49),s])},0)}var Br=a(null),Vr=a(!1);async function Hr(){Vr.value=!0;try{Br.value=await pe(`/api/worktrees`)}catch(e){x(e.message,!0)}finally{Vr.value=!1}}var Ur=e=>e.branch||e.path.split(`/`).pop()||e.path;async function Wr(e){let t=Ur(e),n=e.agents?b(` ${e.agents>1?`Its ${e.agents} agents will be stopped`:`Its agent will be stopped`}.`,` ${e.agents>1?`Ses ${e.agents} agents seront arrêtés`:`Son agent sera arrêté`}.`):e.panes?b(` Its terminals will be closed.`,` Ses terminaux seront fermés.`):``,r=e.branch?b(` Branch ${e.branch} is kept.`,` La branche ${e.branch} est gardée.`):``;if(!await _(b(`Delete worktree ${t} (${e.path})?${n}${r}`,`Supprimer le worktree ${t} (${e.path}) ?${n}${r}`),ge(`Delete`)))return!1;let i=!1;for(;;)try{return await pe(`/api/worktrees/remove`,{machine:e.machine,path:e.path,force:i}),x(b(`Worktree ${t} deleted`,`Worktree ${t} supprimé`)),Br.value&&=Br.value.filter(t=>t.machine!==e.machine||t.path!==e.path),!0}catch(e){if(!i&&e instanceof _e&&e.code===`dirty`){if(!await _(b(`${t} has uncommitted changes. Delete them with the worktree?`,`${t} contient des modifications non commitées. Les supprimer avec le worktree ?`),ge(`Force delete`)))return!1;i=!0;continue}return x(e.message,!0),!1}}export{Lr as a,zr as c,Sr as d,Cr as f,ye as h,Br as i,Nr as l,xe as m,Wr as n,Ir as o,Xn as p,Ur as r,Rr as s,Hr as t,Or as u};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as e,B as t,Hn as n,N as r,Ot as i,P as a,U as o,V as s,b as c,gr as l,j as u}from"./C25ROUa9.js";import{h as d,u as f}from"./CvGCN0_f.js";import{ii as p,ri as m,xt as h}from"./DoX0nZZb.js";var g=`eliasstravik/herdr-projects`,_=`https://github.com/${g}`,v=`1.2.1`,y=`1.2.21`,b=`v${y}`,x=`herdr ${[`plugin`,`install`,g,`--ref`,b,`--yes`].join(` `)}`,S=`herdr plugin uninstall herdr-projects && ${x}`,C=`1.3.4`,w=[`npm install -g wherdr@${C}`],T=`~/.herdr-projects/data/bin/herdr-projects`,E=`docs/herdr-projects-1x.md`;function D(e,t){let n=e=>/^\d+(\.\d+)*$/.test(e)?e.split(`.`).map(Number):null,r=n((e||``).trim().replace(/^v/,``).replace(/[-+].*$/,``)),i=n(t);if(!r||!i)return!1;for(let e=0;e<Math.max(r.length,i.length);e++){let t=(r[e]||0)-(i[e]||0);if(t)return t>0}return!0}function O(e){return D(e,`1.2.1`)&&!D(e,`1.2.21`)}var k={class:`plugin-input-note warn projects-upgrade`,role:`note`},A={key:0},j={key:1},M={class:`projects-upgrade-step`},N={class:`projects-upgrade-cmd`},P={class:`projects-plugin-command`},F={class:`projects-upgrade-step`},I={class:`projects-upgrade-cmd`},L={class:`projects-plugin-command`},R={class:`projects-upgrade-step`},z=Object.assign(o({__name:`ProjectsUpgradeNote`,props:{status:{},version:{},machine:{}},setup(o){let g=o,_=e(()=>!g.version||!/^[1-9]/.test(g.version)),y=e(()=>g.status===`missing`?x:S);async function b(e){try{await navigator.clipboard.writeText(e),h(m(`Copied`))}catch{h(p(`Copy failed`,`Copie impossible`),!0)}}return(e,h)=>{let g=d,x=f;return i(),a(`div`,k,[s(g,{name:`i-lucide-triangle-alert`}),u(`div`,null,[u(`strong`,null,l((`tl`in e?e.tl:n(p))(`Update herdr-projects to ${n(v)} or later, or downgrade wherdr to ${n(C)}`,`Mets herdr-projects à jour en ${n(v)} ou plus, ou reviens à wherdr ${n(C)}`)),1),o.status===`old`?(i(),a(`p`,A,l(o.version?(`tl`in e?e.tl:n(p))(`${o.machine?`${o.machine} has`:`This machine has`} herdr-projects ${o.version}. This version of wherdr reads herdr-projects ${n(v)} and later only.`,`${o.machine?`${o.machine} a`:`Cette machine a`} herdr-projects ${o.version}. Cette version de wherdr ne lit que herdr-projects ${n(v)} et plus.`):(`tl`in e?e.tl:n(p))(`This version of wherdr reads herdr-projects ${n(v)} and later only.`,`Cette version de wherdr ne lit que herdr-projects ${n(v)} et plus.`)),1)):(i(),a(`p`,j,l((`tl`in e?e.tl:n(p))(`herdr-projects is not installed${o.machine?` on ${o.machine}`:``}. The Board shows its tasks from version ${n(v)} on.`,`herdr-projects n’est pas installé${o.machine?` sur ${o.machine}`:``}. Le Board affiche ses tâches à partir de la version ${n(v)}.`)),1)),u(`p`,M,l(o.status===`missing`?(`tl`in e?e.tl:n(p))(`Install it:`,`L’installer :`):n(_)?(`tl`in e?e.tl:n(p))(`Update it (your 0.2 projects are set aside in ~/.herdr-projects-legacy, never deleted):`,`La mettre à jour (tes projets 0.2 sont mis de côté dans ~/.herdr-projects-legacy, jamais supprimés) :`):(`tl`in e?e.tl:n(p))(`Update it:`,`La mettre à jour :`)),1),u(`div`,N,[u(`code`,P,l(n(y)),1),s(x,{size:`sm`,color:`neutral`,variant:`outline`,icon:`i-lucide-copy`,"aria-label":(`t`in e?e.t:n(m))(`Copy command`),onClick:h[0]||=e=>b(n(y))},null,8,[`aria-label`])]),o.status===`old`?(i(),a(c,{key:2},[u(`p`,F,l((`tl`in e?e.tl:n(p))(`Or go back to wherdr ${n(C)}, the last version for herdr-projects 0.2. With npm:`,`Ou revenir à wherdr ${n(C)}, la dernière version pour herdr-projects 0.2. Avec npm :`)),1),u(`div`,I,[u(`code`,L,l(n(w)[0]),1),s(x,{size:`sm`,color:`neutral`,variant:`outline`,icon:`i-lucide-copy`,"aria-label":(`t`in e?e.t:n(m))(`Copy command`),onClick:h[1]||=e=>b(n(w)[0])},null,8,[`aria-label`])])],64)):r(``,!0),u(`p`,R,[t(l((`tl`in e?e.tl:n(p))(`Step by step, with a backup and the way back:`,`Pas à pas, avec la sauvegarde et le retour arrière :`))+` `,1),u(`code`,null,l(n(E)),1),t(` `+l((`tl`in e?e.tl:n(p))(`in wherdr’s repository.`,`dans le dépôt de wherdr.`)),1)])])])}}}),{__name:`ProjectsUpgradeNote`});export{b as a,O as c,v as i,D as l,x as n,_ as o,T as r,y as s,z as t};
|
|
Binary file
|
|
Binary file
|