tia-gpc-widget 1.0.7 → 1.0.8
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 +1092 -1092
- package/dist/tia-gpc-widget.standalone.css +1 -1
- package/dist/tia-gpc-widget.standalone.js +5 -5
- package/dist/tia-gpc-widget.standalone.js.map +1 -1
- package/dist/tia-gpc.cjs.js +7 -7
- package/dist/tia-gpc.cjs.js.map +1 -1
- package/dist/tia-gpc.css +1 -1
- package/dist/tia-gpc.es.js +283 -273
- package/dist/tia-gpc.es.js.map +1 -1
- package/package.json +84 -84
package/dist/tia-gpc.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as V, jsx as I, Fragment as Bt } from "react/jsx-runtime";
|
|
2
2
|
import { useState as Q, useRef as Ve, useEffect as xe, useCallback as en, useMemo as zr } from "react";
|
|
3
3
|
import { useTranslation as fe, initReactI18next as Or, I18nextProvider as Rr } from "react-i18next";
|
|
4
4
|
import { MessageCircle as Dr, Moon as Mr, Sun as Fr, Globe as Br, ChevronDown as Ur, MessageSquare as jr, Send as Vr, AlertCircle as Hr } from "lucide-react";
|
|
@@ -7,22 +7,29 @@ import { Turnstile as $r } from "@marsidev/react-turnstile";
|
|
|
7
7
|
import Gr from "axios";
|
|
8
8
|
import nn from "i18next";
|
|
9
9
|
import Wr from "i18next-browser-languagedetector";
|
|
10
|
-
const Kr = ({ onClick: e, unreadCount: n = 0 }) => {
|
|
11
|
-
const { t } = fe();
|
|
12
|
-
return /* @__PURE__ */
|
|
10
|
+
const Kr = ({ onClick: e, unreadCount: n = 0, widgetConfig: t }) => {
|
|
11
|
+
const { t: r } = fe(), i = t?.company_name || r("widget.title");
|
|
12
|
+
return /* @__PURE__ */ V(
|
|
13
13
|
"button",
|
|
14
14
|
{
|
|
15
15
|
onClick: e,
|
|
16
|
-
className: "gpc-floating-button gpc-animate-fade-in",
|
|
17
|
-
"aria-label":
|
|
18
|
-
title:
|
|
16
|
+
className: "gpc-floating-button gpc-floating-button-with-text gpc-animate-fade-in",
|
|
17
|
+
"aria-label": r("chat.title"),
|
|
18
|
+
title: r("chat.title"),
|
|
19
19
|
children: [
|
|
20
|
-
/* @__PURE__ */
|
|
20
|
+
/* @__PURE__ */ V("div", { className: "gpc-floating-content", children: [
|
|
21
|
+
/* @__PURE__ */ I(Dr, { className: "gpc-floating-icon" }),
|
|
22
|
+
/* @__PURE__ */ V("span", { className: "gpc-floating-text", children: [
|
|
23
|
+
r("widget.questionsTo"),
|
|
24
|
+
" ",
|
|
25
|
+
i
|
|
26
|
+
] })
|
|
27
|
+
] }),
|
|
21
28
|
n > 0 && /* @__PURE__ */ I("span", { className: "gpc-notification-badge", children: n > 9 ? "9+" : n })
|
|
22
29
|
]
|
|
23
30
|
}
|
|
24
31
|
);
|
|
25
|
-
},
|
|
32
|
+
}, Xr = ({ theme: e, onToggle: n }) => {
|
|
26
33
|
const { t } = fe();
|
|
27
34
|
return /* @__PURE__ */ I(
|
|
28
35
|
"button",
|
|
@@ -38,7 +45,7 @@ const Kr = ({ onClick: e, unreadCount: n = 0 }) => {
|
|
|
38
45
|
{ code: "en", label: "English", flag: "🇬🇧" },
|
|
39
46
|
{ code: "es", label: "Español", flag: "🇪🇸" },
|
|
40
47
|
{ code: "fr", label: "Français", flag: "🇫🇷" }
|
|
41
|
-
],
|
|
48
|
+
], Yr = () => {
|
|
42
49
|
const { i18n: e } = fe(), [n, t] = Q(!1), r = Ve(null), i = un.find((o) => o.code === e.language) || un[0], l = (o) => {
|
|
43
50
|
e.changeLanguage(o), t(!1);
|
|
44
51
|
};
|
|
@@ -49,7 +56,7 @@ const Kr = ({ onClick: e, unreadCount: n = 0 }) => {
|
|
|
49
56
|
return n && document.addEventListener("mousedown", o), () => {
|
|
50
57
|
document.removeEventListener("mousedown", o);
|
|
51
58
|
};
|
|
52
|
-
}, [n]), /* @__PURE__ */
|
|
59
|
+
}, [n]), /* @__PURE__ */ V("div", { className: "gpc-language-selector", ref: r, children: [
|
|
53
60
|
/* @__PURE__ */ I(
|
|
54
61
|
"button",
|
|
55
62
|
{
|
|
@@ -60,7 +67,7 @@ const Kr = ({ onClick: e, unreadCount: n = 0 }) => {
|
|
|
60
67
|
children: /* @__PURE__ */ I(Br, { className: "gpc-icon" })
|
|
61
68
|
}
|
|
62
69
|
),
|
|
63
|
-
n && /* @__PURE__ */ I("div", { className: "gpc-language-dropdown", children: un.map((o) => /* @__PURE__ */
|
|
70
|
+
n && /* @__PURE__ */ I("div", { className: "gpc-language-dropdown", children: un.map((o) => /* @__PURE__ */ V(
|
|
64
71
|
"button",
|
|
65
72
|
{
|
|
66
73
|
onClick: () => l(o.code),
|
|
@@ -81,14 +88,14 @@ const Kr = ({ onClick: e, unreadCount: n = 0 }) => {
|
|
|
81
88
|
widgetConfig: i = null
|
|
82
89
|
}) => {
|
|
83
90
|
const { t: l } = fe(), o = i?.company_name || l("widget.title"), a = i?.company_logo_base64, c = a?.startsWith("data:") ? a : a ? `data:image/png;base64,${a}` : null;
|
|
84
|
-
return /* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */
|
|
91
|
+
return /* @__PURE__ */ V("div", { className: "gpc-chat-header", children: [
|
|
92
|
+
/* @__PURE__ */ V("div", { className: "gpc-header-content", children: [
|
|
86
93
|
c && /* @__PURE__ */ I("div", { className: "gpc-header-logo", children: /* @__PURE__ */ I("img", { src: c, alt: o, className: "gpc-company-logo" }) }),
|
|
87
94
|
/* @__PURE__ */ I("div", { className: "gpc-header-text", children: /* @__PURE__ */ I("h2", { className: "gpc-header-title", children: o }) })
|
|
88
95
|
] }),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
/* @__PURE__ */ I(
|
|
91
|
-
/* @__PURE__ */ I(
|
|
96
|
+
/* @__PURE__ */ V("div", { className: "gpc-header-actions", children: [
|
|
97
|
+
/* @__PURE__ */ I(Yr, {}),
|
|
98
|
+
/* @__PURE__ */ I(Xr, { theme: n, onToggle: t }),
|
|
92
99
|
/* @__PURE__ */ I(
|
|
93
100
|
"button",
|
|
94
101
|
{
|
|
@@ -1288,77 +1295,77 @@ function di(e) {
|
|
|
1288
1295
|
function Wt(e) {
|
|
1289
1296
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1290
1297
|
}
|
|
1291
|
-
var
|
|
1298
|
+
var Ae = {}, pn, it;
|
|
1292
1299
|
function mi() {
|
|
1293
1300
|
if (it) return pn;
|
|
1294
1301
|
it = 1;
|
|
1295
1302
|
var e = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g, n = /\n/g, t = /^\s*/, r = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/, i = /^:\s*/, l = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/, o = /^[;\s]*/, a = /^\s+|\s+$/g, c = `
|
|
1296
1303
|
`, s = "/", u = "*", h = "", f = "comment", p = "declaration";
|
|
1297
|
-
pn = function(b,
|
|
1304
|
+
pn = function(b, P) {
|
|
1298
1305
|
if (typeof b != "string")
|
|
1299
1306
|
throw new TypeError("First argument must be a string");
|
|
1300
1307
|
if (!b) return [];
|
|
1301
|
-
|
|
1308
|
+
P = P || {};
|
|
1302
1309
|
var y = 1, E = 1;
|
|
1303
1310
|
function k(v) {
|
|
1304
|
-
var
|
|
1305
|
-
|
|
1311
|
+
var A = v.match(n);
|
|
1312
|
+
A && (y += A.length);
|
|
1306
1313
|
var L = v.lastIndexOf(c);
|
|
1307
1314
|
E = ~L ? v.length - L : E + v.length;
|
|
1308
1315
|
}
|
|
1309
1316
|
function D() {
|
|
1310
1317
|
var v = { line: y, column: E };
|
|
1311
|
-
return function(
|
|
1312
|
-
return
|
|
1318
|
+
return function(A) {
|
|
1319
|
+
return A.position = new M(v), H(), A;
|
|
1313
1320
|
};
|
|
1314
1321
|
}
|
|
1315
1322
|
function M(v) {
|
|
1316
|
-
this.start = v, this.end = { line: y, column: E }, this.source =
|
|
1323
|
+
this.start = v, this.end = { line: y, column: E }, this.source = P.source;
|
|
1317
1324
|
}
|
|
1318
1325
|
M.prototype.content = b;
|
|
1319
1326
|
function x(v) {
|
|
1320
|
-
var
|
|
1321
|
-
|
|
1327
|
+
var A = new Error(
|
|
1328
|
+
P.source + ":" + y + ":" + E + ": " + v
|
|
1322
1329
|
);
|
|
1323
|
-
if (
|
|
1330
|
+
if (A.reason = v, A.filename = P.source, A.line = y, A.column = E, A.source = b, !P.silent) throw A;
|
|
1324
1331
|
}
|
|
1325
1332
|
function O(v) {
|
|
1326
|
-
var
|
|
1327
|
-
if (
|
|
1328
|
-
var L =
|
|
1329
|
-
return k(L), b = b.slice(L.length),
|
|
1333
|
+
var A = v.exec(b);
|
|
1334
|
+
if (A) {
|
|
1335
|
+
var L = A[0];
|
|
1336
|
+
return k(L), b = b.slice(L.length), A;
|
|
1330
1337
|
}
|
|
1331
1338
|
}
|
|
1332
|
-
function
|
|
1339
|
+
function H() {
|
|
1333
1340
|
O(t);
|
|
1334
1341
|
}
|
|
1335
1342
|
function B(v) {
|
|
1336
|
-
var
|
|
1337
|
-
for (v = v || [];
|
|
1338
|
-
|
|
1343
|
+
var A;
|
|
1344
|
+
for (v = v || []; A = j(); )
|
|
1345
|
+
A !== !1 && v.push(A);
|
|
1339
1346
|
return v;
|
|
1340
1347
|
}
|
|
1341
1348
|
function j() {
|
|
1342
1349
|
var v = D();
|
|
1343
1350
|
if (!(s != b.charAt(0) || u != b.charAt(1))) {
|
|
1344
|
-
for (var
|
|
1345
|
-
++
|
|
1346
|
-
if (
|
|
1351
|
+
for (var A = 2; h != b.charAt(A) && (u != b.charAt(A) || s != b.charAt(A + 1)); )
|
|
1352
|
+
++A;
|
|
1353
|
+
if (A += 2, h === b.charAt(A - 1))
|
|
1347
1354
|
return x("End of comment missing");
|
|
1348
|
-
var L = b.slice(2,
|
|
1349
|
-
return E += 2, k(L), b = b.slice(
|
|
1355
|
+
var L = b.slice(2, A - 2);
|
|
1356
|
+
return E += 2, k(L), b = b.slice(A), E += 2, v({
|
|
1350
1357
|
type: f,
|
|
1351
1358
|
comment: L
|
|
1352
1359
|
});
|
|
1353
1360
|
}
|
|
1354
1361
|
}
|
|
1355
1362
|
function N() {
|
|
1356
|
-
var v = D(),
|
|
1357
|
-
if (
|
|
1363
|
+
var v = D(), A = O(r);
|
|
1364
|
+
if (A) {
|
|
1358
1365
|
if (j(), !O(i)) return x("property missing ':'");
|
|
1359
1366
|
var L = O(l), K = v({
|
|
1360
1367
|
type: p,
|
|
1361
|
-
property: w(
|
|
1368
|
+
property: w(A[0].replace(e, h)),
|
|
1362
1369
|
value: L ? w(L[0].replace(e, h)) : h
|
|
1363
1370
|
});
|
|
1364
1371
|
return O(o), K;
|
|
@@ -1367,11 +1374,11 @@ function mi() {
|
|
|
1367
1374
|
function T() {
|
|
1368
1375
|
var v = [];
|
|
1369
1376
|
B(v);
|
|
1370
|
-
for (var
|
|
1371
|
-
|
|
1377
|
+
for (var A; A = N(); )
|
|
1378
|
+
A !== !1 && (v.push(A), B(v));
|
|
1372
1379
|
return v;
|
|
1373
1380
|
}
|
|
1374
|
-
return
|
|
1381
|
+
return H(), T();
|
|
1375
1382
|
};
|
|
1376
1383
|
function w(b) {
|
|
1377
1384
|
return b ? b.replace(a, h) : h;
|
|
@@ -1380,12 +1387,12 @@ function mi() {
|
|
|
1380
1387
|
}
|
|
1381
1388
|
var lt;
|
|
1382
1389
|
function gi() {
|
|
1383
|
-
if (lt) return
|
|
1390
|
+
if (lt) return Ae;
|
|
1384
1391
|
lt = 1;
|
|
1385
|
-
var e =
|
|
1392
|
+
var e = Ae && Ae.__importDefault || function(r) {
|
|
1386
1393
|
return r && r.__esModule ? r : { default: r };
|
|
1387
1394
|
};
|
|
1388
|
-
Object.defineProperty(
|
|
1395
|
+
Object.defineProperty(Ae, "__esModule", { value: !0 }), Ae.default = t;
|
|
1389
1396
|
const n = e(mi());
|
|
1390
1397
|
function t(r, i) {
|
|
1391
1398
|
let l = null;
|
|
@@ -1399,7 +1406,7 @@ function gi() {
|
|
|
1399
1406
|
a ? i(s, u, c) : u && (l = l || {}, l[s] = u);
|
|
1400
1407
|
}), l;
|
|
1401
1408
|
}
|
|
1402
|
-
return
|
|
1409
|
+
return Ae;
|
|
1403
1410
|
}
|
|
1404
1411
|
var Fe = {}, ot;
|
|
1405
1412
|
function yi() {
|
|
@@ -1432,8 +1439,8 @@ function xi() {
|
|
|
1432
1439
|
return r.default = r, Be = r, Be;
|
|
1433
1440
|
}
|
|
1434
1441
|
var ki = xi();
|
|
1435
|
-
const bi = /* @__PURE__ */ Wt(ki), Kt =
|
|
1436
|
-
function
|
|
1442
|
+
const bi = /* @__PURE__ */ Wt(ki), Kt = Xt("end"), Dn = Xt("start");
|
|
1443
|
+
function Xt(e) {
|
|
1437
1444
|
return n;
|
|
1438
1445
|
function n(t) {
|
|
1439
1446
|
const r = t && t.position && t.position[e] || {};
|
|
@@ -1549,7 +1556,7 @@ J.prototype.fatal = void 0;
|
|
|
1549
1556
|
J.prototype.place = void 0;
|
|
1550
1557
|
J.prototype.ruleId = void 0;
|
|
1551
1558
|
J.prototype.source = void 0;
|
|
1552
|
-
const Mn = {}.hasOwnProperty, Si = /* @__PURE__ */ new Map(), Ci = /[A-Z]/g, Ei = /* @__PURE__ */ new Set(["table", "tbody", "thead", "tfoot", "tr"]), Ti = /* @__PURE__ */ new Set(["td", "th"]),
|
|
1559
|
+
const Mn = {}.hasOwnProperty, Si = /* @__PURE__ */ new Map(), Ci = /[A-Z]/g, Ei = /* @__PURE__ */ new Set(["table", "tbody", "thead", "tfoot", "tr"]), Ti = /* @__PURE__ */ new Set(["td", "th"]), Yt = "https://github.com/syntax-tree/hast-util-to-jsx-runtime";
|
|
1553
1560
|
function Ii(e, n) {
|
|
1554
1561
|
if (!n || n.Fragment === void 0)
|
|
1555
1562
|
throw new TypeError("Expected `Fragment` in options");
|
|
@@ -1594,11 +1601,11 @@ function Jt(e, n, t) {
|
|
|
1594
1601
|
if (n.type === "element")
|
|
1595
1602
|
return vi(e, n, t);
|
|
1596
1603
|
if (n.type === "mdxFlowExpression" || n.type === "mdxTextExpression")
|
|
1597
|
-
return
|
|
1604
|
+
return Pi(e, n);
|
|
1598
1605
|
if (n.type === "mdxJsxFlowElement" || n.type === "mdxJsxTextElement")
|
|
1599
1606
|
return Ni(e, n, t);
|
|
1600
1607
|
if (n.type === "mdxjsEsm")
|
|
1601
|
-
return
|
|
1608
|
+
return Ai(e, n);
|
|
1602
1609
|
if (n.type === "root")
|
|
1603
1610
|
return _i(e, n, t);
|
|
1604
1611
|
if (n.type === "text")
|
|
@@ -1614,7 +1621,7 @@ function vi(e, n, t) {
|
|
|
1614
1621
|
return typeof c == "string" ? !ri(c) : !0;
|
|
1615
1622
|
})), Qt(e, o, l, n), Fn(o, a), e.ancestors.pop(), e.schema = r, e.create(n, l, o, t);
|
|
1616
1623
|
}
|
|
1617
|
-
function
|
|
1624
|
+
function Pi(e, n) {
|
|
1618
1625
|
if (n.data && n.data.estree && e.evaluater) {
|
|
1619
1626
|
const r = n.data.estree.body[0];
|
|
1620
1627
|
return r.type, /** @type {Child | undefined} */
|
|
@@ -1622,7 +1629,7 @@ function Ai(e, n) {
|
|
|
1622
1629
|
}
|
|
1623
1630
|
Ge(e, n.position);
|
|
1624
1631
|
}
|
|
1625
|
-
function
|
|
1632
|
+
function Ai(e, n) {
|
|
1626
1633
|
if (n.data && n.data.estree && e.evaluater)
|
|
1627
1634
|
return (
|
|
1628
1635
|
/** @type {Child | undefined} */
|
|
@@ -1777,7 +1784,7 @@ function Fi(e, n) {
|
|
|
1777
1784
|
ruleId: "style",
|
|
1778
1785
|
source: "hast-util-to-jsx-runtime"
|
|
1779
1786
|
});
|
|
1780
|
-
throw i.file = e.filePath || void 0, i.url =
|
|
1787
|
+
throw i.file = e.filePath || void 0, i.url = Yt + "#cannot-parse-style-attribute", i;
|
|
1781
1788
|
}
|
|
1782
1789
|
}
|
|
1783
1790
|
function Zt(e, n, t) {
|
|
@@ -1821,7 +1828,7 @@ function Ge(e, n) {
|
|
|
1821
1828
|
source: "hast-util-to-jsx-runtime"
|
|
1822
1829
|
}
|
|
1823
1830
|
);
|
|
1824
|
-
throw t.file = e.filePath || void 0, t.url =
|
|
1831
|
+
throw t.file = e.filePath || void 0, t.url = Yt + "#cannot-handle-mdx-estrees-without-createevaluater", t;
|
|
1825
1832
|
}
|
|
1826
1833
|
function Bi(e) {
|
|
1827
1834
|
const n = {};
|
|
@@ -1957,14 +1964,14 @@ function Le(e) {
|
|
|
1957
1964
|
return e.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
|
|
1958
1965
|
}
|
|
1959
1966
|
const pe = Se(/[A-Za-z]/), ie = Se(/[\dA-Za-z]/), Ki = Se(/[#-'*+\--9=?A-Z^-~]/);
|
|
1960
|
-
function
|
|
1967
|
+
function Pn(e) {
|
|
1961
1968
|
return (
|
|
1962
1969
|
// Special whitespace codes (which have negative values), C0 and Control
|
|
1963
1970
|
// character DEL
|
|
1964
1971
|
e !== null && (e < 32 || e === 127)
|
|
1965
1972
|
);
|
|
1966
1973
|
}
|
|
1967
|
-
const
|
|
1974
|
+
const An = Se(/\d/), Xi = Se(/[\dA-Fa-f]/), Yi = Se(/[!-/:-@[-`{-~]/);
|
|
1968
1975
|
function _(e) {
|
|
1969
1976
|
return e !== null && e < -2;
|
|
1970
1977
|
}
|
|
@@ -2114,12 +2121,12 @@ function tl(e) {
|
|
|
2114
2121
|
}
|
|
2115
2122
|
function b(k) {
|
|
2116
2123
|
if (k === null) {
|
|
2117
|
-
|
|
2124
|
+
P(e.exit("chunkFlow"), !0), y(0), e.consume(k);
|
|
2118
2125
|
return;
|
|
2119
2126
|
}
|
|
2120
|
-
return _(k) ? (e.consume(k),
|
|
2127
|
+
return _(k) ? (e.consume(k), P(e.exit("chunkFlow")), r = 0, n.interrupt = void 0, a) : (e.consume(k), b);
|
|
2121
2128
|
}
|
|
2122
|
-
function
|
|
2129
|
+
function P(k, D) {
|
|
2123
2130
|
const M = n.sliceStream(k);
|
|
2124
2131
|
if (D && M.push(null), k.previous = l, l && (l.next = k), l = k, i.defineSkip(k.start), i.write(M), n.parser.lazy[k.start.line]) {
|
|
2125
2132
|
let x = i.events.length;
|
|
@@ -2132,11 +2139,11 @@ function tl(e) {
|
|
|
2132
2139
|
)
|
|
2133
2140
|
return;
|
|
2134
2141
|
const O = n.events.length;
|
|
2135
|
-
let
|
|
2136
|
-
for (;
|
|
2137
|
-
if (n.events[
|
|
2142
|
+
let H = O, B, j;
|
|
2143
|
+
for (; H--; )
|
|
2144
|
+
if (n.events[H][0] === "exit" && n.events[H][1].type === "chunkFlow") {
|
|
2138
2145
|
if (B) {
|
|
2139
|
-
j = n.events[
|
|
2146
|
+
j = n.events[H][1].end;
|
|
2140
2147
|
break;
|
|
2141
2148
|
}
|
|
2142
2149
|
B = !0;
|
|
@@ -2145,7 +2152,7 @@ function tl(e) {
|
|
|
2145
2152
|
n.events[x][1].end = {
|
|
2146
2153
|
...j
|
|
2147
2154
|
}, x++;
|
|
2148
|
-
he(n.events,
|
|
2155
|
+
he(n.events, H + 1, 0, n.events.slice(O)), n.events.length = x;
|
|
2149
2156
|
}
|
|
2150
2157
|
}
|
|
2151
2158
|
function y(k) {
|
|
@@ -2275,7 +2282,7 @@ function al(e, n, t) {
|
|
|
2275
2282
|
return p === 58 ? (e.consume(p), r = 0, c) : (p === 43 || p === 45 || p === 46 || ie(p)) && r++ < 32 ? (e.consume(p), a) : (r = 0, s(p));
|
|
2276
2283
|
}
|
|
2277
2284
|
function c(p) {
|
|
2278
|
-
return p === 62 ? (e.exit("autolinkProtocol"), e.enter("autolinkMarker"), e.consume(p), e.exit("autolinkMarker"), e.exit("autolink"), n) : p === null || p === 32 || p === 60 ||
|
|
2285
|
+
return p === 62 ? (e.exit("autolinkProtocol"), e.enter("autolinkMarker"), e.consume(p), e.exit("autolinkMarker"), e.exit("autolink"), n) : p === null || p === 32 || p === 60 || Pn(p) ? t(p) : (e.consume(p), c);
|
|
2279
2286
|
}
|
|
2280
2287
|
function s(p) {
|
|
2281
2288
|
return p === 64 ? (e.consume(p), u) : Ki(p) ? (e.consume(p), s) : t(p);
|
|
@@ -2354,7 +2361,7 @@ function hl(e, n, t) {
|
|
|
2354
2361
|
return e.enter("characterEscape"), e.enter("escapeMarker"), e.consume(l), e.exit("escapeMarker"), i;
|
|
2355
2362
|
}
|
|
2356
2363
|
function i(l) {
|
|
2357
|
-
return
|
|
2364
|
+
return Yi(l) ? (e.enter("characterEscapeValue"), e.consume(l), e.exit("characterEscapeValue"), e.exit("characterEscape"), n) : t(l);
|
|
2358
2365
|
}
|
|
2359
2366
|
}
|
|
2360
2367
|
const ir = {
|
|
@@ -2372,7 +2379,7 @@ function fl(e, n, t) {
|
|
|
2372
2379
|
return h === 35 ? (e.enter("characterReferenceMarkerNumeric"), e.consume(h), e.exit("characterReferenceMarkerNumeric"), s) : (e.enter("characterReferenceValue"), l = 31, o = ie, u(h));
|
|
2373
2380
|
}
|
|
2374
2381
|
function s(h) {
|
|
2375
|
-
return h === 88 || h === 120 ? (e.enter("characterReferenceMarkerHexadecimal"), e.consume(h), e.exit("characterReferenceMarkerHexadecimal"), e.enter("characterReferenceValue"), l = 6, o =
|
|
2382
|
+
return h === 88 || h === 120 ? (e.enter("characterReferenceMarkerHexadecimal"), e.consume(h), e.exit("characterReferenceMarkerHexadecimal"), e.enter("characterReferenceValue"), l = 6, o = Xi, u) : (e.enter("characterReferenceValue"), l = 7, o = An, u(h));
|
|
2376
2383
|
}
|
|
2377
2384
|
function u(h) {
|
|
2378
2385
|
if (h === 59 && i) {
|
|
@@ -2424,9 +2431,9 @@ function dl(e, n, t) {
|
|
|
2424
2431
|
return x === null || _(x) ? (e.exit("chunkString"), e.exit("codeFencedFenceMeta"), h(x)) : x === 96 && x === a ? t(x) : (e.consume(x), w);
|
|
2425
2432
|
}
|
|
2426
2433
|
function b(x) {
|
|
2427
|
-
return e.attempt(i, D,
|
|
2434
|
+
return e.attempt(i, D, P)(x);
|
|
2428
2435
|
}
|
|
2429
|
-
function
|
|
2436
|
+
function P(x) {
|
|
2430
2437
|
return e.enter("lineEnding"), e.consume(x), e.exit("lineEnding"), y;
|
|
2431
2438
|
}
|
|
2432
2439
|
function y(x) {
|
|
@@ -2441,7 +2448,7 @@ function dl(e, n, t) {
|
|
|
2441
2448
|
function D(x) {
|
|
2442
2449
|
return e.exit("codeFenced"), n(x);
|
|
2443
2450
|
}
|
|
2444
|
-
function M(x, O,
|
|
2451
|
+
function M(x, O, H) {
|
|
2445
2452
|
let B = 0;
|
|
2446
2453
|
return j;
|
|
2447
2454
|
function j(L) {
|
|
@@ -2451,13 +2458,13 @@ function dl(e, n, t) {
|
|
|
2451
2458
|
return x.enter("codeFencedFence"), U(L) ? G(x, T, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(L) : T(L);
|
|
2452
2459
|
}
|
|
2453
2460
|
function T(L) {
|
|
2454
|
-
return L === a ? (x.enter("codeFencedFenceSequence"), v(L)) :
|
|
2461
|
+
return L === a ? (x.enter("codeFencedFenceSequence"), v(L)) : H(L);
|
|
2455
2462
|
}
|
|
2456
2463
|
function v(L) {
|
|
2457
|
-
return L === a ? (B++, x.consume(L), v) : B >= o ? (x.exit("codeFencedFenceSequence"), U(L) ? G(x,
|
|
2464
|
+
return L === a ? (B++, x.consume(L), v) : B >= o ? (x.exit("codeFencedFenceSequence"), U(L) ? G(x, A, "whitespace")(L) : A(L)) : H(L);
|
|
2458
2465
|
}
|
|
2459
|
-
function
|
|
2460
|
-
return L === null || _(L) ? (x.exit("codeFencedFence"), O(L)) :
|
|
2466
|
+
function A(L) {
|
|
2467
|
+
return L === null || _(L) ? (x.exit("codeFencedFence"), O(L)) : H(L);
|
|
2461
2468
|
}
|
|
2462
2469
|
}
|
|
2463
2470
|
}
|
|
@@ -2754,7 +2761,7 @@ function El(e, n) {
|
|
|
2754
2761
|
o || (o = r.parser[t.contentType](t.start), t._contentTypeTextTrailing && (o._contentTypeTextTrailing = !0));
|
|
2755
2762
|
const a = o.events, c = [], s = {};
|
|
2756
2763
|
let u, h, f = -1, p = t, w = 0, b = 0;
|
|
2757
|
-
const
|
|
2764
|
+
const P = [b];
|
|
2758
2765
|
for (; p; ) {
|
|
2759
2766
|
for (; e.get(++i)[1] !== p; )
|
|
2760
2767
|
;
|
|
@@ -2762,9 +2769,9 @@ function El(e, n) {
|
|
|
2762
2769
|
}
|
|
2763
2770
|
for (p = t; ++f < a.length; )
|
|
2764
2771
|
// Find a void token that includes a break.
|
|
2765
|
-
a[f][0] === "exit" && a[f - 1][0] === "enter" && a[f][1].type === a[f - 1][1].type && a[f][1].start.line !== a[f][1].end.line && (b = f + 1,
|
|
2766
|
-
for (o.events = [], p ? (p._tokenizer = void 0, p.previous = void 0) :
|
|
2767
|
-
const y = a.slice(
|
|
2772
|
+
a[f][0] === "exit" && a[f - 1][0] === "enter" && a[f][1].type === a[f - 1][1].type && a[f][1].start.line !== a[f][1].end.line && (b = f + 1, P.push(b), p._tokenizer = void 0, p.previous = void 0, p = p.next);
|
|
2773
|
+
for (o.events = [], p ? (p._tokenizer = void 0, p.previous = void 0) : P.pop(), f = P.length; f--; ) {
|
|
2774
|
+
const y = a.slice(P[f], P[f + 1]), E = l.pop();
|
|
2768
2775
|
c.push([E, E + y.length - 1]), e.splice(E, 2, y);
|
|
2769
2776
|
}
|
|
2770
2777
|
for (c.reverse(), f = -1; ++f < c.length; )
|
|
@@ -2773,15 +2780,15 @@ function El(e, n) {
|
|
|
2773
2780
|
}
|
|
2774
2781
|
const Tl = {
|
|
2775
2782
|
resolve: vl,
|
|
2776
|
-
tokenize:
|
|
2783
|
+
tokenize: Pl
|
|
2777
2784
|
}, Il = {
|
|
2778
2785
|
partial: !0,
|
|
2779
|
-
tokenize:
|
|
2786
|
+
tokenize: Al
|
|
2780
2787
|
};
|
|
2781
2788
|
function vl(e) {
|
|
2782
2789
|
return lr(e), e;
|
|
2783
2790
|
}
|
|
2784
|
-
function
|
|
2791
|
+
function Pl(e, n) {
|
|
2785
2792
|
let t;
|
|
2786
2793
|
return r;
|
|
2787
2794
|
function r(a) {
|
|
@@ -2802,7 +2809,7 @@ function Al(e, n) {
|
|
|
2802
2809
|
}), t = t.next, i;
|
|
2803
2810
|
}
|
|
2804
2811
|
}
|
|
2805
|
-
function
|
|
2812
|
+
function Al(e, n, t) {
|
|
2806
2813
|
const r = this;
|
|
2807
2814
|
return i;
|
|
2808
2815
|
function i(o) {
|
|
@@ -2820,7 +2827,7 @@ function or(e, n, t, r, i, l, o, a, c) {
|
|
|
2820
2827
|
let u = 0;
|
|
2821
2828
|
return h;
|
|
2822
2829
|
function h(y) {
|
|
2823
|
-
return y === 60 ? (e.enter(r), e.enter(i), e.enter(l), e.consume(y), e.exit(l), f) : y === null || y === 32 || y === 41 ||
|
|
2830
|
+
return y === 60 ? (e.enter(r), e.enter(i), e.enter(l), e.consume(y), e.exit(l), f) : y === null || y === 32 || y === 41 || Pn(y) ? t(y) : (e.enter(r), e.enter(o), e.enter(a), e.enter("chunkString", {
|
|
2824
2831
|
contentType: "string"
|
|
2825
2832
|
}), b(y));
|
|
2826
2833
|
}
|
|
@@ -2836,9 +2843,9 @@ function or(e, n, t, r, i, l, o, a, c) {
|
|
|
2836
2843
|
return y === 60 || y === 62 || y === 92 ? (e.consume(y), p) : p(y);
|
|
2837
2844
|
}
|
|
2838
2845
|
function b(y) {
|
|
2839
|
-
return !u && (y === null || y === 41 || ee(y)) ? (e.exit("chunkString"), e.exit(a), e.exit(o), e.exit(r), n(y)) : u < s && y === 40 ? (e.consume(y), u++, b) : y === 41 ? (e.consume(y), u--, b) : y === null || y === 32 || y === 40 ||
|
|
2846
|
+
return !u && (y === null || y === 41 || ee(y)) ? (e.exit("chunkString"), e.exit(a), e.exit(o), e.exit(r), n(y)) : u < s && y === 40 ? (e.consume(y), u++, b) : y === 41 ? (e.consume(y), u--, b) : y === null || y === 32 || y === 40 || Pn(y) ? t(y) : (e.consume(y), y === 92 ? P : b);
|
|
2840
2847
|
}
|
|
2841
|
-
function
|
|
2848
|
+
function P(y) {
|
|
2842
2849
|
return y === 40 || y === 41 || y === 92 ? (e.consume(y), b) : b(y);
|
|
2843
2850
|
}
|
|
2844
2851
|
}
|
|
@@ -3109,7 +3116,7 @@ function ql(e, n, t) {
|
|
|
3109
3116
|
return e.enter("htmlFlow"), e.enter("htmlFlowData"), e.consume(m), h;
|
|
3110
3117
|
}
|
|
3111
3118
|
function h(m) {
|
|
3112
|
-
return m === 33 ? (e.consume(m), f) : m === 47 ? (e.consume(m), l = !0, b) : m === 63 ? (e.consume(m), i = 3, r.interrupt ? n : d) : pe(m) ? (e.consume(m), o = String.fromCharCode(m),
|
|
3119
|
+
return m === 33 ? (e.consume(m), f) : m === 47 ? (e.consume(m), l = !0, b) : m === 63 ? (e.consume(m), i = 3, r.interrupt ? n : d) : pe(m) ? (e.consume(m), o = String.fromCharCode(m), P) : t(m);
|
|
3113
3120
|
}
|
|
3114
3121
|
function f(m) {
|
|
3115
3122
|
return m === 45 ? (e.consume(m), i = 2, p) : m === 91 ? (e.consume(m), i = 5, a = 0, w) : pe(m) ? (e.consume(m), i = 4, r.interrupt ? n : d) : t(m);
|
|
@@ -3122,14 +3129,14 @@ function ql(e, n, t) {
|
|
|
3122
3129
|
return m === se.charCodeAt(a++) ? (e.consume(m), a === se.length ? r.interrupt ? n : T : w) : t(m);
|
|
3123
3130
|
}
|
|
3124
3131
|
function b(m) {
|
|
3125
|
-
return pe(m) ? (e.consume(m), o = String.fromCharCode(m),
|
|
3132
|
+
return pe(m) ? (e.consume(m), o = String.fromCharCode(m), P) : t(m);
|
|
3126
3133
|
}
|
|
3127
|
-
function
|
|
3134
|
+
function P(m) {
|
|
3128
3135
|
if (m === null || m === 47 || m === 62 || ee(m)) {
|
|
3129
3136
|
const se = m === 47, Ce = o.toLowerCase();
|
|
3130
3137
|
return !se && !l && xt.includes(Ce) ? (i = 1, r.interrupt ? n(m) : T(m)) : Bl.includes(o.toLowerCase()) ? (i = 6, se ? (e.consume(m), y) : r.interrupt ? n(m) : T(m)) : (i = 7, r.interrupt && !r.parser.lazy[r.now().line] ? t(m) : l ? E(m) : k(m));
|
|
3131
3138
|
}
|
|
3132
|
-
return m === 45 || ie(m) ? (e.consume(m), o += String.fromCharCode(m),
|
|
3139
|
+
return m === 45 || ie(m) ? (e.consume(m), o += String.fromCharCode(m), P) : t(m);
|
|
3133
3140
|
}
|
|
3134
3141
|
function y(m) {
|
|
3135
3142
|
return m === 62 ? (e.consume(m), r.interrupt ? n : T) : t(m);
|
|
@@ -3147,13 +3154,13 @@ function ql(e, n, t) {
|
|
|
3147
3154
|
return m === 61 ? (e.consume(m), x) : U(m) ? (e.consume(m), M) : k(m);
|
|
3148
3155
|
}
|
|
3149
3156
|
function x(m) {
|
|
3150
|
-
return m === null || m === 60 || m === 61 || m === 62 || m === 96 ? t(m) : m === 34 || m === 39 ? (e.consume(m), c = m, O) : U(m) ? (e.consume(m), x) :
|
|
3157
|
+
return m === null || m === 60 || m === 61 || m === 62 || m === 96 ? t(m) : m === 34 || m === 39 ? (e.consume(m), c = m, O) : U(m) ? (e.consume(m), x) : H(m);
|
|
3151
3158
|
}
|
|
3152
3159
|
function O(m) {
|
|
3153
3160
|
return m === c ? (e.consume(m), c = null, B) : m === null || _(m) ? t(m) : (e.consume(m), O);
|
|
3154
3161
|
}
|
|
3155
|
-
function
|
|
3156
|
-
return m === null || m === 34 || m === 39 || m === 47 || m === 60 || m === 61 || m === 62 || m === 96 || ee(m) ? M(m) : (e.consume(m),
|
|
3162
|
+
function H(m) {
|
|
3163
|
+
return m === null || m === 34 || m === 39 || m === 47 || m === 60 || m === 61 || m === 62 || m === 96 || ee(m) ? M(m) : (e.consume(m), H);
|
|
3157
3164
|
}
|
|
3158
3165
|
function B(m) {
|
|
3159
3166
|
return m === 47 || m === 62 || U(m) ? k(m) : t(m);
|
|
@@ -3165,12 +3172,12 @@ function ql(e, n, t) {
|
|
|
3165
3172
|
return m === null || _(m) ? T(m) : U(m) ? (e.consume(m), N) : t(m);
|
|
3166
3173
|
}
|
|
3167
3174
|
function T(m) {
|
|
3168
|
-
return m === 45 && i === 2 ? (e.consume(m), K) : m === 60 && i === 1 ? (e.consume(m),
|
|
3175
|
+
return m === 45 && i === 2 ? (e.consume(m), K) : m === 60 && i === 1 ? (e.consume(m), X) : m === 62 && i === 4 ? (e.consume(m), ae) : m === 63 && i === 3 ? (e.consume(m), d) : m === 93 && i === 5 ? (e.consume(m), de) : _(m) && (i === 6 || i === 7) ? (e.exit("htmlFlowData"), e.check(jl, me, v)(m)) : m === null || _(m) ? (e.exit("htmlFlowData"), v(m)) : (e.consume(m), T);
|
|
3169
3176
|
}
|
|
3170
3177
|
function v(m) {
|
|
3171
|
-
return e.check(Vl,
|
|
3178
|
+
return e.check(Vl, A, me)(m);
|
|
3172
3179
|
}
|
|
3173
|
-
function
|
|
3180
|
+
function A(m) {
|
|
3174
3181
|
return e.enter("lineEnding"), e.consume(m), e.exit("lineEnding"), L;
|
|
3175
3182
|
}
|
|
3176
3183
|
function L(m) {
|
|
@@ -3179,7 +3186,7 @@ function ql(e, n, t) {
|
|
|
3179
3186
|
function K(m) {
|
|
3180
3187
|
return m === 45 ? (e.consume(m), d) : T(m);
|
|
3181
3188
|
}
|
|
3182
|
-
function
|
|
3189
|
+
function X(m) {
|
|
3183
3190
|
return m === 47 ? (e.consume(m), o = "", oe) : T(m);
|
|
3184
3191
|
}
|
|
3185
3192
|
function oe(m) {
|
|
@@ -3230,7 +3237,7 @@ function Kl(e, n, t) {
|
|
|
3230
3237
|
return e.enter("htmlText"), e.enter("htmlTextData"), e.consume(d), c;
|
|
3231
3238
|
}
|
|
3232
3239
|
function c(d) {
|
|
3233
|
-
return d === 33 ? (e.consume(d), s) : d === 47 ? (e.consume(d), M) : d === 63 ? (e.consume(d), k) : pe(d) ? (e.consume(d),
|
|
3240
|
+
return d === 33 ? (e.consume(d), s) : d === 47 ? (e.consume(d), M) : d === 63 ? (e.consume(d), k) : pe(d) ? (e.consume(d), H) : t(d);
|
|
3234
3241
|
}
|
|
3235
3242
|
function s(d) {
|
|
3236
3243
|
return d === 45 ? (e.consume(d), u) : d === 91 ? (e.consume(d), l = 0, w) : pe(d) ? (e.consume(d), E) : t(d);
|
|
@@ -3239,7 +3246,7 @@ function Kl(e, n, t) {
|
|
|
3239
3246
|
return d === 45 ? (e.consume(d), p) : t(d);
|
|
3240
3247
|
}
|
|
3241
3248
|
function h(d) {
|
|
3242
|
-
return d === null ? t(d) : d === 45 ? (e.consume(d), f) : _(d) ? (o = h,
|
|
3249
|
+
return d === null ? t(d) : d === 45 ? (e.consume(d), f) : _(d) ? (o = h, X(d)) : (e.consume(d), h);
|
|
3243
3250
|
}
|
|
3244
3251
|
function f(d) {
|
|
3245
3252
|
return d === 45 ? (e.consume(d), p) : h(d);
|
|
@@ -3252,19 +3259,19 @@ function Kl(e, n, t) {
|
|
|
3252
3259
|
return d === ae.charCodeAt(l++) ? (e.consume(d), l === ae.length ? b : w) : t(d);
|
|
3253
3260
|
}
|
|
3254
3261
|
function b(d) {
|
|
3255
|
-
return d === null ? t(d) : d === 93 ? (e.consume(d),
|
|
3262
|
+
return d === null ? t(d) : d === 93 ? (e.consume(d), P) : _(d) ? (o = b, X(d)) : (e.consume(d), b);
|
|
3256
3263
|
}
|
|
3257
|
-
function
|
|
3264
|
+
function P(d) {
|
|
3258
3265
|
return d === 93 ? (e.consume(d), y) : b(d);
|
|
3259
3266
|
}
|
|
3260
3267
|
function y(d) {
|
|
3261
3268
|
return d === 62 ? K(d) : d === 93 ? (e.consume(d), y) : b(d);
|
|
3262
3269
|
}
|
|
3263
3270
|
function E(d) {
|
|
3264
|
-
return d === null || d === 62 ? K(d) : _(d) ? (o = E,
|
|
3271
|
+
return d === null || d === 62 ? K(d) : _(d) ? (o = E, X(d)) : (e.consume(d), E);
|
|
3265
3272
|
}
|
|
3266
3273
|
function k(d) {
|
|
3267
|
-
return d === null ? t(d) : d === 63 ? (e.consume(d), D) : _(d) ? (o = k,
|
|
3274
|
+
return d === null ? t(d) : d === 63 ? (e.consume(d), D) : _(d) ? (o = k, X(d)) : (e.consume(d), k);
|
|
3268
3275
|
}
|
|
3269
3276
|
function D(d) {
|
|
3270
3277
|
return d === 62 ? K(d) : k(d);
|
|
@@ -3276,28 +3283,28 @@ function Kl(e, n, t) {
|
|
|
3276
3283
|
return d === 45 || ie(d) ? (e.consume(d), x) : O(d);
|
|
3277
3284
|
}
|
|
3278
3285
|
function O(d) {
|
|
3279
|
-
return _(d) ? (o = O,
|
|
3286
|
+
return _(d) ? (o = O, X(d)) : U(d) ? (e.consume(d), O) : K(d);
|
|
3280
3287
|
}
|
|
3281
|
-
function
|
|
3282
|
-
return d === 45 || ie(d) ? (e.consume(d),
|
|
3288
|
+
function H(d) {
|
|
3289
|
+
return d === 45 || ie(d) ? (e.consume(d), H) : d === 47 || d === 62 || ee(d) ? B(d) : t(d);
|
|
3283
3290
|
}
|
|
3284
3291
|
function B(d) {
|
|
3285
|
-
return d === 47 ? (e.consume(d), K) : d === 58 || d === 95 || pe(d) ? (e.consume(d), j) : _(d) ? (o = B,
|
|
3292
|
+
return d === 47 ? (e.consume(d), K) : d === 58 || d === 95 || pe(d) ? (e.consume(d), j) : _(d) ? (o = B, X(d)) : U(d) ? (e.consume(d), B) : K(d);
|
|
3286
3293
|
}
|
|
3287
3294
|
function j(d) {
|
|
3288
3295
|
return d === 45 || d === 46 || d === 58 || d === 95 || ie(d) ? (e.consume(d), j) : N(d);
|
|
3289
3296
|
}
|
|
3290
3297
|
function N(d) {
|
|
3291
|
-
return d === 61 ? (e.consume(d), T) : _(d) ? (o = N,
|
|
3298
|
+
return d === 61 ? (e.consume(d), T) : _(d) ? (o = N, X(d)) : U(d) ? (e.consume(d), N) : B(d);
|
|
3292
3299
|
}
|
|
3293
3300
|
function T(d) {
|
|
3294
|
-
return d === null || d === 60 || d === 61 || d === 62 || d === 96 ? t(d) : d === 34 || d === 39 ? (e.consume(d), i = d, v) : _(d) ? (o = T,
|
|
3301
|
+
return d === null || d === 60 || d === 61 || d === 62 || d === 96 ? t(d) : d === 34 || d === 39 ? (e.consume(d), i = d, v) : _(d) ? (o = T, X(d)) : U(d) ? (e.consume(d), T) : (e.consume(d), A);
|
|
3295
3302
|
}
|
|
3296
3303
|
function v(d) {
|
|
3297
|
-
return d === i ? (e.consume(d), i = void 0, L) : d === null ? t(d) : _(d) ? (o = v,
|
|
3304
|
+
return d === i ? (e.consume(d), i = void 0, L) : d === null ? t(d) : _(d) ? (o = v, X(d)) : (e.consume(d), v);
|
|
3298
3305
|
}
|
|
3299
|
-
function
|
|
3300
|
-
return d === null || d === 34 || d === 39 || d === 60 || d === 61 || d === 96 ? t(d) : d === 47 || d === 62 || ee(d) ? B(d) : (e.consume(d),
|
|
3306
|
+
function A(d) {
|
|
3307
|
+
return d === null || d === 34 || d === 39 || d === 60 || d === 61 || d === 96 ? t(d) : d === 47 || d === 62 || ee(d) ? B(d) : (e.consume(d), A);
|
|
3301
3308
|
}
|
|
3302
3309
|
function L(d) {
|
|
3303
3310
|
return d === 47 || d === 62 || ee(d) ? B(d) : t(d);
|
|
@@ -3305,7 +3312,7 @@ function Kl(e, n, t) {
|
|
|
3305
3312
|
function K(d) {
|
|
3306
3313
|
return d === 62 ? (e.consume(d), e.exit("htmlTextData"), e.exit("htmlText"), n) : t(d);
|
|
3307
3314
|
}
|
|
3308
|
-
function
|
|
3315
|
+
function X(d) {
|
|
3309
3316
|
return e.exit("htmlTextData"), e.enter("lineEnding"), e.consume(d), e.exit("lineEnding"), oe;
|
|
3310
3317
|
}
|
|
3311
3318
|
function oe(d) {
|
|
@@ -3320,9 +3327,9 @@ const Vn = {
|
|
|
3320
3327
|
resolveAll: Ql,
|
|
3321
3328
|
resolveTo: Zl,
|
|
3322
3329
|
tokenize: eo
|
|
3323
|
-
}, Yl = {
|
|
3324
|
-
tokenize: no
|
|
3325
3330
|
}, Xl = {
|
|
3331
|
+
tokenize: no
|
|
3332
|
+
}, Yl = {
|
|
3326
3333
|
tokenize: to
|
|
3327
3334
|
}, Jl = {
|
|
3328
3335
|
tokenize: ro
|
|
@@ -3395,7 +3402,7 @@ function eo(e, n, t) {
|
|
|
3395
3402
|
}))), e.enter("labelEnd"), e.enter("labelMarker"), e.consume(f), e.exit("labelMarker"), e.exit("labelEnd"), c) : t(f);
|
|
3396
3403
|
}
|
|
3397
3404
|
function c(f) {
|
|
3398
|
-
return f === 40 ? e.attempt(
|
|
3405
|
+
return f === 40 ? e.attempt(Xl, u, o ? u : h)(f) : f === 91 ? e.attempt(Yl, u, o ? s : h)(f) : o ? u(f) : h(f);
|
|
3399
3406
|
}
|
|
3400
3407
|
function s(f) {
|
|
3401
3408
|
return e.attempt(Jl, u, h)(f);
|
|
@@ -3539,7 +3546,7 @@ function ho(e, n, t) {
|
|
|
3539
3546
|
return a;
|
|
3540
3547
|
function a(p) {
|
|
3541
3548
|
const w = r.containerState.type || (p === 42 || p === 43 || p === 45 ? "listUnordered" : "listOrdered");
|
|
3542
|
-
if (w === "listUnordered" ? !r.containerState.marker || p === r.containerState.marker :
|
|
3549
|
+
if (w === "listUnordered" ? !r.containerState.marker || p === r.containerState.marker : An(p)) {
|
|
3543
3550
|
if (r.containerState.type || (r.containerState.type = w, e.enter(w, {
|
|
3544
3551
|
_container: !0
|
|
3545
3552
|
})), w === "listUnordered")
|
|
@@ -3550,7 +3557,7 @@ function ho(e, n, t) {
|
|
|
3550
3557
|
return t(p);
|
|
3551
3558
|
}
|
|
3552
3559
|
function c(p) {
|
|
3553
|
-
return
|
|
3560
|
+
return An(p) && ++o < 10 ? (e.consume(p), c) : (!r.interrupt || o < 2) && (r.containerState.marker ? p === r.containerState.marker : p === 41 || p === 46) ? (e.exit("listItemValue"), s(p)) : t(p);
|
|
3554
3561
|
}
|
|
3555
3562
|
function s(p) {
|
|
3556
3563
|
return e.enter("listItemMarker"), e.consume(p), e.exit("listItemMarker"), r.containerState.marker = r.containerState.marker || p, e.check(
|
|
@@ -3788,11 +3795,11 @@ const Io = {
|
|
|
3788
3795
|
62: tr
|
|
3789
3796
|
}, vo = {
|
|
3790
3797
|
91: Nl
|
|
3791
|
-
},
|
|
3798
|
+
}, Po = {
|
|
3792
3799
|
[-2]: fn,
|
|
3793
3800
|
[-1]: fn,
|
|
3794
3801
|
32: fn
|
|
3795
|
-
},
|
|
3802
|
+
}, Ao = {
|
|
3796
3803
|
35: Dl,
|
|
3797
3804
|
42: tn,
|
|
3798
3805
|
45: [kt, tn],
|
|
@@ -3829,8 +3836,8 @@ const Io = {
|
|
|
3829
3836
|
contentInitial: vo,
|
|
3830
3837
|
disable: Oo,
|
|
3831
3838
|
document: Io,
|
|
3832
|
-
flow:
|
|
3833
|
-
flowInitial:
|
|
3839
|
+
flow: Ao,
|
|
3840
|
+
flowInitial: Po,
|
|
3834
3841
|
insideSpan: Lo,
|
|
3835
3842
|
string: No,
|
|
3836
3843
|
text: _o
|
|
@@ -3869,7 +3876,7 @@ function Do(e, n, t) {
|
|
|
3869
3876
|
let u = n.tokenize.call(s, c);
|
|
3870
3877
|
return n.resolveAll && l.push(n), s;
|
|
3871
3878
|
function h(N) {
|
|
3872
|
-
return o = le(o, N),
|
|
3879
|
+
return o = le(o, N), P(), o[o.length - 1] !== null ? [] : (H(n, 0), s.events = jn(l, s.events, s), s.events);
|
|
3873
3880
|
}
|
|
3874
3881
|
function f(N, T) {
|
|
3875
3882
|
return Fo(p(N), T);
|
|
@@ -3882,21 +3889,21 @@ function Do(e, n, t) {
|
|
|
3882
3889
|
_bufferIndex: N,
|
|
3883
3890
|
_index: T,
|
|
3884
3891
|
line: v,
|
|
3885
|
-
column:
|
|
3892
|
+
column: A,
|
|
3886
3893
|
offset: L
|
|
3887
3894
|
} = r;
|
|
3888
3895
|
return {
|
|
3889
3896
|
_bufferIndex: N,
|
|
3890
3897
|
_index: T,
|
|
3891
3898
|
line: v,
|
|
3892
|
-
column:
|
|
3899
|
+
column: A,
|
|
3893
3900
|
offset: L
|
|
3894
3901
|
};
|
|
3895
3902
|
}
|
|
3896
3903
|
function b(N) {
|
|
3897
3904
|
i[N.line] = N.column, j();
|
|
3898
3905
|
}
|
|
3899
|
-
function
|
|
3906
|
+
function P() {
|
|
3900
3907
|
let N;
|
|
3901
3908
|
for (; r._index < o.length; ) {
|
|
3902
3909
|
const T = o[r._index];
|
|
@@ -3925,44 +3932,44 @@ function Do(e, n, t) {
|
|
|
3925
3932
|
return T.end = w(), s.events.push(["exit", T, s]), T;
|
|
3926
3933
|
}
|
|
3927
3934
|
function M(N, T) {
|
|
3928
|
-
|
|
3935
|
+
H(N, T.from);
|
|
3929
3936
|
}
|
|
3930
3937
|
function x(N, T) {
|
|
3931
3938
|
T.restore();
|
|
3932
3939
|
}
|
|
3933
3940
|
function O(N, T) {
|
|
3934
3941
|
return v;
|
|
3935
|
-
function v(
|
|
3936
|
-
let
|
|
3937
|
-
return Array.isArray(
|
|
3942
|
+
function v(A, L, K) {
|
|
3943
|
+
let X, oe, de, d;
|
|
3944
|
+
return Array.isArray(A) ? (
|
|
3938
3945
|
/* c8 ignore next 1 */
|
|
3939
|
-
me(
|
|
3940
|
-
) : "tokenize" in
|
|
3946
|
+
me(A)
|
|
3947
|
+
) : "tokenize" in A ? (
|
|
3941
3948
|
// Looks like a construct.
|
|
3942
3949
|
me([
|
|
3943
3950
|
/** @type {Construct} */
|
|
3944
|
-
|
|
3951
|
+
A
|
|
3945
3952
|
])
|
|
3946
|
-
) : ae(
|
|
3947
|
-
function ae(
|
|
3953
|
+
) : ae(A);
|
|
3954
|
+
function ae(Y) {
|
|
3948
3955
|
return Re;
|
|
3949
3956
|
function Re(ke) {
|
|
3950
|
-
const Ie = ke !== null &&
|
|
3957
|
+
const Ie = ke !== null && Y[ke], ve = ke !== null && Y.null, Xe = [
|
|
3951
3958
|
// To do: add more extension tests.
|
|
3952
3959
|
/* c8 ignore next 2 */
|
|
3953
3960
|
...Array.isArray(Ie) ? Ie : Ie ? [Ie] : [],
|
|
3954
3961
|
...Array.isArray(ve) ? ve : ve ? [ve] : []
|
|
3955
3962
|
];
|
|
3956
|
-
return me(
|
|
3963
|
+
return me(Xe)(ke);
|
|
3957
3964
|
}
|
|
3958
3965
|
}
|
|
3959
|
-
function me(
|
|
3960
|
-
return
|
|
3966
|
+
function me(Y) {
|
|
3967
|
+
return X = Y, oe = 0, Y.length === 0 ? K : m(Y[oe]);
|
|
3961
3968
|
}
|
|
3962
|
-
function m(
|
|
3969
|
+
function m(Y) {
|
|
3963
3970
|
return Re;
|
|
3964
3971
|
function Re(ke) {
|
|
3965
|
-
return d = B(), de =
|
|
3972
|
+
return d = B(), de = Y, Y.partial || (s.currentConstruct = Y), Y.name && s.parser.constructs.disable.null.includes(Y.name) ? Ce() : Y.tokenize.call(
|
|
3966
3973
|
// If we do have fields, create an object w/ `context` as its
|
|
3967
3974
|
// prototype.
|
|
3968
3975
|
// This allows a “live binding”, which is needed for `interrupt`.
|
|
@@ -3973,25 +3980,25 @@ function Do(e, n, t) {
|
|
|
3973
3980
|
)(ke);
|
|
3974
3981
|
}
|
|
3975
3982
|
}
|
|
3976
|
-
function se(
|
|
3983
|
+
function se(Y) {
|
|
3977
3984
|
return N(de, d), L;
|
|
3978
3985
|
}
|
|
3979
|
-
function Ce(
|
|
3980
|
-
return d.restore(), ++oe <
|
|
3986
|
+
function Ce(Y) {
|
|
3987
|
+
return d.restore(), ++oe < X.length ? m(X[oe]) : K;
|
|
3981
3988
|
}
|
|
3982
3989
|
}
|
|
3983
3990
|
}
|
|
3984
|
-
function
|
|
3991
|
+
function H(N, T) {
|
|
3985
3992
|
N.resolveAll && !l.includes(N) && l.push(N), N.resolve && he(s.events, T, s.events.length - T, N.resolve(s.events.slice(T), s)), N.resolveTo && (s.events = N.resolveTo(s.events, s));
|
|
3986
3993
|
}
|
|
3987
3994
|
function B() {
|
|
3988
|
-
const N = w(), T = s.previous, v = s.currentConstruct,
|
|
3995
|
+
const N = w(), T = s.previous, v = s.currentConstruct, A = s.events.length, L = Array.from(a);
|
|
3989
3996
|
return {
|
|
3990
|
-
from:
|
|
3997
|
+
from: A,
|
|
3991
3998
|
restore: K
|
|
3992
3999
|
};
|
|
3993
4000
|
function K() {
|
|
3994
|
-
r = N, s.previous = T, s.currentConstruct = v, s.events.length =
|
|
4001
|
+
r = N, s.previous = T, s.currentConstruct = v, s.events.length = A, a = L, j();
|
|
3995
4002
|
}
|
|
3996
4003
|
}
|
|
3997
4004
|
function j() {
|
|
@@ -4144,10 +4151,10 @@ function Go(e) {
|
|
|
4144
4151
|
blockQuote: l(ve),
|
|
4145
4152
|
characterEscape: B,
|
|
4146
4153
|
characterReference: B,
|
|
4147
|
-
codeFenced: l(
|
|
4154
|
+
codeFenced: l(Xe),
|
|
4148
4155
|
codeFencedFenceInfo: o,
|
|
4149
4156
|
codeFencedFenceMeta: o,
|
|
4150
|
-
codeIndented: l(
|
|
4157
|
+
codeIndented: l(Xe, o),
|
|
4151
4158
|
codeText: l(Er, o),
|
|
4152
4159
|
codeTextData: B,
|
|
4153
4160
|
data: B,
|
|
@@ -4157,20 +4164,20 @@ function Go(e) {
|
|
|
4157
4164
|
definitionLabelString: o,
|
|
4158
4165
|
definitionTitleString: o,
|
|
4159
4166
|
emphasis: l(Ir),
|
|
4160
|
-
hardBreakEscape: l(
|
|
4161
|
-
hardBreakTrailing: l(
|
|
4162
|
-
htmlFlow: l(
|
|
4167
|
+
hardBreakEscape: l(Xn),
|
|
4168
|
+
hardBreakTrailing: l(Xn),
|
|
4169
|
+
htmlFlow: l(Yn, o),
|
|
4163
4170
|
htmlFlowData: B,
|
|
4164
|
-
htmlText: l(
|
|
4171
|
+
htmlText: l(Yn, o),
|
|
4165
4172
|
htmlTextData: B,
|
|
4166
4173
|
image: l(vr),
|
|
4167
4174
|
label: o,
|
|
4168
4175
|
link: l(Jn),
|
|
4169
|
-
listItem: l(
|
|
4176
|
+
listItem: l(Pr),
|
|
4170
4177
|
listItemValue: f,
|
|
4171
4178
|
listOrdered: l(Qn, h),
|
|
4172
4179
|
listUnordered: l(Qn),
|
|
4173
|
-
paragraph: l(
|
|
4180
|
+
paragraph: l(Ar),
|
|
4174
4181
|
reference: m,
|
|
4175
4182
|
referenceString: o,
|
|
4176
4183
|
resourceDestinationString: o,
|
|
@@ -4189,9 +4196,9 @@ function Go(e) {
|
|
|
4189
4196
|
characterEscapeValue: j,
|
|
4190
4197
|
characterReferenceMarkerHexadecimal: Ce,
|
|
4191
4198
|
characterReferenceMarkerNumeric: Ce,
|
|
4192
|
-
characterReferenceValue:
|
|
4199
|
+
characterReferenceValue: Y,
|
|
4193
4200
|
characterReference: Re,
|
|
4194
|
-
codeFenced: c(
|
|
4201
|
+
codeFenced: c(P),
|
|
4195
4202
|
codeFencedFence: b,
|
|
4196
4203
|
codeFencedFenceInfo: p,
|
|
4197
4204
|
codeFencedFenceMeta: w,
|
|
@@ -4209,9 +4216,9 @@ function Go(e) {
|
|
|
4209
4216
|
hardBreakTrailing: c(T),
|
|
4210
4217
|
htmlFlow: c(v),
|
|
4211
4218
|
htmlFlowData: j,
|
|
4212
|
-
htmlText: c(
|
|
4219
|
+
htmlText: c(A),
|
|
4213
4220
|
htmlTextData: j,
|
|
4214
|
-
image: c(
|
|
4221
|
+
image: c(X),
|
|
4215
4222
|
label: de,
|
|
4216
4223
|
labelText: oe,
|
|
4217
4224
|
lineEnding: N,
|
|
@@ -4224,7 +4231,7 @@ function Go(e) {
|
|
|
4224
4231
|
resourceDestinationString: d,
|
|
4225
4232
|
resourceTitleString: ae,
|
|
4226
4233
|
resource: me,
|
|
4227
|
-
setextHeading: c(
|
|
4234
|
+
setextHeading: c(H),
|
|
4228
4235
|
setextHeadingLineSequence: O,
|
|
4229
4236
|
setextHeadingText: x,
|
|
4230
4237
|
strong: c(),
|
|
@@ -4309,25 +4316,25 @@ function Go(e) {
|
|
|
4309
4316
|
}
|
|
4310
4317
|
if (!q && te[0] === "enter" && te[1].type === "listItemPrefix" || q === -1 && te[0] === "exit" && (te[1].type === "listUnordered" || te[1].type === "listOrdered")) {
|
|
4311
4318
|
if (Ee) {
|
|
4312
|
-
let
|
|
4313
|
-
for (ge = void 0;
|
|
4314
|
-
const ye = g[
|
|
4319
|
+
let Pe = F;
|
|
4320
|
+
for (ge = void 0; Pe--; ) {
|
|
4321
|
+
const ye = g[Pe];
|
|
4315
4322
|
if (ye[1].type === "lineEnding" || ye[1].type === "lineEndingBlank") {
|
|
4316
4323
|
if (ye[0] === "exit") continue;
|
|
4317
|
-
ge && (g[ge][1].type = "lineEndingBlank", ue = !0), ye[1].type = "lineEnding", ge =
|
|
4324
|
+
ge && (g[ge][1].type = "lineEndingBlank", ue = !0), ye[1].type = "lineEnding", ge = Pe;
|
|
4318
4325
|
} else if (!(ye[1].type === "linePrefix" || ye[1].type === "blockQuotePrefix" || ye[1].type === "blockQuotePrefixWhitespace" || ye[1].type === "blockQuoteMarker" || ye[1].type === "listItemIndent")) break;
|
|
4319
4326
|
}
|
|
4320
4327
|
De && (!ge || De < ge) && (Ee._spread = !0), Ee.end = Object.assign({}, ge ? g[ge][1].start : te[1].end), g.splice(ge || F, 0, ["exit", Ee, te[2]]), F++, z++;
|
|
4321
4328
|
}
|
|
4322
4329
|
if (te[1].type === "listItemPrefix") {
|
|
4323
|
-
const
|
|
4330
|
+
const Pe = {
|
|
4324
4331
|
type: "listItem",
|
|
4325
4332
|
_spread: !1,
|
|
4326
4333
|
start: Object.assign({}, te[1].start),
|
|
4327
4334
|
// @ts-expect-error: we’ll add `end` in a second.
|
|
4328
4335
|
end: void 0
|
|
4329
4336
|
};
|
|
4330
|
-
Ee =
|
|
4337
|
+
Ee = Pe, g.splice(F, 0, ["enter", Pe, te[2]]), F++, z++, De = void 0, Me = !0;
|
|
4331
4338
|
}
|
|
4332
4339
|
}
|
|
4333
4340
|
}
|
|
@@ -4391,7 +4398,7 @@ function Go(e) {
|
|
|
4391
4398
|
function b() {
|
|
4392
4399
|
this.data.flowCodeInside || (this.buffer(), this.data.flowCodeInside = !0);
|
|
4393
4400
|
}
|
|
4394
|
-
function
|
|
4401
|
+
function P() {
|
|
4395
4402
|
const g = this.resume(), C = this.stack[this.stack.length - 1];
|
|
4396
4403
|
C.value = g.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, ""), this.data.flowCodeInside = void 0;
|
|
4397
4404
|
}
|
|
@@ -4425,7 +4432,7 @@ function Go(e) {
|
|
|
4425
4432
|
const C = this.stack[this.stack.length - 1];
|
|
4426
4433
|
C.depth = this.sliceSerialize(g).codePointAt(0) === 61 ? 1 : 2;
|
|
4427
4434
|
}
|
|
4428
|
-
function
|
|
4435
|
+
function H() {
|
|
4429
4436
|
this.data.setextHeadingSlurpLineEnding = void 0;
|
|
4430
4437
|
}
|
|
4431
4438
|
function B(g) {
|
|
@@ -4457,7 +4464,7 @@ function Go(e) {
|
|
|
4457
4464
|
const g = this.resume(), C = this.stack[this.stack.length - 1];
|
|
4458
4465
|
C.value = g;
|
|
4459
4466
|
}
|
|
4460
|
-
function
|
|
4467
|
+
function A() {
|
|
4461
4468
|
const g = this.resume(), C = this.stack[this.stack.length - 1];
|
|
4462
4469
|
C.value = g;
|
|
4463
4470
|
}
|
|
@@ -4474,7 +4481,7 @@ function Go(e) {
|
|
|
4474
4481
|
delete g.identifier, delete g.label;
|
|
4475
4482
|
this.data.referenceType = void 0;
|
|
4476
4483
|
}
|
|
4477
|
-
function
|
|
4484
|
+
function X() {
|
|
4478
4485
|
const g = this.stack[this.stack.length - 1];
|
|
4479
4486
|
if (this.data.inReference) {
|
|
4480
4487
|
const C = this.data.referenceType || "shortcut";
|
|
@@ -4516,7 +4523,7 @@ function Go(e) {
|
|
|
4516
4523
|
function Ce(g) {
|
|
4517
4524
|
this.data.characterReferenceType = g.type;
|
|
4518
4525
|
}
|
|
4519
|
-
function
|
|
4526
|
+
function Y(g) {
|
|
4520
4527
|
const C = this.sliceSerialize(g), z = this.data.characterReferenceType;
|
|
4521
4528
|
let F;
|
|
4522
4529
|
z ? (F = nr(C, z === "characterReferenceMarkerNumeric" ? 10 : 16), this.data.characterReferenceType = void 0) : F = Un(C);
|
|
@@ -4543,7 +4550,7 @@ function Go(e) {
|
|
|
4543
4550
|
children: []
|
|
4544
4551
|
};
|
|
4545
4552
|
}
|
|
4546
|
-
function
|
|
4553
|
+
function Xe() {
|
|
4547
4554
|
return {
|
|
4548
4555
|
type: "code",
|
|
4549
4556
|
lang: null,
|
|
@@ -4580,12 +4587,12 @@ function Go(e) {
|
|
|
4580
4587
|
children: []
|
|
4581
4588
|
};
|
|
4582
4589
|
}
|
|
4583
|
-
function
|
|
4590
|
+
function Xn() {
|
|
4584
4591
|
return {
|
|
4585
4592
|
type: "break"
|
|
4586
4593
|
};
|
|
4587
4594
|
}
|
|
4588
|
-
function
|
|
4595
|
+
function Yn() {
|
|
4589
4596
|
return {
|
|
4590
4597
|
type: "html",
|
|
4591
4598
|
value: ""
|
|
@@ -4616,7 +4623,7 @@ function Go(e) {
|
|
|
4616
4623
|
children: []
|
|
4617
4624
|
};
|
|
4618
4625
|
}
|
|
4619
|
-
function
|
|
4626
|
+
function Pr(g) {
|
|
4620
4627
|
return {
|
|
4621
4628
|
type: "listItem",
|
|
4622
4629
|
spread: g._spread,
|
|
@@ -4624,7 +4631,7 @@ function Go(e) {
|
|
|
4624
4631
|
children: []
|
|
4625
4632
|
};
|
|
4626
4633
|
}
|
|
4627
|
-
function
|
|
4634
|
+
function Ar() {
|
|
4628
4635
|
return {
|
|
4629
4636
|
type: "paragraph",
|
|
4630
4637
|
children: []
|
|
@@ -4712,7 +4719,7 @@ function Ko(e) {
|
|
|
4712
4719
|
});
|
|
4713
4720
|
}
|
|
4714
4721
|
}
|
|
4715
|
-
function
|
|
4722
|
+
function Xo(e, n) {
|
|
4716
4723
|
const t = {
|
|
4717
4724
|
type: "element",
|
|
4718
4725
|
tagName: "blockquote",
|
|
@@ -4721,7 +4728,7 @@ function Yo(e, n) {
|
|
|
4721
4728
|
};
|
|
4722
4729
|
return e.patch(n, t), e.applyData(n, t);
|
|
4723
4730
|
}
|
|
4724
|
-
function
|
|
4731
|
+
function Yo(e, n) {
|
|
4725
4732
|
const t = { type: "element", tagName: "br", properties: {}, children: [] };
|
|
4726
4733
|
return e.patch(n, t), [e.applyData(n, t), { type: "text", value: `
|
|
4727
4734
|
` }];
|
|
@@ -5031,8 +5038,8 @@ function ka(e, n) {
|
|
|
5031
5038
|
return e.patch(n, t), e.applyData(n, t);
|
|
5032
5039
|
}
|
|
5033
5040
|
const ba = {
|
|
5034
|
-
blockquote:
|
|
5035
|
-
break:
|
|
5041
|
+
blockquote: Xo,
|
|
5042
|
+
break: Yo,
|
|
5036
5043
|
code: Jo,
|
|
5037
5044
|
delete: Qo,
|
|
5038
5045
|
emphasis: Zo,
|
|
@@ -5055,12 +5062,12 @@ const ba = {
|
|
|
5055
5062
|
tableRow: ma,
|
|
5056
5063
|
text: xa,
|
|
5057
5064
|
thematicBreak: ka,
|
|
5058
|
-
toml:
|
|
5059
|
-
yaml:
|
|
5060
|
-
definition:
|
|
5061
|
-
footnoteDefinition:
|
|
5065
|
+
toml: Ye,
|
|
5066
|
+
yaml: Ye,
|
|
5067
|
+
definition: Ye,
|
|
5068
|
+
footnoteDefinition: Ye
|
|
5062
5069
|
};
|
|
5063
|
-
function
|
|
5070
|
+
function Ye() {
|
|
5064
5071
|
}
|
|
5065
5072
|
const mr = -1, an = 0, $e = 1, rn = 2, Hn = 3, qn = 4, $n = 5, Gn = 6, gr = 7, yr = 8, Tt = typeof self == "object" ? self : globalThis, wa = (e, n) => {
|
|
5066
5073
|
const t = (i, l) => (e.set(l, i), i), r = (i) => {
|
|
@@ -5265,10 +5272,10 @@ function va(e) {
|
|
|
5265
5272
|
children: Array.isArray(E) ? E : [E]
|
|
5266
5273
|
});
|
|
5267
5274
|
}
|
|
5268
|
-
const
|
|
5269
|
-
if (
|
|
5270
|
-
const E =
|
|
5271
|
-
E && E.type === "text" ? E.value += " " :
|
|
5275
|
+
const P = u[u.length - 1];
|
|
5276
|
+
if (P && P.type === "element" && P.tagName === "p") {
|
|
5277
|
+
const E = P.children[P.children.length - 1];
|
|
5278
|
+
E && E.type === "text" ? E.value += " " : P.children.push({ type: "text", value: " " }), P.children.push(...w);
|
|
5272
5279
|
} else
|
|
5273
5280
|
u.push(...w);
|
|
5274
5281
|
const y = {
|
|
@@ -5328,10 +5335,10 @@ const xr = (
|
|
|
5328
5335
|
if (typeof e == "function")
|
|
5329
5336
|
return sn(e);
|
|
5330
5337
|
if (typeof e == "object")
|
|
5331
|
-
return Array.isArray(e) ?
|
|
5338
|
+
return Array.isArray(e) ? Pa(e) : (
|
|
5332
5339
|
// Cast because `ReadonlyArray` goes into the above but `isArray`
|
|
5333
5340
|
// narrows to `Array`.
|
|
5334
|
-
|
|
5341
|
+
Aa(
|
|
5335
5342
|
/** @type {Props} */
|
|
5336
5343
|
e
|
|
5337
5344
|
)
|
|
@@ -5341,7 +5348,7 @@ const xr = (
|
|
|
5341
5348
|
throw new Error("Expected function, string, or object as test");
|
|
5342
5349
|
})
|
|
5343
5350
|
);
|
|
5344
|
-
function
|
|
5351
|
+
function Pa(e) {
|
|
5345
5352
|
const n = [];
|
|
5346
5353
|
let t = -1;
|
|
5347
5354
|
for (; ++t < e.length; )
|
|
@@ -5354,7 +5361,7 @@ function Aa(e) {
|
|
|
5354
5361
|
return !1;
|
|
5355
5362
|
}
|
|
5356
5363
|
}
|
|
5357
|
-
function
|
|
5364
|
+
function Aa(e) {
|
|
5358
5365
|
const n = (
|
|
5359
5366
|
/** @type {Record<string, unknown>} */
|
|
5360
5367
|
e
|
|
@@ -5395,7 +5402,7 @@ function _a() {
|
|
|
5395
5402
|
function La(e) {
|
|
5396
5403
|
return e !== null && typeof e == "object" && "type" in e;
|
|
5397
5404
|
}
|
|
5398
|
-
const kr = [], za = !0,
|
|
5405
|
+
const kr = [], za = !0, Pt = !1, Oa = "skip";
|
|
5399
5406
|
function Ra(e, n, t, r) {
|
|
5400
5407
|
let i;
|
|
5401
5408
|
typeof n == "function" && typeof t != "function" ? (r = t, t = n) : i = n;
|
|
@@ -5420,8 +5427,8 @@ function Ra(e, n, t, r) {
|
|
|
5420
5427
|
}
|
|
5421
5428
|
return f;
|
|
5422
5429
|
function f() {
|
|
5423
|
-
let p = kr, w, b,
|
|
5424
|
-
if ((!n || l(c, s, u[u.length - 1] || void 0)) && (p = Da(t(c, u)), p[0] ===
|
|
5430
|
+
let p = kr, w, b, P;
|
|
5431
|
+
if ((!n || l(c, s, u[u.length - 1] || void 0)) && (p = Da(t(c, u)), p[0] === Pt))
|
|
5425
5432
|
return p;
|
|
5426
5433
|
if ("children" in c && c.children) {
|
|
5427
5434
|
const y = (
|
|
@@ -5429,9 +5436,9 @@ function Ra(e, n, t, r) {
|
|
|
5429
5436
|
c
|
|
5430
5437
|
);
|
|
5431
5438
|
if (y.children && p[0] !== Oa)
|
|
5432
|
-
for (b = (r ? y.children.length : -1) + o,
|
|
5439
|
+
for (b = (r ? y.children.length : -1) + o, P = u.concat(y); b > -1 && b < y.children.length; ) {
|
|
5433
5440
|
const E = y.children[b];
|
|
5434
|
-
if (w = a(E, b,
|
|
5441
|
+
if (w = a(E, b, P)(), w[0] === Pt)
|
|
5435
5442
|
return w;
|
|
5436
5443
|
b = typeof w[1] == "number" ? w[1] : b + o;
|
|
5437
5444
|
}
|
|
@@ -5478,7 +5485,7 @@ function Fa(e, n) {
|
|
|
5478
5485
|
return p(a, u, h);
|
|
5479
5486
|
if (a.options.passThrough && a.options.passThrough.includes(f)) {
|
|
5480
5487
|
if ("children" in u) {
|
|
5481
|
-
const { children: b, ...
|
|
5488
|
+
const { children: b, ...P } = u, y = ln(P);
|
|
5482
5489
|
return y.children = a.all(u), y;
|
|
5483
5490
|
}
|
|
5484
5491
|
return ln(u);
|
|
@@ -5493,9 +5500,9 @@ function Fa(e, n) {
|
|
|
5493
5500
|
for (; ++p < f.length; ) {
|
|
5494
5501
|
const w = a.one(f[p], u);
|
|
5495
5502
|
if (w) {
|
|
5496
|
-
if (p && f[p - 1].type === "break" && (!Array.isArray(w) && w.type === "text" && (w.value =
|
|
5503
|
+
if (p && f[p - 1].type === "break" && (!Array.isArray(w) && w.type === "text" && (w.value = At(w.value)), !Array.isArray(w) && w.type === "element")) {
|
|
5497
5504
|
const b = w.children[0];
|
|
5498
|
-
b && b.type === "text" && (b.value =
|
|
5505
|
+
b && b.type === "text" && (b.value = At(b.value));
|
|
5499
5506
|
}
|
|
5500
5507
|
Array.isArray(w) ? h.push(...w) : h.push(w);
|
|
5501
5508
|
}
|
|
@@ -5541,7 +5548,7 @@ function Va(e, n) {
|
|
|
5541
5548
|
return n && e.length > 0 && t.push({ type: "text", value: `
|
|
5542
5549
|
` }), t;
|
|
5543
5550
|
}
|
|
5544
|
-
function
|
|
5551
|
+
function At(e) {
|
|
5545
5552
|
let n = 0, t = e.charCodeAt(n);
|
|
5546
5553
|
for (; t === 9 || t === 32; )
|
|
5547
5554
|
n++, t = e.charCodeAt(n);
|
|
@@ -5602,9 +5609,9 @@ function qa() {
|
|
|
5602
5609
|
return s[u];
|
|
5603
5610
|
};
|
|
5604
5611
|
return mn = function c() {
|
|
5605
|
-
var s, u, h, f, p, w, b = arguments[0],
|
|
5606
|
-
for (typeof b == "boolean" && (E = b, b = arguments[1] || {},
|
|
5607
|
-
if (s = arguments[
|
|
5612
|
+
var s, u, h, f, p, w, b = arguments[0], P = 1, y = arguments.length, E = !1;
|
|
5613
|
+
for (typeof b == "boolean" && (E = b, b = arguments[1] || {}, P = 2), (b == null || typeof b != "object" && typeof b != "function") && (b = {}); P < y; ++P)
|
|
5614
|
+
if (s = arguments[P], s != null)
|
|
5608
5615
|
for (u in s)
|
|
5609
5616
|
h = a(b, u), f = a(s, u), b !== f && (E && f && (l(f) || (p = i(f))) ? (p ? (p = !1, w = h && i(h) ? h : []) : w = h && l(h) ? h : {}, o(b, { name: u, newValue: c(E, w, f) })) : typeof f < "u" && o(b, { name: u, newValue: f }));
|
|
5610
5617
|
return b;
|
|
@@ -5674,7 +5681,7 @@ function Wa(e, n) {
|
|
|
5674
5681
|
i(null, o);
|
|
5675
5682
|
}
|
|
5676
5683
|
}
|
|
5677
|
-
const ce = { basename: Ka, dirname:
|
|
5684
|
+
const ce = { basename: Ka, dirname: Xa, extname: Ya, join: Ja, sep: "/" };
|
|
5678
5685
|
function Ka(e, n) {
|
|
5679
5686
|
if (n !== void 0 && typeof n != "string")
|
|
5680
5687
|
throw new TypeError('"ext" argument must be a string');
|
|
@@ -5703,7 +5710,7 @@ function Ka(e, n) {
|
|
|
5703
5710
|
o < 0 && (l = !0, o = i + 1), a > -1 && (e.codePointAt(i) === n.codePointAt(a--) ? a < 0 && (r = i) : (a = -1, r = o));
|
|
5704
5711
|
return t === r ? r = o : r < 0 && (r = e.length), e.slice(t, r);
|
|
5705
5712
|
}
|
|
5706
|
-
function
|
|
5713
|
+
function Xa(e) {
|
|
5707
5714
|
if (Ke(e), e.length === 0)
|
|
5708
5715
|
return ".";
|
|
5709
5716
|
let n = -1, t = e.length, r;
|
|
@@ -5716,7 +5723,7 @@ function Ya(e) {
|
|
|
5716
5723
|
} else r || (r = !0);
|
|
5717
5724
|
return n < 0 ? e.codePointAt(0) === 47 ? "/" : "." : n === 1 && e.codePointAt(0) === 47 ? "//" : e.slice(0, n);
|
|
5718
5725
|
}
|
|
5719
|
-
function
|
|
5726
|
+
function Ya(e) {
|
|
5720
5727
|
Ke(e);
|
|
5721
5728
|
let n = e.length, t = -1, r = 0, i = -1, l = 0, o;
|
|
5722
5729
|
for (; n--; ) {
|
|
@@ -6820,7 +6827,7 @@ function ys(e, n) {
|
|
|
6820
6827
|
components: i,
|
|
6821
6828
|
ignoreInvalidStyle: !0,
|
|
6822
6829
|
jsx: I,
|
|
6823
|
-
jsxs:
|
|
6830
|
+
jsxs: V,
|
|
6824
6831
|
passKeys: !0,
|
|
6825
6832
|
passNode: !0
|
|
6826
6833
|
});
|
|
@@ -6851,7 +6858,7 @@ function xs(e) {
|
|
|
6851
6858
|
hs.test(e.slice(0, n)) ? e : ""
|
|
6852
6859
|
);
|
|
6853
6860
|
}
|
|
6854
|
-
const Sr = "
|
|
6861
|
+
const Sr = "http://localhost:8002", ks = "0x4AAAAAAB9XB2TsB-P7vbJM", bs = {
|
|
6855
6862
|
BOTTOM_RIGHT: "bottom-right",
|
|
6856
6863
|
BOTTOM_LEFT: "bottom-left",
|
|
6857
6864
|
TOP_RIGHT: "top-right",
|
|
@@ -6889,7 +6896,7 @@ const Sr = "https://www.tiagpctest.softiabot.com", ks = "0x4AAAAAAB-BKyDZcYYqCbi
|
|
|
6889
6896
|
} catch {
|
|
6890
6897
|
return "";
|
|
6891
6898
|
}
|
|
6892
|
-
}, vs = (e) => e >= 1e3 ? `${(e / 1e3).toFixed(1)}s` : `${Math.round(e)}ms`, Cn = () => crypto.randomUUID(),
|
|
6899
|
+
}, vs = (e) => e >= 1e3 ? `${(e / 1e3).toFixed(1)}s` : `${Math.round(e)}ms`, Cn = () => crypto.randomUUID(), Ps = () => window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", As = (e) => e.trim().slice(0, 2e3), Ns = ({ size: e = "md", className: n = "" }) => /* @__PURE__ */ I(
|
|
6893
6900
|
"div",
|
|
6894
6901
|
{
|
|
6895
6902
|
className: `gpc-spinner ${{
|
|
@@ -6901,7 +6908,7 @@ const Sr = "https://www.tiagpctest.softiabot.com", ks = "0x4AAAAAAB-BKyDZcYYqCbi
|
|
|
6901
6908
|
"aria-label": "Cargando",
|
|
6902
6909
|
children: /* @__PURE__ */ I("span", { className: "sr-only", children: "Cargando..." })
|
|
6903
6910
|
}
|
|
6904
|
-
), _s = () => /* @__PURE__ */
|
|
6911
|
+
), _s = () => /* @__PURE__ */ V("div", { className: "gpc-typing-indicator", role: "status", "aria-label": "Escribiendo", children: [
|
|
6905
6912
|
/* @__PURE__ */ I("span", { className: "gpc-typing-dot" }),
|
|
6906
6913
|
/* @__PURE__ */ I("span", { className: "gpc-typing-dot" }),
|
|
6907
6914
|
/* @__PURE__ */ I("span", { className: "gpc-typing-dot" })
|
|
@@ -6911,7 +6918,7 @@ const Sr = "https://www.tiagpctest.softiabot.com", ks = "0x4AAAAAAB-BKyDZcYYqCbi
|
|
|
6911
6918
|
messageRef: t = null
|
|
6912
6919
|
}) => {
|
|
6913
6920
|
const { t: r } = fe(), i = e.role === "user", l = !i && e.isStreaming && !e.content;
|
|
6914
|
-
return /* @__PURE__ */
|
|
6921
|
+
return /* @__PURE__ */ V(
|
|
6915
6922
|
"div",
|
|
6916
6923
|
{
|
|
6917
6924
|
ref: t,
|
|
@@ -6927,25 +6934,25 @@ const Sr = "https://www.tiagpctest.softiabot.com", ks = "0x4AAAAAAB-BKyDZcYYqCbi
|
|
|
6927
6934
|
children: Is(e.timestamp)
|
|
6928
6935
|
}
|
|
6929
6936
|
),
|
|
6930
|
-
!i && n && e.metadata && /* @__PURE__ */
|
|
6931
|
-
e.metadata.tokensUsed && /* @__PURE__ */
|
|
6932
|
-
/* @__PURE__ */
|
|
6937
|
+
!i && n && e.metadata && /* @__PURE__ */ V("div", { className: "gpc-message-metadata", children: [
|
|
6938
|
+
e.metadata.tokensUsed && /* @__PURE__ */ V("div", { className: "gpc-metadata-item", children: [
|
|
6939
|
+
/* @__PURE__ */ V("strong", { children: [
|
|
6933
6940
|
r("metadata.tokensUsed"),
|
|
6934
6941
|
":"
|
|
6935
6942
|
] }),
|
|
6936
6943
|
" ",
|
|
6937
6944
|
e.metadata.tokensUsed
|
|
6938
6945
|
] }),
|
|
6939
|
-
e.metadata.responseTimeMs && /* @__PURE__ */
|
|
6940
|
-
/* @__PURE__ */
|
|
6946
|
+
e.metadata.responseTimeMs && /* @__PURE__ */ V("div", { className: "gpc-metadata-item", children: [
|
|
6947
|
+
/* @__PURE__ */ V("strong", { children: [
|
|
6941
6948
|
r("metadata.responseTime"),
|
|
6942
6949
|
":"
|
|
6943
6950
|
] }),
|
|
6944
6951
|
" ",
|
|
6945
6952
|
vs(e.metadata.responseTimeMs)
|
|
6946
6953
|
] }),
|
|
6947
|
-
e.metadata.model && /* @__PURE__ */
|
|
6948
|
-
/* @__PURE__ */
|
|
6954
|
+
e.metadata.model && /* @__PURE__ */ V("div", { className: "gpc-metadata-item", children: [
|
|
6955
|
+
/* @__PURE__ */ V("strong", { children: [
|
|
6949
6956
|
r("metadata.model"),
|
|
6950
6957
|
":"
|
|
6951
6958
|
] }),
|
|
@@ -6973,7 +6980,7 @@ const Sr = "https://www.tiagpctest.softiabot.com", ks = "0x4AAAAAAB-BKyDZcYYqCbi
|
|
|
6973
6980
|
}, 100)), a.current = e.length;
|
|
6974
6981
|
}, [e]);
|
|
6975
6982
|
const c = r?.company_name || "TIA GPC", s = r?.company_logo_base64, u = s?.startsWith("data:") ? s : s ? `data:image/png;base64,${s}` : null;
|
|
6976
|
-
return e.length === 0 && !n ? /* @__PURE__ */ I("div", { className: "gpc-messages-container", children: /* @__PURE__ */
|
|
6983
|
+
return e.length === 0 && !n ? /* @__PURE__ */ I("div", { className: "gpc-messages-container", children: /* @__PURE__ */ V("div", { className: "gpc-empty-state", children: [
|
|
6977
6984
|
u ? /* @__PURE__ */ I("div", { className: "gpc-welcome-logo", children: /* @__PURE__ */ I(
|
|
6978
6985
|
"img",
|
|
6979
6986
|
{
|
|
@@ -6984,7 +6991,7 @@ const Sr = "https://www.tiagpctest.softiabot.com", ks = "0x4AAAAAAB-BKyDZcYYqCbi
|
|
|
6984
6991
|
) }) : /* @__PURE__ */ I(jr, { className: "gpc-empty-icon" }),
|
|
6985
6992
|
/* @__PURE__ */ I("h3", { className: "gpc-empty-title", children: i("chat.welcome", { companyName: c }) }),
|
|
6986
6993
|
/* @__PURE__ */ I("p", { className: "gpc-empty-text", children: i("chat.emptyState") })
|
|
6987
|
-
] }) }) : /* @__PURE__ */
|
|
6994
|
+
] }) }) : /* @__PURE__ */ V("div", { className: "gpc-messages-container gpc-scrollbar gpc-smooth-scroll", children: [
|
|
6988
6995
|
e.map((h, f) => /* @__PURE__ */ I(
|
|
6989
6996
|
Ls,
|
|
6990
6997
|
{
|
|
@@ -7003,7 +7010,7 @@ const Sr = "https://www.tiagpctest.softiabot.com", ks = "0x4AAAAAAB-BKyDZcYYqCbi
|
|
|
7003
7010
|
}, [t, n]);
|
|
7004
7011
|
const a = async (u) => {
|
|
7005
7012
|
u.preventDefault();
|
|
7006
|
-
const h =
|
|
7013
|
+
const h = As(i);
|
|
7007
7014
|
if (!(!h || n || t))
|
|
7008
7015
|
try {
|
|
7009
7016
|
await e(h), l("");
|
|
@@ -7013,7 +7020,7 @@ const Sr = "https://www.tiagpctest.softiabot.com", ks = "0x4AAAAAAB-BKyDZcYYqCbi
|
|
|
7013
7020
|
}, c = (u) => {
|
|
7014
7021
|
u.key === "Enter" && !u.shiftKey && (u.preventDefault(), a(u));
|
|
7015
7022
|
}, s = i.trim().length > 0 && !n && !t;
|
|
7016
|
-
return /* @__PURE__ */
|
|
7023
|
+
return /* @__PURE__ */ V("form", { onSubmit: a, className: "gpc-input-container", children: [
|
|
7017
7024
|
/* @__PURE__ */ I(
|
|
7018
7025
|
"input",
|
|
7019
7026
|
{
|
|
@@ -7041,7 +7048,7 @@ const Sr = "https://www.tiagpctest.softiabot.com", ks = "0x4AAAAAAB-BKyDZcYYqCbi
|
|
|
7041
7048
|
children: n ? /* @__PURE__ */ I("span", { className: "gpc-spinner" }) : /* @__PURE__ */ I(Vr, { className: "gpc-icon" })
|
|
7042
7049
|
}
|
|
7043
7050
|
),
|
|
7044
|
-
/* @__PURE__ */
|
|
7051
|
+
/* @__PURE__ */ V("span", { id: "chat-input-help", className: "gpc-sr-only", children: [
|
|
7045
7052
|
r("chat.placeholder"),
|
|
7046
7053
|
". Máximo ",
|
|
7047
7054
|
Ft.MAX_LENGTH,
|
|
@@ -7061,8 +7068,8 @@ const Sr = "https://www.tiagpctest.softiabot.com", ks = "0x4AAAAAAB-BKyDZcYYqCbi
|
|
|
7061
7068
|
}, s = (u) => {
|
|
7062
7069
|
console.error("Turnstile widget error:", u), a(r("turnstile.error")), t?.(new Error(r("turnstile.error")));
|
|
7063
7070
|
};
|
|
7064
|
-
return /* @__PURE__ */
|
|
7065
|
-
/* @__PURE__ */
|
|
7071
|
+
return /* @__PURE__ */ V("div", { className: "gpc-validator-container", children: [
|
|
7072
|
+
/* @__PURE__ */ V("div", { className: "gpc-validator-header", children: [
|
|
7066
7073
|
/* @__PURE__ */ I("h3", { className: "gpc-validator-title", children: r("chat.validation") }),
|
|
7067
7074
|
/* @__PURE__ */ I("p", { className: "gpc-validator-subtitle", children: r("turnstile.verifying") })
|
|
7068
7075
|
] }),
|
|
@@ -7078,13 +7085,13 @@ const Sr = "https://www.tiagpctest.softiabot.com", ks = "0x4AAAAAAB-BKyDZcYYqCbi
|
|
|
7078
7085
|
}
|
|
7079
7086
|
}
|
|
7080
7087
|
) }),
|
|
7081
|
-
i && /* @__PURE__ */
|
|
7088
|
+
i && /* @__PURE__ */ V("div", { className: "gpc-validator-loading", children: [
|
|
7082
7089
|
/* @__PURE__ */ I(Ns, { size: "md" }),
|
|
7083
7090
|
/* @__PURE__ */ I("p", { className: "gpc-validator-text", children: r("chat.validation") })
|
|
7084
7091
|
] }),
|
|
7085
|
-
o && /* @__PURE__ */
|
|
7092
|
+
o && /* @__PURE__ */ V("div", { className: "gpc-validator-error", children: [
|
|
7086
7093
|
/* @__PURE__ */ I(Hr, { className: "gpc-error-icon" }),
|
|
7087
|
-
/* @__PURE__ */
|
|
7094
|
+
/* @__PURE__ */ V("div", { className: "gpc-error-content", children: [
|
|
7088
7095
|
/* @__PURE__ */ I("p", { className: "gpc-error-title", children: r("errors.validation") }),
|
|
7089
7096
|
/* @__PURE__ */ I("p", { className: "gpc-error-message", children: o }),
|
|
7090
7097
|
/* @__PURE__ */ I(
|
|
@@ -7114,14 +7121,14 @@ const Sr = "https://www.tiagpctest.softiabot.com", ks = "0x4AAAAAAB-BKyDZcYYqCbi
|
|
|
7114
7121
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
7115
7122
|
};
|
|
7116
7123
|
l((y) => [...y, w]), a(!0), s(null);
|
|
7117
|
-
const b = Cn(),
|
|
7124
|
+
const b = Cn(), P = {
|
|
7118
7125
|
id: b,
|
|
7119
7126
|
role: "assistant",
|
|
7120
7127
|
content: "",
|
|
7121
7128
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
7122
7129
|
isStreaming: !0
|
|
7123
7130
|
};
|
|
7124
|
-
l((y) => [...y,
|
|
7131
|
+
l((y) => [...y, P]);
|
|
7125
7132
|
try {
|
|
7126
7133
|
const y = await e.sendMessage(
|
|
7127
7134
|
p,
|
|
@@ -7154,7 +7161,7 @@ const Sr = "https://www.tiagpctest.softiabot.com", ks = "0x4AAAAAAB-BKyDZcYYqCbi
|
|
|
7154
7161
|
)
|
|
7155
7162
|
);
|
|
7156
7163
|
} catch (y) {
|
|
7157
|
-
l((O) => O.filter((
|
|
7164
|
+
l((O) => O.filter((H) => H.id !== b));
|
|
7158
7165
|
let E;
|
|
7159
7166
|
try {
|
|
7160
7167
|
E = JSON.parse(y.message);
|
|
@@ -7219,7 +7226,7 @@ const Sr = "https://www.tiagpctest.softiabot.com", ks = "0x4AAAAAAB-BKyDZcYYqCbi
|
|
|
7219
7226
|
}, Ms = (e = "auto") => {
|
|
7220
7227
|
const [n, t] = Q(e), [r, i] = Q("light");
|
|
7221
7228
|
return xe(() => {
|
|
7222
|
-
if (i(n === "auto" ?
|
|
7229
|
+
if (i(n === "auto" ? Ps() : n), n === "auto") {
|
|
7223
7230
|
const a = window.matchMedia("(prefers-color-scheme: dark)"), c = (s) => {
|
|
7224
7231
|
i(s.matches ? "dark" : "light");
|
|
7225
7232
|
};
|
|
@@ -7246,24 +7253,24 @@ const Sr = "https://www.tiagpctest.softiabot.com", ks = "0x4AAAAAAB-BKyDZcYYqCbi
|
|
|
7246
7253
|
showMetadata: a = !1,
|
|
7247
7254
|
onError: c
|
|
7248
7255
|
}) => {
|
|
7249
|
-
const { t: s } = fe(), [u, h] = Q(null), [f, p] = Q(!1), { theme: w, toggleTheme: b } = Ms(l),
|
|
7256
|
+
const { t: s } = fe(), [u, h] = Q(null), [f, p] = Q(!1), { theme: w, toggleTheme: b } = Ms(l), P = en(() => {
|
|
7250
7257
|
p(!1), h(null), e && e.renewSessionToken();
|
|
7251
7258
|
}, [e]), { messages: y, isLoading: E, sendMessage: k } = Ds(
|
|
7252
7259
|
e,
|
|
7253
7260
|
u,
|
|
7254
|
-
|
|
7261
|
+
P
|
|
7255
7262
|
);
|
|
7256
7263
|
xe(() => {
|
|
7257
7264
|
e && e.hasValidCachedSession() && (p(!0), h("CACHED_SESSION"));
|
|
7258
7265
|
}, [e]);
|
|
7259
7266
|
const D = (M) => {
|
|
7260
|
-
h(M), p(!0);
|
|
7267
|
+
h(M), p(!0), e && e.validateSession();
|
|
7261
7268
|
};
|
|
7262
7269
|
return xe(() => () => {
|
|
7263
7270
|
e && e.releaseSession().catch((M) => {
|
|
7264
7271
|
console.error("Failed to release session:", M);
|
|
7265
7272
|
});
|
|
7266
|
-
}, [e]), /* @__PURE__ */
|
|
7273
|
+
}, [e]), /* @__PURE__ */ V(
|
|
7267
7274
|
"div",
|
|
7268
7275
|
{
|
|
7269
7276
|
className: `gpc-chat-window gpc-animate-fade-in ${w === "dark" ? "gpc-dark" : ""}`,
|
|
@@ -7278,7 +7285,7 @@ const Sr = "https://www.tiagpctest.softiabot.com", ks = "0x4AAAAAAB-BKyDZcYYqCbi
|
|
|
7278
7285
|
widgetConfig: t
|
|
7279
7286
|
}
|
|
7280
7287
|
),
|
|
7281
|
-
f ? /* @__PURE__ */
|
|
7288
|
+
f ? /* @__PURE__ */ V(Bt, { children: [
|
|
7282
7289
|
/* @__PURE__ */ I(
|
|
7283
7290
|
zs,
|
|
7284
7291
|
{
|
|
@@ -7331,40 +7338,40 @@ class Cr {
|
|
|
7331
7338
|
try {
|
|
7332
7339
|
const i = localStorage.getItem(t);
|
|
7333
7340
|
if (i) {
|
|
7334
|
-
const { sessionToken: l, timestamp: o } = JSON.parse(i),
|
|
7335
|
-
if (a - o <
|
|
7341
|
+
const { sessionToken: l, timestamp: o, validated: a } = JSON.parse(i), c = Date.now(), s = 1440 * 60 * 1e3;
|
|
7342
|
+
if (a && c - o < s)
|
|
7336
7343
|
return l;
|
|
7337
7344
|
localStorage.removeItem(t);
|
|
7338
7345
|
}
|
|
7339
7346
|
} catch (i) {
|
|
7340
7347
|
console.warn("[TIA GPC] Error leyendo sesión de localStorage:", i);
|
|
7341
7348
|
}
|
|
7342
|
-
|
|
7343
|
-
return this._saveSessionToken(n, r), r;
|
|
7349
|
+
return this._generateSessionToken();
|
|
7344
7350
|
}
|
|
7345
7351
|
hasValidCachedSession() {
|
|
7346
7352
|
const n = this._getStorageKey(this.licenseToken);
|
|
7347
7353
|
try {
|
|
7348
7354
|
const t = localStorage.getItem(n);
|
|
7349
7355
|
if (t) {
|
|
7350
|
-
const { sessionToken: r, timestamp: i } = JSON.parse(t),
|
|
7351
|
-
return l - i <
|
|
7356
|
+
const { sessionToken: r, timestamp: i, validated: l } = JSON.parse(t), o = Date.now(), a = 1440 * 60 * 1e3;
|
|
7357
|
+
return l && o - i < a;
|
|
7352
7358
|
}
|
|
7353
7359
|
} catch (t) {
|
|
7354
7360
|
console.warn("[TIA GPC] Error verificando sesión:", t);
|
|
7355
7361
|
}
|
|
7356
7362
|
return !1;
|
|
7357
7363
|
}
|
|
7358
|
-
_saveSessionToken(n, t) {
|
|
7359
|
-
const
|
|
7364
|
+
_saveSessionToken(n, t, r = !1) {
|
|
7365
|
+
const i = this._getStorageKey(n);
|
|
7360
7366
|
try {
|
|
7361
|
-
const
|
|
7367
|
+
const l = {
|
|
7362
7368
|
sessionToken: t,
|
|
7363
|
-
timestamp: Date.now()
|
|
7369
|
+
timestamp: Date.now(),
|
|
7370
|
+
validated: r
|
|
7364
7371
|
};
|
|
7365
|
-
localStorage.setItem(
|
|
7366
|
-
} catch (
|
|
7367
|
-
console.warn("[TIA GPC] Error guardando sesión en localStorage:",
|
|
7372
|
+
localStorage.setItem(i, JSON.stringify(l));
|
|
7373
|
+
} catch (l) {
|
|
7374
|
+
console.warn("[TIA GPC] Error guardando sesión en localStorage:", l);
|
|
7368
7375
|
}
|
|
7369
7376
|
}
|
|
7370
7377
|
_clearSessionToken(n) {
|
|
@@ -7410,10 +7417,10 @@ class Cr {
|
|
|
7410
7417
|
const { done: w, value: b } = await c.read();
|
|
7411
7418
|
if (w) break;
|
|
7412
7419
|
u += s.decode(b, { stream: !0 });
|
|
7413
|
-
const
|
|
7420
|
+
const P = u.split(`
|
|
7414
7421
|
`);
|
|
7415
|
-
u =
|
|
7416
|
-
for (const y of
|
|
7422
|
+
u = P.pop();
|
|
7423
|
+
for (const y of P) {
|
|
7417
7424
|
if (!y.trim() || !y.startsWith("data: ")) continue;
|
|
7418
7425
|
const E = y.replace("data: ", "").trim();
|
|
7419
7426
|
if (E !== "[DONE]")
|
|
@@ -7503,6 +7510,9 @@ class Cr {
|
|
|
7503
7510
|
const n = this._generateSessionToken();
|
|
7504
7511
|
this.sessionToken = n, this._saveSessionToken(this.licenseToken, n);
|
|
7505
7512
|
}
|
|
7513
|
+
validateSession() {
|
|
7514
|
+
this._saveSessionToken(this.licenseToken, this.sessionToken, !0);
|
|
7515
|
+
}
|
|
7506
7516
|
_handleError(n) {
|
|
7507
7517
|
if (n.response) {
|
|
7508
7518
|
const t = n.response.data, i = {
|
|
@@ -7530,21 +7540,21 @@ class Cr {
|
|
|
7530
7540
|
}
|
|
7531
7541
|
}
|
|
7532
7542
|
let Ze = null;
|
|
7533
|
-
const gu = (e, n) => ((!Ze || n && Ze.licenseToken !== n) && (Ze = new Cr(e, n)), Ze), Bs = { title: "TIA GPC", poweredBy: "Desarrollado por TIA GPC" }, Us = { title: "Asistente", placeholder: "Escribe tu pregunta...", send: "Enviar", close: "Cerrar", welcome: "¡Hola! Bienvenido a {{companyName}}. ¿En qué puedo ayudarte hoy?", emptyState: "Inicia una conversación escribiendo tu pregunta", validation: "Verificando seguridad...", retry: "Reintentar" }, js = { light: "Claro", dark: "Oscuro", toggle: "Cambiar tema" }, Vs = { unauthorized: "Autenticación fallida. Por favor, verifica tu token de licencia e intenta nuevamente.", validation: "Verificación anti-bot fallida. Por favor, recarga la página e intenta nuevamente.", network: "No se pudo conectar al servidor. Verifica tu conexión a internet.", rateLimit: "Has realizado demasiadas consultas o se alcanzó el límite de usuarios concurrentes. Por favor, espera un momento antes de continuar.", session: "Tu sesión ha expirado por inactividad. Por favor, recarga la página para continuar.", insufficientCredits: "Créditos insuficientes. Por favor, recarga créditos desde tu panel de administración para continuar usando TIA GPC.", generic: "Ha ocurrido un error inesperado. Por favor, intenta nuevamente.", aiServiceUnavailable: "El asistente está temporalmente no disponible. Por favor, intenta de nuevo en unos momentos.", serverError: "El servidor encontró un problema. Por favor, intenta de nuevo más tarde.", domainUnauthorized: "Este dominio no está autorizado para usar este widget. Por favor, contacta a tu administrador." }, Hs = { verifying: "Verificando que eres humano...", error: "No se pudo completar la verificación de seguridad. Por favor, recarga la página e intenta nuevamente." }, qs = { tokensUsed: "Tokens usados", responseTime: "Tiempo de respuesta", model: "Modelo" }, $s = {
|
|
7543
|
+
const gu = (e, n) => ((!Ze || n && Ze.licenseToken !== n) && (Ze = new Cr(e, n)), Ze), Bs = { title: "TIA GPC", poweredBy: "Desarrollado por TIA GPC", questionsTo: "Preguntas a" }, Us = { title: "Asistente", placeholder: "Escribe tu pregunta...", send: "Enviar", close: "Cerrar", welcome: "¡Hola! Bienvenido a {{companyName}}. ¿En qué puedo ayudarte hoy?", emptyState: "Inicia una conversación escribiendo tu pregunta", validation: "Verificando seguridad...", retry: "Reintentar" }, js = { light: "Claro", dark: "Oscuro", toggle: "Cambiar tema" }, Vs = { unauthorized: "Autenticación fallida. Por favor, verifica tu token de licencia e intenta nuevamente.", validation: "Verificación anti-bot fallida. Por favor, recarga la página e intenta nuevamente.", network: "No se pudo conectar al servidor. Verifica tu conexión a internet.", rateLimit: "Has realizado demasiadas consultas o se alcanzó el límite de usuarios concurrentes. Por favor, espera un momento antes de continuar.", session: "Tu sesión ha expirado por inactividad. Por favor, recarga la página para continuar.", insufficientCredits: "Créditos insuficientes. Por favor, recarga créditos desde tu panel de administración para continuar usando TIA GPC.", generic: "Ha ocurrido un error inesperado. Por favor, intenta nuevamente.", aiServiceUnavailable: "El asistente está temporalmente no disponible. Por favor, intenta de nuevo en unos momentos.", serverError: "El servidor encontró un problema. Por favor, intenta de nuevo más tarde.", domainUnauthorized: "Este dominio no está autorizado para usar este widget. Por favor, contacta a tu administrador." }, Hs = { verifying: "Verificando que eres humano...", error: "No se pudo completar la verificación de seguridad. Por favor, recarga la página e intenta nuevamente." }, qs = { tokensUsed: "Tokens usados", responseTime: "Tiempo de respuesta", model: "Modelo" }, $s = {
|
|
7534
7544
|
widget: Bs,
|
|
7535
7545
|
chat: Us,
|
|
7536
7546
|
theme: js,
|
|
7537
7547
|
errors: Vs,
|
|
7538
7548
|
turnstile: Hs,
|
|
7539
7549
|
metadata: qs
|
|
7540
|
-
}, Gs = { title: "TIA GPC", poweredBy: "Powered by TIA GPC" }, Ws = { title: "Assistant", placeholder: "Type your question...", send: "Send", close: "Close", welcome: "Hello! Welcome to {{companyName}}. How can I help you today?", emptyState: "Start a conversation by typing your question", validation: "Verifying security...", retry: "Retry" }, Ks = { light: "Light", dark: "Dark", toggle: "Toggle theme" },
|
|
7550
|
+
}, Gs = { title: "TIA GPC", poweredBy: "Powered by TIA GPC", questionsTo: "Questions to" }, Ws = { title: "Assistant", placeholder: "Type your question...", send: "Send", close: "Close", welcome: "Hello! Welcome to {{companyName}}. How can I help you today?", emptyState: "Start a conversation by typing your question", validation: "Verifying security...", retry: "Retry" }, Ks = { light: "Light", dark: "Dark", toggle: "Toggle theme" }, Xs = { unauthorized: "Authentication failed. Please check your license token and try again.", validation: "Bot verification failed. Please reload the page and try again.", network: "Unable to connect to the server. Please check your internet connection.", rateLimit: "You've made too many requests or the concurrent user limit has been reached. Please wait a moment before continuing.", session: "Your session has expired due to inactivity. Please reload the page to continue.", insufficientCredits: "Insufficient credits. Please reload credits from your admin panel to continue using TIA GPC.", generic: "An unexpected error has occurred. Please try again.", aiServiceUnavailable: "The assistant is temporarily unavailable. Please try again in a few moments.", serverError: "The server encountered a problem. Please try again later.", domainUnauthorized: "This domain is not authorized to use this widget. Please contact your administrator." }, Ys = { verifying: "Verifying you're human...", error: "Security verification could not be completed. Please reload the page and try again." }, Js = { tokensUsed: "Tokens used", responseTime: "Response time", model: "Model" }, Qs = {
|
|
7541
7551
|
widget: Gs,
|
|
7542
7552
|
chat: Ws,
|
|
7543
7553
|
theme: Ks,
|
|
7544
|
-
errors:
|
|
7545
|
-
turnstile:
|
|
7554
|
+
errors: Xs,
|
|
7555
|
+
turnstile: Ys,
|
|
7546
7556
|
metadata: Js
|
|
7547
|
-
}, Zs = { title: "TIA GPC", poweredBy: "Propulsé par TIA GPC" }, eu = { title: "Assistant", placeholder: "Tapez votre question...", send: "Envoyer", close: "Fermer", welcome: "Bonjour ! Bienvenue à {{companyName}}. Comment puis-je vous aider aujourd'hui ?", emptyState: "Commencez une conversation en tapant votre question", validation: "Vérification de sécurité...", retry: "Réessayer" }, nu = { light: "Clair", dark: "Sombre", toggle: "Changer de thème" }, tu = { unauthorized: "Échec de l'authentification. Veuillez vérifier votre jeton de licence et réessayer.", validation: "La vérification anti-bot a échoué. Veuillez recharger la page et réessayer.", network: "Impossible de se connecter au serveur. Veuillez vérifier votre connexion internet.", rateLimit: "Vous avez fait trop de demandes ou la limite d'utilisateurs concurrents a été atteinte. Veuillez patienter un moment avant de continuer.", session: "Votre session a expiré en raison d'inactivité. Veuillez recharger la page pour continuer.", insufficientCredits: "Crédits insuffisants. Veuillez recharger des crédits depuis votre panneau d'administration pour continuer à utiliser TIA GPC.", generic: "Une erreur inattendue s'est produite. Veuillez réessayer.", aiServiceUnavailable: "L'assistant est temporairement indisponible. Veuillez réessayer dans quelques instants.", serverError: "Le serveur a rencontré un problème. Veuillez réessayer plus tard.", domainUnauthorized: "Ce domaine n'est pas autorisé à utiliser ce widget. Veuillez contacter votre administrateur." }, ru = { verifying: "Vérification que vous êtes humain...", error: "La vérification de sécurité n'a pas pu être complétée. Veuillez recharger la page et réessayer." }, iu = { tokensUsed: "Tokens utilisés", responseTime: "Temps de réponse", model: "Modèle" }, lu = {
|
|
7557
|
+
}, Zs = { title: "TIA GPC", poweredBy: "Propulsé par TIA GPC", questionsTo: "Questions à" }, eu = { title: "Assistant", placeholder: "Tapez votre question...", send: "Envoyer", close: "Fermer", welcome: "Bonjour ! Bienvenue à {{companyName}}. Comment puis-je vous aider aujourd'hui ?", emptyState: "Commencez une conversation en tapant votre question", validation: "Vérification de sécurité...", retry: "Réessayer" }, nu = { light: "Clair", dark: "Sombre", toggle: "Changer de thème" }, tu = { unauthorized: "Échec de l'authentification. Veuillez vérifier votre jeton de licence et réessayer.", validation: "La vérification anti-bot a échoué. Veuillez recharger la page et réessayer.", network: "Impossible de se connecter au serveur. Veuillez vérifier votre connexion internet.", rateLimit: "Vous avez fait trop de demandes ou la limite d'utilisateurs concurrents a été atteinte. Veuillez patienter un moment avant de continuer.", session: "Votre session a expiré en raison d'inactivité. Veuillez recharger la page pour continuer.", insufficientCredits: "Crédits insuffisants. Veuillez recharger des crédits depuis votre panneau d'administration pour continuer à utiliser TIA GPC.", generic: "Une erreur inattendue s'est produite. Veuillez réessayer.", aiServiceUnavailable: "L'assistant est temporairement indisponible. Veuillez réessayer dans quelques instants.", serverError: "Le serveur a rencontré un problème. Veuillez réessayer plus tard.", domainUnauthorized: "Ce domaine n'est pas autorisé à utiliser ce widget. Veuillez contacter votre administrateur." }, ru = { verifying: "Vérification que vous êtes humain...", error: "La vérification de sécurité n'a pas pu être complétée. Veuillez recharger la page et réessayer." }, iu = { tokensUsed: "Tokens utilisés", responseTime: "Temps de réponse", model: "Modèle" }, lu = {
|
|
7548
7558
|
widget: Zs,
|
|
7549
7559
|
chat: eu,
|
|
7550
7560
|
theme: nu,
|
|
@@ -7586,7 +7596,7 @@ const ou = ({
|
|
|
7586
7596
|
mobileFullscreen: w = we.mobileFullscreen,
|
|
7587
7597
|
...b
|
|
7588
7598
|
}) => {
|
|
7589
|
-
const [
|
|
7599
|
+
const [P, y] = Q(f), [E, k] = Q(!1), [D, M] = Q(null), [x, O] = Q(!0), H = zr(() => new Cr(c, e), [c, e]);
|
|
7590
7600
|
if (xe(() => {
|
|
7591
7601
|
const T = () => {
|
|
7592
7602
|
k(Ts());
|
|
@@ -7601,7 +7611,7 @@ const ou = ({
|
|
|
7601
7611
|
return;
|
|
7602
7612
|
}
|
|
7603
7613
|
try {
|
|
7604
|
-
const v = await
|
|
7614
|
+
const v = await H.getInitConfig();
|
|
7605
7615
|
v.success && (M(v.data), s && s(v.data));
|
|
7606
7616
|
} catch (v) {
|
|
7607
7617
|
console.error("[TIA GPC Widget] Error loading config:", v), u && u(v);
|
|
@@ -7609,7 +7619,7 @@ const ou = ({
|
|
|
7609
7619
|
O(!1);
|
|
7610
7620
|
}
|
|
7611
7621
|
})();
|
|
7612
|
-
}, [e,
|
|
7622
|
+
}, [e, H, s, u]), !e)
|
|
7613
7623
|
return console.error('[TIA GPC Widget] Error: "token" prop is required'), null;
|
|
7614
7624
|
const B = () => {
|
|
7615
7625
|
y(!1), h?.();
|
|
@@ -7617,17 +7627,17 @@ const ou = ({
|
|
|
7617
7627
|
const T = {};
|
|
7618
7628
|
return l && (T["--gpc-color-primary"] = l), (!E || !w) && (o && (T["--gpc-widget-width"] = o), a && (T["--gpc-widget-height"] = a)), T;
|
|
7619
7629
|
};
|
|
7620
|
-
return /* @__PURE__ */ I(Rr, { i18n: nn, children: /* @__PURE__ */
|
|
7630
|
+
return /* @__PURE__ */ I(Rr, { i18n: nn, children: /* @__PURE__ */ V(
|
|
7621
7631
|
"div",
|
|
7622
7632
|
{
|
|
7623
7633
|
className: `gpc-widget gpc-widget-container ${j()} ${t === "dark" ? "gpc-dark" : ""}`,
|
|
7624
7634
|
style: N(),
|
|
7625
7635
|
children: [
|
|
7626
|
-
!
|
|
7627
|
-
|
|
7636
|
+
!P && /* @__PURE__ */ I(Kr, { onClick: () => y(!0), widgetConfig: D }),
|
|
7637
|
+
P && !x && /* @__PURE__ */ I(
|
|
7628
7638
|
Fs,
|
|
7629
7639
|
{
|
|
7630
|
-
gpcService:
|
|
7640
|
+
gpcService: H,
|
|
7631
7641
|
licenseToken: e,
|
|
7632
7642
|
widgetConfig: D,
|
|
7633
7643
|
turnstileSiteKey: n,
|