@cuadra-ai/uikit 0.1.7 → 0.1.9
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/README.md +0 -1
- package/dist/adapters/chatModelAdapter.d.ts +1 -0
- package/dist/adapters/chatModelAdapter.d.ts.map +1 -1
- package/dist/components/CuadraChat.d.ts +2 -0
- package/dist/components/CuadraChat.d.ts.map +1 -1
- package/dist/components/CuadraRuntimeProvider.d.ts +2 -2
- package/dist/components/CuadraRuntimeProvider.d.ts.map +1 -1
- package/dist/components/SimpleThread.d.ts +3 -1
- package/dist/components/SimpleThread.d.ts.map +1 -1
- package/dist/components/WidgetContent.d.ts +4 -2
- package/dist/components/WidgetContent.d.ts.map +1 -1
- package/dist/index.cjs +15 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +955 -954
- package/dist/index.mjs.map +1 -1
- package/dist/lib/cuadraChatClient.d.ts +1 -6
- package/dist/lib/cuadraChatClient.d.ts.map +1 -1
- package/dist/widget/cuadra-uikit.umd.js +30 -30
- package/dist/widget/cuadra-uikit.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { forwardRef as
|
|
6
|
-
import { createPortal as
|
|
7
|
-
import { useLocalRuntime as
|
|
8
|
-
import { unstable_memoizeMarkdownComponents as
|
|
9
|
-
const
|
|
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(
|
|
10
10
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
11
11
|
(r, t, n) => n ? n.toUpperCase() : t.toLowerCase()
|
|
12
|
-
),
|
|
13
|
-
const r =
|
|
12
|
+
), Oe = (e) => {
|
|
13
|
+
const r = Qt(e);
|
|
14
14
|
return r.charAt(0).toUpperCase() + r.slice(1);
|
|
15
|
-
},
|
|
15
|
+
}, it = (...e) => e.filter((r, t, n) => !!r && r.trim() !== "" && n.indexOf(r) === t).join(" ").trim(), Xt = (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
|
|
20
|
+
var Yt = {
|
|
21
21
|
xmlns: "http://www.w3.org/2000/svg",
|
|
22
22
|
width: 24,
|
|
23
23
|
height: 24,
|
|
@@ -28,7 +28,7 @@ var Jt = {
|
|
|
28
28
|
strokeLinecap: "round",
|
|
29
29
|
strokeLinejoin: "round"
|
|
30
30
|
};
|
|
31
|
-
const
|
|
31
|
+
const er = tt(
|
|
32
32
|
({
|
|
33
33
|
color: e = "currentColor",
|
|
34
34
|
size: r = 24,
|
|
@@ -38,76 +38,75 @@ const Qt = Ye(
|
|
|
38
38
|
children: o,
|
|
39
39
|
iconNode: a,
|
|
40
40
|
...u
|
|
41
|
-
}, l) =>
|
|
41
|
+
}, l) => Ne(
|
|
42
42
|
"svg",
|
|
43
43
|
{
|
|
44
44
|
ref: l,
|
|
45
|
-
...
|
|
45
|
+
...Yt,
|
|
46
46
|
width: r,
|
|
47
47
|
height: r,
|
|
48
48
|
stroke: e,
|
|
49
49
|
strokeWidth: n ? Number(t) * 24 / Number(r) : t,
|
|
50
|
-
className:
|
|
51
|
-
...!o && !
|
|
50
|
+
className: it("lucide", i),
|
|
51
|
+
...!o && !Xt(u) && { "aria-hidden": "true" },
|
|
52
52
|
...u
|
|
53
53
|
},
|
|
54
54
|
[
|
|
55
|
-
...a.map(([s, f]) =>
|
|
55
|
+
...a.map(([s, f]) => Ne(s, f)),
|
|
56
56
|
...Array.isArray(o) ? o : [o]
|
|
57
57
|
]
|
|
58
58
|
)
|
|
59
59
|
);
|
|
60
|
-
const
|
|
61
|
-
const t =
|
|
62
|
-
({ className: n, ...i }, o) =>
|
|
60
|
+
const j = (e, r) => {
|
|
61
|
+
const t = tt(
|
|
62
|
+
({ className: n, ...i }, o) => Ne(er, {
|
|
63
63
|
ref: o,
|
|
64
64
|
iconNode: r,
|
|
65
|
-
className:
|
|
66
|
-
`lucide-${
|
|
65
|
+
className: it(
|
|
66
|
+
`lucide-${Jt(Oe(e))}`,
|
|
67
67
|
`lucide-${e}`,
|
|
68
68
|
n
|
|
69
69
|
),
|
|
70
70
|
...i
|
|
71
71
|
})
|
|
72
72
|
);
|
|
73
|
-
return t.displayName =
|
|
73
|
+
return t.displayName = Oe(e), t;
|
|
74
74
|
};
|
|
75
|
-
const
|
|
75
|
+
const tr = [
|
|
76
76
|
["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
|
|
77
77
|
["path", { d: "M12 19V5", key: "x0mq9r" }]
|
|
78
|
-
],
|
|
79
|
-
const
|
|
80
|
-
const
|
|
81
|
-
const
|
|
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 = [
|
|
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
|
-
],
|
|
85
|
-
const
|
|
84
|
+
], ur = j("contrast", lr);
|
|
85
|
+
const cr = [
|
|
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
|
-
],
|
|
89
|
-
const
|
|
88
|
+
], sr = j("copy", cr);
|
|
89
|
+
const dr = [
|
|
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
|
-
],
|
|
94
|
-
const
|
|
95
|
-
const
|
|
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 = [
|
|
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
|
-
],
|
|
100
|
-
const
|
|
99
|
+
], pr = j("menu", mr);
|
|
100
|
+
const gr = [
|
|
101
101
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
102
102
|
["path", { d: "M12 5v14", key: "s699le" }]
|
|
103
|
-
],
|
|
104
|
-
class
|
|
105
|
-
constructor(r, t, n = !1
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
this.baseUrl = r.replace(/\/$/, ""), this.isProxyMode = n, t && (this.sessionToken = t), i && (this.tenantId = i);
|
|
103
|
+
], br = j("plus", gr);
|
|
104
|
+
class lt {
|
|
105
|
+
constructor(r, t, n = !1) {
|
|
106
|
+
le(this, "baseUrl");
|
|
107
|
+
le(this, "sessionToken", null);
|
|
108
|
+
le(this, "isProxyMode", !1);
|
|
109
|
+
this.baseUrl = r.replace(/\/$/, ""), this.isProxyMode = n, t && (this.sessionToken = t);
|
|
111
110
|
}
|
|
112
111
|
/**
|
|
113
112
|
* Set or update the session token
|
|
@@ -115,12 +114,6 @@ class it {
|
|
|
115
114
|
setSessionToken(r) {
|
|
116
115
|
this.sessionToken = r;
|
|
117
116
|
}
|
|
118
|
-
/**
|
|
119
|
-
* Set or update the tenant ID
|
|
120
|
-
*/
|
|
121
|
-
setTenantId(r) {
|
|
122
|
-
this.tenantId = r;
|
|
123
|
-
}
|
|
124
117
|
/**
|
|
125
118
|
* Create or continue a chat with streaming support
|
|
126
119
|
* Returns a ReadableStream for SSE parsing
|
|
@@ -137,7 +130,7 @@ class it {
|
|
|
137
130
|
"Content-Type": "application/json",
|
|
138
131
|
"Idempotency-Key": this.generateIdempotencyKey()
|
|
139
132
|
};
|
|
140
|
-
this.sessionToken && (o.Authorization = `Bearer ${this.sessionToken}`)
|
|
133
|
+
this.sessionToken && (o.Authorization = `Bearer ${this.sessionToken}`);
|
|
141
134
|
const a = {
|
|
142
135
|
...r,
|
|
143
136
|
stream: !0
|
|
@@ -164,7 +157,7 @@ class it {
|
|
|
164
157
|
const t = this.getUrl(`/v1/chats/${r}`), n = {
|
|
165
158
|
"Content-Type": "application/json"
|
|
166
159
|
};
|
|
167
|
-
this.sessionToken && (n.Authorization = `Bearer ${this.sessionToken}`)
|
|
160
|
+
this.sessionToken && (n.Authorization = `Bearer ${this.sessionToken}`);
|
|
168
161
|
const i = await fetch(t, {
|
|
169
162
|
method: "GET",
|
|
170
163
|
headers: n
|
|
@@ -188,7 +181,7 @@ class it {
|
|
|
188
181
|
const i = {
|
|
189
182
|
"Content-Type": "application/json"
|
|
190
183
|
};
|
|
191
|
-
this.sessionToken && (i.Authorization = `Bearer ${this.sessionToken}`)
|
|
184
|
+
this.sessionToken && (i.Authorization = `Bearer ${this.sessionToken}`);
|
|
192
185
|
const o = await fetch(n.toString(), {
|
|
193
186
|
method: "GET",
|
|
194
187
|
headers: i
|
|
@@ -224,7 +217,7 @@ class it {
|
|
|
224
217
|
"Content-Type": "application/json",
|
|
225
218
|
"Idempotency-Key": this.generateIdempotencyKey()
|
|
226
219
|
};
|
|
227
|
-
this.sessionToken && (u.Authorization = `Bearer ${this.sessionToken}`)
|
|
220
|
+
this.sessionToken && (u.Authorization = `Bearer ${this.sessionToken}`);
|
|
228
221
|
const l = await fetch(o.toString(), {
|
|
229
222
|
method: "PATCH",
|
|
230
223
|
headers: u,
|
|
@@ -261,7 +254,7 @@ class it {
|
|
|
261
254
|
"Content-Type": "application/json",
|
|
262
255
|
"Idempotency-Key": this.generateIdempotencyKey()
|
|
263
256
|
};
|
|
264
|
-
this.sessionToken && (a.Authorization = `Bearer ${this.sessionToken}`)
|
|
257
|
+
this.sessionToken && (a.Authorization = `Bearer ${this.sessionToken}`);
|
|
265
258
|
const u = await fetch(i.toString(), {
|
|
266
259
|
method: "DELETE",
|
|
267
260
|
headers: a
|
|
@@ -284,7 +277,7 @@ class it {
|
|
|
284
277
|
const i = {
|
|
285
278
|
"Content-Type": "application/json"
|
|
286
279
|
};
|
|
287
|
-
this.sessionToken && (i.Authorization = `Bearer ${this.sessionToken}`)
|
|
280
|
+
this.sessionToken && (i.Authorization = `Bearer ${this.sessionToken}`);
|
|
288
281
|
const o = await fetch(n.toString(), {
|
|
289
282
|
method: "GET",
|
|
290
283
|
headers: i
|
|
@@ -304,7 +297,7 @@ class it {
|
|
|
304
297
|
const t = this.getUrl(`/v1/models/${r}`), n = {
|
|
305
298
|
"Content-Type": "application/json"
|
|
306
299
|
};
|
|
307
|
-
this.sessionToken && (n.Authorization = `Bearer ${this.sessionToken}`)
|
|
300
|
+
this.sessionToken && (n.Authorization = `Bearer ${this.sessionToken}`);
|
|
308
301
|
const i = await fetch(t, {
|
|
309
302
|
method: "GET",
|
|
310
303
|
headers: n
|
|
@@ -318,7 +311,7 @@ class it {
|
|
|
318
311
|
return i.json();
|
|
319
312
|
}
|
|
320
313
|
}
|
|
321
|
-
async function*
|
|
314
|
+
async function* kr(e, r) {
|
|
322
315
|
const t = e.getReader(), n = new TextDecoder();
|
|
323
316
|
let i = "";
|
|
324
317
|
try {
|
|
@@ -351,7 +344,7 @@ async function* gr(e, r) {
|
|
|
351
344
|
t.releaseLock();
|
|
352
345
|
}
|
|
353
346
|
}
|
|
354
|
-
function
|
|
347
|
+
function xr(e) {
|
|
355
348
|
return e.map((r) => {
|
|
356
349
|
let t = "";
|
|
357
350
|
if (typeof r.content == "string")
|
|
@@ -366,49 +359,51 @@ function br(e) {
|
|
|
366
359
|
};
|
|
367
360
|
});
|
|
368
361
|
}
|
|
369
|
-
function
|
|
370
|
-
const { modelId: t, systemPrompt: n, ephemeral: i, onChatCreated: o } = r;
|
|
362
|
+
function wr(e, r) {
|
|
363
|
+
const { modelId: t, systemPrompt: n, ephemeral: i, onChatCreated: o, onUserMessage: a } = r;
|
|
371
364
|
return {
|
|
372
|
-
async *run(
|
|
373
|
-
const { messages:
|
|
374
|
-
|
|
365
|
+
async *run(u) {
|
|
366
|
+
const { messages: l, abortSignal: s } = u;
|
|
367
|
+
l.length > 0 && l[l.length - 1].role === "user" && a?.();
|
|
368
|
+
const c = {
|
|
369
|
+
messages: xr(l),
|
|
375
370
|
chatId: null,
|
|
376
371
|
// Thread ID will be set by runtime if needed
|
|
377
372
|
systemPrompt: n,
|
|
378
373
|
ephemeral: i,
|
|
379
374
|
stream: !0
|
|
380
375
|
};
|
|
381
|
-
t && t.trim() !== "" && (
|
|
382
|
-
const
|
|
383
|
-
let
|
|
384
|
-
for await (const
|
|
385
|
-
if (
|
|
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)
|
|
386
381
|
throw new Error("Request aborted");
|
|
387
|
-
const
|
|
388
|
-
|
|
389
|
-
const
|
|
390
|
-
if (
|
|
391
|
-
const
|
|
392
|
-
|
|
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;
|
|
393
388
|
}
|
|
394
|
-
if (
|
|
395
|
-
|
|
396
|
-
content: [{ type: "text", text:
|
|
389
|
+
if (k.message && (g += k.message.content || ""), k.tool_calls, k.finished) {
|
|
390
|
+
g && (yield {
|
|
391
|
+
content: [{ type: "text", text: g }]
|
|
397
392
|
});
|
|
398
393
|
break;
|
|
399
394
|
}
|
|
400
|
-
|
|
401
|
-
content: [{ type: "text", text:
|
|
395
|
+
g && (yield {
|
|
396
|
+
content: [{ type: "text", text: g }]
|
|
402
397
|
});
|
|
403
398
|
}
|
|
404
|
-
|
|
405
|
-
content: [{ type: "text", text:
|
|
399
|
+
g && (yield {
|
|
400
|
+
content: [{ type: "text", text: g }]
|
|
406
401
|
});
|
|
407
402
|
}
|
|
408
403
|
};
|
|
409
404
|
}
|
|
410
|
-
const
|
|
411
|
-
function
|
|
405
|
+
const Ue = /* @__PURE__ */ new Map();
|
|
406
|
+
function yr(e, r) {
|
|
412
407
|
return {
|
|
413
408
|
async list() {
|
|
414
409
|
const t = [];
|
|
@@ -429,7 +424,7 @@ function xr(e, r) {
|
|
|
429
424
|
}).filter((u) => u !== null) };
|
|
430
425
|
},
|
|
431
426
|
async initialize(t) {
|
|
432
|
-
return { remoteId:
|
|
427
|
+
return { remoteId: Ue.get(t) || t, externalId: void 0 };
|
|
433
428
|
},
|
|
434
429
|
async rename(t, n) {
|
|
435
430
|
await e.updateChat(t, { title: n });
|
|
@@ -465,65 +460,66 @@ function xr(e, r) {
|
|
|
465
460
|
},
|
|
466
461
|
// Add a method to update the remoteId mapping when chat ID is received
|
|
467
462
|
updateRemoteId(t, n) {
|
|
468
|
-
|
|
463
|
+
Ue.set(t, n), r?.(t, n);
|
|
469
464
|
}
|
|
470
465
|
};
|
|
471
466
|
}
|
|
472
|
-
function
|
|
467
|
+
function Cr({
|
|
473
468
|
children: e,
|
|
474
469
|
baseUrl: r,
|
|
475
470
|
sessionToken: t,
|
|
476
471
|
isProxyMode: n = !1,
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
472
|
+
mode: i = "multiChat",
|
|
473
|
+
modelId: o,
|
|
474
|
+
onModelChange: a,
|
|
475
|
+
ephemeral: u = !1,
|
|
476
|
+
systemPrompt: l,
|
|
477
|
+
initialThreadId: s,
|
|
478
|
+
onError: f,
|
|
479
|
+
onChatCreated: c,
|
|
480
|
+
onUserMessage: p,
|
|
486
481
|
onThreadIdUpdate: g,
|
|
487
|
-
onChatsLoaded:
|
|
482
|
+
onChatsLoaded: h
|
|
488
483
|
}) {
|
|
489
|
-
const k =
|
|
490
|
-
() => new
|
|
491
|
-
[r, t, n
|
|
492
|
-
), [b, x] = N(
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
}, [
|
|
496
|
-
const w =
|
|
497
|
-
(
|
|
498
|
-
|
|
484
|
+
const k = W(
|
|
485
|
+
() => new lt(r, t || void 0, n),
|
|
486
|
+
[r, t, n]
|
|
487
|
+
), [b, x] = N(o || null);
|
|
488
|
+
M(() => {
|
|
489
|
+
o && x(o);
|
|
490
|
+
}, [o]);
|
|
491
|
+
const w = te(
|
|
492
|
+
(C) => {
|
|
493
|
+
c?.(C);
|
|
499
494
|
},
|
|
500
|
-
[
|
|
501
|
-
), y =
|
|
502
|
-
(
|
|
503
|
-
g?.(
|
|
495
|
+
[c]
|
|
496
|
+
), y = te(
|
|
497
|
+
(C, L) => {
|
|
498
|
+
g?.(C, L);
|
|
504
499
|
},
|
|
505
500
|
[g]
|
|
506
|
-
),
|
|
501
|
+
), A = W(() => wr(k, {
|
|
507
502
|
modelId: b || void 0,
|
|
508
503
|
// Pass undefined if not set (backend resolves it)
|
|
509
|
-
systemPrompt:
|
|
510
|
-
ephemeral:
|
|
511
|
-
onChatCreated: w
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
504
|
+
systemPrompt: l,
|
|
505
|
+
ephemeral: u,
|
|
506
|
+
onChatCreated: w,
|
|
507
|
+
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,
|
|
515
511
|
{
|
|
516
512
|
client: k,
|
|
517
|
-
modelAdapter:
|
|
518
|
-
initialThreadId:
|
|
519
|
-
onChatsLoaded:
|
|
513
|
+
modelAdapter: A,
|
|
514
|
+
initialThreadId: s,
|
|
515
|
+
onChatsLoaded: h,
|
|
520
516
|
onThreadIdUpdate: y,
|
|
521
|
-
onError:
|
|
517
|
+
onError: f,
|
|
522
518
|
children: e
|
|
523
519
|
}
|
|
524
520
|
);
|
|
525
521
|
}
|
|
526
|
-
function
|
|
522
|
+
function vr({
|
|
527
523
|
client: e,
|
|
528
524
|
modelAdapter: r,
|
|
529
525
|
initialThreadId: t,
|
|
@@ -532,27 +528,27 @@ function yr({
|
|
|
532
528
|
onError: o,
|
|
533
529
|
children: a
|
|
534
530
|
}) {
|
|
535
|
-
const u =
|
|
531
|
+
const u = W(() => yr(e, (c, p) => {
|
|
536
532
|
i?.(c, p);
|
|
537
|
-
}), [e, i]), l =
|
|
533
|
+
}), [e, i]), l = W(() => ({
|
|
538
534
|
...u,
|
|
539
535
|
async list() {
|
|
540
536
|
const c = await u.list();
|
|
541
537
|
return n?.(), c;
|
|
542
538
|
}
|
|
543
539
|
}), [u, n]);
|
|
544
|
-
|
|
540
|
+
M(() => {
|
|
545
541
|
window.__cuadraThreadListAdapter = l, window.__cuadraThreadListRuntime = null;
|
|
546
542
|
}, [l]);
|
|
547
|
-
const s =
|
|
543
|
+
const s = te(() => nt(r), [r]), f = Bt({
|
|
548
544
|
adapter: l,
|
|
549
545
|
runtimeHook: s
|
|
550
546
|
});
|
|
551
|
-
return
|
|
547
|
+
return M(() => {
|
|
552
548
|
window.__cuadraThreadListRuntime = f;
|
|
553
|
-
}, [f]), /* @__PURE__ */
|
|
549
|
+
}, [f]), /* @__PURE__ */ d(at, { runtime: f, children: a });
|
|
554
550
|
}
|
|
555
|
-
function
|
|
551
|
+
function Be(e, r) {
|
|
556
552
|
const t = String(e);
|
|
557
553
|
if (typeof r != "string")
|
|
558
554
|
throw new TypeError("Expected character");
|
|
@@ -561,36 +557,36 @@ function Oe(e, r) {
|
|
|
561
557
|
n++, i = t.indexOf(r, i + r.length);
|
|
562
558
|
return n;
|
|
563
559
|
}
|
|
564
|
-
const
|
|
565
|
-
function
|
|
560
|
+
const re = me(/[A-Za-z]/), Me = me(/[\dA-Za-z]/);
|
|
561
|
+
function Tr(e) {
|
|
566
562
|
return (
|
|
567
563
|
// Special whitespace codes (which have negative values), C0 and Control
|
|
568
564
|
// character DEL
|
|
569
565
|
e !== null && (e < 32 || e === 127)
|
|
570
566
|
);
|
|
571
567
|
}
|
|
572
|
-
function
|
|
568
|
+
function Z(e) {
|
|
573
569
|
return e !== null && e < -2;
|
|
574
570
|
}
|
|
575
|
-
function
|
|
571
|
+
function D(e) {
|
|
576
572
|
return e !== null && (e < 0 || e === 32);
|
|
577
573
|
}
|
|
578
|
-
function
|
|
574
|
+
function F(e) {
|
|
579
575
|
return e === -2 || e === -1 || e === 32;
|
|
580
576
|
}
|
|
581
|
-
const
|
|
582
|
-
function
|
|
577
|
+
const he = me(/\p{P}|\p{S}/u), H = me(/\s/);
|
|
578
|
+
function me(e) {
|
|
583
579
|
return r;
|
|
584
580
|
function r(t) {
|
|
585
581
|
return t !== null && t > -1 && e.test(String.fromCharCode(t));
|
|
586
582
|
}
|
|
587
583
|
}
|
|
588
|
-
function
|
|
584
|
+
function Ar(e) {
|
|
589
585
|
if (typeof e != "string")
|
|
590
586
|
throw new TypeError("Expected a string");
|
|
591
587
|
return e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
592
588
|
}
|
|
593
|
-
const
|
|
589
|
+
const pe = (
|
|
594
590
|
// Note: overloads in JSDoc can’t yet use different `@template`s.
|
|
595
591
|
/**
|
|
596
592
|
* @type {(
|
|
@@ -607,29 +603,29 @@ const me = (
|
|
|
607
603
|
*/
|
|
608
604
|
(function(e) {
|
|
609
605
|
if (e == null)
|
|
610
|
-
return
|
|
606
|
+
return Lr;
|
|
611
607
|
if (typeof e == "function")
|
|
612
|
-
return
|
|
608
|
+
return ge(e);
|
|
613
609
|
if (typeof e == "object")
|
|
614
|
-
return Array.isArray(e) ?
|
|
610
|
+
return Array.isArray(e) ? Ir(e) : (
|
|
615
611
|
// Cast because `ReadonlyArray` goes into the above but `isArray`
|
|
616
612
|
// narrows to `Array`.
|
|
617
|
-
|
|
613
|
+
Nr(
|
|
618
614
|
/** @type {Props} */
|
|
619
615
|
e
|
|
620
616
|
)
|
|
621
617
|
);
|
|
622
618
|
if (typeof e == "string")
|
|
623
|
-
return
|
|
619
|
+
return Sr(e);
|
|
624
620
|
throw new Error("Expected function, string, or object as test");
|
|
625
621
|
})
|
|
626
622
|
);
|
|
627
|
-
function
|
|
623
|
+
function Ir(e) {
|
|
628
624
|
const r = [];
|
|
629
625
|
let t = -1;
|
|
630
626
|
for (; ++t < e.length; )
|
|
631
|
-
r[t] =
|
|
632
|
-
return
|
|
627
|
+
r[t] = pe(e[t]);
|
|
628
|
+
return ge(n);
|
|
633
629
|
function n(...i) {
|
|
634
630
|
let o = -1;
|
|
635
631
|
for (; ++o < r.length; )
|
|
@@ -637,12 +633,12 @@ function Tr(e) {
|
|
|
637
633
|
return !1;
|
|
638
634
|
}
|
|
639
635
|
}
|
|
640
|
-
function
|
|
636
|
+
function Nr(e) {
|
|
641
637
|
const r = (
|
|
642
638
|
/** @type {Record<string, unknown>} */
|
|
643
639
|
e
|
|
644
640
|
);
|
|
645
|
-
return
|
|
641
|
+
return ge(t);
|
|
646
642
|
function t(n) {
|
|
647
643
|
const i = (
|
|
648
644
|
/** @type {Record<string, unknown>} */
|
|
@@ -655,16 +651,16 @@ function Ir(e) {
|
|
|
655
651
|
return !0;
|
|
656
652
|
}
|
|
657
653
|
}
|
|
658
|
-
function
|
|
659
|
-
return
|
|
654
|
+
function Sr(e) {
|
|
655
|
+
return ge(r);
|
|
660
656
|
function r(t) {
|
|
661
657
|
return t && t.type === e;
|
|
662
658
|
}
|
|
663
659
|
}
|
|
664
|
-
function
|
|
660
|
+
function ge(e) {
|
|
665
661
|
return r;
|
|
666
662
|
function r(t, n, i) {
|
|
667
|
-
return !!(
|
|
663
|
+
return !!(Mr(t) && e.call(
|
|
668
664
|
this,
|
|
669
665
|
t,
|
|
670
666
|
typeof n == "number" ? n : void 0,
|
|
@@ -672,17 +668,17 @@ function pe(e) {
|
|
|
672
668
|
));
|
|
673
669
|
}
|
|
674
670
|
}
|
|
675
|
-
function
|
|
671
|
+
function Lr() {
|
|
676
672
|
return !0;
|
|
677
673
|
}
|
|
678
|
-
function
|
|
674
|
+
function Mr(e) {
|
|
679
675
|
return e !== null && typeof e == "object" && "type" in e;
|
|
680
676
|
}
|
|
681
|
-
const
|
|
682
|
-
function
|
|
677
|
+
const ut = [], Dr = !0, Se = !1, Pr = "skip";
|
|
678
|
+
function ct(e, r, t, n) {
|
|
683
679
|
let i;
|
|
684
680
|
typeof r == "function" && typeof t != "function" ? (n = t, t = r) : i = r;
|
|
685
|
-
const o =
|
|
681
|
+
const o = pe(i), a = n ? -1 : 1;
|
|
686
682
|
u(e, void 0, [])();
|
|
687
683
|
function u(l, s, f) {
|
|
688
684
|
const c = (
|
|
@@ -703,41 +699,41 @@ function lt(e, r, t, n) {
|
|
|
703
699
|
}
|
|
704
700
|
return p;
|
|
705
701
|
function p() {
|
|
706
|
-
let g =
|
|
707
|
-
if ((!r || o(l, s, f[f.length - 1] || void 0)) && (g =
|
|
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))
|
|
708
704
|
return g;
|
|
709
705
|
if ("children" in l && l.children) {
|
|
710
706
|
const x = (
|
|
711
707
|
/** @type {UnistParent} */
|
|
712
708
|
l
|
|
713
709
|
);
|
|
714
|
-
if (x.children && g[0] !==
|
|
710
|
+
if (x.children && g[0] !== Pr)
|
|
715
711
|
for (k = (n ? x.children.length : -1) + a, b = f.concat(x); k > -1 && k < x.children.length; ) {
|
|
716
712
|
const w = x.children[k];
|
|
717
|
-
if (
|
|
718
|
-
return
|
|
719
|
-
k = typeof
|
|
713
|
+
if (h = u(w, k, b)(), h[0] === Se)
|
|
714
|
+
return h;
|
|
715
|
+
k = typeof h[1] == "number" ? h[1] : k + a;
|
|
720
716
|
}
|
|
721
717
|
}
|
|
722
718
|
return g;
|
|
723
719
|
}
|
|
724
720
|
}
|
|
725
721
|
}
|
|
726
|
-
function
|
|
727
|
-
return Array.isArray(e) ? e : typeof e == "number" ? [
|
|
722
|
+
function Rr(e) {
|
|
723
|
+
return Array.isArray(e) ? e : typeof e == "number" ? [Dr, e] : e == null ? ut : [e];
|
|
728
724
|
}
|
|
729
|
-
function
|
|
730
|
-
const i =
|
|
725
|
+
function Er(e, r, t) {
|
|
726
|
+
const i = pe((t || {}).ignore || []), o = _r(r);
|
|
731
727
|
let a = -1;
|
|
732
728
|
for (; ++a < o.length; )
|
|
733
|
-
|
|
729
|
+
ct(e, "text", u);
|
|
734
730
|
function u(s, f) {
|
|
735
731
|
let c = -1, p;
|
|
736
732
|
for (; ++c < f.length; ) {
|
|
737
|
-
const g = f[c],
|
|
733
|
+
const g = f[c], h = p ? p.children : void 0;
|
|
738
734
|
if (i(
|
|
739
735
|
g,
|
|
740
|
-
|
|
736
|
+
h ? h.indexOf(g) : void 0,
|
|
741
737
|
p
|
|
742
738
|
))
|
|
743
739
|
return;
|
|
@@ -748,29 +744,29 @@ function Pr(e, r, t) {
|
|
|
748
744
|
}
|
|
749
745
|
function l(s, f) {
|
|
750
746
|
const c = f[f.length - 1], p = o[a][0], g = o[a][1];
|
|
751
|
-
let
|
|
747
|
+
let h = 0;
|
|
752
748
|
const b = c.children.indexOf(s);
|
|
753
749
|
let x = !1, w = [];
|
|
754
750
|
p.lastIndex = 0;
|
|
755
751
|
let y = p.exec(s.value);
|
|
756
752
|
for (; y; ) {
|
|
757
|
-
const
|
|
753
|
+
const A = y.index, T = {
|
|
758
754
|
index: y.index,
|
|
759
755
|
input: y.input,
|
|
760
756
|
stack: [...f, s]
|
|
761
757
|
};
|
|
762
|
-
let
|
|
763
|
-
if (typeof
|
|
758
|
+
let C = g(...y, T);
|
|
759
|
+
if (typeof C == "string" && (C = C.length > 0 ? { type: "text", value: C } : void 0), C === !1 ? p.lastIndex = A + 1 : (h !== A && w.push({
|
|
764
760
|
type: "text",
|
|
765
|
-
value: s.value.slice(
|
|
766
|
-
}), Array.isArray(
|
|
761
|
+
value: s.value.slice(h, A)
|
|
762
|
+
}), Array.isArray(C) ? w.push(...C) : C && w.push(C), h = A + y[0].length, x = !0), !p.global)
|
|
767
763
|
break;
|
|
768
764
|
y = p.exec(s.value);
|
|
769
765
|
}
|
|
770
|
-
return x ? (
|
|
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;
|
|
771
767
|
}
|
|
772
768
|
}
|
|
773
|
-
function
|
|
769
|
+
function _r(e) {
|
|
774
770
|
const r = [];
|
|
775
771
|
if (!Array.isArray(e))
|
|
776
772
|
throw new TypeError("Expected find and replace tuple or list of tuples");
|
|
@@ -778,98 +774,98 @@ function Rr(e) {
|
|
|
778
774
|
let n = -1;
|
|
779
775
|
for (; ++n < t.length; ) {
|
|
780
776
|
const i = t[n];
|
|
781
|
-
r.push([
|
|
777
|
+
r.push([Fr(i[0]), zr(i[1])]);
|
|
782
778
|
}
|
|
783
779
|
return r;
|
|
784
780
|
}
|
|
785
|
-
function
|
|
786
|
-
return typeof e == "string" ? new RegExp(
|
|
781
|
+
function Fr(e) {
|
|
782
|
+
return typeof e == "string" ? new RegExp(Ar(e), "g") : e;
|
|
787
783
|
}
|
|
788
|
-
function
|
|
784
|
+
function zr(e) {
|
|
789
785
|
return typeof e == "function" ? e : function() {
|
|
790
786
|
return e;
|
|
791
787
|
};
|
|
792
788
|
}
|
|
793
|
-
const
|
|
794
|
-
function
|
|
789
|
+
const ye = "phrasing", Ce = ["autolink", "link", "image", "label"];
|
|
790
|
+
function jr() {
|
|
795
791
|
return {
|
|
796
|
-
transforms: [
|
|
792
|
+
transforms: [qr],
|
|
797
793
|
enter: {
|
|
798
|
-
literalAutolink:
|
|
799
|
-
literalAutolinkEmail:
|
|
800
|
-
literalAutolinkHttp:
|
|
801
|
-
literalAutolinkWww:
|
|
794
|
+
literalAutolink: Or,
|
|
795
|
+
literalAutolinkEmail: ve,
|
|
796
|
+
literalAutolinkHttp: ve,
|
|
797
|
+
literalAutolinkWww: ve
|
|
802
798
|
},
|
|
803
799
|
exit: {
|
|
804
|
-
literalAutolink:
|
|
805
|
-
literalAutolinkEmail:
|
|
806
|
-
literalAutolinkHttp:
|
|
807
|
-
literalAutolinkWww:
|
|
800
|
+
literalAutolink: Hr,
|
|
801
|
+
literalAutolinkEmail: Wr,
|
|
802
|
+
literalAutolinkHttp: Ur,
|
|
803
|
+
literalAutolinkWww: Br
|
|
808
804
|
}
|
|
809
805
|
};
|
|
810
806
|
}
|
|
811
|
-
function
|
|
807
|
+
function $r() {
|
|
812
808
|
return {
|
|
813
809
|
unsafe: [
|
|
814
810
|
{
|
|
815
811
|
character: "@",
|
|
816
812
|
before: "[+\\-.\\w]",
|
|
817
813
|
after: "[\\-.\\w]",
|
|
818
|
-
inConstruct:
|
|
819
|
-
notInConstruct:
|
|
814
|
+
inConstruct: ye,
|
|
815
|
+
notInConstruct: Ce
|
|
820
816
|
},
|
|
821
817
|
{
|
|
822
818
|
character: ".",
|
|
823
819
|
before: "[Ww]",
|
|
824
820
|
after: "[\\-.\\w]",
|
|
825
|
-
inConstruct:
|
|
826
|
-
notInConstruct:
|
|
821
|
+
inConstruct: ye,
|
|
822
|
+
notInConstruct: Ce
|
|
827
823
|
},
|
|
828
824
|
{
|
|
829
825
|
character: ":",
|
|
830
826
|
before: "[ps]",
|
|
831
827
|
after: "\\/",
|
|
832
|
-
inConstruct:
|
|
833
|
-
notInConstruct:
|
|
828
|
+
inConstruct: ye,
|
|
829
|
+
notInConstruct: Ce
|
|
834
830
|
}
|
|
835
831
|
]
|
|
836
832
|
};
|
|
837
833
|
}
|
|
838
|
-
function
|
|
834
|
+
function Or(e) {
|
|
839
835
|
this.enter({ type: "link", title: null, url: "", children: [] }, e);
|
|
840
836
|
}
|
|
841
|
-
function
|
|
837
|
+
function ve(e) {
|
|
842
838
|
this.config.enter.autolinkProtocol.call(this, e);
|
|
843
839
|
}
|
|
844
|
-
function
|
|
840
|
+
function Ur(e) {
|
|
845
841
|
this.config.exit.autolinkProtocol.call(this, e);
|
|
846
842
|
}
|
|
847
|
-
function
|
|
843
|
+
function Br(e) {
|
|
848
844
|
this.config.exit.data.call(this, e);
|
|
849
845
|
const r = this.stack[this.stack.length - 1];
|
|
850
846
|
r.type, r.url = "http://" + this.sliceSerialize(e);
|
|
851
847
|
}
|
|
852
|
-
function
|
|
848
|
+
function Wr(e) {
|
|
853
849
|
this.config.exit.autolinkEmail.call(this, e);
|
|
854
850
|
}
|
|
855
|
-
function
|
|
851
|
+
function Hr(e) {
|
|
856
852
|
this.exit(e);
|
|
857
853
|
}
|
|
858
|
-
function
|
|
859
|
-
|
|
854
|
+
function qr(e) {
|
|
855
|
+
Er(
|
|
860
856
|
e,
|
|
861
857
|
[
|
|
862
|
-
[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,
|
|
863
|
-
[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,
|
|
858
|
+
[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi, Kr],
|
|
859
|
+
[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu, Vr]
|
|
864
860
|
],
|
|
865
861
|
{ ignore: ["link", "linkReference"] }
|
|
866
862
|
);
|
|
867
863
|
}
|
|
868
|
-
function
|
|
864
|
+
function Kr(e, r, t, n, i) {
|
|
869
865
|
let o = "";
|
|
870
|
-
if (!
|
|
866
|
+
if (!st(i) || (/^w/i.test(r) && (t = r + t, r = "", o = "http://"), !Gr(t)))
|
|
871
867
|
return !1;
|
|
872
|
-
const a =
|
|
868
|
+
const a = Zr(t + n);
|
|
873
869
|
if (!a[0]) return !1;
|
|
874
870
|
const u = {
|
|
875
871
|
type: "link",
|
|
@@ -879,10 +875,10 @@ function Hr(e, r, t, n, i) {
|
|
|
879
875
|
};
|
|
880
876
|
return a[1] ? [u, { type: "text", value: a[1] }] : u;
|
|
881
877
|
}
|
|
882
|
-
function
|
|
878
|
+
function Vr(e, r, t, n) {
|
|
883
879
|
return (
|
|
884
880
|
// Not an expected previous character.
|
|
885
|
-
!
|
|
881
|
+
!st(n, !0) || // Label ends in not allowed character.
|
|
886
882
|
/[-\d_]$/.test(t) ? !1 : {
|
|
887
883
|
type: "link",
|
|
888
884
|
title: null,
|
|
@@ -891,68 +887,68 @@ function qr(e, r, t, n) {
|
|
|
891
887
|
}
|
|
892
888
|
);
|
|
893
889
|
}
|
|
894
|
-
function
|
|
890
|
+
function Gr(e) {
|
|
895
891
|
const r = e.split(".");
|
|
896
892
|
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])));
|
|
897
893
|
}
|
|
898
|
-
function
|
|
894
|
+
function Zr(e) {
|
|
899
895
|
const r = /[!"&'),.:;<>?\]}]+$/.exec(e);
|
|
900
896
|
if (!r)
|
|
901
897
|
return [e, void 0];
|
|
902
898
|
e = e.slice(0, r.index);
|
|
903
899
|
let t = r[0], n = t.indexOf(")");
|
|
904
|
-
const i =
|
|
905
|
-
let o =
|
|
900
|
+
const i = Be(e, "(");
|
|
901
|
+
let o = Be(e, ")");
|
|
906
902
|
for (; n !== -1 && i > o; )
|
|
907
903
|
e += t.slice(0, n + 1), t = t.slice(n + 1), n = t.indexOf(")"), o++;
|
|
908
904
|
return [e, t];
|
|
909
905
|
}
|
|
910
|
-
function
|
|
906
|
+
function st(e, r) {
|
|
911
907
|
const t = e.input.charCodeAt(e.index - 1);
|
|
912
|
-
return (e.index === 0 ||
|
|
908
|
+
return (e.index === 0 || H(t) || he(t)) && // If it’s an email, the previous character should not be a slash.
|
|
913
909
|
(!r || t !== 47);
|
|
914
910
|
}
|
|
915
|
-
function
|
|
911
|
+
function ae(e) {
|
|
916
912
|
return e.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
|
|
917
913
|
}
|
|
918
|
-
|
|
919
|
-
function
|
|
914
|
+
dt.peek = an;
|
|
915
|
+
function Jr() {
|
|
920
916
|
this.buffer();
|
|
921
917
|
}
|
|
922
|
-
function
|
|
918
|
+
function Qr(e) {
|
|
923
919
|
this.enter({ type: "footnoteReference", identifier: "", label: "" }, e);
|
|
924
920
|
}
|
|
925
|
-
function
|
|
921
|
+
function Xr() {
|
|
926
922
|
this.buffer();
|
|
927
923
|
}
|
|
928
|
-
function
|
|
924
|
+
function Yr(e) {
|
|
929
925
|
this.enter(
|
|
930
926
|
{ type: "footnoteDefinition", identifier: "", label: "", children: [] },
|
|
931
927
|
e
|
|
932
928
|
);
|
|
933
929
|
}
|
|
934
|
-
function
|
|
930
|
+
function en(e) {
|
|
935
931
|
const r = this.resume(), t = this.stack[this.stack.length - 1];
|
|
936
|
-
t.type, t.identifier =
|
|
932
|
+
t.type, t.identifier = ae(
|
|
937
933
|
this.sliceSerialize(e)
|
|
938
934
|
).toLowerCase(), t.label = r;
|
|
939
935
|
}
|
|
940
|
-
function
|
|
936
|
+
function tn(e) {
|
|
941
937
|
this.exit(e);
|
|
942
938
|
}
|
|
943
|
-
function
|
|
939
|
+
function rn(e) {
|
|
944
940
|
const r = this.resume(), t = this.stack[this.stack.length - 1];
|
|
945
|
-
t.type, t.identifier =
|
|
941
|
+
t.type, t.identifier = ae(
|
|
946
942
|
this.sliceSerialize(e)
|
|
947
943
|
).toLowerCase(), t.label = r;
|
|
948
944
|
}
|
|
949
|
-
function
|
|
945
|
+
function nn(e) {
|
|
950
946
|
this.exit(e);
|
|
951
947
|
}
|
|
952
|
-
function
|
|
948
|
+
function an() {
|
|
953
949
|
return "[";
|
|
954
950
|
}
|
|
955
|
-
function
|
|
951
|
+
function dt(e, r, t, n) {
|
|
956
952
|
const i = t.createTracker(n);
|
|
957
953
|
let o = i.move("[^");
|
|
958
954
|
const a = t.enter("footnoteReference"), u = t.enter("reference");
|
|
@@ -960,26 +956,26 @@ function ct(e, r, t, n) {
|
|
|
960
956
|
t.safe(t.associationId(e), { after: "]", before: o })
|
|
961
957
|
), u(), a(), o += i.move("]"), o;
|
|
962
958
|
}
|
|
963
|
-
function
|
|
959
|
+
function on() {
|
|
964
960
|
return {
|
|
965
961
|
enter: {
|
|
966
|
-
gfmFootnoteCallString:
|
|
967
|
-
gfmFootnoteCall:
|
|
968
|
-
gfmFootnoteDefinitionLabelString:
|
|
969
|
-
gfmFootnoteDefinition:
|
|
962
|
+
gfmFootnoteCallString: Jr,
|
|
963
|
+
gfmFootnoteCall: Qr,
|
|
964
|
+
gfmFootnoteDefinitionLabelString: Xr,
|
|
965
|
+
gfmFootnoteDefinition: Yr
|
|
970
966
|
},
|
|
971
967
|
exit: {
|
|
972
|
-
gfmFootnoteCallString:
|
|
973
|
-
gfmFootnoteCall:
|
|
974
|
-
gfmFootnoteDefinitionLabelString:
|
|
975
|
-
gfmFootnoteDefinition:
|
|
968
|
+
gfmFootnoteCallString: en,
|
|
969
|
+
gfmFootnoteCall: tn,
|
|
970
|
+
gfmFootnoteDefinitionLabelString: rn,
|
|
971
|
+
gfmFootnoteDefinition: nn
|
|
976
972
|
}
|
|
977
973
|
};
|
|
978
974
|
}
|
|
979
|
-
function
|
|
975
|
+
function ln(e) {
|
|
980
976
|
let r = !1;
|
|
981
977
|
return e && e.firstLineBlank && (r = !0), {
|
|
982
|
-
handlers: { footnoteDefinition: t, footnoteReference:
|
|
978
|
+
handlers: { footnoteDefinition: t, footnoteReference: dt },
|
|
983
979
|
// This is on by default already.
|
|
984
980
|
unsafe: [{ character: "[", inConstruct: ["label", "phrasing", "reference"] }]
|
|
985
981
|
};
|
|
@@ -993,18 +989,18 @@ function an(e) {
|
|
|
993
989
|
(r ? `
|
|
994
990
|
` : " ") + o.indentLines(
|
|
995
991
|
o.containerFlow(n, u.current()),
|
|
996
|
-
r ?
|
|
992
|
+
r ? ft : un
|
|
997
993
|
)
|
|
998
994
|
)), s(), l;
|
|
999
995
|
}
|
|
1000
996
|
}
|
|
1001
|
-
function
|
|
1002
|
-
return r === 0 ? e :
|
|
997
|
+
function un(e, r, t) {
|
|
998
|
+
return r === 0 ? e : ft(e, r, t);
|
|
1003
999
|
}
|
|
1004
|
-
function
|
|
1000
|
+
function ft(e, r, t) {
|
|
1005
1001
|
return (t ? "" : " ") + e;
|
|
1006
1002
|
}
|
|
1007
|
-
const
|
|
1003
|
+
const cn = [
|
|
1008
1004
|
"autolink",
|
|
1009
1005
|
"destinationLiteral",
|
|
1010
1006
|
"destinationRaw",
|
|
@@ -1012,33 +1008,33 @@ const ln = [
|
|
|
1012
1008
|
"titleQuote",
|
|
1013
1009
|
"titleApostrophe"
|
|
1014
1010
|
];
|
|
1015
|
-
|
|
1016
|
-
function
|
|
1011
|
+
ht.peek = mn;
|
|
1012
|
+
function sn() {
|
|
1017
1013
|
return {
|
|
1018
1014
|
canContainEols: ["delete"],
|
|
1019
|
-
enter: { strikethrough:
|
|
1020
|
-
exit: { strikethrough:
|
|
1015
|
+
enter: { strikethrough: fn },
|
|
1016
|
+
exit: { strikethrough: hn }
|
|
1021
1017
|
};
|
|
1022
1018
|
}
|
|
1023
|
-
function
|
|
1019
|
+
function dn() {
|
|
1024
1020
|
return {
|
|
1025
1021
|
unsafe: [
|
|
1026
1022
|
{
|
|
1027
1023
|
character: "~",
|
|
1028
1024
|
inConstruct: "phrasing",
|
|
1029
|
-
notInConstruct:
|
|
1025
|
+
notInConstruct: cn
|
|
1030
1026
|
}
|
|
1031
1027
|
],
|
|
1032
|
-
handlers: { delete:
|
|
1028
|
+
handlers: { delete: ht }
|
|
1033
1029
|
};
|
|
1034
1030
|
}
|
|
1035
|
-
function
|
|
1031
|
+
function fn(e) {
|
|
1036
1032
|
this.enter({ type: "delete", children: [] }, e);
|
|
1037
1033
|
}
|
|
1038
|
-
function
|
|
1034
|
+
function hn(e) {
|
|
1039
1035
|
this.exit(e);
|
|
1040
1036
|
}
|
|
1041
|
-
function
|
|
1037
|
+
function ht(e, r, t, n) {
|
|
1042
1038
|
const i = t.createTracker(n), o = t.enter("strikethrough");
|
|
1043
1039
|
let a = i.move("~~");
|
|
1044
1040
|
return a += t.containerPhrasing(e, {
|
|
@@ -1047,20 +1043,20 @@ function dt(e, r, t, n) {
|
|
|
1047
1043
|
after: "~"
|
|
1048
1044
|
}), a += i.move("~~"), o(), a;
|
|
1049
1045
|
}
|
|
1050
|
-
function
|
|
1046
|
+
function mn() {
|
|
1051
1047
|
return "~";
|
|
1052
1048
|
}
|
|
1053
|
-
function
|
|
1049
|
+
function pn(e) {
|
|
1054
1050
|
return e.length;
|
|
1055
1051
|
}
|
|
1056
|
-
function
|
|
1057
|
-
const t = r || {}, n = (t.align || []).concat(), i = t.stringLength ||
|
|
1052
|
+
function gn(e, r) {
|
|
1053
|
+
const t = r || {}, n = (t.align || []).concat(), i = t.stringLength || pn, o = [], a = [], u = [], l = [];
|
|
1058
1054
|
let s = 0, f = -1;
|
|
1059
1055
|
for (; ++f < e.length; ) {
|
|
1060
1056
|
const k = [], b = [];
|
|
1061
1057
|
let x = -1;
|
|
1062
1058
|
for (e[f].length > s && (s = e[f].length); ++x < e[f].length; ) {
|
|
1063
|
-
const w =
|
|
1059
|
+
const w = bn(e[f][x]);
|
|
1064
1060
|
if (t.alignDelimiters !== !1) {
|
|
1065
1061
|
const y = i(w);
|
|
1066
1062
|
b[x] = y, (l[x] === void 0 || y > l[x]) && (l[x] = y);
|
|
@@ -1072,9 +1068,9 @@ function mn(e, r) {
|
|
|
1072
1068
|
let c = -1;
|
|
1073
1069
|
if (typeof n == "object" && "length" in n)
|
|
1074
1070
|
for (; ++c < s; )
|
|
1075
|
-
o[c] =
|
|
1071
|
+
o[c] = We(n[c]);
|
|
1076
1072
|
else {
|
|
1077
|
-
const k =
|
|
1073
|
+
const k = We(n);
|
|
1078
1074
|
for (; ++c < s; )
|
|
1079
1075
|
o[c] = k;
|
|
1080
1076
|
}
|
|
@@ -1092,52 +1088,52 @@ function mn(e, r) {
|
|
|
1092
1088
|
t.alignDelimiters !== !1 && (w = b.length + w + x.length, w > l[c] && (l[c] = w), g[c] = w), p[c] = y;
|
|
1093
1089
|
}
|
|
1094
1090
|
a.splice(1, 0, p), u.splice(1, 0, g), f = -1;
|
|
1095
|
-
const
|
|
1091
|
+
const h = [];
|
|
1096
1092
|
for (; ++f < a.length; ) {
|
|
1097
1093
|
const k = a[f], b = u[f];
|
|
1098
1094
|
c = -1;
|
|
1099
1095
|
const x = [];
|
|
1100
1096
|
for (; ++c < s; ) {
|
|
1101
1097
|
const w = k[c] || "";
|
|
1102
|
-
let y = "",
|
|
1098
|
+
let y = "", A = "";
|
|
1103
1099
|
if (t.alignDelimiters !== !1) {
|
|
1104
|
-
const
|
|
1105
|
-
|
|
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);
|
|
1106
1102
|
}
|
|
1107
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
|
|
1108
1104
|
// empty: there will be a closing space.
|
|
1109
|
-
!(t.alignDelimiters === !1 && w === "") && (t.delimiterStart !== !1 || c) && x.push(" "), t.alignDelimiters !== !1 && x.push(y), x.push(w), t.alignDelimiters !== !1 && x.push(
|
|
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("|");
|
|
1110
1106
|
}
|
|
1111
|
-
|
|
1107
|
+
h.push(
|
|
1112
1108
|
t.delimiterEnd === !1 ? x.join("").replace(/ +$/, "") : x.join("")
|
|
1113
1109
|
);
|
|
1114
1110
|
}
|
|
1115
|
-
return
|
|
1111
|
+
return h.join(`
|
|
1116
1112
|
`);
|
|
1117
1113
|
}
|
|
1118
|
-
function
|
|
1114
|
+
function bn(e) {
|
|
1119
1115
|
return e == null ? "" : String(e);
|
|
1120
1116
|
}
|
|
1121
|
-
function
|
|
1117
|
+
function We(e) {
|
|
1122
1118
|
const r = typeof e == "string" ? e.codePointAt(0) : 0;
|
|
1123
1119
|
return r === 67 || r === 99 ? 99 : r === 76 || r === 108 ? 108 : r === 82 || r === 114 ? 114 : 0;
|
|
1124
1120
|
}
|
|
1125
|
-
function
|
|
1121
|
+
function kn(e, r, t, n) {
|
|
1126
1122
|
const i = t.enter("blockquote"), o = t.createTracker(n);
|
|
1127
1123
|
o.move("> "), o.shift(2);
|
|
1128
1124
|
const a = t.indentLines(
|
|
1129
1125
|
t.containerFlow(e, o.current()),
|
|
1130
|
-
|
|
1126
|
+
xn
|
|
1131
1127
|
);
|
|
1132
1128
|
return i(), a;
|
|
1133
1129
|
}
|
|
1134
|
-
function
|
|
1130
|
+
function xn(e, r, t) {
|
|
1135
1131
|
return ">" + (t ? "" : " ") + e;
|
|
1136
1132
|
}
|
|
1137
|
-
function
|
|
1138
|
-
return
|
|
1133
|
+
function wn(e, r) {
|
|
1134
|
+
return He(e, r.inConstruct, !0) && !He(e, r.notInConstruct, !1);
|
|
1139
1135
|
}
|
|
1140
|
-
function
|
|
1136
|
+
function He(e, r, t) {
|
|
1141
1137
|
if (typeof r == "string" && (r = [r]), !r || r.length === 0)
|
|
1142
1138
|
return t;
|
|
1143
1139
|
let n = -1;
|
|
@@ -1146,16 +1142,16 @@ function Be(e, r, t) {
|
|
|
1146
1142
|
return !0;
|
|
1147
1143
|
return !1;
|
|
1148
1144
|
}
|
|
1149
|
-
function
|
|
1145
|
+
function qe(e, r, t, n) {
|
|
1150
1146
|
let i = -1;
|
|
1151
1147
|
for (; ++i < t.unsafe.length; )
|
|
1152
1148
|
if (t.unsafe[i].character === `
|
|
1153
|
-
` &&
|
|
1149
|
+
` && wn(t.stack, t.unsafe[i]))
|
|
1154
1150
|
return /[ \t]/.test(n.before) ? "" : " ";
|
|
1155
1151
|
return `\\
|
|
1156
1152
|
`;
|
|
1157
1153
|
}
|
|
1158
|
-
function
|
|
1154
|
+
function yn(e, r) {
|
|
1159
1155
|
const t = String(e);
|
|
1160
1156
|
let n = t.indexOf(r), i = n, o = 0, a = 0;
|
|
1161
1157
|
if (typeof r != "string")
|
|
@@ -1164,13 +1160,13 @@ function xn(e, r) {
|
|
|
1164
1160
|
n === i ? ++o > a && (a = o) : o = 1, i = n + r.length, n = t.indexOf(r, i);
|
|
1165
1161
|
return a;
|
|
1166
1162
|
}
|
|
1167
|
-
function
|
|
1163
|
+
function Cn(e, r) {
|
|
1168
1164
|
return !!(r.options.fences === !1 && e.value && // If there’s no info…
|
|
1169
1165
|
!e.lang && // And there’s a non-whitespace character…
|
|
1170
1166
|
/[^ \r\n]/.test(e.value) && // And the value doesn’t start or end in a blank…
|
|
1171
1167
|
!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value));
|
|
1172
1168
|
}
|
|
1173
|
-
function
|
|
1169
|
+
function vn(e) {
|
|
1174
1170
|
const r = e.options.fence || "`";
|
|
1175
1171
|
if (r !== "`" && r !== "~")
|
|
1176
1172
|
throw new Error(
|
|
@@ -1178,13 +1174,13 @@ function yn(e) {
|
|
|
1178
1174
|
);
|
|
1179
1175
|
return r;
|
|
1180
1176
|
}
|
|
1181
|
-
function
|
|
1182
|
-
const i =
|
|
1183
|
-
if (
|
|
1184
|
-
const c = t.enter("codeIndented"), p = t.indentLines(o,
|
|
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);
|
|
1185
1181
|
return c(), p;
|
|
1186
1182
|
}
|
|
1187
|
-
const u = t.createTracker(n), l = i.repeat(Math.max(
|
|
1183
|
+
const u = t.createTracker(n), l = i.repeat(Math.max(yn(o, i) + 1, 3)), s = t.enter("codeFenced");
|
|
1188
1184
|
let f = u.move(l);
|
|
1189
1185
|
if (e.lang) {
|
|
1190
1186
|
const c = t.enter(`codeFencedLang${a}`);
|
|
@@ -1213,10 +1209,10 @@ function Cn(e, r, t, n) {
|
|
|
1213
1209
|
`), o && (f += u.move(o + `
|
|
1214
1210
|
`)), f += u.move(l), s(), f;
|
|
1215
1211
|
}
|
|
1216
|
-
function
|
|
1212
|
+
function An(e, r, t) {
|
|
1217
1213
|
return (t ? "" : " ") + e;
|
|
1218
1214
|
}
|
|
1219
|
-
function
|
|
1215
|
+
function De(e) {
|
|
1220
1216
|
const r = e.options.quote || '"';
|
|
1221
1217
|
if (r !== '"' && r !== "'")
|
|
1222
1218
|
throw new Error(
|
|
@@ -1224,8 +1220,8 @@ function Me(e) {
|
|
|
1224
1220
|
);
|
|
1225
1221
|
return r;
|
|
1226
1222
|
}
|
|
1227
|
-
function
|
|
1228
|
-
const i =
|
|
1223
|
+
function In(e, r, t, n) {
|
|
1224
|
+
const i = De(t), o = i === '"' ? "Quote" : "Apostrophe", a = t.enter("definition");
|
|
1229
1225
|
let u = t.enter("label");
|
|
1230
1226
|
const l = t.createTracker(n);
|
|
1231
1227
|
let s = l.move("[");
|
|
@@ -1254,7 +1250,7 @@ function Tn(e, r, t, n) {
|
|
|
1254
1250
|
})
|
|
1255
1251
|
), s += l.move(i), u()), a(), s;
|
|
1256
1252
|
}
|
|
1257
|
-
function
|
|
1253
|
+
function Nn(e) {
|
|
1258
1254
|
const r = e.options.emphasis || "*";
|
|
1259
1255
|
if (r !== "*" && r !== "_")
|
|
1260
1256
|
throw new Error(
|
|
@@ -1262,17 +1258,17 @@ function In(e) {
|
|
|
1262
1258
|
);
|
|
1263
1259
|
return r;
|
|
1264
1260
|
}
|
|
1265
|
-
function
|
|
1261
|
+
function ne(e) {
|
|
1266
1262
|
return "&#x" + e.toString(16).toUpperCase() + ";";
|
|
1267
1263
|
}
|
|
1268
|
-
function
|
|
1269
|
-
if (e === null ||
|
|
1264
|
+
function de(e) {
|
|
1265
|
+
if (e === null || D(e) || H(e))
|
|
1270
1266
|
return 1;
|
|
1271
|
-
if (
|
|
1267
|
+
if (he(e))
|
|
1272
1268
|
return 2;
|
|
1273
1269
|
}
|
|
1274
|
-
function
|
|
1275
|
-
const n =
|
|
1270
|
+
function fe(e, r, t) {
|
|
1271
|
+
const n = de(e), i = de(r);
|
|
1276
1272
|
return n === void 0 ? i === void 0 ? (
|
|
1277
1273
|
// Letter inside:
|
|
1278
1274
|
// we have to encode *both* letters for `_` as it is looser.
|
|
@@ -1304,9 +1300,9 @@ function de(e, r, t) {
|
|
|
1304
1300
|
{ inside: !1, outside: !1 }
|
|
1305
1301
|
);
|
|
1306
1302
|
}
|
|
1307
|
-
|
|
1308
|
-
function
|
|
1309
|
-
const i =
|
|
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);
|
|
1310
1306
|
let l = a.move(
|
|
1311
1307
|
t.containerPhrasing(e, {
|
|
1312
1308
|
after: i,
|
|
@@ -1314,67 +1310,67 @@ function ft(e, r, t, n) {
|
|
|
1314
1310
|
...a.current()
|
|
1315
1311
|
})
|
|
1316
1312
|
);
|
|
1317
|
-
const s = l.charCodeAt(0), f =
|
|
1313
|
+
const s = l.charCodeAt(0), f = fe(
|
|
1318
1314
|
n.before.charCodeAt(n.before.length - 1),
|
|
1319
1315
|
s,
|
|
1320
1316
|
i
|
|
1321
1317
|
);
|
|
1322
|
-
f.inside && (l =
|
|
1323
|
-
const c = l.charCodeAt(l.length - 1), p =
|
|
1324
|
-
p.inside && (l = l.slice(0, -1) +
|
|
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));
|
|
1325
1321
|
const g = a.move(i);
|
|
1326
1322
|
return o(), t.attentionEncodeSurroundingInfo = {
|
|
1327
1323
|
after: p.outside,
|
|
1328
1324
|
before: f.outside
|
|
1329
1325
|
}, u + l + g;
|
|
1330
1326
|
}
|
|
1331
|
-
function
|
|
1327
|
+
function Sn(e, r, t) {
|
|
1332
1328
|
return t.options.emphasis || "*";
|
|
1333
1329
|
}
|
|
1334
|
-
function
|
|
1330
|
+
function Ln(e, r, t, n) {
|
|
1335
1331
|
let i, o, a;
|
|
1336
|
-
typeof r == "function" && typeof t != "function" ? (o = void 0, a = r, i = t) : (o = r, a = t, i = n),
|
|
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);
|
|
1337
1333
|
function u(l, s) {
|
|
1338
1334
|
const f = s[s.length - 1], c = f ? f.children.indexOf(l) : void 0;
|
|
1339
1335
|
return a(l, c, f);
|
|
1340
1336
|
}
|
|
1341
1337
|
}
|
|
1342
|
-
const
|
|
1343
|
-
function
|
|
1344
|
-
const t =
|
|
1345
|
-
return
|
|
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);
|
|
1346
1342
|
}
|
|
1347
|
-
function
|
|
1348
|
-
if (
|
|
1343
|
+
function gt(e, r, t) {
|
|
1344
|
+
if (Dn(e)) {
|
|
1349
1345
|
if ("value" in e)
|
|
1350
1346
|
return e.type === "html" && !t ? "" : e.value;
|
|
1351
1347
|
if (r && "alt" in e && e.alt)
|
|
1352
1348
|
return e.alt;
|
|
1353
1349
|
if ("children" in e)
|
|
1354
|
-
return
|
|
1350
|
+
return Ke(e.children, r, t);
|
|
1355
1351
|
}
|
|
1356
|
-
return Array.isArray(e) ?
|
|
1352
|
+
return Array.isArray(e) ? Ke(e, r, t) : "";
|
|
1357
1353
|
}
|
|
1358
|
-
function
|
|
1354
|
+
function Ke(e, r, t) {
|
|
1359
1355
|
const n = [];
|
|
1360
1356
|
let i = -1;
|
|
1361
1357
|
for (; ++i < e.length; )
|
|
1362
|
-
n[i] =
|
|
1358
|
+
n[i] = gt(e[i], r, t);
|
|
1363
1359
|
return n.join("");
|
|
1364
1360
|
}
|
|
1365
|
-
function
|
|
1361
|
+
function Dn(e) {
|
|
1366
1362
|
return !!(e && typeof e == "object");
|
|
1367
1363
|
}
|
|
1368
|
-
function
|
|
1364
|
+
function Pn(e, r) {
|
|
1369
1365
|
let t = !1;
|
|
1370
|
-
return
|
|
1366
|
+
return Ln(e, function(n) {
|
|
1371
1367
|
if ("value" in n && /\r?\n|\r/.test(n.value) || n.type === "break")
|
|
1372
|
-
return t = !0,
|
|
1373
|
-
}), !!((!e.depth || e.depth < 3) &&
|
|
1368
|
+
return t = !0, Se;
|
|
1369
|
+
}), !!((!e.depth || e.depth < 3) && pt(e) && (r.options.setext || t));
|
|
1374
1370
|
}
|
|
1375
|
-
function
|
|
1371
|
+
function Rn(e, r, t, n) {
|
|
1376
1372
|
const i = Math.max(Math.min(6, e.depth || 1), 1), o = t.createTracker(n);
|
|
1377
|
-
if (
|
|
1373
|
+
if (Pn(e, t)) {
|
|
1378
1374
|
const f = t.enter("headingSetext"), c = t.enter("phrasing"), p = t.containerPhrasing(e, {
|
|
1379
1375
|
...o.current(),
|
|
1380
1376
|
before: `
|
|
@@ -1399,18 +1395,18 @@ function Dn(e, r, t, n) {
|
|
|
1399
1395
|
`,
|
|
1400
1396
|
...o.current()
|
|
1401
1397
|
});
|
|
1402
|
-
return /^[\t ]/.test(s) && (s =
|
|
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;
|
|
1403
1399
|
}
|
|
1404
|
-
|
|
1405
|
-
function
|
|
1400
|
+
bt.peek = En;
|
|
1401
|
+
function bt(e) {
|
|
1406
1402
|
return e.value || "";
|
|
1407
1403
|
}
|
|
1408
|
-
function
|
|
1404
|
+
function En() {
|
|
1409
1405
|
return "<";
|
|
1410
1406
|
}
|
|
1411
|
-
|
|
1412
|
-
function
|
|
1413
|
-
const i =
|
|
1407
|
+
kt.peek = _n;
|
|
1408
|
+
function kt(e, r, t, n) {
|
|
1409
|
+
const i = De(t), o = i === '"' ? "Quote" : "Apostrophe", a = t.enter("image");
|
|
1414
1410
|
let u = t.enter("label");
|
|
1415
1411
|
const l = t.createTracker(n);
|
|
1416
1412
|
let s = l.move("![");
|
|
@@ -1434,11 +1430,11 @@ function gt(e, r, t, n) {
|
|
|
1434
1430
|
})
|
|
1435
1431
|
), s += l.move(i), u()), s += l.move(")"), a(), s;
|
|
1436
1432
|
}
|
|
1437
|
-
function
|
|
1433
|
+
function _n() {
|
|
1438
1434
|
return "!";
|
|
1439
1435
|
}
|
|
1440
|
-
|
|
1441
|
-
function
|
|
1436
|
+
xt.peek = Fn;
|
|
1437
|
+
function xt(e, r, t, n) {
|
|
1442
1438
|
const i = e.referenceType, o = t.enter("imageReference");
|
|
1443
1439
|
let a = t.enter("label");
|
|
1444
1440
|
const u = t.createTracker(n);
|
|
@@ -1458,11 +1454,11 @@ function bt(e, r, t, n) {
|
|
|
1458
1454
|
});
|
|
1459
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;
|
|
1460
1456
|
}
|
|
1461
|
-
function
|
|
1457
|
+
function Fn() {
|
|
1462
1458
|
return "!";
|
|
1463
1459
|
}
|
|
1464
|
-
|
|
1465
|
-
function
|
|
1460
|
+
wt.peek = zn;
|
|
1461
|
+
function wt(e, r, t) {
|
|
1466
1462
|
let n = e.value || "", i = "`", o = -1;
|
|
1467
1463
|
for (; new RegExp("(^|[^`])" + i + "([^`]|$)").test(n); )
|
|
1468
1464
|
i += "`";
|
|
@@ -1477,11 +1473,11 @@ function kt(e, r, t) {
|
|
|
1477
1473
|
}
|
|
1478
1474
|
return i + n + i;
|
|
1479
1475
|
}
|
|
1480
|
-
function
|
|
1476
|
+
function zn() {
|
|
1481
1477
|
return "`";
|
|
1482
1478
|
}
|
|
1483
|
-
function
|
|
1484
|
-
const t =
|
|
1479
|
+
function yt(e, r) {
|
|
1480
|
+
const t = pt(e);
|
|
1485
1481
|
return !!(!r.options.resourceLink && // If there’s a url…
|
|
1486
1482
|
e.url && // And there’s a no title…
|
|
1487
1483
|
!e.title && // And the content of `node` is a single text node…
|
|
@@ -1491,11 +1487,11 @@ function xt(e, r) {
|
|
|
1491
1487
|
// references don’t work), space, or angle brackets…
|
|
1492
1488
|
!/[\0- <>\u007F]/.test(e.url));
|
|
1493
1489
|
}
|
|
1494
|
-
|
|
1495
|
-
function
|
|
1496
|
-
const i =
|
|
1490
|
+
Ct.peek = jn;
|
|
1491
|
+
function Ct(e, r, t, n) {
|
|
1492
|
+
const i = De(t), o = i === '"' ? "Quote" : "Apostrophe", a = t.createTracker(n);
|
|
1497
1493
|
let u, l;
|
|
1498
|
-
if (
|
|
1494
|
+
if (yt(e, t)) {
|
|
1499
1495
|
const f = t.stack;
|
|
1500
1496
|
t.stack = [], u = t.enter("autolink");
|
|
1501
1497
|
let c = a.move("<");
|
|
@@ -1533,11 +1529,11 @@ function wt(e, r, t, n) {
|
|
|
1533
1529
|
})
|
|
1534
1530
|
), s += a.move(i), l()), s += a.move(")"), u(), s;
|
|
1535
1531
|
}
|
|
1536
|
-
function
|
|
1537
|
-
return
|
|
1532
|
+
function jn(e, r, t) {
|
|
1533
|
+
return yt(e, t) ? "<" : "[";
|
|
1538
1534
|
}
|
|
1539
|
-
|
|
1540
|
-
function
|
|
1535
|
+
vt.peek = $n;
|
|
1536
|
+
function vt(e, r, t, n) {
|
|
1541
1537
|
const i = e.referenceType, o = t.enter("linkReference");
|
|
1542
1538
|
let a = t.enter("label");
|
|
1543
1539
|
const u = t.createTracker(n);
|
|
@@ -1557,10 +1553,10 @@ function yt(e, r, t, n) {
|
|
|
1557
1553
|
});
|
|
1558
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;
|
|
1559
1555
|
}
|
|
1560
|
-
function
|
|
1556
|
+
function $n() {
|
|
1561
1557
|
return "[";
|
|
1562
1558
|
}
|
|
1563
|
-
function
|
|
1559
|
+
function Pe(e) {
|
|
1564
1560
|
const r = e.options.bullet || "*";
|
|
1565
1561
|
if (r !== "*" && r !== "+" && r !== "-")
|
|
1566
1562
|
throw new Error(
|
|
@@ -1568,8 +1564,8 @@ function De(e) {
|
|
|
1568
1564
|
);
|
|
1569
1565
|
return r;
|
|
1570
1566
|
}
|
|
1571
|
-
function
|
|
1572
|
-
const r =
|
|
1567
|
+
function On(e) {
|
|
1568
|
+
const r = Pe(e), t = e.options.bulletOther;
|
|
1573
1569
|
if (!t)
|
|
1574
1570
|
return r === "*" ? "-" : "*";
|
|
1575
1571
|
if (t !== "*" && t !== "+" && t !== "-")
|
|
@@ -1582,7 +1578,7 @@ function jn(e) {
|
|
|
1582
1578
|
);
|
|
1583
1579
|
return t;
|
|
1584
1580
|
}
|
|
1585
|
-
function
|
|
1581
|
+
function Un(e) {
|
|
1586
1582
|
const r = e.options.bulletOrdered || ".";
|
|
1587
1583
|
if (r !== "." && r !== ")")
|
|
1588
1584
|
throw new Error(
|
|
@@ -1590,7 +1586,7 @@ function $n(e) {
|
|
|
1590
1586
|
);
|
|
1591
1587
|
return r;
|
|
1592
1588
|
}
|
|
1593
|
-
function
|
|
1589
|
+
function Tt(e) {
|
|
1594
1590
|
const r = e.options.rule || "*";
|
|
1595
1591
|
if (r !== "*" && r !== "-" && r !== "_")
|
|
1596
1592
|
throw new Error(
|
|
@@ -1598,10 +1594,10 @@ function Ct(e) {
|
|
|
1598
1594
|
);
|
|
1599
1595
|
return r;
|
|
1600
1596
|
}
|
|
1601
|
-
function
|
|
1597
|
+
function Bn(e, r, t, n) {
|
|
1602
1598
|
const i = t.enter("list"), o = t.bulletCurrent;
|
|
1603
|
-
let a = e.ordered ?
|
|
1604
|
-
const u = e.ordered ? a === "." ? ")" : "." :
|
|
1599
|
+
let a = e.ordered ? Un(t) : Pe(t);
|
|
1600
|
+
const u = e.ordered ? a === "." ? ")" : "." : On(t);
|
|
1605
1601
|
let l = r && t.bulletLastUsed ? a === t.bulletLastUsed : !1;
|
|
1606
1602
|
if (!e.ordered) {
|
|
1607
1603
|
const f = e.children ? e.children[0] : void 0;
|
|
@@ -1610,7 +1606,7 @@ function On(e, r, t, n) {
|
|
|
1610
1606
|
(a === "*" || a === "-") && // Empty first list item:
|
|
1611
1607
|
f && (!f.children || !f.children[0]) && // Directly in two other list items:
|
|
1612
1608
|
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.
|
|
1613
|
-
t.indexStack[t.indexStack.length - 1] === 0 && t.indexStack[t.indexStack.length - 2] === 0 && t.indexStack[t.indexStack.length - 3] === 0 && (l = !0),
|
|
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
|
|
1614
1610
|
) {
|
|
1615
1611
|
let c = -1;
|
|
1616
1612
|
for (; ++c < e.children.length; ) {
|
|
@@ -1626,7 +1622,7 @@ function On(e, r, t, n) {
|
|
|
1626
1622
|
const s = t.containerFlow(e, n);
|
|
1627
1623
|
return t.bulletLastUsed = a, t.bulletCurrent = o, i(), s;
|
|
1628
1624
|
}
|
|
1629
|
-
function
|
|
1625
|
+
function Wn(e) {
|
|
1630
1626
|
const r = e.options.listItemIndent || "one";
|
|
1631
1627
|
if (r !== "tab" && r !== "one" && r !== "mixed")
|
|
1632
1628
|
throw new Error(
|
|
@@ -1634,9 +1630,9 @@ function Un(e) {
|
|
|
1634
1630
|
);
|
|
1635
1631
|
return r;
|
|
1636
1632
|
}
|
|
1637
|
-
function
|
|
1638
|
-
const i =
|
|
1639
|
-
let o = t.bulletCurrent ||
|
|
1633
|
+
function Hn(e, r, t, n) {
|
|
1634
|
+
const i = Wn(t);
|
|
1635
|
+
let o = t.bulletCurrent || Pe(t);
|
|
1640
1636
|
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);
|
|
1641
1637
|
let a = o.length + 1;
|
|
1642
1638
|
(i === "tab" || i === "mixed" && (r && r.type === "list" && r.spread || e.spread)) && (a = Math.ceil(a / 4) * 4);
|
|
@@ -1651,13 +1647,13 @@ function Bn(e, r, t, n) {
|
|
|
1651
1647
|
return p ? (g ? "" : " ".repeat(a)) + c : (g ? o : o + " ".repeat(a - o.length)) + c;
|
|
1652
1648
|
}
|
|
1653
1649
|
}
|
|
1654
|
-
function
|
|
1650
|
+
function qn(e, r, t, n) {
|
|
1655
1651
|
const i = t.enter("paragraph"), o = t.enter("phrasing"), a = t.containerPhrasing(e, n);
|
|
1656
1652
|
return o(), i(), a;
|
|
1657
1653
|
}
|
|
1658
|
-
const
|
|
1654
|
+
const Kn = (
|
|
1659
1655
|
/** @type {(node?: unknown) => node is Exclude<PhrasingContent, Html>} */
|
|
1660
|
-
|
|
1656
|
+
pe([
|
|
1661
1657
|
"break",
|
|
1662
1658
|
"delete",
|
|
1663
1659
|
"emphasis",
|
|
@@ -1681,12 +1677,12 @@ const Hn = (
|
|
|
1681
1677
|
"textDirective"
|
|
1682
1678
|
])
|
|
1683
1679
|
);
|
|
1684
|
-
function
|
|
1680
|
+
function Vn(e, r, t, n) {
|
|
1685
1681
|
return (e.children.some(function(a) {
|
|
1686
|
-
return
|
|
1682
|
+
return Kn(a);
|
|
1687
1683
|
}) ? t.containerPhrasing : t.containerFlow).call(t, e, n);
|
|
1688
1684
|
}
|
|
1689
|
-
function
|
|
1685
|
+
function Gn(e) {
|
|
1690
1686
|
const r = e.options.strong || "*";
|
|
1691
1687
|
if (r !== "*" && r !== "_")
|
|
1692
1688
|
throw new Error(
|
|
@@ -1694,9 +1690,9 @@ function Kn(e) {
|
|
|
1694
1690
|
);
|
|
1695
1691
|
return r;
|
|
1696
1692
|
}
|
|
1697
|
-
|
|
1698
|
-
function
|
|
1699
|
-
const i =
|
|
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);
|
|
1700
1696
|
let l = a.move(
|
|
1701
1697
|
t.containerPhrasing(e, {
|
|
1702
1698
|
after: i,
|
|
@@ -1704,27 +1700,27 @@ function vt(e, r, t, n) {
|
|
|
1704
1700
|
...a.current()
|
|
1705
1701
|
})
|
|
1706
1702
|
);
|
|
1707
|
-
const s = l.charCodeAt(0), f =
|
|
1703
|
+
const s = l.charCodeAt(0), f = fe(
|
|
1708
1704
|
n.before.charCodeAt(n.before.length - 1),
|
|
1709
1705
|
s,
|
|
1710
1706
|
i
|
|
1711
1707
|
);
|
|
1712
|
-
f.inside && (l =
|
|
1713
|
-
const c = l.charCodeAt(l.length - 1), p =
|
|
1714
|
-
p.inside && (l = l.slice(0, -1) +
|
|
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));
|
|
1715
1711
|
const g = a.move(i + i);
|
|
1716
1712
|
return o(), t.attentionEncodeSurroundingInfo = {
|
|
1717
1713
|
after: p.outside,
|
|
1718
1714
|
before: f.outside
|
|
1719
1715
|
}, u + l + g;
|
|
1720
1716
|
}
|
|
1721
|
-
function
|
|
1717
|
+
function Zn(e, r, t) {
|
|
1722
1718
|
return t.options.strong || "*";
|
|
1723
1719
|
}
|
|
1724
|
-
function
|
|
1720
|
+
function Jn(e, r, t, n) {
|
|
1725
1721
|
return t.safe(e.value, n);
|
|
1726
1722
|
}
|
|
1727
|
-
function
|
|
1723
|
+
function Qn(e) {
|
|
1728
1724
|
const r = e.options.ruleRepetition || 3;
|
|
1729
1725
|
if (r < 3)
|
|
1730
1726
|
throw new Error(
|
|
@@ -1732,50 +1728,50 @@ function Gn(e) {
|
|
|
1732
1728
|
);
|
|
1733
1729
|
return r;
|
|
1734
1730
|
}
|
|
1735
|
-
function
|
|
1736
|
-
const n = (
|
|
1731
|
+
function Xn(e, r, t) {
|
|
1732
|
+
const n = (Tt(t) + (t.options.ruleSpaces ? " " : "")).repeat(Qn(t));
|
|
1737
1733
|
return t.options.ruleSpaces ? n.slice(0, -1) : n;
|
|
1738
1734
|
}
|
|
1739
|
-
const
|
|
1740
|
-
blockquote:
|
|
1741
|
-
break:
|
|
1742
|
-
code:
|
|
1743
|
-
definition:
|
|
1744
|
-
emphasis:
|
|
1745
|
-
hardBreak:
|
|
1746
|
-
heading:
|
|
1747
|
-
html:
|
|
1748
|
-
image:
|
|
1749
|
-
imageReference:
|
|
1750
|
-
inlineCode:
|
|
1751
|
-
link:
|
|
1752
|
-
linkReference:
|
|
1753
|
-
list:
|
|
1754
|
-
listItem:
|
|
1755
|
-
paragraph:
|
|
1756
|
-
root:
|
|
1757
|
-
strong:
|
|
1758
|
-
text:
|
|
1759
|
-
thematicBreak:
|
|
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
|
|
1760
1756
|
};
|
|
1761
|
-
function
|
|
1757
|
+
function Yn() {
|
|
1762
1758
|
return {
|
|
1763
1759
|
enter: {
|
|
1764
|
-
table:
|
|
1765
|
-
tableData:
|
|
1766
|
-
tableHeader:
|
|
1767
|
-
tableRow:
|
|
1760
|
+
table: ea,
|
|
1761
|
+
tableData: Ve,
|
|
1762
|
+
tableHeader: Ve,
|
|
1763
|
+
tableRow: ra
|
|
1768
1764
|
},
|
|
1769
1765
|
exit: {
|
|
1770
|
-
codeText:
|
|
1771
|
-
table:
|
|
1772
|
-
tableData:
|
|
1773
|
-
tableHeader:
|
|
1774
|
-
tableRow:
|
|
1766
|
+
codeText: na,
|
|
1767
|
+
table: ta,
|
|
1768
|
+
tableData: Te,
|
|
1769
|
+
tableHeader: Te,
|
|
1770
|
+
tableRow: Te
|
|
1775
1771
|
}
|
|
1776
1772
|
};
|
|
1777
1773
|
}
|
|
1778
|
-
function
|
|
1774
|
+
function ea(e) {
|
|
1779
1775
|
const r = e._align;
|
|
1780
1776
|
this.enter(
|
|
1781
1777
|
{
|
|
@@ -1788,28 +1784,28 @@ function Qn(e) {
|
|
|
1788
1784
|
e
|
|
1789
1785
|
), this.data.inTable = !0;
|
|
1790
1786
|
}
|
|
1791
|
-
function
|
|
1787
|
+
function ta(e) {
|
|
1792
1788
|
this.exit(e), this.data.inTable = void 0;
|
|
1793
1789
|
}
|
|
1794
|
-
function
|
|
1790
|
+
function ra(e) {
|
|
1795
1791
|
this.enter({ type: "tableRow", children: [] }, e);
|
|
1796
1792
|
}
|
|
1797
|
-
function
|
|
1793
|
+
function Te(e) {
|
|
1798
1794
|
this.exit(e);
|
|
1799
1795
|
}
|
|
1800
|
-
function
|
|
1796
|
+
function Ve(e) {
|
|
1801
1797
|
this.enter({ type: "tableCell", children: [] }, e);
|
|
1802
1798
|
}
|
|
1803
|
-
function
|
|
1799
|
+
function na(e) {
|
|
1804
1800
|
let r = this.resume();
|
|
1805
|
-
this.data.inTable && (r = r.replace(/\\([\\|])/g,
|
|
1801
|
+
this.data.inTable && (r = r.replace(/\\([\\|])/g, aa));
|
|
1806
1802
|
const t = this.stack[this.stack.length - 1];
|
|
1807
1803
|
t.type, t.value = r, this.exit(e);
|
|
1808
1804
|
}
|
|
1809
|
-
function
|
|
1805
|
+
function aa(e, r) {
|
|
1810
1806
|
return r === "|" ? r : e;
|
|
1811
1807
|
}
|
|
1812
|
-
function
|
|
1808
|
+
function ia(e) {
|
|
1813
1809
|
const r = e || {}, t = r.tableCellPadding, n = r.tablePipeAlign, i = r.stringLength, o = t ? " " : "|";
|
|
1814
1810
|
return {
|
|
1815
1811
|
unsafe: [
|
|
@@ -1838,15 +1834,15 @@ function na(e) {
|
|
|
1838
1834
|
tableRow: u
|
|
1839
1835
|
}
|
|
1840
1836
|
};
|
|
1841
|
-
function a(g,
|
|
1837
|
+
function a(g, h, k, b) {
|
|
1842
1838
|
return s(f(g, k, b), g.align);
|
|
1843
1839
|
}
|
|
1844
|
-
function u(g,
|
|
1840
|
+
function u(g, h, k, b) {
|
|
1845
1841
|
const x = c(g, k, b), w = s([x]);
|
|
1846
1842
|
return w.slice(0, w.indexOf(`
|
|
1847
1843
|
`));
|
|
1848
1844
|
}
|
|
1849
|
-
function l(g,
|
|
1845
|
+
function l(g, h, k, b) {
|
|
1850
1846
|
const x = k.enter("tableCell"), w = k.enter("phrasing"), y = k.containerPhrasing(g, {
|
|
1851
1847
|
...b,
|
|
1852
1848
|
before: o,
|
|
@@ -1854,9 +1850,9 @@ function na(e) {
|
|
|
1854
1850
|
});
|
|
1855
1851
|
return w(), x(), y;
|
|
1856
1852
|
}
|
|
1857
|
-
function s(g,
|
|
1858
|
-
return
|
|
1859
|
-
align:
|
|
1853
|
+
function s(g, h) {
|
|
1854
|
+
return gn(g, {
|
|
1855
|
+
align: h,
|
|
1860
1856
|
// @ts-expect-error: `markdown-table` types should support `null`.
|
|
1861
1857
|
alignDelimiters: n,
|
|
1862
1858
|
// @ts-expect-error: `markdown-table` types should support `null`.
|
|
@@ -1865,47 +1861,47 @@ function na(e) {
|
|
|
1865
1861
|
stringLength: i
|
|
1866
1862
|
});
|
|
1867
1863
|
}
|
|
1868
|
-
function f(g,
|
|
1864
|
+
function f(g, h, k) {
|
|
1869
1865
|
const b = g.children;
|
|
1870
1866
|
let x = -1;
|
|
1871
|
-
const w = [], y =
|
|
1867
|
+
const w = [], y = h.enter("table");
|
|
1872
1868
|
for (; ++x < b.length; )
|
|
1873
|
-
w[x] = c(b[x],
|
|
1869
|
+
w[x] = c(b[x], h, k);
|
|
1874
1870
|
return y(), w;
|
|
1875
1871
|
}
|
|
1876
|
-
function c(g,
|
|
1872
|
+
function c(g, h, k) {
|
|
1877
1873
|
const b = g.children;
|
|
1878
1874
|
let x = -1;
|
|
1879
|
-
const w = [], y =
|
|
1875
|
+
const w = [], y = h.enter("tableRow");
|
|
1880
1876
|
for (; ++x < b.length; )
|
|
1881
|
-
w[x] = l(b[x], g,
|
|
1877
|
+
w[x] = l(b[x], g, h, k);
|
|
1882
1878
|
return y(), w;
|
|
1883
1879
|
}
|
|
1884
|
-
function p(g,
|
|
1885
|
-
let b =
|
|
1880
|
+
function p(g, h, k) {
|
|
1881
|
+
let b = It.inlineCode(g, h, k);
|
|
1886
1882
|
return k.stack.includes("tableCell") && (b = b.replace(/\|/g, "\\$&")), b;
|
|
1887
1883
|
}
|
|
1888
1884
|
}
|
|
1889
|
-
function
|
|
1885
|
+
function oa() {
|
|
1890
1886
|
return {
|
|
1891
1887
|
exit: {
|
|
1892
|
-
taskListCheckValueChecked:
|
|
1893
|
-
taskListCheckValueUnchecked:
|
|
1894
|
-
paragraph:
|
|
1888
|
+
taskListCheckValueChecked: Ge,
|
|
1889
|
+
taskListCheckValueUnchecked: Ge,
|
|
1890
|
+
paragraph: ua
|
|
1895
1891
|
}
|
|
1896
1892
|
};
|
|
1897
1893
|
}
|
|
1898
|
-
function
|
|
1894
|
+
function la() {
|
|
1899
1895
|
return {
|
|
1900
1896
|
unsafe: [{ atBreak: !0, character: "-", after: "[:|-]" }],
|
|
1901
|
-
handlers: { listItem:
|
|
1897
|
+
handlers: { listItem: ca }
|
|
1902
1898
|
};
|
|
1903
1899
|
}
|
|
1904
|
-
function
|
|
1900
|
+
function Ge(e) {
|
|
1905
1901
|
const r = this.stack[this.stack.length - 2];
|
|
1906
1902
|
r.type, r.checked = e.type === "taskListCheckValueChecked";
|
|
1907
1903
|
}
|
|
1908
|
-
function
|
|
1904
|
+
function ua(e) {
|
|
1909
1905
|
const r = this.stack[this.stack.length - 2];
|
|
1910
1906
|
if (r && r.type === "listItem" && typeof r.checked == "boolean") {
|
|
1911
1907
|
const t = this.stack[this.stack.length - 1];
|
|
@@ -1926,10 +1922,10 @@ function oa(e) {
|
|
|
1926
1922
|
}
|
|
1927
1923
|
this.exit(e);
|
|
1928
1924
|
}
|
|
1929
|
-
function
|
|
1925
|
+
function ca(e, r, t, n) {
|
|
1930
1926
|
const i = e.children[0], o = typeof e.checked == "boolean" && i && i.type === "paragraph", a = "[" + (e.checked ? "x" : " ") + "] ", u = t.createTracker(n);
|
|
1931
1927
|
o && u.move(a);
|
|
1932
|
-
let l =
|
|
1928
|
+
let l = It.listItem(e, r, t, {
|
|
1933
1929
|
...n,
|
|
1934
1930
|
...u.current()
|
|
1935
1931
|
});
|
|
@@ -1938,27 +1934,27 @@ function la(e, r, t, n) {
|
|
|
1938
1934
|
return f + a;
|
|
1939
1935
|
}
|
|
1940
1936
|
}
|
|
1941
|
-
function
|
|
1937
|
+
function sa() {
|
|
1942
1938
|
return [
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1939
|
+
jr(),
|
|
1940
|
+
on(),
|
|
1941
|
+
sn(),
|
|
1942
|
+
Yn(),
|
|
1943
|
+
oa()
|
|
1948
1944
|
];
|
|
1949
1945
|
}
|
|
1950
|
-
function
|
|
1946
|
+
function da(e) {
|
|
1951
1947
|
return {
|
|
1952
1948
|
extensions: [
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1949
|
+
$r(),
|
|
1950
|
+
ln(e),
|
|
1951
|
+
dn(),
|
|
1952
|
+
ia(e),
|
|
1953
|
+
la()
|
|
1958
1954
|
]
|
|
1959
1955
|
};
|
|
1960
1956
|
}
|
|
1961
|
-
function
|
|
1957
|
+
function ce(e, r, t, n) {
|
|
1962
1958
|
const i = e.length;
|
|
1963
1959
|
let o = 0, a;
|
|
1964
1960
|
if (r < 0 ? r = -r > i ? 0 : i + r : r = r > i ? i : r, t = t > 0 ? t : 0, n.length < 1e4)
|
|
@@ -1967,24 +1963,24 @@ function ue(e, r, t, n) {
|
|
|
1967
1963
|
for (t && e.splice(r, t); o < n.length; )
|
|
1968
1964
|
a = n.slice(o, o + 1e4), a.unshift(r, 0), e.splice(...a), o += 1e4, r += 1e4;
|
|
1969
1965
|
}
|
|
1970
|
-
const
|
|
1971
|
-
function
|
|
1966
|
+
const Ze = {}.hasOwnProperty;
|
|
1967
|
+
function fa(e) {
|
|
1972
1968
|
const r = {};
|
|
1973
1969
|
let t = -1;
|
|
1974
1970
|
for (; ++t < e.length; )
|
|
1975
|
-
|
|
1971
|
+
ha(r, e[t]);
|
|
1976
1972
|
return r;
|
|
1977
1973
|
}
|
|
1978
|
-
function
|
|
1974
|
+
function ha(e, r) {
|
|
1979
1975
|
let t;
|
|
1980
1976
|
for (t in r) {
|
|
1981
|
-
const i = (
|
|
1977
|
+
const i = (Ze.call(e, t) ? e[t] : void 0) || (e[t] = {}), o = r[t];
|
|
1982
1978
|
let a;
|
|
1983
1979
|
if (o)
|
|
1984
1980
|
for (a in o) {
|
|
1985
|
-
|
|
1981
|
+
Ze.call(i, a) || (i[a] = []);
|
|
1986
1982
|
const u = o[a];
|
|
1987
|
-
|
|
1983
|
+
ma(
|
|
1988
1984
|
// @ts-expect-error Looks like a list.
|
|
1989
1985
|
i[a],
|
|
1990
1986
|
Array.isArray(u) ? u : u ? [u] : []
|
|
@@ -1992,96 +1988,96 @@ function da(e, r) {
|
|
|
1992
1988
|
}
|
|
1993
1989
|
}
|
|
1994
1990
|
}
|
|
1995
|
-
function
|
|
1991
|
+
function ma(e, r) {
|
|
1996
1992
|
let t = -1;
|
|
1997
1993
|
const n = [];
|
|
1998
1994
|
for (; ++t < r.length; )
|
|
1999
1995
|
(r[t].add === "after" ? e : n).push(r[t]);
|
|
2000
|
-
|
|
1996
|
+
ce(e, 0, 0, n);
|
|
2001
1997
|
}
|
|
2002
|
-
const
|
|
2003
|
-
tokenize: xa,
|
|
2004
|
-
partial: !0
|
|
2005
|
-
}, It = {
|
|
2006
|
-
tokenize: wa,
|
|
2007
|
-
partial: !0
|
|
2008
|
-
}, At = {
|
|
1998
|
+
const pa = {
|
|
2009
1999
|
tokenize: ya,
|
|
2010
2000
|
partial: !0
|
|
2011
2001
|
}, Nt = {
|
|
2012
2002
|
tokenize: Ca,
|
|
2013
2003
|
partial: !0
|
|
2014
|
-
},
|
|
2004
|
+
}, St = {
|
|
2015
2005
|
tokenize: va,
|
|
2016
2006
|
partial: !0
|
|
2017
|
-
}, St = {
|
|
2018
|
-
name: "wwwAutolink",
|
|
2019
|
-
tokenize: ba,
|
|
2020
|
-
previous: Mt
|
|
2021
2007
|
}, Lt = {
|
|
2008
|
+
tokenize: Ta,
|
|
2009
|
+
partial: !0
|
|
2010
|
+
}, ga = {
|
|
2011
|
+
tokenize: Aa,
|
|
2012
|
+
partial: !0
|
|
2013
|
+
}, Mt = {
|
|
2014
|
+
name: "wwwAutolink",
|
|
2015
|
+
tokenize: xa,
|
|
2016
|
+
previous: Pt
|
|
2017
|
+
}, Dt = {
|
|
2022
2018
|
name: "protocolAutolink",
|
|
2023
|
-
tokenize:
|
|
2024
|
-
previous:
|
|
2025
|
-
},
|
|
2019
|
+
tokenize: wa,
|
|
2020
|
+
previous: Rt
|
|
2021
|
+
}, $ = {
|
|
2026
2022
|
name: "emailAutolink",
|
|
2027
|
-
tokenize:
|
|
2028
|
-
previous:
|
|
2023
|
+
tokenize: ka,
|
|
2024
|
+
previous: Et
|
|
2029
2025
|
}, R = {};
|
|
2030
|
-
function
|
|
2026
|
+
function ba() {
|
|
2031
2027
|
return {
|
|
2032
2028
|
text: R
|
|
2033
2029
|
};
|
|
2034
2030
|
}
|
|
2035
|
-
let
|
|
2036
|
-
for (;
|
|
2037
|
-
R[
|
|
2038
|
-
R[43] =
|
|
2039
|
-
R[45] =
|
|
2040
|
-
R[46] =
|
|
2041
|
-
R[95] =
|
|
2042
|
-
R[72] = [
|
|
2043
|
-
R[104] = [
|
|
2044
|
-
R[87] = [
|
|
2045
|
-
R[119] = [
|
|
2046
|
-
function
|
|
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) {
|
|
2047
2043
|
const n = this;
|
|
2048
2044
|
let i, o;
|
|
2049
2045
|
return a;
|
|
2050
2046
|
function a(c) {
|
|
2051
|
-
return !
|
|
2047
|
+
return !Le(c) || !Et.call(n, n.previous) || Re(n.events) ? t(c) : (e.enter("literalAutolink"), e.enter("literalAutolinkEmail"), u(c));
|
|
2052
2048
|
}
|
|
2053
2049
|
function u(c) {
|
|
2054
|
-
return
|
|
2050
|
+
return Le(c) ? (e.consume(c), u) : c === 64 ? (e.consume(c), l) : t(c);
|
|
2055
2051
|
}
|
|
2056
2052
|
function l(c) {
|
|
2057
|
-
return c === 46 ? e.check(
|
|
2053
|
+
return c === 46 ? e.check(ga, f, s)(c) : c === 45 || c === 95 || Me(c) ? (o = !0, e.consume(c), l) : f(c);
|
|
2058
2054
|
}
|
|
2059
2055
|
function s(c) {
|
|
2060
2056
|
return e.consume(c), i = !0, l;
|
|
2061
2057
|
}
|
|
2062
2058
|
function f(c) {
|
|
2063
|
-
return o && i &&
|
|
2059
|
+
return o && i && re(n.previous) ? (e.exit("literalAutolinkEmail"), e.exit("literalAutolink"), r(c)) : t(c);
|
|
2064
2060
|
}
|
|
2065
2061
|
}
|
|
2066
|
-
function
|
|
2062
|
+
function xa(e, r, t) {
|
|
2067
2063
|
const n = this;
|
|
2068
2064
|
return i;
|
|
2069
2065
|
function i(a) {
|
|
2070
|
-
return a !== 87 && a !== 119 || !
|
|
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));
|
|
2071
2067
|
}
|
|
2072
2068
|
function o(a) {
|
|
2073
2069
|
return e.exit("literalAutolinkWww"), e.exit("literalAutolink"), r(a);
|
|
2074
2070
|
}
|
|
2075
2071
|
}
|
|
2076
|
-
function
|
|
2072
|
+
function wa(e, r, t) {
|
|
2077
2073
|
const n = this;
|
|
2078
2074
|
let i = "", o = !1;
|
|
2079
2075
|
return a;
|
|
2080
2076
|
function a(c) {
|
|
2081
|
-
return (c === 72 || c === 104) &&
|
|
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);
|
|
2082
2078
|
}
|
|
2083
2079
|
function u(c) {
|
|
2084
|
-
if (
|
|
2080
|
+
if (re(c) && i.length < 5)
|
|
2085
2081
|
return i += String.fromCodePoint(c), e.consume(c), u;
|
|
2086
2082
|
if (c === 58) {
|
|
2087
2083
|
const p = i.toLowerCase();
|
|
@@ -2094,13 +2090,13 @@ function ka(e, r, t) {
|
|
|
2094
2090
|
return c === 47 ? (e.consume(c), o ? s : (o = !0, l)) : t(c);
|
|
2095
2091
|
}
|
|
2096
2092
|
function s(c) {
|
|
2097
|
-
return c === null ||
|
|
2093
|
+
return c === null || Tr(c) || D(c) || H(c) || he(c) ? t(c) : e.attempt(Nt, e.attempt(St, f), t)(c);
|
|
2098
2094
|
}
|
|
2099
2095
|
function f(c) {
|
|
2100
2096
|
return e.exit("literalAutolinkHttp"), e.exit("literalAutolink"), r(c);
|
|
2101
2097
|
}
|
|
2102
2098
|
}
|
|
2103
|
-
function
|
|
2099
|
+
function ya(e, r, t) {
|
|
2104
2100
|
let n = 0;
|
|
2105
2101
|
return i;
|
|
2106
2102
|
function i(a) {
|
|
@@ -2110,11 +2106,11 @@ function xa(e, r, t) {
|
|
|
2110
2106
|
return a === null ? t(a) : r(a);
|
|
2111
2107
|
}
|
|
2112
2108
|
}
|
|
2113
|
-
function
|
|
2109
|
+
function Ca(e, r, t) {
|
|
2114
2110
|
let n, i, o;
|
|
2115
2111
|
return a;
|
|
2116
2112
|
function a(s) {
|
|
2117
|
-
return s === 46 || s === 95 ? e.check(
|
|
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);
|
|
2118
2114
|
}
|
|
2119
2115
|
function u(s) {
|
|
2120
2116
|
return s === 95 ? n = !0 : (i = n, n = void 0), e.consume(s), a;
|
|
@@ -2123,57 +2119,57 @@ function wa(e, r, t) {
|
|
|
2123
2119
|
return i || n || !o ? t(s) : r(s);
|
|
2124
2120
|
}
|
|
2125
2121
|
}
|
|
2126
|
-
function
|
|
2122
|
+
function va(e, r) {
|
|
2127
2123
|
let t = 0, n = 0;
|
|
2128
2124
|
return i;
|
|
2129
2125
|
function i(a) {
|
|
2130
|
-
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(
|
|
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);
|
|
2131
2127
|
}
|
|
2132
2128
|
function o(a) {
|
|
2133
2129
|
return a === 41 && n++, e.consume(a), i;
|
|
2134
2130
|
}
|
|
2135
2131
|
}
|
|
2136
|
-
function
|
|
2132
|
+
function Ta(e, r, t) {
|
|
2137
2133
|
return n;
|
|
2138
2134
|
function n(u) {
|
|
2139
2135
|
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) : (
|
|
2140
2136
|
// `<` is an end.
|
|
2141
2137
|
u === 60 || // So is whitespace.
|
|
2142
|
-
u === null ||
|
|
2138
|
+
u === null || D(u) || H(u) ? r(u) : t(u)
|
|
2143
2139
|
);
|
|
2144
2140
|
}
|
|
2145
2141
|
function i(u) {
|
|
2146
|
-
return u === null || u === 40 || u === 91 ||
|
|
2142
|
+
return u === null || u === 40 || u === 91 || D(u) || H(u) ? r(u) : n(u);
|
|
2147
2143
|
}
|
|
2148
2144
|
function o(u) {
|
|
2149
|
-
return
|
|
2145
|
+
return re(u) ? a(u) : t(u);
|
|
2150
2146
|
}
|
|
2151
2147
|
function a(u) {
|
|
2152
|
-
return u === 59 ? (e.consume(u), n) :
|
|
2148
|
+
return u === 59 ? (e.consume(u), n) : re(u) ? (e.consume(u), a) : t(u);
|
|
2153
2149
|
}
|
|
2154
2150
|
}
|
|
2155
|
-
function
|
|
2151
|
+
function Aa(e, r, t) {
|
|
2156
2152
|
return n;
|
|
2157
2153
|
function n(o) {
|
|
2158
2154
|
return e.consume(o), i;
|
|
2159
2155
|
}
|
|
2160
2156
|
function i(o) {
|
|
2161
|
-
return
|
|
2157
|
+
return Me(o) ? t(o) : r(o);
|
|
2162
2158
|
}
|
|
2163
2159
|
}
|
|
2164
|
-
function
|
|
2165
|
-
return e === null || e === 40 || e === 42 || e === 95 || e === 91 || e === 93 || e === 126 ||
|
|
2160
|
+
function Pt(e) {
|
|
2161
|
+
return e === null || e === 40 || e === 42 || e === 95 || e === 91 || e === 93 || e === 126 || D(e);
|
|
2166
2162
|
}
|
|
2167
|
-
function
|
|
2168
|
-
return !
|
|
2163
|
+
function Rt(e) {
|
|
2164
|
+
return !re(e);
|
|
2169
2165
|
}
|
|
2170
|
-
function
|
|
2171
|
-
return !(e === 47 ||
|
|
2166
|
+
function Et(e) {
|
|
2167
|
+
return !(e === 47 || Le(e));
|
|
2172
2168
|
}
|
|
2173
|
-
function
|
|
2174
|
-
return e === 43 || e === 45 || e === 46 || e === 95 ||
|
|
2169
|
+
function Le(e) {
|
|
2170
|
+
return e === 43 || e === 45 || e === 46 || e === 95 || Me(e);
|
|
2175
2171
|
}
|
|
2176
|
-
function
|
|
2172
|
+
function Re(e) {
|
|
2177
2173
|
let r = e.length, t = !1;
|
|
2178
2174
|
for (; r--; ) {
|
|
2179
2175
|
const n = e[r][1];
|
|
@@ -2188,7 +2184,7 @@ function Pe(e) {
|
|
|
2188
2184
|
}
|
|
2189
2185
|
return e.length > 0 && !t && (e[e.length - 1][1]._gfmAutolinkLiteralWalkedInto = !0), t;
|
|
2190
2186
|
}
|
|
2191
|
-
function
|
|
2187
|
+
function Ia(e, r, t) {
|
|
2192
2188
|
const n = [];
|
|
2193
2189
|
let i = -1;
|
|
2194
2190
|
for (; ++i < e.length; ) {
|
|
@@ -2197,61 +2193,61 @@ function Ta(e, r, t) {
|
|
|
2197
2193
|
}
|
|
2198
2194
|
return r;
|
|
2199
2195
|
}
|
|
2200
|
-
function
|
|
2196
|
+
function z(e, r, t, n) {
|
|
2201
2197
|
const i = n ? n - 1 : Number.POSITIVE_INFINITY;
|
|
2202
2198
|
let o = 0;
|
|
2203
2199
|
return a;
|
|
2204
2200
|
function a(l) {
|
|
2205
|
-
return
|
|
2201
|
+
return F(l) ? (e.enter(t), u(l)) : r(l);
|
|
2206
2202
|
}
|
|
2207
2203
|
function u(l) {
|
|
2208
|
-
return
|
|
2204
|
+
return F(l) && o++ < i ? (e.consume(l), u) : (e.exit(t), r(l));
|
|
2209
2205
|
}
|
|
2210
2206
|
}
|
|
2211
|
-
const
|
|
2207
|
+
const Na = {
|
|
2212
2208
|
partial: !0,
|
|
2213
|
-
tokenize:
|
|
2209
|
+
tokenize: Sa
|
|
2214
2210
|
};
|
|
2215
|
-
function
|
|
2211
|
+
function Sa(e, r, t) {
|
|
2216
2212
|
return n;
|
|
2217
2213
|
function n(o) {
|
|
2218
|
-
return
|
|
2214
|
+
return F(o) ? z(e, i, "linePrefix")(o) : i(o);
|
|
2219
2215
|
}
|
|
2220
2216
|
function i(o) {
|
|
2221
|
-
return o === null ||
|
|
2217
|
+
return o === null || Z(o) ? r(o) : t(o);
|
|
2222
2218
|
}
|
|
2223
2219
|
}
|
|
2224
|
-
const
|
|
2225
|
-
tokenize:
|
|
2220
|
+
const La = {
|
|
2221
|
+
tokenize: za,
|
|
2226
2222
|
partial: !0
|
|
2227
2223
|
};
|
|
2228
|
-
function
|
|
2224
|
+
function Ma() {
|
|
2229
2225
|
return {
|
|
2230
2226
|
document: {
|
|
2231
2227
|
91: {
|
|
2232
2228
|
name: "gfmFootnoteDefinition",
|
|
2233
|
-
tokenize:
|
|
2229
|
+
tokenize: Ea,
|
|
2234
2230
|
continuation: {
|
|
2235
|
-
tokenize:
|
|
2231
|
+
tokenize: _a
|
|
2236
2232
|
},
|
|
2237
|
-
exit:
|
|
2233
|
+
exit: Fa
|
|
2238
2234
|
}
|
|
2239
2235
|
},
|
|
2240
2236
|
text: {
|
|
2241
2237
|
91: {
|
|
2242
2238
|
name: "gfmFootnoteCall",
|
|
2243
|
-
tokenize:
|
|
2239
|
+
tokenize: Ra
|
|
2244
2240
|
},
|
|
2245
2241
|
93: {
|
|
2246
2242
|
name: "gfmPotentialFootnoteCall",
|
|
2247
2243
|
add: "after",
|
|
2248
|
-
tokenize:
|
|
2249
|
-
resolveTo:
|
|
2244
|
+
tokenize: Da,
|
|
2245
|
+
resolveTo: Pa
|
|
2250
2246
|
}
|
|
2251
2247
|
}
|
|
2252
2248
|
};
|
|
2253
2249
|
}
|
|
2254
|
-
function
|
|
2250
|
+
function Da(e, r, t) {
|
|
2255
2251
|
const n = this;
|
|
2256
2252
|
let i = n.events.length;
|
|
2257
2253
|
const o = n.parser.gfmFootnotes || (n.parser.gfmFootnotes = []);
|
|
@@ -2269,14 +2265,14 @@ function La(e, r, t) {
|
|
|
2269
2265
|
function u(l) {
|
|
2270
2266
|
if (!a || !a._balanced)
|
|
2271
2267
|
return t(l);
|
|
2272
|
-
const s =
|
|
2268
|
+
const s = ae(n.sliceSerialize({
|
|
2273
2269
|
start: a.end,
|
|
2274
2270
|
end: n.now()
|
|
2275
2271
|
}));
|
|
2276
2272
|
return s.codePointAt(0) !== 94 || !o.includes(s.slice(1)) ? t(l) : (e.enter("gfmFootnoteCallLabelMarker"), e.consume(l), e.exit("gfmFootnoteCallLabelMarker"), r(l));
|
|
2277
2273
|
}
|
|
2278
2274
|
}
|
|
2279
|
-
function
|
|
2275
|
+
function Pa(e, r) {
|
|
2280
2276
|
let t = e.length;
|
|
2281
2277
|
for (; t--; )
|
|
2282
2278
|
if (e[t][1].type === "labelImage" && e[t][0] === "enter") {
|
|
@@ -2326,7 +2322,7 @@ function Ma(e, r) {
|
|
|
2326
2322
|
];
|
|
2327
2323
|
return e.splice(t, e.length - t + 1, ...u), e;
|
|
2328
2324
|
}
|
|
2329
|
-
function
|
|
2325
|
+
function Ra(e, r, t) {
|
|
2330
2326
|
const n = this, i = n.parser.gfmFootnotes || (n.parser.gfmFootnotes = []);
|
|
2331
2327
|
let o = 0, a;
|
|
2332
2328
|
return u;
|
|
@@ -2342,71 +2338,71 @@ function Da(e, r, t) {
|
|
|
2342
2338
|
o > 999 || // Closing brace with nothing.
|
|
2343
2339
|
c === 93 && !a || // Space or tab is not supported by GFM for some reason.
|
|
2344
2340
|
// `\n` and `[` not being supported makes sense.
|
|
2345
|
-
c === null || c === 91 ||
|
|
2341
|
+
c === null || c === 91 || D(c)
|
|
2346
2342
|
)
|
|
2347
2343
|
return t(c);
|
|
2348
2344
|
if (c === 93) {
|
|
2349
2345
|
e.exit("chunkString");
|
|
2350
2346
|
const p = e.exit("gfmFootnoteCallString");
|
|
2351
|
-
return i.includes(
|
|
2347
|
+
return i.includes(ae(n.sliceSerialize(p))) ? (e.enter("gfmFootnoteCallLabelMarker"), e.consume(c), e.exit("gfmFootnoteCallLabelMarker"), e.exit("gfmFootnoteCall"), r) : t(c);
|
|
2352
2348
|
}
|
|
2353
|
-
return
|
|
2349
|
+
return D(c) || (a = !0), o++, e.consume(c), c === 92 ? f : s;
|
|
2354
2350
|
}
|
|
2355
2351
|
function f(c) {
|
|
2356
2352
|
return c === 91 || c === 92 || c === 93 ? (e.consume(c), o++, s) : s(c);
|
|
2357
2353
|
}
|
|
2358
2354
|
}
|
|
2359
|
-
function
|
|
2355
|
+
function Ea(e, r, t) {
|
|
2360
2356
|
const n = this, i = n.parser.gfmFootnotes || (n.parser.gfmFootnotes = []);
|
|
2361
2357
|
let o, a = 0, u;
|
|
2362
2358
|
return l;
|
|
2363
|
-
function l(
|
|
2364
|
-
return e.enter("gfmFootnoteDefinition")._container = !0, e.enter("gfmFootnoteDefinitionLabel"), e.enter("gfmFootnoteDefinitionLabelMarker"), e.consume(
|
|
2359
|
+
function l(h) {
|
|
2360
|
+
return e.enter("gfmFootnoteDefinition")._container = !0, e.enter("gfmFootnoteDefinitionLabel"), e.enter("gfmFootnoteDefinitionLabelMarker"), e.consume(h), e.exit("gfmFootnoteDefinitionLabelMarker"), s;
|
|
2365
2361
|
}
|
|
2366
|
-
function s(
|
|
2367
|
-
return
|
|
2362
|
+
function s(h) {
|
|
2363
|
+
return h === 94 ? (e.enter("gfmFootnoteDefinitionMarker"), e.consume(h), e.exit("gfmFootnoteDefinitionMarker"), e.enter("gfmFootnoteDefinitionLabelString"), e.enter("chunkString").contentType = "string", f) : t(h);
|
|
2368
2364
|
}
|
|
2369
|
-
function f(
|
|
2365
|
+
function f(h) {
|
|
2370
2366
|
if (
|
|
2371
2367
|
// Too long.
|
|
2372
2368
|
a > 999 || // Closing brace with nothing.
|
|
2373
|
-
|
|
2369
|
+
h === 93 && !u || // Space or tab is not supported by GFM for some reason.
|
|
2374
2370
|
// `\n` and `[` not being supported makes sense.
|
|
2375
|
-
|
|
2371
|
+
h === null || h === 91 || D(h)
|
|
2376
2372
|
)
|
|
2377
|
-
return t(
|
|
2378
|
-
if (
|
|
2373
|
+
return t(h);
|
|
2374
|
+
if (h === 93) {
|
|
2379
2375
|
e.exit("chunkString");
|
|
2380
2376
|
const k = e.exit("gfmFootnoteDefinitionLabelString");
|
|
2381
|
-
return o =
|
|
2377
|
+
return o = ae(n.sliceSerialize(k)), e.enter("gfmFootnoteDefinitionLabelMarker"), e.consume(h), e.exit("gfmFootnoteDefinitionLabelMarker"), e.exit("gfmFootnoteDefinitionLabel"), p;
|
|
2382
2378
|
}
|
|
2383
|
-
return
|
|
2379
|
+
return D(h) || (u = !0), a++, e.consume(h), h === 92 ? c : f;
|
|
2384
2380
|
}
|
|
2385
|
-
function c(
|
|
2386
|
-
return
|
|
2381
|
+
function c(h) {
|
|
2382
|
+
return h === 91 || h === 92 || h === 93 ? (e.consume(h), a++, f) : f(h);
|
|
2387
2383
|
}
|
|
2388
|
-
function p(
|
|
2389
|
-
return
|
|
2384
|
+
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);
|
|
2390
2386
|
}
|
|
2391
|
-
function g(
|
|
2392
|
-
return r(
|
|
2387
|
+
function g(h) {
|
|
2388
|
+
return r(h);
|
|
2393
2389
|
}
|
|
2394
2390
|
}
|
|
2395
|
-
function
|
|
2396
|
-
return e.check(
|
|
2391
|
+
function _a(e, r, t) {
|
|
2392
|
+
return e.check(Na, r, e.attempt(La, r, t));
|
|
2397
2393
|
}
|
|
2398
|
-
function
|
|
2394
|
+
function Fa(e) {
|
|
2399
2395
|
e.exit("gfmFootnoteDefinition");
|
|
2400
2396
|
}
|
|
2401
|
-
function
|
|
2397
|
+
function za(e, r, t) {
|
|
2402
2398
|
const n = this;
|
|
2403
|
-
return
|
|
2399
|
+
return z(e, i, "gfmFootnoteDefinitionIndent", 5);
|
|
2404
2400
|
function i(o) {
|
|
2405
2401
|
const a = n.events[n.events.length - 1];
|
|
2406
2402
|
return a && a[1].type === "gfmFootnoteDefinitionIndent" && a[2].sliceSerialize(a[1], !0).length === 4 ? r(o) : t(o);
|
|
2407
2403
|
}
|
|
2408
2404
|
}
|
|
2409
|
-
function
|
|
2405
|
+
function ja(e) {
|
|
2410
2406
|
let t = (e || {}).singleTilde;
|
|
2411
2407
|
const n = {
|
|
2412
2408
|
name: "strikethrough",
|
|
@@ -2442,7 +2438,7 @@ function Fa(e) {
|
|
|
2442
2438
|
start: Object.assign({}, a[s][1].end),
|
|
2443
2439
|
end: Object.assign({}, a[l][1].start)
|
|
2444
2440
|
}, p = [["enter", f, u], ["enter", a[s][1], u], ["exit", a[s][1], u], ["enter", c, u]], g = u.parser.constructs.insideSpan.null;
|
|
2445
|
-
g &&
|
|
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;
|
|
2446
2442
|
break;
|
|
2447
2443
|
}
|
|
2448
2444
|
}
|
|
@@ -2454,20 +2450,20 @@ function Fa(e) {
|
|
|
2454
2450
|
const s = this.previous, f = this.events;
|
|
2455
2451
|
let c = 0;
|
|
2456
2452
|
return p;
|
|
2457
|
-
function p(
|
|
2458
|
-
return s === 126 && f[f.length - 1][1].type !== "characterEscape" ? l(
|
|
2453
|
+
function p(h) {
|
|
2454
|
+
return s === 126 && f[f.length - 1][1].type !== "characterEscape" ? l(h) : (a.enter("strikethroughSequenceTemporary"), g(h));
|
|
2459
2455
|
}
|
|
2460
|
-
function g(
|
|
2461
|
-
const k =
|
|
2462
|
-
if (
|
|
2463
|
-
return c > 1 ? l(
|
|
2464
|
-
if (c < 2 && !t) return l(
|
|
2465
|
-
const b = a.exit("strikethroughSequenceTemporary"), x =
|
|
2466
|
-
return b._open = !x || x === 2 && !!k, b._close = !k || k === 2 && !!x, u(
|
|
2456
|
+
function g(h) {
|
|
2457
|
+
const k = de(s);
|
|
2458
|
+
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);
|
|
2467
2463
|
}
|
|
2468
2464
|
}
|
|
2469
2465
|
}
|
|
2470
|
-
class
|
|
2466
|
+
class $a {
|
|
2471
2467
|
/**
|
|
2472
2468
|
* Create a new edit map.
|
|
2473
2469
|
*/
|
|
@@ -2483,7 +2479,7 @@ class za {
|
|
|
2483
2479
|
* @returns {undefined}
|
|
2484
2480
|
*/
|
|
2485
2481
|
add(r, t, n) {
|
|
2486
|
-
|
|
2482
|
+
Oa(this, r, t, n);
|
|
2487
2483
|
}
|
|
2488
2484
|
// To do: add this when moving to `micromark`.
|
|
2489
2485
|
// /**
|
|
@@ -2522,7 +2518,7 @@ class za {
|
|
|
2522
2518
|
this.map.length = 0;
|
|
2523
2519
|
}
|
|
2524
2520
|
}
|
|
2525
|
-
function
|
|
2521
|
+
function Oa(e, r, t, n) {
|
|
2526
2522
|
let i = 0;
|
|
2527
2523
|
if (!(t === 0 && n.length === 0)) {
|
|
2528
2524
|
for (; i < e.map.length; ) {
|
|
@@ -2535,7 +2531,7 @@ function ja(e, r, t, n) {
|
|
|
2535
2531
|
e.map.push([r, t, n]);
|
|
2536
2532
|
}
|
|
2537
2533
|
}
|
|
2538
|
-
function
|
|
2534
|
+
function Ua(e, r) {
|
|
2539
2535
|
let t = !1;
|
|
2540
2536
|
const n = [];
|
|
2541
2537
|
for (; r < e.length; ) {
|
|
@@ -2555,18 +2551,18 @@ function $a(e, r) {
|
|
|
2555
2551
|
}
|
|
2556
2552
|
return n;
|
|
2557
2553
|
}
|
|
2558
|
-
function
|
|
2554
|
+
function Ba() {
|
|
2559
2555
|
return {
|
|
2560
2556
|
flow: {
|
|
2561
2557
|
null: {
|
|
2562
2558
|
name: "table",
|
|
2563
|
-
tokenize:
|
|
2564
|
-
resolveAll:
|
|
2559
|
+
tokenize: Wa,
|
|
2560
|
+
resolveAll: Ha
|
|
2565
2561
|
}
|
|
2566
2562
|
}
|
|
2567
2563
|
};
|
|
2568
2564
|
}
|
|
2569
|
-
function
|
|
2565
|
+
function Wa(e, r, t) {
|
|
2570
2566
|
const n = this;
|
|
2571
2567
|
let i = 0, o = 0, a;
|
|
2572
2568
|
return u;
|
|
@@ -2578,8 +2574,8 @@ function Ua(e, r, t) {
|
|
|
2578
2574
|
J === "linePrefix") P--;
|
|
2579
2575
|
else break;
|
|
2580
2576
|
}
|
|
2581
|
-
const
|
|
2582
|
-
return O ===
|
|
2577
|
+
const ie = P > -1 ? n.events[P][1].type : null, O = ie === "tableHead" || ie === "tableRow" ? C : l;
|
|
2578
|
+
return O === C && n.parser.lazy[n.now().line] ? t(m) : O(m);
|
|
2583
2579
|
}
|
|
2584
2580
|
function l(m) {
|
|
2585
2581
|
return e.enter("tableHead"), e.enter("tableRow"), s(m);
|
|
@@ -2588,88 +2584,88 @@ function Ua(e, r, t) {
|
|
|
2588
2584
|
return m === 124 || (a = !0, o += 1), f(m);
|
|
2589
2585
|
}
|
|
2590
2586
|
function f(m) {
|
|
2591
|
-
return m === null ? t(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)));
|
|
2592
2588
|
}
|
|
2593
2589
|
function c(m) {
|
|
2594
|
-
return m === null || m === 124 ||
|
|
2590
|
+
return m === null || m === 124 || D(m) ? (e.exit("data"), f(m)) : (e.consume(m), m === 92 ? p : c);
|
|
2595
2591
|
}
|
|
2596
2592
|
function p(m) {
|
|
2597
2593
|
return m === 92 || m === 124 ? (e.consume(m), c) : c(m);
|
|
2598
2594
|
}
|
|
2599
2595
|
function g(m) {
|
|
2600
|
-
return n.interrupt = !1, n.parser.lazy[n.now().line] ? t(m) : (e.enter("tableDelimiterRow"), a = !1,
|
|
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));
|
|
2601
2597
|
}
|
|
2602
|
-
function
|
|
2603
|
-
return m === 45 || m === 58 ? b(m) : m === 124 ? (a = !0, e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"), k) :
|
|
2598
|
+
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);
|
|
2604
2600
|
}
|
|
2605
2601
|
function k(m) {
|
|
2606
|
-
return
|
|
2602
|
+
return F(m) ? z(e, b, "whitespace")(m) : b(m);
|
|
2607
2603
|
}
|
|
2608
2604
|
function b(m) {
|
|
2609
|
-
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 ||
|
|
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);
|
|
2610
2606
|
}
|
|
2611
2607
|
function x(m) {
|
|
2612
|
-
return m === 45 ? (e.enter("tableDelimiterFiller"), w(m)) :
|
|
2608
|
+
return m === 45 ? (e.enter("tableDelimiterFiller"), w(m)) : T(m);
|
|
2613
2609
|
}
|
|
2614
2610
|
function w(m) {
|
|
2615
2611
|
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));
|
|
2616
2612
|
}
|
|
2617
2613
|
function y(m) {
|
|
2618
|
-
return
|
|
2614
|
+
return F(m) ? z(e, A, "whitespace")(m) : A(m);
|
|
2619
2615
|
}
|
|
2620
|
-
function
|
|
2621
|
-
return m === 124 ?
|
|
2616
|
+
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);
|
|
2622
2618
|
}
|
|
2623
|
-
function
|
|
2619
|
+
function T(m) {
|
|
2624
2620
|
return t(m);
|
|
2625
2621
|
}
|
|
2626
|
-
function
|
|
2627
|
-
return e.enter("tableRow"),
|
|
2622
|
+
function C(m) {
|
|
2623
|
+
return e.enter("tableRow"), L(m);
|
|
2628
2624
|
}
|
|
2629
|
-
function
|
|
2630
|
-
return m === 124 ? (e.enter("tableCellDivider"), e.consume(m), e.exit("tableCellDivider"),
|
|
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));
|
|
2631
2627
|
}
|
|
2632
|
-
function
|
|
2633
|
-
return m === null || m === 124 ||
|
|
2628
|
+
function E(m) {
|
|
2629
|
+
return m === null || m === 124 || D(m) ? (e.exit("data"), L(m)) : (e.consume(m), m === 92 ? q : E);
|
|
2634
2630
|
}
|
|
2635
|
-
function
|
|
2636
|
-
return m === 92 || m === 124 ? (e.consume(m),
|
|
2631
|
+
function q(m) {
|
|
2632
|
+
return m === 92 || m === 124 ? (e.consume(m), E) : E(m);
|
|
2637
2633
|
}
|
|
2638
2634
|
}
|
|
2639
|
-
function
|
|
2635
|
+
function Ha(e, r) {
|
|
2640
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;
|
|
2641
|
-
const p = new
|
|
2637
|
+
const p = new $a();
|
|
2642
2638
|
for (; ++t < e.length; ) {
|
|
2643
|
-
const g = e[t],
|
|
2644
|
-
g[0] === "enter" ?
|
|
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 = {
|
|
2645
2641
|
type: "table",
|
|
2646
|
-
start: Object.assign({},
|
|
2642
|
+
start: Object.assign({}, h.start),
|
|
2647
2643
|
// Note: correct end is set later.
|
|
2648
|
-
end: Object.assign({},
|
|
2649
|
-
}, p.add(t, 0, [["enter", s, r]])) :
|
|
2644
|
+
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 = {
|
|
2650
2646
|
type: "tableBody",
|
|
2651
|
-
start: Object.assign({},
|
|
2647
|
+
start: Object.assign({}, h.start),
|
|
2652
2648
|
// Note: correct end is set later.
|
|
2653
|
-
end: Object.assign({},
|
|
2654
|
-
}, p.add(t, 0, [["enter", f, r]])), i =
|
|
2649
|
+
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);
|
|
2655
2651
|
}
|
|
2656
|
-
for (l !== 0 &&
|
|
2652
|
+
for (l !== 0 && Je(p, r, l, s, f), p.consume(r.events), t = -1; ++t < r.events.length; ) {
|
|
2657
2653
|
const g = r.events[t];
|
|
2658
|
-
g[0] === "enter" && g[1].type === "table" && (g[1]._align =
|
|
2654
|
+
g[0] === "enter" && g[1].type === "table" && (g[1]._align = Ua(r.events, t));
|
|
2659
2655
|
}
|
|
2660
2656
|
return e;
|
|
2661
2657
|
}
|
|
2662
|
-
function
|
|
2658
|
+
function ue(e, r, t, n, i, o) {
|
|
2663
2659
|
const a = n === 1 ? "tableHeader" : n === 2 ? "tableDelimiter" : "tableData", u = "tableContent";
|
|
2664
|
-
t[0] !== 0 && (o.end = Object.assign({},
|
|
2665
|
-
const l =
|
|
2660
|
+
t[0] !== 0 && (o.end = Object.assign({}, G(r.events, t[0])), e.add(t[0], 0, [["exit", o, r]]));
|
|
2661
|
+
const l = G(r.events, t[1]);
|
|
2666
2662
|
if (o = {
|
|
2667
2663
|
type: a,
|
|
2668
2664
|
start: Object.assign({}, l),
|
|
2669
2665
|
// Note: correct end is set later.
|
|
2670
2666
|
end: Object.assign({}, l)
|
|
2671
2667
|
}, e.add(t[1], 0, [["enter", o, r]]), t[2] !== 0) {
|
|
2672
|
-
const s =
|
|
2668
|
+
const s = G(r.events, t[2]), f = G(r.events, t[3]), c = {
|
|
2673
2669
|
type: u,
|
|
2674
2670
|
start: Object.assign({}, s),
|
|
2675
2671
|
end: Object.assign({}, f)
|
|
@@ -2677,34 +2673,34 @@ function le(e, r, t, n, i, o) {
|
|
|
2677
2673
|
if (e.add(t[2], 0, [["enter", c, r]]), n !== 2) {
|
|
2678
2674
|
const p = r.events[t[2]], g = r.events[t[3]];
|
|
2679
2675
|
if (p[1].end = Object.assign({}, g[1].end), p[1].type = "chunkText", p[1].contentType = "text", t[3] > t[2] + 1) {
|
|
2680
|
-
const
|
|
2681
|
-
e.add(
|
|
2676
|
+
const h = t[2] + 1, k = t[3] - t[2] - 1;
|
|
2677
|
+
e.add(h, k, []);
|
|
2682
2678
|
}
|
|
2683
2679
|
}
|
|
2684
2680
|
e.add(t[3] + 1, 0, [["exit", c, r]]);
|
|
2685
2681
|
}
|
|
2686
|
-
return i !== void 0 && (o.end = Object.assign({},
|
|
2682
|
+
return i !== void 0 && (o.end = Object.assign({}, G(r.events, i)), e.add(i, 0, [["exit", o, r]]), o = void 0), o;
|
|
2687
2683
|
}
|
|
2688
|
-
function
|
|
2689
|
-
const o = [], a =
|
|
2684
|
+
function Je(e, r, t, n, i) {
|
|
2685
|
+
const o = [], a = G(r.events, t);
|
|
2690
2686
|
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);
|
|
2691
2687
|
}
|
|
2692
|
-
function
|
|
2688
|
+
function G(e, r) {
|
|
2693
2689
|
const t = e[r], n = t[0] === "enter" ? "start" : "end";
|
|
2694
2690
|
return t[1][n];
|
|
2695
2691
|
}
|
|
2696
|
-
const
|
|
2692
|
+
const qa = {
|
|
2697
2693
|
name: "tasklistCheck",
|
|
2698
|
-
tokenize:
|
|
2694
|
+
tokenize: Va
|
|
2699
2695
|
};
|
|
2700
|
-
function
|
|
2696
|
+
function Ka() {
|
|
2701
2697
|
return {
|
|
2702
2698
|
text: {
|
|
2703
|
-
91:
|
|
2699
|
+
91: qa
|
|
2704
2700
|
}
|
|
2705
2701
|
};
|
|
2706
2702
|
}
|
|
2707
|
-
function
|
|
2703
|
+
function Va(e, r, t) {
|
|
2708
2704
|
const n = this;
|
|
2709
2705
|
return i;
|
|
2710
2706
|
function i(l) {
|
|
@@ -2716,56 +2712,56 @@ function qa(e, r, t) {
|
|
|
2716
2712
|
);
|
|
2717
2713
|
}
|
|
2718
2714
|
function o(l) {
|
|
2719
|
-
return
|
|
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);
|
|
2720
2716
|
}
|
|
2721
2717
|
function a(l) {
|
|
2722
2718
|
return l === 93 ? (e.enter("taskListCheckMarker"), e.consume(l), e.exit("taskListCheckMarker"), e.exit("taskListCheck"), u) : t(l);
|
|
2723
2719
|
}
|
|
2724
2720
|
function u(l) {
|
|
2725
|
-
return
|
|
2726
|
-
tokenize:
|
|
2721
|
+
return Z(l) ? r(l) : F(l) ? e.check({
|
|
2722
|
+
tokenize: Ga
|
|
2727
2723
|
}, r, t)(l) : t(l);
|
|
2728
2724
|
}
|
|
2729
2725
|
}
|
|
2730
|
-
function
|
|
2731
|
-
return
|
|
2726
|
+
function Ga(e, r, t) {
|
|
2727
|
+
return z(e, n, "whitespace");
|
|
2732
2728
|
function n(i) {
|
|
2733
2729
|
return i === null ? t(i) : r(i);
|
|
2734
2730
|
}
|
|
2735
2731
|
}
|
|
2736
|
-
function
|
|
2737
|
-
return
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2732
|
+
function Za(e) {
|
|
2733
|
+
return fa([
|
|
2734
|
+
ba(),
|
|
2735
|
+
Ma(),
|
|
2736
|
+
ja(e),
|
|
2737
|
+
Ba(),
|
|
2738
|
+
Ka()
|
|
2743
2739
|
]);
|
|
2744
2740
|
}
|
|
2745
|
-
const
|
|
2746
|
-
function
|
|
2741
|
+
const Ja = {};
|
|
2742
|
+
function Qa(e) {
|
|
2747
2743
|
const r = (
|
|
2748
2744
|
/** @type {Processor<Root>} */
|
|
2749
2745
|
this
|
|
2750
|
-
), t = e ||
|
|
2751
|
-
i.push(
|
|
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));
|
|
2752
2748
|
}
|
|
2753
|
-
function
|
|
2749
|
+
function I(...e) {
|
|
2754
2750
|
return e.filter(Boolean).join(" ");
|
|
2755
2751
|
}
|
|
2756
|
-
const
|
|
2757
|
-
|
|
2752
|
+
const Xa = ({ content: e }) => /* @__PURE__ */ d(
|
|
2753
|
+
Zt,
|
|
2758
2754
|
{
|
|
2759
|
-
remarkPlugins: [
|
|
2755
|
+
remarkPlugins: [Qa],
|
|
2760
2756
|
className: "cuadra-aui-md",
|
|
2761
|
-
components:
|
|
2757
|
+
components: ti,
|
|
2762
2758
|
children: e
|
|
2763
2759
|
}
|
|
2764
|
-
),
|
|
2765
|
-
const { isCopied: t, copyToClipboard: n } =
|
|
2766
|
-
return /* @__PURE__ */
|
|
2767
|
-
/* @__PURE__ */
|
|
2768
|
-
/* @__PURE__ */
|
|
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: [
|
|
2763
|
+
/* @__PURE__ */ d("span", { className: "cuadra-lowercase [&>span]:cuadra-text-xs cuadra-font-brand", children: e }),
|
|
2764
|
+
/* @__PURE__ */ v(
|
|
2769
2765
|
"button",
|
|
2770
2766
|
{
|
|
2771
2767
|
onClick: () => {
|
|
@@ -2774,13 +2770,13 @@ const Za = ({ content: e }) => /* @__PURE__ */ h(
|
|
|
2774
2770
|
className: "cuadra-p-1 cuadra-rounded hover:cuadra-bg-muted cuadra-transition-colors",
|
|
2775
2771
|
"aria-label": "Copy code",
|
|
2776
2772
|
children: [
|
|
2777
|
-
!t && /* @__PURE__ */
|
|
2778
|
-
t && /* @__PURE__ */
|
|
2773
|
+
!t && /* @__PURE__ */ d(sr, { className: "cuadra-h-4 cuadra-w-4" }),
|
|
2774
|
+
t && /* @__PURE__ */ d(ar, { className: "cuadra-h-4 cuadra-w-4" })
|
|
2779
2775
|
]
|
|
2780
2776
|
}
|
|
2781
2777
|
)
|
|
2782
2778
|
] });
|
|
2783
|
-
},
|
|
2779
|
+
}, ei = ({
|
|
2784
2780
|
copiedDuration: e = 3e3
|
|
2785
2781
|
} = {}) => {
|
|
2786
2782
|
const [r, t] = N(!1);
|
|
@@ -2789,100 +2785,100 @@ const Za = ({ content: e }) => /* @__PURE__ */ h(
|
|
|
2789
2785
|
t(!0), setTimeout(() => t(!1), e);
|
|
2790
2786
|
});
|
|
2791
2787
|
} };
|
|
2792
|
-
},
|
|
2793
|
-
h1: ({ className: e, ...r }) => /* @__PURE__ */
|
|
2788
|
+
}, ti = Vt({
|
|
2789
|
+
h1: ({ className: e, ...r }) => /* @__PURE__ */ d(
|
|
2794
2790
|
"h1",
|
|
2795
2791
|
{
|
|
2796
|
-
className:
|
|
2792
|
+
className: I("cuadra-mb-6 cuadra-scroll-m-20 cuadra-text-2xl cuadra-font-normal cuadra-tracking-tight last:cuadra-mb-0 font-brand", e),
|
|
2797
2793
|
...r
|
|
2798
2794
|
}
|
|
2799
2795
|
),
|
|
2800
|
-
h2: ({ className: e, ...r }) => /* @__PURE__ */
|
|
2796
|
+
h2: ({ className: e, ...r }) => /* @__PURE__ */ d(
|
|
2801
2797
|
"h2",
|
|
2802
2798
|
{
|
|
2803
|
-
className:
|
|
2799
|
+
className: I(
|
|
2804
2800
|
"cuadra-mb-4 cuadra-mt-6 cuadra-scroll-m-20 cuadra-text-xl cuadra-font-normal cuadra-tracking-tight first:cuadra-mt-0 last:cuadra-mb-0 font-brand",
|
|
2805
2801
|
e
|
|
2806
2802
|
),
|
|
2807
2803
|
...r
|
|
2808
2804
|
}
|
|
2809
2805
|
),
|
|
2810
|
-
h3: ({ className: e, ...r }) => /* @__PURE__ */
|
|
2806
|
+
h3: ({ className: e, ...r }) => /* @__PURE__ */ d(
|
|
2811
2807
|
"h3",
|
|
2812
2808
|
{
|
|
2813
|
-
className:
|
|
2809
|
+
className: I(
|
|
2814
2810
|
"cuadra-mb-3 cuadra-mt-5 cuadra-scroll-m-20 cuadra-text-lg cuadra-font-normal cuadra-tracking-tight first:cuadra-mt-0 last:cuadra-mb-0 font-brand",
|
|
2815
2811
|
e
|
|
2816
2812
|
),
|
|
2817
2813
|
...r
|
|
2818
2814
|
}
|
|
2819
2815
|
),
|
|
2820
|
-
h4: ({ className: e, ...r }) => /* @__PURE__ */
|
|
2816
|
+
h4: ({ className: e, ...r }) => /* @__PURE__ */ d(
|
|
2821
2817
|
"h4",
|
|
2822
2818
|
{
|
|
2823
|
-
className:
|
|
2819
|
+
className: I(
|
|
2824
2820
|
"cuadra-mb-4 cuadra-mt-6 cuadra-scroll-m-20 cuadra-text-xl cuadra-font-normal cuadra-tracking-tight first:cuadra-mt-0 last:cuadra-mb-0 font-brand",
|
|
2825
2821
|
e
|
|
2826
2822
|
),
|
|
2827
2823
|
...r
|
|
2828
2824
|
}
|
|
2829
2825
|
),
|
|
2830
|
-
h5: ({ className: e, ...r }) => /* @__PURE__ */
|
|
2831
|
-
h6: ({ className: e, ...r }) => /* @__PURE__ */
|
|
2832
|
-
p: ({ className: e, ...r }) => /* @__PURE__ */
|
|
2833
|
-
a: ({ className: e, ...r }) => /* @__PURE__ */
|
|
2826
|
+
h5: ({ className: e, ...r }) => /* @__PURE__ */ d("h5", { className: I("cuadra-my-4 cuadra-text-lg cuadra-font-normal first:cuadra-mt-0 last:cuadra-mb-0 font-brand", e), ...r }),
|
|
2827
|
+
h6: ({ className: e, ...r }) => /* @__PURE__ */ d("h6", { className: I("cuadra-my-4 cuadra-font-normal first:cuadra-mb-0 font-brand", e), ...r }),
|
|
2828
|
+
p: ({ className: e, ...r }) => /* @__PURE__ */ d("p", { className: I("cuadra-mb-5 cuadra-mt-5 cuadra-leading-7 first:cuadra-mt-0 last:cuadra-mb-0 font-brand", e), ...r }),
|
|
2829
|
+
a: ({ className: e, ...r }) => /* @__PURE__ */ d(
|
|
2834
2830
|
"a",
|
|
2835
2831
|
{
|
|
2836
|
-
className:
|
|
2832
|
+
className: I("cuadra-text-primary cuadra-font-medium cuadra-underline cuadra-underline-offset-4 font-brand", e),
|
|
2837
2833
|
...r
|
|
2838
2834
|
}
|
|
2839
2835
|
),
|
|
2840
|
-
blockquote: ({ className: e, ...r }) => /* @__PURE__ */
|
|
2841
|
-
ul: ({ className: e, ...r }) => /* @__PURE__ */
|
|
2842
|
-
ol: ({ className: e, ...r }) => /* @__PURE__ */
|
|
2843
|
-
hr: ({ className: e, ...r }) => /* @__PURE__ */
|
|
2844
|
-
table: ({ className: e, ...r }) => /* @__PURE__ */
|
|
2836
|
+
blockquote: ({ className: e, ...r }) => /* @__PURE__ */ d("blockquote", { className: I("cuadra-border-l-2 cuadra-pl-6 cuadra-italic font-brand", e), ...r }),
|
|
2837
|
+
ul: ({ className: e, ...r }) => /* @__PURE__ */ d("ul", { className: I("cuadra-my-5 cuadra-ml-6 cuadra-list-disc [&>li]:cuadra-mt-2 font-brand", e), ...r }),
|
|
2838
|
+
ol: ({ className: e, ...r }) => /* @__PURE__ */ d("ol", { className: I("cuadra-my-5 cuadra-ml-6 cuadra-list-decimal [&>li]:cuadra-mt-2 font-brand", e), ...r }),
|
|
2839
|
+
hr: ({ className: e, ...r }) => /* @__PURE__ */ d("hr", { className: I("cuadra-my-5 cuadra-border-b", e), ...r }),
|
|
2840
|
+
table: ({ className: e, ...r }) => /* @__PURE__ */ d(
|
|
2845
2841
|
"table",
|
|
2846
2842
|
{
|
|
2847
|
-
className:
|
|
2843
|
+
className: I("cuadra-my-5 cuadra-w-full cuadra-border-separate cuadra-border-spacing-0 cuadra-overflow-y-auto font-brand", e),
|
|
2848
2844
|
...r
|
|
2849
2845
|
}
|
|
2850
2846
|
),
|
|
2851
|
-
th: ({ className: e, ...r }) => /* @__PURE__ */
|
|
2847
|
+
th: ({ className: e, ...r }) => /* @__PURE__ */ d(
|
|
2852
2848
|
"th",
|
|
2853
2849
|
{
|
|
2854
|
-
className:
|
|
2850
|
+
className: I(
|
|
2855
2851
|
"cuadra-bg-muted cuadra-px-4 cuadra-py-2 cuadra-text-left cuadra-font-normal first:cuadra-rounded-tl-lg last:cuadra-rounded-tr-lg [&[align=center]]:cuadra-text-center [&[align=right]]:cuadra-text-right font-brand",
|
|
2856
2852
|
e
|
|
2857
2853
|
),
|
|
2858
2854
|
...r
|
|
2859
2855
|
}
|
|
2860
2856
|
),
|
|
2861
|
-
td: ({ className: e, ...r }) => /* @__PURE__ */
|
|
2857
|
+
td: ({ className: e, ...r }) => /* @__PURE__ */ d(
|
|
2862
2858
|
"td",
|
|
2863
2859
|
{
|
|
2864
|
-
className:
|
|
2860
|
+
className: I(
|
|
2865
2861
|
"cuadra-border-b cuadra-border-l cuadra-px-4 cuadra-py-2 cuadra-text-left last:cuadra-border-r [&[align=center]]:cuadra-text-center [&[align=right]]:cuadra-text-right font-brand",
|
|
2866
2862
|
e
|
|
2867
2863
|
),
|
|
2868
2864
|
...r
|
|
2869
2865
|
}
|
|
2870
2866
|
),
|
|
2871
|
-
tr: ({ className: e, ...r }) => /* @__PURE__ */
|
|
2867
|
+
tr: ({ className: e, ...r }) => /* @__PURE__ */ d(
|
|
2872
2868
|
"tr",
|
|
2873
2869
|
{
|
|
2874
|
-
className:
|
|
2870
|
+
className: I(
|
|
2875
2871
|
"cuadra-m-0 cuadra-border-b cuadra-p-0 first:cuadra-border-t [&:last-child>td:first-child]:cuadra-rounded-bl-lg [&:last-child>td:last-child]:cuadra-rounded-br-lg",
|
|
2876
2872
|
e
|
|
2877
2873
|
),
|
|
2878
2874
|
...r
|
|
2879
2875
|
}
|
|
2880
2876
|
),
|
|
2881
|
-
sup: ({ className: e, ...r }) => /* @__PURE__ */
|
|
2882
|
-
pre: ({ className: e, ...r }) => /* @__PURE__ */
|
|
2877
|
+
sup: ({ className: e, ...r }) => /* @__PURE__ */ d("sup", { className: I("[&>a]:cuadra-text-xs [&>a]:cuadra-no-underline font-brand", e), ...r }),
|
|
2878
|
+
pre: ({ className: e, ...r }) => /* @__PURE__ */ d(
|
|
2883
2879
|
"pre",
|
|
2884
2880
|
{
|
|
2885
|
-
className:
|
|
2881
|
+
className: I(
|
|
2886
2882
|
"cuadra-overflow-x-auto cuadra-rounded-b-lg !cuadra-rounded-t-none cuadra-bg-muted cuadra-p-4 cuadra-text-foreground font-brand",
|
|
2887
2883
|
e
|
|
2888
2884
|
),
|
|
@@ -2890,152 +2886,153 @@ const Za = ({ content: e }) => /* @__PURE__ */ h(
|
|
|
2890
2886
|
}
|
|
2891
2887
|
),
|
|
2892
2888
|
code: function({ className: r, ...t }) {
|
|
2893
|
-
const n =
|
|
2894
|
-
return /* @__PURE__ */
|
|
2889
|
+
const n = Gt();
|
|
2890
|
+
return /* @__PURE__ */ d(
|
|
2895
2891
|
"code",
|
|
2896
2892
|
{
|
|
2897
|
-
className:
|
|
2893
|
+
className: I(!n && "cuadra-bg-muted cuadra-rounded cuadra-border cuadra-font-normal font-brand", r),
|
|
2898
2894
|
...t
|
|
2899
2895
|
}
|
|
2900
2896
|
);
|
|
2901
2897
|
},
|
|
2902
|
-
CodeHeader:
|
|
2903
|
-
}),
|
|
2898
|
+
CodeHeader: Ya
|
|
2899
|
+
}), Qe = [
|
|
2904
2900
|
"Sending question…",
|
|
2905
2901
|
"Understanding your need…",
|
|
2906
2902
|
"Scanning data…",
|
|
2907
2903
|
"Comparing results…",
|
|
2908
2904
|
"Composing answer…"
|
|
2909
2905
|
];
|
|
2910
|
-
function
|
|
2906
|
+
function ri({ active: e }) {
|
|
2911
2907
|
const [r, t] = N(0);
|
|
2912
|
-
return
|
|
2908
|
+
return M(() => {
|
|
2913
2909
|
if (!e) {
|
|
2914
2910
|
t(0);
|
|
2915
2911
|
return;
|
|
2916
2912
|
}
|
|
2917
2913
|
const n = window.setInterval(() => {
|
|
2918
|
-
t((i) => i >=
|
|
2914
|
+
t((i) => i >= Qe.length - 1 ? (window.clearInterval(n), i) : i + 1);
|
|
2919
2915
|
}, 2500);
|
|
2920
2916
|
return () => window.clearInterval(n);
|
|
2921
|
-
}, [e]), e ? /* @__PURE__ */
|
|
2917
|
+
}, [e]), e ? /* @__PURE__ */ v("span", { className: "cuadra-text-xs cuadra-text-muted-foreground cuadra-font-brand", children: [
|
|
2922
2918
|
"Thinking… ",
|
|
2923
|
-
|
|
2919
|
+
Qe[r]
|
|
2924
2920
|
] }) : null;
|
|
2925
2921
|
}
|
|
2926
|
-
function
|
|
2922
|
+
function Xe({
|
|
2927
2923
|
welcomeTitle: e = "Hi, how can I help you today?",
|
|
2928
2924
|
welcomeSubtitle: r = "Start exploring our platform and discover what you can build.",
|
|
2929
2925
|
extraTopPadding: t,
|
|
2930
|
-
suggestions: n
|
|
2926
|
+
suggestions: n,
|
|
2927
|
+
inputPlaceholder: i = "Type your message..."
|
|
2931
2928
|
} = {}) {
|
|
2932
|
-
const
|
|
2933
|
-
return
|
|
2934
|
-
if (!
|
|
2935
|
-
|
|
2929
|
+
const o = Wt(), [a, u] = N(!1), [l, s] = N(null), [f, c] = N(!1);
|
|
2930
|
+
return M(() => {
|
|
2931
|
+
if (!o) {
|
|
2932
|
+
u(!1);
|
|
2936
2933
|
return;
|
|
2937
2934
|
}
|
|
2938
2935
|
try {
|
|
2939
|
-
const
|
|
2940
|
-
if (!
|
|
2941
|
-
|
|
2936
|
+
const p = o?.store;
|
|
2937
|
+
if (!p) {
|
|
2938
|
+
u(!1);
|
|
2942
2939
|
return;
|
|
2943
2940
|
}
|
|
2944
|
-
const
|
|
2945
|
-
const
|
|
2946
|
-
|
|
2947
|
-
const
|
|
2948
|
-
(C) => C.role === "assistant" && !!C.content && (Array.isArray(C.content) ? C.content.some((
|
|
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)
|
|
2949
2946
|
);
|
|
2950
|
-
|
|
2951
|
-
}),
|
|
2952
|
-
if (
|
|
2953
|
-
const
|
|
2954
|
-
|
|
2955
|
-
const
|
|
2956
|
-
(
|
|
2947
|
+
c(T);
|
|
2948
|
+
}), h = p.getState?.();
|
|
2949
|
+
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)
|
|
2957
2954
|
);
|
|
2958
|
-
|
|
2955
|
+
c(A);
|
|
2959
2956
|
}
|
|
2960
2957
|
return () => {
|
|
2961
|
-
|
|
2958
|
+
g && g();
|
|
2962
2959
|
};
|
|
2963
2960
|
} catch {
|
|
2964
|
-
|
|
2961
|
+
u(!1);
|
|
2965
2962
|
}
|
|
2966
|
-
}, [
|
|
2967
|
-
/* @__PURE__ */
|
|
2968
|
-
|
|
2963
|
+
}, [o, l]), /* @__PURE__ */ v(ee.Root, { className: "cuadra-bg-inherit cuadra-flex cuadra-flex-col cuadra-w-full cuadra-h-full", children: [
|
|
2964
|
+
/* @__PURE__ */ d(
|
|
2965
|
+
ee.Viewport,
|
|
2969
2966
|
{
|
|
2970
2967
|
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",
|
|
2971
2968
|
style: t ? { paddingTop: t } : void 0,
|
|
2972
|
-
children:
|
|
2973
|
-
/* @__PURE__ */
|
|
2974
|
-
/* @__PURE__ */
|
|
2975
|
-
] }) }) : /* @__PURE__ */
|
|
2976
|
-
/* @__PURE__ */
|
|
2977
|
-
|
|
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" }),
|
|
2971
|
+
/* @__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,
|
|
2978
2975
|
{
|
|
2979
2976
|
title: e,
|
|
2980
2977
|
subtitle: r,
|
|
2981
2978
|
suggestions: n
|
|
2982
2979
|
}
|
|
2983
2980
|
) }),
|
|
2984
|
-
/* @__PURE__ */
|
|
2985
|
-
|
|
2981
|
+
/* @__PURE__ */ d(
|
|
2982
|
+
ee.Messages,
|
|
2986
2983
|
{
|
|
2987
2984
|
components: {
|
|
2988
|
-
UserMessage:
|
|
2989
|
-
AssistantMessage:
|
|
2985
|
+
UserMessage: ai,
|
|
2986
|
+
AssistantMessage: ii
|
|
2990
2987
|
}
|
|
2991
2988
|
}
|
|
2992
2989
|
),
|
|
2993
|
-
/* @__PURE__ */
|
|
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 }) }) })
|
|
2994
2991
|
] })
|
|
2995
2992
|
}
|
|
2996
2993
|
),
|
|
2997
|
-
/* @__PURE__ */
|
|
2998
|
-
/* @__PURE__ */
|
|
2999
|
-
|
|
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: [
|
|
2995
|
+
/* @__PURE__ */ d(
|
|
2996
|
+
ke.Input,
|
|
3000
2997
|
{
|
|
3001
2998
|
asChild: !0,
|
|
3002
|
-
children: /* @__PURE__ */
|
|
2999
|
+
children: /* @__PURE__ */ d(
|
|
3003
3000
|
"textarea",
|
|
3004
3001
|
{
|
|
3005
3002
|
rows: 3,
|
|
3006
|
-
placeholder:
|
|
3003
|
+
placeholder: i,
|
|
3007
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",
|
|
3008
3005
|
style: { paddingRight: "2.5rem", fontSize: "1rem" }
|
|
3009
3006
|
}
|
|
3010
3007
|
)
|
|
3011
3008
|
}
|
|
3012
3009
|
),
|
|
3013
|
-
/* @__PURE__ */
|
|
3010
|
+
/* @__PURE__ */ d(ke.Send, { asChild: !0, children: /* @__PURE__ */ d(
|
|
3014
3011
|
"button",
|
|
3015
3012
|
{
|
|
3016
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",
|
|
3017
3014
|
style: { position: "absolute", bottom: "0.5rem", right: "0.5rem" },
|
|
3018
3015
|
"aria-label": "Send message",
|
|
3019
3016
|
type: "button",
|
|
3020
|
-
children: /* @__PURE__ */
|
|
3017
|
+
children: /* @__PURE__ */ d(rr, { className: "cuadra-h-4 cuadra-w-4" })
|
|
3021
3018
|
}
|
|
3022
3019
|
) })
|
|
3023
3020
|
] }) })
|
|
3024
3021
|
] });
|
|
3025
3022
|
}
|
|
3026
|
-
function
|
|
3027
|
-
const n =
|
|
3023
|
+
function ni({ title: e, subtitle: r, suggestions: t }) {
|
|
3024
|
+
const n = Ht(), i = async (o) => {
|
|
3028
3025
|
try {
|
|
3029
3026
|
n.composer().setText(o), await new Promise((a) => setTimeout(a, 10)), n.composer().send();
|
|
3030
3027
|
} catch {
|
|
3031
3028
|
}
|
|
3032
3029
|
};
|
|
3033
|
-
return /* @__PURE__ */
|
|
3034
|
-
/* @__PURE__ */
|
|
3035
|
-
/* @__PURE__ */
|
|
3036
|
-
/* @__PURE__ */
|
|
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: [
|
|
3032
|
+
/* @__PURE__ */ d("h2", { className: "cuadra-text-lg cuadra-font-normal cuadra-text-foreground cuadra-mb-2 font-brand", children: e }),
|
|
3033
|
+
/* @__PURE__ */ d("p", { className: "cuadra-text-muted-foreground font-brand", children: r })
|
|
3037
3034
|
] }),
|
|
3038
|
-
t && t.length > 0 && /* @__PURE__ */
|
|
3035
|
+
t && t.length > 0 && /* @__PURE__ */ d("div", { className: "cuadra-grid cuadra-grid-cols-2 cuadra-gap-2 cuadra-pb-4 cuadra-w-full cuadra-max-w-2xl", children: t.map((o, a) => /* @__PURE__ */ d(
|
|
3039
3036
|
"button",
|
|
3040
3037
|
{
|
|
3041
3038
|
type: "button",
|
|
@@ -3048,8 +3045,8 @@ function ti({ title: e, subtitle: r, suggestions: t }) {
|
|
|
3048
3045
|
)) })
|
|
3049
3046
|
] }) });
|
|
3050
3047
|
}
|
|
3051
|
-
function
|
|
3052
|
-
return /* @__PURE__ */
|
|
3048
|
+
function ai() {
|
|
3049
|
+
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(
|
|
3053
3050
|
"div",
|
|
3054
3051
|
{
|
|
3055
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",
|
|
@@ -3064,19 +3061,19 @@ function ri() {
|
|
|
3064
3061
|
paddingBottom: "0.625rem",
|
|
3065
3062
|
wordBreak: "break-word"
|
|
3066
3063
|
},
|
|
3067
|
-
children: /* @__PURE__ */
|
|
3068
|
-
|
|
3064
|
+
children: /* @__PURE__ */ d(
|
|
3065
|
+
se.Parts,
|
|
3069
3066
|
{
|
|
3070
3067
|
components: {
|
|
3071
|
-
Text: ({ text: e }) => /* @__PURE__ */
|
|
3068
|
+
Text: ({ text: e }) => /* @__PURE__ */ d(_t, { content: e || "" })
|
|
3072
3069
|
}
|
|
3073
3070
|
}
|
|
3074
3071
|
)
|
|
3075
3072
|
}
|
|
3076
3073
|
) });
|
|
3077
3074
|
}
|
|
3078
|
-
function
|
|
3079
|
-
return /* @__PURE__ */
|
|
3075
|
+
function ii() {
|
|
3076
|
+
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(
|
|
3080
3077
|
"div",
|
|
3081
3078
|
{
|
|
3082
3079
|
className: "cuadra-text-foreground cuadra-col-span-2 cuadra-col-start-2 cuadra-row-start-1 cuadra-my-1.5 cuadra-max-w-[90%] cuadra-break-words cuadra-leading-7 font-brand",
|
|
@@ -3085,49 +3082,49 @@ function ni() {
|
|
|
3085
3082
|
marginTop: "0.375rem",
|
|
3086
3083
|
marginBottom: "0.375rem"
|
|
3087
3084
|
},
|
|
3088
|
-
children: /* @__PURE__ */
|
|
3089
|
-
|
|
3085
|
+
children: /* @__PURE__ */ d(
|
|
3086
|
+
se.Parts,
|
|
3090
3087
|
{
|
|
3091
3088
|
components: {
|
|
3092
|
-
Text: ({ text: e }) => /* @__PURE__ */
|
|
3089
|
+
Text: ({ text: e }) => /* @__PURE__ */ d(_t, { content: e || "" })
|
|
3093
3090
|
}
|
|
3094
3091
|
}
|
|
3095
3092
|
)
|
|
3096
3093
|
}
|
|
3097
3094
|
) });
|
|
3098
3095
|
}
|
|
3099
|
-
function
|
|
3100
|
-
const r =
|
|
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 () => {
|
|
3101
3098
|
if (!r?.remoteId || !s || s === r.title) {
|
|
3102
3099
|
l(!1);
|
|
3103
3100
|
return;
|
|
3104
3101
|
}
|
|
3105
3102
|
try {
|
|
3106
|
-
|
|
3103
|
+
h(!0);
|
|
3107
3104
|
const b = window.__cuadraThreadListAdapter;
|
|
3108
3105
|
b && typeof b.rename == "function" && await b.rename(r.remoteId, s), l(!1), p(!1);
|
|
3109
3106
|
} catch {
|
|
3110
3107
|
l(!1), p(!1);
|
|
3111
3108
|
} finally {
|
|
3112
|
-
|
|
3109
|
+
h(!1);
|
|
3113
3110
|
}
|
|
3114
3111
|
};
|
|
3115
|
-
return
|
|
3112
|
+
return M(() => {
|
|
3116
3113
|
r?.title && !u && f(r.title);
|
|
3117
|
-
}, [r?.title, u]), r ? /* @__PURE__ */
|
|
3118
|
-
|
|
3114
|
+
}, [r?.title, u]), r ? /* @__PURE__ */ d(
|
|
3115
|
+
we.Root,
|
|
3119
3116
|
{
|
|
3120
3117
|
className: `group cuadra-relative cuadra-flex cuadra-items-center cuadra-gap-3 cuadra-rounded-lg cuadra-transition-colors cuadra-cursor-pointer cuadra-border cuadra-mb-2 ${o ? "cuadra-bg-muted cuadra-border-border" : "cuadra-border-transparent hover:cuadra-bg-muted hover:cuadra-border-border"}`,
|
|
3121
3118
|
style: { marginBottom: "0.5rem" },
|
|
3122
3119
|
onMouseEnter: () => i(r.id),
|
|
3123
3120
|
onMouseLeave: () => i(null),
|
|
3124
|
-
children: /* @__PURE__ */
|
|
3125
|
-
|
|
3121
|
+
children: /* @__PURE__ */ v(
|
|
3122
|
+
we.Trigger,
|
|
3126
3123
|
{
|
|
3127
3124
|
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
3125
|
onClick: () => e?.(),
|
|
3129
3126
|
children: [
|
|
3130
|
-
/* @__PURE__ */
|
|
3127
|
+
/* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-flex-col cuadra-min-w-0 cuadra-flex-1 cuadra-items-start cuadra-text-left", children: u ? /* @__PURE__ */ d(
|
|
3131
3128
|
"input",
|
|
3132
3129
|
{
|
|
3133
3130
|
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",
|
|
@@ -3140,12 +3137,12 @@ function ai({ onThreadSelect: e }) {
|
|
|
3140
3137
|
autoFocus: !0,
|
|
3141
3138
|
onClick: (b) => b.stopPropagation()
|
|
3142
3139
|
}
|
|
3143
|
-
) : /* @__PURE__ */
|
|
3144
|
-
/* @__PURE__ */
|
|
3145
|
-
r.updatedAt && /* @__PURE__ */
|
|
3140
|
+
) : /* @__PURE__ */ v(B, { children: [
|
|
3141
|
+
/* @__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
|
+
r.updatedAt && /* @__PURE__ */ d("span", { className: "cuadra-text-xs cuadra-text-muted-foreground cuadra-mt-1 font-brand", children: new Date(r.updatedAt).toLocaleDateString() })
|
|
3146
3143
|
] }) }),
|
|
3147
|
-
/* @__PURE__ */
|
|
3148
|
-
/* @__PURE__ */
|
|
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: [
|
|
3145
|
+
/* @__PURE__ */ d(
|
|
3149
3146
|
"button",
|
|
3150
3147
|
{
|
|
3151
3148
|
className: "cuadra-p-1 cuadra-rounded hover:cuadra-bg-background/50 cuadra-transition-colors",
|
|
@@ -3153,18 +3150,18 @@ function ai({ onThreadSelect: e }) {
|
|
|
3153
3150
|
b.stopPropagation(), p(!c);
|
|
3154
3151
|
},
|
|
3155
3152
|
"aria-label": "Thread options",
|
|
3156
|
-
children: /* @__PURE__ */
|
|
3153
|
+
children: /* @__PURE__ */ d(fr, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-muted-foreground" })
|
|
3157
3154
|
}
|
|
3158
3155
|
),
|
|
3159
|
-
c && /* @__PURE__ */
|
|
3160
|
-
/* @__PURE__ */
|
|
3156
|
+
c && /* @__PURE__ */ v(B, { children: [
|
|
3157
|
+
/* @__PURE__ */ d(
|
|
3161
3158
|
"div",
|
|
3162
3159
|
{
|
|
3163
3160
|
className: "cuadra-fixed cuadra-inset-0 cuadra-z-40",
|
|
3164
3161
|
onClick: () => p(!1)
|
|
3165
3162
|
}
|
|
3166
3163
|
),
|
|
3167
|
-
/* @__PURE__ */
|
|
3164
|
+
/* @__PURE__ */ d("div", { className: "cuadra-absolute cuadra-right-0 cuadra-top-8 cuadra-z-50 cuadra-bg-background cuadra-border cuadra-border-border cuadra-rounded-lg cuadra-shadow-lg cuadra-min-w-[120px] cuadra-overflow-hidden", children: u ? /* @__PURE__ */ d(
|
|
3168
3165
|
"button",
|
|
3169
3166
|
{
|
|
3170
3167
|
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",
|
|
@@ -3174,8 +3171,8 @@ function ai({ onThreadSelect: e }) {
|
|
|
3174
3171
|
disabled: g,
|
|
3175
3172
|
children: "Save"
|
|
3176
3173
|
}
|
|
3177
|
-
) : /* @__PURE__ */
|
|
3178
|
-
/* @__PURE__ */
|
|
3174
|
+
) : /* @__PURE__ */ v(B, { children: [
|
|
3175
|
+
/* @__PURE__ */ d(
|
|
3179
3176
|
"button",
|
|
3180
3177
|
{
|
|
3181
3178
|
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",
|
|
@@ -3185,8 +3182,8 @@ function ai({ onThreadSelect: e }) {
|
|
|
3185
3182
|
children: "Rename"
|
|
3186
3183
|
}
|
|
3187
3184
|
),
|
|
3188
|
-
/* @__PURE__ */
|
|
3189
|
-
/* @__PURE__ */
|
|
3185
|
+
/* @__PURE__ */ d("div", { className: "cuadra-border-t cuadra-border-border" }),
|
|
3186
|
+
/* @__PURE__ */ d(we.Delete, { asChild: !0, children: /* @__PURE__ */ d(
|
|
3190
3187
|
"button",
|
|
3191
3188
|
{
|
|
3192
3189
|
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",
|
|
@@ -3205,38 +3202,38 @@ function ai({ onThreadSelect: e }) {
|
|
|
3205
3202
|
}
|
|
3206
3203
|
) : null;
|
|
3207
3204
|
}
|
|
3208
|
-
function
|
|
3209
|
-
return /* @__PURE__ */
|
|
3210
|
-
/* @__PURE__ */
|
|
3211
|
-
/* @__PURE__ */
|
|
3212
|
-
/* @__PURE__ */
|
|
3213
|
-
|
|
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: [
|
|
3207
|
+
/* @__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: [
|
|
3209
|
+
/* @__PURE__ */ d(
|
|
3210
|
+
xe.New,
|
|
3214
3211
|
{
|
|
3215
3212
|
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",
|
|
3216
3213
|
onClick: () => e?.(),
|
|
3217
|
-
children: /* @__PURE__ */
|
|
3218
|
-
/* @__PURE__ */
|
|
3219
|
-
/* @__PURE__ */
|
|
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" }),
|
|
3216
|
+
/* @__PURE__ */ d("h4", { className: "cuadra-text-sm cuadra-font-normal cuadra-text-foreground font-brand", children: "New Chat" })
|
|
3220
3217
|
] }) })
|
|
3221
3218
|
}
|
|
3222
3219
|
),
|
|
3223
|
-
/* @__PURE__ */
|
|
3224
|
-
/* @__PURE__ */
|
|
3225
|
-
|
|
3220
|
+
/* @__PURE__ */ d("div", { className: "cuadra-my-2 cuadra-border-t cuadra-border-border" }),
|
|
3221
|
+
/* @__PURE__ */ d(
|
|
3222
|
+
xe.Items,
|
|
3226
3223
|
{
|
|
3227
3224
|
components: {
|
|
3228
|
-
ThreadListItem: (r) => /* @__PURE__ */
|
|
3225
|
+
ThreadListItem: (r) => /* @__PURE__ */ d(oi, { ...r, onThreadSelect: e })
|
|
3229
3226
|
}
|
|
3230
3227
|
}
|
|
3231
3228
|
)
|
|
3232
3229
|
] })
|
|
3233
3230
|
] });
|
|
3234
3231
|
}
|
|
3235
|
-
const
|
|
3232
|
+
const li = `
|
|
3236
3233
|
@keyframes rotate {
|
|
3237
3234
|
100% { transform: rotate(1turn); }
|
|
3238
3235
|
}
|
|
3239
|
-
`,
|
|
3236
|
+
`, Ae = ({
|
|
3240
3237
|
children: e,
|
|
3241
3238
|
className: r = "",
|
|
3242
3239
|
paddingX: t = "px-0",
|
|
@@ -3245,15 +3242,15 @@ const ii = `
|
|
|
3245
3242
|
style: o,
|
|
3246
3243
|
contentStyle: a,
|
|
3247
3244
|
rotating: u = !1
|
|
3248
|
-
}) => /* @__PURE__ */
|
|
3249
|
-
/* @__PURE__ */
|
|
3250
|
-
/* @__PURE__ */
|
|
3245
|
+
}) => /* @__PURE__ */ v(B, { children: [
|
|
3246
|
+
/* @__PURE__ */ d("style", { children: li }),
|
|
3247
|
+
/* @__PURE__ */ v(
|
|
3251
3248
|
"div",
|
|
3252
3249
|
{
|
|
3253
3250
|
className: `cuadra-relative cuadra-bg-background md:cuadra-rounded-xl cuadra-overflow-hidden ${r}`,
|
|
3254
3251
|
style: { padding: i, ...o },
|
|
3255
3252
|
children: [
|
|
3256
|
-
/* @__PURE__ */
|
|
3253
|
+
/* @__PURE__ */ d(
|
|
3257
3254
|
"div",
|
|
3258
3255
|
{
|
|
3259
3256
|
className: "cuadra-absolute md:cuadra-rounded-xl",
|
|
@@ -3279,7 +3276,7 @@ const ii = `
|
|
|
3279
3276
|
}
|
|
3280
3277
|
}
|
|
3281
3278
|
),
|
|
3282
|
-
/* @__PURE__ */
|
|
3279
|
+
/* @__PURE__ */ d(
|
|
3283
3280
|
"div",
|
|
3284
3281
|
{
|
|
3285
3282
|
className: `cuadra-relative cuadra-bg-background cuadra-h-full cuadra-z-10 cuadra-flex cuadra-flex-col cuadra-overflow-hidden ${t} ${n}`,
|
|
@@ -3293,7 +3290,7 @@ const ii = `
|
|
|
3293
3290
|
]
|
|
3294
3291
|
}
|
|
3295
3292
|
)
|
|
3296
|
-
] }),
|
|
3293
|
+
] }), ui = ({ className: e = "", theme: r = "system" }) => {
|
|
3297
3294
|
const t = () => {
|
|
3298
3295
|
if (typeof window > "u") return "light";
|
|
3299
3296
|
if (r === "system") {
|
|
@@ -3302,12 +3299,12 @@ const ii = `
|
|
|
3302
3299
|
}
|
|
3303
3300
|
return r;
|
|
3304
3301
|
}, [n, i] = N(t);
|
|
3305
|
-
return
|
|
3302
|
+
return M(() => {
|
|
3306
3303
|
r !== "system" && i(r);
|
|
3307
|
-
}, [r]),
|
|
3304
|
+
}, [r]), M(() => {
|
|
3308
3305
|
const a = document.documentElement;
|
|
3309
3306
|
a.classList.remove("light", "dark"), a.classList.add(n), r === "system" && localStorage.setItem("theme", n);
|
|
3310
|
-
}, [n, r]), /* @__PURE__ */
|
|
3307
|
+
}, [n, r]), /* @__PURE__ */ d(
|
|
3311
3308
|
"button",
|
|
3312
3309
|
{
|
|
3313
3310
|
type: "button",
|
|
@@ -3317,15 +3314,15 @@ const ii = `
|
|
|
3317
3314
|
},
|
|
3318
3315
|
disabled: r !== "system",
|
|
3319
3316
|
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}`,
|
|
3320
|
-
children: /* @__PURE__ */
|
|
3321
|
-
|
|
3317
|
+
children: /* @__PURE__ */ d(
|
|
3318
|
+
ur,
|
|
3322
3319
|
{
|
|
3323
3320
|
className: `cuadra-h-4 cuadra-w-4 cuadra-transition-colors ${n === "dark" ? "cuadra-text-primary" : "cuadra-text-gray-400"}`
|
|
3324
3321
|
}
|
|
3325
3322
|
)
|
|
3326
3323
|
}
|
|
3327
3324
|
);
|
|
3328
|
-
},
|
|
3325
|
+
}, et = ({
|
|
3329
3326
|
currentModel: e,
|
|
3330
3327
|
models: r,
|
|
3331
3328
|
modelsLoading: t,
|
|
@@ -3337,34 +3334,34 @@ const ii = `
|
|
|
3337
3334
|
onMobileMenuClick: l,
|
|
3338
3335
|
showMobileMenuButton: s = !1
|
|
3339
3336
|
}) => {
|
|
3340
|
-
const [f, c] = N(!1), p =
|
|
3341
|
-
|
|
3342
|
-
const
|
|
3337
|
+
const [f, c] = N(!1), p = rt(null);
|
|
3338
|
+
M(() => {
|
|
3339
|
+
const h = (k) => {
|
|
3343
3340
|
p.current && !p.current.contains(k.target) && c(!1);
|
|
3344
3341
|
};
|
|
3345
|
-
return f && document.addEventListener("mousedown",
|
|
3346
|
-
document.removeEventListener("mousedown",
|
|
3342
|
+
return f && document.addEventListener("mousedown", h), () => {
|
|
3343
|
+
document.removeEventListener("mousedown", h);
|
|
3347
3344
|
};
|
|
3348
3345
|
}, [f]);
|
|
3349
|
-
const g = r.find((
|
|
3350
|
-
return /* @__PURE__ */
|
|
3351
|
-
/* @__PURE__ */
|
|
3352
|
-
s && /* @__PURE__ */
|
|
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(
|
|
3353
3350
|
"button",
|
|
3354
3351
|
{
|
|
3355
3352
|
type: "button",
|
|
3356
3353
|
onClick: l,
|
|
3357
3354
|
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",
|
|
3358
3355
|
"aria-label": "Toggle thread list",
|
|
3359
|
-
children: /* @__PURE__ */
|
|
3356
|
+
children: /* @__PURE__ */ d(pr, { className: "cuadra-h-4 cuadra-w-4 cuadra-text-foreground" })
|
|
3360
3357
|
}
|
|
3361
3358
|
),
|
|
3362
|
-
a && /* @__PURE__ */
|
|
3359
|
+
a && /* @__PURE__ */ d("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2", children: /* @__PURE__ */ d(ui, { theme: u }) })
|
|
3363
3360
|
] }),
|
|
3364
|
-
/* @__PURE__ */
|
|
3365
|
-
!o && /* @__PURE__ */
|
|
3366
|
-
o ? null : t ? /* @__PURE__ */
|
|
3367
|
-
/* @__PURE__ */
|
|
3361
|
+
/* @__PURE__ */ v("div", { className: "cuadra-flex cuadra-items-center cuadra-gap-2 md:cuadra-ml-0 cuadra-ml-auto", children: [
|
|
3362
|
+
!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(
|
|
3368
3365
|
"button",
|
|
3369
3366
|
{
|
|
3370
3367
|
type: "button",
|
|
@@ -3372,21 +3369,21 @@ const ii = `
|
|
|
3372
3369
|
disabled: t || r.length === 0 || !!n,
|
|
3373
3370
|
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",
|
|
3374
3371
|
children: [
|
|
3375
|
-
/* @__PURE__ */
|
|
3376
|
-
/* @__PURE__ */
|
|
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" })
|
|
3377
3374
|
]
|
|
3378
3375
|
}
|
|
3379
3376
|
),
|
|
3380
|
-
f && r.length > 0 && /* @__PURE__ */
|
|
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(
|
|
3381
3378
|
"button",
|
|
3382
3379
|
{
|
|
3383
3380
|
type: "button",
|
|
3384
3381
|
onClick: () => {
|
|
3385
|
-
i(
|
|
3382
|
+
i(h.id), c(!1);
|
|
3386
3383
|
},
|
|
3387
|
-
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 ===
|
|
3384
|
+
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"}`,
|
|
3388
3385
|
children: [
|
|
3389
|
-
e ===
|
|
3386
|
+
e === h.id && /* @__PURE__ */ d("span", { className: "cuadra-absolute cuadra-left-2 cuadra-flex cuadra-h-3.5 cuadra-w-3.5 cuadra-items-center cuadra-justify-center", children: /* @__PURE__ */ d(
|
|
3390
3387
|
"svg",
|
|
3391
3388
|
{
|
|
3392
3389
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3394,7 +3391,7 @@ const ii = `
|
|
|
3394
3391
|
height: "16",
|
|
3395
3392
|
fill: "none",
|
|
3396
3393
|
viewBox: "0 0 16 16",
|
|
3397
|
-
children: /* @__PURE__ */
|
|
3394
|
+
children: /* @__PURE__ */ d(
|
|
3398
3395
|
"path",
|
|
3399
3396
|
{
|
|
3400
3397
|
fill: "currentColor",
|
|
@@ -3405,17 +3402,17 @@ const ii = `
|
|
|
3405
3402
|
)
|
|
3406
3403
|
}
|
|
3407
3404
|
) }),
|
|
3408
|
-
/* @__PURE__ */
|
|
3405
|
+
/* @__PURE__ */ d("span", { children: h.name })
|
|
3409
3406
|
]
|
|
3410
3407
|
},
|
|
3411
|
-
|
|
3408
|
+
h.id
|
|
3412
3409
|
)) }) })
|
|
3413
3410
|
] })
|
|
3414
3411
|
] })
|
|
3415
3412
|
] });
|
|
3416
|
-
},
|
|
3417
|
-
function
|
|
3418
|
-
|
|
3413
|
+
}, ci = Ut(void 0), Ie = ({ children: e, value: r }) => /* @__PURE__ */ d(ci.Provider, { value: r, children: e });
|
|
3414
|
+
function si() {
|
|
3415
|
+
M(() => {
|
|
3419
3416
|
if (document.querySelector("style[data-cuadra-uikit]"))
|
|
3420
3417
|
return;
|
|
3421
3418
|
const r = document.createElement("div");
|
|
@@ -3437,8 +3434,8 @@ function ui() {
|
|
|
3437
3434
|
}, document.head.appendChild(n), o) break;
|
|
3438
3435
|
}, []);
|
|
3439
3436
|
}
|
|
3440
|
-
const
|
|
3441
|
-
|
|
3437
|
+
const di = ({ config: e }) => {
|
|
3438
|
+
si();
|
|
3442
3439
|
const {
|
|
3443
3440
|
baseUrl: r,
|
|
3444
3441
|
proxyUrl: t,
|
|
@@ -3453,43 +3450,45 @@ const ci = ({ config: e }) => {
|
|
|
3453
3450
|
welcomeTitle: c,
|
|
3454
3451
|
welcomeSubtitle: p,
|
|
3455
3452
|
extraTopPadding: g,
|
|
3456
|
-
suggestions:
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3453
|
+
suggestions: h,
|
|
3454
|
+
inputPlaceholder: k,
|
|
3455
|
+
showThemeToggle: b = !0,
|
|
3456
|
+
theme: x = "system",
|
|
3457
|
+
onError: w,
|
|
3458
|
+
onChatCreated: y,
|
|
3459
|
+
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);
|
|
3468
3467
|
}, [i]);
|
|
3469
|
-
const K =
|
|
3468
|
+
const K = te(async () => {
|
|
3470
3469
|
if (o === "selector") {
|
|
3471
|
-
|
|
3470
|
+
J(!0), Ee(null);
|
|
3472
3471
|
try {
|
|
3473
|
-
const S = await
|
|
3474
|
-
|
|
3472
|
+
const S = await m.listModels();
|
|
3473
|
+
ie(S);
|
|
3475
3474
|
} catch (S) {
|
|
3476
|
-
|
|
3475
|
+
Ee(S instanceof Error ? S : new Error("Failed to load models"));
|
|
3477
3476
|
} finally {
|
|
3478
|
-
|
|
3477
|
+
J(!1);
|
|
3479
3478
|
}
|
|
3480
3479
|
}
|
|
3481
|
-
}, [
|
|
3482
|
-
|
|
3480
|
+
}, [m, o]);
|
|
3481
|
+
M(() => {
|
|
3483
3482
|
o === "selector" && K();
|
|
3484
|
-
}, [o, K]),
|
|
3483
|
+
}, [o, K]), M(() => (typeof window < "u" && (window.__cuadraUIKitRefetchModels = K), () => {
|
|
3485
3484
|
typeof window < "u" && delete window.__cuadraUIKitRefetchModels;
|
|
3486
3485
|
}), [K]);
|
|
3487
|
-
const [
|
|
3486
|
+
const [_, Fe] = N(
|
|
3488
3487
|
o === "fixed" && a || null
|
|
3489
|
-
),
|
|
3488
|
+
), ze = rt(_), X = te(
|
|
3490
3489
|
(S) => {
|
|
3491
|
-
const Y =
|
|
3492
|
-
|
|
3490
|
+
const Y = ze.current;
|
|
3491
|
+
Fe(S), ze.current = S, u?.(S), Y !== null && Y !== S && i === "multiChat" && setTimeout(() => {
|
|
3493
3492
|
const V = window.__cuadraThreadListRuntime;
|
|
3494
3493
|
if (V?.threads?.switchToNewThread)
|
|
3495
3494
|
try {
|
|
@@ -3510,134 +3509,135 @@ const ci = ({ config: e }) => {
|
|
|
3510
3509
|
},
|
|
3511
3510
|
[u, i]
|
|
3512
3511
|
);
|
|
3513
|
-
|
|
3514
|
-
if (o === "selector" &&
|
|
3515
|
-
const S =
|
|
3512
|
+
M(() => {
|
|
3513
|
+
if (o === "selector" && P?.items && P.items.length > 0 && !_) {
|
|
3514
|
+
const S = P.items[0];
|
|
3516
3515
|
if (S?.id) {
|
|
3517
3516
|
const Y = S.id;
|
|
3518
|
-
|
|
3517
|
+
Fe(Y), u?.(Y);
|
|
3519
3518
|
}
|
|
3520
3519
|
}
|
|
3521
|
-
}, [o,
|
|
3522
|
-
const
|
|
3523
|
-
() => (
|
|
3524
|
-
[
|
|
3525
|
-
),
|
|
3520
|
+
}, [o, P?.items, _, u]);
|
|
3521
|
+
const zt = o === "fixed" ? !!a : !!_, oe = W(
|
|
3522
|
+
() => (P?.items || []).filter((S) => S?.id && S?.displayName).map((S) => ({ id: S.id, name: S.displayName })),
|
|
3523
|
+
[P]
|
|
3524
|
+
), be = W(
|
|
3526
3525
|
() => ({
|
|
3527
|
-
currentModelId:
|
|
3526
|
+
currentModelId: _ || "",
|
|
3528
3527
|
models: oe,
|
|
3529
|
-
modelsLoading:
|
|
3530
|
-
modelsError:
|
|
3531
|
-
onModelChange:
|
|
3528
|
+
modelsLoading: O,
|
|
3529
|
+
modelsError: Q,
|
|
3530
|
+
onModelChange: X,
|
|
3532
3531
|
refetchModels: K
|
|
3533
3532
|
}),
|
|
3534
|
-
[
|
|
3533
|
+
[_, oe, O, Q, X, K]
|
|
3535
3534
|
);
|
|
3536
|
-
return o === "selector" &&
|
|
3537
|
-
|
|
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,
|
|
3538
3537
|
{
|
|
3539
|
-
baseUrl:
|
|
3538
|
+
baseUrl: q ? E : r || E,
|
|
3540
3539
|
sessionToken: n,
|
|
3541
|
-
isProxyMode:
|
|
3542
|
-
tenantId: e.tenantId,
|
|
3540
|
+
isProxyMode: q,
|
|
3543
3541
|
mode: i,
|
|
3544
3542
|
modelMode: o,
|
|
3545
|
-
modelId:
|
|
3546
|
-
onModelChange:
|
|
3543
|
+
modelId: _ || a || void 0,
|
|
3544
|
+
onModelChange: X,
|
|
3547
3545
|
ephemeral: l,
|
|
3548
3546
|
systemPrompt: s,
|
|
3549
3547
|
initialThreadId: f,
|
|
3550
|
-
onError:
|
|
3551
|
-
onChatCreated:
|
|
3552
|
-
|
|
3548
|
+
onError: w,
|
|
3549
|
+
onChatCreated: y,
|
|
3550
|
+
onUserMessage: A,
|
|
3551
|
+
onThreadIdUpdate: T,
|
|
3553
3552
|
onChatsLoaded: () => {
|
|
3554
|
-
i === "multiChat" &&
|
|
3553
|
+
i === "multiChat" && _e(!1);
|
|
3555
3554
|
},
|
|
3556
|
-
children: /* @__PURE__ */
|
|
3557
|
-
|
|
3555
|
+
children: /* @__PURE__ */ d(
|
|
3556
|
+
Ae,
|
|
3558
3557
|
{
|
|
3559
3558
|
paddingX: "cuadra-px-0",
|
|
3560
3559
|
paddingY: "cuadra-py-0",
|
|
3561
3560
|
className: `cuadra-h-full ${e.containerClass || ""}`,
|
|
3562
3561
|
borderSizePx: 4,
|
|
3563
3562
|
style: { height: "100%" },
|
|
3564
|
-
children: /* @__PURE__ */
|
|
3565
|
-
|
|
3566
|
-
/* @__PURE__ */
|
|
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(
|
|
3565
|
+
/* @__PURE__ */ d(
|
|
3567
3566
|
"div",
|
|
3568
3567
|
{
|
|
3569
3568
|
className: "cuadra-fixed cuadra-inset-0 cuadra-bg-black/50 cuadra-z-40 md:cuadra-hidden",
|
|
3570
|
-
onClick: () =>
|
|
3569
|
+
onClick: () => L(!1)
|
|
3571
3570
|
}
|
|
3572
3571
|
),
|
|
3573
3572
|
document.body
|
|
3574
3573
|
),
|
|
3575
|
-
typeof document < "u" && /* @__PURE__ */
|
|
3576
|
-
/* @__PURE__ */
|
|
3574
|
+
typeof document < "u" && /* @__PURE__ */ v(B, { children: [
|
|
3575
|
+
/* @__PURE__ */ d(
|
|
3577
3576
|
"div",
|
|
3578
3577
|
{
|
|
3579
3578
|
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",
|
|
3580
3579
|
style: { borderRightWidth: "1px", height: "100%" },
|
|
3581
|
-
children: /* @__PURE__ */
|
|
3580
|
+
children: /* @__PURE__ */ d(Ye, { onThreadSelect: () => L(!1) })
|
|
3582
3581
|
}
|
|
3583
3582
|
),
|
|
3584
|
-
|
|
3585
|
-
/* @__PURE__ */
|
|
3583
|
+
C && $e(
|
|
3584
|
+
/* @__PURE__ */ d(
|
|
3586
3585
|
"div",
|
|
3587
3586
|
{
|
|
3588
3587
|
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",
|
|
3589
3588
|
style: { borderRightWidth: "1px" },
|
|
3590
|
-
children: /* @__PURE__ */
|
|
3589
|
+
children: /* @__PURE__ */ d(Ye, { onThreadSelect: () => L(!1) })
|
|
3591
3590
|
}
|
|
3592
3591
|
),
|
|
3593
3592
|
document.body
|
|
3594
3593
|
)
|
|
3595
3594
|
] }),
|
|
3596
|
-
/* @__PURE__ */
|
|
3597
|
-
o === "selector" && /* @__PURE__ */
|
|
3598
|
-
|
|
3595
|
+
/* @__PURE__ */ v("div", { className: "cuadra-flex-1 cuadra-flex cuadra-flex-col", children: [
|
|
3596
|
+
o === "selector" && /* @__PURE__ */ d(
|
|
3597
|
+
et,
|
|
3599
3598
|
{
|
|
3600
|
-
currentModel:
|
|
3599
|
+
currentModel: _ || "",
|
|
3601
3600
|
models: oe,
|
|
3602
|
-
modelsLoading:
|
|
3603
|
-
modelsError:
|
|
3604
|
-
onModelChange:
|
|
3605
|
-
showThemeToggle:
|
|
3606
|
-
theme:
|
|
3607
|
-
onMobileMenuClick: () =>
|
|
3601
|
+
modelsLoading: O,
|
|
3602
|
+
modelsError: Q,
|
|
3603
|
+
onModelChange: X,
|
|
3604
|
+
showThemeToggle: b,
|
|
3605
|
+
theme: x,
|
|
3606
|
+
onMobileMenuClick: () => L(!C),
|
|
3608
3607
|
showMobileMenuButton: i === "multiChat"
|
|
3609
3608
|
}
|
|
3610
3609
|
),
|
|
3611
|
-
/* @__PURE__ */
|
|
3612
|
-
|
|
3610
|
+
/* @__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,
|
|
3613
3612
|
{
|
|
3614
3613
|
welcomeTitle: c,
|
|
3615
3614
|
welcomeSubtitle: p,
|
|
3616
3615
|
extraTopPadding: g,
|
|
3617
|
-
suggestions:
|
|
3616
|
+
suggestions: h,
|
|
3617
|
+
inputPlaceholder: k
|
|
3618
3618
|
}
|
|
3619
3619
|
) })
|
|
3620
3620
|
] })
|
|
3621
|
-
] }) : /* @__PURE__ */
|
|
3622
|
-
o === "selector" && /* @__PURE__ */
|
|
3623
|
-
|
|
3621
|
+
] }) : /* @__PURE__ */ v("div", { className: "cuadra-flex-1 cuadra-flex cuadra-flex-col", children: [
|
|
3622
|
+
o === "selector" && /* @__PURE__ */ d(
|
|
3623
|
+
et,
|
|
3624
3624
|
{
|
|
3625
|
-
currentModel:
|
|
3625
|
+
currentModel: _ || "",
|
|
3626
3626
|
models: oe,
|
|
3627
|
-
modelsLoading:
|
|
3628
|
-
modelsError:
|
|
3629
|
-
onModelChange:
|
|
3630
|
-
showThemeToggle:
|
|
3631
|
-
theme:
|
|
3627
|
+
modelsLoading: O,
|
|
3628
|
+
modelsError: Q,
|
|
3629
|
+
onModelChange: X,
|
|
3630
|
+
showThemeToggle: b,
|
|
3631
|
+
theme: x
|
|
3632
3632
|
}
|
|
3633
3633
|
),
|
|
3634
|
-
/* @__PURE__ */
|
|
3635
|
-
|
|
3634
|
+
/* @__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,
|
|
3636
3636
|
{
|
|
3637
3637
|
welcomeTitle: c,
|
|
3638
3638
|
welcomeSubtitle: p,
|
|
3639
3639
|
extraTopPadding: g,
|
|
3640
|
-
suggestions:
|
|
3640
|
+
suggestions: h
|
|
3641
3641
|
}
|
|
3642
3642
|
) })
|
|
3643
3643
|
] }) })
|
|
@@ -3646,12 +3646,11 @@ const ci = ({ config: e }) => {
|
|
|
3646
3646
|
}
|
|
3647
3647
|
) }) });
|
|
3648
3648
|
};
|
|
3649
|
-
function
|
|
3649
|
+
function xi(e) {
|
|
3650
3650
|
const r = {
|
|
3651
3651
|
baseUrl: e.baseUrl,
|
|
3652
3652
|
proxyUrl: e.proxyUrl,
|
|
3653
3653
|
sessionToken: e.sessionToken || null,
|
|
3654
|
-
tenantId: e.tenantId,
|
|
3655
3654
|
mode: e.mode || "multiChat",
|
|
3656
3655
|
modelMode: e.modelMode || "fixed",
|
|
3657
3656
|
modelId: e.modelId,
|
|
@@ -3664,16 +3663,18 @@ function bi(e) {
|
|
|
3664
3663
|
welcomeSubtitle: e.welcomeSubtitle,
|
|
3665
3664
|
extraTopPadding: e.extraTopPadding,
|
|
3666
3665
|
suggestions: e.suggestions,
|
|
3666
|
+
inputPlaceholder: e.inputPlaceholder,
|
|
3667
3667
|
onError: e.onError,
|
|
3668
3668
|
onChatCreated: e.onChatCreated,
|
|
3669
|
+
onUserMessage: e.onUserMessage,
|
|
3669
3670
|
onThreadIdUpdate: e.onThreadIdUpdate,
|
|
3670
3671
|
showThemeToggle: e.showThemeToggle,
|
|
3671
3672
|
theme: e.theme,
|
|
3672
3673
|
containerClass: e.className
|
|
3673
3674
|
};
|
|
3674
|
-
return /* @__PURE__ */
|
|
3675
|
+
return /* @__PURE__ */ d(di, { config: r });
|
|
3675
3676
|
}
|
|
3676
3677
|
export {
|
|
3677
|
-
|
|
3678
|
+
xi as CuadraChat
|
|
3678
3679
|
};
|
|
3679
3680
|
//# sourceMappingURL=index.mjs.map
|