@cuadra-ai/uikit 0.1.13 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,23 +1,23 @@
1
- var jt = Object.defineProperty;
2
- var $t = (e, r, t) => r in e ? jt(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
- var le = (e, r, t) => $t(e, typeof r != "symbol" ? r + "" : r, t);
4
- import { jsx as d, jsxs as v, Fragment as B } from "react/jsx-runtime";
5
- import { forwardRef as tt, createElement as Ne, useMemo as W, useState as N, useEffect as M, useCallback as te, memo as Ot, useRef as rt, createContext as Ut } from "react";
6
- import { createPortal as $e } from "react-dom";
7
- import { useLocalRuntime as nt, AssistantRuntimeProvider as at, unstable_useRemoteThreadListRuntime as Bt, useThreadRuntime as Wt, ThreadPrimitive as ee, ComposerPrimitive as ke, useAssistantApi as Ht, MessagePrimitive as se, ThreadListPrimitive as xe, useThreadListItem as qt, useThread as Kt, ThreadListItemPrimitive as we } from "@assistant-ui/react";
8
- import { unstable_memoizeMarkdownComponents as Vt, useIsMarkdownCodeBlock as Gt, MarkdownTextPrimitive as Zt } from "@assistant-ui/react-markdown";
9
- const Jt = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Qt = (e) => e.replace(
1
+ var Ut = Object.defineProperty;
2
+ var Bt = (e, r, t) => r in e ? Ut(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
+ var le = (e, r, t) => Bt(e, typeof r != "symbol" ? r + "" : r, t);
4
+ import { jsx as d, jsxs as T, Fragment as W } from "react/jsx-runtime";
5
+ import $e, { forwardRef as rt, createElement as Ne, useMemo as U, useState as N, useEffect as L, useCallback as J, memo as Wt, useRef as nt, createContext as Ht } from "react";
6
+ import { createPortal as Oe } from "react-dom";
7
+ import { useThreadListItem as at, RuntimeAdapterProvider as qt, useLocalRuntime as it, AssistantRuntimeProvider as ot, unstable_useRemoteThreadListRuntime as Kt, useThreadRuntime as Vt, ThreadPrimitive as te, ComposerPrimitive as ke, useAssistantApi as Gt, MessagePrimitive as se, ThreadListPrimitive as xe, useThread as Zt, ThreadListItemPrimitive as we } from "@assistant-ui/react";
8
+ import { unstable_memoizeMarkdownComponents as Jt, useIsMarkdownCodeBlock as Qt, MarkdownTextPrimitive as Xt } from "@assistant-ui/react-markdown";
9
+ const Yt = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), er = (e) => e.replace(
10
10
  /^([A-Z])|[\s-_]+(\w)/g,
11
11
  (r, t, n) => n ? n.toUpperCase() : t.toLowerCase()
12
- ), Oe = (e) => {
13
- const r = Qt(e);
12
+ ), Ue = (e) => {
13
+ const r = er(e);
14
14
  return r.charAt(0).toUpperCase() + r.slice(1);
15
- }, it = (...e) => e.filter((r, t, n) => !!r && r.trim() !== "" && n.indexOf(r) === t).join(" ").trim(), Xt = (e) => {
15
+ }, lt = (...e) => e.filter((r, t, n) => !!r && r.trim() !== "" && n.indexOf(r) === t).join(" ").trim(), tr = (e) => {
16
16
  for (const r in e)
17
17
  if (r.startsWith("aria-") || r === "role" || r === "title")
18
18
  return !0;
19
19
  };
20
- var Yt = {
20
+ var rr = {
21
21
  xmlns: "http://www.w3.org/2000/svg",
22
22
  width: 24,
23
23
  height: 24,
@@ -28,7 +28,7 @@ var Yt = {
28
28
  strokeLinecap: "round",
29
29
  strokeLinejoin: "round"
30
30
  };
31
- const er = tt(
31
+ const nr = rt(
32
32
  ({
33
33
  color: e = "currentColor",
34
34
  size: r = 24,
@@ -42,66 +42,66 @@ const er = tt(
42
42
  "svg",
43
43
  {
44
44
  ref: l,
45
- ...Yt,
45
+ ...rr,
46
46
  width: r,
47
47
  height: r,
48
48
  stroke: e,
49
49
  strokeWidth: n ? Number(t) * 24 / Number(r) : t,
50
- className: it("lucide", i),
51
- ...!o && !Xt(u) && { "aria-hidden": "true" },
50
+ className: lt("lucide", i),
51
+ ...!o && !tr(u) && { "aria-hidden": "true" },
52
52
  ...u
53
53
  },
54
54
  [
55
- ...a.map(([s, f]) => Ne(s, f)),
55
+ ...a.map(([c, f]) => Ne(c, f)),
56
56
  ...Array.isArray(o) ? o : [o]
57
57
  ]
58
58
  )
59
59
  );
60
60
  const j = (e, r) => {
61
- const t = tt(
62
- ({ className: n, ...i }, o) => Ne(er, {
61
+ const t = rt(
62
+ ({ className: n, ...i }, o) => Ne(nr, {
63
63
  ref: o,
64
64
  iconNode: r,
65
- className: it(
66
- `lucide-${Jt(Oe(e))}`,
65
+ className: lt(
66
+ `lucide-${Yt(Ue(e))}`,
67
67
  `lucide-${e}`,
68
68
  n
69
69
  ),
70
70
  ...i
71
71
  })
72
72
  );
73
- return t.displayName = Oe(e), t;
73
+ return t.displayName = Ue(e), t;
74
74
  };
75
- const tr = [
75
+ const ar = [
76
76
  ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
77
77
  ["path", { d: "M12 19V5", key: "x0mq9r" }]
78
- ], rr = j("arrow-up", tr);
79
- const nr = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], ar = j("check", nr);
80
- const ir = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], or = j("chevron-down", ir);
81
- const lr = [
78
+ ], ir = j("arrow-up", ar);
79
+ const or = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], lr = j("check", or);
80
+ const ur = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], cr = j("chevron-down", ur);
81
+ const sr = [
82
82
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
83
83
  ["path", { d: "M12 18a6 6 0 0 0 0-12v12z", key: "j4l70d" }]
84
- ], ur = j("contrast", lr);
85
- const cr = [
84
+ ], dr = j("contrast", sr);
85
+ const fr = [
86
86
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
87
87
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
88
- ], sr = j("copy", cr);
89
- const dr = [
88
+ ], hr = j("copy", fr);
89
+ const mr = [
90
90
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
91
91
  ["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
92
92
  ["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
93
- ], fr = j("ellipsis-vertical", dr);
94
- const hr = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], ot = j("loader-circle", hr);
95
- const mr = [
93
+ ], pr = j("ellipsis-vertical", mr);
94
+ const gr = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], ut = j("loader-circle", gr);
95
+ const br = [
96
96
  ["path", { d: "M4 5h16", key: "1tepv9" }],
97
97
  ["path", { d: "M4 12h16", key: "1lakjw" }],
98
98
  ["path", { d: "M4 19h16", key: "1djgab" }]
99
- ], pr = j("menu", mr);
100
- const gr = [
99
+ ], kr = j("menu", br);
100
+ const xr = [
101
101
  ["path", { d: "M5 12h14", key: "1ays0h" }],
102
102
  ["path", { d: "M12 5v14", key: "s699le" }]
103
- ], br = j("plus", gr);
104
- class lt {
103
+ ], wr = j("plus", xr);
104
+ class ct {
105
105
  constructor(r, t, n = !1) {
106
106
  le(this, "baseUrl");
107
107
  le(this, "sessionToken", null);
@@ -225,23 +225,23 @@ class lt {
225
225
  });
226
226
  if (!l.ok) {
227
227
  const f = await l.text();
228
- let c = {};
228
+ let s = {};
229
229
  try {
230
- c = JSON.parse(f);
230
+ s = JSON.parse(f);
231
231
  } catch {
232
- c = { detail: f };
232
+ s = { detail: f };
233
233
  }
234
234
  throw new Error(
235
- c.detail || c.message || `API error: ${l.status} ${l.statusText}`
235
+ s.detail || s.message || `API error: ${l.status} ${l.statusText}`
236
236
  );
237
237
  }
238
238
  if (l.status === 204)
239
239
  return {};
240
- const s = await l.text();
241
- if (!s)
240
+ const c = await l.text();
241
+ if (!c)
242
242
  return {};
243
243
  try {
244
- return JSON.parse(s);
244
+ return JSON.parse(c);
245
245
  } catch {
246
246
  return {};
247
247
  }
@@ -311,7 +311,7 @@ class lt {
311
311
  return i.json();
312
312
  }
313
313
  }
314
- async function* kr(e, r) {
314
+ async function* yr(e, r) {
315
315
  const t = e.getReader(), n = new TextDecoder();
316
316
  let i = "";
317
317
  try {
@@ -329,13 +329,13 @@ async function* kr(e, r) {
329
329
  i = u.pop() || "";
330
330
  for (const l of u)
331
331
  if (l.startsWith("data: ")) {
332
- const s = l.slice(6);
333
- if (s.trim() === "[DONE]") {
332
+ const c = l.slice(6);
333
+ if (c.trim() === "[DONE]") {
334
334
  yield { done: !0 };
335
335
  continue;
336
336
  }
337
337
  try {
338
- yield JSON.parse(s);
338
+ yield JSON.parse(c);
339
339
  } catch {
340
340
  }
341
341
  }
@@ -344,7 +344,7 @@ async function* kr(e, r) {
344
344
  t.releaseLock();
345
345
  }
346
346
  }
347
- function xr(e) {
347
+ function Cr(e) {
348
348
  return e.map((r) => {
349
349
  let t = "";
350
350
  if (typeof r.content == "string")
@@ -359,34 +359,66 @@ function xr(e) {
359
359
  };
360
360
  });
361
361
  }
362
- function wr(e, r) {
363
- const { modelId: t, systemPrompt: n, ephemeral: i, onChatCreated: o, onUserMessage: a } = r;
362
+ function vr(e) {
363
+ return {
364
+ id: e.id,
365
+ role: e.role,
366
+ content: [
367
+ {
368
+ type: "text",
369
+ text: e.content
370
+ }
371
+ ],
372
+ createdAt: new Date(e.createdAt),
373
+ metadata: {
374
+ custom: {}
375
+ },
376
+ ...e.role === "assistant" && {
377
+ status: {
378
+ type: "complete",
379
+ reason: "stop"
380
+ },
381
+ metadata: {
382
+ unstable_state: null,
383
+ unstable_annotations: [],
384
+ unstable_data: [],
385
+ steps: [],
386
+ custom: {}
387
+ }
388
+ },
389
+ ...e.role === "user" && {
390
+ attachments: []
391
+ }
392
+ };
393
+ }
394
+ function st(e, r) {
395
+ const { modelId: t, systemPrompt: n, ephemeral: i, onChatCreated: o, onUserMessage: a, onThreadIdUpdate: u } = r;
364
396
  return {
365
- async *run(u) {
366
- const { messages: l, abortSignal: s } = u;
397
+ async *run(l) {
398
+ const { messages: c, abortSignal: f, context: s } = l, p = s?.threadId;
367
399
  a?.();
368
- const c = {
369
- messages: xr(l),
400
+ const h = {
401
+ messages: Cr(c),
370
402
  chatId: null,
371
403
  // Thread ID will be set by runtime if needed
372
404
  systemPrompt: n,
373
405
  ephemeral: i,
374
406
  stream: !0
375
407
  };
376
- t && t.trim() !== "" && (c.modelId = t);
377
- const p = await e.createOrContinueChat(c, s);
378
- let g = "", h;
379
- for await (const k of kr(p, s)) {
380
- if (s?.aborted)
408
+ t && t.trim() !== "" && (h.modelId = t);
409
+ const k = await e.createOrContinueChat(h, f);
410
+ let g = "", x;
411
+ for await (const w of yr(k, f)) {
412
+ if (f?.aborted)
381
413
  throw new Error("Request aborted");
382
- const b = k.id;
383
- b && !h && (h = b, o?.(b));
384
- const x = k.delta;
385
- if (x != null && (g += x), k.type === "message" || k.content) {
386
- const y = k.content || "";
387
- g += y;
414
+ const y = w.id;
415
+ y && !x && (x = y, o?.(y), p && u && u(p, y));
416
+ const A = w.delta;
417
+ if (A != null && (g += A), w.type === "message" || w.content) {
418
+ const C = w.content || "";
419
+ g += C;
388
420
  }
389
- if (k.message && (g += k.message.content || ""), k.tool_calls, k.finished) {
421
+ if (w.message && (g += w.message.content || ""), w.tool_calls, w.finished) {
390
422
  g && (yield {
391
423
  content: [{ type: "text", text: g }]
392
424
  });
@@ -402,8 +434,8 @@ function wr(e, r) {
402
434
  }
403
435
  };
404
436
  }
405
- const Ue = /* @__PURE__ */ new Map();
406
- function yr(e, r) {
437
+ const Be = /* @__PURE__ */ new Map();
438
+ function Tr(e, r) {
407
439
  return {
408
440
  async list() {
409
441
  const t = [];
@@ -424,7 +456,7 @@ function yr(e, r) {
424
456
  }).filter((u) => u !== null) };
425
457
  },
426
458
  async initialize(t) {
427
- return { remoteId: Ue.get(t) || t, externalId: void 0 };
459
+ return { remoteId: Be.get(t) || t, externalId: void 0 };
428
460
  },
429
461
  async rename(t, n) {
430
462
  await e.updateChat(t, { title: n });
@@ -460,11 +492,31 @@ function yr(e, r) {
460
492
  },
461
493
  // Add a method to update the remoteId mapping when chat ID is received
462
494
  updateRemoteId(t, n) {
463
- Ue.set(t, n), r?.(t, n);
495
+ Be.set(t, n), r?.(t, n);
496
+ },
497
+ // Provider component that adds thread-specific history adapter
498
+ unstable_Provider: ({ children: t }) => {
499
+ const i = at()?.remoteId, o = $e.useMemo(
500
+ () => ({
501
+ async load() {
502
+ if (!i) return { messages: [] };
503
+ try {
504
+ const u = await e.getChat(i);
505
+ return !u.messages || u.messages.length === 0 ? { messages: [] } : { messages: u.messages.map((c) => vr(c)) };
506
+ } catch (u) {
507
+ return console.error("Failed to load messages for thread:", i, u), { messages: [] };
508
+ }
509
+ },
510
+ async append(u) {
511
+ }
512
+ }),
513
+ [i, e]
514
+ ), a = $e.useMemo(() => ({ history: o }), [o]);
515
+ return /* @__PURE__ */ d(qt, { adapters: a, children: t });
464
516
  }
465
517
  };
466
518
  }
467
- function Cr({
519
+ function Ar({
468
520
  children: e,
469
521
  baseUrl: r,
470
522
  sessionToken: t,
@@ -474,44 +526,50 @@ function Cr({
474
526
  onModelChange: a,
475
527
  ephemeral: u = !1,
476
528
  systemPrompt: l,
477
- initialThreadId: s,
529
+ initialThreadId: c,
478
530
  onError: f,
479
- onChatCreated: c,
531
+ onChatCreated: s,
480
532
  onUserMessage: p,
481
- onThreadIdUpdate: g,
533
+ onThreadIdUpdate: b,
482
534
  onChatsLoaded: h
483
535
  }) {
484
- const k = W(
485
- () => new lt(r, t || void 0, n),
536
+ const k = U(
537
+ () => new ct(r, t || void 0, n),
486
538
  [r, t, n]
487
- ), [b, x] = N(o || null);
488
- M(() => {
539
+ ), [g, x] = N(o || null);
540
+ L(() => {
489
541
  o && x(o);
490
542
  }, [o]);
491
- const w = te(
492
- (C) => {
493
- c?.(C);
543
+ const w = J(
544
+ (v) => {
545
+ s?.(v);
494
546
  },
495
- [c]
496
- ), y = te(
497
- (C, L) => {
498
- g?.(C, L);
547
+ [s]
548
+ ), y = J(
549
+ (v, C) => {
550
+ b?.(v, C);
499
551
  },
500
- [g]
501
- ), A = W(() => wr(k, {
502
- modelId: b || void 0,
552
+ [b]
553
+ ), A = U(() => st(k, {
554
+ modelId: g || void 0,
503
555
  // Pass undefined if not set (backend resolves it)
504
556
  systemPrompt: l,
505
557
  ephemeral: u,
506
558
  onChatCreated: w,
507
559
  onUserMessage: p
508
- }), [k, b, l, u, w, p]), T = nt(A);
509
- return i === "singleChat" ? /* @__PURE__ */ d(at, { runtime: T, children: e }) : /* @__PURE__ */ d(
510
- vr,
560
+ }), [k, g, l, u, w, p]);
561
+ return i === "singleChat" ? /* @__PURE__ */ d(Ir, { modelAdapter: A, children: e }) : /* @__PURE__ */ d(
562
+ Nr,
511
563
  {
512
564
  client: k,
513
- modelAdapter: A,
514
- initialThreadId: s,
565
+ modelAdapterOptions: {
566
+ modelId: g || void 0,
567
+ systemPrompt: l,
568
+ ephemeral: u,
569
+ onChatCreated: w,
570
+ onUserMessage: p
571
+ },
572
+ initialThreadId: c,
515
573
  onChatsLoaded: h,
516
574
  onThreadIdUpdate: y,
517
575
  onError: f,
@@ -519,36 +577,51 @@ function Cr({
519
577
  }
520
578
  );
521
579
  }
522
- function vr({
580
+ function Ir({
581
+ modelAdapter: e,
582
+ children: r
583
+ }) {
584
+ const t = it(e);
585
+ return /* @__PURE__ */ d(ot, { runtime: t, children: r });
586
+ }
587
+ function Nr({
523
588
  client: e,
524
- modelAdapter: r,
589
+ modelAdapterOptions: r,
525
590
  initialThreadId: t,
526
591
  onChatsLoaded: n,
527
592
  onThreadIdUpdate: i,
528
593
  onError: o,
529
594
  children: a
530
595
  }) {
531
- const u = W(() => yr(e, (c, p) => {
532
- i?.(c, p);
533
- }), [e, i]), l = W(() => ({
596
+ const u = U(() => Tr(e, (b, h) => {
597
+ i?.(b, h);
598
+ }), [e, i]), l = J(
599
+ (b, h) => {
600
+ u.updateRemoteId && u.updateRemoteId(b, h), i?.(b, h);
601
+ },
602
+ [u, i]
603
+ ), c = U(() => ({
534
604
  ...u,
535
605
  async list() {
536
- const c = await u.list();
537
- return n?.(), c;
606
+ const b = await u.list();
607
+ return n?.(), b;
538
608
  }
539
609
  }), [u, n]);
540
- M(() => {
541
- window.__cuadraThreadListAdapter = l, window.__cuadraThreadListRuntime = null;
542
- }, [l]);
543
- const s = te(() => nt(r), [r]), f = Bt({
544
- adapter: l,
610
+ L(() => {
611
+ window.__cuadraThreadListAdapter = c, window.__cuadraThreadListRuntime = null;
612
+ }, [c]);
613
+ const f = U(() => st(e, {
614
+ ...r,
615
+ onThreadIdUpdate: l
616
+ }), [e, r, l]), s = J(() => it(f), [f]), p = Kt({
617
+ adapter: c,
545
618
  runtimeHook: s
546
619
  });
547
- return M(() => {
548
- window.__cuadraThreadListRuntime = f;
549
- }, [f]), /* @__PURE__ */ d(at, { runtime: f, children: a });
620
+ return L(() => {
621
+ window.__cuadraThreadListRuntime = p;
622
+ }, [p]), /* @__PURE__ */ d(ot, { runtime: p, children: a });
550
623
  }
551
- function Be(e, r) {
624
+ function We(e, r) {
552
625
  const t = String(e);
553
626
  if (typeof r != "string")
554
627
  throw new TypeError("Expected character");
@@ -558,7 +631,7 @@ function Be(e, r) {
558
631
  return n;
559
632
  }
560
633
  const re = me(/[A-Za-z]/), Me = me(/[\dA-Za-z]/);
561
- function Tr(e) {
634
+ function Sr(e) {
562
635
  return (
563
636
  // Special whitespace codes (which have negative values), C0 and Control
564
637
  // character DEL
@@ -568,10 +641,10 @@ function Tr(e) {
568
641
  function Z(e) {
569
642
  return e !== null && e < -2;
570
643
  }
571
- function D(e) {
644
+ function M(e) {
572
645
  return e !== null && (e < 0 || e === 32);
573
646
  }
574
- function F(e) {
647
+ function _(e) {
575
648
  return e === -2 || e === -1 || e === 32;
576
649
  }
577
650
  const he = me(/\p{P}|\p{S}/u), H = me(/\s/);
@@ -581,7 +654,7 @@ function me(e) {
581
654
  return t !== null && t > -1 && e.test(String.fromCharCode(t));
582
655
  }
583
656
  }
584
- function Ar(e) {
657
+ function Lr(e) {
585
658
  if (typeof e != "string")
586
659
  throw new TypeError("Expected a string");
587
660
  return e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
@@ -603,24 +676,24 @@ const pe = (
603
676
  */
604
677
  (function(e) {
605
678
  if (e == null)
606
- return Lr;
679
+ return Fr;
607
680
  if (typeof e == "function")
608
681
  return ge(e);
609
682
  if (typeof e == "object")
610
- return Array.isArray(e) ? Ir(e) : (
683
+ return Array.isArray(e) ? Mr(e) : (
611
684
  // Cast because `ReadonlyArray` goes into the above but `isArray`
612
685
  // narrows to `Array`.
613
- Nr(
686
+ Dr(
614
687
  /** @type {Props} */
615
688
  e
616
689
  )
617
690
  );
618
691
  if (typeof e == "string")
619
- return Sr(e);
692
+ return Pr(e);
620
693
  throw new Error("Expected function, string, or object as test");
621
694
  })
622
695
  );
623
- function Ir(e) {
696
+ function Mr(e) {
624
697
  const r = [];
625
698
  let t = -1;
626
699
  for (; ++t < e.length; )
@@ -633,7 +706,7 @@ function Ir(e) {
633
706
  return !1;
634
707
  }
635
708
  }
636
- function Nr(e) {
709
+ function Dr(e) {
637
710
  const r = (
638
711
  /** @type {Record<string, unknown>} */
639
712
  e
@@ -651,7 +724,7 @@ function Nr(e) {
651
724
  return !0;
652
725
  }
653
726
  }
654
- function Sr(e) {
727
+ function Pr(e) {
655
728
  return ge(r);
656
729
  function r(t) {
657
730
  return t && t.type === e;
@@ -660,7 +733,7 @@ function Sr(e) {
660
733
  function ge(e) {
661
734
  return r;
662
735
  function r(t, n, i) {
663
- return !!(Mr(t) && e.call(
736
+ return !!(Rr(t) && e.call(
664
737
  this,
665
738
  t,
666
739
  typeof n == "number" ? n : void 0,
@@ -668,105 +741,105 @@ function ge(e) {
668
741
  ));
669
742
  }
670
743
  }
671
- function Lr() {
744
+ function Fr() {
672
745
  return !0;
673
746
  }
674
- function Mr(e) {
747
+ function Rr(e) {
675
748
  return e !== null && typeof e == "object" && "type" in e;
676
749
  }
677
- const ut = [], Dr = !0, Se = !1, Pr = "skip";
678
- function ct(e, r, t, n) {
750
+ const dt = [], Er = !0, Se = !1, _r = "skip";
751
+ function ft(e, r, t, n) {
679
752
  let i;
680
753
  typeof r == "function" && typeof t != "function" ? (n = t, t = r) : i = r;
681
754
  const o = pe(i), a = n ? -1 : 1;
682
755
  u(e, void 0, [])();
683
- function u(l, s, f) {
684
- const c = (
756
+ function u(l, c, f) {
757
+ const s = (
685
758
  /** @type {Record<string, unknown>} */
686
759
  l && typeof l == "object" ? l : {}
687
760
  );
688
- if (typeof c.type == "string") {
689
- const g = (
761
+ if (typeof s.type == "string") {
762
+ const b = (
690
763
  // `hast`
691
- typeof c.tagName == "string" ? c.tagName : (
764
+ typeof s.tagName == "string" ? s.tagName : (
692
765
  // `xast`
693
- typeof c.name == "string" ? c.name : void 0
766
+ typeof s.name == "string" ? s.name : void 0
694
767
  )
695
768
  );
696
769
  Object.defineProperty(p, "name", {
697
- value: "node (" + (l.type + (g ? "<" + g + ">" : "")) + ")"
770
+ value: "node (" + (l.type + (b ? "<" + b + ">" : "")) + ")"
698
771
  });
699
772
  }
700
773
  return p;
701
774
  function p() {
702
- let g = ut, h, k, b;
703
- if ((!r || o(l, s, f[f.length - 1] || void 0)) && (g = Rr(t(l, f)), g[0] === Se))
704
- return g;
775
+ let b = dt, h, k, g;
776
+ if ((!r || o(l, c, f[f.length - 1] || void 0)) && (b = zr(t(l, f)), b[0] === Se))
777
+ return b;
705
778
  if ("children" in l && l.children) {
706
779
  const x = (
707
780
  /** @type {UnistParent} */
708
781
  l
709
782
  );
710
- if (x.children && g[0] !== Pr)
711
- for (k = (n ? x.children.length : -1) + a, b = f.concat(x); k > -1 && k < x.children.length; ) {
783
+ if (x.children && b[0] !== _r)
784
+ for (k = (n ? x.children.length : -1) + a, g = f.concat(x); k > -1 && k < x.children.length; ) {
712
785
  const w = x.children[k];
713
- if (h = u(w, k, b)(), h[0] === Se)
786
+ if (h = u(w, k, g)(), h[0] === Se)
714
787
  return h;
715
788
  k = typeof h[1] == "number" ? h[1] : k + a;
716
789
  }
717
790
  }
718
- return g;
791
+ return b;
719
792
  }
720
793
  }
721
794
  }
722
- function Rr(e) {
723
- return Array.isArray(e) ? e : typeof e == "number" ? [Dr, e] : e == null ? ut : [e];
795
+ function zr(e) {
796
+ return Array.isArray(e) ? e : typeof e == "number" ? [Er, e] : e == null ? dt : [e];
724
797
  }
725
- function Er(e, r, t) {
726
- const i = pe((t || {}).ignore || []), o = _r(r);
798
+ function jr(e, r, t) {
799
+ const i = pe((t || {}).ignore || []), o = $r(r);
727
800
  let a = -1;
728
801
  for (; ++a < o.length; )
729
- ct(e, "text", u);
730
- function u(s, f) {
731
- let c = -1, p;
732
- for (; ++c < f.length; ) {
733
- const g = f[c], h = p ? p.children : void 0;
802
+ ft(e, "text", u);
803
+ function u(c, f) {
804
+ let s = -1, p;
805
+ for (; ++s < f.length; ) {
806
+ const b = f[s], h = p ? p.children : void 0;
734
807
  if (i(
735
- g,
736
- h ? h.indexOf(g) : void 0,
808
+ b,
809
+ h ? h.indexOf(b) : void 0,
737
810
  p
738
811
  ))
739
812
  return;
740
- p = g;
813
+ p = b;
741
814
  }
742
815
  if (p)
743
- return l(s, f);
816
+ return l(c, f);
744
817
  }
745
- function l(s, f) {
746
- const c = f[f.length - 1], p = o[a][0], g = o[a][1];
818
+ function l(c, f) {
819
+ const s = f[f.length - 1], p = o[a][0], b = o[a][1];
747
820
  let h = 0;
748
- const b = c.children.indexOf(s);
821
+ const g = s.children.indexOf(c);
749
822
  let x = !1, w = [];
750
823
  p.lastIndex = 0;
751
- let y = p.exec(s.value);
824
+ let y = p.exec(c.value);
752
825
  for (; y; ) {
753
- const A = y.index, T = {
826
+ const A = y.index, v = {
754
827
  index: y.index,
755
828
  input: y.input,
756
- stack: [...f, s]
829
+ stack: [...f, c]
757
830
  };
758
- let C = g(...y, T);
831
+ let C = b(...y, v);
759
832
  if (typeof C == "string" && (C = C.length > 0 ? { type: "text", value: C } : void 0), C === !1 ? p.lastIndex = A + 1 : (h !== A && w.push({
760
833
  type: "text",
761
- value: s.value.slice(h, A)
834
+ value: c.value.slice(h, A)
762
835
  }), Array.isArray(C) ? w.push(...C) : C && w.push(C), h = A + y[0].length, x = !0), !p.global)
763
836
  break;
764
- y = p.exec(s.value);
837
+ y = p.exec(c.value);
765
838
  }
766
- return x ? (h < s.value.length && w.push({ type: "text", value: s.value.slice(h) }), c.children.splice(b, 1, ...w)) : w = [s], b + w.length;
839
+ return x ? (h < c.value.length && w.push({ type: "text", value: c.value.slice(h) }), s.children.splice(g, 1, ...w)) : w = [c], g + w.length;
767
840
  }
768
841
  }
769
- function _r(e) {
842
+ function $r(e) {
770
843
  const r = [];
771
844
  if (!Array.isArray(e))
772
845
  throw new TypeError("Expected find and replace tuple or list of tuples");
@@ -774,37 +847,37 @@ function _r(e) {
774
847
  let n = -1;
775
848
  for (; ++n < t.length; ) {
776
849
  const i = t[n];
777
- r.push([Fr(i[0]), zr(i[1])]);
850
+ r.push([Or(i[0]), Ur(i[1])]);
778
851
  }
779
852
  return r;
780
853
  }
781
- function Fr(e) {
782
- return typeof e == "string" ? new RegExp(Ar(e), "g") : e;
854
+ function Or(e) {
855
+ return typeof e == "string" ? new RegExp(Lr(e), "g") : e;
783
856
  }
784
- function zr(e) {
857
+ function Ur(e) {
785
858
  return typeof e == "function" ? e : function() {
786
859
  return e;
787
860
  };
788
861
  }
789
862
  const ye = "phrasing", Ce = ["autolink", "link", "image", "label"];
790
- function jr() {
863
+ function Br() {
791
864
  return {
792
- transforms: [qr],
865
+ transforms: [Zr],
793
866
  enter: {
794
- literalAutolink: Or,
867
+ literalAutolink: Hr,
795
868
  literalAutolinkEmail: ve,
796
869
  literalAutolinkHttp: ve,
797
870
  literalAutolinkWww: ve
798
871
  },
799
872
  exit: {
800
- literalAutolink: Hr,
801
- literalAutolinkEmail: Wr,
802
- literalAutolinkHttp: Ur,
803
- literalAutolinkWww: Br
873
+ literalAutolink: Gr,
874
+ literalAutolinkEmail: Vr,
875
+ literalAutolinkHttp: qr,
876
+ literalAutolinkWww: Kr
804
877
  }
805
878
  };
806
879
  }
807
- function $r() {
880
+ function Wr() {
808
881
  return {
809
882
  unsafe: [
810
883
  {
@@ -831,41 +904,41 @@ function $r() {
831
904
  ]
832
905
  };
833
906
  }
834
- function Or(e) {
907
+ function Hr(e) {
835
908
  this.enter({ type: "link", title: null, url: "", children: [] }, e);
836
909
  }
837
910
  function ve(e) {
838
911
  this.config.enter.autolinkProtocol.call(this, e);
839
912
  }
840
- function Ur(e) {
913
+ function qr(e) {
841
914
  this.config.exit.autolinkProtocol.call(this, e);
842
915
  }
843
- function Br(e) {
916
+ function Kr(e) {
844
917
  this.config.exit.data.call(this, e);
845
918
  const r = this.stack[this.stack.length - 1];
846
919
  r.type, r.url = "http://" + this.sliceSerialize(e);
847
920
  }
848
- function Wr(e) {
921
+ function Vr(e) {
849
922
  this.config.exit.autolinkEmail.call(this, e);
850
923
  }
851
- function Hr(e) {
924
+ function Gr(e) {
852
925
  this.exit(e);
853
926
  }
854
- function qr(e) {
855
- Er(
927
+ function Zr(e) {
928
+ jr(
856
929
  e,
857
930
  [
858
- [/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi, Kr],
859
- [/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu, Vr]
931
+ [/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi, Jr],
932
+ [/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu, Qr]
860
933
  ],
861
934
  { ignore: ["link", "linkReference"] }
862
935
  );
863
936
  }
864
- function Kr(e, r, t, n, i) {
937
+ function Jr(e, r, t, n, i) {
865
938
  let o = "";
866
- if (!st(i) || (/^w/i.test(r) && (t = r + t, r = "", o = "http://"), !Gr(t)))
939
+ if (!ht(i) || (/^w/i.test(r) && (t = r + t, r = "", o = "http://"), !Xr(t)))
867
940
  return !1;
868
- const a = Zr(t + n);
941
+ const a = Yr(t + n);
869
942
  if (!a[0]) return !1;
870
943
  const u = {
871
944
  type: "link",
@@ -875,10 +948,10 @@ function Kr(e, r, t, n, i) {
875
948
  };
876
949
  return a[1] ? [u, { type: "text", value: a[1] }] : u;
877
950
  }
878
- function Vr(e, r, t, n) {
951
+ function Qr(e, r, t, n) {
879
952
  return (
880
953
  // Not an expected previous character.
881
- !st(n, !0) || // Label ends in not allowed character.
954
+ !ht(n, !0) || // Label ends in not allowed character.
882
955
  /[-\d_]$/.test(t) ? !1 : {
883
956
  type: "link",
884
957
  title: null,
@@ -887,23 +960,23 @@ function Vr(e, r, t, n) {
887
960
  }
888
961
  );
889
962
  }
890
- function Gr(e) {
963
+ function Xr(e) {
891
964
  const r = e.split(".");
892
965
  return !(r.length < 2 || r[r.length - 1] && (/_/.test(r[r.length - 1]) || !/[a-zA-Z\d]/.test(r[r.length - 1])) || r[r.length - 2] && (/_/.test(r[r.length - 2]) || !/[a-zA-Z\d]/.test(r[r.length - 2])));
893
966
  }
894
- function Zr(e) {
967
+ function Yr(e) {
895
968
  const r = /[!"&'),.:;<>?\]}]+$/.exec(e);
896
969
  if (!r)
897
970
  return [e, void 0];
898
971
  e = e.slice(0, r.index);
899
972
  let t = r[0], n = t.indexOf(")");
900
- const i = Be(e, "(");
901
- let o = Be(e, ")");
973
+ const i = We(e, "(");
974
+ let o = We(e, ")");
902
975
  for (; n !== -1 && i > o; )
903
976
  e += t.slice(0, n + 1), t = t.slice(n + 1), n = t.indexOf(")"), o++;
904
977
  return [e, t];
905
978
  }
906
- function st(e, r) {
979
+ function ht(e, r) {
907
980
  const t = e.input.charCodeAt(e.index - 1);
908
981
  return (e.index === 0 || H(t) || he(t)) && // If it’s an email, the previous character should not be a slash.
909
982
  (!r || t !== 47);
@@ -911,44 +984,44 @@ function st(e, r) {
911
984
  function ae(e) {
912
985
  return e.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
913
986
  }
914
- dt.peek = an;
915
- function Jr() {
987
+ mt.peek = cn;
988
+ function en() {
916
989
  this.buffer();
917
990
  }
918
- function Qr(e) {
991
+ function tn(e) {
919
992
  this.enter({ type: "footnoteReference", identifier: "", label: "" }, e);
920
993
  }
921
- function Xr() {
994
+ function rn() {
922
995
  this.buffer();
923
996
  }
924
- function Yr(e) {
997
+ function nn(e) {
925
998
  this.enter(
926
999
  { type: "footnoteDefinition", identifier: "", label: "", children: [] },
927
1000
  e
928
1001
  );
929
1002
  }
930
- function en(e) {
1003
+ function an(e) {
931
1004
  const r = this.resume(), t = this.stack[this.stack.length - 1];
932
1005
  t.type, t.identifier = ae(
933
1006
  this.sliceSerialize(e)
934
1007
  ).toLowerCase(), t.label = r;
935
1008
  }
936
- function tn(e) {
1009
+ function on(e) {
937
1010
  this.exit(e);
938
1011
  }
939
- function rn(e) {
1012
+ function ln(e) {
940
1013
  const r = this.resume(), t = this.stack[this.stack.length - 1];
941
1014
  t.type, t.identifier = ae(
942
1015
  this.sliceSerialize(e)
943
1016
  ).toLowerCase(), t.label = r;
944
1017
  }
945
- function nn(e) {
1018
+ function un(e) {
946
1019
  this.exit(e);
947
1020
  }
948
- function an() {
1021
+ function cn() {
949
1022
  return "[";
950
1023
  }
951
- function dt(e, r, t, n) {
1024
+ function mt(e, r, t, n) {
952
1025
  const i = t.createTracker(n);
953
1026
  let o = i.move("[^");
954
1027
  const a = t.enter("footnoteReference"), u = t.enter("reference");
@@ -956,51 +1029,51 @@ function dt(e, r, t, n) {
956
1029
  t.safe(t.associationId(e), { after: "]", before: o })
957
1030
  ), u(), a(), o += i.move("]"), o;
958
1031
  }
959
- function on() {
1032
+ function sn() {
960
1033
  return {
961
1034
  enter: {
962
- gfmFootnoteCallString: Jr,
963
- gfmFootnoteCall: Qr,
964
- gfmFootnoteDefinitionLabelString: Xr,
965
- gfmFootnoteDefinition: Yr
966
- },
967
- exit: {
968
1035
  gfmFootnoteCallString: en,
969
1036
  gfmFootnoteCall: tn,
970
1037
  gfmFootnoteDefinitionLabelString: rn,
971
1038
  gfmFootnoteDefinition: nn
1039
+ },
1040
+ exit: {
1041
+ gfmFootnoteCallString: an,
1042
+ gfmFootnoteCall: on,
1043
+ gfmFootnoteDefinitionLabelString: ln,
1044
+ gfmFootnoteDefinition: un
972
1045
  }
973
1046
  };
974
1047
  }
975
- function ln(e) {
1048
+ function dn(e) {
976
1049
  let r = !1;
977
1050
  return e && e.firstLineBlank && (r = !0), {
978
- handlers: { footnoteDefinition: t, footnoteReference: dt },
1051
+ handlers: { footnoteDefinition: t, footnoteReference: mt },
979
1052
  // This is on by default already.
980
1053
  unsafe: [{ character: "[", inConstruct: ["label", "phrasing", "reference"] }]
981
1054
  };
982
1055
  function t(n, i, o, a) {
983
1056
  const u = o.createTracker(a);
984
1057
  let l = u.move("[^");
985
- const s = o.enter("footnoteDefinition"), f = o.enter("label");
1058
+ const c = o.enter("footnoteDefinition"), f = o.enter("label");
986
1059
  return l += u.move(
987
1060
  o.safe(o.associationId(n), { before: l, after: "]" })
988
1061
  ), f(), l += u.move("]:"), n.children && n.children.length > 0 && (u.shift(4), l += u.move(
989
1062
  (r ? `
990
1063
  ` : " ") + o.indentLines(
991
1064
  o.containerFlow(n, u.current()),
992
- r ? ft : un
1065
+ r ? pt : fn
993
1066
  )
994
- )), s(), l;
1067
+ )), c(), l;
995
1068
  }
996
1069
  }
997
- function un(e, r, t) {
998
- return r === 0 ? e : ft(e, r, t);
1070
+ function fn(e, r, t) {
1071
+ return r === 0 ? e : pt(e, r, t);
999
1072
  }
1000
- function ft(e, r, t) {
1073
+ function pt(e, r, t) {
1001
1074
  return (t ? "" : " ") + e;
1002
1075
  }
1003
- const cn = [
1076
+ const hn = [
1004
1077
  "autolink",
1005
1078
  "destinationLiteral",
1006
1079
  "destinationRaw",
@@ -1008,33 +1081,33 @@ const cn = [
1008
1081
  "titleQuote",
1009
1082
  "titleApostrophe"
1010
1083
  ];
1011
- ht.peek = mn;
1012
- function sn() {
1084
+ gt.peek = kn;
1085
+ function mn() {
1013
1086
  return {
1014
1087
  canContainEols: ["delete"],
1015
- enter: { strikethrough: fn },
1016
- exit: { strikethrough: hn }
1088
+ enter: { strikethrough: gn },
1089
+ exit: { strikethrough: bn }
1017
1090
  };
1018
1091
  }
1019
- function dn() {
1092
+ function pn() {
1020
1093
  return {
1021
1094
  unsafe: [
1022
1095
  {
1023
1096
  character: "~",
1024
1097
  inConstruct: "phrasing",
1025
- notInConstruct: cn
1098
+ notInConstruct: hn
1026
1099
  }
1027
1100
  ],
1028
- handlers: { delete: ht }
1101
+ handlers: { delete: gt }
1029
1102
  };
1030
1103
  }
1031
- function fn(e) {
1104
+ function gn(e) {
1032
1105
  this.enter({ type: "delete", children: [] }, e);
1033
1106
  }
1034
- function hn(e) {
1107
+ function bn(e) {
1035
1108
  this.exit(e);
1036
1109
  }
1037
- function ht(e, r, t, n) {
1110
+ function gt(e, r, t, n) {
1038
1111
  const i = t.createTracker(n), o = t.enter("strikethrough");
1039
1112
  let a = i.move("~~");
1040
1113
  return a += t.containerPhrasing(e, {
@@ -1043,66 +1116,66 @@ function ht(e, r, t, n) {
1043
1116
  after: "~"
1044
1117
  }), a += i.move("~~"), o(), a;
1045
1118
  }
1046
- function mn() {
1119
+ function kn() {
1047
1120
  return "~";
1048
1121
  }
1049
- function pn(e) {
1122
+ function xn(e) {
1050
1123
  return e.length;
1051
1124
  }
1052
- function gn(e, r) {
1053
- const t = r || {}, n = (t.align || []).concat(), i = t.stringLength || pn, o = [], a = [], u = [], l = [];
1054
- let s = 0, f = -1;
1125
+ function wn(e, r) {
1126
+ const t = r || {}, n = (t.align || []).concat(), i = t.stringLength || xn, o = [], a = [], u = [], l = [];
1127
+ let c = 0, f = -1;
1055
1128
  for (; ++f < e.length; ) {
1056
- const k = [], b = [];
1129
+ const k = [], g = [];
1057
1130
  let x = -1;
1058
- for (e[f].length > s && (s = e[f].length); ++x < e[f].length; ) {
1059
- const w = bn(e[f][x]);
1131
+ for (e[f].length > c && (c = e[f].length); ++x < e[f].length; ) {
1132
+ const w = yn(e[f][x]);
1060
1133
  if (t.alignDelimiters !== !1) {
1061
1134
  const y = i(w);
1062
- b[x] = y, (l[x] === void 0 || y > l[x]) && (l[x] = y);
1135
+ g[x] = y, (l[x] === void 0 || y > l[x]) && (l[x] = y);
1063
1136
  }
1064
1137
  k.push(w);
1065
1138
  }
1066
- a[f] = k, u[f] = b;
1139
+ a[f] = k, u[f] = g;
1067
1140
  }
1068
- let c = -1;
1141
+ let s = -1;
1069
1142
  if (typeof n == "object" && "length" in n)
1070
- for (; ++c < s; )
1071
- o[c] = We(n[c]);
1143
+ for (; ++s < c; )
1144
+ o[s] = He(n[s]);
1072
1145
  else {
1073
- const k = We(n);
1074
- for (; ++c < s; )
1075
- o[c] = k;
1076
- }
1077
- c = -1;
1078
- const p = [], g = [];
1079
- for (; ++c < s; ) {
1080
- const k = o[c];
1081
- let b = "", x = "";
1082
- k === 99 ? (b = ":", x = ":") : k === 108 ? b = ":" : k === 114 && (x = ":");
1146
+ const k = He(n);
1147
+ for (; ++s < c; )
1148
+ o[s] = k;
1149
+ }
1150
+ s = -1;
1151
+ const p = [], b = [];
1152
+ for (; ++s < c; ) {
1153
+ const k = o[s];
1154
+ let g = "", x = "";
1155
+ k === 99 ? (g = ":", x = ":") : k === 108 ? g = ":" : k === 114 && (x = ":");
1083
1156
  let w = t.alignDelimiters === !1 ? 1 : Math.max(
1084
1157
  1,
1085
- l[c] - b.length - x.length
1158
+ l[s] - g.length - x.length
1086
1159
  );
1087
- const y = b + "-".repeat(w) + x;
1088
- t.alignDelimiters !== !1 && (w = b.length + w + x.length, w > l[c] && (l[c] = w), g[c] = w), p[c] = y;
1160
+ const y = g + "-".repeat(w) + x;
1161
+ t.alignDelimiters !== !1 && (w = g.length + w + x.length, w > l[s] && (l[s] = w), b[s] = w), p[s] = y;
1089
1162
  }
1090
- a.splice(1, 0, p), u.splice(1, 0, g), f = -1;
1163
+ a.splice(1, 0, p), u.splice(1, 0, b), f = -1;
1091
1164
  const h = [];
1092
1165
  for (; ++f < a.length; ) {
1093
- const k = a[f], b = u[f];
1094
- c = -1;
1166
+ const k = a[f], g = u[f];
1167
+ s = -1;
1095
1168
  const x = [];
1096
- for (; ++c < s; ) {
1097
- const w = k[c] || "";
1169
+ for (; ++s < c; ) {
1170
+ const w = k[s] || "";
1098
1171
  let y = "", A = "";
1099
1172
  if (t.alignDelimiters !== !1) {
1100
- const T = l[c] - (b[c] || 0), C = o[c];
1101
- C === 114 ? y = " ".repeat(T) : C === 99 ? T % 2 ? (y = " ".repeat(T / 2 + 0.5), A = " ".repeat(T / 2 - 0.5)) : (y = " ".repeat(T / 2), A = y) : A = " ".repeat(T);
1173
+ const v = l[s] - (g[s] || 0), C = o[s];
1174
+ C === 114 ? y = " ".repeat(v) : C === 99 ? v % 2 ? (y = " ".repeat(v / 2 + 0.5), A = " ".repeat(v / 2 - 0.5)) : (y = " ".repeat(v / 2), A = y) : A = " ".repeat(v);
1102
1175
  }
1103
- t.delimiterStart !== !1 && !c && x.push("|"), t.padding !== !1 && // Don’t add the opening space if we’re not aligning and the cell is
1176
+ t.delimiterStart !== !1 && !s && x.push("|"), t.padding !== !1 && // Don’t add the opening space if we’re not aligning and the cell is
1104
1177
  // empty: there will be a closing space.
1105
- !(t.alignDelimiters === !1 && w === "") && (t.delimiterStart !== !1 || c) && x.push(" "), t.alignDelimiters !== !1 && x.push(y), x.push(w), t.alignDelimiters !== !1 && x.push(A), t.padding !== !1 && x.push(" "), (t.delimiterEnd !== !1 || c !== s - 1) && x.push("|");
1178
+ !(t.alignDelimiters === !1 && w === "") && (t.delimiterStart !== !1 || s) && x.push(" "), t.alignDelimiters !== !1 && x.push(y), x.push(w), t.alignDelimiters !== !1 && x.push(A), t.padding !== !1 && x.push(" "), (t.delimiterEnd !== !1 || s !== c - 1) && x.push("|");
1106
1179
  }
1107
1180
  h.push(
1108
1181
  t.delimiterEnd === !1 ? x.join("").replace(/ +$/, "") : x.join("")
@@ -1111,29 +1184,29 @@ function gn(e, r) {
1111
1184
  return h.join(`
1112
1185
  `);
1113
1186
  }
1114
- function bn(e) {
1187
+ function yn(e) {
1115
1188
  return e == null ? "" : String(e);
1116
1189
  }
1117
- function We(e) {
1190
+ function He(e) {
1118
1191
  const r = typeof e == "string" ? e.codePointAt(0) : 0;
1119
1192
  return r === 67 || r === 99 ? 99 : r === 76 || r === 108 ? 108 : r === 82 || r === 114 ? 114 : 0;
1120
1193
  }
1121
- function kn(e, r, t, n) {
1194
+ function Cn(e, r, t, n) {
1122
1195
  const i = t.enter("blockquote"), o = t.createTracker(n);
1123
1196
  o.move("> "), o.shift(2);
1124
1197
  const a = t.indentLines(
1125
1198
  t.containerFlow(e, o.current()),
1126
- xn
1199
+ vn
1127
1200
  );
1128
1201
  return i(), a;
1129
1202
  }
1130
- function xn(e, r, t) {
1203
+ function vn(e, r, t) {
1131
1204
  return ">" + (t ? "" : " ") + e;
1132
1205
  }
1133
- function wn(e, r) {
1134
- return He(e, r.inConstruct, !0) && !He(e, r.notInConstruct, !1);
1206
+ function Tn(e, r) {
1207
+ return qe(e, r.inConstruct, !0) && !qe(e, r.notInConstruct, !1);
1135
1208
  }
1136
- function He(e, r, t) {
1209
+ function qe(e, r, t) {
1137
1210
  if (typeof r == "string" && (r = [r]), !r || r.length === 0)
1138
1211
  return t;
1139
1212
  let n = -1;
@@ -1142,16 +1215,16 @@ function He(e, r, t) {
1142
1215
  return !0;
1143
1216
  return !1;
1144
1217
  }
1145
- function qe(e, r, t, n) {
1218
+ function Ke(e, r, t, n) {
1146
1219
  let i = -1;
1147
1220
  for (; ++i < t.unsafe.length; )
1148
1221
  if (t.unsafe[i].character === `
1149
- ` && wn(t.stack, t.unsafe[i]))
1222
+ ` && Tn(t.stack, t.unsafe[i]))
1150
1223
  return /[ \t]/.test(n.before) ? "" : " ";
1151
1224
  return `\\
1152
1225
  `;
1153
1226
  }
1154
- function yn(e, r) {
1227
+ function An(e, r) {
1155
1228
  const t = String(e);
1156
1229
  let n = t.indexOf(r), i = n, o = 0, a = 0;
1157
1230
  if (typeof r != "string")
@@ -1160,13 +1233,13 @@ function yn(e, r) {
1160
1233
  n === i ? ++o > a && (a = o) : o = 1, i = n + r.length, n = t.indexOf(r, i);
1161
1234
  return a;
1162
1235
  }
1163
- function Cn(e, r) {
1236
+ function In(e, r) {
1164
1237
  return !!(r.options.fences === !1 && e.value && // If there’s no info…
1165
1238
  !e.lang && // And there’s a non-whitespace character…
1166
1239
  /[^ \r\n]/.test(e.value) && // And the value doesn’t start or end in a blank…
1167
1240
  !/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value));
1168
1241
  }
1169
- function vn(e) {
1242
+ function Nn(e) {
1170
1243
  const r = e.options.fence || "`";
1171
1244
  if (r !== "`" && r !== "~")
1172
1245
  throw new Error(
@@ -1174,16 +1247,16 @@ function vn(e) {
1174
1247
  );
1175
1248
  return r;
1176
1249
  }
1177
- function Tn(e, r, t, n) {
1178
- const i = vn(t), o = e.value || "", a = i === "`" ? "GraveAccent" : "Tilde";
1179
- if (Cn(e, t)) {
1180
- const c = t.enter("codeIndented"), p = t.indentLines(o, An);
1181
- return c(), p;
1250
+ function Sn(e, r, t, n) {
1251
+ const i = Nn(t), o = e.value || "", a = i === "`" ? "GraveAccent" : "Tilde";
1252
+ if (In(e, t)) {
1253
+ const s = t.enter("codeIndented"), p = t.indentLines(o, Ln);
1254
+ return s(), p;
1182
1255
  }
1183
- const u = t.createTracker(n), l = i.repeat(Math.max(yn(o, i) + 1, 3)), s = t.enter("codeFenced");
1256
+ const u = t.createTracker(n), l = i.repeat(Math.max(An(o, i) + 1, 3)), c = t.enter("codeFenced");
1184
1257
  let f = u.move(l);
1185
1258
  if (e.lang) {
1186
- const c = t.enter(`codeFencedLang${a}`);
1259
+ const s = t.enter(`codeFencedLang${a}`);
1187
1260
  f += u.move(
1188
1261
  t.safe(e.lang, {
1189
1262
  before: f,
@@ -1191,10 +1264,10 @@ function Tn(e, r, t, n) {
1191
1264
  encode: ["`"],
1192
1265
  ...u.current()
1193
1266
  })
1194
- ), c();
1267
+ ), s();
1195
1268
  }
1196
1269
  if (e.lang && e.meta) {
1197
- const c = t.enter(`codeFencedMeta${a}`);
1270
+ const s = t.enter(`codeFencedMeta${a}`);
1198
1271
  f += u.move(" "), f += u.move(
1199
1272
  t.safe(e.meta, {
1200
1273
  before: f,
@@ -1203,13 +1276,13 @@ function Tn(e, r, t, n) {
1203
1276
  encode: ["`"],
1204
1277
  ...u.current()
1205
1278
  })
1206
- ), c();
1279
+ ), s();
1207
1280
  }
1208
1281
  return f += u.move(`
1209
1282
  `), o && (f += u.move(o + `
1210
- `)), f += u.move(l), s(), f;
1283
+ `)), f += u.move(l), c(), f;
1211
1284
  }
1212
- function An(e, r, t) {
1285
+ function Ln(e, r, t) {
1213
1286
  return (t ? "" : " ") + e;
1214
1287
  }
1215
1288
  function De(e) {
@@ -1220,37 +1293,37 @@ function De(e) {
1220
1293
  );
1221
1294
  return r;
1222
1295
  }
1223
- function In(e, r, t, n) {
1296
+ function Mn(e, r, t, n) {
1224
1297
  const i = De(t), o = i === '"' ? "Quote" : "Apostrophe", a = t.enter("definition");
1225
1298
  let u = t.enter("label");
1226
1299
  const l = t.createTracker(n);
1227
- let s = l.move("[");
1228
- return s += l.move(
1300
+ let c = l.move("[");
1301
+ return c += l.move(
1229
1302
  t.safe(t.associationId(e), {
1230
- before: s,
1303
+ before: c,
1231
1304
  after: "]",
1232
1305
  ...l.current()
1233
1306
  })
1234
- ), s += l.move("]: "), u(), // If there’s no url, or…
1307
+ ), c += l.move("]: "), u(), // If there’s no url, or…
1235
1308
  !e.url || // If there are control characters or whitespace.
1236
- /[\0- \u007F]/.test(e.url) ? (u = t.enter("destinationLiteral"), s += l.move("<"), s += l.move(
1237
- t.safe(e.url, { before: s, after: ">", ...l.current() })
1238
- ), s += l.move(">")) : (u = t.enter("destinationRaw"), s += l.move(
1309
+ /[\0- \u007F]/.test(e.url) ? (u = t.enter("destinationLiteral"), c += l.move("<"), c += l.move(
1310
+ t.safe(e.url, { before: c, after: ">", ...l.current() })
1311
+ ), c += l.move(">")) : (u = t.enter("destinationRaw"), c += l.move(
1239
1312
  t.safe(e.url, {
1240
- before: s,
1313
+ before: c,
1241
1314
  after: e.title ? " " : `
1242
1315
  `,
1243
1316
  ...l.current()
1244
1317
  })
1245
- )), u(), e.title && (u = t.enter(`title${o}`), s += l.move(" " + i), s += l.move(
1318
+ )), u(), e.title && (u = t.enter(`title${o}`), c += l.move(" " + i), c += l.move(
1246
1319
  t.safe(e.title, {
1247
- before: s,
1320
+ before: c,
1248
1321
  after: i,
1249
1322
  ...l.current()
1250
1323
  })
1251
- ), s += l.move(i), u()), a(), s;
1324
+ ), c += l.move(i), u()), a(), c;
1252
1325
  }
1253
- function Nn(e) {
1326
+ function Dn(e) {
1254
1327
  const r = e.options.emphasis || "*";
1255
1328
  if (r !== "*" && r !== "_")
1256
1329
  throw new Error(
@@ -1262,7 +1335,7 @@ function ne(e) {
1262
1335
  return "&#x" + e.toString(16).toUpperCase() + ";";
1263
1336
  }
1264
1337
  function de(e) {
1265
- if (e === null || D(e) || H(e))
1338
+ if (e === null || M(e) || H(e))
1266
1339
  return 1;
1267
1340
  if (he(e))
1268
1341
  return 2;
@@ -1300,9 +1373,9 @@ function fe(e, r, t) {
1300
1373
  { inside: !1, outside: !1 }
1301
1374
  );
1302
1375
  }
1303
- mt.peek = Sn;
1304
- function mt(e, r, t, n) {
1305
- const i = Nn(t), o = t.enter("emphasis"), a = t.createTracker(n), u = a.move(i);
1376
+ bt.peek = Pn;
1377
+ function bt(e, r, t, n) {
1378
+ const i = Dn(t), o = t.enter("emphasis"), a = t.createTracker(n), u = a.move(i);
1306
1379
  let l = a.move(
1307
1380
  t.containerPhrasing(e, {
1308
1381
  after: i,
@@ -1310,75 +1383,75 @@ function mt(e, r, t, n) {
1310
1383
  ...a.current()
1311
1384
  })
1312
1385
  );
1313
- const s = l.charCodeAt(0), f = fe(
1386
+ const c = l.charCodeAt(0), f = fe(
1314
1387
  n.before.charCodeAt(n.before.length - 1),
1315
- s,
1388
+ c,
1316
1389
  i
1317
1390
  );
1318
- f.inside && (l = ne(s) + l.slice(1));
1319
- const c = l.charCodeAt(l.length - 1), p = fe(n.after.charCodeAt(0), c, i);
1320
- p.inside && (l = l.slice(0, -1) + ne(c));
1321
- const g = a.move(i);
1391
+ f.inside && (l = ne(c) + l.slice(1));
1392
+ const s = l.charCodeAt(l.length - 1), p = fe(n.after.charCodeAt(0), s, i);
1393
+ p.inside && (l = l.slice(0, -1) + ne(s));
1394
+ const b = a.move(i);
1322
1395
  return o(), t.attentionEncodeSurroundingInfo = {
1323
1396
  after: p.outside,
1324
1397
  before: f.outside
1325
- }, u + l + g;
1398
+ }, u + l + b;
1326
1399
  }
1327
- function Sn(e, r, t) {
1400
+ function Pn(e, r, t) {
1328
1401
  return t.options.emphasis || "*";
1329
1402
  }
1330
- function Ln(e, r, t, n) {
1403
+ function Fn(e, r, t, n) {
1331
1404
  let i, o, a;
1332
- typeof r == "function" && typeof t != "function" ? (o = void 0, a = r, i = t) : (o = r, a = t, i = n), ct(e, o, u, i);
1333
- function u(l, s) {
1334
- const f = s[s.length - 1], c = f ? f.children.indexOf(l) : void 0;
1335
- return a(l, c, f);
1405
+ typeof r == "function" && typeof t != "function" ? (o = void 0, a = r, i = t) : (o = r, a = t, i = n), ft(e, o, u, i);
1406
+ function u(l, c) {
1407
+ const f = c[c.length - 1], s = f ? f.children.indexOf(l) : void 0;
1408
+ return a(l, s, f);
1336
1409
  }
1337
1410
  }
1338
- const Mn = {};
1339
- function pt(e, r) {
1340
- const t = Mn, n = typeof t.includeImageAlt == "boolean" ? t.includeImageAlt : !0, i = typeof t.includeHtml == "boolean" ? t.includeHtml : !0;
1341
- return gt(e, n, i);
1411
+ const Rn = {};
1412
+ function kt(e, r) {
1413
+ const t = Rn, n = typeof t.includeImageAlt == "boolean" ? t.includeImageAlt : !0, i = typeof t.includeHtml == "boolean" ? t.includeHtml : !0;
1414
+ return xt(e, n, i);
1342
1415
  }
1343
- function gt(e, r, t) {
1344
- if (Dn(e)) {
1416
+ function xt(e, r, t) {
1417
+ if (En(e)) {
1345
1418
  if ("value" in e)
1346
1419
  return e.type === "html" && !t ? "" : e.value;
1347
1420
  if (r && "alt" in e && e.alt)
1348
1421
  return e.alt;
1349
1422
  if ("children" in e)
1350
- return Ke(e.children, r, t);
1423
+ return Ve(e.children, r, t);
1351
1424
  }
1352
- return Array.isArray(e) ? Ke(e, r, t) : "";
1425
+ return Array.isArray(e) ? Ve(e, r, t) : "";
1353
1426
  }
1354
- function Ke(e, r, t) {
1427
+ function Ve(e, r, t) {
1355
1428
  const n = [];
1356
1429
  let i = -1;
1357
1430
  for (; ++i < e.length; )
1358
- n[i] = gt(e[i], r, t);
1431
+ n[i] = xt(e[i], r, t);
1359
1432
  return n.join("");
1360
1433
  }
1361
- function Dn(e) {
1434
+ function En(e) {
1362
1435
  return !!(e && typeof e == "object");
1363
1436
  }
1364
- function Pn(e, r) {
1437
+ function _n(e, r) {
1365
1438
  let t = !1;
1366
- return Ln(e, function(n) {
1439
+ return Fn(e, function(n) {
1367
1440
  if ("value" in n && /\r?\n|\r/.test(n.value) || n.type === "break")
1368
1441
  return t = !0, Se;
1369
- }), !!((!e.depth || e.depth < 3) && pt(e) && (r.options.setext || t));
1442
+ }), !!((!e.depth || e.depth < 3) && kt(e) && (r.options.setext || t));
1370
1443
  }
1371
- function Rn(e, r, t, n) {
1444
+ function zn(e, r, t, n) {
1372
1445
  const i = Math.max(Math.min(6, e.depth || 1), 1), o = t.createTracker(n);
1373
- if (Pn(e, t)) {
1374
- const f = t.enter("headingSetext"), c = t.enter("phrasing"), p = t.containerPhrasing(e, {
1446
+ if (_n(e, t)) {
1447
+ const f = t.enter("headingSetext"), s = t.enter("phrasing"), p = t.containerPhrasing(e, {
1375
1448
  ...o.current(),
1376
1449
  before: `
1377
1450
  `,
1378
1451
  after: `
1379
1452
  `
1380
1453
  });
1381
- return c(), f(), p + `
1454
+ return s(), f(), p + `
1382
1455
  ` + (i === 1 ? "=" : "-").repeat(
1383
1456
  // The whole size…
1384
1457
  p.length - // Minus the position of the character after the last EOL (or
@@ -1389,76 +1462,76 @@ function Rn(e, r, t, n) {
1389
1462
  }
1390
1463
  const a = "#".repeat(i), u = t.enter("headingAtx"), l = t.enter("phrasing");
1391
1464
  o.move(a + " ");
1392
- let s = t.containerPhrasing(e, {
1465
+ let c = t.containerPhrasing(e, {
1393
1466
  before: "# ",
1394
1467
  after: `
1395
1468
  `,
1396
1469
  ...o.current()
1397
1470
  });
1398
- return /^[\t ]/.test(s) && (s = ne(s.charCodeAt(0)) + s.slice(1)), s = s ? a + " " + s : a, t.options.closeAtx && (s += " " + a), l(), u(), s;
1471
+ return /^[\t ]/.test(c) && (c = ne(c.charCodeAt(0)) + c.slice(1)), c = c ? a + " " + c : a, t.options.closeAtx && (c += " " + a), l(), u(), c;
1399
1472
  }
1400
- bt.peek = En;
1401
- function bt(e) {
1473
+ wt.peek = jn;
1474
+ function wt(e) {
1402
1475
  return e.value || "";
1403
1476
  }
1404
- function En() {
1477
+ function jn() {
1405
1478
  return "<";
1406
1479
  }
1407
- kt.peek = _n;
1408
- function kt(e, r, t, n) {
1480
+ yt.peek = $n;
1481
+ function yt(e, r, t, n) {
1409
1482
  const i = De(t), o = i === '"' ? "Quote" : "Apostrophe", a = t.enter("image");
1410
1483
  let u = t.enter("label");
1411
1484
  const l = t.createTracker(n);
1412
- let s = l.move("![");
1413
- return s += l.move(
1414
- t.safe(e.alt, { before: s, after: "]", ...l.current() })
1415
- ), s += l.move("]("), u(), // If there’s no url but there is a title…
1485
+ let c = l.move("![");
1486
+ return c += l.move(
1487
+ t.safe(e.alt, { before: c, after: "]", ...l.current() })
1488
+ ), c += l.move("]("), u(), // If there’s no url but there is a title…
1416
1489
  !e.url && e.title || // If there are control characters or whitespace.
1417
- /[\0- \u007F]/.test(e.url) ? (u = t.enter("destinationLiteral"), s += l.move("<"), s += l.move(
1418
- t.safe(e.url, { before: s, after: ">", ...l.current() })
1419
- ), s += l.move(">")) : (u = t.enter("destinationRaw"), s += l.move(
1490
+ /[\0- \u007F]/.test(e.url) ? (u = t.enter("destinationLiteral"), c += l.move("<"), c += l.move(
1491
+ t.safe(e.url, { before: c, after: ">", ...l.current() })
1492
+ ), c += l.move(">")) : (u = t.enter("destinationRaw"), c += l.move(
1420
1493
  t.safe(e.url, {
1421
- before: s,
1494
+ before: c,
1422
1495
  after: e.title ? " " : ")",
1423
1496
  ...l.current()
1424
1497
  })
1425
- )), u(), e.title && (u = t.enter(`title${o}`), s += l.move(" " + i), s += l.move(
1498
+ )), u(), e.title && (u = t.enter(`title${o}`), c += l.move(" " + i), c += l.move(
1426
1499
  t.safe(e.title, {
1427
- before: s,
1500
+ before: c,
1428
1501
  after: i,
1429
1502
  ...l.current()
1430
1503
  })
1431
- ), s += l.move(i), u()), s += l.move(")"), a(), s;
1504
+ ), c += l.move(i), u()), c += l.move(")"), a(), c;
1432
1505
  }
1433
- function _n() {
1506
+ function $n() {
1434
1507
  return "!";
1435
1508
  }
1436
- xt.peek = Fn;
1437
- function xt(e, r, t, n) {
1509
+ Ct.peek = On;
1510
+ function Ct(e, r, t, n) {
1438
1511
  const i = e.referenceType, o = t.enter("imageReference");
1439
1512
  let a = t.enter("label");
1440
1513
  const u = t.createTracker(n);
1441
1514
  let l = u.move("![");
1442
- const s = t.safe(e.alt, {
1515
+ const c = t.safe(e.alt, {
1443
1516
  before: l,
1444
1517
  after: "]",
1445
1518
  ...u.current()
1446
1519
  });
1447
- l += u.move(s + "]["), a();
1520
+ l += u.move(c + "]["), a();
1448
1521
  const f = t.stack;
1449
1522
  t.stack = [], a = t.enter("reference");
1450
- const c = t.safe(t.associationId(e), {
1523
+ const s = t.safe(t.associationId(e), {
1451
1524
  before: l,
1452
1525
  after: "]",
1453
1526
  ...u.current()
1454
1527
  });
1455
- return a(), t.stack = f, o(), i === "full" || !s || s !== c ? l += u.move(c + "]") : i === "shortcut" ? l = l.slice(0, -1) : l += u.move("]"), l;
1528
+ return a(), t.stack = f, o(), i === "full" || !c || c !== s ? l += u.move(s + "]") : i === "shortcut" ? l = l.slice(0, -1) : l += u.move("]"), l;
1456
1529
  }
1457
- function Fn() {
1530
+ function On() {
1458
1531
  return "!";
1459
1532
  }
1460
- wt.peek = zn;
1461
- function wt(e, r, t) {
1533
+ vt.peek = Un;
1534
+ function vt(e, r, t) {
1462
1535
  let n = e.value || "", i = "`", o = -1;
1463
1536
  for (; new RegExp("(^|[^`])" + i + "([^`]|$)").test(n); )
1464
1537
  i += "`";
@@ -1467,17 +1540,17 @@ function wt(e, r, t) {
1467
1540
  let l;
1468
1541
  if (a.atBreak)
1469
1542
  for (; l = u.exec(n); ) {
1470
- let s = l.index;
1471
- n.charCodeAt(s) === 10 && n.charCodeAt(s - 1) === 13 && s--, n = n.slice(0, s) + " " + n.slice(l.index + 1);
1543
+ let c = l.index;
1544
+ n.charCodeAt(c) === 10 && n.charCodeAt(c - 1) === 13 && c--, n = n.slice(0, c) + " " + n.slice(l.index + 1);
1472
1545
  }
1473
1546
  }
1474
1547
  return i + n + i;
1475
1548
  }
1476
- function zn() {
1549
+ function Un() {
1477
1550
  return "`";
1478
1551
  }
1479
- function yt(e, r) {
1480
- const t = pt(e);
1552
+ function Tt(e, r) {
1553
+ const t = kt(e);
1481
1554
  return !!(!r.options.resourceLink && // If there’s a url…
1482
1555
  e.url && // And there’s a no title…
1483
1556
  !e.title && // And the content of `node` is a single text node…
@@ -1487,73 +1560,73 @@ function yt(e, r) {
1487
1560
  // references don’t work), space, or angle brackets…
1488
1561
  !/[\0- <>\u007F]/.test(e.url));
1489
1562
  }
1490
- Ct.peek = jn;
1491
- function Ct(e, r, t, n) {
1563
+ At.peek = Bn;
1564
+ function At(e, r, t, n) {
1492
1565
  const i = De(t), o = i === '"' ? "Quote" : "Apostrophe", a = t.createTracker(n);
1493
1566
  let u, l;
1494
- if (yt(e, t)) {
1567
+ if (Tt(e, t)) {
1495
1568
  const f = t.stack;
1496
1569
  t.stack = [], u = t.enter("autolink");
1497
- let c = a.move("<");
1498
- return c += a.move(
1570
+ let s = a.move("<");
1571
+ return s += a.move(
1499
1572
  t.containerPhrasing(e, {
1500
- before: c,
1573
+ before: s,
1501
1574
  after: ">",
1502
1575
  ...a.current()
1503
1576
  })
1504
- ), c += a.move(">"), u(), t.stack = f, c;
1577
+ ), s += a.move(">"), u(), t.stack = f, s;
1505
1578
  }
1506
1579
  u = t.enter("link"), l = t.enter("label");
1507
- let s = a.move("[");
1508
- return s += a.move(
1580
+ let c = a.move("[");
1581
+ return c += a.move(
1509
1582
  t.containerPhrasing(e, {
1510
- before: s,
1583
+ before: c,
1511
1584
  after: "](",
1512
1585
  ...a.current()
1513
1586
  })
1514
- ), s += a.move("]("), l(), // If there’s no url but there is a title…
1587
+ ), c += a.move("]("), l(), // If there’s no url but there is a title…
1515
1588
  !e.url && e.title || // If there are control characters or whitespace.
1516
- /[\0- \u007F]/.test(e.url) ? (l = t.enter("destinationLiteral"), s += a.move("<"), s += a.move(
1517
- t.safe(e.url, { before: s, after: ">", ...a.current() })
1518
- ), s += a.move(">")) : (l = t.enter("destinationRaw"), s += a.move(
1589
+ /[\0- \u007F]/.test(e.url) ? (l = t.enter("destinationLiteral"), c += a.move("<"), c += a.move(
1590
+ t.safe(e.url, { before: c, after: ">", ...a.current() })
1591
+ ), c += a.move(">")) : (l = t.enter("destinationRaw"), c += a.move(
1519
1592
  t.safe(e.url, {
1520
- before: s,
1593
+ before: c,
1521
1594
  after: e.title ? " " : ")",
1522
1595
  ...a.current()
1523
1596
  })
1524
- )), l(), e.title && (l = t.enter(`title${o}`), s += a.move(" " + i), s += a.move(
1597
+ )), l(), e.title && (l = t.enter(`title${o}`), c += a.move(" " + i), c += a.move(
1525
1598
  t.safe(e.title, {
1526
- before: s,
1599
+ before: c,
1527
1600
  after: i,
1528
1601
  ...a.current()
1529
1602
  })
1530
- ), s += a.move(i), l()), s += a.move(")"), u(), s;
1603
+ ), c += a.move(i), l()), c += a.move(")"), u(), c;
1531
1604
  }
1532
- function jn(e, r, t) {
1533
- return yt(e, t) ? "<" : "[";
1605
+ function Bn(e, r, t) {
1606
+ return Tt(e, t) ? "<" : "[";
1534
1607
  }
1535
- vt.peek = $n;
1536
- function vt(e, r, t, n) {
1608
+ It.peek = Wn;
1609
+ function It(e, r, t, n) {
1537
1610
  const i = e.referenceType, o = t.enter("linkReference");
1538
1611
  let a = t.enter("label");
1539
1612
  const u = t.createTracker(n);
1540
1613
  let l = u.move("[");
1541
- const s = t.containerPhrasing(e, {
1614
+ const c = t.containerPhrasing(e, {
1542
1615
  before: l,
1543
1616
  after: "]",
1544
1617
  ...u.current()
1545
1618
  });
1546
- l += u.move(s + "]["), a();
1619
+ l += u.move(c + "]["), a();
1547
1620
  const f = t.stack;
1548
1621
  t.stack = [], a = t.enter("reference");
1549
- const c = t.safe(t.associationId(e), {
1622
+ const s = t.safe(t.associationId(e), {
1550
1623
  before: l,
1551
1624
  after: "]",
1552
1625
  ...u.current()
1553
1626
  });
1554
- return a(), t.stack = f, o(), i === "full" || !s || s !== c ? l += u.move(c + "]") : i === "shortcut" ? l = l.slice(0, -1) : l += u.move("]"), l;
1627
+ return a(), t.stack = f, o(), i === "full" || !c || c !== s ? l += u.move(s + "]") : i === "shortcut" ? l = l.slice(0, -1) : l += u.move("]"), l;
1555
1628
  }
1556
- function $n() {
1629
+ function Wn() {
1557
1630
  return "[";
1558
1631
  }
1559
1632
  function Pe(e) {
@@ -1564,7 +1637,7 @@ function Pe(e) {
1564
1637
  );
1565
1638
  return r;
1566
1639
  }
1567
- function On(e) {
1640
+ function Hn(e) {
1568
1641
  const r = Pe(e), t = e.options.bulletOther;
1569
1642
  if (!t)
1570
1643
  return r === "*" ? "-" : "*";
@@ -1578,7 +1651,7 @@ function On(e) {
1578
1651
  );
1579
1652
  return t;
1580
1653
  }
1581
- function Un(e) {
1654
+ function qn(e) {
1582
1655
  const r = e.options.bulletOrdered || ".";
1583
1656
  if (r !== "." && r !== ")")
1584
1657
  throw new Error(
@@ -1586,7 +1659,7 @@ function Un(e) {
1586
1659
  );
1587
1660
  return r;
1588
1661
  }
1589
- function Tt(e) {
1662
+ function Nt(e) {
1590
1663
  const r = e.options.rule || "*";
1591
1664
  if (r !== "*" && r !== "-" && r !== "_")
1592
1665
  throw new Error(
@@ -1594,10 +1667,10 @@ function Tt(e) {
1594
1667
  );
1595
1668
  return r;
1596
1669
  }
1597
- function Bn(e, r, t, n) {
1670
+ function Kn(e, r, t, n) {
1598
1671
  const i = t.enter("list"), o = t.bulletCurrent;
1599
- let a = e.ordered ? Un(t) : Pe(t);
1600
- const u = e.ordered ? a === "." ? ")" : "." : On(t);
1672
+ let a = e.ordered ? qn(t) : Pe(t);
1673
+ const u = e.ordered ? a === "." ? ")" : "." : Hn(t);
1601
1674
  let l = r && t.bulletLastUsed ? a === t.bulletLastUsed : !1;
1602
1675
  if (!e.ordered) {
1603
1676
  const f = e.children ? e.children[0] : void 0;
@@ -1606,11 +1679,11 @@ function Bn(e, r, t, n) {
1606
1679
  (a === "*" || a === "-") && // Empty first list item:
1607
1680
  f && (!f.children || !f.children[0]) && // Directly in two other list items:
1608
1681
  t.stack[t.stack.length - 1] === "list" && t.stack[t.stack.length - 2] === "listItem" && t.stack[t.stack.length - 3] === "list" && t.stack[t.stack.length - 4] === "listItem" && // That are each the first child.
1609
- t.indexStack[t.indexStack.length - 1] === 0 && t.indexStack[t.indexStack.length - 2] === 0 && t.indexStack[t.indexStack.length - 3] === 0 && (l = !0), Tt(t) === a && f
1682
+ t.indexStack[t.indexStack.length - 1] === 0 && t.indexStack[t.indexStack.length - 2] === 0 && t.indexStack[t.indexStack.length - 3] === 0 && (l = !0), Nt(t) === a && f
1610
1683
  ) {
1611
- let c = -1;
1612
- for (; ++c < e.children.length; ) {
1613
- const p = e.children[c];
1684
+ let s = -1;
1685
+ for (; ++s < e.children.length; ) {
1686
+ const p = e.children[s];
1614
1687
  if (p && p.type === "listItem" && p.children && p.children[0] && p.children[0].type === "thematicBreak") {
1615
1688
  l = !0;
1616
1689
  break;
@@ -1619,10 +1692,10 @@ function Bn(e, r, t, n) {
1619
1692
  }
1620
1693
  }
1621
1694
  l && (a = u), t.bulletCurrent = a;
1622
- const s = t.containerFlow(e, n);
1623
- return t.bulletLastUsed = a, t.bulletCurrent = o, i(), s;
1695
+ const c = t.containerFlow(e, n);
1696
+ return t.bulletLastUsed = a, t.bulletCurrent = o, i(), c;
1624
1697
  }
1625
- function Wn(e) {
1698
+ function Vn(e) {
1626
1699
  const r = e.options.listItemIndent || "one";
1627
1700
  if (r !== "tab" && r !== "one" && r !== "mixed")
1628
1701
  throw new Error(
@@ -1630,28 +1703,28 @@ function Wn(e) {
1630
1703
  );
1631
1704
  return r;
1632
1705
  }
1633
- function Hn(e, r, t, n) {
1634
- const i = Wn(t);
1706
+ function Gn(e, r, t, n) {
1707
+ const i = Vn(t);
1635
1708
  let o = t.bulletCurrent || Pe(t);
1636
1709
  r && r.type === "list" && r.ordered && (o = (typeof r.start == "number" && r.start > -1 ? r.start : 1) + (t.options.incrementListMarker === !1 ? 0 : r.children.indexOf(e)) + o);
1637
1710
  let a = o.length + 1;
1638
1711
  (i === "tab" || i === "mixed" && (r && r.type === "list" && r.spread || e.spread)) && (a = Math.ceil(a / 4) * 4);
1639
1712
  const u = t.createTracker(n);
1640
1713
  u.move(o + " ".repeat(a - o.length)), u.shift(a);
1641
- const l = t.enter("listItem"), s = t.indentLines(
1714
+ const l = t.enter("listItem"), c = t.indentLines(
1642
1715
  t.containerFlow(e, u.current()),
1643
1716
  f
1644
1717
  );
1645
- return l(), s;
1646
- function f(c, p, g) {
1647
- return p ? (g ? "" : " ".repeat(a)) + c : (g ? o : o + " ".repeat(a - o.length)) + c;
1718
+ return l(), c;
1719
+ function f(s, p, b) {
1720
+ return p ? (b ? "" : " ".repeat(a)) + s : (b ? o : o + " ".repeat(a - o.length)) + s;
1648
1721
  }
1649
1722
  }
1650
- function qn(e, r, t, n) {
1723
+ function Zn(e, r, t, n) {
1651
1724
  const i = t.enter("paragraph"), o = t.enter("phrasing"), a = t.containerPhrasing(e, n);
1652
1725
  return o(), i(), a;
1653
1726
  }
1654
- const Kn = (
1727
+ const Jn = (
1655
1728
  /** @type {(node?: unknown) => node is Exclude<PhrasingContent, Html>} */
1656
1729
  pe([
1657
1730
  "break",
@@ -1677,12 +1750,12 @@ const Kn = (
1677
1750
  "textDirective"
1678
1751
  ])
1679
1752
  );
1680
- function Vn(e, r, t, n) {
1753
+ function Qn(e, r, t, n) {
1681
1754
  return (e.children.some(function(a) {
1682
- return Kn(a);
1755
+ return Jn(a);
1683
1756
  }) ? t.containerPhrasing : t.containerFlow).call(t, e, n);
1684
1757
  }
1685
- function Gn(e) {
1758
+ function Xn(e) {
1686
1759
  const r = e.options.strong || "*";
1687
1760
  if (r !== "*" && r !== "_")
1688
1761
  throw new Error(
@@ -1690,9 +1763,9 @@ function Gn(e) {
1690
1763
  );
1691
1764
  return r;
1692
1765
  }
1693
- At.peek = Zn;
1694
- function At(e, r, t, n) {
1695
- const i = Gn(t), o = t.enter("strong"), a = t.createTracker(n), u = a.move(i + i);
1766
+ St.peek = Yn;
1767
+ function St(e, r, t, n) {
1768
+ const i = Xn(t), o = t.enter("strong"), a = t.createTracker(n), u = a.move(i + i);
1696
1769
  let l = a.move(
1697
1770
  t.containerPhrasing(e, {
1698
1771
  after: i,
@@ -1700,27 +1773,27 @@ function At(e, r, t, n) {
1700
1773
  ...a.current()
1701
1774
  })
1702
1775
  );
1703
- const s = l.charCodeAt(0), f = fe(
1776
+ const c = l.charCodeAt(0), f = fe(
1704
1777
  n.before.charCodeAt(n.before.length - 1),
1705
- s,
1778
+ c,
1706
1779
  i
1707
1780
  );
1708
- f.inside && (l = ne(s) + l.slice(1));
1709
- const c = l.charCodeAt(l.length - 1), p = fe(n.after.charCodeAt(0), c, i);
1710
- p.inside && (l = l.slice(0, -1) + ne(c));
1711
- const g = a.move(i + i);
1781
+ f.inside && (l = ne(c) + l.slice(1));
1782
+ const s = l.charCodeAt(l.length - 1), p = fe(n.after.charCodeAt(0), s, i);
1783
+ p.inside && (l = l.slice(0, -1) + ne(s));
1784
+ const b = a.move(i + i);
1712
1785
  return o(), t.attentionEncodeSurroundingInfo = {
1713
1786
  after: p.outside,
1714
1787
  before: f.outside
1715
- }, u + l + g;
1788
+ }, u + l + b;
1716
1789
  }
1717
- function Zn(e, r, t) {
1790
+ function Yn(e, r, t) {
1718
1791
  return t.options.strong || "*";
1719
1792
  }
1720
- function Jn(e, r, t, n) {
1793
+ function ea(e, r, t, n) {
1721
1794
  return t.safe(e.value, n);
1722
1795
  }
1723
- function Qn(e) {
1796
+ function ta(e) {
1724
1797
  const r = e.options.ruleRepetition || 3;
1725
1798
  if (r < 3)
1726
1799
  throw new Error(
@@ -1728,50 +1801,50 @@ function Qn(e) {
1728
1801
  );
1729
1802
  return r;
1730
1803
  }
1731
- function Xn(e, r, t) {
1732
- const n = (Tt(t) + (t.options.ruleSpaces ? " " : "")).repeat(Qn(t));
1804
+ function ra(e, r, t) {
1805
+ const n = (Nt(t) + (t.options.ruleSpaces ? " " : "")).repeat(ta(t));
1733
1806
  return t.options.ruleSpaces ? n.slice(0, -1) : n;
1734
1807
  }
1735
- const It = {
1736
- blockquote: kn,
1737
- break: qe,
1738
- code: Tn,
1739
- definition: In,
1740
- emphasis: mt,
1741
- hardBreak: qe,
1742
- heading: Rn,
1743
- html: bt,
1744
- image: kt,
1745
- imageReference: xt,
1746
- inlineCode: wt,
1747
- link: Ct,
1748
- linkReference: vt,
1749
- list: Bn,
1750
- listItem: Hn,
1751
- paragraph: qn,
1752
- root: Vn,
1753
- strong: At,
1754
- text: Jn,
1755
- thematicBreak: Xn
1808
+ const Lt = {
1809
+ blockquote: Cn,
1810
+ break: Ke,
1811
+ code: Sn,
1812
+ definition: Mn,
1813
+ emphasis: bt,
1814
+ hardBreak: Ke,
1815
+ heading: zn,
1816
+ html: wt,
1817
+ image: yt,
1818
+ imageReference: Ct,
1819
+ inlineCode: vt,
1820
+ link: At,
1821
+ linkReference: It,
1822
+ list: Kn,
1823
+ listItem: Gn,
1824
+ paragraph: Zn,
1825
+ root: Qn,
1826
+ strong: St,
1827
+ text: ea,
1828
+ thematicBreak: ra
1756
1829
  };
1757
- function Yn() {
1830
+ function na() {
1758
1831
  return {
1759
1832
  enter: {
1760
- table: ea,
1761
- tableData: Ve,
1762
- tableHeader: Ve,
1763
- tableRow: ra
1833
+ table: aa,
1834
+ tableData: Ge,
1835
+ tableHeader: Ge,
1836
+ tableRow: oa
1764
1837
  },
1765
1838
  exit: {
1766
- codeText: na,
1767
- table: ta,
1839
+ codeText: la,
1840
+ table: ia,
1768
1841
  tableData: Te,
1769
1842
  tableHeader: Te,
1770
1843
  tableRow: Te
1771
1844
  }
1772
1845
  };
1773
1846
  }
1774
- function ea(e) {
1847
+ function aa(e) {
1775
1848
  const r = e._align;
1776
1849
  this.enter(
1777
1850
  {
@@ -1784,28 +1857,28 @@ function ea(e) {
1784
1857
  e
1785
1858
  ), this.data.inTable = !0;
1786
1859
  }
1787
- function ta(e) {
1860
+ function ia(e) {
1788
1861
  this.exit(e), this.data.inTable = void 0;
1789
1862
  }
1790
- function ra(e) {
1863
+ function oa(e) {
1791
1864
  this.enter({ type: "tableRow", children: [] }, e);
1792
1865
  }
1793
1866
  function Te(e) {
1794
1867
  this.exit(e);
1795
1868
  }
1796
- function Ve(e) {
1869
+ function Ge(e) {
1797
1870
  this.enter({ type: "tableCell", children: [] }, e);
1798
1871
  }
1799
- function na(e) {
1872
+ function la(e) {
1800
1873
  let r = this.resume();
1801
- this.data.inTable && (r = r.replace(/\\([\\|])/g, aa));
1874
+ this.data.inTable && (r = r.replace(/\\([\\|])/g, ua));
1802
1875
  const t = this.stack[this.stack.length - 1];
1803
1876
  t.type, t.value = r, this.exit(e);
1804
1877
  }
1805
- function aa(e, r) {
1878
+ function ua(e, r) {
1806
1879
  return r === "|" ? r : e;
1807
1880
  }
1808
- function ia(e) {
1881
+ function ca(e) {
1809
1882
  const r = e || {}, t = r.tableCellPadding, n = r.tablePipeAlign, i = r.stringLength, o = t ? " " : "|";
1810
1883
  return {
1811
1884
  unsafe: [
@@ -1834,24 +1907,24 @@ function ia(e) {
1834
1907
  tableRow: u
1835
1908
  }
1836
1909
  };
1837
- function a(g, h, k, b) {
1838
- return s(f(g, k, b), g.align);
1910
+ function a(b, h, k, g) {
1911
+ return c(f(b, k, g), b.align);
1839
1912
  }
1840
- function u(g, h, k, b) {
1841
- const x = c(g, k, b), w = s([x]);
1913
+ function u(b, h, k, g) {
1914
+ const x = s(b, k, g), w = c([x]);
1842
1915
  return w.slice(0, w.indexOf(`
1843
1916
  `));
1844
1917
  }
1845
- function l(g, h, k, b) {
1846
- const x = k.enter("tableCell"), w = k.enter("phrasing"), y = k.containerPhrasing(g, {
1847
- ...b,
1918
+ function l(b, h, k, g) {
1919
+ const x = k.enter("tableCell"), w = k.enter("phrasing"), y = k.containerPhrasing(b, {
1920
+ ...g,
1848
1921
  before: o,
1849
1922
  after: o
1850
1923
  });
1851
1924
  return w(), x(), y;
1852
1925
  }
1853
- function s(g, h) {
1854
- return gn(g, {
1926
+ function c(b, h) {
1927
+ return wn(b, {
1855
1928
  align: h,
1856
1929
  // @ts-expect-error: `markdown-table` types should support `null`.
1857
1930
  alignDelimiters: n,
@@ -1861,47 +1934,47 @@ function ia(e) {
1861
1934
  stringLength: i
1862
1935
  });
1863
1936
  }
1864
- function f(g, h, k) {
1865
- const b = g.children;
1937
+ function f(b, h, k) {
1938
+ const g = b.children;
1866
1939
  let x = -1;
1867
1940
  const w = [], y = h.enter("table");
1868
- for (; ++x < b.length; )
1869
- w[x] = c(b[x], h, k);
1941
+ for (; ++x < g.length; )
1942
+ w[x] = s(g[x], h, k);
1870
1943
  return y(), w;
1871
1944
  }
1872
- function c(g, h, k) {
1873
- const b = g.children;
1945
+ function s(b, h, k) {
1946
+ const g = b.children;
1874
1947
  let x = -1;
1875
1948
  const w = [], y = h.enter("tableRow");
1876
- for (; ++x < b.length; )
1877
- w[x] = l(b[x], g, h, k);
1949
+ for (; ++x < g.length; )
1950
+ w[x] = l(g[x], b, h, k);
1878
1951
  return y(), w;
1879
1952
  }
1880
- function p(g, h, k) {
1881
- let b = It.inlineCode(g, h, k);
1882
- return k.stack.includes("tableCell") && (b = b.replace(/\|/g, "\\$&")), b;
1953
+ function p(b, h, k) {
1954
+ let g = Lt.inlineCode(b, h, k);
1955
+ return k.stack.includes("tableCell") && (g = g.replace(/\|/g, "\\$&")), g;
1883
1956
  }
1884
1957
  }
1885
- function oa() {
1958
+ function sa() {
1886
1959
  return {
1887
1960
  exit: {
1888
- taskListCheckValueChecked: Ge,
1889
- taskListCheckValueUnchecked: Ge,
1890
- paragraph: ua
1961
+ taskListCheckValueChecked: Ze,
1962
+ taskListCheckValueUnchecked: Ze,
1963
+ paragraph: fa
1891
1964
  }
1892
1965
  };
1893
1966
  }
1894
- function la() {
1967
+ function da() {
1895
1968
  return {
1896
1969
  unsafe: [{ atBreak: !0, character: "-", after: "[:|-]" }],
1897
- handlers: { listItem: ca }
1970
+ handlers: { listItem: ha }
1898
1971
  };
1899
1972
  }
1900
- function Ge(e) {
1973
+ function Ze(e) {
1901
1974
  const r = this.stack[this.stack.length - 2];
1902
1975
  r.type, r.checked = e.type === "taskListCheckValueChecked";
1903
1976
  }
1904
- function ua(e) {
1977
+ function fa(e) {
1905
1978
  const r = this.stack[this.stack.length - 2];
1906
1979
  if (r && r.type === "listItem" && typeof r.checked == "boolean") {
1907
1980
  const t = this.stack[this.stack.length - 1];
@@ -1922,35 +1995,35 @@ function ua(e) {
1922
1995
  }
1923
1996
  this.exit(e);
1924
1997
  }
1925
- function ca(e, r, t, n) {
1998
+ function ha(e, r, t, n) {
1926
1999
  const i = e.children[0], o = typeof e.checked == "boolean" && i && i.type === "paragraph", a = "[" + (e.checked ? "x" : " ") + "] ", u = t.createTracker(n);
1927
2000
  o && u.move(a);
1928
- let l = It.listItem(e, r, t, {
2001
+ let l = Lt.listItem(e, r, t, {
1929
2002
  ...n,
1930
2003
  ...u.current()
1931
2004
  });
1932
- return o && (l = l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/, s)), l;
1933
- function s(f) {
2005
+ return o && (l = l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/, c)), l;
2006
+ function c(f) {
1934
2007
  return f + a;
1935
2008
  }
1936
2009
  }
1937
- function sa() {
2010
+ function ma() {
1938
2011
  return [
1939
- jr(),
1940
- on(),
2012
+ Br(),
1941
2013
  sn(),
1942
- Yn(),
1943
- oa()
2014
+ mn(),
2015
+ na(),
2016
+ sa()
1944
2017
  ];
1945
2018
  }
1946
- function da(e) {
2019
+ function pa(e) {
1947
2020
  return {
1948
2021
  extensions: [
1949
- $r(),
1950
- ln(e),
1951
- dn(),
1952
- ia(e),
1953
- la()
2022
+ Wr(),
2023
+ dn(e),
2024
+ pn(),
2025
+ ca(e),
2026
+ da()
1954
2027
  ]
1955
2028
  };
1956
2029
  }
@@ -1963,24 +2036,24 @@ function ce(e, r, t, n) {
1963
2036
  for (t && e.splice(r, t); o < n.length; )
1964
2037
  a = n.slice(o, o + 1e4), a.unshift(r, 0), e.splice(...a), o += 1e4, r += 1e4;
1965
2038
  }
1966
- const Ze = {}.hasOwnProperty;
1967
- function fa(e) {
2039
+ const Je = {}.hasOwnProperty;
2040
+ function ga(e) {
1968
2041
  const r = {};
1969
2042
  let t = -1;
1970
2043
  for (; ++t < e.length; )
1971
- ha(r, e[t]);
2044
+ ba(r, e[t]);
1972
2045
  return r;
1973
2046
  }
1974
- function ha(e, r) {
2047
+ function ba(e, r) {
1975
2048
  let t;
1976
2049
  for (t in r) {
1977
- const i = (Ze.call(e, t) ? e[t] : void 0) || (e[t] = {}), o = r[t];
2050
+ const i = (Je.call(e, t) ? e[t] : void 0) || (e[t] = {}), o = r[t];
1978
2051
  let a;
1979
2052
  if (o)
1980
2053
  for (a in o) {
1981
- Ze.call(i, a) || (i[a] = []);
2054
+ Je.call(i, a) || (i[a] = []);
1982
2055
  const u = o[a];
1983
- ma(
2056
+ ka(
1984
2057
  // @ts-expect-error Looks like a list.
1985
2058
  i[a],
1986
2059
  Array.isArray(u) ? u : u ? [u] : []
@@ -1988,115 +2061,115 @@ function ha(e, r) {
1988
2061
  }
1989
2062
  }
1990
2063
  }
1991
- function ma(e, r) {
2064
+ function ka(e, r) {
1992
2065
  let t = -1;
1993
2066
  const n = [];
1994
2067
  for (; ++t < r.length; )
1995
2068
  (r[t].add === "after" ? e : n).push(r[t]);
1996
2069
  ce(e, 0, 0, n);
1997
2070
  }
1998
- const pa = {
1999
- tokenize: ya,
2071
+ const xa = {
2072
+ tokenize: Aa,
2000
2073
  partial: !0
2001
- }, Nt = {
2002
- tokenize: Ca,
2074
+ }, Mt = {
2075
+ tokenize: Ia,
2003
2076
  partial: !0
2004
- }, St = {
2005
- tokenize: va,
2077
+ }, Dt = {
2078
+ tokenize: Na,
2006
2079
  partial: !0
2007
- }, Lt = {
2008
- tokenize: Ta,
2080
+ }, Pt = {
2081
+ tokenize: Sa,
2009
2082
  partial: !0
2010
- }, ga = {
2011
- tokenize: Aa,
2083
+ }, wa = {
2084
+ tokenize: La,
2012
2085
  partial: !0
2013
- }, Mt = {
2086
+ }, Ft = {
2014
2087
  name: "wwwAutolink",
2015
- tokenize: xa,
2016
- previous: Pt
2017
- }, Dt = {
2088
+ tokenize: va,
2089
+ previous: Et
2090
+ }, Rt = {
2018
2091
  name: "protocolAutolink",
2019
- tokenize: wa,
2020
- previous: Rt
2092
+ tokenize: Ta,
2093
+ previous: _t
2021
2094
  }, $ = {
2022
2095
  name: "emailAutolink",
2023
- tokenize: ka,
2024
- previous: Et
2025
- }, R = {};
2026
- function ba() {
2096
+ tokenize: Ca,
2097
+ previous: zt
2098
+ }, F = {};
2099
+ function ya() {
2027
2100
  return {
2028
- text: R
2101
+ text: F
2029
2102
  };
2030
2103
  }
2031
- let U = 48;
2032
- for (; U < 123; )
2033
- R[U] = $, U++, U === 58 ? U = 65 : U === 91 && (U = 97);
2034
- R[43] = $;
2035
- R[45] = $;
2036
- R[46] = $;
2037
- R[95] = $;
2038
- R[72] = [$, Dt];
2039
- R[104] = [$, Dt];
2040
- R[87] = [$, Mt];
2041
- R[119] = [$, Mt];
2042
- function ka(e, r, t) {
2104
+ let B = 48;
2105
+ for (; B < 123; )
2106
+ F[B] = $, B++, B === 58 ? B = 65 : B === 91 && (B = 97);
2107
+ F[43] = $;
2108
+ F[45] = $;
2109
+ F[46] = $;
2110
+ F[95] = $;
2111
+ F[72] = [$, Rt];
2112
+ F[104] = [$, Rt];
2113
+ F[87] = [$, Ft];
2114
+ F[119] = [$, Ft];
2115
+ function Ca(e, r, t) {
2043
2116
  const n = this;
2044
2117
  let i, o;
2045
2118
  return a;
2046
- function a(c) {
2047
- return !Le(c) || !Et.call(n, n.previous) || Re(n.events) ? t(c) : (e.enter("literalAutolink"), e.enter("literalAutolinkEmail"), u(c));
2119
+ function a(s) {
2120
+ return !Le(s) || !zt.call(n, n.previous) || Fe(n.events) ? t(s) : (e.enter("literalAutolink"), e.enter("literalAutolinkEmail"), u(s));
2048
2121
  }
2049
- function u(c) {
2050
- return Le(c) ? (e.consume(c), u) : c === 64 ? (e.consume(c), l) : t(c);
2122
+ function u(s) {
2123
+ return Le(s) ? (e.consume(s), u) : s === 64 ? (e.consume(s), l) : t(s);
2051
2124
  }
2052
- function l(c) {
2053
- return c === 46 ? e.check(ga, f, s)(c) : c === 45 || c === 95 || Me(c) ? (o = !0, e.consume(c), l) : f(c);
2125
+ function l(s) {
2126
+ return s === 46 ? e.check(wa, f, c)(s) : s === 45 || s === 95 || Me(s) ? (o = !0, e.consume(s), l) : f(s);
2054
2127
  }
2055
- function s(c) {
2056
- return e.consume(c), i = !0, l;
2128
+ function c(s) {
2129
+ return e.consume(s), i = !0, l;
2057
2130
  }
2058
- function f(c) {
2059
- return o && i && re(n.previous) ? (e.exit("literalAutolinkEmail"), e.exit("literalAutolink"), r(c)) : t(c);
2131
+ function f(s) {
2132
+ return o && i && re(n.previous) ? (e.exit("literalAutolinkEmail"), e.exit("literalAutolink"), r(s)) : t(s);
2060
2133
  }
2061
2134
  }
2062
- function xa(e, r, t) {
2135
+ function va(e, r, t) {
2063
2136
  const n = this;
2064
2137
  return i;
2065
2138
  function i(a) {
2066
- return a !== 87 && a !== 119 || !Pt.call(n, n.previous) || Re(n.events) ? t(a) : (e.enter("literalAutolink"), e.enter("literalAutolinkWww"), e.check(pa, e.attempt(Nt, e.attempt(St, o), t), t)(a));
2139
+ return a !== 87 && a !== 119 || !Et.call(n, n.previous) || Fe(n.events) ? t(a) : (e.enter("literalAutolink"), e.enter("literalAutolinkWww"), e.check(xa, e.attempt(Mt, e.attempt(Dt, o), t), t)(a));
2067
2140
  }
2068
2141
  function o(a) {
2069
2142
  return e.exit("literalAutolinkWww"), e.exit("literalAutolink"), r(a);
2070
2143
  }
2071
2144
  }
2072
- function wa(e, r, t) {
2145
+ function Ta(e, r, t) {
2073
2146
  const n = this;
2074
2147
  let i = "", o = !1;
2075
2148
  return a;
2076
- function a(c) {
2077
- return (c === 72 || c === 104) && Rt.call(n, n.previous) && !Re(n.events) ? (e.enter("literalAutolink"), e.enter("literalAutolinkHttp"), i += String.fromCodePoint(c), e.consume(c), u) : t(c);
2149
+ function a(s) {
2150
+ return (s === 72 || s === 104) && _t.call(n, n.previous) && !Fe(n.events) ? (e.enter("literalAutolink"), e.enter("literalAutolinkHttp"), i += String.fromCodePoint(s), e.consume(s), u) : t(s);
2078
2151
  }
2079
- function u(c) {
2080
- if (re(c) && i.length < 5)
2081
- return i += String.fromCodePoint(c), e.consume(c), u;
2082
- if (c === 58) {
2152
+ function u(s) {
2153
+ if (re(s) && i.length < 5)
2154
+ return i += String.fromCodePoint(s), e.consume(s), u;
2155
+ if (s === 58) {
2083
2156
  const p = i.toLowerCase();
2084
2157
  if (p === "http" || p === "https")
2085
- return e.consume(c), l;
2158
+ return e.consume(s), l;
2086
2159
  }
2087
- return t(c);
2160
+ return t(s);
2088
2161
  }
2089
- function l(c) {
2090
- return c === 47 ? (e.consume(c), o ? s : (o = !0, l)) : t(c);
2162
+ function l(s) {
2163
+ return s === 47 ? (e.consume(s), o ? c : (o = !0, l)) : t(s);
2091
2164
  }
2092
- function s(c) {
2093
- return c === null || Tr(c) || D(c) || H(c) || he(c) ? t(c) : e.attempt(Nt, e.attempt(St, f), t)(c);
2165
+ function c(s) {
2166
+ return s === null || Sr(s) || M(s) || H(s) || he(s) ? t(s) : e.attempt(Mt, e.attempt(Dt, f), t)(s);
2094
2167
  }
2095
- function f(c) {
2096
- return e.exit("literalAutolinkHttp"), e.exit("literalAutolink"), r(c);
2168
+ function f(s) {
2169
+ return e.exit("literalAutolinkHttp"), e.exit("literalAutolink"), r(s);
2097
2170
  }
2098
2171
  }
2099
- function ya(e, r, t) {
2172
+ function Aa(e, r, t) {
2100
2173
  let n = 0;
2101
2174
  return i;
2102
2175
  function i(a) {
@@ -2106,40 +2179,40 @@ function ya(e, r, t) {
2106
2179
  return a === null ? t(a) : r(a);
2107
2180
  }
2108
2181
  }
2109
- function Ca(e, r, t) {
2182
+ function Ia(e, r, t) {
2110
2183
  let n, i, o;
2111
2184
  return a;
2112
- function a(s) {
2113
- return s === 46 || s === 95 ? e.check(Lt, l, u)(s) : s === null || D(s) || H(s) || s !== 45 && he(s) ? l(s) : (o = !0, e.consume(s), a);
2185
+ function a(c) {
2186
+ return c === 46 || c === 95 ? e.check(Pt, l, u)(c) : c === null || M(c) || H(c) || c !== 45 && he(c) ? l(c) : (o = !0, e.consume(c), a);
2114
2187
  }
2115
- function u(s) {
2116
- return s === 95 ? n = !0 : (i = n, n = void 0), e.consume(s), a;
2188
+ function u(c) {
2189
+ return c === 95 ? n = !0 : (i = n, n = void 0), e.consume(c), a;
2117
2190
  }
2118
- function l(s) {
2119
- return i || n || !o ? t(s) : r(s);
2191
+ function l(c) {
2192
+ return i || n || !o ? t(c) : r(c);
2120
2193
  }
2121
2194
  }
2122
- function va(e, r) {
2195
+ function Na(e, r) {
2123
2196
  let t = 0, n = 0;
2124
2197
  return i;
2125
2198
  function i(a) {
2126
- return a === 40 ? (t++, e.consume(a), i) : a === 41 && n < t ? o(a) : a === 33 || a === 34 || a === 38 || a === 39 || a === 41 || a === 42 || a === 44 || a === 46 || a === 58 || a === 59 || a === 60 || a === 63 || a === 93 || a === 95 || a === 126 ? e.check(Lt, r, o)(a) : a === null || D(a) || H(a) ? r(a) : (e.consume(a), i);
2199
+ return a === 40 ? (t++, e.consume(a), i) : a === 41 && n < t ? o(a) : a === 33 || a === 34 || a === 38 || a === 39 || a === 41 || a === 42 || a === 44 || a === 46 || a === 58 || a === 59 || a === 60 || a === 63 || a === 93 || a === 95 || a === 126 ? e.check(Pt, r, o)(a) : a === null || M(a) || H(a) ? r(a) : (e.consume(a), i);
2127
2200
  }
2128
2201
  function o(a) {
2129
2202
  return a === 41 && n++, e.consume(a), i;
2130
2203
  }
2131
2204
  }
2132
- function Ta(e, r, t) {
2205
+ function Sa(e, r, t) {
2133
2206
  return n;
2134
2207
  function n(u) {
2135
2208
  return u === 33 || u === 34 || u === 39 || u === 41 || u === 42 || u === 44 || u === 46 || u === 58 || u === 59 || u === 63 || u === 95 || u === 126 ? (e.consume(u), n) : u === 38 ? (e.consume(u), o) : u === 93 ? (e.consume(u), i) : (
2136
2209
  // `<` is an end.
2137
2210
  u === 60 || // So is whitespace.
2138
- u === null || D(u) || H(u) ? r(u) : t(u)
2211
+ u === null || M(u) || H(u) ? r(u) : t(u)
2139
2212
  );
2140
2213
  }
2141
2214
  function i(u) {
2142
- return u === null || u === 40 || u === 91 || D(u) || H(u) ? r(u) : n(u);
2215
+ return u === null || u === 40 || u === 91 || M(u) || H(u) ? r(u) : n(u);
2143
2216
  }
2144
2217
  function o(u) {
2145
2218
  return re(u) ? a(u) : t(u);
@@ -2148,7 +2221,7 @@ function Ta(e, r, t) {
2148
2221
  return u === 59 ? (e.consume(u), n) : re(u) ? (e.consume(u), a) : t(u);
2149
2222
  }
2150
2223
  }
2151
- function Aa(e, r, t) {
2224
+ function La(e, r, t) {
2152
2225
  return n;
2153
2226
  function n(o) {
2154
2227
  return e.consume(o), i;
@@ -2157,19 +2230,19 @@ function Aa(e, r, t) {
2157
2230
  return Me(o) ? t(o) : r(o);
2158
2231
  }
2159
2232
  }
2160
- function Pt(e) {
2161
- return e === null || e === 40 || e === 42 || e === 95 || e === 91 || e === 93 || e === 126 || D(e);
2233
+ function Et(e) {
2234
+ return e === null || e === 40 || e === 42 || e === 95 || e === 91 || e === 93 || e === 126 || M(e);
2162
2235
  }
2163
- function Rt(e) {
2236
+ function _t(e) {
2164
2237
  return !re(e);
2165
2238
  }
2166
- function Et(e) {
2239
+ function zt(e) {
2167
2240
  return !(e === 47 || Le(e));
2168
2241
  }
2169
2242
  function Le(e) {
2170
2243
  return e === 43 || e === 45 || e === 46 || e === 95 || Me(e);
2171
2244
  }
2172
- function Re(e) {
2245
+ function Fe(e) {
2173
2246
  let r = e.length, t = !1;
2174
2247
  for (; r--; ) {
2175
2248
  const n = e[r][1];
@@ -2184,7 +2257,7 @@ function Re(e) {
2184
2257
  }
2185
2258
  return e.length > 0 && !t && (e[e.length - 1][1]._gfmAutolinkLiteralWalkedInto = !0), t;
2186
2259
  }
2187
- function Ia(e, r, t) {
2260
+ function Ma(e, r, t) {
2188
2261
  const n = [];
2189
2262
  let i = -1;
2190
2263
  for (; ++i < e.length; ) {
@@ -2198,56 +2271,56 @@ function z(e, r, t, n) {
2198
2271
  let o = 0;
2199
2272
  return a;
2200
2273
  function a(l) {
2201
- return F(l) ? (e.enter(t), u(l)) : r(l);
2274
+ return _(l) ? (e.enter(t), u(l)) : r(l);
2202
2275
  }
2203
2276
  function u(l) {
2204
- return F(l) && o++ < i ? (e.consume(l), u) : (e.exit(t), r(l));
2277
+ return _(l) && o++ < i ? (e.consume(l), u) : (e.exit(t), r(l));
2205
2278
  }
2206
2279
  }
2207
- const Na = {
2280
+ const Da = {
2208
2281
  partial: !0,
2209
- tokenize: Sa
2282
+ tokenize: Pa
2210
2283
  };
2211
- function Sa(e, r, t) {
2284
+ function Pa(e, r, t) {
2212
2285
  return n;
2213
2286
  function n(o) {
2214
- return F(o) ? z(e, i, "linePrefix")(o) : i(o);
2287
+ return _(o) ? z(e, i, "linePrefix")(o) : i(o);
2215
2288
  }
2216
2289
  function i(o) {
2217
2290
  return o === null || Z(o) ? r(o) : t(o);
2218
2291
  }
2219
2292
  }
2220
- const La = {
2221
- tokenize: za,
2293
+ const Fa = {
2294
+ tokenize: Ua,
2222
2295
  partial: !0
2223
2296
  };
2224
- function Ma() {
2297
+ function Ra() {
2225
2298
  return {
2226
2299
  document: {
2227
2300
  91: {
2228
2301
  name: "gfmFootnoteDefinition",
2229
- tokenize: Ea,
2302
+ tokenize: ja,
2230
2303
  continuation: {
2231
- tokenize: _a
2304
+ tokenize: $a
2232
2305
  },
2233
- exit: Fa
2306
+ exit: Oa
2234
2307
  }
2235
2308
  },
2236
2309
  text: {
2237
2310
  91: {
2238
2311
  name: "gfmFootnoteCall",
2239
- tokenize: Ra
2312
+ tokenize: za
2240
2313
  },
2241
2314
  93: {
2242
2315
  name: "gfmPotentialFootnoteCall",
2243
2316
  add: "after",
2244
- tokenize: Da,
2245
- resolveTo: Pa
2317
+ tokenize: Ea,
2318
+ resolveTo: _a
2246
2319
  }
2247
2320
  }
2248
2321
  };
2249
2322
  }
2250
- function Da(e, r, t) {
2323
+ function Ea(e, r, t) {
2251
2324
  const n = this;
2252
2325
  let i = n.events.length;
2253
2326
  const o = n.parser.gfmFootnotes || (n.parser.gfmFootnotes = []);
@@ -2265,14 +2338,14 @@ function Da(e, r, t) {
2265
2338
  function u(l) {
2266
2339
  if (!a || !a._balanced)
2267
2340
  return t(l);
2268
- const s = ae(n.sliceSerialize({
2341
+ const c = ae(n.sliceSerialize({
2269
2342
  start: a.end,
2270
2343
  end: n.now()
2271
2344
  }));
2272
- return s.codePointAt(0) !== 94 || !o.includes(s.slice(1)) ? t(l) : (e.enter("gfmFootnoteCallLabelMarker"), e.consume(l), e.exit("gfmFootnoteCallLabelMarker"), r(l));
2345
+ return c.codePointAt(0) !== 94 || !o.includes(c.slice(1)) ? t(l) : (e.enter("gfmFootnoteCallLabelMarker"), e.consume(l), e.exit("gfmFootnoteCallLabelMarker"), r(l));
2273
2346
  }
2274
2347
  }
2275
- function Pa(e, r) {
2348
+ function _a(e, r) {
2276
2349
  let t = e.length;
2277
2350
  for (; t--; )
2278
2351
  if (e[t][1].type === "labelImage" && e[t][0] === "enter") {
@@ -2322,44 +2395,44 @@ function Pa(e, r) {
2322
2395
  ];
2323
2396
  return e.splice(t, e.length - t + 1, ...u), e;
2324
2397
  }
2325
- function Ra(e, r, t) {
2398
+ function za(e, r, t) {
2326
2399
  const n = this, i = n.parser.gfmFootnotes || (n.parser.gfmFootnotes = []);
2327
2400
  let o = 0, a;
2328
2401
  return u;
2329
- function u(c) {
2330
- return e.enter("gfmFootnoteCall"), e.enter("gfmFootnoteCallLabelMarker"), e.consume(c), e.exit("gfmFootnoteCallLabelMarker"), l;
2402
+ function u(s) {
2403
+ return e.enter("gfmFootnoteCall"), e.enter("gfmFootnoteCallLabelMarker"), e.consume(s), e.exit("gfmFootnoteCallLabelMarker"), l;
2331
2404
  }
2332
- function l(c) {
2333
- return c !== 94 ? t(c) : (e.enter("gfmFootnoteCallMarker"), e.consume(c), e.exit("gfmFootnoteCallMarker"), e.enter("gfmFootnoteCallString"), e.enter("chunkString").contentType = "string", s);
2405
+ function l(s) {
2406
+ return s !== 94 ? t(s) : (e.enter("gfmFootnoteCallMarker"), e.consume(s), e.exit("gfmFootnoteCallMarker"), e.enter("gfmFootnoteCallString"), e.enter("chunkString").contentType = "string", c);
2334
2407
  }
2335
- function s(c) {
2408
+ function c(s) {
2336
2409
  if (
2337
2410
  // Too long.
2338
2411
  o > 999 || // Closing brace with nothing.
2339
- c === 93 && !a || // Space or tab is not supported by GFM for some reason.
2412
+ s === 93 && !a || // Space or tab is not supported by GFM for some reason.
2340
2413
  // `\n` and `[` not being supported makes sense.
2341
- c === null || c === 91 || D(c)
2414
+ s === null || s === 91 || M(s)
2342
2415
  )
2343
- return t(c);
2344
- if (c === 93) {
2416
+ return t(s);
2417
+ if (s === 93) {
2345
2418
  e.exit("chunkString");
2346
2419
  const p = e.exit("gfmFootnoteCallString");
2347
- return i.includes(ae(n.sliceSerialize(p))) ? (e.enter("gfmFootnoteCallLabelMarker"), e.consume(c), e.exit("gfmFootnoteCallLabelMarker"), e.exit("gfmFootnoteCall"), r) : t(c);
2420
+ return i.includes(ae(n.sliceSerialize(p))) ? (e.enter("gfmFootnoteCallLabelMarker"), e.consume(s), e.exit("gfmFootnoteCallLabelMarker"), e.exit("gfmFootnoteCall"), r) : t(s);
2348
2421
  }
2349
- return D(c) || (a = !0), o++, e.consume(c), c === 92 ? f : s;
2422
+ return M(s) || (a = !0), o++, e.consume(s), s === 92 ? f : c;
2350
2423
  }
2351
- function f(c) {
2352
- return c === 91 || c === 92 || c === 93 ? (e.consume(c), o++, s) : s(c);
2424
+ function f(s) {
2425
+ return s === 91 || s === 92 || s === 93 ? (e.consume(s), o++, c) : c(s);
2353
2426
  }
2354
2427
  }
2355
- function Ea(e, r, t) {
2428
+ function ja(e, r, t) {
2356
2429
  const n = this, i = n.parser.gfmFootnotes || (n.parser.gfmFootnotes = []);
2357
2430
  let o, a = 0, u;
2358
2431
  return l;
2359
2432
  function l(h) {
2360
- return e.enter("gfmFootnoteDefinition")._container = !0, e.enter("gfmFootnoteDefinitionLabel"), e.enter("gfmFootnoteDefinitionLabelMarker"), e.consume(h), e.exit("gfmFootnoteDefinitionLabelMarker"), s;
2433
+ return e.enter("gfmFootnoteDefinition")._container = !0, e.enter("gfmFootnoteDefinitionLabel"), e.enter("gfmFootnoteDefinitionLabelMarker"), e.consume(h), e.exit("gfmFootnoteDefinitionLabelMarker"), c;
2361
2434
  }
2362
- function s(h) {
2435
+ function c(h) {
2363
2436
  return h === 94 ? (e.enter("gfmFootnoteDefinitionMarker"), e.consume(h), e.exit("gfmFootnoteDefinitionMarker"), e.enter("gfmFootnoteDefinitionLabelString"), e.enter("chunkString").contentType = "string", f) : t(h);
2364
2437
  }
2365
2438
  function f(h) {
@@ -2368,7 +2441,7 @@ function Ea(e, r, t) {
2368
2441
  a > 999 || // Closing brace with nothing.
2369
2442
  h === 93 && !u || // Space or tab is not supported by GFM for some reason.
2370
2443
  // `\n` and `[` not being supported makes sense.
2371
- h === null || h === 91 || D(h)
2444
+ h === null || h === 91 || M(h)
2372
2445
  )
2373
2446
  return t(h);
2374
2447
  if (h === 93) {
@@ -2376,25 +2449,25 @@ function Ea(e, r, t) {
2376
2449
  const k = e.exit("gfmFootnoteDefinitionLabelString");
2377
2450
  return o = ae(n.sliceSerialize(k)), e.enter("gfmFootnoteDefinitionLabelMarker"), e.consume(h), e.exit("gfmFootnoteDefinitionLabelMarker"), e.exit("gfmFootnoteDefinitionLabel"), p;
2378
2451
  }
2379
- return D(h) || (u = !0), a++, e.consume(h), h === 92 ? c : f;
2452
+ return M(h) || (u = !0), a++, e.consume(h), h === 92 ? s : f;
2380
2453
  }
2381
- function c(h) {
2454
+ function s(h) {
2382
2455
  return h === 91 || h === 92 || h === 93 ? (e.consume(h), a++, f) : f(h);
2383
2456
  }
2384
2457
  function p(h) {
2385
- return h === 58 ? (e.enter("definitionMarker"), e.consume(h), e.exit("definitionMarker"), i.includes(o) || i.push(o), z(e, g, "gfmFootnoteDefinitionWhitespace")) : t(h);
2458
+ return h === 58 ? (e.enter("definitionMarker"), e.consume(h), e.exit("definitionMarker"), i.includes(o) || i.push(o), z(e, b, "gfmFootnoteDefinitionWhitespace")) : t(h);
2386
2459
  }
2387
- function g(h) {
2460
+ function b(h) {
2388
2461
  return r(h);
2389
2462
  }
2390
2463
  }
2391
- function _a(e, r, t) {
2392
- return e.check(Na, r, e.attempt(La, r, t));
2464
+ function $a(e, r, t) {
2465
+ return e.check(Da, r, e.attempt(Fa, r, t));
2393
2466
  }
2394
- function Fa(e) {
2467
+ function Oa(e) {
2395
2468
  e.exit("gfmFootnoteDefinition");
2396
2469
  }
2397
- function za(e, r, t) {
2470
+ function Ua(e, r, t) {
2398
2471
  const n = this;
2399
2472
  return z(e, i, "gfmFootnoteDefinitionIndent", 5);
2400
2473
  function i(o) {
@@ -2402,7 +2475,7 @@ function za(e, r, t) {
2402
2475
  return a && a[1].type === "gfmFootnoteDefinitionIndent" && a[2].sliceSerialize(a[1], !0).length === 4 ? r(o) : t(o);
2403
2476
  }
2404
2477
  }
2405
- function ja(e) {
2478
+ function Ba(e) {
2406
2479
  let t = (e || {}).singleTilde;
2407
2480
  const n = {
2408
2481
  name: "strikethrough",
@@ -2424,21 +2497,21 @@ function ja(e) {
2424
2497
  let l = -1;
2425
2498
  for (; ++l < a.length; )
2426
2499
  if (a[l][0] === "enter" && a[l][1].type === "strikethroughSequenceTemporary" && a[l][1]._close) {
2427
- let s = l;
2428
- for (; s--; )
2429
- if (a[s][0] === "exit" && a[s][1].type === "strikethroughSequenceTemporary" && a[s][1]._open && // If the sizes are the same:
2430
- a[l][1].end.offset - a[l][1].start.offset === a[s][1].end.offset - a[s][1].start.offset) {
2431
- a[l][1].type = "strikethroughSequence", a[s][1].type = "strikethroughSequence";
2500
+ let c = l;
2501
+ for (; c--; )
2502
+ if (a[c][0] === "exit" && a[c][1].type === "strikethroughSequenceTemporary" && a[c][1]._open && // If the sizes are the same:
2503
+ a[l][1].end.offset - a[l][1].start.offset === a[c][1].end.offset - a[c][1].start.offset) {
2504
+ a[l][1].type = "strikethroughSequence", a[c][1].type = "strikethroughSequence";
2432
2505
  const f = {
2433
2506
  type: "strikethrough",
2434
- start: Object.assign({}, a[s][1].start),
2507
+ start: Object.assign({}, a[c][1].start),
2435
2508
  end: Object.assign({}, a[l][1].end)
2436
- }, c = {
2509
+ }, s = {
2437
2510
  type: "strikethroughText",
2438
- start: Object.assign({}, a[s][1].end),
2511
+ start: Object.assign({}, a[c][1].end),
2439
2512
  end: Object.assign({}, a[l][1].start)
2440
- }, p = [["enter", f, u], ["enter", a[s][1], u], ["exit", a[s][1], u], ["enter", c, u]], g = u.parser.constructs.insideSpan.null;
2441
- g && ce(p, p.length, 0, Ia(g, a.slice(s + 1, l), u)), ce(p, p.length, 0, [["exit", c, u], ["enter", a[l][1], u], ["exit", a[l][1], u], ["exit", f, u]]), ce(a, s - 1, l - s + 3, p), l = s + p.length - 2;
2513
+ }, p = [["enter", f, u], ["enter", a[c][1], u], ["exit", a[c][1], u], ["enter", s, u]], b = u.parser.constructs.insideSpan.null;
2514
+ b && ce(p, p.length, 0, Ma(b, a.slice(c + 1, l), u)), ce(p, p.length, 0, [["exit", s, u], ["enter", a[l][1], u], ["exit", a[l][1], u], ["exit", f, u]]), ce(a, c - 1, l - c + 3, p), l = c + p.length - 2;
2442
2515
  break;
2443
2516
  }
2444
2517
  }
@@ -2447,23 +2520,23 @@ function ja(e) {
2447
2520
  return a;
2448
2521
  }
2449
2522
  function o(a, u, l) {
2450
- const s = this.previous, f = this.events;
2451
- let c = 0;
2523
+ const c = this.previous, f = this.events;
2524
+ let s = 0;
2452
2525
  return p;
2453
2526
  function p(h) {
2454
- return s === 126 && f[f.length - 1][1].type !== "characterEscape" ? l(h) : (a.enter("strikethroughSequenceTemporary"), g(h));
2527
+ return c === 126 && f[f.length - 1][1].type !== "characterEscape" ? l(h) : (a.enter("strikethroughSequenceTemporary"), b(h));
2455
2528
  }
2456
- function g(h) {
2457
- const k = de(s);
2529
+ function b(h) {
2530
+ const k = de(c);
2458
2531
  if (h === 126)
2459
- return c > 1 ? l(h) : (a.consume(h), c++, g);
2460
- if (c < 2 && !t) return l(h);
2461
- const b = a.exit("strikethroughSequenceTemporary"), x = de(h);
2462
- return b._open = !x || x === 2 && !!k, b._close = !k || k === 2 && !!x, u(h);
2532
+ return s > 1 ? l(h) : (a.consume(h), s++, b);
2533
+ if (s < 2 && !t) return l(h);
2534
+ const g = a.exit("strikethroughSequenceTemporary"), x = de(h);
2535
+ return g._open = !x || x === 2 && !!k, g._close = !k || k === 2 && !!x, u(h);
2463
2536
  }
2464
2537
  }
2465
2538
  }
2466
- class $a {
2539
+ class Wa {
2467
2540
  /**
2468
2541
  * Create a new edit map.
2469
2542
  */
@@ -2479,7 +2552,7 @@ class $a {
2479
2552
  * @returns {undefined}
2480
2553
  */
2481
2554
  add(r, t, n) {
2482
- Oa(this, r, t, n);
2555
+ Ha(this, r, t, n);
2483
2556
  }
2484
2557
  // To do: add this when moving to `micromark`.
2485
2558
  // /**
@@ -2518,7 +2591,7 @@ class $a {
2518
2591
  this.map.length = 0;
2519
2592
  }
2520
2593
  }
2521
- function Oa(e, r, t, n) {
2594
+ function Ha(e, r, t, n) {
2522
2595
  let i = 0;
2523
2596
  if (!(t === 0 && n.length === 0)) {
2524
2597
  for (; i < e.map.length; ) {
@@ -2531,7 +2604,7 @@ function Oa(e, r, t, n) {
2531
2604
  e.map.push([r, t, n]);
2532
2605
  }
2533
2606
  }
2534
- function Ua(e, r) {
2607
+ function qa(e, r) {
2535
2608
  let t = !1;
2536
2609
  const n = [];
2537
2610
  for (; r < e.length; ) {
@@ -2551,107 +2624,107 @@ function Ua(e, r) {
2551
2624
  }
2552
2625
  return n;
2553
2626
  }
2554
- function Ba() {
2627
+ function Ka() {
2555
2628
  return {
2556
2629
  flow: {
2557
2630
  null: {
2558
2631
  name: "table",
2559
- tokenize: Wa,
2560
- resolveAll: Ha
2632
+ tokenize: Va,
2633
+ resolveAll: Ga
2561
2634
  }
2562
2635
  }
2563
2636
  };
2564
2637
  }
2565
- function Wa(e, r, t) {
2638
+ function Va(e, r, t) {
2566
2639
  const n = this;
2567
2640
  let i = 0, o = 0, a;
2568
2641
  return u;
2569
2642
  function u(m) {
2570
2643
  let P = n.events.length - 1;
2571
2644
  for (; P > -1; ) {
2572
- const J = n.events[P][1].type;
2573
- if (J === "lineEnding" || // Note: markdown-rs uses `whitespace` instead of `linePrefix`
2574
- J === "linePrefix") P--;
2645
+ const Q = n.events[P][1].type;
2646
+ if (Q === "lineEnding" || // Note: markdown-rs uses `whitespace` instead of `linePrefix`
2647
+ Q === "linePrefix") P--;
2575
2648
  else break;
2576
2649
  }
2577
2650
  const ie = P > -1 ? n.events[P][1].type : null, O = ie === "tableHead" || ie === "tableRow" ? C : l;
2578
2651
  return O === C && n.parser.lazy[n.now().line] ? t(m) : O(m);
2579
2652
  }
2580
2653
  function l(m) {
2581
- return e.enter("tableHead"), e.enter("tableRow"), s(m);
2654
+ return e.enter("tableHead"), e.enter("tableRow"), c(m);
2582
2655
  }
2583
- function s(m) {
2656
+ function c(m) {
2584
2657
  return m === 124 || (a = !0, o += 1), f(m);
2585
2658
  }
2586
2659
  function f(m) {
2587
- return m === null ? t(m) : Z(m) ? o > 1 ? (o = 0, n.interrupt = !0, e.exit("tableRow"), e.enter("lineEnding"), e.consume(m), e.exit("lineEnding"), g) : t(m) : F(m) ? z(e, f, "whitespace")(m) : (o += 1, a && (a = !1, i += 1), m === 124 ? (e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"), a = !0, f) : (e.enter("data"), c(m)));
2660
+ return m === null ? t(m) : Z(m) ? o > 1 ? (o = 0, n.interrupt = !0, e.exit("tableRow"), e.enter("lineEnding"), e.consume(m), e.exit("lineEnding"), b) : t(m) : _(m) ? z(e, f, "whitespace")(m) : (o += 1, a && (a = !1, i += 1), m === 124 ? (e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"), a = !0, f) : (e.enter("data"), s(m)));
2588
2661
  }
2589
- function c(m) {
2590
- return m === null || m === 124 || D(m) ? (e.exit("data"), f(m)) : (e.consume(m), m === 92 ? p : c);
2662
+ function s(m) {
2663
+ return m === null || m === 124 || M(m) ? (e.exit("data"), f(m)) : (e.consume(m), m === 92 ? p : s);
2591
2664
  }
2592
2665
  function p(m) {
2593
- return m === 92 || m === 124 ? (e.consume(m), c) : c(m);
2666
+ return m === 92 || m === 124 ? (e.consume(m), s) : s(m);
2594
2667
  }
2595
- function g(m) {
2596
- return n.interrupt = !1, n.parser.lazy[n.now().line] ? t(m) : (e.enter("tableDelimiterRow"), a = !1, F(m) ? z(e, h, "linePrefix", n.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(m) : h(m));
2668
+ function b(m) {
2669
+ return n.interrupt = !1, n.parser.lazy[n.now().line] ? t(m) : (e.enter("tableDelimiterRow"), a = !1, _(m) ? z(e, h, "linePrefix", n.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(m) : h(m));
2597
2670
  }
2598
2671
  function h(m) {
2599
- return m === 45 || m === 58 ? b(m) : m === 124 ? (a = !0, e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"), k) : T(m);
2672
+ return m === 45 || m === 58 ? g(m) : m === 124 ? (a = !0, e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"), k) : v(m);
2600
2673
  }
2601
2674
  function k(m) {
2602
- return F(m) ? z(e, b, "whitespace")(m) : b(m);
2675
+ return _(m) ? z(e, g, "whitespace")(m) : g(m);
2603
2676
  }
2604
- function b(m) {
2605
- return m === 58 ? (o += 1, a = !0, e.enter("tableDelimiterMarker"), e.consume(m), e.exit("tableDelimiterMarker"), x) : m === 45 ? (o += 1, x(m)) : m === null || Z(m) ? A(m) : T(m);
2677
+ function g(m) {
2678
+ return m === 58 ? (o += 1, a = !0, e.enter("tableDelimiterMarker"), e.consume(m), e.exit("tableDelimiterMarker"), x) : m === 45 ? (o += 1, x(m)) : m === null || Z(m) ? A(m) : v(m);
2606
2679
  }
2607
2680
  function x(m) {
2608
- return m === 45 ? (e.enter("tableDelimiterFiller"), w(m)) : T(m);
2681
+ return m === 45 ? (e.enter("tableDelimiterFiller"), w(m)) : v(m);
2609
2682
  }
2610
2683
  function w(m) {
2611
2684
  return m === 45 ? (e.consume(m), w) : m === 58 ? (a = !0, e.exit("tableDelimiterFiller"), e.enter("tableDelimiterMarker"), e.consume(m), e.exit("tableDelimiterMarker"), y) : (e.exit("tableDelimiterFiller"), y(m));
2612
2685
  }
2613
2686
  function y(m) {
2614
- return F(m) ? z(e, A, "whitespace")(m) : A(m);
2687
+ return _(m) ? z(e, A, "whitespace")(m) : A(m);
2615
2688
  }
2616
2689
  function A(m) {
2617
- return m === 124 ? h(m) : m === null || Z(m) ? !a || i !== o ? T(m) : (e.exit("tableDelimiterRow"), e.exit("tableHead"), r(m)) : T(m);
2690
+ return m === 124 ? h(m) : m === null || Z(m) ? !a || i !== o ? v(m) : (e.exit("tableDelimiterRow"), e.exit("tableHead"), r(m)) : v(m);
2618
2691
  }
2619
- function T(m) {
2692
+ function v(m) {
2620
2693
  return t(m);
2621
2694
  }
2622
2695
  function C(m) {
2623
- return e.enter("tableRow"), L(m);
2696
+ return e.enter("tableRow"), D(m);
2624
2697
  }
2625
- function L(m) {
2626
- return m === 124 ? (e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"), L) : m === null || Z(m) ? (e.exit("tableRow"), r(m)) : F(m) ? z(e, L, "whitespace")(m) : (e.enter("data"), E(m));
2698
+ function D(m) {
2699
+ return m === 124 ? (e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"), D) : m === null || Z(m) ? (e.exit("tableRow"), r(m)) : _(m) ? z(e, D, "whitespace")(m) : (e.enter("data"), R(m));
2627
2700
  }
2628
- function E(m) {
2629
- return m === null || m === 124 || D(m) ? (e.exit("data"), L(m)) : (e.consume(m), m === 92 ? q : E);
2701
+ function R(m) {
2702
+ return m === null || m === 124 || M(m) ? (e.exit("data"), D(m)) : (e.consume(m), m === 92 ? q : R);
2630
2703
  }
2631
2704
  function q(m) {
2632
- return m === 92 || m === 124 ? (e.consume(m), E) : E(m);
2705
+ return m === 92 || m === 124 ? (e.consume(m), R) : R(m);
2633
2706
  }
2634
2707
  }
2635
- function Ha(e, r) {
2636
- let t = -1, n = !0, i = 0, o = [0, 0, 0, 0], a = [0, 0, 0, 0], u = !1, l = 0, s, f, c;
2637
- const p = new $a();
2708
+ function Ga(e, r) {
2709
+ let t = -1, n = !0, i = 0, o = [0, 0, 0, 0], a = [0, 0, 0, 0], u = !1, l = 0, c, f, s;
2710
+ const p = new Wa();
2638
2711
  for (; ++t < e.length; ) {
2639
- const g = e[t], h = g[1];
2640
- g[0] === "enter" ? h.type === "tableHead" ? (u = !1, l !== 0 && (Je(p, r, l, s, f), f = void 0, l = 0), s = {
2712
+ const b = e[t], h = b[1];
2713
+ b[0] === "enter" ? h.type === "tableHead" ? (u = !1, l !== 0 && (Qe(p, r, l, c, f), f = void 0, l = 0), c = {
2641
2714
  type: "table",
2642
2715
  start: Object.assign({}, h.start),
2643
2716
  // Note: correct end is set later.
2644
2717
  end: Object.assign({}, h.end)
2645
- }, p.add(t, 0, [["enter", s, r]])) : h.type === "tableRow" || h.type === "tableDelimiterRow" ? (n = !0, c = void 0, o = [0, 0, 0, 0], a = [0, t + 1, 0, 0], u && (u = !1, f = {
2718
+ }, p.add(t, 0, [["enter", c, r]])) : h.type === "tableRow" || h.type === "tableDelimiterRow" ? (n = !0, s = void 0, o = [0, 0, 0, 0], a = [0, t + 1, 0, 0], u && (u = !1, f = {
2646
2719
  type: "tableBody",
2647
2720
  start: Object.assign({}, h.start),
2648
2721
  // Note: correct end is set later.
2649
2722
  end: Object.assign({}, h.end)
2650
- }, p.add(t, 0, [["enter", f, r]])), i = h.type === "tableDelimiterRow" ? 2 : f ? 3 : 1) : i && (h.type === "data" || h.type === "tableDelimiterMarker" || h.type === "tableDelimiterFiller") ? (n = !1, a[2] === 0 && (o[1] !== 0 && (a[0] = a[1], c = ue(p, r, o, i, void 0, c), o = [0, 0, 0, 0]), a[2] = t)) : h.type === "tableCellDivider" && (n ? n = !1 : (o[1] !== 0 && (a[0] = a[1], c = ue(p, r, o, i, void 0, c)), o = a, a = [o[1], t, 0, 0])) : h.type === "tableHead" ? (u = !0, l = t) : h.type === "tableRow" || h.type === "tableDelimiterRow" ? (l = t, o[1] !== 0 ? (a[0] = a[1], c = ue(p, r, o, i, t, c)) : a[1] !== 0 && (c = ue(p, r, a, i, t, c)), i = 0) : i && (h.type === "data" || h.type === "tableDelimiterMarker" || h.type === "tableDelimiterFiller") && (a[3] = t);
2723
+ }, p.add(t, 0, [["enter", f, r]])), i = h.type === "tableDelimiterRow" ? 2 : f ? 3 : 1) : i && (h.type === "data" || h.type === "tableDelimiterMarker" || h.type === "tableDelimiterFiller") ? (n = !1, a[2] === 0 && (o[1] !== 0 && (a[0] = a[1], s = ue(p, r, o, i, void 0, s), o = [0, 0, 0, 0]), a[2] = t)) : h.type === "tableCellDivider" && (n ? n = !1 : (o[1] !== 0 && (a[0] = a[1], s = ue(p, r, o, i, void 0, s)), o = a, a = [o[1], t, 0, 0])) : h.type === "tableHead" ? (u = !0, l = t) : h.type === "tableRow" || h.type === "tableDelimiterRow" ? (l = t, o[1] !== 0 ? (a[0] = a[1], s = ue(p, r, o, i, t, s)) : a[1] !== 0 && (s = ue(p, r, a, i, t, s)), i = 0) : i && (h.type === "data" || h.type === "tableDelimiterMarker" || h.type === "tableDelimiterFiller") && (a[3] = t);
2651
2724
  }
2652
- for (l !== 0 && Je(p, r, l, s, f), p.consume(r.events), t = -1; ++t < r.events.length; ) {
2653
- const g = r.events[t];
2654
- g[0] === "enter" && g[1].type === "table" && (g[1]._align = Ua(r.events, t));
2725
+ for (l !== 0 && Qe(p, r, l, c, f), p.consume(r.events), t = -1; ++t < r.events.length; ) {
2726
+ const b = r.events[t];
2727
+ b[0] === "enter" && b[1].type === "table" && (b[1]._align = qa(r.events, t));
2655
2728
  }
2656
2729
  return e;
2657
2730
  }
@@ -2665,23 +2738,23 @@ function ue(e, r, t, n, i, o) {
2665
2738
  // Note: correct end is set later.
2666
2739
  end: Object.assign({}, l)
2667
2740
  }, e.add(t[1], 0, [["enter", o, r]]), t[2] !== 0) {
2668
- const s = G(r.events, t[2]), f = G(r.events, t[3]), c = {
2741
+ const c = G(r.events, t[2]), f = G(r.events, t[3]), s = {
2669
2742
  type: u,
2670
- start: Object.assign({}, s),
2743
+ start: Object.assign({}, c),
2671
2744
  end: Object.assign({}, f)
2672
2745
  };
2673
- if (e.add(t[2], 0, [["enter", c, r]]), n !== 2) {
2674
- const p = r.events[t[2]], g = r.events[t[3]];
2675
- if (p[1].end = Object.assign({}, g[1].end), p[1].type = "chunkText", p[1].contentType = "text", t[3] > t[2] + 1) {
2746
+ if (e.add(t[2], 0, [["enter", s, r]]), n !== 2) {
2747
+ const p = r.events[t[2]], b = r.events[t[3]];
2748
+ if (p[1].end = Object.assign({}, b[1].end), p[1].type = "chunkText", p[1].contentType = "text", t[3] > t[2] + 1) {
2676
2749
  const h = t[2] + 1, k = t[3] - t[2] - 1;
2677
2750
  e.add(h, k, []);
2678
2751
  }
2679
2752
  }
2680
- e.add(t[3] + 1, 0, [["exit", c, r]]);
2753
+ e.add(t[3] + 1, 0, [["exit", s, r]]);
2681
2754
  }
2682
2755
  return i !== void 0 && (o.end = Object.assign({}, G(r.events, i)), e.add(i, 0, [["exit", o, r]]), o = void 0), o;
2683
2756
  }
2684
- function Je(e, r, t, n, i) {
2757
+ function Qe(e, r, t, n, i) {
2685
2758
  const o = [], a = G(r.events, t);
2686
2759
  i && (i.end = Object.assign({}, a), o.push(["exit", i, r])), n.end = Object.assign({}, a), o.push(["exit", n, r]), e.add(t + 1, 0, o);
2687
2760
  }
@@ -2689,18 +2762,18 @@ function G(e, r) {
2689
2762
  const t = e[r], n = t[0] === "enter" ? "start" : "end";
2690
2763
  return t[1][n];
2691
2764
  }
2692
- const qa = {
2765
+ const Za = {
2693
2766
  name: "tasklistCheck",
2694
- tokenize: Va
2767
+ tokenize: Qa
2695
2768
  };
2696
- function Ka() {
2769
+ function Ja() {
2697
2770
  return {
2698
2771
  text: {
2699
- 91: qa
2772
+ 91: Za
2700
2773
  }
2701
2774
  };
2702
2775
  }
2703
- function Va(e, r, t) {
2776
+ function Qa(e, r, t) {
2704
2777
  const n = this;
2705
2778
  return i;
2706
2779
  function i(l) {
@@ -2712,56 +2785,56 @@ function Va(e, r, t) {
2712
2785
  );
2713
2786
  }
2714
2787
  function o(l) {
2715
- return D(l) ? (e.enter("taskListCheckValueUnchecked"), e.consume(l), e.exit("taskListCheckValueUnchecked"), a) : l === 88 || l === 120 ? (e.enter("taskListCheckValueChecked"), e.consume(l), e.exit("taskListCheckValueChecked"), a) : t(l);
2788
+ return M(l) ? (e.enter("taskListCheckValueUnchecked"), e.consume(l), e.exit("taskListCheckValueUnchecked"), a) : l === 88 || l === 120 ? (e.enter("taskListCheckValueChecked"), e.consume(l), e.exit("taskListCheckValueChecked"), a) : t(l);
2716
2789
  }
2717
2790
  function a(l) {
2718
2791
  return l === 93 ? (e.enter("taskListCheckMarker"), e.consume(l), e.exit("taskListCheckMarker"), e.exit("taskListCheck"), u) : t(l);
2719
2792
  }
2720
2793
  function u(l) {
2721
- return Z(l) ? r(l) : F(l) ? e.check({
2722
- tokenize: Ga
2794
+ return Z(l) ? r(l) : _(l) ? e.check({
2795
+ tokenize: Xa
2723
2796
  }, r, t)(l) : t(l);
2724
2797
  }
2725
2798
  }
2726
- function Ga(e, r, t) {
2799
+ function Xa(e, r, t) {
2727
2800
  return z(e, n, "whitespace");
2728
2801
  function n(i) {
2729
2802
  return i === null ? t(i) : r(i);
2730
2803
  }
2731
2804
  }
2732
- function Za(e) {
2733
- return fa([
2734
- ba(),
2735
- Ma(),
2736
- ja(e),
2737
- Ba(),
2738
- Ka()
2805
+ function Ya(e) {
2806
+ return ga([
2807
+ ya(),
2808
+ Ra(),
2809
+ Ba(e),
2810
+ Ka(),
2811
+ Ja()
2739
2812
  ]);
2740
2813
  }
2741
- const Ja = {};
2742
- function Qa(e) {
2814
+ const ei = {};
2815
+ function ti(e) {
2743
2816
  const r = (
2744
2817
  /** @type {Processor<Root>} */
2745
2818
  this
2746
- ), t = e || Ja, n = r.data(), i = n.micromarkExtensions || (n.micromarkExtensions = []), o = n.fromMarkdownExtensions || (n.fromMarkdownExtensions = []), a = n.toMarkdownExtensions || (n.toMarkdownExtensions = []);
2747
- i.push(Za(t)), o.push(sa()), a.push(da(t));
2819
+ ), t = e || ei, n = r.data(), i = n.micromarkExtensions || (n.micromarkExtensions = []), o = n.fromMarkdownExtensions || (n.fromMarkdownExtensions = []), a = n.toMarkdownExtensions || (n.toMarkdownExtensions = []);
2820
+ i.push(Ya(t)), o.push(ma()), a.push(pa(t));
2748
2821
  }
2749
2822
  function I(...e) {
2750
2823
  return e.filter(Boolean).join(" ");
2751
2824
  }
2752
- const Xa = ({ content: e }) => /* @__PURE__ */ d(
2753
- Zt,
2825
+ const ri = ({ content: e }) => /* @__PURE__ */ d(
2826
+ Xt,
2754
2827
  {
2755
- remarkPlugins: [Qa],
2828
+ remarkPlugins: [ti],
2756
2829
  className: "cuadra-aui-md",
2757
- components: ti,
2830
+ components: ii,
2758
2831
  children: e
2759
2832
  }
2760
- ), _t = Ot(Xa), Ya = ({ language: e, code: r }) => {
2761
- const { isCopied: t, copyToClipboard: n } = ei();
2762
- return /* @__PURE__ */ v("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-between cuadra-gap-4 cuadra-mt-4 cuadra-rounded-t-lg cuadra-bg-muted/50 cuadra-border-b cuadra-border-border cuadra-px-4 cuadra-py-2 cuadra-text-sm cuadra-font-normal cuadra-text-foreground cuadra-font-brand", children: [
2833
+ ), jt = Wt(ri), ni = ({ language: e, code: r }) => {
2834
+ const { isCopied: t, copyToClipboard: n } = ai();
2835
+ return /* @__PURE__ */ T("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-between cuadra-gap-4 cuadra-mt-4 cuadra-rounded-t-lg cuadra-bg-muted/50 cuadra-border-b cuadra-border-border cuadra-px-4 cuadra-py-2 cuadra-text-sm cuadra-font-normal cuadra-text-foreground cuadra-font-brand", children: [
2763
2836
  /* @__PURE__ */ d("span", { className: "cuadra-lowercase [&>span]:cuadra-text-xs cuadra-font-brand", children: e }),
2764
- /* @__PURE__ */ v(
2837
+ /* @__PURE__ */ T(
2765
2838
  "button",
2766
2839
  {
2767
2840
  onClick: () => {
@@ -2770,13 +2843,13 @@ const Xa = ({ content: e }) => /* @__PURE__ */ d(
2770
2843
  className: "cuadra-p-1 cuadra-rounded hover:cuadra-bg-muted cuadra-transition-colors",
2771
2844
  "aria-label": "Copy code",
2772
2845
  children: [
2773
- !t && /* @__PURE__ */ d(sr, { className: "cuadra-h-4 cuadra-w-4" }),
2774
- t && /* @__PURE__ */ d(ar, { className: "cuadra-h-4 cuadra-w-4" })
2846
+ !t && /* @__PURE__ */ d(hr, { className: "cuadra-h-4 cuadra-w-4" }),
2847
+ t && /* @__PURE__ */ d(lr, { className: "cuadra-h-4 cuadra-w-4" })
2775
2848
  ]
2776
2849
  }
2777
2850
  )
2778
2851
  ] });
2779
- }, ei = ({
2852
+ }, ai = ({
2780
2853
  copiedDuration: e = 3e3
2781
2854
  } = {}) => {
2782
2855
  const [r, t] = N(!1);
@@ -2785,7 +2858,7 @@ const Xa = ({ content: e }) => /* @__PURE__ */ d(
2785
2858
  t(!0), setTimeout(() => t(!1), e);
2786
2859
  });
2787
2860
  } };
2788
- }, ti = Vt({
2861
+ }, ii = Jt({
2789
2862
  h1: ({ className: e, ...r }) => /* @__PURE__ */ d(
2790
2863
  "h1",
2791
2864
  {
@@ -2886,7 +2959,7 @@ const Xa = ({ content: e }) => /* @__PURE__ */ d(
2886
2959
  }
2887
2960
  ),
2888
2961
  code: function({ className: r, ...t }) {
2889
- const n = Gt();
2962
+ const n = Qt();
2890
2963
  return /* @__PURE__ */ d(
2891
2964
  "code",
2892
2965
  {
@@ -2895,39 +2968,39 @@ const Xa = ({ content: e }) => /* @__PURE__ */ d(
2895
2968
  }
2896
2969
  );
2897
2970
  },
2898
- CodeHeader: Ya
2899
- }), Qe = [
2971
+ CodeHeader: ni
2972
+ }), Xe = [
2900
2973
  "Sending question…",
2901
2974
  "Understanding your need…",
2902
2975
  "Scanning data…",
2903
2976
  "Comparing results…",
2904
2977
  "Composing answer…"
2905
2978
  ];
2906
- function ri({ active: e }) {
2979
+ function oi({ active: e }) {
2907
2980
  const [r, t] = N(0);
2908
- return M(() => {
2981
+ return L(() => {
2909
2982
  if (!e) {
2910
2983
  t(0);
2911
2984
  return;
2912
2985
  }
2913
2986
  const n = window.setInterval(() => {
2914
- t((i) => i >= Qe.length - 1 ? (window.clearInterval(n), i) : i + 1);
2987
+ t((i) => i >= Xe.length - 1 ? (window.clearInterval(n), i) : i + 1);
2915
2988
  }, 2500);
2916
2989
  return () => window.clearInterval(n);
2917
- }, [e]), e ? /* @__PURE__ */ v("span", { className: "cuadra-text-xs cuadra-text-muted-foreground cuadra-font-brand", children: [
2990
+ }, [e]), e ? /* @__PURE__ */ T("span", { className: "cuadra-text-xs cuadra-text-muted-foreground cuadra-font-brand", children: [
2918
2991
  "Thinking… ",
2919
- Qe[r]
2992
+ Xe[r]
2920
2993
  ] }) : null;
2921
2994
  }
2922
- function Xe({
2995
+ function Ye({
2923
2996
  welcomeTitle: e = "Hi, how can I help you today?",
2924
2997
  welcomeSubtitle: r = "Start exploring our platform and discover what you can build.",
2925
2998
  extraTopPadding: t,
2926
2999
  suggestions: n,
2927
3000
  inputPlaceholder: i = "Type your message..."
2928
3001
  } = {}) {
2929
- const o = Wt(), [a, u] = N(!1), [l, s] = N(null), [f, c] = N(!1);
2930
- return M(() => {
3002
+ const o = Vt(), [a, u] = N(!1), [l, c] = N(null), [f, s] = N(!1);
3003
+ return L(() => {
2931
3004
  if (!o) {
2932
3005
  u(!1);
2933
3006
  return;
@@ -2938,40 +3011,40 @@ function Xe({
2938
3011
  u(!1);
2939
3012
  return;
2940
3013
  }
2941
- const g = p.subscribe?.((k) => {
2942
- const b = k?.threadId, x = k?.messages || [], w = k?.isLoadingHistory || !1, y = x.length;
2943
- b && b !== l && s(b), u(w && y === 0);
2944
- const T = x.some(
2945
- (C) => C.role === "assistant" && !!C.content && (Array.isArray(C.content) ? C.content.some((L) => typeof L == "object" && L?.text ? L.text.trim().length > 0 : !1) : typeof C.content == "string" ? C.content.trim().length > 0 : !1)
3014
+ const b = p.subscribe?.((k) => {
3015
+ const g = k?.threadId, x = k?.messages || [], w = k?.isLoadingHistory || !1, y = x.length;
3016
+ g && g !== l && c(g), u(w && y === 0);
3017
+ const v = x.some(
3018
+ (C) => C.role === "assistant" && !!C.content && (Array.isArray(C.content) ? C.content.some((D) => typeof D == "object" && D?.text ? D.text.trim().length > 0 : !1) : typeof C.content == "string" ? C.content.trim().length > 0 : !1)
2946
3019
  );
2947
- c(T);
3020
+ s(v);
2948
3021
  }), h = p.getState?.();
2949
3022
  if (h) {
2950
- const k = h?.threadId, b = h?.messages || [], x = h?.isLoadingHistory || !1, w = b.length;
2951
- k && k !== l && s(k), u(x && w === 0);
2952
- const A = b.some(
2953
- (T) => T.role === "assistant" && !!T.content && (Array.isArray(T.content) ? T.content.some((C) => typeof C == "object" && C?.text ? C.text.trim().length > 0 : !1) : typeof T.content == "string" ? T.content.trim().length > 0 : !1)
3023
+ const k = h?.threadId, g = h?.messages || [], x = h?.isLoadingHistory || !1, w = g.length;
3024
+ k && k !== l && c(k), u(x && w === 0);
3025
+ const A = g.some(
3026
+ (v) => v.role === "assistant" && !!v.content && (Array.isArray(v.content) ? v.content.some((C) => typeof C == "object" && C?.text ? C.text.trim().length > 0 : !1) : typeof v.content == "string" ? v.content.trim().length > 0 : !1)
2954
3027
  );
2955
- c(A);
3028
+ s(A);
2956
3029
  }
2957
3030
  return () => {
2958
- g && g();
3031
+ b && b();
2959
3032
  };
2960
3033
  } catch {
2961
3034
  u(!1);
2962
3035
  }
2963
- }, [o, l]), /* @__PURE__ */ v(ee.Root, { className: "cuadra-bg-inherit cuadra-flex cuadra-flex-col cuadra-w-full cuadra-h-full", children: [
3036
+ }, [o, l]), /* @__PURE__ */ T(te.Root, { className: "cuadra-bg-inherit cuadra-flex cuadra-flex-col cuadra-w-full cuadra-h-full", children: [
2964
3037
  /* @__PURE__ */ d(
2965
- ee.Viewport,
3038
+ te.Viewport,
2966
3039
  {
2967
3040
  className: "cuadra-w-full cuadra-bg-inherit cuadra-px-4 cuadra-flex-1 cuadra-min-h-0 cuadra-overflow-y-auto cuadra-relative scrollbar-thin cuadra-pt-4",
2968
3041
  style: t ? { paddingTop: t } : void 0,
2969
- children: a ? /* @__PURE__ */ d("div", { className: "cuadra-absolute cuadra-inset-0 cuadra-flex cuadra-items-center cuadra-justify-center", children: /* @__PURE__ */ v("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-gap-2", children: [
2970
- /* @__PURE__ */ d(ot, { className: "cuadra-h-6 cuadra-w-6 cuadra-animate-spin cuadra-text-muted-foreground" }),
3042
+ children: a ? /* @__PURE__ */ d("div", { className: "cuadra-absolute cuadra-inset-0 cuadra-flex cuadra-items-center cuadra-justify-center", children: /* @__PURE__ */ T("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-gap-2", children: [
3043
+ /* @__PURE__ */ d(ut, { className: "cuadra-h-6 cuadra-w-6 cuadra-animate-spin cuadra-text-muted-foreground" }),
2971
3044
  /* @__PURE__ */ d("p", { className: "cuadra-text-sm cuadra-text-muted-foreground font-brand", children: "Loading messages..." })
2972
- ] }) }) : /* @__PURE__ */ v(B, { children: [
2973
- /* @__PURE__ */ d(ee.Empty, { children: /* @__PURE__ */ d(
2974
- ni,
3045
+ ] }) }) : /* @__PURE__ */ T(W, { children: [
3046
+ /* @__PURE__ */ d(te.Empty, { children: /* @__PURE__ */ d(
3047
+ li,
2975
3048
  {
2976
3049
  title: e,
2977
3050
  subtitle: r,
@@ -2979,19 +3052,19 @@ function Xe({
2979
3052
  }
2980
3053
  ) }),
2981
3054
  /* @__PURE__ */ d(
2982
- ee.Messages,
3055
+ te.Messages,
2983
3056
  {
2984
3057
  components: {
2985
- UserMessage: ai,
2986
- AssistantMessage: ii
3058
+ UserMessage: ui,
3059
+ AssistantMessage: ci
2987
3060
  }
2988
3061
  }
2989
3062
  ),
2990
- /* @__PURE__ */ d(ee.If, { running: !0, children: !f && /* @__PURE__ */ d("div", { className: "cuadra-mt-2 cuadra-max-w-2xl", children: /* @__PURE__ */ d(ri, { active: !0 }) }) })
3063
+ /* @__PURE__ */ d(te.If, { running: !0, children: !f && /* @__PURE__ */ d("div", { className: "cuadra-mt-2 cuadra-max-w-2xl", children: /* @__PURE__ */ d(oi, { active: !0 }) }) })
2991
3064
  ] })
2992
3065
  }
2993
3066
  ),
2994
- /* @__PURE__ */ d("div", { className: "cuadra-w-full cuadra-mt-3 cuadra-border-t cuadra-border-border cuadra-pt-4", children: /* @__PURE__ */ v(ke.Root, { className: "cuadra-relative !cuadra-relative cuadra-flex-1 cuadra-w-full", children: [
3067
+ /* @__PURE__ */ d("div", { className: "cuadra-w-full cuadra-mt-3 cuadra-border-t cuadra-border-border cuadra-pt-4", children: /* @__PURE__ */ T(ke.Root, { className: "cuadra-relative !cuadra-relative cuadra-flex-1 cuadra-w-full", children: [
2995
3068
  /* @__PURE__ */ d(
2996
3069
  ke.Input,
2997
3070
  {
@@ -3001,8 +3074,8 @@ function Xe({
3001
3074
  {
3002
3075
  rows: 3,
3003
3076
  placeholder: i,
3004
- className: "cuadra-flex cuadra-min-h-[80px] cuadra-w-full cuadra-rounded-md cuadra-border cuadra-border-input cuadra-bg-background cuadra-px-3 cuadra-py-2 cuadra-text-base placeholder:cuadra-text-muted-foreground focus-visible:cuadra-outline-none disabled:cuadra-cursor-not-allowed disabled:cuadra-opacity-50 cuadra-resize-none cuadra-pr-10 font-brand",
3005
- style: { paddingRight: "2.5rem", fontSize: "1rem" }
3077
+ className: "cuadra-flex cuadra-min-h-[80px] cuadra-w-full cuadra-rounded-md cuadra-border cuadra-border-border cuadra-bg-background cuadra-px-3 cuadra-py-2 cuadra-text-base placeholder:cuadra-text-muted-foreground focus-visible:cuadra-outline-none disabled:cuadra-cursor-not-allowed disabled:cuadra-opacity-50 cuadra-resize-none cuadra-pr-10 font-brand",
3078
+ style: { paddingRight: "2.5rem", fontSize: "1rem", borderWidth: "1px" }
3006
3079
  }
3007
3080
  )
3008
3081
  }
@@ -3010,25 +3083,31 @@ function Xe({
3010
3083
  /* @__PURE__ */ d(ke.Send, { asChild: !0, children: /* @__PURE__ */ d(
3011
3084
  "button",
3012
3085
  {
3013
- className: "!cuadra-absolute !cuadra-bottom-2 !cuadra-right-2 cuadra-size-8 cuadra-bg-secondary cuadra-text-secondary-foreground cuadra-rounded-md cuadra-shadow-sm hover:cuadra-bg-secondary/90 disabled:cuadra-opacity-50 disabled:cuadra-cursor-not-allowed cuadra-flex cuadra-items-center cuadra-justify-center",
3014
- style: { position: "absolute", bottom: "0.5rem", right: "0.5rem" },
3086
+ className: "!cuadra-absolute !cuadra-bottom-2 !cuadra-right-2 cuadra-size-8 cuadra-rounded-md cuadra-shadow-sm hover:cuadra-opacity-90 disabled:cuadra-opacity-50 disabled:cuadra-cursor-not-allowed cuadra-flex cuadra-items-center cuadra-justify-center",
3087
+ style: {
3088
+ position: "absolute",
3089
+ bottom: "0.5rem",
3090
+ right: "0.5rem",
3091
+ backgroundColor: "var(--primary)",
3092
+ color: "hsl(var(--primary-foreground))"
3093
+ },
3015
3094
  "aria-label": "Send message",
3016
3095
  type: "button",
3017
- children: /* @__PURE__ */ d(rr, { className: "cuadra-h-4 cuadra-w-4" })
3096
+ children: /* @__PURE__ */ d(ir, { className: "cuadra-h-4 cuadra-w-4" })
3018
3097
  }
3019
3098
  ) })
3020
3099
  ] }) })
3021
3100
  ] });
3022
3101
  }
3023
- function ni({ title: e, subtitle: r, suggestions: t }) {
3024
- const n = Ht(), i = async (o) => {
3102
+ function li({ title: e, subtitle: r, suggestions: t }) {
3103
+ const n = Gt(), i = async (o) => {
3025
3104
  try {
3026
3105
  n.composer().setText(o), await new Promise((a) => setTimeout(a, 10)), n.composer().send();
3027
3106
  } catch {
3028
3107
  }
3029
3108
  };
3030
- return /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-h-full cuadra-py-12 cuadra-px-4 cuadra-overflow-y-auto scrollbar-hide", children: /* @__PURE__ */ v("div", { className: "cuadra-text-center cuadra-max-w-3xl cuadra-w-full cuadra-flex cuadra-flex-col cuadra-items-center cuadra-justify-center cuadra-min-h-full", children: [
3031
- /* @__PURE__ */ v("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-justify-center cuadra-mb-8", children: [
3109
+ return /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-h-full cuadra-py-12 cuadra-px-4 cuadra-overflow-y-auto scrollbar-hide", children: /* @__PURE__ */ T("div", { className: "cuadra-text-center cuadra-max-w-3xl cuadra-w-full cuadra-flex cuadra-flex-col cuadra-items-center cuadra-justify-center cuadra-min-h-full", children: [
3110
+ /* @__PURE__ */ T("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-justify-center cuadra-mb-8", children: [
3032
3111
  /* @__PURE__ */ d("h2", { className: "cuadra-text-lg cuadra-font-normal cuadra-text-foreground cuadra-mb-2 font-brand", children: e }),
3033
3112
  /* @__PURE__ */ d("p", { className: "cuadra-text-muted-foreground font-brand", children: r })
3034
3113
  ] }),
@@ -3045,11 +3124,11 @@ function ni({ title: e, subtitle: r, suggestions: t }) {
3045
3124
  )) })
3046
3125
  ] }) });
3047
3126
  }
3048
- function ai() {
3127
+ function ui() {
3049
3128
  return /* @__PURE__ */ d(se.Root, { className: "cuadra-grid cuadra-w-full cuadra-auto-rows-auto cuadra-grid-cols-[minmax(72px,1fr)_auto] cuadra-gap-y-2 cuadra-py-3 [&:where(>*)]:cuadra-col-start-2", children: /* @__PURE__ */ d(
3050
3129
  "div",
3051
3130
  {
3052
- className: "cuadra-bg-muted cuadra-text-foreground cuadra-col-start-2 cuadra-row-start-2 cuadra-max-w-[calc(42rem*0.8)] cuadra-break-words cuadra-rounded-3xl cuadra-px-5 cuadra-py-2.5 font-brand",
3131
+ className: "cuadra-bg-muted cuadra-text-foreground cuadra-col-start-2 cuadra-row-start-2 cuadra-max-w-[calc(42rem*0.8)] cuadra-break-words cuadra-rounded-3xl cuadra-border cuadra-border-border cuadra-px-5 cuadra-py-2.5 font-brand",
3053
3132
  style: {
3054
3133
  maxWidth: "calc(42rem * 0.8)",
3055
3134
  borderRadius: "1.5rem",
@@ -3059,20 +3138,21 @@ function ai() {
3059
3138
  paddingRight: "1.25rem",
3060
3139
  paddingTop: "0.625rem",
3061
3140
  paddingBottom: "0.625rem",
3062
- wordBreak: "break-word"
3141
+ wordBreak: "break-word",
3142
+ borderWidth: "1px"
3063
3143
  },
3064
3144
  children: /* @__PURE__ */ d(
3065
3145
  se.Parts,
3066
3146
  {
3067
3147
  components: {
3068
- Text: ({ text: e }) => /* @__PURE__ */ d(_t, { content: e || "" })
3148
+ Text: ({ text: e }) => /* @__PURE__ */ d(jt, { content: e || "" })
3069
3149
  }
3070
3150
  }
3071
3151
  )
3072
3152
  }
3073
3153
  ) });
3074
3154
  }
3075
- function ii() {
3155
+ function ci() {
3076
3156
  return /* @__PURE__ */ d(se.Root, { className: "cuadra-relative cuadra-grid cuadra-w-full cuadra-grid-cols-[auto_auto_1fr] cuadra-grid-rows-[auto_1fr] cuadra-py-3", children: /* @__PURE__ */ d(
3077
3157
  "div",
3078
3158
  {
@@ -3086,30 +3166,30 @@ function ii() {
3086
3166
  se.Parts,
3087
3167
  {
3088
3168
  components: {
3089
- Text: ({ text: e }) => /* @__PURE__ */ d(_t, { content: e || "" })
3169
+ Text: ({ text: e }) => /* @__PURE__ */ d(jt, { content: e || "" })
3090
3170
  }
3091
3171
  }
3092
3172
  )
3093
3173
  }
3094
3174
  ) });
3095
3175
  }
3096
- function oi({ onThreadSelect: e }) {
3097
- const r = qt(), t = Kt((b) => b.threadId), [n, i] = N(null), o = r?.id === t, a = n === r?.id, [u, l] = N(!1), [s, f] = N(r?.title || ""), [c, p] = N(!1), [g, h] = N(!1), k = async () => {
3098
- if (!r?.remoteId || !s || s === r.title) {
3176
+ function si({ onThreadSelect: e }) {
3177
+ const r = at(), t = Zt((g) => g.threadId), [n, i] = N(null), o = r?.id === t, a = n === r?.id, [u, l] = N(!1), [c, f] = N(r?.title || ""), [s, p] = N(!1), [b, h] = N(!1), k = async () => {
3178
+ if (!r?.remoteId || !c || c === r.title) {
3099
3179
  l(!1);
3100
3180
  return;
3101
3181
  }
3102
3182
  try {
3103
3183
  h(!0);
3104
- const b = window.__cuadraThreadListAdapter;
3105
- b && typeof b.rename == "function" && await b.rename(r.remoteId, s), l(!1), p(!1);
3184
+ const g = window.__cuadraThreadListAdapter;
3185
+ g && typeof g.rename == "function" && await g.rename(r.remoteId, c), l(!1), p(!1);
3106
3186
  } catch {
3107
3187
  l(!1), p(!1);
3108
3188
  } finally {
3109
3189
  h(!1);
3110
3190
  }
3111
3191
  };
3112
- return M(() => {
3192
+ return L(() => {
3113
3193
  r?.title && !u && f(r.title);
3114
3194
  }, [r?.title, u]), r ? /* @__PURE__ */ d(
3115
3195
  we.Root,
@@ -3118,7 +3198,7 @@ function oi({ onThreadSelect: e }) {
3118
3198
  style: { marginBottom: "0.5rem" },
3119
3199
  onMouseEnter: () => i(r.id),
3120
3200
  onMouseLeave: () => i(null),
3121
- children: /* @__PURE__ */ v(
3201
+ children: /* @__PURE__ */ T(
3122
3202
  we.Trigger,
3123
3203
  {
3124
3204
  className: "cuadra-p-3 cuadra-flex-1 cuadra-flex cuadra-items-center cuadra-justify-between cuadra-w-full cuadra-min-w-0 cuadra-cursor-pointer",
@@ -3128,32 +3208,32 @@ function oi({ onThreadSelect: e }) {
3128
3208
  "input",
3129
3209
  {
3130
3210
  className: "cuadra-flex cuadra-w-full cuadra-rounded-md cuadra-border cuadra-border-input cuadra-bg-background cuadra-px-3 cuadra-py-2 cuadra-text-sm placeholder:cuadra-text-muted-foreground focus-visible:cuadra-outline-none disabled:cuadra-cursor-not-allowed disabled:cuadra-opacity-50 font-brand",
3131
- value: s,
3132
- onChange: (b) => f(b.target.value),
3133
- onKeyDown: (b) => {
3134
- b.key === "Enter" && k(), b.key === "Escape" && (l(!1), f(r.title || ""));
3211
+ value: c,
3212
+ onChange: (g) => f(g.target.value),
3213
+ onKeyDown: (g) => {
3214
+ g.key === "Enter" && k(), g.key === "Escape" && (l(!1), f(r.title || ""));
3135
3215
  },
3136
- disabled: g,
3216
+ disabled: b,
3137
3217
  autoFocus: !0,
3138
- onClick: (b) => b.stopPropagation()
3218
+ onClick: (g) => g.stopPropagation()
3139
3219
  }
3140
- ) : /* @__PURE__ */ v(B, { children: [
3220
+ ) : /* @__PURE__ */ T(W, { children: [
3141
3221
  /* @__PURE__ */ d("span", { className: "cuadra-text-sm cuadra-font-normal cuadra-text-foreground cuadra-truncate font-brand", children: (r.title?.length || 0) > 60 ? `${r.title?.slice(0, 60)}…` : r.title || "Chat" }),
3142
3222
  r.updatedAt && /* @__PURE__ */ d("span", { className: "cuadra-text-xs cuadra-text-muted-foreground cuadra-mt-1 font-brand", children: new Date(r.updatedAt).toLocaleDateString() })
3143
3223
  ] }) }),
3144
- /* @__PURE__ */ d("div", { className: "cuadra-ml-2 cuadra-flex-shrink-0 cuadra-w-6 cuadra-h-6 cuadra-flex cuadra-items-center cuadra-justify-center", children: (a || o || c) && /* @__PURE__ */ v("div", { className: "cuadra-relative", children: [
3224
+ /* @__PURE__ */ d("div", { className: "cuadra-ml-2 cuadra-flex-shrink-0 cuadra-w-6 cuadra-h-6 cuadra-flex cuadra-items-center cuadra-justify-center", children: (a || o || s) && /* @__PURE__ */ T("div", { className: "cuadra-relative", children: [
3145
3225
  /* @__PURE__ */ d(
3146
3226
  "button",
3147
3227
  {
3148
3228
  className: "cuadra-p-1 cuadra-rounded hover:cuadra-bg-background/50 cuadra-transition-colors",
3149
- onClick: (b) => {
3150
- b.stopPropagation(), p(!c);
3229
+ onClick: (g) => {
3230
+ g.stopPropagation(), p(!s);
3151
3231
  },
3152
3232
  "aria-label": "Thread options",
3153
- children: /* @__PURE__ */ d(fr, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground" })
3233
+ children: /* @__PURE__ */ d(pr, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground" })
3154
3234
  }
3155
3235
  ),
3156
- c && /* @__PURE__ */ v(B, { children: [
3236
+ s && /* @__PURE__ */ T(W, { children: [
3157
3237
  /* @__PURE__ */ d(
3158
3238
  "div",
3159
3239
  {
@@ -3165,19 +3245,19 @@ function oi({ onThreadSelect: e }) {
3165
3245
  "button",
3166
3246
  {
3167
3247
  className: "cuadra-w-full cuadra-px-3 cuadra-py-2 cuadra-text-sm cuadra-text-left hover:cuadra-bg-muted cuadra-transition-colors font-brand",
3168
- onClick: (b) => {
3169
- b.stopPropagation(), k();
3248
+ onClick: (g) => {
3249
+ g.stopPropagation(), k();
3170
3250
  },
3171
- disabled: g,
3251
+ disabled: b,
3172
3252
  children: "Save"
3173
3253
  }
3174
- ) : /* @__PURE__ */ v(B, { children: [
3254
+ ) : /* @__PURE__ */ T(W, { children: [
3175
3255
  /* @__PURE__ */ d(
3176
3256
  "button",
3177
3257
  {
3178
3258
  className: "cuadra-w-full cuadra-px-3 cuadra-py-2 cuadra-text-sm cuadra-text-left hover:cuadra-bg-muted cuadra-transition-colors font-brand",
3179
- onClick: (b) => {
3180
- b.stopPropagation(), l(!0), f(r.title || ""), p(!1);
3259
+ onClick: (g) => {
3260
+ g.stopPropagation(), l(!0), f(r.title || ""), p(!1);
3181
3261
  },
3182
3262
  children: "Rename"
3183
3263
  }
@@ -3187,8 +3267,8 @@ function oi({ onThreadSelect: e }) {
3187
3267
  "button",
3188
3268
  {
3189
3269
  className: "cuadra-w-full cuadra-px-3 cuadra-py-2 cuadra-text-sm cuadra-text-left cuadra-text-destructive hover:cuadra-bg-muted cuadra-transition-colors font-brand",
3190
- onClick: (b) => {
3191
- b.stopPropagation(), p(!1);
3270
+ onClick: (g) => {
3271
+ g.stopPropagation(), p(!1);
3192
3272
  },
3193
3273
  children: "Delete"
3194
3274
  }
@@ -3202,17 +3282,17 @@ function oi({ onThreadSelect: e }) {
3202
3282
  }
3203
3283
  ) : null;
3204
3284
  }
3205
- function Ye({ onThreadSelect: e }) {
3206
- return /* @__PURE__ */ v(xe.Root, { className: "!cuadra-border-r cuadra-border-border cuadra-flex cuadra-flex-col cuadra-bg-background cuadra-transition-all cuadra-duration-300 cuadra-ease-in-out cuadra-h-full cuadra-w-80", style: { borderRightWidth: "1px" }, children: [
3285
+ function et({ onThreadSelect: e }) {
3286
+ return /* @__PURE__ */ T(xe.Root, { className: "!cuadra-border-r cuadra-border-border cuadra-flex cuadra-flex-col cuadra-bg-background cuadra-transition-all cuadra-duration-300 cuadra-ease-in-out cuadra-h-full cuadra-w-80", style: { borderRightWidth: "1px" }, children: [
3207
3287
  /* @__PURE__ */ d("div", { className: "cuadra-border-b cuadra-border-border cuadra-flex cuadra-items-center cuadra-justify-between cuadra-transition-all cuadra-duration-300 cuadra-h-16 cuadra-px-4", children: /* @__PURE__ */ d("h3", { className: "cuadra-text-sm cuadra-font-normal cuadra-text-foreground cuadra-text-nowrap font-brand", children: "Chat History" }) }),
3208
- /* @__PURE__ */ v("div", { className: "cuadra-flex-1 cuadra-overflow-y-auto cuadra-p-2 scrollbar-thin", children: [
3288
+ /* @__PURE__ */ T("div", { className: "cuadra-flex-1 cuadra-overflow-y-auto cuadra-p-2 scrollbar-thin", children: [
3209
3289
  /* @__PURE__ */ d(
3210
3290
  xe.New,
3211
3291
  {
3212
3292
  className: "group cuadra-relative cuadra-flex cuadra-items-center cuadra-gap-3 cuadra-p-3 cuadra-rounded-lg cuadra-cursor-pointer cuadra-transition-colors cuadra-border cuadra-border-transparent hover:cuadra-bg-muted hover:cuadra-border-border",
3213
3293
  onClick: () => e?.(),
3214
- children: /* @__PURE__ */ d("div", { className: "cuadra-flex-1 cuadra-min-w-0", children: /* @__PURE__ */ v("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2", children: [
3215
- /* @__PURE__ */ d(br, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground" }),
3294
+ children: /* @__PURE__ */ d("div", { className: "cuadra-flex-1 cuadra-min-w-0", children: /* @__PURE__ */ T("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2", children: [
3295
+ /* @__PURE__ */ d(wr, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground" }),
3216
3296
  /* @__PURE__ */ d("h4", { className: "cuadra-text-sm cuadra-font-normal cuadra-text-foreground font-brand", children: "New Chat" })
3217
3297
  ] }) })
3218
3298
  }
@@ -3222,14 +3302,14 @@ function Ye({ onThreadSelect: e }) {
3222
3302
  xe.Items,
3223
3303
  {
3224
3304
  components: {
3225
- ThreadListItem: (r) => /* @__PURE__ */ d(oi, { ...r, onThreadSelect: e })
3305
+ ThreadListItem: (r) => /* @__PURE__ */ d(si, { ...r, onThreadSelect: e })
3226
3306
  }
3227
3307
  }
3228
3308
  )
3229
3309
  ] })
3230
3310
  ] });
3231
3311
  }
3232
- const li = `
3312
+ const di = `
3233
3313
  @keyframes rotate {
3234
3314
  100% { transform: rotate(1turn); }
3235
3315
  }
@@ -3242,9 +3322,9 @@ const li = `
3242
3322
  style: o,
3243
3323
  contentStyle: a,
3244
3324
  rotating: u = !1
3245
- }) => /* @__PURE__ */ v(B, { children: [
3246
- /* @__PURE__ */ d("style", { children: li }),
3247
- /* @__PURE__ */ v(
3325
+ }) => /* @__PURE__ */ T(W, { children: [
3326
+ /* @__PURE__ */ d("style", { children: di }),
3327
+ /* @__PURE__ */ T(
3248
3328
  "div",
3249
3329
  {
3250
3330
  className: `cuadra-relative cuadra-bg-background md:cuadra-rounded-xl cuadra-overflow-hidden ${r}`,
@@ -3259,13 +3339,13 @@ const li = `
3259
3339
  top: "-100%",
3260
3340
  width: "300%",
3261
3341
  height: "300%",
3262
- backgroundImage: "conic-gradient(#ff8308, #ff5043, #392bd5, #ff8308)",
3342
+ backgroundImage: "conic-gradient(#F4633A, #FF7A4D, #FF8C5C, #F4633A, #FF7A4D, #FF8C5C)",
3263
3343
  backgroundRepeat: "no-repeat",
3264
3344
  backgroundSize: "cover",
3265
3345
  backgroundPosition: "center",
3266
3346
  animation: "rotate 4s linear infinite"
3267
3347
  } : {
3268
- backgroundImage: "linear-gradient(to right, #ff8308, #ff5043, #392bd5)",
3348
+ backgroundImage: "linear-gradient(to right, #F4633A, #FF7A4D, #FF8C5C, #F4633A)",
3269
3349
  backgroundSize: "cover",
3270
3350
  backgroundPosition: "center",
3271
3351
  backgroundRepeat: "no-repeat",
@@ -3290,7 +3370,7 @@ const li = `
3290
3370
  ]
3291
3371
  }
3292
3372
  )
3293
- ] }), ui = ({ className: e = "", theme: r = "system" }) => {
3373
+ ] }), fi = ({ className: e = "", theme: r = "system" }) => {
3294
3374
  const t = () => {
3295
3375
  if (typeof window > "u") return "light";
3296
3376
  if (r === "system") {
@@ -3299,9 +3379,9 @@ const li = `
3299
3379
  }
3300
3380
  return r;
3301
3381
  }, [n, i] = N(t);
3302
- return M(() => {
3382
+ return L(() => {
3303
3383
  r !== "system" && i(r);
3304
- }, [r]), M(() => {
3384
+ }, [r]), L(() => {
3305
3385
  const a = document.documentElement;
3306
3386
  a.classList.remove("light", "dark"), a.classList.add(n), r === "system" && localStorage.setItem("theme", n);
3307
3387
  }, [n, r]), /* @__PURE__ */ d(
@@ -3315,14 +3395,14 @@ const li = `
3315
3395
  disabled: r !== "system",
3316
3396
  className: `cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-8 cuadra-w-8 cuadra-rounded-full cuadra-bg-muted hover:cuadra-bg-muted/80 cuadra-transition-colors disabled:cuadra-opacity-50 disabled:cuadra-cursor-not-allowed ${e}`,
3317
3397
  children: /* @__PURE__ */ d(
3318
- ur,
3398
+ dr,
3319
3399
  {
3320
3400
  className: `cuadra-h-4 cuadra-w-4 cuadra-transition-colors ${n === "dark" ? "cuadra-text-primary" : "cuadra-text-gray-400"}`
3321
3401
  }
3322
3402
  )
3323
3403
  }
3324
3404
  );
3325
- }, et = ({
3405
+ }, tt = ({
3326
3406
  currentModel: e,
3327
3407
  models: r,
3328
3408
  modelsLoading: t,
@@ -3332,54 +3412,54 @@ const li = `
3332
3412
  showThemeToggle: a = !0,
3333
3413
  theme: u = "system",
3334
3414
  onMobileMenuClick: l,
3335
- showMobileMenuButton: s = !1
3415
+ showMobileMenuButton: c = !1
3336
3416
  }) => {
3337
- const [f, c] = N(!1), p = rt(null);
3338
- M(() => {
3417
+ const [f, s] = N(!1), p = nt(null);
3418
+ L(() => {
3339
3419
  const h = (k) => {
3340
- p.current && !p.current.contains(k.target) && c(!1);
3420
+ p.current && !p.current.contains(k.target) && s(!1);
3341
3421
  };
3342
3422
  return f && document.addEventListener("mousedown", h), () => {
3343
3423
  document.removeEventListener("mousedown", h);
3344
3424
  };
3345
3425
  }, [f]);
3346
- const g = r.find((h) => h.id === e);
3347
- return /* @__PURE__ */ v("div", { className: "cuadra-h-16 cuadra-px-4 cuadra-border-b cuadra-border-border cuadra-flex cuadra-items-center cuadra-justify-between cuadra-bg-background", children: [
3348
- /* @__PURE__ */ v("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2", children: [
3349
- s && /* @__PURE__ */ d(
3426
+ const b = r.find((h) => h.id === e);
3427
+ return /* @__PURE__ */ T("div", { className: "cuadra-h-16 cuadra-px-4 cuadra-border-b cuadra-border-border cuadra-flex cuadra-items-center cuadra-justify-between cuadra-bg-background", children: [
3428
+ /* @__PURE__ */ T("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2", children: [
3429
+ c && /* @__PURE__ */ d(
3350
3430
  "button",
3351
3431
  {
3352
3432
  type: "button",
3353
3433
  onClick: l,
3354
3434
  className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-8 cuadra-w-8 cuadra-rounded-full cuadra-bg-muted hover:cuadra-bg-muted/80 cuadra-transition-colors disabled:cuadra-opacity-50 disabled:cuadra-cursor-not-allowed md:cuadra-hidden",
3355
3435
  "aria-label": "Toggle thread list",
3356
- children: /* @__PURE__ */ d(pr, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-foreground" })
3436
+ children: /* @__PURE__ */ d(kr, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-foreground" })
3357
3437
  }
3358
3438
  ),
3359
- a && /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2", children: /* @__PURE__ */ d(ui, { theme: u }) })
3439
+ a && /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2", children: /* @__PURE__ */ d(fi, { theme: u }) })
3360
3440
  ] }),
3361
- /* @__PURE__ */ v("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2 md:cuadra-ml-0 cuadra-ml-auto", children: [
3441
+ /* @__PURE__ */ T("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2 md:cuadra-ml-0 cuadra-ml-auto", children: [
3362
3442
  !o && /* @__PURE__ */ d("label", { className: "cuadra-hidden md:cuadra-inline cuadra-text-sm cuadra-text-muted-foreground cuadra-font-brand", children: "Model" }),
3363
- o ? null : t ? /* @__PURE__ */ d("div", { className: "cuadra-w-48 cuadra-rounded-md cuadra-border cuadra-border-border cuadra-px-3 cuadra-py-2 cuadra-bg-muted", children: /* @__PURE__ */ d("span", { className: "cuadra-text-muted-foreground cuadra-text-sm cuadra-font-brand", children: "Loading..." }) }) : n ? /* @__PURE__ */ d("div", { className: "cuadra-w-48 cuadra-rounded-md cuadra-border cuadra-border-destructive cuadra-px-3 cuadra-py-2 cuadra-bg-destructive/10", children: /* @__PURE__ */ d("span", { className: "cuadra-text-destructive cuadra-text-sm cuadra-font-brand", children: "Failed to load models" }) }) : /* @__PURE__ */ v("div", { ref: p, className: "cuadra-relative cuadra-w-48", children: [
3364
- /* @__PURE__ */ v(
3443
+ o ? null : t ? /* @__PURE__ */ d("div", { className: "cuadra-w-48 cuadra-rounded-md cuadra-border cuadra-border-border cuadra-px-3 cuadra-py-2 cuadra-bg-muted", children: /* @__PURE__ */ d("span", { className: "cuadra-text-muted-foreground cuadra-text-sm cuadra-font-brand", children: "Loading..." }) }) : n ? /* @__PURE__ */ d("div", { className: "cuadra-w-48 cuadra-rounded-md cuadra-border cuadra-border-destructive cuadra-px-3 cuadra-py-2 cuadra-bg-destructive/10", children: /* @__PURE__ */ d("span", { className: "cuadra-text-destructive cuadra-text-sm cuadra-font-brand", children: "Failed to load models" }) }) : /* @__PURE__ */ T("div", { ref: p, className: "cuadra-relative cuadra-w-48", children: [
3444
+ /* @__PURE__ */ T(
3365
3445
  "button",
3366
3446
  {
3367
3447
  type: "button",
3368
- onClick: () => c(!f),
3448
+ onClick: () => s(!f),
3369
3449
  disabled: t || r.length === 0 || !!n,
3370
3450
  className: "cuadra-flex cuadra-h-10 cuadra-w-full cuadra-items-center cuadra-justify-between cuadra-rounded-md cuadra-border cuadra-border-input cuadra-bg-background cuadra-px-3 cuadra-py-2 cuadra-text-sm placeholder:cuadra-text-muted-foreground focus:cuadra-outline-none disabled:cuadra-cursor-not-allowed disabled:cuadra-opacity-50 cuadra-font-brand",
3371
3451
  children: [
3372
- /* @__PURE__ */ d("span", { className: g ? "cuadra-text-foreground" : "cuadra-text-muted-foreground", children: g?.name || "Select model" }),
3373
- /* @__PURE__ */ d(or, { className: "cuadra-ml-2 cuadra-h-4 cuadra-w-4 cuadra-opacity-50" })
3452
+ /* @__PURE__ */ d("span", { className: b ? "cuadra-text-foreground" : "cuadra-text-muted-foreground", children: b?.name || "Select model" }),
3453
+ /* @__PURE__ */ d(cr, { className: "cuadra-ml-2 cuadra-h-4 cuadra-w-4 cuadra-opacity-50" })
3374
3454
  ]
3375
3455
  }
3376
3456
  ),
3377
- f && r.length > 0 && /* @__PURE__ */ d("div", { className: "cuadra-absolute cuadra-z-50 cuadra-mt-1 cuadra-w-full cuadra-min-w-[8rem] cuadra-overflow-hidden cuadra-rounded-md glass-popover cuadra-text-popover-foreground cuadra-animate-in fade-in-80 cuadra-border cuadra-border-border cuadra-bg-popover cuadra-shadow-md", children: /* @__PURE__ */ d("div", { className: "cuadra-p-1", children: r.map((h) => /* @__PURE__ */ v(
3457
+ f && r.length > 0 && /* @__PURE__ */ d("div", { className: "cuadra-absolute cuadra-z-50 cuadra-mt-1 cuadra-w-full cuadra-min-w-[8rem] cuadra-overflow-hidden cuadra-rounded-md glass-popover cuadra-text-popover-foreground cuadra-animate-in fade-in-80 cuadra-border cuadra-border-border cuadra-bg-popover cuadra-shadow-md", children: /* @__PURE__ */ d("div", { className: "cuadra-p-1", children: r.map((h) => /* @__PURE__ */ T(
3378
3458
  "button",
3379
3459
  {
3380
3460
  type: "button",
3381
3461
  onClick: () => {
3382
- i(h.id), c(!1);
3462
+ i(h.id), s(!1);
3383
3463
  },
3384
3464
  className: `cuadra-relative cuadra-flex cuadra-w-full cuadra-cursor-pointer cuadra-select-none cuadra-items-center cuadra-rounded-sm cuadra-py-1.5 cuadra-pl-8 cuadra-pr-2 cuadra-text-sm cuadra-outline-none focus:cuadra-bg-secondary focus:cuadra-text-secondary-foreground font-brand cuadra-transition-colors ${e === h.id ? "cuadra-bg-secondary cuadra-text-secondary-foreground" : "hover:cuadra-bg-secondary/50"}`,
3385
3465
  children: [
@@ -3410,9 +3490,9 @@ const li = `
3410
3490
  ] })
3411
3491
  ] })
3412
3492
  ] });
3413
- }, ci = Ut(void 0), Ie = ({ children: e, value: r }) => /* @__PURE__ */ d(ci.Provider, { value: r, children: e });
3414
- function si() {
3415
- M(() => {
3493
+ }, hi = Ht(void 0), Ie = ({ children: e, value: r }) => /* @__PURE__ */ d(hi.Provider, { value: r, children: e });
3494
+ function mi() {
3495
+ L(() => {
3416
3496
  if (document.querySelector("style[data-cuadra-uikit]"))
3417
3497
  return;
3418
3498
  const r = document.createElement("div");
@@ -3434,8 +3514,8 @@ function si() {
3434
3514
  }, document.head.appendChild(n), o) break;
3435
3515
  }, []);
3436
3516
  }
3437
- const di = ({ config: e }) => {
3438
- si();
3517
+ const pi = ({ config: e }) => {
3518
+ mi();
3439
3519
  const {
3440
3520
  baseUrl: r,
3441
3521
  proxyUrl: t,
@@ -3445,50 +3525,50 @@ const di = ({ config: e }) => {
3445
3525
  modelId: a,
3446
3526
  onModelChange: u,
3447
3527
  ephemeral: l = !1,
3448
- systemPrompt: s,
3528
+ systemPrompt: c,
3449
3529
  initialThreadId: f,
3450
- welcomeTitle: c,
3530
+ welcomeTitle: s,
3451
3531
  welcomeSubtitle: p,
3452
- extraTopPadding: g,
3532
+ extraTopPadding: b,
3453
3533
  suggestions: h,
3454
3534
  inputPlaceholder: k,
3455
- showThemeToggle: b = !0,
3535
+ showThemeToggle: g = !0,
3456
3536
  theme: x = "system",
3457
3537
  onError: w,
3458
3538
  onChatCreated: y,
3459
3539
  onUserMessage: A,
3460
- onThreadIdUpdate: T
3461
- } = e, [C, L] = N(!1), E = t || r || "", q = !!t, m = W(
3462
- () => new lt(E, n || void 0, q),
3463
- [E, n, q]
3464
- ), [P, ie] = N(null), [O, J] = N(!1), [Q, Ee] = N(null), [Ft, _e] = N(!1);
3465
- M(() => {
3466
- i === "multiChat" && _e(!0);
3540
+ onThreadIdUpdate: v
3541
+ } = e, [C, D] = N(!1), R = t || r || "", q = !!t, m = U(
3542
+ () => new ct(R, n || void 0, q),
3543
+ [R, n, q]
3544
+ ), [P, ie] = N(null), [O, Q] = N(!1), [X, Re] = N(null), [$t, Ee] = N(!1);
3545
+ L(() => {
3546
+ i === "multiChat" && Ee(!0);
3467
3547
  }, [i]);
3468
- const K = te(async () => {
3548
+ const K = J(async () => {
3469
3549
  if (o === "selector") {
3470
- J(!0), Ee(null);
3550
+ Q(!0), Re(null);
3471
3551
  try {
3472
3552
  const S = await m.listModels();
3473
3553
  ie(S);
3474
3554
  } catch (S) {
3475
- Ee(S instanceof Error ? S : new Error("Failed to load models"));
3555
+ Re(S instanceof Error ? S : new Error("Failed to load models"));
3476
3556
  } finally {
3477
- J(!1);
3557
+ Q(!1);
3478
3558
  }
3479
3559
  }
3480
3560
  }, [m, o]);
3481
- M(() => {
3561
+ L(() => {
3482
3562
  o === "selector" && K();
3483
- }, [o, K]), M(() => (typeof window < "u" && (window.__cuadraUIKitRefetchModels = K), () => {
3563
+ }, [o, K]), L(() => (typeof window < "u" && (window.__cuadraUIKitRefetchModels = K), () => {
3484
3564
  typeof window < "u" && delete window.__cuadraUIKitRefetchModels;
3485
3565
  }), [K]);
3486
- const [_, Fe] = N(
3566
+ const [E, _e] = N(
3487
3567
  o === "fixed" && a || null
3488
- ), ze = rt(_), X = te(
3568
+ ), ze = nt(E), Y = J(
3489
3569
  (S) => {
3490
- const Y = ze.current;
3491
- Fe(S), ze.current = S, u?.(S), Y !== null && Y !== S && i === "multiChat" && setTimeout(() => {
3570
+ const ee = ze.current;
3571
+ _e(S), ze.current = S, u?.(S), ee !== null && ee !== S && i === "multiChat" && setTimeout(() => {
3492
3572
  const V = window.__cuadraThreadListRuntime;
3493
3573
  if (V?.threads?.switchToNewThread)
3494
3574
  try {
@@ -3509,48 +3589,48 @@ const di = ({ config: e }) => {
3509
3589
  },
3510
3590
  [u, i]
3511
3591
  );
3512
- M(() => {
3513
- if (o === "selector" && P?.items && P.items.length > 0 && !_) {
3592
+ L(() => {
3593
+ if (o === "selector" && P?.items && P.items.length > 0 && !E) {
3514
3594
  const S = P.items[0];
3515
3595
  if (S?.id) {
3516
- const Y = S.id;
3517
- Fe(Y), u?.(Y);
3596
+ const ee = S.id;
3597
+ _e(ee), u?.(ee);
3518
3598
  }
3519
3599
  }
3520
- }, [o, P?.items, _, u]);
3521
- const zt = o === "fixed" ? !!a : !!_, oe = W(
3600
+ }, [o, P?.items, E, u]);
3601
+ const Ot = o === "fixed" ? !!a : !!E, oe = U(
3522
3602
  () => (P?.items || []).filter((S) => S?.id && S?.displayName).map((S) => ({ id: S.id, name: S.displayName })),
3523
3603
  [P]
3524
- ), be = W(
3604
+ ), be = U(
3525
3605
  () => ({
3526
- currentModelId: _ || "",
3606
+ currentModelId: E || "",
3527
3607
  models: oe,
3528
3608
  modelsLoading: O,
3529
- modelsError: Q,
3530
- onModelChange: X,
3609
+ modelsError: X,
3610
+ onModelChange: Y,
3531
3611
  refetchModels: K
3532
3612
  }),
3533
- [_, oe, O, Q, X, K]
3613
+ [E, oe, O, X, Y, K]
3534
3614
  );
3535
- return o === "selector" && O || i === "multiChat" && Ft ? /* @__PURE__ */ d(Ie, { value: be, children: /* @__PURE__ */ d(Ae, { className: "cuadra-h-full", paddingX: "cuadra-px-0", paddingY: "cuadra-py-0", children: /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-full", children: /* @__PURE__ */ d(ot, { className: "cuadra-h-6 cuadra-w-6 cuadra-animate-spin cuadra-text-muted-foreground" }) }) }) }) : o === "selector" && !zt && Q ? /* @__PURE__ */ d(Ie, { value: be, children: /* @__PURE__ */ d(Ae, { className: "cuadra-h-full", paddingX: "cuadra-px-0", paddingY: "cuadra-py-0", children: /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-full", children: /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-gap-2", children: /* @__PURE__ */ d("p", { className: "cuadra-text-sm cuadra-text-destructive font-brand", children: "Failed to load models" }) }) }) }) }) : /* @__PURE__ */ d("div", { className: "cuadra-uikit cuadra-h-full cuadra-w-full", style: { height: "100%", width: "100%" }, children: /* @__PURE__ */ d(Ie, { value: be, children: /* @__PURE__ */ d(
3536
- Cr,
3615
+ return o === "selector" && O || i === "multiChat" && $t ? /* @__PURE__ */ d(Ie, { value: be, children: /* @__PURE__ */ d(Ae, { className: "cuadra-h-full", paddingX: "cuadra-px-0", paddingY: "cuadra-py-0", children: /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-full", children: /* @__PURE__ */ d(ut, { className: "cuadra-h-6 cuadra-w-6 cuadra-animate-spin cuadra-text-muted-foreground" }) }) }) }) : o === "selector" && !Ot && X ? /* @__PURE__ */ d(Ie, { value: be, children: /* @__PURE__ */ d(Ae, { className: "cuadra-h-full", paddingX: "cuadra-px-0", paddingY: "cuadra-py-0", children: /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-items-center cuadra-justify-center cuadra-h-full", children: /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-flex-col cuadra-items-center cuadra-gap-2", children: /* @__PURE__ */ d("p", { className: "cuadra-text-sm cuadra-text-destructive font-brand", children: "Failed to load models" }) }) }) }) }) : /* @__PURE__ */ d("div", { className: "cuadra-uikit cuadra-h-full cuadra-w-full", style: { height: "100%", width: "100%" }, children: /* @__PURE__ */ d(Ie, { value: be, children: /* @__PURE__ */ d(
3616
+ Ar,
3537
3617
  {
3538
- baseUrl: q ? E : r || E,
3618
+ baseUrl: q ? R : r || R,
3539
3619
  sessionToken: n,
3540
3620
  isProxyMode: q,
3541
3621
  mode: i,
3542
3622
  modelMode: o,
3543
- modelId: _ || a || void 0,
3544
- onModelChange: X,
3623
+ modelId: E || a || void 0,
3624
+ onModelChange: Y,
3545
3625
  ephemeral: l,
3546
- systemPrompt: s,
3626
+ systemPrompt: c,
3547
3627
  initialThreadId: f,
3548
3628
  onError: w,
3549
3629
  onChatCreated: y,
3550
3630
  onUserMessage: A,
3551
- onThreadIdUpdate: T,
3631
+ onThreadIdUpdate: v,
3552
3632
  onChatsLoaded: () => {
3553
- i === "multiChat" && _e(!1);
3633
+ i === "multiChat" && Ee(!1);
3554
3634
  },
3555
3635
  children: /* @__PURE__ */ d(
3556
3636
  Ae,
@@ -3560,83 +3640,83 @@ const di = ({ config: e }) => {
3560
3640
  className: `cuadra-h-full ${e.containerClass || ""}`,
3561
3641
  borderSizePx: 4,
3562
3642
  style: { height: "100%" },
3563
- children: /* @__PURE__ */ d("div", { className: "cuadra-h-full cuadra-flex cuadra-relative", style: { height: "100%" }, children: i === "multiChat" ? /* @__PURE__ */ v(B, { children: [
3564
- C && typeof document < "u" && $e(
3643
+ children: /* @__PURE__ */ d("div", { className: "cuadra-h-full cuadra-flex cuadra-relative", style: { height: "100%" }, children: i === "multiChat" ? /* @__PURE__ */ T(W, { children: [
3644
+ C && typeof document < "u" && Oe(
3565
3645
  /* @__PURE__ */ d(
3566
3646
  "div",
3567
3647
  {
3568
3648
  className: "cuadra-fixed cuadra-inset-0 cuadra-bg-black/50 cuadra-z-40 md:cuadra-hidden",
3569
- onClick: () => L(!1)
3649
+ onClick: () => D(!1)
3570
3650
  }
3571
3651
  ),
3572
3652
  document.body
3573
3653
  ),
3574
- typeof document < "u" && /* @__PURE__ */ v(B, { children: [
3654
+ typeof document < "u" && /* @__PURE__ */ T(W, { children: [
3575
3655
  /* @__PURE__ */ d(
3576
3656
  "div",
3577
3657
  {
3578
3658
  className: "cuadra-hidden md:cuadra-block !cuadra-border-r cuadra-border-border cuadra-flex cuadra-flex-col cuadra-bg-background cuadra-transition-all cuadra-duration-300 cuadra-ease-in-out cuadra-h-full cuadra-w-80 cuadra-relative",
3579
3659
  style: { borderRightWidth: "1px", height: "100%" },
3580
- children: /* @__PURE__ */ d(Ye, { onThreadSelect: () => L(!1) })
3660
+ children: /* @__PURE__ */ d(et, { onThreadSelect: () => D(!1) })
3581
3661
  }
3582
3662
  ),
3583
- C && $e(
3663
+ C && Oe(
3584
3664
  /* @__PURE__ */ d(
3585
3665
  "div",
3586
3666
  {
3587
3667
  className: "cuadra-block md:cuadra-hidden !cuadra-border-r cuadra-border-border cuadra-flex cuadra-flex-col cuadra-bg-background cuadra-transition-all cuadra-duration-300 cuadra-ease-in-out cuadra-h-screen cuadra-w-80 cuadra-fixed cuadra-z-50 cuadra-top-0 cuadra-left-0 cuadra-translate-x-0",
3588
3668
  style: { borderRightWidth: "1px" },
3589
- children: /* @__PURE__ */ d(Ye, { onThreadSelect: () => L(!1) })
3669
+ children: /* @__PURE__ */ d(et, { onThreadSelect: () => D(!1) })
3590
3670
  }
3591
3671
  ),
3592
3672
  document.body
3593
3673
  )
3594
3674
  ] }),
3595
- /* @__PURE__ */ v("div", { className: "cuadra-flex-1 cuadra-flex cuadra-flex-col", children: [
3675
+ /* @__PURE__ */ T("div", { className: "cuadra-flex-1 cuadra-flex cuadra-flex-col", children: [
3596
3676
  o === "selector" && /* @__PURE__ */ d(
3597
- et,
3677
+ tt,
3598
3678
  {
3599
- currentModel: _ || "",
3679
+ currentModel: E || "",
3600
3680
  models: oe,
3601
3681
  modelsLoading: O,
3602
- modelsError: Q,
3603
- onModelChange: X,
3604
- showThemeToggle: b,
3682
+ modelsError: X,
3683
+ onModelChange: Y,
3684
+ showThemeToggle: g,
3605
3685
  theme: x,
3606
- onMobileMenuClick: () => L(!C),
3686
+ onMobileMenuClick: () => D(!C),
3607
3687
  showMobileMenuButton: i === "multiChat"
3608
3688
  }
3609
3689
  ),
3610
3690
  /* @__PURE__ */ d("div", { className: "cuadra-flex-1 cuadra-relative cuadra-min-h-0 cuadra-space-y-4 cuadra-p-4", children: /* @__PURE__ */ d(
3611
- Xe,
3691
+ Ye,
3612
3692
  {
3613
- welcomeTitle: c,
3693
+ welcomeTitle: s,
3614
3694
  welcomeSubtitle: p,
3615
- extraTopPadding: g,
3695
+ extraTopPadding: b,
3616
3696
  suggestions: h,
3617
3697
  inputPlaceholder: k
3618
3698
  }
3619
3699
  ) })
3620
3700
  ] })
3621
- ] }) : /* @__PURE__ */ v("div", { className: "cuadra-flex-1 cuadra-flex cuadra-flex-col", children: [
3701
+ ] }) : /* @__PURE__ */ T("div", { className: "cuadra-flex-1 cuadra-flex cuadra-flex-col", children: [
3622
3702
  o === "selector" && /* @__PURE__ */ d(
3623
- et,
3703
+ tt,
3624
3704
  {
3625
- currentModel: _ || "",
3705
+ currentModel: E || "",
3626
3706
  models: oe,
3627
3707
  modelsLoading: O,
3628
- modelsError: Q,
3629
- onModelChange: X,
3630
- showThemeToggle: b,
3708
+ modelsError: X,
3709
+ onModelChange: Y,
3710
+ showThemeToggle: g,
3631
3711
  theme: x
3632
3712
  }
3633
3713
  ),
3634
3714
  /* @__PURE__ */ d("div", { className: "cuadra-flex-1 cuadra-relative cuadra-min-h-0 cuadra-space-y-4 cuadra-p-4", children: /* @__PURE__ */ d(
3635
- Xe,
3715
+ Ye,
3636
3716
  {
3637
- welcomeTitle: c,
3717
+ welcomeTitle: s,
3638
3718
  welcomeSubtitle: p,
3639
- extraTopPadding: g,
3719
+ extraTopPadding: b,
3640
3720
  suggestions: h
3641
3721
  }
3642
3722
  ) })
@@ -3646,7 +3726,7 @@ const di = ({ config: e }) => {
3646
3726
  }
3647
3727
  ) }) });
3648
3728
  };
3649
- function xi(e) {
3729
+ function vi(e) {
3650
3730
  const r = {
3651
3731
  baseUrl: e.baseUrl,
3652
3732
  proxyUrl: e.proxyUrl,
@@ -3672,9 +3752,9 @@ function xi(e) {
3672
3752
  theme: e.theme,
3673
3753
  containerClass: e.className
3674
3754
  };
3675
- return /* @__PURE__ */ d(di, { config: r });
3755
+ return /* @__PURE__ */ d(pi, { config: r });
3676
3756
  }
3677
3757
  export {
3678
- xi as CuadraChat
3758
+ vi as CuadraChat
3679
3759
  };
3680
3760
  //# sourceMappingURL=index.mjs.map