@linxin666/dsh-client-ui-task-board 0.4.6 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.i18n.yaml +2 -2
  2. package/README.md +14 -6
  3. package/README.zh.md +14 -6
  4. package/lib/client.js +1502 -820
  5. package/lib/client.js.map +1 -1
  6. package/lib/index.js +674 -75
  7. package/lib/types/client/CardDefaultPresetField.d.ts +35 -0
  8. package/lib/types/client/TaskBoardSettingsCard.d.ts +49 -0
  9. package/lib/types/client/board/ReasoningEffortField.d.ts +25 -0
  10. package/lib/types/client/board/model-options.d.ts +67 -0
  11. package/lib/types/client/board/preset-label.d.ts +21 -0
  12. package/lib/types/client/board/preset-roster.d.ts +45 -0
  13. package/lib/types/client/board/team-run-promotion.d.ts +26 -0
  14. package/lib/types/client/locales.d.ts +16 -0
  15. package/lib/types/core/card-defaults.d.ts +78 -0
  16. package/lib/types/core/controller.d.ts +32 -7
  17. package/lib/types/core/launch-width.d.ts +31 -0
  18. package/lib/types/core/reasoning-effort.d.ts +57 -0
  19. package/lib/types/core/subtask.d.ts +30 -8
  20. package/lib/types/core/tasks.d.ts +19 -0
  21. package/lib/types/core/use-cases/task-create.d.ts +10 -5
  22. package/lib/types/core/use-cases/task-update.d.ts +1 -1
  23. package/lib/types/host/launch-admission.d.ts +72 -0
  24. package/lib/types/host-ledger.d.ts +9 -4
  25. package/lib/types/host-runner.d.ts +79 -4
  26. package/lib/types/host-service.d.ts +85 -2
  27. package/lib/types/index.d.ts +87 -0
  28. package/lib/types/protocol.d.ts +13 -0
  29. package/package.json +28 -28
  30. package/src/client/CardDefaultPresetField.tsx +101 -0
  31. package/src/client/TaskBoardSettingsCard.tsx +214 -16
  32. package/src/client/board/LinkSubtaskModal.tsx +8 -0
  33. package/src/client/board/NewTaskModal.tsx +86 -40
  34. package/src/client/board/ReasoningEffortField.tsx +50 -0
  35. package/src/client/board/TaskDetail.tsx +42 -6
  36. package/src/client/board/model-options.ts +178 -0
  37. package/src/client/board/preset-label.ts +32 -0
  38. package/src/client/board/preset-roster.ts +58 -0
  39. package/src/client/board/team-run-promotion.ts +39 -0
  40. package/src/client/index.ts +98 -94
  41. package/src/client/locales.ts +34 -2
  42. package/src/client/settings-entry-form.ts +0 -1
  43. package/src/core/card-defaults.ts +132 -0
  44. package/src/core/controller.ts +44 -9
  45. package/src/core/launch-width.ts +38 -0
  46. package/src/core/reasoning-effort.ts +92 -0
  47. package/src/core/store.ts +5 -0
  48. package/src/core/subtask.ts +48 -13
  49. package/src/core/tasks.ts +20 -0
  50. package/src/core/use-cases/task-create.ts +27 -16
  51. package/src/core/use-cases/task-update.ts +6 -1
  52. package/src/host/agent-tools.ts +21 -8
  53. package/src/host/launch-admission.ts +140 -0
  54. package/src/host-ledger.ts +18 -6
  55. package/src/host-runner.ts +184 -18
  56. package/src/host-service.ts +247 -23
  57. package/src/index.ts +149 -2
  58. package/src/protocol.ts +28 -4
package/lib/client.js CHANGED
@@ -6,6 +6,7 @@ window.__ModuleLoader__.load({
6
6
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
7
  let react = require("react");
8
8
  let react_jsx_runtime = require("react/jsx-runtime");
9
+ let _deepseek_ai_dsh_client_store = require("@deepseek-ai/dsh-client-store");
9
10
  //#region src/core/extension.ts
10
11
  /** Cordis service name the host and browser halves each publish. */
11
12
  const TASK_BOARD_SERVICE_NAME = "taskBoard";
@@ -294,6 +295,7 @@ window.__ModuleLoader__.load({
294
295
  mode: normalizeTargetId(input.mode),
295
296
  permission: isTaskPermission(input.permission) ? input.permission : void 0,
296
297
  model: normalizeTargetId(input.model),
298
+ reasoningEffort: normalizeTargetId(input.reasoningEffort),
297
299
  reuseSession: input.reuseSession === true ? true : void 0,
298
300
  teamRun: input.teamRun === true ? true : void 0,
299
301
  goalRun: input.goalRun === true ? true : void 0,
@@ -508,6 +510,26 @@ window.__ModuleLoader__.load({
508
510
  return { ok: true };
509
511
  }
510
512
  /**
513
+ * Whether a cascade member takes part in a new run.
514
+ *
515
+ * The task the user ran is always a member: the request names that card, and
516
+ * the operator asked for it to run whatever its column says. A descendant does
517
+ * not join once it sits in the `done` column — its work is finished, so running
518
+ * the parent again is a run of the parent, never a second execution of work
519
+ * that is already done. The rule keys on the column alone, so it covers both a
520
+ * subtask that ran and one an operator moved to done by hand, and it holds for
521
+ * every trigger: a manual run, a re-run, and a due occurrence of a schedule.
522
+ * A card whose own schedule is enabled settles back into `todo`, so a scheduled
523
+ * subtask stays a participant; to make a finished one run again, move it back
524
+ * to `todo` or run it on its own.
525
+ * @param task - the candidate member.
526
+ * @param rootId - the task the run request named.
527
+ * @returns false when this member is left alone by the run.
528
+ */
529
+ function joinsCascadeRun(task, rootId) {
530
+ return task.id === rootId || task.status !== "done";
531
+ }
532
+ /**
511
533
  * The permission a task would actually run under: its handover bundle's pin
512
534
  * wins over the plain pin field, exactly as the runner resolves it.
513
535
  */
@@ -875,6 +897,57 @@ window.__ModuleLoader__.load({
875
897
  return /^\d+$/.test(value);
876
898
  }
877
899
  //#endregion
900
+ //#region src/core/card-defaults.ts
901
+ /** Trim one optional target: blank text means "not set", like every stored pin. */
902
+ function textOf(value) {
903
+ return value?.trim() ?? "";
904
+ }
905
+ /**
906
+ * Resolve the execution targets a new card starts from.
907
+ * @param defaults - the board's configured new-card defaults, if any.
908
+ * @param source - the card this one is created from (a duplicate or a parent), if any.
909
+ * @param picked - what the caller chose explicitly; a non-blank value wins.
910
+ * @returns the four targets, blank where nothing supplies a value.
911
+ */
912
+ function resolveCardTargets(defaults, source, picked) {
913
+ const defaultMode = textOf(defaults?.mode);
914
+ const defaultPermission = textOf(defaults?.permission);
915
+ const defaultModel = textOf(defaults?.model);
916
+ const defaultEffort = defaultModel === "" ? "" : textOf(defaults?.reasoningEffort);
917
+ const chosen = {
918
+ mode: textOf(picked?.mode),
919
+ permission: textOf(picked?.permission),
920
+ model: textOf(picked?.model),
921
+ reasoningEffort: textOf(picked?.reasoningEffort)
922
+ };
923
+ const copied = source === void 0 ? void 0 : {
924
+ mode: textOf(source.task.mode),
925
+ permission: textOf(source.task.permission),
926
+ model: textOf(source.task.model),
927
+ reasoningEffort: textOf(source.task.reasoningEffort)
928
+ };
929
+ /** The value carried over from the source card, or the board default. */
930
+ const inherited = (key) => {
931
+ const fallback = key === "mode" ? defaultMode : key === "model" ? defaultModel : defaultPermission;
932
+ if (copied === void 0 || key === "permission" && source?.kind === "parent") return fallback;
933
+ return copied[key] === "" ? fallback : copied[key];
934
+ };
935
+ const mode = chosen.mode === "" ? inherited("mode") : chosen.mode;
936
+ const permission = chosen.permission === "" ? inherited("permission") : chosen.permission;
937
+ const model = chosen.model === "" ? inherited("model") : chosen.model;
938
+ let reasoningEffort = chosen.reasoningEffort;
939
+ if (reasoningEffort === "" && chosen.model === "") {
940
+ const sourced = copied === void 0 ? "" : copied.reasoningEffort;
941
+ reasoningEffort = sourced !== "" ? sourced : model !== "" && model === defaultModel ? defaultEffort : "";
942
+ }
943
+ return {
944
+ mode,
945
+ permission,
946
+ model,
947
+ reasoningEffort
948
+ };
949
+ }
950
+ //#endregion
878
951
  //#region src/core/use-cases/task-create.ts
879
952
  /**
880
953
  * Create-task use case: mint a new task from user input, rejecting a blank
@@ -887,18 +960,22 @@ window.__ModuleLoader__.load({
887
960
  * appended ledger, or the unchanged ledger when the title is blank or the
888
961
  * requested parent link is refused.
889
962
  *
890
- * A subtask inherits the execution targets its parent already pins (workspace,
891
- * agent preset, permission, model) unless the form supplied its own; the
892
- * parent human permission confirmation travels with an inherited permission,
893
- * so a subtask of an already-confirmed elevated card is runnable at once.
963
+ * The execution targets resolve through {@link resolveCardTargets}: what the
964
+ * caller sent wins, then the parent's own pins, then - only when the caller
965
+ * opted in with `applyCardDefaults` - the deployment's configured new-card
966
+ * defaults. Without the flag the resolution sees no defaults at all, which is
967
+ * exactly the inline parent inheritance this path has always applied. The
968
+ * workspace is not part of that resolution: a subtask still takes the parent's
969
+ * workspace, and the defaults never name one.
894
970
  * @param tasks - current ledger.
895
971
  * @param input - raw user input (title/description/prompt + optional schedule/parent).
896
972
  * @param now - clock instant (ms epoch).
897
973
  * @param id - minted task id.
898
974
  * @param maxSubtaskDepth - deployment subtask depth limit.
899
975
  * @param hostTimeZone - zone a rule that stores no zone of its own follows.
976
+ * @param cardDefaults - the deployment's new-card defaults, read live at creation.
900
977
  */
901
- function applyCreateTask(tasks, input, now, id, maxSubtaskDepth = 1, hostTimeZone = resolveHostTimeZone()) {
978
+ function applyCreateTask(tasks, input, now, id, maxSubtaskDepth = 1, hostTimeZone = resolveHostTimeZone(), cardDefaults) {
902
979
  if (input.title.trim() === "") return {
903
980
  task: void 0,
904
981
  tasks,
@@ -924,11 +1001,22 @@ window.__ModuleLoader__.load({
924
1001
  error: `subtask depth limit (${limit}) exceeded`
925
1002
  };
926
1003
  }
927
- let task = createTask(parent === void 0 ? input : {
1004
+ const seed = resolveCardTargets(input.applyCardDefaults === true ? cardDefaults : void 0, parent === void 0 ? void 0 : {
1005
+ kind: "parent",
1006
+ task: parent
1007
+ }, {
1008
+ mode: input.mode,
1009
+ permission: input.permission,
1010
+ model: input.model,
1011
+ reasoningEffort: input.reasoningEffort
1012
+ });
1013
+ let task = createTask({
928
1014
  ...input,
929
- workspaceId: input.workspaceId ?? parent.workspaceId,
930
- mode: input.mode ?? parent.mode,
931
- model: input.model ?? parent.model
1015
+ workspaceId: input.workspaceId ?? parent?.workspaceId,
1016
+ mode: seed.mode,
1017
+ permission: isTaskPermission(seed.permission) ? seed.permission : void 0,
1018
+ model: seed.model,
1019
+ reasoningEffort: seed.reasoningEffort
932
1020
  }, now, id);
933
1021
  const requested = input.schedule;
934
1022
  if (requested?.enabled === true) {
@@ -1378,6 +1466,7 @@ window.__ModuleLoader__.load({
1378
1466
  const mode = "mode" in patch ? normalizeTargetId(patch.mode) : void 0;
1379
1467
  const permission = "permission" in patch ? normalizePermission(task.permission, patch.permission) : void 0;
1380
1468
  const model = "model" in patch ? normalizeTargetId(patch.model) : void 0;
1469
+ const reasoningEffort = "reasoningEffort" in patch ? normalizeTargetId(patch.reasoningEffort) : void 0;
1381
1470
  const next = {
1382
1471
  ...task,
1383
1472
  ...rest,
@@ -1403,6 +1492,7 @@ window.__ModuleLoader__.load({
1403
1492
  if (mode !== void 0 || "mode" in patch) next.mode = mode;
1404
1493
  if (permission !== void 0 || "permission" in patch) next.permission = permission;
1405
1494
  if (model !== void 0 || "model" in patch) next.model = model;
1495
+ if (reasoningEffort !== void 0 || "reasoningEffort" in patch) next.reasoningEffort = reasoningEffort;
1406
1496
  return next;
1407
1497
  });
1408
1498
  }
@@ -1544,6 +1634,21 @@ window.__ModuleLoader__.load({
1544
1634
  return await this.initializeRemote();
1545
1635
  }
1546
1636
  /**
1637
+ * Re-read the authoritative Host snapshot.
1638
+ *
1639
+ * The board's volatile deployment configuration — the new-card defaults among
1640
+ * it — is republished the moment the settings document is written, but the SSE
1641
+ * frame that republish emits carries the value as of BEFORE the write (the
1642
+ * loader hands the update to the fiber while the new document is not yet
1643
+ * visible to it), so a mirror that followed frames alone would stay one edit
1644
+ * behind and the create dialog would prefill from the previous defaults for
1645
+ * the rest of the session. The surface that owns the write asks for the
1646
+ * snapshot again instead of trusting the frame.
1647
+ */
1648
+ refreshHostState() {
1649
+ this.refreshRemote();
1650
+ }
1651
+ /**
1547
1652
  * Show the board. The layout owns which panel the center column renders, so
1548
1653
  * the state flip and the panel selection travel together here; a composition
1549
1654
  * with no layout face (tests, a shell-less host) still flips the state.
@@ -1616,7 +1721,7 @@ window.__ModuleLoader__.load({
1616
1721
  }
1617
1722
  createTask(input) {
1618
1723
  const id = this.uuid();
1619
- const { task, tasks } = applyCreateTask(this.tasks, input, this.now(), id, this.mirrorDepth());
1724
+ const { task, tasks } = applyCreateTask(this.tasks, input, this.now(), id, this.mirrorDepth(), void 0, this.hostState?.cardDefaults);
1620
1725
  if (task === void 0) return void 0;
1621
1726
  this.tasks = [...tasks];
1622
1727
  this.persistAndNotify();
@@ -1626,7 +1731,7 @@ window.__ModuleLoader__.load({
1626
1731
  async createTaskConfirmed(input) {
1627
1732
  if (this.deps.transport === void 0) return this.createTask(input);
1628
1733
  const id = this.uuid();
1629
- if (applyCreateTask(this.tasks, input, this.now(), id, this.mirrorDepth()).task === void 0) return void 0;
1734
+ if (applyCreateTask(this.tasks, input, this.now(), id, this.mirrorDepth(), void 0, this.hostState?.cardDefaults).task === void 0) return void 0;
1630
1735
  return await this.commitRemote({
1631
1736
  kind: "create",
1632
1737
  id,
@@ -2009,18 +2114,20 @@ window.__ModuleLoader__.load({
2009
2114
  return this.hostState?.maxSubtaskDepth ?? 1;
2010
2115
  }
2011
2116
  /**
2012
- * Project a Host snapshot onto the browser's mirror. SSE frames and partial
2013
- * snapshots carry only the volatile subset (revision/scheduler/power), so the
2014
- * deployment constants the UI reads — the session-default permission the
2015
- * confirmation banner compares against and the subtask depth limit — are
2016
- * carried over from the last full snapshot instead of being dropped by a
2017
- * heartbeat frame.
2117
+ * Project a Host snapshot onto the browser's mirror. Every snapshot the
2118
+ * transport serves is a full document (bootstrap/state/action all answer
2119
+ * `TaskBoardHostService.snapshot()`), so the deployment constants the UI reads
2120
+ * — the session-default permission the confirmation banner compares against,
2121
+ * the subtask depth limit, the platform switches and the extensions a provider
2122
+ * published — are taken as published, carried over only where the snapshot
2123
+ * itself omits the key.
2018
2124
  */
2019
2125
  mirrorOf(snapshot) {
2020
2126
  const sessionDefaultPermission = snapshot.sessionDefaultPermission ?? this.hostState?.sessionDefaultPermission;
2021
2127
  const maxSubtaskDepth = snapshot.maxSubtaskDepth ?? this.hostState?.maxSubtaskDepth;
2022
2128
  const teamRunAvailable = snapshot.teamRunAvailable ?? this.hostState?.teamRunAvailable;
2023
2129
  const goalRunEnabled = snapshot.goalRunEnabled ?? this.hostState?.goalRunEnabled;
2130
+ const cardDefaults = snapshot.cardDefaults;
2024
2131
  const extensions = snapshot.extensions ?? this.hostState?.extensions;
2025
2132
  return {
2026
2133
  revision: snapshot.revision,
@@ -2030,6 +2137,7 @@ window.__ModuleLoader__.load({
2030
2137
  ...maxSubtaskDepth === void 0 ? {} : { maxSubtaskDepth },
2031
2138
  ...teamRunAvailable === void 0 ? {} : { teamRunAvailable },
2032
2139
  ...goalRunEnabled === void 0 ? {} : { goalRunEnabled },
2140
+ ...cardDefaults === void 0 ? {} : { cardDefaults },
2033
2141
  ...extensions === void 0 ? {} : { extensions }
2034
2142
  };
2035
2143
  }
@@ -2064,6 +2172,189 @@ window.__ModuleLoader__.load({
2064
2172
  }
2065
2173
  };
2066
2174
  //#endregion
2175
+ //#region src/client/board/model-options.ts
2176
+ /** A plain JSON object, or undefined for anything else (including arrays). */
2177
+ function record(value) {
2178
+ return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
2179
+ }
2180
+ /** A non-empty string, or undefined. */
2181
+ function text(value) {
2182
+ return typeof value === "string" && value !== "" ? value : void 0;
2183
+ }
2184
+ /** The effort ids an adapter published for one model, in catalog order. */
2185
+ function effortIdsOf(reasoning) {
2186
+ const efforts = [];
2187
+ for (const entry of Array.isArray(reasoning.efforts) ? reasoning.efforts : []) {
2188
+ const id = text(record(entry)?.id);
2189
+ if (id !== void 0 && !efforts.includes(id)) efforts.push(id);
2190
+ }
2191
+ return efforts;
2192
+ }
2193
+ /**
2194
+ * What the catalog declares about one model's reasoning: a published
2195
+ * `reasoning` block is what "this route reasons" means, and a model published
2196
+ * without one is declared to have none. A model the reply never described at
2197
+ * all is a different state, expressed by the row carrying no capability.
2198
+ */
2199
+ function reasoningOf(model) {
2200
+ const reasoning = record(model.reasoning);
2201
+ if (reasoning === void 0) return { supported: false };
2202
+ const efforts = effortIdsOf(reasoning);
2203
+ return {
2204
+ supported: true,
2205
+ ...efforts.length === 0 ? {} : { efforts }
2206
+ };
2207
+ }
2208
+ /**
2209
+ * One picker row, or undefined when the entry carries no usable id.
2210
+ * @param withCapability - whether this reply declares reasoning metadata at
2211
+ * all; the flat discovery list does not, so its rows stay silent about it.
2212
+ */
2213
+ function rowOf(model, provider, withCapability) {
2214
+ const id = text(model.id);
2215
+ if (id === void 0) return void 0;
2216
+ const reasoning = withCapability ? reasoningOf(model) : void 0;
2217
+ return {
2218
+ id: provider === void 0 ? id : `${provider}/${id}`,
2219
+ name: text(model.name) ?? id,
2220
+ ...provider === void 0 ? {} : { provider },
2221
+ ...reasoning === void 0 ? {} : { reasoning }
2222
+ };
2223
+ }
2224
+ /**
2225
+ * Normalize a `session/modelCatalog` reply into picker rows: one row per model
2226
+ * of every provider group, keyed by the qualified route an execution pins.
2227
+ * @param value - the raw catalog reply.
2228
+ * @returns the rows, empty when the reply is unreadable.
2229
+ */
2230
+ function modelOptionsFromCatalog(value) {
2231
+ const options = [];
2232
+ const groups = record(value)?.groups;
2233
+ for (const entry of Array.isArray(groups) ? groups : []) {
2234
+ const group = record(entry);
2235
+ if (group === void 0) continue;
2236
+ const provider = text(group.id) ?? text(group.provider);
2237
+ for (const item of Array.isArray(group.models) ? group.models : []) {
2238
+ const model = record(item);
2239
+ if (model === void 0) continue;
2240
+ const row = rowOf(model, provider, true);
2241
+ if (row !== void 0) options.push(row);
2242
+ }
2243
+ }
2244
+ return options;
2245
+ }
2246
+ /**
2247
+ * Normalize the flat `llm/discoverModels` list into picker rows. That reply
2248
+ * names models only, so every row leaves the reasoning capability unknown.
2249
+ * @param value - the raw discovery list.
2250
+ * @returns the rows, empty when the list is unreadable.
2251
+ */
2252
+ function modelOptionsFromDiscoveredModels(value) {
2253
+ const options = [];
2254
+ for (const item of Array.isArray(value) ? value : []) {
2255
+ const model = record(item);
2256
+ if (model === void 0) continue;
2257
+ const row = rowOf(model, void 0, false);
2258
+ if (row !== void 0) options.push(row);
2259
+ }
2260
+ return options;
2261
+ }
2262
+ /**
2263
+ * The picker rows of a model roster: the qualified `provider/model` route as
2264
+ * the value a pin stores, and the provider beside the model name so two
2265
+ * providers offering one model name stay distinguishable.
2266
+ * @param models - the roster rows.
2267
+ * @returns the choice rows, in roster order.
2268
+ */
2269
+ function modelChoiceRows(models) {
2270
+ return models.map((model) => ({
2271
+ value: model.id,
2272
+ label: (model.provider === void 0 ? "" : model.provider + " · ") + (model.name ?? model.id)
2273
+ }));
2274
+ }
2275
+ /**
2276
+ * The capability row the roster publishes for one model route.
2277
+ * @returns undefined when no model is pinned, or the roster does not describe
2278
+ * the pinned one — an unknown model is not the same as a model without
2279
+ * reasoning.
2280
+ */
2281
+ function reasoningOfModel(models, modelId) {
2282
+ if (modelId === "") return void 0;
2283
+ return models.find((item) => item.id === modelId)?.reasoning;
2284
+ }
2285
+ /**
2286
+ * The effort ids the picker offers for a model, in catalog order.
2287
+ * @returns an empty list when the model is unpinned, unknown, declares no
2288
+ * reasoning, or publishes no selectable level.
2289
+ */
2290
+ function reasoningEffortsFor(models, modelId) {
2291
+ const reasoning = reasoningOfModel(models, modelId);
2292
+ return reasoning?.supported === true ? [...reasoning.efforts ?? []] : [];
2293
+ }
2294
+ /** Whether the effort picker may be operated: a pinned model with declared, selectable levels. */
2295
+ function reasoningPickerEnabled(models, modelId) {
2296
+ return reasoningEffortsFor(models, modelId).length > 0;
2297
+ }
2298
+ /**
2299
+ * The effort to keep when the picked model changes. Only a model that declares
2300
+ * its levels can invalidate one: a model the roster cannot describe keeps the
2301
+ * stored value, because the roster has no grounds to call it invalid.
2302
+ * @param effort - the effort currently stored/selected ('' = follow the default).
2303
+ * @returns the effort to keep.
2304
+ */
2305
+ function reconcileReasoningEffort(models, modelId, effort) {
2306
+ if (effort === "") return "";
2307
+ const reasoning = reasoningOfModel(models, modelId);
2308
+ if (reasoning === void 0) return modelId === "" ? "" : effort;
2309
+ return reasoning.efforts?.includes(effort) === true ? effort : "";
2310
+ }
2311
+ /**
2312
+ * The copy explaining why the picker is in its current state. One lookup for
2313
+ * both editors, so the create dialog and the detail page never drift apart.
2314
+ */
2315
+ function reasoningHintKey(models, modelId) {
2316
+ if (modelId === "") return "exec.reasoning.hint.pickModel";
2317
+ if (reasoningOfModel(models, modelId) === void 0) return "exec.reasoning.hint.unknownModel";
2318
+ return reasoningPickerEnabled(models, modelId) ? "exec.reasoning.hint.inherit" : "exec.reasoning.hint.noEfforts";
2319
+ }
2320
+ //#endregion
2321
+ //#region src/client/board/preset-roster.ts
2322
+ /**
2323
+ * Read the agent-preset roster of one deployment. The caller passes the
2324
+ * namespace resolved inside its scoped inject, so a host that serves no such
2325
+ * namespace never reaches here; a host that serves it answers `ok: false`
2326
+ * instead, which leaves the caller's options untouched.
2327
+ * @param remote - the `remote.agentPresets` namespace.
2328
+ * @returns the roster, or a failed read the caller ignores.
2329
+ */
2330
+ async function readPresetRoster(remote) {
2331
+ const response = await remote.list();
2332
+ if (!response.ok) return {
2333
+ ok: false,
2334
+ presets: []
2335
+ };
2336
+ return {
2337
+ ok: true,
2338
+ presets: response.value.presets
2339
+ };
2340
+ }
2341
+ /**
2342
+ * Normalize one roster into the picker rows the UI consumes. A preset that
2343
+ * cannot compose a session keeps its `broken` reason: the pickers show it and
2344
+ * disable it, so a missing preset never looks like a missing roster.
2345
+ * @param presets - the roster rows.
2346
+ * @returns the picker options.
2347
+ */
2348
+ function presetOptionsFromRoster(presets) {
2349
+ return presets.map((preset) => ({
2350
+ id: preset.id,
2351
+ name: preset.name,
2352
+ description: preset.description,
2353
+ broken: preset.broken,
2354
+ isDefault: preset.isDefault
2355
+ }));
2356
+ }
2357
+ //#endregion
2067
2358
  //#region src/client/main-session.ts
2068
2359
  /**
2069
2360
  * Resolve the Session the main view currently shows.
@@ -2813,6 +3104,7 @@ window.__ModuleLoader__.load({
2813
3104
  if (record.parentId !== void 0 && typeof record.parentId !== "string") return false;
2814
3105
  if (record.workspaceId !== void 0 && typeof record.workspaceId !== "string") return false;
2815
3106
  if (record.mode !== void 0 && typeof record.mode !== "string") return false;
3107
+ if (record.reasoningEffort !== void 0 && typeof record.reasoningEffort !== "string") return false;
2816
3108
  if (record.permission !== void 0 && typeof record.permission !== "string") return false;
2817
3109
  if (record.integrations !== void 0 && (typeof record.integrations !== "object" || record.integrations === null || Array.isArray(record.integrations))) return false;
2818
3110
  if (record.hidden !== void 0 && typeof record.hidden !== "boolean") return false;
@@ -2978,6 +3270,7 @@ window.__ModuleLoader__.load({
2978
3270
  }));
2979
3271
  task.workspaceId = normalizeTargetId(row.workspaceId);
2980
3272
  task.mode = normalizeTargetId(row.mode);
3273
+ task.reasoningEffort = normalizeTargetId(row.reasoningEffort);
2981
3274
  task.archivedAt = typeof row.archivedAt === "number" && Number.isFinite(row.archivedAt) ? row.archivedAt : void 0;
2982
3275
  task.permission = isTaskPermission(row.permission) ? row.permission : void 0;
2983
3276
  task.reuseSession = row.reuseSession === true ? true : void 0;
@@ -3318,6 +3611,14 @@ window.__ModuleLoader__.load({
3318
3611
  "exec.permission.danger-full-access": "完全访问",
3319
3612
  "exec.model.default": "宿主默认(agent-default-model)",
3320
3613
  "exec.model.unknown": "(未知模型/回退默认)",
3614
+ "exec.reasoning": "思考档位",
3615
+ "exec.reasoning.inherit": "沿用模型/宿主默认",
3616
+ "exec.reasoning.unknown": "(未知档位)",
3617
+ "exec.reasoning.hint.pickModel": "先选择要钉住的模型,才能设置它的思考档位。",
3618
+ "exec.reasoning.hint.unknownModel": "无法从当前名册确认该模型的可选档位;已保存的值原样保留。",
3619
+ "exec.reasoning.hint.noEfforts": "该模型没有可选的思考档位,始终沿用模型/宿主的默认值。",
3620
+ "exec.reasoning.hint.inherit": "留空即沿用该模型/宿主的默认档位。",
3621
+ "exec.teamRunAutoHint": "创建或关联子任务成功后,父任务会自动开启 Agent Team 执行(可随时手动关闭)。",
3321
3622
  "exec.reuseSession": "在同一对话继续",
3322
3623
  "exec.teamRun": "用 Agent Team 执行(Leader/teammate)",
3323
3624
  "exec.teamRunHint": "开启后:执行本任务只启动一个 Leader 会话,每个子任务由它派生为 teammate 并在该会话内并行工作(子任务自身的权限钉住不适用)。关闭则每个成员各开独立会话。",
@@ -3362,6 +3663,8 @@ window.__ModuleLoader__.load({
3362
3663
  "settings.maxSubtaskDepth": "子任务深度上限",
3363
3664
  "settings.maxSubtaskDepthHint": "默认 1:一个任务只允许一层子任务,子任务不能再创建或关联子任务。最大 3。执行父任务会并发执行它的整棵子任务树,层级越深,一次执行开启的会话越多。",
3364
3665
  "settings.maxSubtaskDepthOption": "{depth} 层",
3666
+ "settings.runLaunchWidth": "并发启动上限",
3667
+ "settings.runLaunchWidthHint": "默认 3。一次执行会开启整棵子任务树,但同一刻最多只有这么多个成员在创建会话并入队 Prompt,其余成员排队等待——全部都会启动,只是分批进入运行列。默认值取自本仓「重型实施子代理并发 ≤ 3」的实测纪律。取值 1–16:越大启动越快,Host 的内存与 swap 压力越高。执行中修改只影响尚未入列的启动。",
3365
3668
  "settings.runBehaviorTitle": "运行行为",
3366
3669
  "settings.runBehaviorCardHint": "全局原生 /goal 执行开关(总开关,默认关闭)。",
3367
3670
  "settings.goalRunGlobal": "全局启用 DSH 原生 /goal 执行",
@@ -3391,6 +3694,11 @@ window.__ModuleLoader__.load({
3391
3694
  "settings.goalVerificationEffortFallback": "所选推理强度 {requested} 不被目标模型支持,已回退为 {resolved}。",
3392
3695
  "settings.goalVerificationEffortFallbackNone": "所选推理强度 {requested} 不被目标模型支持,已回退为该模型默认档位(不显式传参)。",
3393
3696
  "settings.goalVerificationModelInvalid": "配置的验收模型不是 provider/model 形式,已回退宿主默认。",
3697
+ "settings.cardDefaultsTitle": "新建卡片默认值",
3698
+ "settings.cardDefaultsCardHint": "新建对话框打开时预填的 Agent 预设、权限、模型与思考档位;留空即不设置,创建卡片的行为与未配置时完全一致。它们只是预填,不改变任何既有语义,新建的卡片仍可随时修改;思考档位默认值只在卡片最终钉住的模型就是这里的默认模型时才生效。",
3699
+ "settings.cardDefaultModeHint": "留空不钉住任何值,新建卡片照旧继承部署默认预设。取值优先级为:新建对话框里的显式选择 > 复制源卡或父任务已钉住的值 > 这里的默认值;子任务沿用父卡已钉住的值。",
3700
+ "settings.cardDefaultPermissionHint": "留空为不设置(用会话默认)。高于会话默认权限基线的默认值仍只是预填:卡片执行前照旧需要人工确认。子任务从不沿用父卡的权限,只在父卡未钉住、且这里设置了默认值时才预填。",
3701
+ "settings.cardDefaultModelHint": "留空为宿主默认(agent-default-model)。对话框里的显式选择优先于源卡/父卡已钉住的值,后者优先于这里的默认值;自己选了模型的调用方不借用任何默认档位。",
3394
3702
  "running.executing": "执行中",
3395
3703
  "running.verifying": "验收中",
3396
3704
  "running.repairing": "验收未通过修复中",
@@ -3464,7 +3772,8 @@ window.__ModuleLoader__.load({
3464
3772
  "detail.subtasks.link": "关联现有任务",
3465
3773
  "detail.subtasks.detach": "解除关联",
3466
3774
  "detail.subtasks.runningLock": "子任务正在执行,结算后才能解除关联或改挂父任务",
3467
- "detail.subtasks.runHint": "执行本任务会同时并发执行它的 {count} 个子任务;子任务失败不影响其它子任务继续执行。",
3775
+ "detail.subtasks.runHint": "执行本任务会同时并发执行它 {count} 个未完成的子任务;已在完成列的子任务不会重复执行,子任务失败不影响其它子任务继续执行。",
3776
+ "detail.subtasks.runHintSettled": "这个任务的子任务都已在完成列;执行本任务不会重复执行它们,要让某个子任务再跑一次,把它移回待办列或单独执行它。",
3468
3777
  "detail.subtasks.waiting": "等待子任务结算",
3469
3778
  "detail.subtasks.depthLimit": "当前子任务深度上限为 {depth} 层,子任务不能再创建或关联子任务。",
3470
3779
  "detail.subtasks.hostOnly": "连接 Host 后才能创建或关联子任务。",
@@ -3742,6 +4051,14 @@ window.__ModuleLoader__.load({
3742
4051
  "exec.permission.danger-full-access": "Full Access",
3743
4052
  "exec.model.default": "Host default (agent-default-model)",
3744
4053
  "exec.model.unknown": " (unknown / fallback to default)",
4054
+ "exec.reasoning": "Reasoning effort",
4055
+ "exec.reasoning.inherit": "Model or Host default",
4056
+ "exec.reasoning.unknown": " (unknown effort)",
4057
+ "exec.reasoning.hint.pickModel": "Pin a model first, then choose its reasoning effort.",
4058
+ "exec.reasoning.hint.unknownModel": "The current roster cannot confirm this model's effort levels; the stored value is kept as it is.",
4059
+ "exec.reasoning.hint.noEfforts": "This model offers no selectable reasoning effort, so the model or Host default always applies.",
4060
+ "exec.reasoning.hint.inherit": "Leave it empty to follow the model or Host default.",
4061
+ "exec.teamRunAutoHint": "Once a subtask is created or linked, the parent task turns on Agent Team execution automatically (you can switch it off at any time).",
3745
4062
  "exec.reuseSession": "Continue in the same conversation",
3746
4063
  "exec.teamRun": "Run with an Agent Team (Lead + teammates)",
3747
4064
  "exec.teamRunHint": "On: running this task starts one Lead session and spawns a teammate per subtask inside it, working in parallel (a subtask permission pin does not apply). Off: every member gets its own independent session.",
@@ -3786,6 +4103,8 @@ window.__ModuleLoader__.load({
3786
4103
  "settings.maxSubtaskDepth": "Subtask depth limit",
3787
4104
  "settings.maxSubtaskDepthHint": "Default 1: a task may carry one level of subtasks, and a subtask cannot create or link further subtasks. Maximum 3. Running a task also runs its whole subtask tree concurrently, and every extra level opens more sessions per run.",
3788
4105
  "settings.maxSubtaskDepthOption": "{depth} levels",
4106
+ "settings.runLaunchWidth": "Concurrent run launches",
4107
+ "settings.runLaunchWidthHint": "Default 3. A run opens its whole subtree, but only this many members create their session and queue their prompt at the same time; the rest wait their turn. Every member still starts, entering the running column in batches. The default comes from this repository's measured guidance for heavy implementation subagents (at most three). Range 1 to 16: a larger width starts runs sooner and costs the Host more memory and swap. Edited during a run, it bounds the launches that have not been admitted yet.",
3789
4108
  "settings.runBehaviorTitle": "Run behavior",
3790
4109
  "settings.runBehaviorCardHint": "The global native /goal switch (master control, off by default).",
3791
4110
  "settings.goalRunGlobal": "Global: run tasks with dsh native /goal",
@@ -3814,6 +4133,11 @@ window.__ModuleLoader__.load({
3814
4133
  "settings.goalVerificationRouteMissing": "The host serves no model catalog, so no judge route resolves: with acceptance on, a goal completion claim is refused and recorded as an acceptance anomaly.",
3815
4134
  "settings.goalVerificationEffortFallback": "The selected reasoning effort {requested} is not supported by the target model; it falls back to {resolved}.",
3816
4135
  "settings.goalVerificationEffortFallbackNone": "The selected reasoning effort {requested} is not supported by the target model; it falls back to that model default level (not sent explicitly).",
4136
+ "settings.cardDefaultsTitle": "New-card defaults",
4137
+ "settings.cardDefaultsCardHint": "What the new-task dialog opens with: agent preset, permission, model and reasoning effort. Blank sets nothing, so creating a card behaves exactly as it does unconfigured. They are only prefills and change no existing meaning, and every new card stays editable; the default reasoning effort applies only while a card ends up on the configured default model.",
4138
+ "settings.cardDefaultModeHint": "Blank pins nothing: a new card keeps following the deployment default preset. A target resolves as the explicit choice in the new-task dialog, then the value carried over from the source card or parent, then this default; a subtask keeps what its parent already pinned.",
4139
+ "settings.cardDefaultPermissionHint": "Blank sets nothing (the session default applies). A default above the session permission baseline is still only a prefill: the card still needs a human confirmation before it may run. A subtask never carries its parent permission; this default fills in only where the parent pinned none.",
4140
+ "settings.cardDefaultModelHint": "Blank is the host default (agent-default-model). An explicit choice in the dialog wins over the value carried over from the source card or parent, which wins over this default; a caller that pins a model of its own borrows no default reasoning level.",
3817
4141
  "settings.goalVerificationModelInvalid": "The configured judge model is not a provider/model route; the host default is used instead.",
3818
4142
  "running.executing": "Executing",
3819
4143
  "running.verifying": "Verifying",
@@ -3888,7 +4212,8 @@ window.__ModuleLoader__.load({
3888
4212
  "detail.subtasks.link": "Link existing task",
3889
4213
  "detail.subtasks.detach": "Detach",
3890
4214
  "detail.subtasks.runningLock": "This subtask is running; it can be detached or re-linked once it settles",
3891
- "detail.subtasks.runHint": "Running this task also runs its {count} subtasks concurrently; one subtask failing does not stop the others.",
4215
+ "detail.subtasks.runHint": "Running this task also runs its {count} unfinished subtasks concurrently; a subtask already in the done column is not run again, and one subtask failing does not stop the others.",
4216
+ "detail.subtasks.runHintSettled": "Every subtask of this task is already in the done column; running this task does not repeat them. To run one again, move it back to the todo column or run it on its own.",
3892
4217
  "detail.subtasks.waiting": "Waiting for subtasks",
3893
4218
  "detail.subtasks.depthLimit": "The subtask depth limit is {depth}; a subtask cannot create or link further subtasks.",
3894
4219
  "detail.subtasks.hostOnly": "Connect to the Host to create or link subtasks.",
@@ -5055,9 +5380,9 @@ window.__ModuleLoader__.load({
5055
5380
  return VERIFICATION_PHASE_KEY[verificationPhase(verification)];
5056
5381
  }
5057
5382
  //#endregion
5058
- //#region ../../node_modules/.pnpm/marked@18.0.14/node_modules/marked/lib/marked.esm.js
5383
+ //#region ../../node_modules/.pnpm/marked@18.1.1/node_modules/marked/lib/marked.esm.js
5059
5384
  /**
5060
- * marked v18.0.14 - a markdown parser
5385
+ * marked v18.1.1 - a markdown parser
5061
5386
  * Copyright (c) 2018-2026, MarkedJS. (MIT License)
5062
5387
  * Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)
5063
5388
  * https://github.com/markedjs/marked
@@ -5066,7 +5391,7 @@ window.__ModuleLoader__.load({
5066
5391
  * DO NOT EDIT THIS FILE
5067
5392
  * The code in this file is generated from files in ./src/
5068
5393
  */
5069
- function I() {
5394
+ function B() {
5070
5395
  return {
5071
5396
  async: !1,
5072
5397
  breaks: !1,
@@ -5080,31 +5405,31 @@ window.__ModuleLoader__.load({
5080
5405
  walkTokens: null
5081
5406
  };
5082
5407
  }
5083
- var y = I();
5084
- function W(l) {
5085
- y = l;
5408
+ var y = B();
5409
+ function V(a) {
5410
+ y = a;
5086
5411
  }
5087
- var A = { exec: () => null };
5088
- function C(l) {
5412
+ var M = { exec: () => null };
5413
+ function D(a) {
5089
5414
  let e = [];
5090
5415
  return (t) => {
5091
- let n = Math.max(0, Math.min(3, t - 1)), s = e[n];
5092
- return s || (s = l(n), e[n] = s), s;
5416
+ let n = Math.max(0, Math.min(3, t - 1)), i = e[n];
5417
+ return i || (i = a(n), e[n] = i), i;
5093
5418
  };
5094
5419
  }
5095
- function h(l, e = "") {
5096
- let t = typeof l == "string" ? l : l.source, n = {
5097
- replace: (s, r) => {
5420
+ function h(a, e = "") {
5421
+ let t = typeof a == "string" ? a : a.source, n = {
5422
+ replace: (i, r) => {
5098
5423
  let o = typeof r == "string" ? r : r.source;
5099
- return o = o.replace(x.caret, "$1"), t = t.replace(s, o), n;
5424
+ return o = o.replace(x.caret, "$1"), t = t.replace(i, o), n;
5100
5425
  },
5101
5426
  getRegex: () => new RegExp(t, e)
5102
5427
  };
5103
5428
  return n;
5104
5429
  }
5105
- var _e = ((l = "") => {
5430
+ var ze = ((a = "") => {
5106
5431
  try {
5107
- return !!new RegExp("(?<=1)(?<!1)" + l);
5432
+ return !!new RegExp("(?<=1)(?<!1)" + a);
5108
5433
  } catch {
5109
5434
  return !1;
5110
5435
  }
@@ -5148,7 +5473,8 @@ window.__ModuleLoader__.load({
5148
5473
  endAngleBracket: />$/,
5149
5474
  pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/,
5150
5475
  unicodeAlphaNumeric: /[\p{L}\p{N}]/u,
5151
- numericCharacterReference: /&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,
5476
+ numericCharacterReference: /&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,
5477
+ numericCharacterReferenceOrAmpersand: /&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,
5152
5478
  escapeTest: /[&<>"']/,
5153
5479
  escapeReplace: /[&<>"']/g,
5154
5480
  escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,
@@ -5162,299 +5488,300 @@ window.__ModuleLoader__.load({
5162
5488
  spaceLine: /^ +$/gm,
5163
5489
  notSpaceStart: /^\S*/,
5164
5490
  endingNewline: /\n$/,
5165
- listItemRegex: (l) => new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),
5166
- nextBulletRegex: C((l) => new RegExp(`^ {0,${l}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
5167
- hrRegex: C((l) => new RegExp(`^ {0,${l}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
5168
- fencesBeginRegex: C((l) => new RegExp(`^ {0,${l}}(?:\`\`\`|~~~)`)),
5169
- headingBeginRegex: C((l) => new RegExp(`^ {0,${l}}#`)),
5170
- htmlBeginRegex: C((l) => new RegExp(`^ {0,${l}}(?:</?(?:${N})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, "i")),
5171
- blockquoteBeginRegex: C((l) => new RegExp(`^ {0,${l}}>`))
5491
+ listItemRegex: (a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`),
5492
+ nextBulletRegex: D((a) => new RegExp(`^ {0,${a}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
5493
+ hrRegex: D((a) => new RegExp(`^ {0,${a}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
5494
+ fencesBeginRegex: D((a) => new RegExp(`^ {0,${a}}(?:\`\`\`|~~~)`)),
5495
+ headingBeginRegex: D((a) => new RegExp(`^ {0,${a}}#`)),
5496
+ htmlBeginRegex: D((a) => new RegExp(`^ {0,${a}}(?:</?(?:${Q})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`, "i")),
5497
+ blockquoteBeginRegex: D((a) => new RegExp(`^ {0,${a}}>`))
5172
5498
  };
5173
- var $e = /^(?:[ \t]*(?:\n|$))+/;
5174
- var Le = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
5175
- var ze = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
5176
- var G = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
5177
- var Ae = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
5178
- var J = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
5179
- var ce = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
5180
- var he = h(ce).replace(/bull/g, J).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}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
5181
- var Ee = h(ce).replace(/bull/g, J).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}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
5182
- var V = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/;
5183
- var Me = /^[^\n]+/;
5184
- var Y = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
5185
- var Ie = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Y).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
5186
- var Ce = h(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, J).getRegex();
5187
- var N = "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";
5188
- var ee = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
5189
- var Be = h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", ee).replace("tag", N).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
5190
- var de = (l) => h(V).replace("hr", G).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", l).replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", N).getRegex();
5191
- var De = de(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/);
5192
- var qe = de(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/);
5193
- var te = {
5194
- blockquote: h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", qe).getRegex(),
5195
- code: Le,
5196
- def: Ie,
5197
- fences: ze,
5198
- heading: Ae,
5199
- hr: G,
5200
- html: Be,
5201
- lheading: he,
5202
- list: Ce,
5203
- newline: $e,
5204
- paragraph: De,
5205
- table: A,
5206
- text: Me
5499
+ var Ee = /^(?:[ \t]*(?:\n|$))+/;
5500
+ var Me = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
5501
+ var Ce = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
5502
+ var N = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
5503
+ var Ie = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
5504
+ var Y = / {0,3}(?:[*+-]|\d{1,9}[.)])/;
5505
+ var fe = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
5506
+ var me = h(fe).replace(/bull/g, Y).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}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
5507
+ var Be = h(fe).replace(/bull/g, Y).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}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
5508
+ var ee = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/;
5509
+ var De = /^[^\n]+/;
5510
+ var te = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
5511
+ var qe = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", te).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
5512
+ var Ze = h(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Y).getRegex();
5513
+ var Q = "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";
5514
+ var ne = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
5515
+ var ve = h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", ne).replace("tag", Q).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
5516
+ var xe = (a) => h(ee).replace("hr", N).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", a).replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Q).getRegex();
5517
+ var He = xe(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/);
5518
+ var Ge = xe(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/);
5519
+ var re = {
5520
+ blockquote: h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ge).getRegex(),
5521
+ code: Me,
5522
+ def: qe,
5523
+ fences: Ce,
5524
+ heading: Ie,
5525
+ hr: N,
5526
+ html: ve,
5527
+ lheading: me,
5528
+ list: Ze,
5529
+ newline: Ee,
5530
+ paragraph: He,
5531
+ table: M,
5532
+ text: De
5207
5533
  };
5208
- var le = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", G).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", N).getRegex();
5209
- var Ze = {
5210
- ...te,
5211
- lheading: Ee,
5212
- table: le,
5213
- paragraph: h(V).replace("hr", G).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", le).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", N).getRegex()
5534
+ var de = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", N).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Q).getRegex();
5535
+ var Qe = {
5536
+ ...re,
5537
+ lheading: Be,
5538
+ table: de,
5539
+ paragraph: h(ee).replace("hr", N).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", de).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Q).getRegex()
5214
5540
  };
5215
- var He = {
5216
- ...te,
5217
- html: h(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", ee).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(),
5541
+ var je = {
5542
+ ...re,
5543
+ html: h(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", ne).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(),
5218
5544
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
5219
5545
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
5220
- fences: A,
5546
+ fences: M,
5221
5547
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
5222
- paragraph: h(V).replace("hr", G).replace("heading", ` *#{1,6} *[^
5223
- ]`).replace("lheading", he).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
5548
+ paragraph: h(ee).replace("hr", N).replace("heading", ` *#{1,6} *[^
5549
+ ]`).replace("lheading", me).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
5224
5550
  };
5225
- var Ge = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
5226
- var Ne = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
5227
- var ke = /^( {2,}|\\)\n(?!\s*$)[ \t]*/;
5228
- var Qe = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
5229
- var $ = /[\p{P}\p{S}]/u;
5230
- var B = /[\s\p{P}\p{S}]/u;
5231
- var Q = /[^\s\p{P}\p{S}]/u;
5232
- var je = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, B).getRegex();
5233
- var Fe = /[\p{Pi}\p{Ps}"']/u;
5234
- var ge = /(?!~)[\p{P}\p{S}]/u;
5235
- var Ue = /(?!~)[\s\p{P}\p{S}]/u;
5236
- var Ke = /(?:[^\s\p{P}\p{S}]|~)/u;
5237
- var We = h(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", _e ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
5238
- var fe = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/;
5239
- var Xe = h(fe, "u").replace(/punct/g, $).getRegex();
5240
- var Je = h(fe, "u").replace(/punct/g, ge).getRegex();
5241
- var Ye = h(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, Fe).replace(/punct/g, $).getRegex();
5242
- var me = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
5243
- var et = h(me, "gu").replace(/notPunctSpace/g, Q).replace(/punctSpace/g, B).replace(/punct/g, $).getRegex();
5244
- var tt = h(me, "gu").replace(/notPunctSpace/g, Ke).replace(/punctSpace/g, Ue).replace(/punct/g, ge).getRegex();
5245
- var rt = h("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Q).replace(/punctSpace/g, B).replace(/punct/g, $).getRegex();
5246
- var st = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Q).replace(/punctSpace/g, B).replace(/punct/g, $).getRegex();
5247
- var ot = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Q).replace(/punctSpace/g, B).replace(/punct/g, $).getRegex();
5248
- var at = h(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, $).getRegex();
5249
- var ut = h("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Q).replace(/punctSpace/g, B).replace(/punct/g, $).getRegex();
5250
- var pt = h(/\\(punct)/, "gu").replace(/punct/g, $).getRegex();
5251
- var ct = h(/^<(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();
5252
- var ht = h(ee).replace("(?:-->|$)", "-->").getRegex();
5253
- var dt = h("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", ht).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
5254
- var xe = /\[(?:\\[\s\S]|[^\[\]\\])*\]/;
5255
- var U = h(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", xe).getRegex();
5256
- var kt = h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", U).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
5257
- var gt = h(/^!?\[(label)\]\[(ref)\]/).replace("label", U).replace("ref", Y).getRegex();
5258
- var ft = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", Y).getRegex();
5259
- var ue = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/;
5260
- var mt = h(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", xe).getRegex();
5261
- var xt = h("reflink|nolink(?!\\()", "g").replace("reflink", h(/^!?\[(label)\]\[(ref)\]/).replace("label", mt).replace("ref", ue).getRegex()).replace("nolink", h(/^!?\[(ref)\](?:\[\])?/).replace("ref", ue).getRegex()).getRegex();
5262
- var pe = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
5263
- var Rt = h(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex();
5264
- var ne = {
5265
- _backpedal: A,
5266
- anyPunctuation: pt,
5267
- autolink: ct,
5268
- blockSkip: We,
5269
- br: ke,
5270
- code: Ne,
5271
- del: A,
5272
- delLDelim: A,
5273
- delRDelim: A,
5274
- emStrongLDelim: Xe,
5275
- emStrongRDelimAst: et,
5276
- emStrongRDelimUnd: st,
5277
- escape: Ge,
5278
- link: kt,
5279
- nolink: ft,
5280
- punctuation: je,
5281
- reflink: gt,
5282
- reflinkSearch: xt,
5283
- tag: dt,
5284
- text: Qe,
5285
- url: A
5551
+ var Fe = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
5552
+ var Ue = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
5553
+ var be = /^( {2,}|\\)\n(?!\s*$)[ \t]*/;
5554
+ var Ke = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
5555
+ var S = /[\p{P}\p{S}]/u;
5556
+ var q = /[\s\p{P}\p{S}]/u;
5557
+ var j = /[^\s\p{P}\p{S}]/u;
5558
+ var Xe = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, q).getRegex();
5559
+ var We = /[\p{Pi}\p{Ps}"']/u;
5560
+ var Re = /(?!~)[\p{P}\p{S}]/u;
5561
+ var Ve = /(?!~)[\s\p{P}\p{S}]/u;
5562
+ var Je = /(?:[^\s\p{P}\p{S}]|~)/u;
5563
+ var Ye = h(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", ze ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
5564
+ var Te = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/;
5565
+ var et = h(Te, "u").replace(/punct/g, S).getRegex();
5566
+ var tt = h(Te, "u").replace(/punct/g, Re).getRegex();
5567
+ var rt = h(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, We).replace(/punct/g, S).getRegex();
5568
+ var Oe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
5569
+ var st = h(Oe, "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
5570
+ var it = h(Oe, "gu").replace(/notPunctSpace/g, Je).replace(/punctSpace/g, Ve).replace(/punct/g, Re).getRegex();
5571
+ var at = h("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
5572
+ var lt = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
5573
+ var pt = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
5574
+ var ct = h(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, S).getRegex();
5575
+ var dt = h("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, j).replace(/punctSpace/g, q).replace(/punct/g, S).getRegex();
5576
+ var kt = h(/\\(punct)/, "gu").replace(/punct/g, S).getRegex();
5577
+ var gt = h(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/, "gu").replace(/punct/g, S).getRegex();
5578
+ var ft = h(/^<(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();
5579
+ var mt = h(ne).replace("(?:-->|$)", "-->").getRegex();
5580
+ var xt = h("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", mt).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
5581
+ var we = /\[(?:\\[\s\S]|[^\[\]\\])*\]/;
5582
+ var K = h(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", we).getRegex();
5583
+ var bt = h(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label", K).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
5584
+ var Rt = h(/^!?\[(label)\]\[(ref)\]/).replace("label", K).replace("ref", te).getRegex();
5585
+ var Tt = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", te).getRegex();
5586
+ var ke = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/;
5587
+ var Ot = h(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", we).getRegex();
5588
+ var wt = h("reflink|nolink(?!\\()", "g").replace("reflink", h(/^!?\[(label)\]\[(ref)\]/).replace("label", Ot).replace("ref", ke).getRegex()).replace("nolink", h(/^!?\[(ref)\](?:\[\])?/).replace("ref", ke).getRegex()).getRegex();
5589
+ var ge = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
5590
+ var yt = h(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex();
5591
+ var se = {
5592
+ _backpedal: M,
5593
+ anyPunctuation: kt,
5594
+ anyPunctuationOutsideCode: gt,
5595
+ autolink: ft,
5596
+ blockSkip: Ye,
5597
+ br: be,
5598
+ code: Ue,
5599
+ del: M,
5600
+ delLDelim: M,
5601
+ delRDelim: M,
5602
+ emStrongLDelim: et,
5603
+ emStrongRDelimAst: st,
5604
+ emStrongRDelimUnd: lt,
5605
+ escape: Fe,
5606
+ link: bt,
5607
+ nolink: Tt,
5608
+ punctuation: Xe,
5609
+ reflink: Rt,
5610
+ reflinkSearch: wt,
5611
+ tag: xt,
5612
+ text: Ke,
5613
+ url: M
5286
5614
  };
5287
- var Tt = {
5288
- ...ne,
5289
- emStrongLDelim: Ye,
5290
- emStrongRDelimAst: rt,
5291
- emStrongRDelimUnd: ot,
5292
- link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", U).getRegex(),
5293
- reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", U).getRegex()
5615
+ var St = {
5616
+ ...se,
5617
+ emStrongLDelim: rt,
5618
+ emStrongRDelimAst: at,
5619
+ emStrongRDelimUnd: pt,
5620
+ link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", K).getRegex(),
5621
+ reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", K).getRegex()
5294
5622
  };
5295
- var X = {
5296
- ...ne,
5297
- emStrongRDelimAst: tt,
5298
- emStrongLDelim: Je,
5299
- delLDelim: at,
5300
- delRDelim: ut,
5301
- url: h(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", Rt).replace("protocol", pe).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
5623
+ var J = {
5624
+ ...se,
5625
+ emStrongRDelimAst: it,
5626
+ emStrongLDelim: tt,
5627
+ delLDelim: ct,
5628
+ delRDelim: dt,
5629
+ url: h(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", yt).replace("protocol", ge).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
5302
5630
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
5303
5631
  del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
5304
- text: h(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", pe).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
5632
+ text: h(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", ge).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
5305
5633
  };
5306
- var Ot = {
5307
- ...X,
5308
- br: h(ke).replace("{2,}", "*").getRegex(),
5309
- text: h(X.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
5634
+ var _t = {
5635
+ ...J,
5636
+ br: h(be).replace("{2,}", "*").getRegex(),
5637
+ text: h(J.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
5310
5638
  };
5311
- var j = {
5312
- normal: te,
5313
- gfm: Ze,
5314
- pedantic: He
5639
+ var F = {
5640
+ normal: re,
5641
+ gfm: Qe,
5642
+ pedantic: je
5315
5643
  };
5316
- var D = {
5317
- normal: ne,
5318
- gfm: X,
5319
- breaks: Ot,
5320
- pedantic: Tt
5644
+ var Z = {
5645
+ normal: se,
5646
+ gfm: J,
5647
+ breaks: _t,
5648
+ pedantic: St
5321
5649
  };
5322
- var wt = {
5650
+ var $t = {
5323
5651
  "&": "&amp;",
5324
5652
  "<": "&lt;",
5325
5653
  ">": "&gt;",
5326
5654
  "\"": "&quot;",
5327
5655
  "'": "&#39;"
5328
5656
  };
5329
- var be = (l) => wt[l];
5330
- function O(l, e) {
5657
+ var Pe = (a) => $t[a];
5658
+ function w(a, e) {
5331
5659
  if (e) {
5332
- if (x.escapeTest.test(l)) return l.replace(x.escapeReplace, be);
5333
- } else if (x.escapeTestNoEncode.test(l)) return l.replace(x.escapeReplaceNoEncode, be);
5334
- return l;
5335
- }
5336
- function Re(l) {
5337
- return l.replace(x.numericCharacterReference, (e, t, n) => {
5338
- let s = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
5339
- return s === 0 || s > 1114111 || s >= 55296 && s <= 57343 ? "�" : String.fromCodePoint(s);
5340
- });
5341
- }
5342
- function re(l) {
5660
+ if (x.escapeTest.test(a)) return a.replace(x.escapeReplace, Pe);
5661
+ } else if (x.escapeTestNoEncode.test(a)) return a.replace(x.escapeReplaceNoEncode, Pe);
5662
+ return a;
5663
+ }
5664
+ function ye(a) {
5665
+ return x.numericCharacterReference.test(a) ? a.replace(x.numericCharacterReferenceOrAmpersand, (e, t, n) => {
5666
+ if (t === void 0 && n === void 0) return "&amp;";
5667
+ let i = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
5668
+ return i === 0 || i > 1114111 || i >= 55296 && i <= 57343 ? "�" : i === 38 ? "&amp;" : String.fromCodePoint(i);
5669
+ }) : a;
5670
+ }
5671
+ function ie(a) {
5343
5672
  try {
5344
- l = encodeURI(l).replace(x.percentDecode, "%");
5673
+ a = encodeURI(a).replace(x.percentDecode, "%");
5345
5674
  } catch {
5346
5675
  return null;
5347
5676
  }
5348
- return l;
5677
+ return a;
5349
5678
  }
5350
- function se(l, e) {
5351
- let n = l.replace(x.findPipe, (r, o, i) => {
5352
- let u = !1, a = o;
5353
- for (; --a >= 0 && i[a] === "\\";) u = !u;
5354
- return u ? "|" : " |";
5355
- }).split(x.splitPipe), s = 0;
5679
+ function oe(a, e) {
5680
+ let n = a.replace(x.findPipe, (r, o, s) => {
5681
+ let l = !1, u = o;
5682
+ for (; --u >= 0 && s[u] === "\\";) l = !l;
5683
+ return l ? "|" : " |";
5684
+ }).split(x.splitPipe), i = 0;
5356
5685
  if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e);
5357
5686
  else for (; n.length < e;) n.push("");
5358
- for (; s < n.length; s++) n[s] = n[s].trim().replace(x.slashPipe, "|");
5687
+ for (; i < n.length; i++) n[i] = n[i].trim().replace(x.slashPipe, "|");
5359
5688
  return n;
5360
5689
  }
5361
- function L(l, e, t) {
5362
- let n = l.length;
5690
+ function A(a, e, t) {
5691
+ let n = a.length;
5363
5692
  if (n === 0) return "";
5364
- let s = 0;
5365
- for (; s < n;) {
5366
- let r = l.charAt(n - s - 1);
5367
- if (r === e && !t) s++;
5368
- else if (r !== e && t) s++;
5693
+ let i = 0;
5694
+ for (; i < n;) {
5695
+ let r = a.charAt(n - i - 1);
5696
+ if (r === e && !t) i++;
5697
+ else if (r !== e && t) i++;
5369
5698
  else break;
5370
5699
  }
5371
- return l.slice(0, n - s);
5700
+ return a.slice(0, n - i);
5372
5701
  }
5373
- function ie(l) {
5374
- let e = l.split(`
5702
+ function ae(a) {
5703
+ let e = a.split(`
5375
5704
  `), t = e.length - 1;
5376
5705
  for (; t >= 0 && x.blankLine.test(e[t]);) t--;
5377
- return e.length - t <= 2 ? l : e.slice(0, t + 1).join(`
5706
+ return e.length - t <= 2 ? a : e.slice(0, t + 1).join(`
5378
5707
  `);
5379
5708
  }
5380
- function q(l) {
5381
- return l.trim().toLowerCase().toUpperCase().toLowerCase();
5709
+ function v(a) {
5710
+ return a.trim().toLowerCase().toUpperCase().toLowerCase();
5382
5711
  }
5383
- function Te(l, e) {
5384
- if (l.indexOf(e[1]) === -1) return -1;
5712
+ function le(a, e) {
5713
+ if (a.indexOf(e[0]) === -1 && a.indexOf(e[1]) === -1) return -1;
5385
5714
  let t = 0;
5386
- for (let n = 0; n < l.length; n++) if (l[n] === "\\") n++;
5387
- else if (l[n] === e[0]) t++;
5388
- else if (l[n] === e[1] && (t--, t < 0)) return n;
5715
+ for (let n = 0; n < a.length; n++) if (a[n] === "\\") n++;
5716
+ else if (a[n] === e[0]) t++;
5717
+ else if (a[n] === e[1] && (t--, t < 0)) return n;
5389
5718
  return t > 0 ? -2 : -1;
5390
5719
  }
5391
- function oe(l, e = 0) {
5720
+ function X(a, e = 0) {
5392
5721
  let t = e, n = "";
5393
- for (let s of l) if (s === " ") {
5722
+ for (let i of a) if (i === " ") {
5394
5723
  let r = 4 - t % 4;
5395
5724
  n += " ".repeat(r), t += r;
5396
- } else n += s, t++;
5725
+ } else n += i, t++;
5397
5726
  return n;
5398
5727
  }
5399
- function Oe(l, e, t, n, s) {
5400
- let r = e.href, o = e.title || null, i = l[1].replace(s.other.outputLinkReplace, "$1"), u = l[0].charAt(0) === "!";
5401
- n.state.inLink = !0;
5402
- let a = n.state.linkEmitted, p = n.state.inRawBlock;
5403
- n.state.linkEmitted = !1;
5404
- let c = n.inlineTokens(i), d = n.state.linkEmitted;
5405
- if (n.state.linkEmitted = a, n.state.inLink = !1, !u) {
5406
- if (d) {
5728
+ function Se(a, e, t, n, i) {
5729
+ let r = e.href, o = e.title || null, s = a[1].replace(i.other.outputLinkReplace, "$1"), l = a[0].charAt(0) === "!", u = n.state.inLink, c = n.state.linkEmitted, p = n.state.inRawBlock;
5730
+ n.state.inLink = !0, n.state.linkEmitted = !1;
5731
+ let d = n.inlineTokens(s), g = n.state.linkEmitted;
5732
+ if (n.state.linkEmitted = c, n.state.inLink = u, !l) {
5733
+ if (g) {
5407
5734
  n.state.inRawBlock = p;
5408
5735
  return;
5409
5736
  }
5410
5737
  n.state.linkEmitted = !0;
5411
5738
  }
5412
5739
  return {
5413
- type: u ? "image" : "link",
5740
+ type: l ? "image" : "link",
5414
5741
  raw: t,
5415
5742
  href: r,
5416
5743
  title: o,
5417
- text: i,
5418
- tokens: c
5744
+ text: s,
5745
+ tokens: d
5419
5746
  };
5420
5747
  }
5421
- function yt(l, e, t) {
5422
- let n = l.match(t.other.indentCodeCompensation);
5748
+ function Lt(a, e, t) {
5749
+ let n = a.match(t.other.indentCodeCompensation);
5423
5750
  if (n === null) return e;
5424
- let s = n[1];
5751
+ let i = n[1];
5425
5752
  return e.split(`
5426
5753
  `).map((r) => {
5427
5754
  let o = r.match(t.other.beginningSpace);
5428
5755
  if (o === null) return r;
5429
- let [i] = o;
5430
- return r.slice(Math.min(i.length, s.length));
5756
+ let [s] = o;
5757
+ return r.slice(Math.min(s.length, i.length));
5431
5758
  }).join(`
5432
5759
  `);
5433
5760
  }
5434
- function we(l, e, t, n) {
5761
+ function _e(a, e, t, n) {
5435
5762
  if (!e.includes("<")) return !1;
5436
- for (let s = 0; s < e.length; s++) {
5437
- if (e[s] === "\\") {
5438
- s++;
5763
+ for (let i = 0; i < e.length; i++) {
5764
+ if (e[i] === "\\") {
5765
+ i++;
5439
5766
  continue;
5440
5767
  }
5441
- if (e[s] === "`") {
5442
- let i = n.inline.code.exec(e.slice(s));
5443
- if (i) {
5444
- s += i[0].length - 1;
5768
+ if (e[i] === "`") {
5769
+ let s = n.inline.code.exec(e.slice(i));
5770
+ if (s) {
5771
+ i += s[0].length - 1;
5445
5772
  continue;
5446
5773
  }
5447
5774
  }
5448
- if (e[s] !== "<") continue;
5449
- let r = l.slice(t + s), o = n.inline.tag.exec(r) || n.inline.autolink.exec(r);
5775
+ if (e[i] !== "<") continue;
5776
+ let r = a.slice(t + i), o = n.inline.tag.exec(r) || n.inline.autolink.exec(r);
5450
5777
  if (o) {
5451
- if (o[0].length > e.length - s) return !0;
5452
- s += o[0].length - 1;
5778
+ if (o[0].length > e.length - i) return !0;
5779
+ i += o[0].length - 1;
5453
5780
  }
5454
5781
  }
5455
5782
  return !1;
5456
5783
  }
5457
- var P = class {
5784
+ var _ = class {
5458
5785
  options;
5459
5786
  rules;
5460
5787
  lexer;
@@ -5471,7 +5798,7 @@ window.__ModuleLoader__.load({
5471
5798
  code(e) {
5472
5799
  let t = this.rules.block.code.exec(e);
5473
5800
  if (t) {
5474
- let n = this.options.pedantic ? t[0] : ie(t[0]);
5801
+ let n = this.options.pedantic ? t[0] : ae(t[0]);
5475
5802
  return {
5476
5803
  type: "code",
5477
5804
  raw: n,
@@ -5483,12 +5810,12 @@ window.__ModuleLoader__.load({
5483
5810
  fences(e) {
5484
5811
  let t = this.rules.block.fences.exec(e);
5485
5812
  if (t) {
5486
- let n = t[0], s = yt(n, t[3] || "", this.rules);
5813
+ let n = t[0], i = Lt(n, t[3] || "", this.rules);
5487
5814
  return {
5488
5815
  type: "code",
5489
5816
  raw: n,
5490
5817
  lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
5491
- text: s
5818
+ text: i
5492
5819
  };
5493
5820
  }
5494
5821
  }
@@ -5497,12 +5824,12 @@ window.__ModuleLoader__.load({
5497
5824
  if (t) {
5498
5825
  let n = t[2].trim();
5499
5826
  if (this.rules.other.endingHash.test(n)) {
5500
- let s = L(n, "#");
5501
- (this.options.pedantic || !s || this.rules.other.endingSpaceTabChar.test(s)) && (n = s.trim());
5827
+ let i = A(n, "#");
5828
+ (this.options.pedantic || !i || this.rules.other.endingSpaceTabChar.test(i)) && (n = i.trim());
5502
5829
  }
5503
5830
  return {
5504
5831
  type: "heading",
5505
- raw: L(t[0], `
5832
+ raw: A(t[0], `
5506
5833
  `),
5507
5834
  depth: t[1].length,
5508
5835
  text: n,
@@ -5514,55 +5841,55 @@ window.__ModuleLoader__.load({
5514
5841
  let t = this.rules.block.hr.exec(e);
5515
5842
  if (t) return {
5516
5843
  type: "hr",
5517
- raw: L(t[0], `
5844
+ raw: A(t[0], `
5518
5845
  `)
5519
5846
  };
5520
5847
  }
5521
5848
  blockquote(e) {
5522
5849
  let t = this.rules.block.blockquote.exec(e);
5523
5850
  if (t) {
5524
- let n = L(t[0], `
5851
+ let n = A(t[0], `
5525
5852
  `).split(`
5526
- `), s = "", r = "", o = [];
5853
+ `), i = "", r = "", o = [];
5527
5854
  for (; n.length > 0;) {
5528
- let i = !1, u = [], a;
5529
- for (a = 0; a < n.length; a++) if (this.rules.other.blockquoteStart.test(n[a])) u.push(n[a]), i = !0;
5530
- else if (!i) u.push(n[a]);
5855
+ let s = !1, l = [], u;
5856
+ for (u = 0; u < n.length; u++) if (this.rules.other.blockquoteStart.test(n[u])) l.push(n[u]), s = !0;
5857
+ else if (!s) l.push(n[u]);
5531
5858
  else break;
5532
- n = n.slice(a);
5533
- let p = u.join(`
5534
- `), c = p.replace(this.rules.other.blockquoteSetextReplace, `
5859
+ n = n.slice(u);
5860
+ let c = l.join(`
5861
+ `), p = c.replace(this.rules.other.blockquoteSetextReplace, `
5535
5862
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
5536
- s = s ? `${s}
5537
- ${p}` : p, r = r ? `${r}
5538
- ${c}` : c;
5863
+ i = i ? `${i}
5864
+ ${c}` : c, r = r ? `${r}
5865
+ ${p}` : p;
5539
5866
  let d = this.lexer.state.top;
5540
- if (this.lexer.state.top = !0, this.lexer.blockTokens(c, o, !0), this.lexer.state.top = d, n.length === 0) break;
5541
- let m = o.at(-1);
5542
- if (m?.type === "code") break;
5543
- if (m?.type === "blockquote") {
5544
- let b = m, g = n.join(`
5545
- `), w = b.raw + `
5546
- ` + g.replace(this.rules.other.blockquoteSetextReplace2, ""), f = this.blockquote(w);
5547
- o[o.length - 1] = f;
5548
- let M = w.substring(f.raw.length).replace(/^\n/, ""), v = M ? M.split(`
5549
- `).length : 0, Z = v ? n.slice(0, -v) : n;
5550
- Z.length > 0 && (s = `${s}
5551
- ${Z.join(`
5552
- `)}`), r = r.substring(0, r.length - b.text.length) + f.text;
5867
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(p, o, !0), this.lexer.state.top = d, n.length === 0) break;
5868
+ let g = o.at(-1);
5869
+ if (g?.type === "code" || g?.type === "heading" || g?.type === "hr" || g?.type === "html") break;
5870
+ if (g?.type === "blockquote") {
5871
+ let k = g, P = n.join(`
5872
+ `), R = k.raw + `
5873
+ ` + P.replace(this.rules.other.blockquoteSetextReplace2, ""), m = this.blockquote(R);
5874
+ o[o.length - 1] = m;
5875
+ let E = R.substring(m.raw.length).replace(/^\n/, ""), b = E ? E.split(`
5876
+ `).length : 0, H = b ? n.slice(0, -b) : n;
5877
+ H.length > 0 && (i = `${i}
5878
+ ${H.join(`
5879
+ `)}`), r = r.substring(0, r.length - k.text.length) + m.text;
5553
5880
  break;
5554
- } else if (m?.type === "list") {
5555
- let b = m, g = b.raw + `
5881
+ } else if (g?.type === "list") {
5882
+ let k = g, P = k.raw + `
5556
5883
  ` + n.join(`
5557
- `), w = this.list(g);
5558
- o[o.length - 1] = w, s = s.substring(0, s.length - m.raw.length) + w.raw, r = r.substring(0, r.length - b.raw.length) + w.raw, n = g.substring(o.at(-1).raw.length).split(`
5884
+ `), R = this.list(P);
5885
+ o[o.length - 1] = R, i = i.substring(0, i.length - g.raw.length) + R.raw, r = r.substring(0, r.length - k.raw.length) + R.raw, n = P.substring(o.at(-1).raw.length).split(`
5559
5886
  `);
5560
5887
  continue;
5561
5888
  }
5562
5889
  }
5563
5890
  return {
5564
5891
  type: "blockquote",
5565
- raw: s,
5892
+ raw: i,
5566
5893
  tokens: o,
5567
5894
  text: r
5568
5895
  };
@@ -5571,93 +5898,93 @@ ${Z.join(`
5571
5898
  list(e) {
5572
5899
  let t = this.rules.block.list.exec(e);
5573
5900
  if (t) {
5574
- let n = t[1].trim(), s = n.length > 1, r = {
5901
+ let n = e, i = () => n.length - e.length, r = t[1].trim(), o = r.length > 1, s = {
5575
5902
  type: "list",
5576
5903
  raw: "",
5577
- ordered: s,
5578
- start: s ? +n.slice(0, -1) : "",
5904
+ ordered: o,
5905
+ start: o ? +r.slice(0, -1) : "",
5579
5906
  loose: !1,
5580
5907
  items: []
5581
5908
  };
5582
- n = s ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = s ? n : "[*+-]");
5583
- let o = this.rules.other.listItemRegex(n), i = !1;
5909
+ r = o ? `\\d{1,9}\\${r.slice(-1)}` : `\\${r}`, this.options.pedantic && (r = o ? r : "[*+-]");
5910
+ let l = this.rules.other.listItemRegex(r), u = !1;
5584
5911
  for (; e;) {
5585
- let a = !1, p = "", c = "";
5586
- if (!(t = o.exec(e)) || this.rules.block.hr.test(e)) break;
5587
- p = t[0], e = e.substring(p.length);
5588
- let d = t[2].split(`
5589
- `, 1)[0], m = t[1].length, b = this.options.pedantic ? oe(d, m) : d.replace(this.rules.other.leadingSpaceTab, (M) => oe(M, m)), g = e.split(`
5590
- `, 1)[0], w = !b.trim(), f = 0;
5591
- if (this.options.pedantic ? (f = 2, c = b.trimStart()) : w ? f = m + 1 : (f = b.search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, c = b.slice(f), f += m), w && this.rules.other.blankLine.test(g) && (p += g + `
5592
- `, e = e.substring(g.length + 1), a = !0), !a) {
5593
- let M = this.rules.other.nextBulletRegex(f), v = this.rules.other.hrRegex(f), Z = this.rules.other.fencesBeginRegex(f), ae = this.rules.other.headingBeginRegex(f), ye = this.rules.other.htmlBeginRegex(f), Pe = this.rules.other.blockquoteBeginRegex(f);
5912
+ let p = !1, d = "";
5913
+ if (!(t = l.exec(e)) || this.rules.block.hr.test(e)) break;
5914
+ let g = i();
5915
+ e = e.substring(t[0].length);
5916
+ let k = t[2].split(`
5917
+ `, 1)[0], P = t[1].length, R = this.options.pedantic ? X(k, P) : k.replace(this.rules.other.leadingSpaceTab, (W) => X(W, P)), m = e.split(`
5918
+ `, 1)[0], E = !R.trim(), b = 0;
5919
+ if (this.options.pedantic ? (b = 2, d = R.trimStart()) : E ? b = P + 1 : (b = R.search(this.rules.other.nonSpaceChar), b = b > 4 ? 1 : b, d = R.slice(b), b += P), E && this.rules.other.blankLine.test(m) && (e = e.substring(m.length + 1), p = !0), !p) {
5920
+ let W = this.rules.other.nextBulletRegex(b), ue = this.rules.other.hrRegex(b), pe = this.rules.other.fencesBeginRegex(b), ce = this.rules.other.headingBeginRegex(b), $e = this.rules.other.htmlBeginRegex(b), Le = this.rules.other.blockquoteBeginRegex(b);
5594
5921
  for (; e;) {
5595
- let K = e.split(`
5596
- `, 1)[0], H;
5597
- if (g = K, this.options.pedantic ? (g = g.replace(this.rules.other.listReplaceNesting, " "), H = g) : H = g.replace(this.rules.other.leadingSpaceTab, (Se) => Se.replace(this.rules.other.tabCharGlobal, " ")), Z.test(g) || ae.test(g) || ye.test(g) || Pe.test(g) || M.test(g) || v.test(g)) break;
5598
- if (H.search(this.rules.other.nonSpaceChar) >= f || !g.trim()) c += `
5599
- ` + H.slice(f);
5922
+ let he = e.split(`
5923
+ `, 1)[0], G;
5924
+ if (m = he, this.options.pedantic ? (m = m.replace(this.rules.other.listReplaceNesting, " "), G = m) : G = m.replace(this.rules.other.leadingSpaceTab, (Ae) => X(Ae)), pe.test(m) || ce.test(m) || $e.test(m) || Le.test(m) || W.test(m) || ue.test(m)) break;
5925
+ if (G.search(this.rules.other.nonSpaceChar) >= b || !m.trim()) d += `
5926
+ ` + G.slice(b);
5600
5927
  else {
5601
- if (w || b.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || Z.test(b) || ae.test(b) || v.test(b)) break;
5602
- c += `
5603
- ` + g;
5928
+ if (E || R.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || pe.test(R) || ce.test(R) || ue.test(R)) break;
5929
+ d += `
5930
+ ` + m;
5604
5931
  }
5605
- w = !g.trim(), p += K + `
5606
- `, e = e.substring(K.length + 1), b = H.slice(f);
5932
+ E = !m.trim(), e = e.substring(he.length + 1), R = G.slice(b);
5607
5933
  }
5608
5934
  }
5609
- r.loose || (i ? r.loose = !0 : this.rules.other.doubleBlankLine.test(p) && (i = !0)), r.items.push({
5935
+ let H = n.slice(g, i());
5936
+ s.loose || (u ? s.loose = !0 : this.rules.other.doubleBlankLine.test(H) && (u = !0)), s.items.push({
5610
5937
  type: "list_item",
5611
- raw: p,
5612
- task: !!this.options.gfm && this.rules.other.listIsTask.test(c),
5938
+ raw: H,
5939
+ task: !!this.options.gfm && this.rules.other.listIsTask.test(d),
5613
5940
  loose: !1,
5614
- text: c,
5941
+ text: d,
5615
5942
  tokens: []
5616
- }), r.raw += p;
5943
+ });
5617
5944
  }
5618
- let u = r.items.at(-1);
5619
- if (u) u.raw = u.raw.trimEnd(), u.text = u.text.trimEnd();
5945
+ let c = s.items.at(-1);
5946
+ if (c) c.raw = c.raw.trimEnd(), c.text = c.text.trimEnd();
5620
5947
  else return;
5621
- r.raw = r.raw.trimEnd();
5622
- for (let a of r.items) if (this.lexer.state.top = !1, a.tokens = this.lexer.blockTokens(a.text, []), !r.loose) {
5623
- let p = a.tokens.filter((d) => d.type === "space");
5624
- r.loose = p.length > 0 && p.some((d) => this.rules.other.anyLine.test(d.raw));
5948
+ s.raw = n.slice(0, i()).trimEnd();
5949
+ for (let p of s.items) if (this.lexer.state.top = !1, p.tokens = this.lexer.blockTokens(p.text, []), !s.loose) {
5950
+ let d = p.tokens.filter((k) => k.type === "space");
5951
+ s.loose = d.length > 0 && d.some((k) => this.rules.other.anyLine.test(k.raw));
5625
5952
  }
5626
- for (let a of r.items) {
5627
- let p = a.tokens[0];
5628
- if (a.task && (p?.type === "text" || p?.type === "paragraph")) {
5629
- a.text = a.text.replace(this.rules.other.listReplaceTask, ""), p.raw = p.raw.replace(this.rules.other.listReplaceTask, ""), p.text = p.text.replace(this.rules.other.listReplaceTask, "");
5630
- for (let d = this.lexer.inlineQueue.length - 1; d >= 0; d--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)) {
5631
- this.lexer.inlineQueue[d].src = this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask, "");
5953
+ for (let p of s.items) {
5954
+ let d = p.tokens[0];
5955
+ if (p.task && (d?.type === "text" || d?.type === "paragraph")) {
5956
+ p.text = p.text.replace(this.rules.other.listReplaceTask, ""), d.raw = d.raw.replace(this.rules.other.listReplaceTask, ""), d.text = d.text.replace(this.rules.other.listReplaceTask, "");
5957
+ for (let k = this.lexer.inlineQueue.length - 1; k >= 0; k--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[k].src)) {
5958
+ this.lexer.inlineQueue[k].src = this.lexer.inlineQueue[k].src.replace(this.rules.other.listReplaceTask, "");
5632
5959
  break;
5633
5960
  }
5634
- let c = this.rules.other.listTaskCheckbox.exec(a.raw);
5635
- if (c) {
5636
- let d = {
5961
+ let g = this.rules.other.listTaskCheckbox.exec(p.raw);
5962
+ if (g) {
5963
+ let k = {
5637
5964
  type: "checkbox",
5638
- raw: c[0] + " ",
5639
- checked: c[0] !== "[ ]"
5965
+ raw: g[0] + " ",
5966
+ checked: g[0] !== "[ ]"
5640
5967
  };
5641
- a.checked = d.checked, r.loose ? a.tokens[0] && ["paragraph", "text"].includes(a.tokens[0].type) && "tokens" in a.tokens[0] && a.tokens[0].tokens ? (a.tokens[0].raw = d.raw + a.tokens[0].raw, a.tokens[0].text = d.raw + a.tokens[0].text, a.tokens[0].tokens.unshift(d)) : a.tokens.unshift({
5968
+ p.checked = k.checked, s.loose ? p.tokens[0] && ["paragraph", "text"].includes(p.tokens[0].type) && "tokens" in p.tokens[0] && p.tokens[0].tokens ? (p.tokens[0].raw = k.raw + p.tokens[0].raw, p.tokens[0].text = k.raw + p.tokens[0].text, p.tokens[0].tokens.unshift(k)) : p.tokens.unshift({
5642
5969
  type: "paragraph",
5643
- raw: d.raw,
5644
- text: d.raw,
5645
- tokens: [d]
5646
- }) : a.tokens.unshift(d);
5970
+ raw: k.raw,
5971
+ text: k.raw,
5972
+ tokens: [k]
5973
+ }) : p.tokens.unshift(k);
5647
5974
  }
5648
- } else a.task && (a.task = !1);
5975
+ } else p.task && (p.task = !1);
5649
5976
  }
5650
- if (r.loose) for (let a of r.items) {
5651
- a.loose = !0;
5652
- for (let p of a.tokens) p.type === "text" && (p.type = "paragraph");
5977
+ if (s.loose) for (let p of s.items) {
5978
+ p.loose = !0;
5979
+ for (let d of p.tokens) d.type === "text" && (d.type = "paragraph");
5653
5980
  }
5654
- return r;
5981
+ return s;
5655
5982
  }
5656
5983
  }
5657
5984
  html(e) {
5658
5985
  let t = this.rules.block.html.exec(e);
5659
5986
  if (t) {
5660
- let n = ie(t[0]);
5987
+ let n = ae(t[0]);
5661
5988
  return {
5662
5989
  type: "html",
5663
5990
  block: !0,
@@ -5670,13 +5997,14 @@ ${Z.join(`
5670
5997
  def(e) {
5671
5998
  let t = this.rules.block.def.exec(e);
5672
5999
  if (t) {
5673
- let n = q(t[1]).replace(this.rules.other.multipleSpaceGlobal, " "), s = 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];
6000
+ if (!this.rules.other.startAngleBracket.test(t[2]) && le(t[2], "()") !== -1) return;
6001
+ let n = v(t[1]).replace(this.rules.other.multipleSpaceGlobal, " "), i = 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];
5674
6002
  return {
5675
6003
  type: "def",
5676
6004
  tag: n,
5677
- raw: L(t[0], `
6005
+ raw: A(t[0], `
5678
6006
  `),
5679
- href: s,
6007
+ href: i,
5680
6008
  title: r
5681
6009
  };
5682
6010
  }
@@ -5684,28 +6012,28 @@ ${Z.join(`
5684
6012
  table(e) {
5685
6013
  let t = this.rules.block.table.exec(e);
5686
6014
  if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
5687
- let n = se(t[1]), s = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), r = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
6015
+ let n = oe(t[1]), i = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), r = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split(`
5688
6016
  `) : [], o = {
5689
6017
  type: "table",
5690
- raw: L(t[0], `
6018
+ raw: A(t[0], `
5691
6019
  `),
5692
6020
  header: [],
5693
6021
  align: [],
5694
6022
  rows: []
5695
6023
  };
5696
- if (n.length === s.length) {
5697
- for (let i of s) this.rules.other.tableAlignRight.test(i) ? o.align.push("right") : this.rules.other.tableAlignCenter.test(i) ? o.align.push("center") : this.rules.other.tableAlignLeft.test(i) ? o.align.push("left") : o.align.push(null);
5698
- for (let i = 0; i < n.length; i++) o.header.push({
5699
- text: n[i],
5700
- tokens: this.lexer.inline(n[i]),
6024
+ if (n.length === i.length) {
6025
+ for (let s of i) this.rules.other.tableAlignRight.test(s) ? o.align.push("right") : this.rules.other.tableAlignCenter.test(s) ? o.align.push("center") : this.rules.other.tableAlignLeft.test(s) ? o.align.push("left") : o.align.push(null);
6026
+ for (let s = 0; s < n.length; s++) o.header.push({
6027
+ text: n[s],
6028
+ tokens: this.lexer.inline(n[s]),
5701
6029
  header: !0,
5702
- align: o.align[i]
6030
+ align: o.align[s]
5703
6031
  });
5704
- for (let i of r) o.rows.push(se(i, o.header.length).map((u, a) => ({
5705
- text: u,
5706
- tokens: this.lexer.inline(u),
6032
+ for (let s of r) o.rows.push(oe(s, o.header.length).map((l, u) => ({
6033
+ text: l,
6034
+ tokens: this.lexer.inline(l),
5707
6035
  header: !1,
5708
- align: o.align[a]
6036
+ align: o.align[u]
5709
6037
  })));
5710
6038
  return o;
5711
6039
  }
@@ -5716,7 +6044,7 @@ ${Z.join(`
5716
6044
  let n = t[1].trim();
5717
6045
  return {
5718
6046
  type: "heading",
5719
- raw: L(t[0], `
6047
+ raw: A(t[0], `
5720
6048
  `),
5721
6049
  depth: t[2].charAt(0) === "=" ? 1 : 2,
5722
6050
  text: n,
@@ -5766,29 +6094,30 @@ ${Z.join(`
5766
6094
  };
5767
6095
  }
5768
6096
  link(e) {
6097
+ if (this.lexer.state.linkParenPossible === !1) return;
5769
6098
  let t = this.rules.inline.link.exec(e);
5770
6099
  if (t) {
5771
6100
  let n = t[0].charAt(0) === "!" ? 2 : 1;
5772
- if (!this.options.pedantic && we(e, t[1], n, this.rules)) return;
5773
- let s = t[2].trim();
5774
- if (!this.options.pedantic && this.rules.other.startAngleBracket.test(s)) {
5775
- if (!this.rules.other.endAngleBracket.test(s)) return;
5776
- let i = L(s.slice(0, -1), "\\");
5777
- if ((s.length - i.length) % 2 === 0) return;
6101
+ if (!this.options.pedantic && _e(e, t[1], n, this.rules)) return;
6102
+ let i = t[2].trim();
6103
+ if (!this.options.pedantic && this.rules.other.startAngleBracket.test(i)) {
6104
+ if (!this.rules.other.endAngleBracket.test(i)) return;
6105
+ let s = A(i.slice(0, -1), "\\");
6106
+ if ((i.length - s.length) % 2 === 0) return;
5778
6107
  } else {
5779
- let i = Te(t[2], "()");
5780
- if (i === -2) return;
5781
- if (i > -1) {
5782
- let a = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + i;
5783
- t[2] = t[2].substring(0, i), t[0] = t[0].substring(0, a).trim(), t[3] = "";
6108
+ let s = le(t[2], "()");
6109
+ if (s === -2) return;
6110
+ if (s > -1) {
6111
+ let u = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
6112
+ t[2] = t[2].substring(0, s), t[0] = t[0].substring(0, u).trim(), t[3] = "";
5784
6113
  }
5785
6114
  }
5786
6115
  let r = t[2], o = "";
5787
6116
  if (this.options.pedantic) {
5788
- let i = this.rules.other.pedanticHrefTitle.exec(r);
5789
- i && (r = i[1], o = i[3]);
6117
+ let s = this.rules.other.pedanticHrefTitle.exec(r);
6118
+ s && (r = s[1], o = s[3]);
5790
6119
  } else o = t[3] ? t[3].slice(1, -1) : "";
5791
- return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(s) ? r = r.slice(1) : r = r.slice(1, -1)), Oe(t, {
6120
+ return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(i) ? r = r.slice(1) : r = r.slice(1, -1)), Se(t, {
5792
6121
  href: r && r.replace(this.rules.inline.anyPunctuation, "$1"),
5793
6122
  title: o && o.replace(this.rules.inline.anyPunctuation, "$1")
5794
6123
  }, t[0], this.lexer, this.rules);
@@ -5797,55 +6126,55 @@ ${Z.join(`
5797
6126
  reflink(e, t) {
5798
6127
  let n;
5799
6128
  if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
5800
- let s = n[0].charAt(0) === "!" ? 2 : 1;
5801
- if (!this.options.pedantic && we(e, n[1], s, this.rules)) return;
5802
- let o = t[q((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
6129
+ let i = n[0].charAt(0) === "!" ? 2 : 1;
6130
+ if (!this.options.pedantic && _e(e, n[1], i, this.rules)) return;
6131
+ let o = t[v((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
5803
6132
  if (!o) {
5804
- let i = n[0].charAt(0);
6133
+ let s = n[0].charAt(0);
5805
6134
  return {
5806
6135
  type: "text",
5807
- raw: i,
5808
- text: i
6136
+ raw: s,
6137
+ text: s
5809
6138
  };
5810
6139
  }
5811
- return Oe(n, o, n[0], this.lexer, this.rules);
6140
+ return Se(n, o, n[0], this.lexer, this.rules);
5812
6141
  }
5813
6142
  }
5814
6143
  emStrong(e, t, n = "") {
5815
- let s = this.rules.inline.emStrongLDelim.exec(e);
5816
- if (!s || !s[1] && !s[2] && !s[3] && !s[4] || s[4] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
5817
- if (!(s[1] || s[3] || "") || !n || this.rules.inline.punctuation.exec(n)) {
5818
- let o = [...s[0]].length - 1, i, u, a = o, p = 0, c = s[0][0], d = n === c, m = c === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
5819
- for (m.lastIndex = 0, t = t.slice(-1 * e.length + o); (s = m.exec(t)) !== null;) {
5820
- if (i = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !i) continue;
5821
- if (u = [...i].length, s[3] || s[4]) {
5822
- a += u;
6144
+ let i = this.rules.inline.emStrongLDelim.exec(e);
6145
+ if (!i || !i[1] && !i[2] && !i[3] && !i[4] || i[4] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
6146
+ if (!(i[1] || i[3] || "") || !n || this.rules.inline.punctuation.exec(n)) {
6147
+ let o = [...i[0]].length - 1, s, l, u = o, c = 0, p = i[0][0], d = n === p, g = p === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
6148
+ for (g.lastIndex = 0, t = t.slice(-1 * e.length + o); (i = g.exec(t)) !== null;) {
6149
+ if (s = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !s) continue;
6150
+ if (l = [...s].length, i[3] || i[4]) {
6151
+ u += l;
5823
6152
  continue;
5824
- } else if (s[5] || s[6]) {
5825
- if (o % 3 && !((o + u) % 3)) {
5826
- p += u;
6153
+ } else if (i[5] || i[6]) {
6154
+ if (o % 3 && !((o + l) % 3)) {
6155
+ c += l;
5827
6156
  continue;
5828
6157
  }
5829
6158
  if (d) break;
5830
6159
  }
5831
- if (a -= u, a > 0) continue;
5832
- u = Math.min(u, u + a + p);
5833
- let b = [...s[0]][0].length, g = e.slice(0, o + s.index + b + u);
5834
- if (Math.min(o, u) % 2) {
5835
- let f = g.slice(1, -1);
6160
+ if (u -= l, u > 0) continue;
6161
+ l = Math.min(l, l + u + c);
6162
+ let k = [...i[0]][0].length, P = e.slice(0, o + i.index + k + l);
6163
+ if (Math.min(o, l) % 2) {
6164
+ let m = P.slice(1, -1);
5836
6165
  return {
5837
6166
  type: "em",
5838
- raw: g,
5839
- text: f,
5840
- tokens: this.lexer.inlineTokens(f)
6167
+ raw: P,
6168
+ text: m,
6169
+ tokens: this.lexer.inlineTokens(m)
5841
6170
  };
5842
6171
  }
5843
- let w = g.slice(2, -2);
6172
+ let R = P.slice(2, -2);
5844
6173
  return {
5845
6174
  type: "strong",
5846
- raw: g,
5847
- text: w,
5848
- tokens: this.lexer.inlineTokens(w)
6175
+ raw: P,
6176
+ text: R,
6177
+ tokens: this.lexer.inlineTokens(R)
5849
6178
  };
5850
6179
  }
5851
6180
  }
@@ -5853,8 +6182,8 @@ ${Z.join(`
5853
6182
  codespan(e) {
5854
6183
  let t = this.rules.inline.code.exec(e);
5855
6184
  if (t) {
5856
- let n = t[2].replace(this.rules.other.newLineCharGlobal, " "), s = this.rules.other.nonSpaceChar.test(n), r = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
5857
- return s && r && (n = n.substring(1, n.length - 1)), {
6185
+ let n = t[2].replace(this.rules.other.newLineCharGlobal, " "), i = this.rules.other.nonSpaceChar.test(n), r = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
6186
+ return i && r && (n = n.substring(1, n.length - 1)), {
5858
6187
  type: "codespan",
5859
6188
  raw: t[0],
5860
6189
  text: n
@@ -5869,24 +6198,24 @@ ${Z.join(`
5869
6198
  };
5870
6199
  }
5871
6200
  del(e, t, n = "") {
5872
- let s = this.rules.inline.delLDelim.exec(e);
5873
- if (!s) return;
5874
- if (!(s[1] || "") || !n || this.rules.inline.punctuation.exec(n)) {
5875
- let o = [...s[0]].length - 1, i, u, a = o, p = this.rules.inline.delRDelim;
5876
- for (p.lastIndex = 0, t = t.slice(-1 * e.length + o); (s = p.exec(t)) !== null;) {
5877
- if (i = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !i || (u = [...i].length, u !== o)) continue;
5878
- if (s[3] || s[4]) {
5879
- a += u;
6201
+ let i = this.rules.inline.delLDelim.exec(e);
6202
+ if (!i) return;
6203
+ if (!(i[1] || "") || !n || this.rules.inline.punctuation.exec(n)) {
6204
+ let o = [...i[0]].length - 1, s, l, u = o, c = this.rules.inline.delRDelim;
6205
+ for (c.lastIndex = 0, t = t.slice(-1 * e.length + o); (i = c.exec(t)) !== null;) {
6206
+ if (s = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !s || (l = [...s].length, l !== o)) continue;
6207
+ if (i[3] || i[4]) {
6208
+ u += l;
5880
6209
  continue;
5881
6210
  }
5882
- if (a -= u, a > 0) continue;
5883
- u = Math.min(u, u + a);
5884
- let c = [...s[0]][0].length, d = e.slice(0, o + s.index + c + u), m = d.slice(o, -o);
6211
+ if (u -= l, u > 0) continue;
6212
+ l = Math.min(l, l + u);
6213
+ let p = [...i[0]][0].length, d = e.slice(0, o + i.index + p + l), g = d.slice(o, -o);
5885
6214
  return {
5886
6215
  type: "del",
5887
6216
  raw: d,
5888
- text: m,
5889
- tokens: this.lexer.inlineTokens(m)
6217
+ text: g,
6218
+ tokens: this.lexer.inlineTokens(g)
5890
6219
  };
5891
6220
  }
5892
6221
  }
@@ -5894,12 +6223,12 @@ ${Z.join(`
5894
6223
  autolink(e) {
5895
6224
  let t = this.rules.inline.autolink.exec(e);
5896
6225
  if (t) {
5897
- let n, s;
5898
- return t[2] === "@" ? (n = t[1], s = "mailto:" + n) : (n = t[1], s = n), {
6226
+ let n, i;
6227
+ return t[2] === "@" ? (n = t[1], i = "mailto:" + n) : (n = t[1], i = n), {
5899
6228
  type: "link",
5900
6229
  raw: t[0],
5901
6230
  text: n,
5902
- href: s,
6231
+ href: i,
5903
6232
  autolink: !0,
5904
6233
  tokens: [{
5905
6234
  type: "text",
@@ -5912,20 +6241,20 @@ ${Z.join(`
5912
6241
  url(e) {
5913
6242
  let t;
5914
6243
  if (t = this.rules.inline.url.exec(e)) {
5915
- let n, s;
5916
- if (t[2] === "@") n = t[0], s = "mailto:" + n;
6244
+ let n, i;
6245
+ if (t[2] === "@") n = t[0], i = "mailto:" + n;
5917
6246
  else {
5918
6247
  let r;
5919
6248
  do
5920
6249
  r = t[0], t[0] = this.rules.inline._backpedal.exec(t[0])?.[0] ?? "";
5921
6250
  while (r !== t[0]);
5922
- n = t[0], t[1] === "www." ? s = "http://" + t[0] : s = t[0];
6251
+ n = t[0], t[1] === "www." ? i = "http://" + t[0] : i = t[0];
5923
6252
  }
5924
6253
  return {
5925
6254
  type: "link",
5926
6255
  raw: t[0],
5927
6256
  text: n,
5928
- href: s,
6257
+ href: i,
5929
6258
  autolink: !0,
5930
6259
  tokens: [{
5931
6260
  type: "text",
@@ -5942,43 +6271,44 @@ ${Z.join(`
5942
6271
  return {
5943
6272
  type: "text",
5944
6273
  raw: t[0],
5945
- text: n ? t[0] : Re(t[0]),
6274
+ text: n ? t[0] : ye(t[0]),
5946
6275
  escaped: n
5947
6276
  };
5948
6277
  }
5949
6278
  }
5950
6279
  };
5951
- var R = class l {
6280
+ var T = class a {
5952
6281
  tokens;
5953
6282
  options;
5954
6283
  state;
5955
6284
  inlineQueue;
5956
6285
  tokenizer;
5957
6286
  constructor(e) {
5958
- this.tokens = [], this.tokens.links = Object.create(null), this.options = e || y, this.options.tokenizer = this.options.tokenizer || new P(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
6287
+ this.tokens = [], this.tokens.links = Object.create(null), this.options = e || y, this.options.tokenizer = this.options.tokenizer || new _(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
5959
6288
  inLink: !1,
5960
6289
  inRawBlock: !1,
5961
6290
  linkEmitted: !1,
6291
+ linkParenPossible: !0,
5962
6292
  top: !0
5963
6293
  };
5964
6294
  let t = {
5965
6295
  other: x,
5966
- block: j.normal,
5967
- inline: D.normal
6296
+ block: F.normal,
6297
+ inline: Z.normal
5968
6298
  };
5969
- this.options.pedantic ? (t.block = j.pedantic, t.inline = D.pedantic) : this.options.gfm && (t.block = j.gfm, this.options.breaks ? t.inline = D.breaks : t.inline = D.gfm), this.tokenizer.rules = t;
6299
+ this.options.pedantic ? (t.block = F.pedantic, t.inline = Z.pedantic) : this.options.gfm && (t.block = F.gfm, this.options.breaks ? t.inline = Z.breaks : t.inline = Z.gfm), this.tokenizer.rules = t;
5970
6300
  }
5971
6301
  static get rules() {
5972
6302
  return {
5973
- block: j,
5974
- inline: D
6303
+ block: F,
6304
+ inline: Z
5975
6305
  };
5976
6306
  }
5977
6307
  static lex(e, t) {
5978
- return new l(t).lex(e);
6308
+ return new a(t).lex(e);
5979
6309
  }
5980
6310
  static lexInline(e, t) {
5981
- return new l(t).inlineTokens(e);
6311
+ return new a(t).inlineTokens(e);
5982
6312
  }
5983
6313
  lex(e) {
5984
6314
  e = e.replace(x.carriageReturn, `
@@ -5991,29 +6321,29 @@ ${Z.join(`
5991
6321
  }
5992
6322
  blockTokens(e, t = [], n = !1) {
5993
6323
  this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(x.tabCharGlobal, " ").replace(x.spaceLine, ""));
5994
- let s = Infinity;
6324
+ let i = Infinity;
5995
6325
  for (; e;) {
5996
- if (e.length < s) s = e.length;
6326
+ if (e.length < i) i = e.length;
5997
6327
  else {
5998
6328
  this.infiniteLoopError(e.charCodeAt(0));
5999
6329
  break;
6000
6330
  }
6001
6331
  let r;
6002
- if (this.options.extensions?.block?.some((i) => (r = i.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
6332
+ if (this.options.extensions?.block?.some((s) => (r = s.call({ lexer: this }, e, t)) ? (e = e.substring(r.raw.length), t.push(r), !0) : !1)) continue;
6003
6333
  if (r = this.tokenizer.space(e)) {
6004
6334
  e = e.substring(r.raw.length);
6005
- let i = t.at(-1);
6006
- r.raw.length === 1 && i !== void 0 ? i.raw += `
6335
+ let s = t.at(-1);
6336
+ r.raw.length === 1 && s !== void 0 ? s.raw += `
6007
6337
  ` : t.push(r);
6008
6338
  continue;
6009
6339
  }
6010
6340
  if (r = this.tokenizer.code(e)) {
6011
6341
  e = e.substring(r.raw.length);
6012
- let i = t.at(-1);
6013
- i?.type === "paragraph" || i?.type === "text" ? (i.raw += (i.raw.endsWith(`
6342
+ let s = t.at(-1);
6343
+ s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
6014
6344
  `) ? "" : `
6015
- `) + r.raw, i.text += `
6016
- ` + r.text, this.inlineQueue.at(-1).src = i.text) : t.push(r);
6345
+ `) + r.raw, s.text += `
6346
+ ` + r.text, this.inlineQueue.at(-1).src = s.text) : t.push(r);
6017
6347
  continue;
6018
6348
  }
6019
6349
  if (r = this.tokenizer.fences(e)) {
@@ -6042,11 +6372,11 @@ ${Z.join(`
6042
6372
  }
6043
6373
  if (r = this.tokenizer.def(e)) {
6044
6374
  e = e.substring(r.raw.length);
6045
- let i = t.at(-1);
6046
- i?.type === "paragraph" || i?.type === "text" ? (i.raw += (i.raw.endsWith(`
6375
+ let s = t.at(-1);
6376
+ s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
6047
6377
  `) ? "" : `
6048
- `) + r.raw, i.text += `
6049
- ` + r.raw, this.inlineQueue.at(-1).src = i.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = {
6378
+ `) + r.raw, s.text += `
6379
+ ` + r.raw, this.inlineQueue.at(-1).src = s.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = {
6050
6380
  href: r.href,
6051
6381
  title: r.title
6052
6382
  }, t.push(r));
@@ -6062,26 +6392,26 @@ ${Z.join(`
6062
6392
  }
6063
6393
  let o = e;
6064
6394
  if (this.options.extensions?.startBlock) {
6065
- let i = Infinity, u = e.slice(1), a;
6066
- this.options.extensions.startBlock.forEach((p) => {
6067
- a = p.call({ lexer: this }, u), typeof a == "number" && a >= 0 && (i = Math.min(i, a));
6068
- }), i < Infinity && i >= 0 && (o = e.substring(0, i + 1));
6395
+ let s = Infinity, l = e.slice(1), u;
6396
+ this.options.extensions.startBlock.forEach((c) => {
6397
+ u = c.call({ lexer: this }, l), typeof u == "number" && u >= 0 && (s = Math.min(s, u));
6398
+ }), s < Infinity && s >= 0 && (o = e.substring(0, s + 1));
6069
6399
  }
6070
6400
  if (this.state.top && (r = this.tokenizer.paragraph(o))) {
6071
- let i = t.at(-1);
6072
- n && i?.type === "paragraph" ? (i.raw += (i.raw.endsWith(`
6401
+ let s = t.at(-1);
6402
+ n && s?.type === "paragraph" ? (s.raw += (s.raw.endsWith(`
6073
6403
  `) ? "" : `
6074
- `) + r.raw, i.text += `
6075
- ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = i.text) : t.push(r), n = o.length !== e.length, e = e.substring(r.raw.length);
6404
+ `) + r.raw, s.text += `
6405
+ ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r), n = o.length !== e.length, e = e.substring(r.raw.length);
6076
6406
  continue;
6077
6407
  }
6078
6408
  if (r = this.tokenizer.text(e)) {
6079
6409
  e = e.substring(r.raw.length);
6080
- let i = t.at(-1);
6081
- i?.type === "text" ? (i.raw += (i.raw.endsWith(`
6410
+ let s = t.at(-1);
6411
+ s?.type === "text" ? (s.raw += (s.raw.endsWith(`
6082
6412
  `) ? "" : `
6083
- `) + r.raw, i.text += `
6084
- ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = i.text) : t.push(r);
6413
+ `) + r.raw, s.text += `
6414
+ ` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t.push(r);
6085
6415
  continue;
6086
6416
  }
6087
6417
  if (e) {
@@ -6102,93 +6432,102 @@ ${Z.join(`
6102
6432
  let t = this.tokenizer.rules.inline.link;
6103
6433
  for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t.test(n[0]) && e.charAt(n.index - 1) !== "!") return !0;
6104
6434
  for (let n of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
6105
- let s = n[0], r = s.lastIndexOf("[");
6106
- if (!(s.charAt(0) === "!" || !Object.hasOwn(this.tokens.links, q(s.slice(r + 1, -1)))) && !(r > 1 && this.linkInText(s.slice(1, r - 1)))) return !0;
6435
+ let i = n[0], r = i.lastIndexOf("[");
6436
+ if (!(i.charAt(0) === "!" || !Object.hasOwn(this.tokens.links, v(i.slice(r + 1, -1)))) && !(r > 1 && this.linkInText(i.slice(1, r - 1)))) return !0;
6107
6437
  }
6108
6438
  return !1;
6109
6439
  }
6110
6440
  inlineTokens(e, t = []) {
6111
6441
  this.tokenizer.lexer = this;
6442
+ let n = this.state.linkParenPossible;
6443
+ this.state.linkParenPossible = n && e.includes(")");
6444
+ try {
6445
+ return this.#e(e, t);
6446
+ } finally {
6447
+ this.state.linkParenPossible = n;
6448
+ }
6449
+ }
6450
+ #e(e, t) {
6112
6451
  let n = e;
6113
6452
  if (this.tokens.links && e.includes("[")) {
6114
- let i = this.tokenizer.rules.inline.reflinkSearch, u = (a) => {
6115
- let p = a.lastIndexOf("[");
6116
- if (!Object.hasOwn(this.tokens.links, q(a.slice(p + 1, -1)))) return a;
6117
- if (p > 1 && a.charAt(0) !== "!") {
6118
- let c = a.slice(1, p - 1);
6119
- if (this.linkInText(c)) return "[" + c.replace(i, u) + "][" + "a".repeat(a.length - p - 2) + "]";
6453
+ let s = this.tokenizer.rules.inline.reflinkSearch, l = (u) => {
6454
+ let c = u.lastIndexOf("[");
6455
+ if (!Object.hasOwn(this.tokens.links, v(u.slice(c + 1, -1)))) return u;
6456
+ if (c > 1 && u.charAt(0) !== "!") {
6457
+ let p = u.slice(1, c - 1);
6458
+ if (this.linkInText(p)) return "[" + p.replace(s, l) + "][" + "a".repeat(u.length - c - 2) + "]";
6120
6459
  }
6121
- return "[" + "a".repeat(a.length - 2) + "]";
6460
+ return "[" + "a".repeat(u.length - 2) + "]";
6122
6461
  };
6123
- n = n.replace(i, u);
6462
+ n = n.replace(s, l);
6124
6463
  }
6125
- n = n.replace(this.tokenizer.rules.inline.anyPunctuation, (i) => "+".repeat(i.length)), n = n.replace(this.tokenizer.rules.inline.blockSkip, (i, u, a) => {
6126
- let p = a ? a.length : 0;
6127
- return i.slice(0, p) + "[" + "a".repeat(i.length - p - 2) + "]";
6464
+ n = n.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode, (s, l, u) => u ? "+".repeat(s.length) : l ? l + s.slice(l.length, -l.length).replace(/`/g, "+") + l : s), n = n.replace(this.tokenizer.rules.inline.blockSkip, (s, l, u) => {
6465
+ let c = u ? u.length : 0;
6466
+ return s.slice(0, c) + "[" + "a".repeat(s.length - c - 2) + "]";
6128
6467
  }), n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
6129
- let s = !1, r = "", o = Infinity;
6468
+ let i = !1, r = "", o = Infinity;
6130
6469
  for (; e;) {
6131
6470
  if (e.length < o) o = e.length;
6132
6471
  else {
6133
6472
  this.infiniteLoopError(e.charCodeAt(0));
6134
6473
  break;
6135
6474
  }
6136
- s || (r = ""), s = !1;
6137
- let i;
6138
- if (this.options.extensions?.inline?.some((a) => (i = a.call({ lexer: this }, e, t)) ? (e = e.substring(i.raw.length), t.push(i), !0) : !1)) continue;
6139
- if (i = this.tokenizer.escape(e)) {
6140
- e = e.substring(i.raw.length), t.push(i);
6475
+ i || (r = ""), i = !1;
6476
+ let s;
6477
+ if (this.options.extensions?.inline?.some((u) => (s = u.call({ lexer: this }, e, t)) ? (e = e.substring(s.raw.length), t.push(s), !0) : !1)) continue;
6478
+ if (s = this.tokenizer.escape(e)) {
6479
+ e = e.substring(s.raw.length), t.push(s);
6141
6480
  continue;
6142
6481
  }
6143
- if (i = this.tokenizer.tag(e)) {
6144
- e = e.substring(i.raw.length), t.push(i);
6482
+ if (s = this.tokenizer.tag(e)) {
6483
+ e = e.substring(s.raw.length), t.push(s);
6145
6484
  continue;
6146
6485
  }
6147
- if (i = this.tokenizer.link(e)) {
6148
- e = e.substring(i.raw.length), t.push(i);
6486
+ if (s = this.tokenizer.link(e)) {
6487
+ e = e.substring(s.raw.length), t.push(s);
6149
6488
  continue;
6150
6489
  }
6151
- if (i = this.tokenizer.reflink(e, this.tokens.links)) {
6152
- e = e.substring(i.raw.length);
6153
- let a = t.at(-1);
6154
- i.type === "text" && a?.type === "text" ? (a.raw += i.raw, a.text += i.text) : t.push(i);
6490
+ if (s = this.tokenizer.reflink(e, this.tokens.links)) {
6491
+ e = e.substring(s.raw.length);
6492
+ let u = t.at(-1);
6493
+ s.type === "text" && u?.type === "text" ? (u.raw += s.raw, u.text += s.text) : t.push(s);
6155
6494
  continue;
6156
6495
  }
6157
- if (i = this.tokenizer.emStrong(e, n, r)) {
6158
- e = e.substring(i.raw.length), t.push(i);
6496
+ if (s = this.tokenizer.emStrong(e, n, r)) {
6497
+ e = e.substring(s.raw.length), t.push(s);
6159
6498
  continue;
6160
6499
  }
6161
- if (i = this.tokenizer.codespan(e)) {
6162
- e = e.substring(i.raw.length), t.push(i);
6500
+ if (s = this.tokenizer.codespan(e)) {
6501
+ e = e.substring(s.raw.length), t.push(s);
6163
6502
  continue;
6164
6503
  }
6165
- if (i = this.tokenizer.br(e)) {
6166
- e = e.substring(i.raw.length), t.push(i);
6504
+ if (s = this.tokenizer.br(e)) {
6505
+ e = e.substring(s.raw.length), t.push(s);
6167
6506
  continue;
6168
6507
  }
6169
- if (i = this.tokenizer.del(e, n, r)) {
6170
- e = e.substring(i.raw.length), t.push(i);
6508
+ if (s = this.tokenizer.del(e, n, r)) {
6509
+ e = e.substring(s.raw.length), t.push(s);
6171
6510
  continue;
6172
6511
  }
6173
- if (i = this.tokenizer.autolink(e)) {
6174
- e = e.substring(i.raw.length), t.push(i);
6512
+ if (s = this.tokenizer.autolink(e)) {
6513
+ e = e.substring(s.raw.length), t.push(s);
6175
6514
  continue;
6176
6515
  }
6177
- if (!this.state.inLink && (i = this.tokenizer.url(e))) {
6178
- e = e.substring(i.raw.length), t.push(i);
6516
+ if (!this.state.inLink && (s = this.tokenizer.url(e))) {
6517
+ e = e.substring(s.raw.length), t.push(s);
6179
6518
  continue;
6180
6519
  }
6181
- let u = e;
6520
+ let l = e;
6182
6521
  if (this.options.extensions?.startInline) {
6183
- let a = Infinity, p = e.slice(1), c;
6522
+ let u = Infinity, c = e.slice(1), p;
6184
6523
  this.options.extensions.startInline.forEach((d) => {
6185
- c = d.call({ lexer: this }, p), typeof c == "number" && c >= 0 && (a = Math.min(a, c));
6186
- }), a < Infinity && a >= 0 && (u = e.substring(0, a + 1));
6524
+ p = d.call({ lexer: this }, c), typeof p == "number" && p >= 0 && (u = Math.min(u, p));
6525
+ }), u < Infinity && u >= 0 && (l = e.substring(0, u + 1));
6187
6526
  }
6188
- if (i = this.tokenizer.inlineText(u)) {
6189
- e = e.substring(i.raw.length), i.raw.slice(-1) !== "_" && (r = i.raw.slice(-1)), s = !0;
6190
- let a = t.at(-1);
6191
- a?.type === "text" ? (a.raw += i.raw, a.text += i.text) : t.push(i);
6527
+ if (s = this.tokenizer.inlineText(l)) {
6528
+ e = e.substring(s.raw.length), s.raw.slice(-1) !== "_" && (r = s.raw.slice(-1)), i = !0;
6529
+ let u = t.at(-1);
6530
+ u?.type === "text" ? (u.raw += s.raw, u.text += s.text) : t.push(s);
6192
6531
  continue;
6193
6532
  }
6194
6533
  if (e) {
@@ -6204,7 +6543,7 @@ ${Z.join(`
6204
6543
  else throw new Error(t);
6205
6544
  }
6206
6545
  };
6207
- var S = class {
6546
+ var $ = class {
6208
6547
  options;
6209
6548
  parser;
6210
6549
  constructor(e) {
@@ -6214,10 +6553,10 @@ ${Z.join(`
6214
6553
  return "";
6215
6554
  }
6216
6555
  code({ text: e, lang: t, escaped: n }) {
6217
- let s = (t || "").match(x.notSpaceStart)?.[0], r = e ? e.replace(x.endingNewline, "") + `
6556
+ let i = (t || "").match(x.notSpaceStart)?.[0], r = e ? e.replace(x.endingNewline, "") + `
6218
6557
  ` : "";
6219
- return s ? "<pre><code class=\"language-" + O(s) + "\">" + (n ? r : O(r, !0)) + `</code></pre>
6220
- ` : "<pre><code>" + (n ? r : O(r, !0)) + `</code></pre>
6558
+ return i ? "<pre><code class=\"language-" + w(i) + "\">" + (n ? r : w(r, !0)) + `</code></pre>
6559
+ ` : "<pre><code>" + (n ? r : w(r, !0)) + `</code></pre>
6221
6560
  `;
6222
6561
  }
6223
6562
  blockquote({ tokens: e }) {
@@ -6240,14 +6579,14 @@ ${this.parser.parse(e)}</blockquote>
6240
6579
  `;
6241
6580
  }
6242
6581
  list(e) {
6243
- let t = e.ordered, n = e.start, s = "";
6244
- for (let i = 0; i < e.items.length; i++) {
6245
- let u = e.items[i];
6246
- s += this.listitem(u);
6582
+ let t = e.ordered, n = e.start, i = "";
6583
+ for (let s = 0; s < e.items.length; s++) {
6584
+ let l = e.items[s];
6585
+ i += this.listitem(l);
6247
6586
  }
6248
6587
  let r = t ? "ol" : "ul", o = t && n !== 1 ? " start=\"" + n + "\"" : "";
6249
6588
  return "<" + r + o + `>
6250
- ` + s + "</" + r + `>
6589
+ ` + i + "</" + r + `>
6251
6590
  `;
6252
6591
  }
6253
6592
  listitem(e) {
@@ -6265,17 +6604,17 @@ ${this.parser.parse(e)}</blockquote>
6265
6604
  let t = "", n = "";
6266
6605
  for (let r = 0; r < e.header.length; r++) n += this.tablecell(e.header[r]);
6267
6606
  t += this.tablerow({ text: n });
6268
- let s = "";
6607
+ let i = "";
6269
6608
  for (let r = 0; r < e.rows.length; r++) {
6270
6609
  let o = e.rows[r];
6271
6610
  n = "";
6272
- for (let i = 0; i < o.length; i++) n += this.tablecell(o[i]);
6273
- s += this.tablerow({ text: n });
6611
+ for (let s = 0; s < o.length; s++) n += this.tablecell(o[s]);
6612
+ i += this.tablerow({ text: n });
6274
6613
  }
6275
- return s && (s = `<tbody>${s}</tbody>`), `<table>
6614
+ return i && (i = `<tbody>${i}</tbody>`), `<table>
6276
6615
  <thead>
6277
6616
  ` + t + `</thead>
6278
- ` + s + `</table>
6617
+ ` + i + `</table>
6279
6618
  `;
6280
6619
  }
6281
6620
  tablerow({ text: e }) {
@@ -6295,7 +6634,7 @@ ${e}</tr>
6295
6634
  return `<em>${this.parser.parseInline(e)}</em>`;
6296
6635
  }
6297
6636
  codespan({ text: e }) {
6298
- return `<code>${O(e, !0)}</code>`;
6637
+ return `<code>${w(e, !0)}</code>`;
6299
6638
  }
6300
6639
  br(e) {
6301
6640
  return "<br>";
@@ -6303,23 +6642,23 @@ ${e}</tr>
6303
6642
  del({ tokens: e }) {
6304
6643
  return `<del>${this.parser.parseInline(e)}</del>`;
6305
6644
  }
6306
- link({ href: e, title: t, text: n, tokens: s, autolink: r }) {
6307
- let o = r ? O(n, !0) : this.parser.parseInline(s), i = re(e);
6308
- if (i === null) return o;
6309
- e = O(i, r);
6310
- let u = "<a href=\"" + e + "\"";
6311
- return t && (u += " title=\"" + O(t) + "\""), u += ">" + o + "</a>", u;
6312
- }
6313
- image({ href: e, title: t, text: n, tokens: s }) {
6314
- s && (n = this.parser.parseInline(s, this.parser.textRenderer));
6315
- let r = re(e);
6316
- if (r === null) return O(n);
6645
+ link({ href: e, title: t, text: n, tokens: i, autolink: r }) {
6646
+ let o = r ? w(n, !0) : this.parser.parseInline(i), s = ie(e);
6647
+ if (s === null) return o;
6648
+ e = w(s, r);
6649
+ let l = "<a href=\"" + e + "\"";
6650
+ return t && (l += " title=\"" + w(t) + "\""), l += ">" + o + "</a>", l;
6651
+ }
6652
+ image({ href: e, title: t, text: n, tokens: i }) {
6653
+ i && (n = this.parser.parseInline(i, this.parser.textRenderer));
6654
+ let r = ie(e);
6655
+ if (r === null) return w(n);
6317
6656
  e = r;
6318
- let o = `<img src="${O(e)}" alt="${O(n)}"`;
6319
- return t && (o += ` title="${O(t)}"`), o += ">", o;
6657
+ let o = `<img src="${w(e)}" alt="${w(n)}"`;
6658
+ return t && (o += ` title="${w(t)}"`), o += ">", o;
6320
6659
  }
6321
6660
  text(e) {
6322
- return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : O(e.text);
6661
+ return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : w(e.text);
6323
6662
  }
6324
6663
  };
6325
6664
  var z = class {
@@ -6354,27 +6693,27 @@ ${e}</tr>
6354
6693
  return e;
6355
6694
  }
6356
6695
  };
6357
- var T = class l {
6696
+ var O = class a {
6358
6697
  options;
6359
6698
  renderer;
6360
6699
  textRenderer;
6361
6700
  constructor(e) {
6362
- this.options = e || y, this.options.renderer = this.options.renderer || new S(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new z();
6701
+ this.options = e || y, this.options.renderer = this.options.renderer || new $(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new z();
6363
6702
  }
6364
6703
  static parse(e, t) {
6365
- return new l(t).parse(e);
6704
+ return new a(t).parse(e);
6366
6705
  }
6367
6706
  static parseInline(e, t) {
6368
- return new l(t).parseInline(e);
6707
+ return new a(t).parseInline(e);
6369
6708
  }
6370
6709
  parse(e) {
6371
6710
  this.renderer.parser = this;
6372
6711
  let t = "";
6373
6712
  for (let n = 0; n < e.length; n++) {
6374
- let s = e[n];
6375
- if (this.options.extensions?.renderers?.[s.type]) {
6376
- let o = s, i = this.options.extensions.renderers[o.type].call({ parser: this }, o);
6377
- if (i !== !1 || ![
6713
+ let i = e[n];
6714
+ if (this.options.extensions?.renderers?.[i.type]) {
6715
+ let o = i, s = this.options.extensions.renderers[o.type].call({ parser: this }, o);
6716
+ if (s !== !1 || ![
6378
6717
  "space",
6379
6718
  "hr",
6380
6719
  "heading",
@@ -6388,11 +6727,11 @@ ${e}</tr>
6388
6727
  "paragraph",
6389
6728
  "text"
6390
6729
  ].includes(o.type)) {
6391
- t += i || "";
6730
+ t += s || "";
6392
6731
  continue;
6393
6732
  }
6394
6733
  }
6395
- let r = s;
6734
+ let r = i;
6396
6735
  switch (r.type) {
6397
6736
  case "space":
6398
6737
  t += this.renderer.space(r);
@@ -6442,11 +6781,11 @@ ${e}</tr>
6442
6781
  parseInline(e, t = this.renderer) {
6443
6782
  this.renderer.parser = this;
6444
6783
  let n = "";
6445
- for (let s = 0; s < e.length; s++) {
6446
- let r = e[s];
6784
+ for (let i = 0; i < e.length; i++) {
6785
+ let r = e[i];
6447
6786
  if (this.options.extensions?.renderers?.[r.type]) {
6448
- let i = this.options.extensions.renderers[r.type].call({ parser: this }, r);
6449
- if (i !== !1 || ![
6787
+ let s = this.options.extensions.renderers[r.type].call({ parser: this }, r);
6788
+ if (s !== !1 || ![
6450
6789
  "escape",
6451
6790
  "html",
6452
6791
  "link",
@@ -6459,7 +6798,7 @@ ${e}</tr>
6459
6798
  "del",
6460
6799
  "text"
6461
6800
  ].includes(r.type)) {
6462
- n += i || "";
6801
+ n += s || "";
6463
6802
  continue;
6464
6803
  }
6465
6804
  }
@@ -6499,16 +6838,16 @@ ${e}</tr>
6499
6838
  n += t.text(o);
6500
6839
  break;
6501
6840
  default: {
6502
- let i = "Token with \"" + o.type + "\" type was not found.";
6503
- if (this.options.silent) return console.error(i), "";
6504
- throw new Error(i);
6841
+ let s = "Token with \"" + o.type + "\" type was not found.";
6842
+ if (this.options.silent) return console.error(s), "";
6843
+ throw new Error(s);
6505
6844
  }
6506
6845
  }
6507
6846
  }
6508
6847
  return n;
6509
6848
  }
6510
6849
  };
6511
- var _ = class {
6850
+ var L = class {
6512
6851
  options;
6513
6852
  block;
6514
6853
  constructor(e) {
@@ -6538,46 +6877,50 @@ ${e}</tr>
6538
6877
  return e;
6539
6878
  }
6540
6879
  provideLexer(e = this.block) {
6541
- return e ? R.lex : R.lexInline;
6880
+ return e ? T.lex : T.lexInline;
6542
6881
  }
6543
6882
  provideParser(e = this.block) {
6544
- return e ? T.parse : T.parseInline;
6883
+ return e ? O.parse : O.parseInline;
6545
6884
  }
6546
6885
  };
6547
- var F = class {
6548
- defaults = I();
6886
+ function C(a, e) {
6887
+ if (Array.isArray(e)) for (let t = 0; t < e.length; t++) a.push(e[t]);
6888
+ else a.push(e);
6889
+ }
6890
+ var U = class {
6891
+ defaults = B();
6549
6892
  options = this.setOptions;
6550
6893
  parse = this.parseMarkdown(!0);
6551
6894
  parseInline = this.parseMarkdown(!1);
6552
- Parser = T;
6553
- Renderer = S;
6895
+ Parser = O;
6896
+ Renderer = $;
6554
6897
  TextRenderer = z;
6555
- Lexer = R;
6556
- Tokenizer = P;
6557
- Hooks = _;
6898
+ Lexer = T;
6899
+ Tokenizer = _;
6900
+ Hooks = L;
6558
6901
  constructor(...e) {
6559
6902
  this.use(...e);
6560
6903
  }
6561
6904
  walkTokens(e, t) {
6562
6905
  let n = [];
6563
- for (let s of e) switch (n = n.concat(t.call(this, s)), s.type) {
6906
+ for (let i of e) switch (C(n, t.call(this, i)), i.type) {
6564
6907
  case "table": {
6565
- let r = s;
6566
- for (let o of r.header) n = n.concat(this.walkTokens(o.tokens, t));
6567
- for (let o of r.rows) for (let i of o) n = n.concat(this.walkTokens(i.tokens, t));
6908
+ let r = i;
6909
+ for (let o of r.header) C(n, this.walkTokens(o.tokens, t));
6910
+ for (let o of r.rows) for (let s of o) C(n, this.walkTokens(s.tokens, t));
6568
6911
  break;
6569
6912
  }
6570
6913
  case "list": {
6571
- let r = s;
6572
- n = n.concat(this.walkTokens(r.items, t));
6914
+ let r = i;
6915
+ C(n, this.walkTokens(r.items, t));
6573
6916
  break;
6574
6917
  }
6575
6918
  default: {
6576
- let r = s;
6919
+ let r = i;
6577
6920
  this.defaults.extensions?.childTokens?.[r.type] ? this.defaults.extensions.childTokens[r.type].forEach((o) => {
6578
- let i = r[o].flat(Infinity);
6579
- n = n.concat(this.walkTokens(i, t));
6580
- }) : r.tokens && (n = n.concat(this.walkTokens(r.tokens, t)));
6921
+ let s = r[o].flat(Infinity);
6922
+ C(n, this.walkTokens(s, t));
6923
+ }) : r.tokens && C(n, this.walkTokens(r.tokens, t));
6581
6924
  }
6582
6925
  }
6583
6926
  return n;
@@ -6588,14 +6931,14 @@ ${e}</tr>
6588
6931
  childTokens: {}
6589
6932
  };
6590
6933
  return e.forEach((n) => {
6591
- let s = { ...n };
6592
- if (s.async = this.defaults.async || s.async || !1, n.extensions && (n.extensions.forEach((r) => {
6934
+ let i = { ...n };
6935
+ if (i.async = this.defaults.async || i.async || !1, n.extensions && (n.extensions.forEach((r) => {
6593
6936
  if (!r.name) throw new Error("extension name required");
6594
6937
  if ("renderer" in r) {
6595
6938
  let o = t.renderers[r.name];
6596
- o ? t.renderers[r.name] = function(...i) {
6597
- let u = r.renderer.apply(this, i);
6598
- return u === !1 && (u = o.apply(this, i)), u;
6939
+ o ? t.renderers[r.name] = function(...s) {
6940
+ let l = r.renderer.apply(this, s);
6941
+ return l === !1 && (l = o.apply(this, s)), l;
6599
6942
  } : t.renderers[r.name] = r.renderer;
6600
6943
  }
6601
6944
  if ("tokenizer" in r) {
@@ -6604,21 +6947,21 @@ ${e}</tr>
6604
6947
  o ? o.unshift(r.tokenizer) : t[r.level] = [r.tokenizer], r.start && (r.level === "block" ? t.startBlock ? t.startBlock.push(r.start) : t.startBlock = [r.start] : r.level === "inline" && (t.startInline ? t.startInline.push(r.start) : t.startInline = [r.start]));
6605
6948
  }
6606
6949
  "childTokens" in r && r.childTokens && (t.childTokens[r.name] = r.childTokens);
6607
- }), s.extensions = t), n.renderer) {
6608
- let r = this.defaults.renderer || new S(this.defaults);
6950
+ }), i.extensions = t), n.renderer) {
6951
+ let r = this.defaults.renderer || new $(this.defaults);
6609
6952
  for (let o in n.renderer) {
6610
6953
  if (!(o in r)) throw new Error(`renderer '${o}' does not exist`);
6611
6954
  if (["options", "parser"].includes(o)) continue;
6612
- let i = o, u = n.renderer[i], a = r[i];
6613
- r[i] = (...p) => {
6614
- let c = u.apply(r, p);
6615
- return c === !1 && (c = a.apply(r, p)), c || "";
6955
+ let s = o, l = n.renderer[s], u = r[s];
6956
+ r[s] = (...c) => {
6957
+ let p = l.apply(r, c);
6958
+ return p === !1 && (p = u.apply(r, c)), p || "";
6616
6959
  };
6617
6960
  }
6618
- s.renderer = r;
6961
+ i.renderer = r;
6619
6962
  }
6620
6963
  if (n.tokenizer) {
6621
- let r = this.defaults.tokenizer || new P(this.defaults);
6964
+ let r = this.defaults.tokenizer || new _(this.defaults);
6622
6965
  for (let o in n.tokenizer) {
6623
6966
  if (!(o in r)) throw new Error(`tokenizer '${o}' does not exist`);
6624
6967
  if ([
@@ -6626,48 +6969,48 @@ ${e}</tr>
6626
6969
  "rules",
6627
6970
  "lexer"
6628
6971
  ].includes(o)) continue;
6629
- let i = o, u = n.tokenizer[i], a = r[i];
6630
- r[i] = (...p) => {
6631
- let c = u.apply(r, p);
6632
- return c === !1 && (c = a.apply(r, p)), c;
6972
+ let s = o, l = n.tokenizer[s], u = r[s];
6973
+ r[s] = (...c) => {
6974
+ let p = l.apply(r, c);
6975
+ return p === !1 && (p = u.apply(r, c)), p;
6633
6976
  };
6634
6977
  }
6635
- s.tokenizer = r;
6978
+ i.tokenizer = r;
6636
6979
  }
6637
6980
  if (n.hooks) {
6638
- let r = this.defaults.hooks || new _();
6981
+ let r = this.defaults.hooks || new L();
6639
6982
  for (let o in n.hooks) {
6640
6983
  if (!(o in r)) throw new Error(`hook '${o}' does not exist`);
6641
6984
  if (["options", "block"].includes(o)) continue;
6642
- let i = o, u = n.hooks[i], a = r[i];
6643
- _.passThroughHooks.has(o) ? r[i] = (p) => {
6644
- if (this.defaults.async && _.passThroughHooksRespectAsync.has(o)) return (async () => {
6645
- let d = await u.call(r, p);
6646
- return a.call(r, d);
6985
+ let s = o, l = n.hooks[s], u = r[s];
6986
+ L.passThroughHooks.has(o) ? r[s] = (c) => {
6987
+ if (this.defaults.async && L.passThroughHooksRespectAsync.has(o)) return (async () => {
6988
+ let d = await l.call(r, c);
6989
+ return u.call(r, d);
6647
6990
  })();
6648
- let c = u.call(r, p);
6649
- return a.call(r, c);
6650
- } : r[i] = (...p) => {
6991
+ let p = l.call(r, c);
6992
+ return u.call(r, p);
6993
+ } : r[s] = (...c) => {
6651
6994
  if (this.defaults.async) return (async () => {
6652
- let d = await u.apply(r, p);
6653
- return d === !1 && (d = await a.apply(r, p)), d;
6995
+ let d = await l.apply(r, c);
6996
+ return d === !1 && (d = await u.apply(r, c)), d;
6654
6997
  })();
6655
- let c = u.apply(r, p);
6656
- return c === !1 && (c = a.apply(r, p)), c;
6998
+ let p = l.apply(r, c);
6999
+ return p === !1 && (p = u.apply(r, c)), p;
6657
7000
  };
6658
7001
  }
6659
- s.hooks = r;
7002
+ i.hooks = r;
6660
7003
  }
6661
7004
  if (n.walkTokens) {
6662
7005
  let r = this.defaults.walkTokens, o = n.walkTokens;
6663
- s.walkTokens = function(i) {
6664
- let u = [];
6665
- return u.push(o.call(this, i)), r && (u = u.concat(r.call(this, i))), u;
7006
+ i.walkTokens = function(s) {
7007
+ let l = [];
7008
+ return l.push(o.call(this, s)), r && C(l, r.call(this, s)), l;
6666
7009
  };
6667
7010
  }
6668
7011
  this.defaults = {
6669
7012
  ...this.defaults,
6670
- ...s
7013
+ ...i
6671
7014
  };
6672
7015
  }), this;
6673
7016
  }
@@ -6678,34 +7021,34 @@ ${e}</tr>
6678
7021
  }, this;
6679
7022
  }
6680
7023
  lexer(e, t) {
6681
- return R.lex(e, t ?? this.defaults);
7024
+ return T.lex(e, t ?? this.defaults);
6682
7025
  }
6683
7026
  parser(e, t) {
6684
- return T.parse(e, t ?? this.defaults);
7027
+ return O.parse(e, t ?? this.defaults);
6685
7028
  }
6686
7029
  parseMarkdown(e) {
6687
- return (n, s) => {
6688
- let r = { ...s }, o = {
7030
+ return (n, i) => {
7031
+ let r = { ...i }, o = {
6689
7032
  ...this.defaults,
6690
7033
  ...r
6691
- }, i = this.onError(!!o.silent, !!o.async);
6692
- if (this.defaults.async === !0 && r.async === !1) return i(/* @__PURE__ */ new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
6693
- if (typeof n > "u" || n === null) return i(/* @__PURE__ */ new Error("marked(): input parameter is undefined or null"));
6694
- if (typeof n != "string") return i(/* @__PURE__ */ new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
7034
+ }, s = this.onError(!!o.silent, !!o.async);
7035
+ if (this.defaults.async === !0 && r.async === !1) return s(/* @__PURE__ */ new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
7036
+ if (typeof n > "u" || n === null) return s(/* @__PURE__ */ new Error("marked(): input parameter is undefined or null"));
7037
+ if (typeof n != "string") return s(/* @__PURE__ */ new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
6695
7038
  if (o.hooks && (o.hooks.options = o, o.hooks.block = e), o.async) return (async () => {
6696
- let u = o.hooks ? await o.hooks.preprocess(n) : n, p = await (o.hooks ? await o.hooks.provideLexer(e) : e ? R.lex : R.lexInline)(u, o), c = o.hooks ? await o.hooks.processAllTokens(p) : p;
6697
- o.walkTokens && await Promise.all(this.walkTokens(c, o.walkTokens));
6698
- let m = await (o.hooks ? await o.hooks.provideParser(e) : e ? T.parse : T.parseInline)(c, o);
6699
- return o.hooks ? await o.hooks.postprocess(m) : m;
6700
- })().catch(i);
7039
+ let l = o.hooks ? await o.hooks.preprocess(n) : n, c = await (o.hooks ? await o.hooks.provideLexer(e) : e ? T.lex : T.lexInline)(l, o), p = o.hooks ? await o.hooks.processAllTokens(c) : c;
7040
+ o.walkTokens && await Promise.all(this.walkTokens(p, o.walkTokens));
7041
+ let g = await (o.hooks ? await o.hooks.provideParser(e) : e ? O.parse : O.parseInline)(p, o);
7042
+ return o.hooks ? await o.hooks.postprocess(g) : g;
7043
+ })().catch(s);
6701
7044
  try {
6702
7045
  o.hooks && (n = o.hooks.preprocess(n));
6703
- let a = (o.hooks ? o.hooks.provideLexer(e) : e ? R.lex : R.lexInline)(n, o);
6704
- o.hooks && (a = o.hooks.processAllTokens(a)), o.walkTokens && this.walkTokens(a, o.walkTokens);
6705
- let c = (o.hooks ? o.hooks.provideParser(e) : e ? T.parse : T.parseInline)(a, o);
6706
- return o.hooks && (c = o.hooks.postprocess(c)), c;
6707
- } catch (u) {
6708
- return i(u);
7046
+ let u = (o.hooks ? o.hooks.provideLexer(e) : e ? T.lex : T.lexInline)(n, o);
7047
+ o.hooks && (u = o.hooks.processAllTokens(u)), o.walkTokens && this.walkTokens(u, o.walkTokens);
7048
+ let p = (o.hooks ? o.hooks.provideParser(e) : e ? O.parse : O.parseInline)(u, o);
7049
+ return o.hooks && (p = o.hooks.postprocess(p)), p;
7050
+ } catch (l) {
7051
+ return s(l);
6709
7052
  }
6710
7053
  };
6711
7054
  }
@@ -6713,46 +7056,46 @@ ${e}</tr>
6713
7056
  return (n) => {
6714
7057
  if (n.message += `
6715
7058
  Please report this to https://github.com/markedjs/marked.`, e) {
6716
- let s = "<p>An error occurred:</p><pre>" + O(n.message + "", !0) + "</pre>";
6717
- return t ? Promise.resolve(s) : s;
7059
+ let i = "<p>An error occurred:</p><pre>" + w(n.message + "", !0) + "</pre>";
7060
+ return t ? Promise.resolve(i) : i;
6718
7061
  }
6719
7062
  if (t) return Promise.reject(n);
6720
7063
  throw n;
6721
7064
  };
6722
7065
  }
6723
7066
  };
6724
- var E = new F();
6725
- function k(l, e) {
6726
- return E.parse(l, e);
7067
+ var I = new U();
7068
+ function f(a, e) {
7069
+ return I.parse(a, e);
6727
7070
  }
6728
- k.options = k.setOptions = function(l) {
6729
- return E.setOptions(l), k.defaults = E.defaults, W(k.defaults), k;
7071
+ f.options = f.setOptions = function(a) {
7072
+ return I.setOptions(a), f.defaults = I.defaults, V(f.defaults), f;
6730
7073
  };
6731
- k.getDefaults = I;
6732
- k.defaults = y;
6733
- function Pt(...l) {
6734
- return E.use(...l), k.defaults = E.defaults, W(k.defaults), k;
6735
- }
6736
- k.use = Pt;
6737
- k.walkTokens = function(l, e) {
6738
- return E.walkTokens(l, e);
7074
+ f.getDefaults = B;
7075
+ f.defaults = y;
7076
+ function At(...a) {
7077
+ return I.use(...a), f.defaults = I.defaults, V(f.defaults), f;
7078
+ }
7079
+ f.use = At;
7080
+ f.walkTokens = function(a, e) {
7081
+ return I.walkTokens(a, e);
6739
7082
  };
6740
- k.parseInline = E.parseInline;
6741
- k.Parser = T;
6742
- k.parser = T.parse;
6743
- k.Renderer = S;
6744
- k.TextRenderer = z;
6745
- k.Lexer = R;
6746
- k.lexer = R.lex;
6747
- k.Tokenizer = P;
6748
- k.Hooks = _;
6749
- k.parse = k;
6750
- k.options;
6751
- k.setOptions;
6752
- k.walkTokens;
6753
- k.parseInline;
6754
- T.parse;
6755
- R.lex;
7083
+ f.parseInline = I.parseInline;
7084
+ f.Parser = O;
7085
+ f.parser = O.parse;
7086
+ f.Renderer = $;
7087
+ f.TextRenderer = z;
7088
+ f.Lexer = T;
7089
+ f.lexer = T.lex;
7090
+ f.Tokenizer = _;
7091
+ f.Hooks = L;
7092
+ f.parse = f;
7093
+ f.options;
7094
+ f.setOptions;
7095
+ f.walkTokens;
7096
+ f.parseInline;
7097
+ O.parse;
7098
+ T.lex;
6756
7099
  //#endregion
6757
7100
  //#region src/core/issue-form.ts
6758
7101
  /**
@@ -6830,7 +7173,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
6830
7173
  }
6831
7174
  /** Readable summary without changing the task source or creating DOM HTML. */
6832
7175
  function markdownToPlainText(source) {
6833
- return plain(R.lex(source, { gfm: true }), " ").replace(/\s+/g, " ").trim();
7176
+ return plain(T.lex(source, { gfm: true }), " ").replace(/\s+/g, " ").trim();
6834
7177
  }
6835
7178
  /**
6836
7179
  * Card excerpt: the plain text a reader can tell cards apart by.
@@ -6848,7 +7191,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
6848
7191
  const blocks = [];
6849
7192
  const summary = [];
6850
7193
  let inSummary = false;
6851
- for (const token of R.lex(source, { gfm: true })) {
7194
+ for (const token of T.lex(source, { gfm: true })) {
6852
7195
  if (token.type === "heading") {
6853
7196
  inSummary = SUMMARY_HEADING.test(plain([token]).replace(HEADING_COLON, "").trim());
6854
7197
  continue;
@@ -6971,7 +7314,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
6971
7314
  }
6972
7315
  /** Markdown rendered as React nodes: raw HTML and automatic image loads are disabled. */
6973
7316
  function TaskMarkdown({ source }) {
6974
- const content = (0, react.useMemo)(() => renderTokens(R.lex(source, { gfm: true })), [source]);
7317
+ const content = (0, react.useMemo)(() => renderTokens(T.lex(source, { gfm: true })), [source]);
6975
7318
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
6976
7319
  className: task_markdown_module_css_default.markdownRoot,
6977
7320
  children: content
@@ -7314,6 +7657,87 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7314
7657
  if (fallback === void 0) return t("exec.mode.inherit");
7315
7658
  return t("exec.mode.inheritWith", { preset: presetLabel(fallback) });
7316
7659
  }
7660
+ /**
7661
+ * The picker rows of one roster, split into the built-in and the user presets.
7662
+ * Both pickers render these rows — the create dialog's mode select and the
7663
+ * settings card's default-preset field — so their wording and their
7664
+ * unavailable rows cannot drift apart.
7665
+ * @param presets - the roster options.
7666
+ * @returns one row list per group, in roster order.
7667
+ */
7668
+ function presetChoiceRows(presets) {
7669
+ const row = (preset) => ({
7670
+ id: preset.id,
7671
+ label: presetLabel(preset) + (preset.isDefault ? t("exec.mode.defaultSuffix") : "") + (preset.broken !== void 0 ? t("exec.mode.brokenSuffix") : ""),
7672
+ disabled: preset.broken !== void 0
7673
+ });
7674
+ return {
7675
+ builtin: presets.filter((preset) => isBuiltinPreset(preset.id)).map(row),
7676
+ custom: presets.filter((preset) => !isBuiltinPreset(preset.id)).map(row)
7677
+ };
7678
+ }
7679
+ //#endregion
7680
+ //#region src/client/board/ReasoningEffortField.tsx
7681
+ /** The controlled reasoning-effort picker. */
7682
+ function ReasoningEffortField({ models, modelId, value, pending, onChange }) {
7683
+ const efforts = reasoningEffortsFor(models, modelId);
7684
+ const unlisted = value !== "" && !efforts.includes(value);
7685
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
7686
+ className: board_module_css_default.field,
7687
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
7688
+ className: board_module_css_default.fieldLabel,
7689
+ children: t("exec.reasoning")
7690
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
7691
+ className: board_module_css_default.select,
7692
+ value,
7693
+ disabled: pending || !reasoningPickerEnabled(models, modelId),
7694
+ onChange: (event) => {
7695
+ onChange(event.target.value);
7696
+ },
7697
+ children: [
7698
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
7699
+ value: "",
7700
+ children: t("exec.reasoning.inherit")
7701
+ }),
7702
+ unlisted && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
7703
+ value,
7704
+ disabled: true,
7705
+ children: [value, t("exec.reasoning.unknown")]
7706
+ }),
7707
+ efforts.map((effort) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
7708
+ value: effort,
7709
+ children: effort
7710
+ }, effort))
7711
+ ]
7712
+ })]
7713
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
7714
+ className: board_module_css_default.detailText,
7715
+ children: t(reasoningHintKey(models, modelId))
7716
+ })] });
7717
+ }
7718
+ //#endregion
7719
+ //#region src/client/board/team-run-promotion.ts
7720
+ /**
7721
+ * Whether a join would promote this parent: the deployment serves Agent Teams
7722
+ * and the parent has not opted in yet.
7723
+ * @param controller - the board controller (the snapshot carries both facts).
7724
+ * @param parent - the task that gained a subtask, if there is one.
7725
+ */
7726
+ function parentAwaitsTeamRunPromotion(controller, parent) {
7727
+ if (parent === void 0) return false;
7728
+ const snapshot = controller.getSnapshot();
7729
+ if (snapshot.host?.teamRunAvailable !== true) return false;
7730
+ return (snapshot.tasks.find((task) => task.id === parent.id) ?? parent).teamRun !== true;
7731
+ }
7732
+ /**
7733
+ * Opt the parent in after the Host confirmed the join.
7734
+ * @returns true when the opt-in was written; false when it did not apply.
7735
+ */
7736
+ async function promoteParentForTeamRun(controller, parent) {
7737
+ if (parent === void 0) return false;
7738
+ if (!parentAwaitsTeamRunPromotion(controller, parent)) return false;
7739
+ return await controller.updateTask(parent.id, { teamRun: true });
7740
+ }
7317
7741
  //#endregion
7318
7742
  //#region src/client/board/NewTaskModal.tsx
7319
7743
  /**
@@ -7326,10 +7750,21 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7326
7750
  const [title, setTitle] = (0, react.useState)(initialTask?.title ?? "");
7327
7751
  const [description, setDescription] = (0, react.useState)(initialTask?.description ?? "");
7328
7752
  const [prompt, setPrompt] = (0, react.useState)(initialTask?.prompt ?? "");
7753
+ const [seed] = (0, react.useState)(() => {
7754
+ const source = parentTask !== void 0 ? {
7755
+ kind: "parent",
7756
+ task: parentTask
7757
+ } : initialTask !== void 0 ? {
7758
+ kind: "duplicate",
7759
+ task: initialTask
7760
+ } : void 0;
7761
+ return resolveCardTargets(controller.getSnapshot().host?.cardDefaults, source);
7762
+ });
7329
7763
  const [workspaceId, setWorkspaceId] = (0, react.useState)(initialTask?.workspaceId ?? parentTask?.workspaceId ?? defaultWorkspaceId ?? "");
7330
- const [mode, setMode] = (0, react.useState)(initialTask?.mode ?? parentTask?.mode ?? "");
7331
- const [permission, setPermission] = (0, react.useState)(initialTask?.permission ?? "");
7332
- const [model, setModel] = (0, react.useState)(initialTask?.model ?? parentTask?.model ?? "");
7764
+ const [mode, setMode] = (0, react.useState)(seed.mode);
7765
+ const [permission, setPermission] = (0, react.useState)(seed.permission);
7766
+ const [model, setModel] = (0, react.useState)(seed.model);
7767
+ const [reasoningEffort, setReasoningEffort] = (0, react.useState)(seed.reasoningEffort);
7333
7768
  const inheritedPermission = parentTask === void 0 ? void 0 : effectiveTaskPermission(parentTask);
7334
7769
  const [reuseSession, setReuseSession] = (0, react.useState)(initialTask?.reuseSession ?? false);
7335
7770
  const [goalRun, setGoalRun] = (0, react.useState)(initialTask?.goalRun ?? false);
@@ -7357,18 +7792,18 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7357
7792
  const [parsePending, setParsePending] = (0, react.useState)(false);
7358
7793
  const [parseError, setParseError] = (0, react.useState)(void 0);
7359
7794
  const parseAbort = (0, react.useRef)(void 0);
7360
- const parseModels = options.models ?? [];
7795
+ const models = options.models ?? [];
7361
7796
  const workspaceKnown = workspaceId === "" || options.workspaces.some((item) => item.workspaceId === workspaceId);
7362
7797
  const modeKnown = mode === "" || options.presets.some((item) => item.id === mode);
7363
- const modelKnown = model === "" || parseModels.some((item) => item.id === model);
7798
+ const modelKnown = model === "" || models.some((item) => item.id === model);
7364
7799
  (0, react.useEffect)(() => controller.subscribe(() => {
7365
7800
  const snapshot = controller.getSnapshot();
7366
7801
  setOptions(snapshot.executionOptions);
7367
7802
  setGoalRunEnabled(snapshot.host?.goalRunEnabled === true);
7368
7803
  }), [controller]);
7369
7804
  (0, react.useEffect)(() => {
7370
- if (parseModel === "" || parseModels.length === 0) return;
7371
- if (parseModels.some((option) => option.id === parseModel)) return;
7805
+ if (parseModel === "" || models.length === 0) return;
7806
+ if (models.some((option) => option.id === parseModel)) return;
7372
7807
  setParseModel("");
7373
7808
  writeParseModelPreference("");
7374
7809
  }, [parseModel, options.models]);
@@ -7452,10 +7887,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7452
7887
  ...parentTask === void 0 ? {} : { parentId: parentTask.id },
7453
7888
  freeze,
7454
7889
  handover,
7455
- workspaceId: workspaceId === "" ? void 0 : workspaceId,
7456
- mode: mode === "" ? void 0 : mode,
7457
- permission: permission === "" ? void 0 : permission,
7458
- model: model === "" ? void 0 : model,
7890
+ ...workspaceId === "" ? {} : { workspaceId },
7891
+ ...mode === "" ? {} : { mode },
7892
+ ...permission === "" ? {} : { permission },
7893
+ ...model === "" ? {} : { model },
7894
+ ...reasoningEffort === "" ? {} : { reasoningEffort },
7459
7895
  ...reuseSession ? { reuseSession: true } : {},
7460
7896
  ...goalRun ? { goalRun: true } : {},
7461
7897
  ...skipVerification ? { skipVerification: true } : {},
@@ -7478,6 +7914,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7478
7914
  setError(controller.getSnapshot().transportError ?? t("new.required"));
7479
7915
  return;
7480
7916
  }
7917
+ await promoteParentForTeamRun(controller, parentTask);
7481
7918
  if (isDuplicate && archiveOriginal && initialTask !== void 0) if (onDuplicateSuccess !== void 0) await onDuplicateSuccess(initialTask.id);
7482
7919
  else await controller.archiveTask(initialTask.id);
7483
7920
  if (runAfterCreate) {
@@ -7489,19 +7926,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7489
7926
  const scheduleTimeZone = scheduleZone === "" ? hostTimeZone : scheduleZone;
7490
7927
  const scheduleNextRun = !scheduleEnabled ? void 0 : scheduleMode === "once" ? parseZonedInput(scheduleAt, scheduleTimeZone) : scheduleCron.trim() !== "" && isValidCron(scheduleCron) ? nextRunAtMs(scheduleCron, Date.now(), scheduleTimeZone) : void 0;
7491
7928
  const modalTitle = parentTask !== void 0 ? t("new.subtaskTitle") : isDuplicate ? t("new.duplicateTitle") : t("board.new");
7492
- const builtinPresets = options.presets.filter((preset) => isBuiltinPreset(preset.id));
7493
- const customPresets = options.presets.filter((preset) => !isBuiltinPreset(preset.id));
7929
+ const presetRows = presetChoiceRows(options.presets);
7494
7930
  const inheritLabel = inheritPresetLabel(options.presets);
7495
7931
  const selectedPreset = options.presets.find((preset) => preset.id === mode);
7496
7932
  const modeLabel = mode === "" ? inheritLabel : selectedPreset === void 0 ? mode : presetLabel(selectedPreset);
7497
7933
  const workspaceLabel = workspaceId === "" ? t("exec.workspace.recent") : options.workspaces.find((item) => item.workspaceId === workspaceId)?.title ?? workspaceId;
7498
7934
  const permissionLabel = permission === "" ? inheritedPermission === void 0 ? t("exec.permission.default") : t("exec.permission.inheritParent", { permission: t(`exec.permission.${inheritedPermission}`) }) : t(`exec.permission.${permission}`);
7499
7935
  const modelLabel = model === "" ? t("exec.model.default") : (options.models ?? []).find((item) => item.id === model)?.name ?? model;
7936
+ const modelSummary = reasoningEffort === "" ? modelLabel : `${modelLabel} · ${reasoningEffort}`;
7500
7937
  const executionSummary = [
7501
7938
  workspaceLabel,
7502
7939
  modeLabel,
7503
7940
  permissionLabel,
7504
- ...model === "" ? [] : [modelLabel]
7941
+ ...model === "" ? [] : [modelSummary]
7505
7942
  ].join(" · ");
7506
7943
  const tagCount = cleanTags(tags).length;
7507
7944
  const labelsSummary = tagCount === 0 ? t("new.summary.none") : t("new.summary.labelCount", { count: String(tagCount) });
@@ -7567,7 +8004,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7567
8004
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
7568
8005
  value: "",
7569
8006
  children: t("exec.model.default")
7570
- }), parseModels.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
8007
+ }), models.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
7571
8008
  value: option.id,
7572
8009
  children: option.name ?? option.id
7573
8010
  }, option.id))]
@@ -7595,7 +8032,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7595
8032
  ]
7596
8033
  })
7597
8034
  }),
7598
- parentTask !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
8035
+ parentTask !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
7599
8036
  className: board_module_css_default.detailText,
7600
8037
  "data-dsh-part": "subtask-inherit",
7601
8038
  children: [
@@ -7605,7 +8042,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7605
8042
  " · ",
7606
8043
  t("new.subtaskInherit")
7607
8044
  ]
7608
- }),
8045
+ }), parentAwaitsTeamRunPromotion(controller, parentTask) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8046
+ className: board_module_css_default.detailText,
8047
+ children: t("exec.teamRunAutoHint")
8048
+ })] }),
7609
8049
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(CollapsibleSection, {
7610
8050
  title: t("new.section.content"),
7611
8051
  defaultOpen: true,
@@ -7690,29 +8130,21 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7690
8130
  value: mode,
7691
8131
  children: [mode, t("exec.mode.removed")]
7692
8132
  }),
7693
- builtinPresets.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("optgroup", {
8133
+ presetRows.builtin.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("optgroup", {
7694
8134
  label: t("exec.mode.builtinGroup"),
7695
- children: builtinPresets.map((preset) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
7696
- value: preset.id,
7697
- disabled: preset.broken !== void 0,
7698
- children: [
7699
- presetLabel(preset),
7700
- preset.isDefault ? t("exec.mode.defaultSuffix") : "",
7701
- preset.broken !== void 0 ? t("exec.mode.brokenSuffix") : ""
7702
- ]
7703
- }, preset.id))
8135
+ children: presetRows.builtin.map((row) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
8136
+ value: row.id,
8137
+ disabled: row.disabled,
8138
+ children: row.label
8139
+ }, row.id))
7704
8140
  }),
7705
- customPresets.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("optgroup", {
8141
+ presetRows.custom.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("optgroup", {
7706
8142
  label: t("exec.mode.customGroup"),
7707
- children: customPresets.map((preset) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
7708
- value: preset.id,
7709
- disabled: preset.broken !== void 0,
7710
- children: [
7711
- presetLabel(preset),
7712
- preset.isDefault ? t("exec.mode.defaultSuffix") : "",
7713
- preset.broken !== void 0 ? t("exec.mode.brokenSuffix") : ""
7714
- ]
7715
- }, preset.id))
8143
+ children: presetRows.custom.map((row) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
8144
+ value: row.id,
8145
+ disabled: row.disabled,
8146
+ children: row.label
8147
+ }, row.id))
7716
8148
  })
7717
8149
  ]
7718
8150
  })]
@@ -7746,7 +8178,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7746
8178
  className: board_module_css_default.select,
7747
8179
  value: model,
7748
8180
  onChange: (event) => {
7749
- setModel(event.target.value);
8181
+ const next = event.target.value;
8182
+ setModel(next);
8183
+ setReasoningEffort((current) => reconcileReasoningEffort(models, next, current));
7750
8184
  },
7751
8185
  children: [
7752
8186
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
@@ -7757,12 +8191,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
7757
8191
  value: model,
7758
8192
  children: [model, t("exec.model.unknown")]
7759
8193
  }),
7760
- options.models?.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
8194
+ models.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
7761
8195
  value: item.id,
7762
8196
  children: item.name ?? item.id
7763
8197
  }, item.id))
7764
8198
  ]
7765
8199
  })]
8200
+ }),
8201
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ReasoningEffortField, {
8202
+ models,
8203
+ modelId: model,
8204
+ value: reasoningEffort,
8205
+ pending,
8206
+ onChange: setReasoningEffort
7766
8207
  })
7767
8208
  ]
7768
8209
  }),
@@ -8419,6 +8860,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
8419
8860
  setPending(true);
8420
8861
  setError(void 0);
8421
8862
  if (await controller.setParent(taskId, parent.id)) {
8863
+ await promoteParentForTeamRun(controller, parent);
8422
8864
  onClose();
8423
8865
  return;
8424
8866
  }
@@ -8445,6 +8887,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
8445
8887
  className: board_module_css_default.fieldHint,
8446
8888
  children: t("link.subtask.hint")
8447
8889
  }),
8890
+ parentAwaitsTeamRunPromotion(controller, parent) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8891
+ className: board_module_css_default.fieldHint,
8892
+ children: t("exec.teamRunAutoHint")
8893
+ }),
8448
8894
  candidates.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8449
8895
  className: board_module_css_default.detailText,
8450
8896
  children: t("link.subtask.empty")
@@ -8894,13 +9340,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
8894
9340
  /** The execution-target editor: workspace / mode / permission pickers. */
8895
9341
  function ExecutionSettingsSection({ controller, task, pending, executionOptions, teamRunAvailable, goalRunEnabled }) {
8896
9342
  const options = executionOptions;
9343
+ const models = options.models ?? [];
8897
9344
  const workspaceId = task.workspaceId ?? "";
8898
9345
  const mode = task.mode ?? "";
8899
9346
  const permission = task.permission ?? "";
8900
9347
  const model = task.model ?? "";
9348
+ const reasoningEffort = task.reasoningEffort ?? "";
8901
9349
  const workspaceKnown = workspaceId === "" || options.workspaces.some((item) => item.workspaceId === workspaceId);
8902
9350
  const modeKnown = mode === "" || options.presets.some((item) => item.id === mode);
8903
- const modelKnown = model === "" || (options.models ?? []).some((item) => item.id === model);
9351
+ const modelKnown = model === "" || models.some((item) => item.id === model);
8904
9352
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
8905
9353
  className: board_module_css_default.detailSection,
8906
9354
  children: [
@@ -9001,7 +9449,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
9001
9449
  value: model,
9002
9450
  disabled: pending,
9003
9451
  onChange: (event) => {
9004
- controller.updateTask(task.id, { model: event.target.value === "" ? void 0 : event.target.value });
9452
+ const next = event.target.value;
9453
+ const effort = reconcileReasoningEffort(models, next, reasoningEffort);
9454
+ controller.updateTask(task.id, {
9455
+ model: next,
9456
+ ...effort === reasoningEffort ? {} : { reasoningEffort: effort }
9457
+ });
9005
9458
  },
9006
9459
  children: [
9007
9460
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
@@ -9012,13 +9465,22 @@ Please report this to https://github.com/markedjs/marked.`, e) {
9012
9465
  value: model,
9013
9466
  children: [model, t("exec.model.unknown")]
9014
9467
  }),
9015
- options.models?.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
9468
+ models.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
9016
9469
  value: item.id,
9017
9470
  children: item.name ?? item.id
9018
9471
  }, item.id))
9019
9472
  ]
9020
9473
  })]
9021
9474
  }),
9475
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ReasoningEffortField, {
9476
+ models,
9477
+ modelId: model,
9478
+ value: reasoningEffort,
9479
+ pending,
9480
+ onChange: (effort) => {
9481
+ controller.updateTask(task.id, { reasoningEffort: effort });
9482
+ }
9483
+ }),
9022
9484
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
9023
9485
  className: board_module_css_default.scheduleToggle,
9024
9486
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
@@ -9471,6 +9933,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
9471
9933
  });
9472
9934
  }
9473
9935
  /**
9936
+ * The run hint of one card: how many subtasks a run opens, counting the same
9937
+ * members the Host will launch (`joinsCascadeRun` leaves a finished subtask
9938
+ * alone), or why it opens none even though the card has subtasks.
9939
+ */
9940
+ function subtaskRunHint(parentId, children) {
9941
+ const runnable = children.filter((child) => joinsCascadeRun(child, parentId));
9942
+ return runnable.length > 0 ? t("detail.subtasks.runHint", { count: String(runnable.length) }) : t("detail.subtasks.runHintSettled");
9943
+ }
9944
+ /**
9474
9945
  * The subtask block: the parent link, the direct subtasks with their status,
9475
9946
  * and the actions that grow or prune the tree. Every gate here mirrors the
9476
9947
  * Host lineage gate for affordance only; the Host re-checks the action.
@@ -9544,7 +10015,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
9544
10015
  }),
9545
10016
  children.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
9546
10017
  className: board_module_css_default.detailText,
9547
- children: t("detail.subtasks.runHint", { count: String(children.length) })
10018
+ children: subtaskRunHint(task.id, children)
9548
10019
  }),
9549
10020
  !archived && (canAddChild ? controller.isHostBacked() ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
9550
10021
  className: board_module_css_default.subtaskAddRow,
@@ -9901,7 +10372,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
9901
10372
  type: "button",
9902
10373
  className: board_module_css_default.primaryButton,
9903
10374
  disabled: busy || pending,
9904
- title: subtaskChildren.length > 0 ? t("detail.subtasks.runHint", { count: String(subtaskChildren.length) }) : void 0,
10375
+ title: subtaskChildren.length > 0 ? subtaskRunHint(current.id, subtaskChildren) : void 0,
9905
10376
  onClick: () => {
9906
10377
  controller.rerunTask(current.id).then(() => {
9907
10378
  if (controller.getSnapshot().transportError === void 0) controller.closeTask();
@@ -10704,6 +11175,83 @@ Please report this to https://github.com/markedjs/marked.`, e) {
10704
11175
  "selectWrap": "Jh0q7G_selectWrap"
10705
11176
  };
10706
11177
  //#endregion
11178
+ //#region src/client/CardDefaultPresetField.tsx
11179
+ /**
11180
+ * Render the default-preset select.
11181
+ * @param props - the field contract and the roster to list.
11182
+ * @returns the field.
11183
+ */
11184
+ function CardDefaultPresetField(props) {
11185
+ const presets = props.presets;
11186
+ const rows = presetChoiceRows(presets ?? []);
11187
+ const unlisted = props.text !== "" && presets !== void 0 && !presets.some((preset) => preset.id === props.text);
11188
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11189
+ className: settings_card_module_css_default.field,
11190
+ children: [
11191
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
11192
+ className: settings_card_module_css_default.head,
11193
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
11194
+ className: settings_card_module_css_default.label,
11195
+ htmlFor: props.id,
11196
+ children: props.label
11197
+ }), props.overridden ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
11198
+ className: settings_card_module_css_default.badges,
11199
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
11200
+ className: settings_card_module_css_default.badge,
11201
+ children: props.overriddenLabel
11202
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
11203
+ type: "button",
11204
+ className: settings_card_module_css_default.reset,
11205
+ disabled: props.disabled,
11206
+ onClick: props.onReset,
11207
+ children: props.resetLabel
11208
+ })]
11209
+ }) : null]
11210
+ }),
11211
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
11212
+ id: props.id,
11213
+ className: settings_card_module_css_default.select,
11214
+ value: props.text,
11215
+ disabled: props.disabled,
11216
+ "aria-invalid": props.invalid || void 0,
11217
+ onChange: (event) => {
11218
+ props.onEdit(event.target.value);
11219
+ },
11220
+ children: [
11221
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
11222
+ value: "",
11223
+ children: inheritPresetLabel(presets ?? [])
11224
+ }),
11225
+ unlisted ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("option", {
11226
+ value: props.text,
11227
+ children: [props.text, t("exec.mode.removed")]
11228
+ }) : null,
11229
+ rows.builtin.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("optgroup", {
11230
+ label: t("exec.mode.builtinGroup"),
11231
+ children: rows.builtin.map((row) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
11232
+ value: row.id,
11233
+ disabled: row.disabled,
11234
+ children: row.label
11235
+ }, row.id))
11236
+ }) : null,
11237
+ rows.custom.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("optgroup", {
11238
+ label: t("exec.mode.customGroup"),
11239
+ children: rows.custom.map((row) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
11240
+ value: row.id,
11241
+ disabled: row.disabled,
11242
+ children: row.label
11243
+ }, row.id))
11244
+ }) : null
11245
+ ]
11246
+ }),
11247
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
11248
+ className: props.invalid ? settings_card_module_css_default.invalid : settings_card_module_css_default.hint,
11249
+ children: props.invalid ? props.invalidLabel : props.hint
11250
+ })
11251
+ ]
11252
+ });
11253
+ }
11254
+ //#endregion
10707
11255
  //#region src/client/PluginSettingsCard.tsx
10708
11256
  /**
10709
11257
  * Family-shared chrome for plugin settings cards: a disclosure header naming
@@ -11162,20 +11710,21 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11162
11710
  });
11163
11711
  }
11164
11712
  //#endregion
11165
- //#region \0dsh-store-engine
11166
- const platform = ["@deepseek-ai/dsh-client", "-store"].join("");
11167
- const legacy = ["@deepseek-ai/dsh-client-runtime", "/client"].join("");
11168
- let engine;
11169
- try {
11170
- engine = require(platform);
11171
- } catch {
11172
- engine = require(legacy);
11173
- }
11174
- const createSnapshotStore = engine.createSnapshotStore;
11175
- engine.defineStore;
11176
- engine.shallowEqual;
11177
- //#endregion
11178
11713
  //#region src/client/settings-form.ts
11714
+ /** A free-text field. An empty draft clears the field. */
11715
+ function textField(field) {
11716
+ return {
11717
+ field,
11718
+ format: (value) => typeof value === "string" ? value : "",
11719
+ parse: (text) => {
11720
+ const trimmed = text.trim();
11721
+ return trimmed === "" ? { kind: "clear" } : {
11722
+ kind: "set",
11723
+ value: trimmed
11724
+ };
11725
+ }
11726
+ };
11727
+ }
11179
11728
  /** A boolean field, edited through true/false draft text. */
11180
11729
  function booleanField(field) {
11181
11730
  return {
@@ -11195,6 +11744,20 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11195
11744
  }
11196
11745
  };
11197
11746
  }
11747
+ /** An enumerated string field; only the listed choices are accepted. An empty draft clears the field. */
11748
+ function choiceField(field, choices) {
11749
+ return {
11750
+ field,
11751
+ format: (value) => typeof value === "string" && choices.includes(value) ? value : "",
11752
+ parse: (text) => {
11753
+ if (text === "") return { kind: "clear" };
11754
+ return choices.includes(text) ? {
11755
+ kind: "set",
11756
+ value: text
11757
+ } : void 0;
11758
+ }
11759
+ };
11760
+ }
11198
11761
  /**
11199
11762
  * Stages one card's edits over one settings namespace and writes them on save.
11200
11763
  *
@@ -11236,7 +11799,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11236
11799
  }
11237
11800
  /** Publish a projection of this form, rebuilt whenever the form or a draft changes. */
11238
11801
  bind(project) {
11239
- const store = createSnapshotStore(project());
11802
+ const store = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)(project());
11240
11803
  this.listeners.add(() => {
11241
11804
  store.set(project());
11242
11805
  });
@@ -11536,36 +12099,42 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11536
12099
  };
11537
12100
  }
11538
12101
  /**
11539
- * The judge-model field: blank inherits the host model catalog default, and a
11540
- * non-blank draft must be a qualified provider/model route. An unparseable
11541
- * draft blocks the save instead of storing a route nothing can resolve.
12102
+ * The run-launch width field: a whole number of concurrent launches inside the
12103
+ * supported range, because the Host schema (`runLaunchWidth`) is numeric. A
12104
+ * draft outside the range blocks the save instead of staging a value the Host
12105
+ * would clamp behind the user's back.
11542
12106
  */
11543
- function judgeModelField() {
12107
+ function runLaunchWidthField() {
11544
12108
  return {
11545
- field: "goalVerificationModel",
11546
- format: (value) => typeof value === "string" ? value : "",
12109
+ field: "runLaunchWidth",
12110
+ format: (value) => typeof value === "number" && Number.isInteger(value) ? String(value) : "",
11547
12111
  parse: (text) => {
11548
12112
  const trimmed = text.trim();
11549
12113
  if (trimmed === "") return { kind: "clear" };
11550
- return parseModelRoute(trimmed) === void 0 ? void 0 : {
12114
+ if (!/^\d+$/.test(trimmed)) return void 0;
12115
+ const width = Number(trimmed);
12116
+ return width >= 1 && width <= 16 ? {
11551
12117
  kind: "set",
11552
- value: trimmed
11553
- };
12118
+ value: width
12119
+ } : void 0;
11554
12120
  }
11555
12121
  };
11556
12122
  }
11557
12123
  /**
11558
- * The reasoning-effort field. Any non-blank id is staged: which levels a model
11559
- * accepts is decided by the host catalog, and the settings card shows the
11560
- * resolved level (including a fallback) rather than guessing here.
12124
+ * The judge-model field: blank inherits the host model catalog default, and a
12125
+ * non-blank draft must be a qualified provider/model route. An unparseable
12126
+ * draft blocks the save instead of storing a route nothing can resolve.
12127
+ * The new-card default model uses the same gate, so both fields accept exactly
12128
+ * the routes an execution can pin.
11561
12129
  */
11562
- function judgeEffortField() {
12130
+ function modelRouteField(field) {
11563
12131
  return {
11564
- field: "goalVerificationReasoningEffort",
12132
+ field,
11565
12133
  format: (value) => typeof value === "string" ? value : "",
11566
12134
  parse: (text) => {
11567
12135
  const trimmed = text.trim();
11568
- return trimmed === "" ? { kind: "clear" } : {
12136
+ if (trimmed === "") return { kind: "clear" };
12137
+ return parseModelRoute(trimmed) === void 0 ? void 0 : {
11569
12138
  kind: "set",
11570
12139
  value: trimmed
11571
12140
  };
@@ -11577,6 +12146,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11577
12146
  dispatch;
11578
12147
  form;
11579
12148
  store;
12149
+ /** The deployment's agent-preset roster, once its runtime read has answered. */
12150
+ presets;
11580
12151
  /** @param scope - the bound configuration form for the `task-board` namespace. */
11581
12152
  constructor(scope, dispatch) {
11582
12153
  this.dispatch = dispatch;
@@ -11586,10 +12157,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11586
12157
  booleanField("preventIdleSleep"),
11587
12158
  subtaskDepthField(),
11588
12159
  sessionPollField(),
12160
+ runLaunchWidthField(),
11589
12161
  booleanField("goalRunEnabled"),
11590
12162
  booleanField("goalVerification"),
11591
- judgeModelField(),
11592
- judgeEffortField()
12163
+ modelRouteField("goalVerificationModel"),
12164
+ textField("goalVerificationReasoningEffort"),
12165
+ textField("cardDefaultMode"),
12166
+ choiceField("cardDefaultPermission", TASK_PERMISSIONS),
12167
+ modelRouteField("cardDefaultModel"),
12168
+ textField("cardDefaultReasoningEffort")
11593
12169
  ]);
11594
12170
  this.store = this.form.bind(() => this.projection());
11595
12171
  }
@@ -11601,13 +12177,32 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11601
12177
  preventIdleSleep: this.form.field("preventIdleSleep"),
11602
12178
  maxSubtaskDepth: this.form.field("maxSubtaskDepth"),
11603
12179
  sessionPollSeconds: this.form.field("sessionPollSeconds"),
12180
+ runLaunchWidth: this.form.field("runLaunchWidth"),
11604
12181
  goalRunEnabled: this.form.field("goalRunEnabled"),
11605
12182
  goalVerification: this.form.field("goalVerification"),
11606
12183
  goalVerificationModel: this.form.field("goalVerificationModel"),
11607
- goalVerificationReasoningEffort: this.form.field("goalVerificationReasoningEffort")
12184
+ goalVerificationReasoningEffort: this.form.field("goalVerificationReasoningEffort"),
12185
+ cardDefaultMode: this.form.field("cardDefaultMode"),
12186
+ cardDefaultPermission: this.form.field("cardDefaultPermission"),
12187
+ cardDefaultModel: this.form.field("cardDefaultModel"),
12188
+ cardDefaultReasoningEffort: this.form.field("cardDefaultReasoningEffort"),
12189
+ ...this.presets === void 0 ? {} : { presets: this.presets }
11608
12190
  };
11609
12191
  }
11610
12192
  /**
12193
+ * Publish the deployment's agent-preset roster to the default-preset field.
12194
+ * The roster is a runtime fact read outside this card (src/client/index.ts
12195
+ * wires it once for both the board's pickers and this topic); it can arrive
12196
+ * late or not at all, and until it does the field lists the inherit choice
12197
+ * alone. This never blocks a save: a deployment that serves no roster still
12198
+ * has a writable settings document.
12199
+ * @param presets - the roster rows.
12200
+ */
12201
+ setPresetRoster(presets) {
12202
+ this.presets = presets;
12203
+ this.store.set(this.projection());
12204
+ }
12205
+ /**
11611
12206
  * Build the face the card's slot registration injects.
11612
12207
  * @returns the card's snapshot and its form actions.
11613
12208
  */
@@ -11723,6 +12318,22 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11723
12318
  invalidLabel: t("settings.invalidNumber"),
11724
12319
  disabled
11725
12320
  };
12321
+ const defaultModels = modelOptionsFromCatalog(catalog);
12322
+ const defaultModel = state.cardDefaultModel.text;
12323
+ const defaultEffortChoices = reasoningEffortsFor(defaultModels, defaultModel).map((effort) => ({
12324
+ value: effort,
12325
+ label: effort
12326
+ }));
12327
+ /**
12328
+ * Drop a staged default level the newly picked default model cannot honour,
12329
+ * exactly as the create dialog's own model picker does (one shared rule):
12330
+ * the level belongs to the route it was chosen for.
12331
+ */
12332
+ const dropUnhonouredEffort = (nextModel) => {
12333
+ const current = state.cardDefaultReasoningEffort.text;
12334
+ const kept = reconcileReasoningEffort(defaultModels, nextModel, current);
12335
+ if (kept !== current) props.edit("cardDefaultReasoningEffort", kept);
12336
+ };
11726
12337
  const nestedShell = {
11727
12338
  available: true,
11728
12339
  exposed: true,
@@ -11835,6 +12446,20 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11835
12446
  onReset: () => {
11836
12447
  props.resetField("maxSubtaskDepth");
11837
12448
  }
12449
+ }),
12450
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ValueField, {
12451
+ id: "settings-task-board-run-launch-width",
12452
+ label: t("settings.runLaunchWidth"),
12453
+ hint: t("settings.runLaunchWidthHint"),
12454
+ numeric: true,
12455
+ ...fieldProps,
12456
+ ...state.runLaunchWidth,
12457
+ onEdit: (text) => {
12458
+ props.edit("runLaunchWidth", text);
12459
+ },
12460
+ onReset: () => {
12461
+ props.resetField("runLaunchWidth");
12462
+ }
11838
12463
  })
11839
12464
  ]
11840
12465
  }),
@@ -11949,6 +12574,83 @@ Please report this to https://github.com/markedjs/marked.`, e) {
11949
12574
  })
11950
12575
  ]
11951
12576
  }),
12577
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(PluginSettingsCard, {
12578
+ t,
12579
+ titleKey: "settings.cardDefaultsTitle",
12580
+ descriptionKey: "settings.cardDefaultsCardHint",
12581
+ defaultOpen: false,
12582
+ hideFooter: true,
12583
+ state: nestedShell,
12584
+ onSave: props.save,
12585
+ onDiscard: props.discard,
12586
+ children: [
12587
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CardDefaultPresetField, {
12588
+ id: "settings-task-board-card-default-mode",
12589
+ label: t("new.agentPreset"),
12590
+ hint: t("settings.cardDefaultModeHint"),
12591
+ presets: state.presets,
12592
+ ...fieldProps,
12593
+ ...state.cardDefaultMode,
12594
+ onEdit: (text) => {
12595
+ props.edit("cardDefaultMode", text);
12596
+ },
12597
+ onReset: () => {
12598
+ props.resetField("cardDefaultMode");
12599
+ }
12600
+ }),
12601
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChoiceField, {
12602
+ id: "settings-task-board-card-default-permission",
12603
+ label: t("new.permission"),
12604
+ hint: t("settings.cardDefaultPermissionHint"),
12605
+ inheritLabel: t("exec.permission.default"),
12606
+ choices: TASK_PERMISSIONS.map((id) => ({
12607
+ value: id,
12608
+ label: t(`exec.permission.${id}`)
12609
+ })),
12610
+ ...fieldProps,
12611
+ ...state.cardDefaultPermission,
12612
+ onEdit: (text) => {
12613
+ props.edit("cardDefaultPermission", text);
12614
+ },
12615
+ onReset: () => {
12616
+ props.resetField("cardDefaultPermission");
12617
+ }
12618
+ }),
12619
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChoiceField, {
12620
+ id: "settings-task-board-card-default-model",
12621
+ label: t("new.model"),
12622
+ hint: t("settings.cardDefaultModelHint"),
12623
+ inheritLabel: t("exec.model.default"),
12624
+ choices: modelChoiceRows(defaultModels),
12625
+ ...fieldProps,
12626
+ ...state.cardDefaultModel,
12627
+ onEdit: (text) => {
12628
+ props.edit("cardDefaultModel", text);
12629
+ dropUnhonouredEffort(text);
12630
+ },
12631
+ onReset: () => {
12632
+ props.resetField("cardDefaultModel");
12633
+ dropUnhonouredEffort("");
12634
+ }
12635
+ }),
12636
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChoiceField, {
12637
+ id: "settings-task-board-card-default-effort",
12638
+ label: t("exec.reasoning"),
12639
+ hint: t(reasoningHintKey(defaultModels, defaultModel)),
12640
+ inheritLabel: t("exec.reasoning.inherit"),
12641
+ choices: defaultEffortChoices,
12642
+ ...fieldProps,
12643
+ ...state.cardDefaultReasoningEffort,
12644
+ disabled: disabled || !reasoningPickerEnabled(defaultModels, defaultModel),
12645
+ onEdit: (text) => {
12646
+ props.edit("cardDefaultReasoningEffort", text);
12647
+ },
12648
+ onReset: () => {
12649
+ props.resetField("cardDefaultReasoningEffort");
12650
+ }
12651
+ })
12652
+ ]
12653
+ }),
11952
12654
  renderSlot("task-board.settings.section", { dispatch })
11953
12655
  ]
11954
12656
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
@@ -12336,7 +13038,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
12336
13038
  /** The building package's version, when the bundle carries it. */
12337
13039
  function bakedVersion() {
12338
13040
  try {
12339
- return "0.4.6";
13041
+ return "0.4.7";
12340
13042
  } catch {
12341
13043
  return;
12342
13044
  }
@@ -12535,8 +13237,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
12535
13237
  base: void 0,
12536
13238
  user: void 0,
12537
13239
  revision: void 0,
12538
- writable: false,
12539
- mode: "host"
13240
+ writable: false
12540
13241
  };
12541
13242
  }
12542
13243
  /**
@@ -12728,25 +13429,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
12728
13429
  "layout"
12729
13430
  ];
12730
13431
  /**
12731
- * Read the agent-preset roster through the generated api-remotes face. The
12732
- * caller passes the namespace resolved inside its scoped inject, so a host
12733
- * that serves no such namespace never reaches here; a host that serves it
12734
- * answers `ok: false` instead, which leaves the picker options untouched.
12735
- * @param remote - the `remote.agentPresets` namespace.
12736
- * @returns the roster, or a failed read the caller ignores.
12737
- */
12738
- async function readPresetRoster(remote) {
12739
- const response = await remote.list();
12740
- if (!response.ok) return {
12741
- ok: false,
12742
- presets: []
12743
- };
12744
- return {
12745
- ok: true,
12746
- presets: response.value.presets
12747
- };
12748
- }
12749
- /**
12750
13432
  * Mount the task board.
12751
13433
  * @param ctx - client root context (services: sessions, workspaces).
12752
13434
  */
@@ -12789,6 +13471,31 @@ Please report this to https://github.com/markedjs/marked.`, e) {
12789
13471
  ctx.effect(() => () => {
12790
13472
  settingsCard.dispose();
12791
13473
  }, "task-board: settings card");
13474
+ let presetRoster;
13475
+ let liveController;
13476
+ const pushPresetOptions = async (presetRemote) => {
13477
+ try {
13478
+ const roster = await readPresetRoster(presetRemote);
13479
+ if (!roster.ok) return;
13480
+ const presets = presetOptionsFromRoster(roster.presets);
13481
+ presetRoster = presets;
13482
+ settingsCard.setPresetRoster(presets);
13483
+ liveController?.setExecutionOptions({ presets });
13484
+ } catch (error) {
13485
+ console.error("[dsh-task-board] agent preset roster read failed", error);
13486
+ }
13487
+ };
13488
+ const presetRosterFeed = ctx.inject(["remote.agentPresets"], (inner) => {
13489
+ const presetRemote = inner.get("remote.agentPresets");
13490
+ if (presetRemote === void 0) return;
13491
+ pushPresetOptions(presetRemote);
13492
+ return inner.on("connection/reset", () => {
13493
+ pushPresetOptions(presetRemote);
13494
+ });
13495
+ });
13496
+ ctx.effect(() => () => {
13497
+ presetRosterFeed.dispose();
13498
+ }, "task-board: agent preset roster");
12792
13499
  let uiDisposer;
12793
13500
  const mountUi = () => {
12794
13501
  if (uiDisposer !== void 0) return;
@@ -12810,6 +13517,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
12810
13517
  controller.start();
12811
13518
  clientService.attach(controller);
12812
13519
  const disposers = [];
13520
+ liveController = controller;
13521
+ if (presetRoster !== void 0) controller.setExecutionOptions({ presets: presetRoster });
13522
+ let followedDefaults = cardDefaultSignature(settingsForm.getSnapshot().value);
13523
+ disposers.push(settingsForm.subscribe(() => {
13524
+ const next = cardDefaultSignature(settingsForm.getSnapshot().value);
13525
+ if (next === followedDefaults) return;
13526
+ followedDefaults = next;
13527
+ controller.refreshHostState();
13528
+ }));
12813
13529
  const pushWorkspaceOptions = () => {
12814
13530
  const snapshot = workspaces.list.getSnapshot();
12815
13531
  controller.setExecutionOptions({ workspaces: snapshot.items.map((item) => ({
@@ -12822,32 +13538,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
12822
13538
  controller.setWorkspaceCreator(async (path) => {
12823
13539
  return { workspaceId: (await workspaces.create({ path })).workspaceId };
12824
13540
  });
12825
- const pushPresetOptions = async (presetRemote) => {
12826
- try {
12827
- const roster = await readPresetRoster(presetRemote);
12828
- if (!roster.ok) return;
12829
- controller.setExecutionOptions({ presets: roster.presets.map((preset) => ({
12830
- id: preset.id,
12831
- name: preset.name,
12832
- description: preset.description,
12833
- broken: preset.broken,
12834
- isDefault: preset.isDefault
12835
- })) });
12836
- } catch (error) {
12837
- console.error("[dsh-task-board] agent preset roster read failed", error);
12838
- }
12839
- };
12840
- const presetRosterFeed = ctx.inject(["remote.agentPresets"], (inner) => {
12841
- const presetRemote = inner.get("remote.agentPresets");
12842
- if (presetRemote === void 0) return;
12843
- pushPresetOptions(presetRemote);
12844
- return inner.on("connection/reset", () => {
12845
- pushPresetOptions(presetRemote);
12846
- });
12847
- });
12848
- disposers.push(() => {
12849
- presetRosterFeed.dispose();
12850
- });
12851
13541
  const pushModelOptions = async () => {
12852
13542
  try {
12853
13543
  let models = [];
@@ -12859,43 +13549,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
12859
13549
  }
12860
13550
  if (typeof sessionRemote?.modelCatalog === "function") {
12861
13551
  const res = await sessionRemote.modelCatalog();
12862
- if (res.ok && Array.isArray(res.value?.groups)) for (const g of res.value.groups) {
12863
- const provider = g.id ?? g.provider;
12864
- for (const m of g.models ?? []) {
12865
- const qualifiedId = provider ? `${provider}/${m.id}` : m.id;
12866
- models.push({
12867
- id: qualifiedId,
12868
- name: m.name ?? m.id,
12869
- provider
12870
- });
12871
- }
12872
- }
13552
+ if (res.ok) models = modelOptionsFromCatalog(res.value);
12873
13553
  }
12874
13554
  if (models.length === 0) {
12875
13555
  const conn = ctx.get("connection");
12876
13556
  if (conn?.api) {
12877
- if (typeof conn.api.llm?.discoverModels === "function") {
12878
- const list = (await conn.api.llm.discoverModels())?.result?.value?.models;
12879
- if (Array.isArray(list)) models = list.map((m) => ({
12880
- id: m.id,
12881
- name: m.name
12882
- }));
12883
- }
13557
+ if (typeof conn.api.llm?.discoverModels === "function") models = modelOptionsFromDiscoveredModels((await conn.api.llm.discoverModels())?.result?.value?.models);
12884
13558
  const catalogFn = typeof conn.api.session?.modelCatalog === "function" ? conn.api.session.modelCatalog : typeof conn.api.sessions?.modelCatalog === "function" ? conn.api.sessions.modelCatalog : void 0;
12885
- if (models.length === 0 && catalogFn !== void 0) {
12886
- const groups = (await catalogFn())?.result?.value?.groups;
12887
- if (Array.isArray(groups)) for (const g of groups) {
12888
- const provider = g.id ?? g.provider;
12889
- for (const m of g.models ?? []) {
12890
- const qualifiedId = provider ? `${provider}/${m.id}` : m.id;
12891
- models.push({
12892
- id: qualifiedId,
12893
- name: m.name ?? m.id,
12894
- provider
12895
- });
12896
- }
12897
- }
12898
- }
13559
+ if (models.length === 0 && catalogFn !== void 0) models = modelOptionsFromCatalog((await catalogFn())?.result?.value);
12899
13560
  }
12900
13561
  }
12901
13562
  if (models.length > 0) controller.setExecutionOptions({ models });
@@ -12925,6 +13586,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
12925
13586
  for (const dispose of disposers.splice(0)) dispose();
12926
13587
  clientService.detach();
12927
13588
  controller.dispose();
13589
+ liveController = void 0;
12928
13590
  uiDisposer = void 0;
12929
13591
  };
12930
13592
  };
@@ -12966,6 +13628,26 @@ Please report this to https://github.com/markedjs/marked.`, e) {
12966
13628
  });
12967
13629
  }
12968
13630
  /**
13631
+ * The four new-card defaults one settings document holds, as a change
13632
+ * signature.
13633
+ *
13634
+ * Deliberately nothing but those four keys: the settings form also carries the
13635
+ * board's own switches and the acceptance configuration, and an edit to one of
13636
+ * those says nothing about the defaults the create dialog prefills from. Not a
13637
+ * second normalization of Host state — the value never leaves this comparison.
13638
+ * @param value - the settings form's effective section, if it has one.
13639
+ * @returns a stable string that changes exactly when the defaults do.
13640
+ */
13641
+ function cardDefaultSignature(value) {
13642
+ const section = value ?? {};
13643
+ return JSON.stringify([
13644
+ section.cardDefaultMode,
13645
+ section.cardDefaultPermission,
13646
+ section.cardDefaultModel,
13647
+ section.cardDefaultReasoningEffort
13648
+ ]);
13649
+ }
13650
+ /**
12969
13651
  * The profile entry id this package's own row carries, for a page that serves
12970
13652
  * no family binder.
12971
13653
  *