hanbiro-react16-sdk 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,43 +1,48 @@
1
- var Me = Object.defineProperty;
2
- var Ne = (t, e, n) => e in t ? Me(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var g = (t, e, n) => Ne(t, typeof e != "symbol" ? e + "" : e, n);
4
- import * as u from "react";
5
- import _, { forwardRef as se } from "react";
6
- let N;
7
- const He = new Uint8Array(16);
8
- function We() {
9
- if (!N && (N = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !N))
1
+ /*!
2
+ * hanbiro-react16-sdk v1.0.6
3
+ * Build Date: 2026-03-26
4
+ */
5
+ var rt = Object.defineProperty;
6
+ var it = (t, e, n) => e in t ? rt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
7
+ var b = (t, e, n) => it(t, typeof e != "symbol" ? e + "" : e, n);
8
+ import * as d from "react";
9
+ import E, { forwardRef as he } from "react";
10
+ import * as ot from "react-dom";
11
+ let q;
12
+ const st = new Uint8Array(16);
13
+ function at() {
14
+ if (!q && (q = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !q))
10
15
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
11
- return N(He);
16
+ return q(st);
12
17
  }
13
- const w = [];
18
+ const R = [];
14
19
  for (let t = 0; t < 256; ++t)
15
- w.push((t + 256).toString(16).slice(1));
16
- function Ue(t, e = 0) {
17
- return w[t[e + 0]] + w[t[e + 1]] + w[t[e + 2]] + w[t[e + 3]] + "-" + w[t[e + 4]] + w[t[e + 5]] + "-" + w[t[e + 6]] + w[t[e + 7]] + "-" + w[t[e + 8]] + w[t[e + 9]] + "-" + w[t[e + 10]] + w[t[e + 11]] + w[t[e + 12]] + w[t[e + 13]] + w[t[e + 14]] + w[t[e + 15]];
20
+ R.push((t + 256).toString(16).slice(1));
21
+ function lt(t, e = 0) {
22
+ return R[t[e + 0]] + R[t[e + 1]] + R[t[e + 2]] + R[t[e + 3]] + "-" + R[t[e + 4]] + R[t[e + 5]] + "-" + R[t[e + 6]] + R[t[e + 7]] + "-" + R[t[e + 8]] + R[t[e + 9]] + "-" + R[t[e + 10]] + R[t[e + 11]] + R[t[e + 12]] + R[t[e + 13]] + R[t[e + 14]] + R[t[e + 15]];
18
23
  }
19
- const Ze = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), be = {
20
- randomUUID: Ze
24
+ const ct = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Ce = {
25
+ randomUUID: ct
21
26
  };
22
- function Ge(t, e, n) {
23
- if (be.randomUUID && !t)
24
- return be.randomUUID();
27
+ function ut(t, e, n) {
28
+ if (Ce.randomUUID && !t)
29
+ return Ce.randomUUID();
25
30
  t = t || {};
26
- const r = t.random || (t.rng || We)();
27
- return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, Ue(r);
31
+ const r = t.random || (t.rng || at)();
32
+ return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, lt(r);
28
33
  }
29
- function Fe(t) {
34
+ function pt(t) {
30
35
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
31
36
  }
32
- var Re = { exports: {} }, Ve = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED", Qe = Ve, Ke = Qe;
33
- function Te() {
37
+ var je = { exports: {} }, ht = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED", ft = ht, dt = ft;
38
+ function Me() {
34
39
  }
35
- function Ee() {
40
+ function Ne() {
36
41
  }
37
- Ee.resetWarningCache = Te;
38
- var Je = function() {
39
- function t(r, i, s, o, a, p) {
40
- if (p !== Ke) {
42
+ Ne.resetWarningCache = Me;
43
+ var gt = function() {
44
+ function t(r, i, o, s, a, c) {
45
+ if (c !== dt) {
41
46
  var l = new Error(
42
47
  "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
43
48
  );
@@ -68,178 +73,178 @@ var Je = function() {
68
73
  oneOfType: e,
69
74
  shape: e,
70
75
  exact: e,
71
- checkPropTypes: Ee,
72
- resetWarningCache: Te
76
+ checkPropTypes: Ne,
77
+ resetWarningCache: Me
73
78
  };
74
79
  return n.PropTypes = n, n;
75
80
  };
76
- Re.exports = Je();
77
- var Xe = Re.exports;
78
- const R = /* @__PURE__ */ Fe(Xe);
79
- function J() {
80
- return J = Object.assign || function(t) {
81
+ je.exports = gt();
82
+ var p = je.exports;
83
+ const I = /* @__PURE__ */ pt(p);
84
+ function ne() {
85
+ return ne = Object.assign || function(t) {
81
86
  for (var e = 1; e < arguments.length; e++) {
82
87
  var n = arguments[e];
83
88
  for (var r in n)
84
89
  Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
85
90
  }
86
91
  return t;
87
- }, J.apply(this, arguments);
92
+ }, ne.apply(this, arguments);
88
93
  }
89
- function Ye(t, e) {
94
+ function mt(t, e) {
90
95
  if (t == null) return {};
91
- var n = et(t, e), r, i;
96
+ var n = bt(t, e), r, i;
92
97
  if (Object.getOwnPropertySymbols) {
93
- var s = Object.getOwnPropertySymbols(t);
94
- for (i = 0; i < s.length; i++)
95
- r = s[i], !(e.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(t, r) && (n[r] = t[r]);
98
+ var o = Object.getOwnPropertySymbols(t);
99
+ for (i = 0; i < o.length; i++)
100
+ r = o[i], !(e.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(t, r) && (n[r] = t[r]);
96
101
  }
97
102
  return n;
98
103
  }
99
- function et(t, e) {
104
+ function bt(t, e) {
100
105
  if (t == null) return {};
101
- var n = {}, r = Object.keys(t), i, s;
102
- for (s = 0; s < r.length; s++)
103
- i = r[s], !(e.indexOf(i) >= 0) && (n[i] = t[i]);
106
+ var n = {}, r = Object.keys(t), i, o;
107
+ for (o = 0; o < r.length; o++)
108
+ i = r[o], !(e.indexOf(i) >= 0) && (n[i] = t[i]);
104
109
  return n;
105
110
  }
106
- var F = se(function(t, e) {
107
- var n = t.color, r = n === void 0 ? "currentColor" : n, i = t.size, s = i === void 0 ? 24 : i, o = Ye(t, ["color", "size"]);
108
- return /* @__PURE__ */ _.createElement("svg", J({
111
+ var Q = he(function(t, e) {
112
+ var n = t.color, r = n === void 0 ? "currentColor" : n, i = t.size, o = i === void 0 ? 24 : i, s = mt(t, ["color", "size"]);
113
+ return /* @__PURE__ */ E.createElement("svg", ne({
109
114
  ref: e,
110
115
  xmlns: "http://www.w3.org/2000/svg",
111
- width: s,
112
- height: s,
116
+ width: o,
117
+ height: o,
113
118
  viewBox: "0 0 24 24",
114
119
  fill: "none",
115
120
  stroke: r,
116
121
  strokeWidth: "2",
117
122
  strokeLinecap: "round",
118
123
  strokeLinejoin: "round"
119
- }, o), /* @__PURE__ */ _.createElement("rect", {
124
+ }, s), /* @__PURE__ */ E.createElement("rect", {
120
125
  x: "9",
121
126
  y: "9",
122
127
  width: "13",
123
128
  height: "13",
124
129
  rx: "2",
125
130
  ry: "2"
126
- }), /* @__PURE__ */ _.createElement("path", {
131
+ }), /* @__PURE__ */ E.createElement("path", {
127
132
  d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"
128
133
  }));
129
134
  });
130
- F.propTypes = {
131
- color: R.string,
132
- size: R.oneOfType([R.string, R.number])
135
+ Q.propTypes = {
136
+ color: I.string,
137
+ size: I.oneOfType([I.string, I.number])
133
138
  };
134
- F.displayName = "Copy";
135
- function X() {
136
- return X = Object.assign || function(t) {
139
+ Q.displayName = "Copy";
140
+ function re() {
141
+ return re = Object.assign || function(t) {
137
142
  for (var e = 1; e < arguments.length; e++) {
138
143
  var n = arguments[e];
139
144
  for (var r in n)
140
145
  Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
141
146
  }
142
147
  return t;
143
- }, X.apply(this, arguments);
148
+ }, re.apply(this, arguments);
144
149
  }
145
- function tt(t, e) {
150
+ function kt(t, e) {
146
151
  if (t == null) return {};
147
- var n = nt(t, e), r, i;
152
+ var n = vt(t, e), r, i;
148
153
  if (Object.getOwnPropertySymbols) {
149
- var s = Object.getOwnPropertySymbols(t);
150
- for (i = 0; i < s.length; i++)
151
- r = s[i], !(e.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(t, r) && (n[r] = t[r]);
154
+ var o = Object.getOwnPropertySymbols(t);
155
+ for (i = 0; i < o.length; i++)
156
+ r = o[i], !(e.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(t, r) && (n[r] = t[r]);
152
157
  }
153
158
  return n;
154
159
  }
155
- function nt(t, e) {
160
+ function vt(t, e) {
156
161
  if (t == null) return {};
157
- var n = {}, r = Object.keys(t), i, s;
158
- for (s = 0; s < r.length; s++)
159
- i = r[s], !(e.indexOf(i) >= 0) && (n[i] = t[i]);
162
+ var n = {}, r = Object.keys(t), i, o;
163
+ for (o = 0; o < r.length; o++)
164
+ i = r[o], !(e.indexOf(i) >= 0) && (n[i] = t[i]);
160
165
  return n;
161
166
  }
162
- var ae = se(function(t, e) {
163
- var n = t.color, r = n === void 0 ? "currentColor" : n, i = t.size, s = i === void 0 ? 24 : i, o = tt(t, ["color", "size"]);
164
- return /* @__PURE__ */ _.createElement("svg", X({
167
+ var fe = he(function(t, e) {
168
+ var n = t.color, r = n === void 0 ? "currentColor" : n, i = t.size, o = i === void 0 ? 24 : i, s = kt(t, ["color", "size"]);
169
+ return /* @__PURE__ */ E.createElement("svg", re({
165
170
  ref: e,
166
171
  xmlns: "http://www.w3.org/2000/svg",
167
- width: s,
168
- height: s,
172
+ width: o,
173
+ height: o,
169
174
  viewBox: "0 0 24 24",
170
175
  fill: "none",
171
176
  stroke: r,
172
177
  strokeWidth: "2",
173
178
  strokeLinecap: "round",
174
179
  strokeLinejoin: "round"
175
- }, o), /* @__PURE__ */ _.createElement("line", {
180
+ }, s), /* @__PURE__ */ E.createElement("line", {
176
181
  x1: "22",
177
182
  y1: "2",
178
183
  x2: "11",
179
184
  y2: "13"
180
- }), /* @__PURE__ */ _.createElement("polygon", {
185
+ }), /* @__PURE__ */ E.createElement("polygon", {
181
186
  points: "22 2 15 22 11 13 2 9 22 2"
182
187
  }));
183
188
  });
184
- ae.propTypes = {
185
- color: R.string,
186
- size: R.oneOfType([R.string, R.number])
189
+ fe.propTypes = {
190
+ color: I.string,
191
+ size: I.oneOfType([I.string, I.number])
187
192
  };
188
- ae.displayName = "Send";
189
- function Y() {
190
- return Y = Object.assign || function(t) {
193
+ fe.displayName = "Send";
194
+ function ie() {
195
+ return ie = Object.assign || function(t) {
191
196
  for (var e = 1; e < arguments.length; e++) {
192
197
  var n = arguments[e];
193
198
  for (var r in n)
194
199
  Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
195
200
  }
196
201
  return t;
197
- }, Y.apply(this, arguments);
202
+ }, ie.apply(this, arguments);
198
203
  }
199
- function rt(t, e) {
204
+ function yt(t, e) {
200
205
  if (t == null) return {};
201
- var n = it(t, e), r, i;
206
+ var n = xt(t, e), r, i;
202
207
  if (Object.getOwnPropertySymbols) {
203
- var s = Object.getOwnPropertySymbols(t);
204
- for (i = 0; i < s.length; i++)
205
- r = s[i], !(e.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(t, r) && (n[r] = t[r]);
208
+ var o = Object.getOwnPropertySymbols(t);
209
+ for (i = 0; i < o.length; i++)
210
+ r = o[i], !(e.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(t, r) && (n[r] = t[r]);
206
211
  }
207
212
  return n;
208
213
  }
209
- function it(t, e) {
214
+ function xt(t, e) {
210
215
  if (t == null) return {};
211
- var n = {}, r = Object.keys(t), i, s;
212
- for (s = 0; s < r.length; s++)
213
- i = r[s], !(e.indexOf(i) >= 0) && (n[i] = t[i]);
216
+ var n = {}, r = Object.keys(t), i, o;
217
+ for (o = 0; o < r.length; o++)
218
+ i = r[o], !(e.indexOf(i) >= 0) && (n[i] = t[i]);
214
219
  return n;
215
220
  }
216
- var le = se(function(t, e) {
217
- var n = t.color, r = n === void 0 ? "currentColor" : n, i = t.size, s = i === void 0 ? 24 : i, o = rt(t, ["color", "size"]);
218
- return /* @__PURE__ */ _.createElement("svg", Y({
221
+ var de = he(function(t, e) {
222
+ var n = t.color, r = n === void 0 ? "currentColor" : n, i = t.size, o = i === void 0 ? 24 : i, s = yt(t, ["color", "size"]);
223
+ return /* @__PURE__ */ E.createElement("svg", ie({
219
224
  ref: e,
220
225
  xmlns: "http://www.w3.org/2000/svg",
221
- width: s,
222
- height: s,
226
+ width: o,
227
+ height: o,
223
228
  viewBox: "0 0 24 24",
224
229
  fill: "none",
225
230
  stroke: r,
226
231
  strokeWidth: "2",
227
232
  strokeLinecap: "round",
228
233
  strokeLinejoin: "round"
229
- }, o), /* @__PURE__ */ _.createElement("circle", {
234
+ }, s), /* @__PURE__ */ E.createElement("circle", {
230
235
  cx: "12",
231
236
  cy: "12",
232
237
  r: "3"
233
- }), /* @__PURE__ */ _.createElement("path", {
238
+ }), /* @__PURE__ */ E.createElement("path", {
234
239
  d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"
235
240
  }));
236
241
  });
237
- le.propTypes = {
238
- color: R.string,
239
- size: R.oneOfType([R.string, R.number])
242
+ de.propTypes = {
243
+ color: I.string,
244
+ size: I.oneOfType([I.string, I.number])
240
245
  };
241
- le.displayName = "Settings";
242
- const ee = [
246
+ de.displayName = "Settings";
247
+ const oe = [
243
248
  { label: "Korean", value: "KR", extra: "ko" },
244
249
  { label: "English", value: "US", extra: "en" },
245
250
  { label: "Japanese", value: "JP" },
@@ -248,9 +253,9 @@ const ee = [
248
253
  { label: "Traditional Chinese (Hong Kong)", value: "zh-HK", extra: "zh-cht" },
249
254
  { label: "Vietnamese", value: "VN", extra: "vi" },
250
255
  { label: "Indonesian", value: "ID", extra: "id" }
251
- ], st = ({ isGradient: t = !1, stroke: e = 1.5, size: n = 40 }) => {
256
+ ], wt = ({ isGradient: t = !1, stroke: e = 1.5, size: n = 40 }) => {
252
257
  const r = "ai-gradient-" + Math.random().toString(36).substr(2, 9);
253
- return /* @__PURE__ */ u.createElement(
258
+ return /* @__PURE__ */ d.createElement(
254
259
  "svg",
255
260
  {
256
261
  xmlns: "http://www.w3.org/2000/svg",
@@ -259,7 +264,7 @@ const ee = [
259
264
  viewBox: "0 0 24 24",
260
265
  style: { flexShrink: 0 }
261
266
  },
262
- t && /* @__PURE__ */ u.createElement("defs", null, /* @__PURE__ */ u.createElement("linearGradient", { id: r, x1: "0%", y1: "0%", x2: "0%", y2: "100%" }, /* @__PURE__ */ u.createElement("stop", { offset: "0%", stopColor: "#9D50BB" }, /* @__PURE__ */ u.createElement(
267
+ t && /* @__PURE__ */ d.createElement("defs", null, /* @__PURE__ */ d.createElement("linearGradient", { id: r, x1: "0%", y1: "0%", x2: "0%", y2: "100%" }, /* @__PURE__ */ d.createElement("stop", { offset: "0%", stopColor: "#9D50BB" }, /* @__PURE__ */ d.createElement(
263
268
  "animate",
264
269
  {
265
270
  attributeName: "offset",
@@ -267,7 +272,7 @@ const ee = [
267
272
  dur: "1s",
268
273
  repeatCount: "indefinite"
269
274
  }
270
- )), /* @__PURE__ */ u.createElement("stop", { offset: "30%", stopColor: "#6E48AA" }, /* @__PURE__ */ u.createElement(
275
+ )), /* @__PURE__ */ d.createElement("stop", { offset: "30%", stopColor: "#6E48AA" }, /* @__PURE__ */ d.createElement(
271
276
  "animate",
272
277
  {
273
278
  attributeName: "offset",
@@ -275,7 +280,7 @@ const ee = [
275
280
  dur: "1s",
276
281
  repeatCount: "indefinite"
277
282
  }
278
- )), /* @__PURE__ */ u.createElement("stop", { offset: "50%", stopColor: "#4776E6" }, /* @__PURE__ */ u.createElement(
283
+ )), /* @__PURE__ */ d.createElement("stop", { offset: "50%", stopColor: "#4776E6" }, /* @__PURE__ */ d.createElement(
279
284
  "animate",
280
285
  {
281
286
  attributeName: "offset",
@@ -283,7 +288,7 @@ const ee = [
283
288
  dur: "1s",
284
289
  repeatCount: "indefinite"
285
290
  }
286
- )), /* @__PURE__ */ u.createElement(
291
+ )), /* @__PURE__ */ d.createElement(
287
292
  "animateTransform",
288
293
  {
289
294
  attributeName: "gradientTransform",
@@ -294,7 +299,7 @@ const ee = [
294
299
  repeatCount: "indefinite"
295
300
  }
296
301
  ))),
297
- /* @__PURE__ */ u.createElement(
302
+ /* @__PURE__ */ d.createElement(
298
303
  "path",
299
304
  {
300
305
  fill: "none",
@@ -307,58 +312,58 @@ const ee = [
307
312
  )
308
313
  );
309
314
  };
310
- async function at(t, { setContent: e, setIsLoading: n, setConversationId: r, signer: i, baseUrl: s }) {
311
- let o = "";
315
+ async function St(t, { setContent: e, setIsLoading: n, setConversationId: r, signer: i, baseUrl: o }) {
316
+ let s = "";
312
317
  try {
313
318
  n(!0);
314
319
  const a = {
315
320
  method: "POST",
316
- baseURL: s,
321
+ baseURL: o,
317
322
  url: "/nmail/chatdraft",
318
323
  params: t
319
324
  };
320
- let p = {};
321
- i && typeof i.generateHeaders == "function" && (p = await i.generateHeaders(a));
322
- const l = await fetch(`${s}/nmail/chatdraft`, {
325
+ let c = {};
326
+ i && typeof i.generateHeaders == "function" && (c = await i.generateHeaders(a));
327
+ const l = await fetch(`${o}/nmail/chatdraft`, {
323
328
  method: "POST",
324
329
  body: JSON.stringify(t),
325
330
  headers: {
326
331
  "Content-Type": "application/json",
327
332
  "Access-Control-Allow-Origin": "*",
328
- ...p
333
+ ...c
329
334
  }
330
335
  });
331
336
  if (n(!1), !l.body)
332
337
  throw new Error("Response body is not available for streaming.");
333
- const c = l.body.getReader();
334
- let d = "", h = 0;
338
+ const u = l.body.getReader();
339
+ let f = "", h = 0;
335
340
  for (; ; ) {
336
- const { done: x, value: f } = await c.read();
337
- if (x)
341
+ const { done: v, value: g } = await u.read();
342
+ if (v)
338
343
  break;
339
- let k = "", v = "";
344
+ let m = "", k = "";
340
345
  try {
341
- const T = new TextDecoder().decode(f);
342
- d += T;
343
- const A = /"answer":".*?"/g, S = /"conversation_id"\s*:\s*"([^"]+)"/, P = [...d.matchAll(A)], O = d.match(S);
344
- for (O && O[1] && r(O[1]); h < P.length; ) {
345
- const D = P[h];
346
+ const w = new TextDecoder().decode(g);
347
+ f += w;
348
+ const C = /"answer":".*?"/g, S = /"conversation_id"\s*:\s*"([^"]+)"/, $ = [...f.matchAll(C)], P = f.match(S);
349
+ for (P && P[1] && r(P[1]); h < $.length; ) {
350
+ const z = $[h];
346
351
  try {
347
- k = D[0];
348
- const E = k.slice(10, k.length - 1);
349
- v = `"${E}"`, E.endsWith("\\") && (v = `"${E}\\"`);
350
- const qe = JSON.parse(v);
351
- o += qe, e(o);
352
- } catch (E) {
353
- console.error("Parse error: ", E, k, v);
352
+ m = z[0];
353
+ const _ = m.slice(10, m.length - 1);
354
+ k = `"${_}"`, _.endsWith("\\") && (k = `"${_}\\"`);
355
+ const j = JSON.parse(k);
356
+ s += j, e(s);
357
+ } catch (_) {
358
+ console.error("Parse error: ", _, m, k);
354
359
  }
355
360
  h++;
356
361
  }
357
- } catch (T) {
358
- console.error("TextDecoder error: ", T, k);
362
+ } catch (w) {
363
+ console.error("TextDecoder error: ", w, m);
359
364
  }
360
365
  }
361
- return o;
366
+ return s;
362
367
  } catch (a) {
363
368
  console.error("Summary error:", a), e("");
364
369
  } finally {
@@ -366,7 +371,7 @@ async function at(t, { setContent: e, setIsLoading: n, setConversationId: r, sig
366
371
  }
367
372
  return "";
368
373
  }
369
- function oe() {
374
+ function ge() {
370
375
  return {
371
376
  async: !1,
372
377
  breaks: !1,
@@ -380,23 +385,23 @@ function oe() {
380
385
  walkTokens: null
381
386
  };
382
387
  }
383
- var L = oe();
384
- function $e(t) {
385
- L = t;
388
+ var B = ge();
389
+ function He(t) {
390
+ B = t;
386
391
  }
387
- var q = { exec: () => null };
388
- function b(t, e = "") {
392
+ var H = { exec: () => null };
393
+ function x(t, e = "") {
389
394
  let n = typeof t == "string" ? t : t.source;
390
395
  const r = {
391
- replace: (i, s) => {
392
- let o = typeof s == "string" ? s : s.source;
393
- return o = o.replace(y.caret, "$1"), n = n.replace(i, o), r;
396
+ replace: (i, o) => {
397
+ let s = typeof o == "string" ? o : o.source;
398
+ return s = s.replace(T.caret, "$1"), n = n.replace(i, s), r;
394
399
  },
395
400
  getRegex: () => new RegExp(n, e)
396
401
  };
397
402
  return r;
398
403
  }
399
- var y = {
404
+ var T = {
400
405
  codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm,
401
406
  outputLinkReplace: /\\([\[\]])/g,
402
407
  indentCodeCompensation: /^(\s+)(?:```)/,
@@ -453,134 +458,134 @@ var y = {
453
458
  fencesBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}(?:\`\`\`|~~~)`),
454
459
  headingBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}#`),
455
460
  htmlBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}<(?:[a-z].*>|!--)`, "i")
456
- }, lt = /^(?:[ \t]*(?:\n|$))+/, ot = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, ct = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, M = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, pt = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, ce = /(?:[*+-]|\d{1,9}[.)])/, ze = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Ce = b(ze).replace(/bull/g, ce).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), ht = b(ze).replace(/bull/g, ce).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), pe = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, ut = /^[^\n]+/, he = /(?!\s*\])(?:\\.|[^\[\]\\])+/, gt = b(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", he).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), dt = b(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, ce).getRegex(), V = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", ue = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, ft = b(
461
+ }, Et = /^(?:[ \t]*(?:\n|$))+/, Ct = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Rt = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, U = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, _t = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, me = /(?:[*+-]|\d{1,9}[.)])/, Ue = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, qe = x(Ue).replace(/bull/g, me).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Tt = x(Ue).replace(/bull/g, me).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), be = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, It = /^[^\n]+/, ke = /(?!\s*\])(?:\\.|[^\[\]\\])+/, $t = x(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", ke).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), zt = x(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, me).getRegex(), J = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", ve = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Lt = x(
457
462
  "^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))",
458
463
  "i"
459
- ).replace("comment", ue).replace("tag", V).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), _e = b(pe).replace("hr", M).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", V).getRegex(), mt = b(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", _e).getRegex(), ge = {
460
- blockquote: mt,
461
- code: ot,
462
- def: gt,
463
- fences: ct,
464
- heading: pt,
465
- hr: M,
466
- html: ft,
467
- lheading: Ce,
468
- list: dt,
469
- newline: lt,
470
- paragraph: _e,
471
- table: q,
472
- text: ut
473
- }, ke = b(
464
+ ).replace("comment", ve).replace("tag", J).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Ge = x(be).replace("hr", U).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", J).getRegex(), Pt = x(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ge).getRegex(), ye = {
465
+ blockquote: Pt,
466
+ code: Ct,
467
+ def: $t,
468
+ fences: Rt,
469
+ heading: _t,
470
+ hr: U,
471
+ html: Lt,
472
+ lheading: qe,
473
+ list: zt,
474
+ newline: Et,
475
+ paragraph: Ge,
476
+ table: H,
477
+ text: It
478
+ }, Re = x(
474
479
  "^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
475
- ).replace("hr", M).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", V).getRegex(), bt = {
476
- ...ge,
477
- lheading: ht,
478
- table: ke,
479
- paragraph: b(pe).replace("hr", M).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ke).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", V).getRegex()
480
- }, kt = {
481
- ...ge,
482
- html: b(
480
+ ).replace("hr", U).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", J).getRegex(), Ot = {
481
+ ...ye,
482
+ lheading: Tt,
483
+ table: Re,
484
+ paragraph: x(be).replace("hr", U).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Re).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", J).getRegex()
485
+ }, At = {
486
+ ...ye,
487
+ html: x(
483
488
  `^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
484
- ).replace("comment", ue).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
489
+ ).replace("comment", ve).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
485
490
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
486
491
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
487
- fences: q,
492
+ fences: H,
488
493
  // fences not supported
489
494
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
490
- paragraph: b(pe).replace("hr", M).replace("heading", ` *#{1,6} *[^
491
- ]`).replace("lheading", Ce).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
492
- }, xt = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, wt = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Ie = /^( {2,}|\\)\n(?!\s*$)/, yt = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Q = /[\p{P}\p{S}]/u, de = /[\s\p{P}\p{S}]/u, Le = /[^\s\p{P}\p{S}]/u, vt = b(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, de).getRegex(), Ae = /(?!~)[\p{P}\p{S}]/u, St = /(?!~)[\s\p{P}\p{S}]/u, Rt = /(?:[^\s\p{P}\p{S}]|~)/u, Tt = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, Pe = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Et = b(Pe, "u").replace(/punct/g, Q).getRegex(), $t = b(Pe, "u").replace(/punct/g, Ae).getRegex(), Oe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", zt = b(Oe, "gu").replace(/notPunctSpace/g, Le).replace(/punctSpace/g, de).replace(/punct/g, Q).getRegex(), Ct = b(Oe, "gu").replace(/notPunctSpace/g, Rt).replace(/punctSpace/g, St).replace(/punct/g, Ae).getRegex(), _t = b(
495
+ paragraph: x(be).replace("hr", U).replace("heading", ` *#{1,6} *[^
496
+ ]`).replace("lheading", qe).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
497
+ }, Dt = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Bt = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, We = /^( {2,}|\\)\n(?!\s*$)/, jt = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Y = /[\p{P}\p{S}]/u, xe = /[\s\p{P}\p{S}]/u, Fe = /[^\s\p{P}\p{S}]/u, Mt = x(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, xe).getRegex(), Ve = /(?!~)[\p{P}\p{S}]/u, Nt = /(?!~)[\s\p{P}\p{S}]/u, Ht = /(?:[^\s\p{P}\p{S}]|~)/u, Ut = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, Ze = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, qt = x(Ze, "u").replace(/punct/g, Y).getRegex(), Gt = x(Ze, "u").replace(/punct/g, Ve).getRegex(), Ke = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Wt = x(Ke, "gu").replace(/notPunctSpace/g, Fe).replace(/punctSpace/g, xe).replace(/punct/g, Y).getRegex(), Ft = x(Ke, "gu").replace(/notPunctSpace/g, Ht).replace(/punctSpace/g, Nt).replace(/punct/g, Ve).getRegex(), Vt = x(
493
498
  "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)",
494
499
  "gu"
495
- ).replace(/notPunctSpace/g, Le).replace(/punctSpace/g, de).replace(/punct/g, Q).getRegex(), It = b(/\\(punct)/, "gu").replace(/punct/g, Q).getRegex(), Lt = b(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), At = b(ue).replace("(?:-->|$)", "-->").getRegex(), Pt = b(
500
+ ).replace(/notPunctSpace/g, Fe).replace(/punctSpace/g, xe).replace(/punct/g, Y).getRegex(), Zt = x(/\\(punct)/, "gu").replace(/punct/g, Y).getRegex(), Kt = x(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Qt = x(ve).replace("(?:-->|$)", "-->").getRegex(), Jt = x(
496
501
  "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>"
497
- ).replace("comment", At).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), U = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Ot = b(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", U).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), De = b(/^!?\[(label)\]\[(ref)\]/).replace("label", U).replace("ref", he).getRegex(), je = b(/^!?\[(ref)\](?:\[\])?/).replace("ref", he).getRegex(), Dt = b("reflink|nolink(?!\\()", "g").replace("reflink", De).replace("nolink", je).getRegex(), fe = {
498
- _backpedal: q,
502
+ ).replace("comment", Qt).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), F = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Yt = x(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", F).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Qe = x(/^!?\[(label)\]\[(ref)\]/).replace("label", F).replace("ref", ke).getRegex(), Je = x(/^!?\[(ref)\](?:\[\])?/).replace("ref", ke).getRegex(), Xt = x("reflink|nolink(?!\\()", "g").replace("reflink", Qe).replace("nolink", Je).getRegex(), we = {
503
+ _backpedal: H,
499
504
  // only used for GFM url
500
- anyPunctuation: It,
501
- autolink: Lt,
502
- blockSkip: Tt,
503
- br: Ie,
504
- code: wt,
505
- del: q,
506
- emStrongLDelim: Et,
507
- emStrongRDelimAst: zt,
508
- emStrongRDelimUnd: _t,
509
- escape: xt,
510
- link: Ot,
511
- nolink: je,
512
- punctuation: vt,
513
- reflink: De,
514
- reflinkSearch: Dt,
515
- tag: Pt,
516
- text: yt,
517
- url: q
518
- }, jt = {
519
- ...fe,
520
- link: b(/^!?\[(label)\]\((.*?)\)/).replace("label", U).getRegex(),
521
- reflink: b(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", U).getRegex()
522
- }, te = {
523
- ...fe,
524
- emStrongRDelimAst: Ct,
525
- emStrongLDelim: $t,
526
- url: b(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
505
+ anyPunctuation: Zt,
506
+ autolink: Kt,
507
+ blockSkip: Ut,
508
+ br: We,
509
+ code: Bt,
510
+ del: H,
511
+ emStrongLDelim: qt,
512
+ emStrongRDelimAst: Wt,
513
+ emStrongRDelimUnd: Vt,
514
+ escape: Dt,
515
+ link: Yt,
516
+ nolink: Je,
517
+ punctuation: Mt,
518
+ reflink: Qe,
519
+ reflinkSearch: Xt,
520
+ tag: Jt,
521
+ text: jt,
522
+ url: H
523
+ }, en = {
524
+ ...we,
525
+ link: x(/^!?\[(label)\]\((.*?)\)/).replace("label", F).getRegex(),
526
+ reflink: x(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", F).getRegex()
527
+ }, se = {
528
+ ...we,
529
+ emStrongRDelimAst: Ft,
530
+ emStrongLDelim: Gt,
531
+ url: x(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
527
532
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
528
533
  del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,
529
534
  text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
530
- }, Bt = {
531
- ...te,
532
- br: b(Ie).replace("{2,}", "*").getRegex(),
533
- text: b(te.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
534
- }, H = {
535
- normal: ge,
536
- gfm: bt,
537
- pedantic: kt
538
- }, j = {
539
- normal: fe,
540
- gfm: te,
541
- breaks: Bt,
542
- pedantic: jt
543
- }, qt = {
535
+ }, tn = {
536
+ ...se,
537
+ br: x(We).replace("{2,}", "*").getRegex(),
538
+ text: x(se.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
539
+ }, G = {
540
+ normal: ye,
541
+ gfm: Ot,
542
+ pedantic: At
543
+ }, M = {
544
+ normal: we,
545
+ gfm: se,
546
+ breaks: tn,
547
+ pedantic: en
548
+ }, nn = {
544
549
  "&": "&amp;",
545
550
  "<": "&lt;",
546
551
  ">": "&gt;",
547
552
  '"': "&quot;",
548
553
  "'": "&#39;"
549
- }, xe = (t) => qt[t];
550
- function $(t, e) {
554
+ }, _e = (t) => nn[t];
555
+ function L(t, e) {
551
556
  if (e) {
552
- if (y.escapeTest.test(t))
553
- return t.replace(y.escapeReplace, xe);
554
- } else if (y.escapeTestNoEncode.test(t))
555
- return t.replace(y.escapeReplaceNoEncode, xe);
557
+ if (T.escapeTest.test(t))
558
+ return t.replace(T.escapeReplace, _e);
559
+ } else if (T.escapeTestNoEncode.test(t))
560
+ return t.replace(T.escapeReplaceNoEncode, _e);
556
561
  return t;
557
562
  }
558
- function we(t) {
563
+ function Te(t) {
559
564
  try {
560
- t = encodeURI(t).replace(y.percentDecode, "%");
565
+ t = encodeURI(t).replace(T.percentDecode, "%");
561
566
  } catch {
562
567
  return null;
563
568
  }
564
569
  return t;
565
570
  }
566
- function ye(t, e) {
567
- var s;
568
- const n = t.replace(y.findPipe, (o, a, p) => {
569
- let l = !1, c = a;
570
- for (; --c >= 0 && p[c] === "\\"; ) l = !l;
571
+ function Ie(t, e) {
572
+ var o;
573
+ const n = t.replace(T.findPipe, (s, a, c) => {
574
+ let l = !1, u = a;
575
+ for (; --u >= 0 && c[u] === "\\"; ) l = !l;
571
576
  return l ? "|" : " |";
572
- }), r = n.split(y.splitPipe);
577
+ }), r = n.split(T.splitPipe);
573
578
  let i = 0;
574
- if (r[0].trim() || r.shift(), r.length > 0 && !((s = r.at(-1)) != null && s.trim()) && r.pop(), e)
579
+ if (r[0].trim() || r.shift(), r.length > 0 && !((o = r.at(-1)) != null && o.trim()) && r.pop(), e)
575
580
  if (r.length > e)
576
581
  r.splice(e);
577
582
  else
578
583
  for (; r.length < e; ) r.push("");
579
584
  for (; i < r.length; i++)
580
- r[i] = r[i].trim().replace(y.slashPipe, "|");
585
+ r[i] = r[i].trim().replace(T.slashPipe, "|");
581
586
  return r;
582
587
  }
583
- function B(t, e, n) {
588
+ function N(t, e, n) {
584
589
  const r = t.length;
585
590
  if (r === 0)
586
591
  return "";
@@ -589,7 +594,7 @@ function B(t, e, n) {
589
594
  i++;
590
595
  return t.slice(0, r - i);
591
596
  }
592
- function Mt(t, e) {
597
+ function rn(t, e) {
593
598
  if (t.indexOf(e[1]) === -1)
594
599
  return -1;
595
600
  let n = 0;
@@ -602,42 +607,42 @@ function Mt(t, e) {
602
607
  return r;
603
608
  return n > 0 ? -2 : -1;
604
609
  }
605
- function ve(t, e, n, r, i) {
606
- const s = e.href, o = e.title || null, a = t[1].replace(i.other.outputLinkReplace, "$1");
610
+ function $e(t, e, n, r, i) {
611
+ const o = e.href, s = e.title || null, a = t[1].replace(i.other.outputLinkReplace, "$1");
607
612
  r.state.inLink = !0;
608
- const p = {
613
+ const c = {
609
614
  type: t[0].charAt(0) === "!" ? "image" : "link",
610
615
  raw: n,
611
- href: s,
612
- title: o,
616
+ href: o,
617
+ title: s,
613
618
  text: a,
614
619
  tokens: r.inlineTokens(a)
615
620
  };
616
- return r.state.inLink = !1, p;
621
+ return r.state.inLink = !1, c;
617
622
  }
618
- function Nt(t, e, n) {
623
+ function on(t, e, n) {
619
624
  const r = t.match(n.other.indentCodeCompensation);
620
625
  if (r === null)
621
626
  return e;
622
627
  const i = r[1];
623
628
  return e.split(`
624
- `).map((s) => {
625
- const o = s.match(n.other.beginningSpace);
626
- if (o === null)
627
- return s;
628
- const [a] = o;
629
- return a.length >= i.length ? s.slice(i.length) : s;
629
+ `).map((o) => {
630
+ const s = o.match(n.other.beginningSpace);
631
+ if (s === null)
632
+ return o;
633
+ const [a] = s;
634
+ return a.length >= i.length ? o.slice(i.length) : o;
630
635
  }).join(`
631
636
  `);
632
637
  }
633
- var Z = class {
638
+ var V = class {
634
639
  // set by the lexer
635
640
  constructor(t) {
636
- g(this, "options");
637
- g(this, "rules");
641
+ b(this, "options");
642
+ b(this, "rules");
638
643
  // set by the lexer
639
- g(this, "lexer");
640
- this.options = t || L;
644
+ b(this, "lexer");
645
+ this.options = t || B;
641
646
  }
642
647
  space(t) {
643
648
  const e = this.rules.block.newline.exec(t);
@@ -655,7 +660,7 @@ var Z = class {
655
660
  type: "code",
656
661
  raw: e[0],
657
662
  codeBlockStyle: "indented",
658
- text: this.options.pedantic ? n : B(n, `
663
+ text: this.options.pedantic ? n : N(n, `
659
664
  `)
660
665
  };
661
666
  }
@@ -663,7 +668,7 @@ var Z = class {
663
668
  fences(t) {
664
669
  const e = this.rules.block.fences.exec(t);
665
670
  if (e) {
666
- const n = e[0], r = Nt(n, e[3] || "", this.rules);
671
+ const n = e[0], r = on(n, e[3] || "", this.rules);
667
672
  return {
668
673
  type: "code",
669
674
  raw: n,
@@ -677,7 +682,7 @@ var Z = class {
677
682
  if (e) {
678
683
  let n = e[2].trim();
679
684
  if (this.rules.other.endingHash.test(n)) {
680
- const r = B(n, "#");
685
+ const r = N(n, "#");
681
686
  (this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
682
687
  }
683
688
  return {
@@ -694,52 +699,52 @@ var Z = class {
694
699
  if (e)
695
700
  return {
696
701
  type: "hr",
697
- raw: B(e[0], `
702
+ raw: N(e[0], `
698
703
  `)
699
704
  };
700
705
  }
701
706
  blockquote(t) {
702
707
  const e = this.rules.block.blockquote.exec(t);
703
708
  if (e) {
704
- let n = B(e[0], `
709
+ let n = N(e[0], `
705
710
  `).split(`
706
711
  `), r = "", i = "";
707
- const s = [];
712
+ const o = [];
708
713
  for (; n.length > 0; ) {
709
- let o = !1;
714
+ let s = !1;
710
715
  const a = [];
711
- let p;
712
- for (p = 0; p < n.length; p++)
713
- if (this.rules.other.blockquoteStart.test(n[p]))
714
- a.push(n[p]), o = !0;
715
- else if (!o)
716
- a.push(n[p]);
716
+ let c;
717
+ for (c = 0; c < n.length; c++)
718
+ if (this.rules.other.blockquoteStart.test(n[c]))
719
+ a.push(n[c]), s = !0;
720
+ else if (!s)
721
+ a.push(n[c]);
717
722
  else
718
723
  break;
719
- n = n.slice(p);
724
+ n = n.slice(c);
720
725
  const l = a.join(`
721
- `), c = l.replace(this.rules.other.blockquoteSetextReplace, `
726
+ `), u = l.replace(this.rules.other.blockquoteSetextReplace, `
722
727
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
723
728
  r = r ? `${r}
724
729
  ${l}` : l, i = i ? `${i}
725
- ${c}` : c;
726
- const d = this.lexer.state.top;
727
- if (this.lexer.state.top = !0, this.lexer.blockTokens(c, s, !0), this.lexer.state.top = d, n.length === 0)
730
+ ${u}` : u;
731
+ const f = this.lexer.state.top;
732
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(u, o, !0), this.lexer.state.top = f, n.length === 0)
728
733
  break;
729
- const h = s.at(-1);
734
+ const h = o.at(-1);
730
735
  if ((h == null ? void 0 : h.type) === "code")
731
736
  break;
732
737
  if ((h == null ? void 0 : h.type) === "blockquote") {
733
- const x = h, f = x.raw + `
738
+ const v = h, g = v.raw + `
734
739
  ` + n.join(`
735
- `), k = this.blockquote(f);
736
- s[s.length - 1] = k, r = r.substring(0, r.length - x.raw.length) + k.raw, i = i.substring(0, i.length - x.text.length) + k.text;
740
+ `), m = this.blockquote(g);
741
+ o[o.length - 1] = m, r = r.substring(0, r.length - v.raw.length) + m.raw, i = i.substring(0, i.length - v.text.length) + m.text;
737
742
  break;
738
743
  } else if ((h == null ? void 0 : h.type) === "list") {
739
- const x = h, f = x.raw + `
744
+ const v = h, g = v.raw + `
740
745
  ` + n.join(`
741
- `), k = this.list(f);
742
- s[s.length - 1] = k, r = r.substring(0, r.length - h.raw.length) + k.raw, i = i.substring(0, i.length - x.raw.length) + k.raw, n = f.substring(s.at(-1).raw.length).split(`
746
+ `), m = this.list(g);
747
+ o[o.length - 1] = m, r = r.substring(0, r.length - h.raw.length) + m.raw, i = i.substring(0, i.length - v.raw.length) + m.raw, n = g.substring(o.at(-1).raw.length).split(`
743
748
  `);
744
749
  continue;
745
750
  }
@@ -747,7 +752,7 @@ ${c}` : c;
747
752
  return {
748
753
  type: "blockquote",
749
754
  raw: r,
750
- tokens: s,
755
+ tokens: o,
751
756
  text: i
752
757
  };
753
758
  }
@@ -765,47 +770,47 @@ ${c}` : c;
765
770
  items: []
766
771
  };
767
772
  n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
768
- const s = this.rules.other.listItemRegex(n);
769
- let o = !1;
773
+ const o = this.rules.other.listItemRegex(n);
774
+ let s = !1;
770
775
  for (; t; ) {
771
- let p = !1, l = "", c = "";
772
- if (!(e = s.exec(t)) || this.rules.block.hr.test(t))
776
+ let c = !1, l = "", u = "";
777
+ if (!(e = o.exec(t)) || this.rules.block.hr.test(t))
773
778
  break;
774
779
  l = e[0], t = t.substring(l.length);
775
- let d = e[2].split(`
776
- `, 1)[0].replace(this.rules.other.listReplaceTabs, (T) => " ".repeat(3 * T.length)), h = t.split(`
777
- `, 1)[0], x = !d.trim(), f = 0;
778
- if (this.options.pedantic ? (f = 2, c = d.trimStart()) : x ? f = e[1].length + 1 : (f = e[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, c = d.slice(f), f += e[1].length), x && this.rules.other.blankLine.test(h) && (l += h + `
779
- `, t = t.substring(h.length + 1), p = !0), !p) {
780
- const T = this.rules.other.nextBulletRegex(f), A = this.rules.other.hrRegex(f), S = this.rules.other.fencesBeginRegex(f), P = this.rules.other.headingBeginRegex(f), O = this.rules.other.htmlBeginRegex(f);
780
+ let f = e[2].split(`
781
+ `, 1)[0].replace(this.rules.other.listReplaceTabs, (w) => " ".repeat(3 * w.length)), h = t.split(`
782
+ `, 1)[0], v = !f.trim(), g = 0;
783
+ if (this.options.pedantic ? (g = 2, u = f.trimStart()) : v ? g = e[1].length + 1 : (g = e[2].search(this.rules.other.nonSpaceChar), g = g > 4 ? 1 : g, u = f.slice(g), g += e[1].length), v && this.rules.other.blankLine.test(h) && (l += h + `
784
+ `, t = t.substring(h.length + 1), c = !0), !c) {
785
+ const w = this.rules.other.nextBulletRegex(g), C = this.rules.other.hrRegex(g), S = this.rules.other.fencesBeginRegex(g), $ = this.rules.other.headingBeginRegex(g), P = this.rules.other.htmlBeginRegex(g);
781
786
  for (; t; ) {
782
- const D = t.split(`
787
+ const z = t.split(`
783
788
  `, 1)[0];
784
- let E;
785
- if (h = D, this.options.pedantic ? (h = h.replace(this.rules.other.listReplaceNesting, " "), E = h) : E = h.replace(this.rules.other.tabCharGlobal, " "), S.test(h) || P.test(h) || O.test(h) || T.test(h) || A.test(h))
789
+ let _;
790
+ if (h = z, this.options.pedantic ? (h = h.replace(this.rules.other.listReplaceNesting, " "), _ = h) : _ = h.replace(this.rules.other.tabCharGlobal, " "), S.test(h) || $.test(h) || P.test(h) || w.test(h) || C.test(h))
786
791
  break;
787
- if (E.search(this.rules.other.nonSpaceChar) >= f || !h.trim())
788
- c += `
789
- ` + E.slice(f);
792
+ if (_.search(this.rules.other.nonSpaceChar) >= g || !h.trim())
793
+ u += `
794
+ ` + _.slice(g);
790
795
  else {
791
- if (x || d.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || S.test(d) || P.test(d) || A.test(d))
796
+ if (v || f.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || S.test(f) || $.test(f) || C.test(f))
792
797
  break;
793
- c += `
798
+ u += `
794
799
  ` + h;
795
800
  }
796
- !x && !h.trim() && (x = !0), l += D + `
797
- `, t = t.substring(D.length + 1), d = E.slice(f);
801
+ !v && !h.trim() && (v = !0), l += z + `
802
+ `, t = t.substring(z.length + 1), f = _.slice(g);
798
803
  }
799
804
  }
800
- i.loose || (o ? i.loose = !0 : this.rules.other.doubleBlankLine.test(l) && (o = !0));
801
- let k = null, v;
802
- this.options.gfm && (k = this.rules.other.listIsTask.exec(c), k && (v = k[0] !== "[ ] ", c = c.replace(this.rules.other.listReplaceTask, ""))), i.items.push({
805
+ i.loose || (s ? i.loose = !0 : this.rules.other.doubleBlankLine.test(l) && (s = !0));
806
+ let m = null, k;
807
+ this.options.gfm && (m = this.rules.other.listIsTask.exec(u), m && (k = m[0] !== "[ ] ", u = u.replace(this.rules.other.listReplaceTask, ""))), i.items.push({
803
808
  type: "list_item",
804
809
  raw: l,
805
- task: !!k,
806
- checked: v,
810
+ task: !!m,
811
+ checked: k,
807
812
  loose: !1,
808
- text: c,
813
+ text: u,
809
814
  tokens: []
810
815
  }), i.raw += l;
811
816
  }
@@ -815,14 +820,14 @@ ${c}` : c;
815
820
  else
816
821
  return;
817
822
  i.raw = i.raw.trimEnd();
818
- for (let p = 0; p < i.items.length; p++)
819
- if (this.lexer.state.top = !1, i.items[p].tokens = this.lexer.blockTokens(i.items[p].text, []), !i.loose) {
820
- const l = i.items[p].tokens.filter((d) => d.type === "space"), c = l.length > 0 && l.some((d) => this.rules.other.anyLine.test(d.raw));
821
- i.loose = c;
823
+ for (let c = 0; c < i.items.length; c++)
824
+ if (this.lexer.state.top = !1, i.items[c].tokens = this.lexer.blockTokens(i.items[c].text, []), !i.loose) {
825
+ const l = i.items[c].tokens.filter((f) => f.type === "space"), u = l.length > 0 && l.some((f) => this.rules.other.anyLine.test(f.raw));
826
+ i.loose = u;
822
827
  }
823
828
  if (i.loose)
824
- for (let p = 0; p < i.items.length; p++)
825
- i.items[p].loose = !0;
829
+ for (let c = 0; c < i.items.length; c++)
830
+ i.items[c].loose = !0;
826
831
  return i;
827
832
  }
828
833
  }
@@ -851,12 +856,12 @@ ${c}` : c;
851
856
  }
852
857
  }
853
858
  table(t) {
854
- var o;
859
+ var s;
855
860
  const e = this.rules.block.table.exec(t);
856
861
  if (!e || !this.rules.other.tableDelimiter.test(e[2]))
857
862
  return;
858
- const n = ye(e[1]), r = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = (o = e[3]) != null && o.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
859
- `) : [], s = {
863
+ const n = Ie(e[1]), r = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = (s = e[3]) != null && s.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
864
+ `) : [], o = {
860
865
  type: "table",
861
866
  raw: e[0],
862
867
  header: [],
@@ -865,22 +870,22 @@ ${c}` : c;
865
870
  };
866
871
  if (n.length === r.length) {
867
872
  for (const a of r)
868
- this.rules.other.tableAlignRight.test(a) ? s.align.push("right") : this.rules.other.tableAlignCenter.test(a) ? s.align.push("center") : this.rules.other.tableAlignLeft.test(a) ? s.align.push("left") : s.align.push(null);
873
+ this.rules.other.tableAlignRight.test(a) ? o.align.push("right") : this.rules.other.tableAlignCenter.test(a) ? o.align.push("center") : this.rules.other.tableAlignLeft.test(a) ? o.align.push("left") : o.align.push(null);
869
874
  for (let a = 0; a < n.length; a++)
870
- s.header.push({
875
+ o.header.push({
871
876
  text: n[a],
872
877
  tokens: this.lexer.inline(n[a]),
873
878
  header: !0,
874
- align: s.align[a]
879
+ align: o.align[a]
875
880
  });
876
881
  for (const a of i)
877
- s.rows.push(ye(a, s.header.length).map((p, l) => ({
878
- text: p,
879
- tokens: this.lexer.inline(p),
882
+ o.rows.push(Ie(a, o.header.length).map((c, l) => ({
883
+ text: c,
884
+ tokens: this.lexer.inline(c),
880
885
  header: !1,
881
- align: s.align[l]
886
+ align: o.align[l]
882
887
  })));
883
- return s;
888
+ return o;
884
889
  }
885
890
  }
886
891
  lheading(t) {
@@ -945,25 +950,25 @@ ${c}` : c;
945
950
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
946
951
  if (!this.rules.other.endAngleBracket.test(n))
947
952
  return;
948
- const s = B(n.slice(0, -1), "\\");
949
- if ((n.length - s.length) % 2 === 0)
953
+ const o = N(n.slice(0, -1), "\\");
954
+ if ((n.length - o.length) % 2 === 0)
950
955
  return;
951
956
  } else {
952
- const s = Mt(e[2], "()");
953
- if (s === -2)
957
+ const o = rn(e[2], "()");
958
+ if (o === -2)
954
959
  return;
955
- if (s > -1) {
956
- const a = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + s;
957
- e[2] = e[2].substring(0, s), e[0] = e[0].substring(0, a).trim(), e[3] = "";
960
+ if (o > -1) {
961
+ const a = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + o;
962
+ e[2] = e[2].substring(0, o), e[0] = e[0].substring(0, a).trim(), e[3] = "";
958
963
  }
959
964
  }
960
965
  let r = e[2], i = "";
961
966
  if (this.options.pedantic) {
962
- const s = this.rules.other.pedanticHrefTitle.exec(r);
963
- s && (r = s[1], i = s[3]);
967
+ const o = this.rules.other.pedanticHrefTitle.exec(r);
968
+ o && (r = o[1], i = o[3]);
964
969
  } else
965
970
  i = e[3] ? e[3].slice(1, -1) : "";
966
- return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), ve(e, {
971
+ return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), $e(e, {
967
972
  href: r && r.replace(this.rules.inline.anyPunctuation, "$1"),
968
973
  title: i && i.replace(this.rules.inline.anyPunctuation, "$1")
969
974
  }, e[0], this.lexer, this.rules);
@@ -974,50 +979,50 @@ ${c}` : c;
974
979
  if ((n = this.rules.inline.reflink.exec(t)) || (n = this.rules.inline.nolink.exec(t))) {
975
980
  const r = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), i = e[r.toLowerCase()];
976
981
  if (!i) {
977
- const s = n[0].charAt(0);
982
+ const o = n[0].charAt(0);
978
983
  return {
979
984
  type: "text",
980
- raw: s,
981
- text: s
985
+ raw: o,
986
+ text: o
982
987
  };
983
988
  }
984
- return ve(n, i, n[0], this.lexer, this.rules);
989
+ return $e(n, i, n[0], this.lexer, this.rules);
985
990
  }
986
991
  }
987
992
  emStrong(t, e, n = "") {
988
993
  let r = this.rules.inline.emStrongLDelim.exec(t);
989
994
  if (!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
990
995
  if (!(r[1] || r[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
991
- const s = [...r[0]].length - 1;
992
- let o, a, p = s, l = 0;
993
- const c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
994
- for (c.lastIndex = 0, e = e.slice(-1 * t.length + s); (r = c.exec(e)) != null; ) {
995
- if (o = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !o) continue;
996
- if (a = [...o].length, r[3] || r[4]) {
997
- p += a;
996
+ const o = [...r[0]].length - 1;
997
+ let s, a, c = o, l = 0;
998
+ const u = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
999
+ for (u.lastIndex = 0, e = e.slice(-1 * t.length + o); (r = u.exec(e)) != null; ) {
1000
+ if (s = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !s) continue;
1001
+ if (a = [...s].length, r[3] || r[4]) {
1002
+ c += a;
998
1003
  continue;
999
- } else if ((r[5] || r[6]) && s % 3 && !((s + a) % 3)) {
1004
+ } else if ((r[5] || r[6]) && o % 3 && !((o + a) % 3)) {
1000
1005
  l += a;
1001
1006
  continue;
1002
1007
  }
1003
- if (p -= a, p > 0) continue;
1004
- a = Math.min(a, a + p + l);
1005
- const d = [...r[0]][0].length, h = t.slice(0, s + r.index + d + a);
1006
- if (Math.min(s, a) % 2) {
1007
- const f = h.slice(1, -1);
1008
+ if (c -= a, c > 0) continue;
1009
+ a = Math.min(a, a + c + l);
1010
+ const f = [...r[0]][0].length, h = t.slice(0, o + r.index + f + a);
1011
+ if (Math.min(o, a) % 2) {
1012
+ const g = h.slice(1, -1);
1008
1013
  return {
1009
1014
  type: "em",
1010
1015
  raw: h,
1011
- text: f,
1012
- tokens: this.lexer.inlineTokens(f)
1016
+ text: g,
1017
+ tokens: this.lexer.inlineTokens(g)
1013
1018
  };
1014
1019
  }
1015
- const x = h.slice(2, -2);
1020
+ const v = h.slice(2, -2);
1016
1021
  return {
1017
1022
  type: "strong",
1018
1023
  raw: h,
1019
- text: x,
1020
- tokens: this.lexer.inlineTokens(x)
1024
+ text: v,
1025
+ tokens: this.lexer.inlineTokens(v)
1021
1026
  };
1022
1027
  }
1023
1028
  }
@@ -1079,10 +1084,10 @@ ${c}` : c;
1079
1084
  if (e[2] === "@")
1080
1085
  r = e[0], i = "mailto:" + r;
1081
1086
  else {
1082
- let s;
1087
+ let o;
1083
1088
  do
1084
- s = e[0], e[0] = ((n = this.rules.inline._backpedal.exec(e[0])) == null ? void 0 : n[0]) ?? "";
1085
- while (s !== e[0]);
1089
+ o = e[0], e[0] = ((n = this.rules.inline._backpedal.exec(e[0])) == null ? void 0 : n[0]) ?? "";
1090
+ while (o !== e[0]);
1086
1091
  r = e[0], e[1] === "www." ? i = "http://" + e[0] : i = e[0];
1087
1092
  }
1088
1093
  return {
@@ -1112,51 +1117,51 @@ ${c}` : c;
1112
1117
  };
1113
1118
  }
1114
1119
  }
1115
- }, z = class ne {
1120
+ }, O = class ae {
1116
1121
  constructor(e) {
1117
- g(this, "tokens");
1118
- g(this, "options");
1119
- g(this, "state");
1120
- g(this, "tokenizer");
1121
- g(this, "inlineQueue");
1122
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || L, this.options.tokenizer = this.options.tokenizer || new Z(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
1122
+ b(this, "tokens");
1123
+ b(this, "options");
1124
+ b(this, "state");
1125
+ b(this, "tokenizer");
1126
+ b(this, "inlineQueue");
1127
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || B, this.options.tokenizer = this.options.tokenizer || new V(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
1123
1128
  inLink: !1,
1124
1129
  inRawBlock: !1,
1125
1130
  top: !0
1126
1131
  };
1127
1132
  const n = {
1128
- other: y,
1129
- block: H.normal,
1130
- inline: j.normal
1133
+ other: T,
1134
+ block: G.normal,
1135
+ inline: M.normal
1131
1136
  };
1132
- this.options.pedantic ? (n.block = H.pedantic, n.inline = j.pedantic) : this.options.gfm && (n.block = H.gfm, this.options.breaks ? n.inline = j.breaks : n.inline = j.gfm), this.tokenizer.rules = n;
1137
+ this.options.pedantic ? (n.block = G.pedantic, n.inline = M.pedantic) : this.options.gfm && (n.block = G.gfm, this.options.breaks ? n.inline = M.breaks : n.inline = M.gfm), this.tokenizer.rules = n;
1133
1138
  }
1134
1139
  /**
1135
1140
  * Expose Rules
1136
1141
  */
1137
1142
  static get rules() {
1138
1143
  return {
1139
- block: H,
1140
- inline: j
1144
+ block: G,
1145
+ inline: M
1141
1146
  };
1142
1147
  }
1143
1148
  /**
1144
1149
  * Static Lex Method
1145
1150
  */
1146
1151
  static lex(e, n) {
1147
- return new ne(n).lex(e);
1152
+ return new ae(n).lex(e);
1148
1153
  }
1149
1154
  /**
1150
1155
  * Static Lex Inline Method
1151
1156
  */
1152
1157
  static lexInline(e, n) {
1153
- return new ne(n).inlineTokens(e);
1158
+ return new ae(n).inlineTokens(e);
1154
1159
  }
1155
1160
  /**
1156
1161
  * Preprocessing
1157
1162
  */
1158
1163
  lex(e) {
1159
- e = e.replace(y.carriageReturn, `
1164
+ e = e.replace(T.carriageReturn, `
1160
1165
  `), this.blockTokens(e, this.tokens);
1161
1166
  for (let n = 0; n < this.inlineQueue.length; n++) {
1162
1167
  const r = this.inlineQueue[n];
@@ -1165,10 +1170,10 @@ ${c}` : c;
1165
1170
  return this.inlineQueue = [], this.tokens;
1166
1171
  }
1167
1172
  blockTokens(e, n = [], r = !1) {
1168
- var i, s, o;
1169
- for (this.options.pedantic && (e = e.replace(y.tabCharGlobal, " ").replace(y.spaceLine, "")); e; ) {
1173
+ var i, o, s;
1174
+ for (this.options.pedantic && (e = e.replace(T.tabCharGlobal, " ").replace(T.spaceLine, "")); e; ) {
1170
1175
  let a;
1171
- if ((s = (i = this.options.extensions) == null ? void 0 : i.block) != null && s.some((l) => (a = l.call({ lexer: this }, e, n)) ? (e = e.substring(a.raw.length), n.push(a), !0) : !1))
1176
+ if ((o = (i = this.options.extensions) == null ? void 0 : i.block) != null && o.some((l) => (a = l.call({ lexer: this }, e, n)) ? (e = e.substring(a.raw.length), n.push(a), !0) : !1))
1172
1177
  continue;
1173
1178
  if (a = this.tokenizer.space(e)) {
1174
1179
  e = e.substring(a.raw.length);
@@ -1228,20 +1233,20 @@ ${c}` : c;
1228
1233
  e = e.substring(a.raw.length), n.push(a);
1229
1234
  continue;
1230
1235
  }
1231
- let p = e;
1232
- if ((o = this.options.extensions) != null && o.startBlock) {
1236
+ let c = e;
1237
+ if ((s = this.options.extensions) != null && s.startBlock) {
1233
1238
  let l = 1 / 0;
1234
- const c = e.slice(1);
1235
- let d;
1239
+ const u = e.slice(1);
1240
+ let f;
1236
1241
  this.options.extensions.startBlock.forEach((h) => {
1237
- d = h.call({ lexer: this }, c), typeof d == "number" && d >= 0 && (l = Math.min(l, d));
1238
- }), l < 1 / 0 && l >= 0 && (p = e.substring(0, l + 1));
1242
+ f = h.call({ lexer: this }, u), typeof f == "number" && f >= 0 && (l = Math.min(l, f));
1243
+ }), l < 1 / 0 && l >= 0 && (c = e.substring(0, l + 1));
1239
1244
  }
1240
- if (this.state.top && (a = this.tokenizer.paragraph(p))) {
1245
+ if (this.state.top && (a = this.tokenizer.paragraph(c))) {
1241
1246
  const l = n.at(-1);
1242
1247
  r && (l == null ? void 0 : l.type) === "paragraph" ? (l.raw += `
1243
1248
  ` + a.raw, l.text += `
1244
- ` + a.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : n.push(a), r = p.length !== e.length, e = e.substring(a.raw.length);
1249
+ ` + a.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : n.push(a), r = c.length !== e.length, e = e.substring(a.raw.length);
1245
1250
  continue;
1246
1251
  }
1247
1252
  if (a = this.tokenizer.text(e)) {
@@ -1270,79 +1275,79 @@ ${c}` : c;
1270
1275
  * Lexing/Compiling
1271
1276
  */
1272
1277
  inlineTokens(e, n = []) {
1273
- var a, p, l;
1278
+ var a, c, l;
1274
1279
  let r = e, i = null;
1275
1280
  if (this.tokens.links) {
1276
- const c = Object.keys(this.tokens.links);
1277
- if (c.length > 0)
1281
+ const u = Object.keys(this.tokens.links);
1282
+ if (u.length > 0)
1278
1283
  for (; (i = this.tokenizer.rules.inline.reflinkSearch.exec(r)) != null; )
1279
- c.includes(i[0].slice(i[0].lastIndexOf("[") + 1, -1)) && (r = r.slice(0, i.index) + "[" + "a".repeat(i[0].length - 2) + "]" + r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
1284
+ u.includes(i[0].slice(i[0].lastIndexOf("[") + 1, -1)) && (r = r.slice(0, i.index) + "[" + "a".repeat(i[0].length - 2) + "]" + r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
1280
1285
  }
1281
1286
  for (; (i = this.tokenizer.rules.inline.anyPunctuation.exec(r)) != null; )
1282
1287
  r = r.slice(0, i.index) + "++" + r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
1283
1288
  for (; (i = this.tokenizer.rules.inline.blockSkip.exec(r)) != null; )
1284
1289
  r = r.slice(0, i.index) + "[" + "a".repeat(i[0].length - 2) + "]" + r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
1285
- let s = !1, o = "";
1290
+ let o = !1, s = "";
1286
1291
  for (; e; ) {
1287
- s || (o = ""), s = !1;
1288
- let c;
1289
- if ((p = (a = this.options.extensions) == null ? void 0 : a.inline) != null && p.some((h) => (c = h.call({ lexer: this }, e, n)) ? (e = e.substring(c.raw.length), n.push(c), !0) : !1))
1292
+ o || (s = ""), o = !1;
1293
+ let u;
1294
+ if ((c = (a = this.options.extensions) == null ? void 0 : a.inline) != null && c.some((h) => (u = h.call({ lexer: this }, e, n)) ? (e = e.substring(u.raw.length), n.push(u), !0) : !1))
1290
1295
  continue;
1291
- if (c = this.tokenizer.escape(e)) {
1292
- e = e.substring(c.raw.length), n.push(c);
1296
+ if (u = this.tokenizer.escape(e)) {
1297
+ e = e.substring(u.raw.length), n.push(u);
1293
1298
  continue;
1294
1299
  }
1295
- if (c = this.tokenizer.tag(e)) {
1296
- e = e.substring(c.raw.length), n.push(c);
1300
+ if (u = this.tokenizer.tag(e)) {
1301
+ e = e.substring(u.raw.length), n.push(u);
1297
1302
  continue;
1298
1303
  }
1299
- if (c = this.tokenizer.link(e)) {
1300
- e = e.substring(c.raw.length), n.push(c);
1304
+ if (u = this.tokenizer.link(e)) {
1305
+ e = e.substring(u.raw.length), n.push(u);
1301
1306
  continue;
1302
1307
  }
1303
- if (c = this.tokenizer.reflink(e, this.tokens.links)) {
1304
- e = e.substring(c.raw.length);
1308
+ if (u = this.tokenizer.reflink(e, this.tokens.links)) {
1309
+ e = e.substring(u.raw.length);
1305
1310
  const h = n.at(-1);
1306
- c.type === "text" && (h == null ? void 0 : h.type) === "text" ? (h.raw += c.raw, h.text += c.text) : n.push(c);
1311
+ u.type === "text" && (h == null ? void 0 : h.type) === "text" ? (h.raw += u.raw, h.text += u.text) : n.push(u);
1307
1312
  continue;
1308
1313
  }
1309
- if (c = this.tokenizer.emStrong(e, r, o)) {
1310
- e = e.substring(c.raw.length), n.push(c);
1314
+ if (u = this.tokenizer.emStrong(e, r, s)) {
1315
+ e = e.substring(u.raw.length), n.push(u);
1311
1316
  continue;
1312
1317
  }
1313
- if (c = this.tokenizer.codespan(e)) {
1314
- e = e.substring(c.raw.length), n.push(c);
1318
+ if (u = this.tokenizer.codespan(e)) {
1319
+ e = e.substring(u.raw.length), n.push(u);
1315
1320
  continue;
1316
1321
  }
1317
- if (c = this.tokenizer.br(e)) {
1318
- e = e.substring(c.raw.length), n.push(c);
1322
+ if (u = this.tokenizer.br(e)) {
1323
+ e = e.substring(u.raw.length), n.push(u);
1319
1324
  continue;
1320
1325
  }
1321
- if (c = this.tokenizer.del(e)) {
1322
- e = e.substring(c.raw.length), n.push(c);
1326
+ if (u = this.tokenizer.del(e)) {
1327
+ e = e.substring(u.raw.length), n.push(u);
1323
1328
  continue;
1324
1329
  }
1325
- if (c = this.tokenizer.autolink(e)) {
1326
- e = e.substring(c.raw.length), n.push(c);
1330
+ if (u = this.tokenizer.autolink(e)) {
1331
+ e = e.substring(u.raw.length), n.push(u);
1327
1332
  continue;
1328
1333
  }
1329
- if (!this.state.inLink && (c = this.tokenizer.url(e))) {
1330
- e = e.substring(c.raw.length), n.push(c);
1334
+ if (!this.state.inLink && (u = this.tokenizer.url(e))) {
1335
+ e = e.substring(u.raw.length), n.push(u);
1331
1336
  continue;
1332
1337
  }
1333
- let d = e;
1338
+ let f = e;
1334
1339
  if ((l = this.options.extensions) != null && l.startInline) {
1335
1340
  let h = 1 / 0;
1336
- const x = e.slice(1);
1337
- let f;
1338
- this.options.extensions.startInline.forEach((k) => {
1339
- f = k.call({ lexer: this }, x), typeof f == "number" && f >= 0 && (h = Math.min(h, f));
1340
- }), h < 1 / 0 && h >= 0 && (d = e.substring(0, h + 1));
1341
+ const v = e.slice(1);
1342
+ let g;
1343
+ this.options.extensions.startInline.forEach((m) => {
1344
+ g = m.call({ lexer: this }, v), typeof g == "number" && g >= 0 && (h = Math.min(h, g));
1345
+ }), h < 1 / 0 && h >= 0 && (f = e.substring(0, h + 1));
1341
1346
  }
1342
- if (c = this.tokenizer.inlineText(d)) {
1343
- e = e.substring(c.raw.length), c.raw.slice(-1) !== "_" && (o = c.raw.slice(-1)), s = !0;
1347
+ if (u = this.tokenizer.inlineText(f)) {
1348
+ e = e.substring(u.raw.length), u.raw.slice(-1) !== "_" && (s = u.raw.slice(-1)), o = !0;
1344
1349
  const h = n.at(-1);
1345
- (h == null ? void 0 : h.type) === "text" ? (h.raw += c.raw, h.text += c.text) : n.push(c);
1350
+ (h == null ? void 0 : h.type) === "text" ? (h.raw += u.raw, h.text += u.text) : n.push(u);
1346
1351
  continue;
1347
1352
  }
1348
1353
  if (e) {
@@ -1356,22 +1361,22 @@ ${c}` : c;
1356
1361
  }
1357
1362
  return n;
1358
1363
  }
1359
- }, G = class {
1364
+ }, Z = class {
1360
1365
  // set by the parser
1361
1366
  constructor(t) {
1362
- g(this, "options");
1363
- g(this, "parser");
1364
- this.options = t || L;
1367
+ b(this, "options");
1368
+ b(this, "parser");
1369
+ this.options = t || B;
1365
1370
  }
1366
1371
  space(t) {
1367
1372
  return "";
1368
1373
  }
1369
1374
  code({ text: t, lang: e, escaped: n }) {
1370
- var s;
1371
- const r = (s = (e || "").match(y.notSpaceStart)) == null ? void 0 : s[0], i = t.replace(y.endingNewline, "") + `
1375
+ var o;
1376
+ const r = (o = (e || "").match(T.notSpaceStart)) == null ? void 0 : o[0], i = t.replace(T.endingNewline, "") + `
1372
1377
  `;
1373
- return r ? '<pre><code class="language-' + $(r) + '">' + (n ? i : $(i, !0)) + `</code></pre>
1374
- ` : "<pre><code>" + (n ? i : $(i, !0)) + `</code></pre>
1378
+ return r ? '<pre><code class="language-' + L(r) + '">' + (n ? i : L(i, !0)) + `</code></pre>
1379
+ ` : "<pre><code>" + (n ? i : L(i, !0)) + `</code></pre>
1375
1380
  `;
1376
1381
  }
1377
1382
  blockquote({ tokens: t }) {
@@ -1393,12 +1398,12 @@ ${this.parser.parse(t)}</blockquote>
1393
1398
  list(t) {
1394
1399
  const e = t.ordered, n = t.start;
1395
1400
  let r = "";
1396
- for (let o = 0; o < t.items.length; o++) {
1397
- const a = t.items[o];
1401
+ for (let s = 0; s < t.items.length; s++) {
1402
+ const a = t.items[s];
1398
1403
  r += this.listitem(a);
1399
1404
  }
1400
- const i = e ? "ol" : "ul", s = e && n !== 1 ? ' start="' + n + '"' : "";
1401
- return "<" + i + s + `>
1405
+ const i = e ? "ol" : "ul", o = e && n !== 1 ? ' start="' + n + '"' : "";
1406
+ return "<" + i + o + `>
1402
1407
  ` + r + "</" + i + `>
1403
1408
  `;
1404
1409
  }
@@ -1407,7 +1412,7 @@ ${this.parser.parse(t)}</blockquote>
1407
1412
  let e = "";
1408
1413
  if (t.task) {
1409
1414
  const r = this.checkbox({ checked: !!t.checked });
1410
- t.loose ? ((n = t.tokens[0]) == null ? void 0 : n.type) === "paragraph" ? (t.tokens[0].text = r + " " + t.tokens[0].text, t.tokens[0].tokens && t.tokens[0].tokens.length > 0 && t.tokens[0].tokens[0].type === "text" && (t.tokens[0].tokens[0].text = r + " " + $(t.tokens[0].tokens[0].text), t.tokens[0].tokens[0].escaped = !0)) : t.tokens.unshift({
1415
+ t.loose ? ((n = t.tokens[0]) == null ? void 0 : n.type) === "paragraph" ? (t.tokens[0].text = r + " " + t.tokens[0].text, t.tokens[0].tokens && t.tokens[0].tokens.length > 0 && t.tokens[0].tokens[0].type === "text" && (t.tokens[0].tokens[0].text = r + " " + L(t.tokens[0].tokens[0].text), t.tokens[0].tokens[0].escaped = !0)) : t.tokens.unshift({
1411
1416
  type: "text",
1412
1417
  raw: r + " ",
1413
1418
  text: r + " ",
@@ -1431,10 +1436,10 @@ ${this.parser.parse(t)}</blockquote>
1431
1436
  e += this.tablerow({ text: n });
1432
1437
  let r = "";
1433
1438
  for (let i = 0; i < t.rows.length; i++) {
1434
- const s = t.rows[i];
1439
+ const o = t.rows[i];
1435
1440
  n = "";
1436
- for (let o = 0; o < s.length; o++)
1437
- n += this.tablecell(s[o]);
1441
+ for (let s = 0; s < o.length; s++)
1442
+ n += this.tablecell(o[s]);
1438
1443
  r += this.tablerow({ text: n });
1439
1444
  }
1440
1445
  return r && (r = `<tbody>${r}</tbody>`), `<table>
@@ -1463,7 +1468,7 @@ ${t}</tr>
1463
1468
  return `<em>${this.parser.parseInline(t)}</em>`;
1464
1469
  }
1465
1470
  codespan({ text: t }) {
1466
- return `<code>${$(t, !0)}</code>`;
1471
+ return `<code>${L(t, !0)}</code>`;
1467
1472
  }
1468
1473
  br(t) {
1469
1474
  return "<br>";
@@ -1472,26 +1477,26 @@ ${t}</tr>
1472
1477
  return `<del>${this.parser.parseInline(t)}</del>`;
1473
1478
  }
1474
1479
  link({ href: t, title: e, tokens: n }) {
1475
- const r = this.parser.parseInline(n), i = we(t);
1480
+ const r = this.parser.parseInline(n), i = Te(t);
1476
1481
  if (i === null)
1477
1482
  return r;
1478
1483
  t = i;
1479
- let s = '<a href="' + t + '"';
1480
- return e && (s += ' title="' + $(e) + '"'), s += ">" + r + "</a>", s;
1484
+ let o = '<a href="' + t + '"';
1485
+ return e && (o += ' title="' + L(e) + '"'), o += ">" + r + "</a>", o;
1481
1486
  }
1482
1487
  image({ href: t, title: e, text: n, tokens: r }) {
1483
1488
  r && (n = this.parser.parseInline(r, this.parser.textRenderer));
1484
- const i = we(t);
1489
+ const i = Te(t);
1485
1490
  if (i === null)
1486
- return $(n);
1491
+ return L(n);
1487
1492
  t = i;
1488
- let s = `<img src="${t}" alt="${n}"`;
1489
- return e && (s += ` title="${$(e)}"`), s += ">", s;
1493
+ let o = `<img src="${t}" alt="${n}"`;
1494
+ return e && (o += ` title="${L(e)}"`), o += ">", o;
1490
1495
  }
1491
1496
  text(t) {
1492
- return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : $(t.text);
1497
+ return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : L(t.text);
1493
1498
  }
1494
- }, me = class {
1499
+ }, Se = class {
1495
1500
  // no need for block level renderers
1496
1501
  strong({ text: t }) {
1497
1502
  return t;
@@ -1520,93 +1525,93 @@ ${t}</tr>
1520
1525
  br() {
1521
1526
  return "";
1522
1527
  }
1523
- }, C = class re {
1528
+ }, A = class le {
1524
1529
  constructor(e) {
1525
- g(this, "options");
1526
- g(this, "renderer");
1527
- g(this, "textRenderer");
1528
- this.options = e || L, this.options.renderer = this.options.renderer || new G(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new me();
1530
+ b(this, "options");
1531
+ b(this, "renderer");
1532
+ b(this, "textRenderer");
1533
+ this.options = e || B, this.options.renderer = this.options.renderer || new Z(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Se();
1529
1534
  }
1530
1535
  /**
1531
1536
  * Static Parse Method
1532
1537
  */
1533
1538
  static parse(e, n) {
1534
- return new re(n).parse(e);
1539
+ return new le(n).parse(e);
1535
1540
  }
1536
1541
  /**
1537
1542
  * Static Parse Inline Method
1538
1543
  */
1539
1544
  static parseInline(e, n) {
1540
- return new re(n).parseInline(e);
1545
+ return new le(n).parseInline(e);
1541
1546
  }
1542
1547
  /**
1543
1548
  * Parse Loop
1544
1549
  */
1545
1550
  parse(e, n = !0) {
1546
- var i, s;
1551
+ var i, o;
1547
1552
  let r = "";
1548
- for (let o = 0; o < e.length; o++) {
1549
- const a = e[o];
1550
- if ((s = (i = this.options.extensions) == null ? void 0 : i.renderers) != null && s[a.type]) {
1551
- const l = a, c = this.options.extensions.renderers[l.type].call({ parser: this }, l);
1552
- if (c !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(l.type)) {
1553
- r += c || "";
1553
+ for (let s = 0; s < e.length; s++) {
1554
+ const a = e[s];
1555
+ if ((o = (i = this.options.extensions) == null ? void 0 : i.renderers) != null && o[a.type]) {
1556
+ const l = a, u = this.options.extensions.renderers[l.type].call({ parser: this }, l);
1557
+ if (u !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(l.type)) {
1558
+ r += u || "";
1554
1559
  continue;
1555
1560
  }
1556
1561
  }
1557
- const p = a;
1558
- switch (p.type) {
1562
+ const c = a;
1563
+ switch (c.type) {
1559
1564
  case "space": {
1560
- r += this.renderer.space(p);
1565
+ r += this.renderer.space(c);
1561
1566
  continue;
1562
1567
  }
1563
1568
  case "hr": {
1564
- r += this.renderer.hr(p);
1569
+ r += this.renderer.hr(c);
1565
1570
  continue;
1566
1571
  }
1567
1572
  case "heading": {
1568
- r += this.renderer.heading(p);
1573
+ r += this.renderer.heading(c);
1569
1574
  continue;
1570
1575
  }
1571
1576
  case "code": {
1572
- r += this.renderer.code(p);
1577
+ r += this.renderer.code(c);
1573
1578
  continue;
1574
1579
  }
1575
1580
  case "table": {
1576
- r += this.renderer.table(p);
1581
+ r += this.renderer.table(c);
1577
1582
  continue;
1578
1583
  }
1579
1584
  case "blockquote": {
1580
- r += this.renderer.blockquote(p);
1585
+ r += this.renderer.blockquote(c);
1581
1586
  continue;
1582
1587
  }
1583
1588
  case "list": {
1584
- r += this.renderer.list(p);
1589
+ r += this.renderer.list(c);
1585
1590
  continue;
1586
1591
  }
1587
1592
  case "html": {
1588
- r += this.renderer.html(p);
1593
+ r += this.renderer.html(c);
1589
1594
  continue;
1590
1595
  }
1591
1596
  case "paragraph": {
1592
- r += this.renderer.paragraph(p);
1597
+ r += this.renderer.paragraph(c);
1593
1598
  continue;
1594
1599
  }
1595
1600
  case "text": {
1596
- let l = p, c = this.renderer.text(l);
1597
- for (; o + 1 < e.length && e[o + 1].type === "text"; )
1598
- l = e[++o], c += `
1601
+ let l = c, u = this.renderer.text(l);
1602
+ for (; s + 1 < e.length && e[s + 1].type === "text"; )
1603
+ l = e[++s], u += `
1599
1604
  ` + this.renderer.text(l);
1600
1605
  n ? r += this.renderer.paragraph({
1601
1606
  type: "paragraph",
1602
- raw: c,
1603
- text: c,
1604
- tokens: [{ type: "text", raw: c, text: c, escaped: !0 }]
1605
- }) : r += c;
1607
+ raw: u,
1608
+ text: u,
1609
+ tokens: [{ type: "text", raw: u, text: u, escaped: !0 }]
1610
+ }) : r += u;
1606
1611
  continue;
1607
1612
  }
1608
1613
  default: {
1609
- const l = 'Token with "' + p.type + '" type was not found.';
1614
+ const l = 'Token with "' + c.type + '" type was not found.';
1610
1615
  if (this.options.silent)
1611
1616
  return console.error(l), "";
1612
1617
  throw new Error(l);
@@ -1619,61 +1624,61 @@ ${t}</tr>
1619
1624
  * Parse Inline Tokens
1620
1625
  */
1621
1626
  parseInline(e, n = this.renderer) {
1622
- var i, s;
1627
+ var i, o;
1623
1628
  let r = "";
1624
- for (let o = 0; o < e.length; o++) {
1625
- const a = e[o];
1626
- if ((s = (i = this.options.extensions) == null ? void 0 : i.renderers) != null && s[a.type]) {
1629
+ for (let s = 0; s < e.length; s++) {
1630
+ const a = e[s];
1631
+ if ((o = (i = this.options.extensions) == null ? void 0 : i.renderers) != null && o[a.type]) {
1627
1632
  const l = this.options.extensions.renderers[a.type].call({ parser: this }, a);
1628
1633
  if (l !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(a.type)) {
1629
1634
  r += l || "";
1630
1635
  continue;
1631
1636
  }
1632
1637
  }
1633
- const p = a;
1634
- switch (p.type) {
1638
+ const c = a;
1639
+ switch (c.type) {
1635
1640
  case "escape": {
1636
- r += n.text(p);
1641
+ r += n.text(c);
1637
1642
  break;
1638
1643
  }
1639
1644
  case "html": {
1640
- r += n.html(p);
1645
+ r += n.html(c);
1641
1646
  break;
1642
1647
  }
1643
1648
  case "link": {
1644
- r += n.link(p);
1649
+ r += n.link(c);
1645
1650
  break;
1646
1651
  }
1647
1652
  case "image": {
1648
- r += n.image(p);
1653
+ r += n.image(c);
1649
1654
  break;
1650
1655
  }
1651
1656
  case "strong": {
1652
- r += n.strong(p);
1657
+ r += n.strong(c);
1653
1658
  break;
1654
1659
  }
1655
1660
  case "em": {
1656
- r += n.em(p);
1661
+ r += n.em(c);
1657
1662
  break;
1658
1663
  }
1659
1664
  case "codespan": {
1660
- r += n.codespan(p);
1665
+ r += n.codespan(c);
1661
1666
  break;
1662
1667
  }
1663
1668
  case "br": {
1664
- r += n.br(p);
1669
+ r += n.br(c);
1665
1670
  break;
1666
1671
  }
1667
1672
  case "del": {
1668
- r += n.del(p);
1673
+ r += n.del(c);
1669
1674
  break;
1670
1675
  }
1671
1676
  case "text": {
1672
- r += n.text(p);
1677
+ r += n.text(c);
1673
1678
  break;
1674
1679
  }
1675
1680
  default: {
1676
- const l = 'Token with "' + p.type + '" type was not found.';
1681
+ const l = 'Token with "' + c.type + '" type was not found.';
1677
1682
  if (this.options.silent)
1678
1683
  return console.error(l), "";
1679
1684
  throw new Error(l);
@@ -1682,11 +1687,11 @@ ${t}</tr>
1682
1687
  }
1683
1688
  return r;
1684
1689
  }
1685
- }, K, W = (K = class {
1690
+ }, te, W = (te = class {
1686
1691
  constructor(t) {
1687
- g(this, "options");
1688
- g(this, "block");
1689
- this.options = t || L;
1692
+ b(this, "options");
1693
+ b(this, "block");
1694
+ this.options = t || B;
1690
1695
  }
1691
1696
  /**
1692
1697
  * Process markdown before marked
@@ -1710,30 +1715,30 @@ ${t}</tr>
1710
1715
  * Provide function to tokenize markdown
1711
1716
  */
1712
1717
  provideLexer() {
1713
- return this.block ? z.lex : z.lexInline;
1718
+ return this.block ? O.lex : O.lexInline;
1714
1719
  }
1715
1720
  /**
1716
1721
  * Provide function to parse tokens
1717
1722
  */
1718
1723
  provideParser() {
1719
- return this.block ? C.parse : C.parseInline;
1724
+ return this.block ? A.parse : A.parseInline;
1720
1725
  }
1721
- }, g(K, "passThroughHooks", /* @__PURE__ */ new Set([
1726
+ }, b(te, "passThroughHooks", /* @__PURE__ */ new Set([
1722
1727
  "preprocess",
1723
1728
  "postprocess",
1724
1729
  "processAllTokens"
1725
- ])), K), Ht = class {
1730
+ ])), te), sn = class {
1726
1731
  constructor(...t) {
1727
- g(this, "defaults", oe());
1728
- g(this, "options", this.setOptions);
1729
- g(this, "parse", this.parseMarkdown(!0));
1730
- g(this, "parseInline", this.parseMarkdown(!1));
1731
- g(this, "Parser", C);
1732
- g(this, "Renderer", G);
1733
- g(this, "TextRenderer", me);
1734
- g(this, "Lexer", z);
1735
- g(this, "Tokenizer", Z);
1736
- g(this, "Hooks", W);
1732
+ b(this, "defaults", ge());
1733
+ b(this, "options", this.setOptions);
1734
+ b(this, "parse", this.parseMarkdown(!0));
1735
+ b(this, "parseInline", this.parseMarkdown(!1));
1736
+ b(this, "Parser", A);
1737
+ b(this, "Renderer", Z);
1738
+ b(this, "TextRenderer", Se);
1739
+ b(this, "Lexer", O);
1740
+ b(this, "Tokenizer", V);
1741
+ b(this, "Hooks", W);
1737
1742
  this.use(...t);
1738
1743
  }
1739
1744
  /**
@@ -1742,28 +1747,28 @@ ${t}</tr>
1742
1747
  walkTokens(t, e) {
1743
1748
  var r, i;
1744
1749
  let n = [];
1745
- for (const s of t)
1746
- switch (n = n.concat(e.call(this, s)), s.type) {
1750
+ for (const o of t)
1751
+ switch (n = n.concat(e.call(this, o)), o.type) {
1747
1752
  case "table": {
1748
- const o = s;
1749
- for (const a of o.header)
1753
+ const s = o;
1754
+ for (const a of s.header)
1750
1755
  n = n.concat(this.walkTokens(a.tokens, e));
1751
- for (const a of o.rows)
1752
- for (const p of a)
1753
- n = n.concat(this.walkTokens(p.tokens, e));
1756
+ for (const a of s.rows)
1757
+ for (const c of a)
1758
+ n = n.concat(this.walkTokens(c.tokens, e));
1754
1759
  break;
1755
1760
  }
1756
1761
  case "list": {
1757
- const o = s;
1758
- n = n.concat(this.walkTokens(o.items, e));
1762
+ const s = o;
1763
+ n = n.concat(this.walkTokens(s.items, e));
1759
1764
  break;
1760
1765
  }
1761
1766
  default: {
1762
- const o = s;
1763
- (i = (r = this.defaults.extensions) == null ? void 0 : r.childTokens) != null && i[o.type] ? this.defaults.extensions.childTokens[o.type].forEach((a) => {
1764
- const p = o[a].flat(1 / 0);
1765
- n = n.concat(this.walkTokens(p, e));
1766
- }) : o.tokens && (n = n.concat(this.walkTokens(o.tokens, e)));
1767
+ const s = o;
1768
+ (i = (r = this.defaults.extensions) == null ? void 0 : r.childTokens) != null && i[s.type] ? this.defaults.extensions.childTokens[s.type].forEach((a) => {
1769
+ const c = s[a].flat(1 / 0);
1770
+ n = n.concat(this.walkTokens(c, e));
1771
+ }) : s.tokens && (n = n.concat(this.walkTokens(s.tokens, e)));
1767
1772
  }
1768
1773
  }
1769
1774
  return n;
@@ -1776,74 +1781,74 @@ ${t}</tr>
1776
1781
  if (!i.name)
1777
1782
  throw new Error("extension name required");
1778
1783
  if ("renderer" in i) {
1779
- const s = e.renderers[i.name];
1780
- s ? e.renderers[i.name] = function(...o) {
1781
- let a = i.renderer.apply(this, o);
1782
- return a === !1 && (a = s.apply(this, o)), a;
1784
+ const o = e.renderers[i.name];
1785
+ o ? e.renderers[i.name] = function(...s) {
1786
+ let a = i.renderer.apply(this, s);
1787
+ return a === !1 && (a = o.apply(this, s)), a;
1783
1788
  } : e.renderers[i.name] = i.renderer;
1784
1789
  }
1785
1790
  if ("tokenizer" in i) {
1786
1791
  if (!i.level || i.level !== "block" && i.level !== "inline")
1787
1792
  throw new Error("extension level must be 'block' or 'inline'");
1788
- const s = e[i.level];
1789
- s ? s.unshift(i.tokenizer) : e[i.level] = [i.tokenizer], i.start && (i.level === "block" ? e.startBlock ? e.startBlock.push(i.start) : e.startBlock = [i.start] : i.level === "inline" && (e.startInline ? e.startInline.push(i.start) : e.startInline = [i.start]));
1793
+ const o = e[i.level];
1794
+ o ? o.unshift(i.tokenizer) : e[i.level] = [i.tokenizer], i.start && (i.level === "block" ? e.startBlock ? e.startBlock.push(i.start) : e.startBlock = [i.start] : i.level === "inline" && (e.startInline ? e.startInline.push(i.start) : e.startInline = [i.start]));
1790
1795
  }
1791
1796
  "childTokens" in i && i.childTokens && (e.childTokens[i.name] = i.childTokens);
1792
1797
  }), r.extensions = e), n.renderer) {
1793
- const i = this.defaults.renderer || new G(this.defaults);
1794
- for (const s in n.renderer) {
1795
- if (!(s in i))
1796
- throw new Error(`renderer '${s}' does not exist`);
1797
- if (["options", "parser"].includes(s))
1798
+ const i = this.defaults.renderer || new Z(this.defaults);
1799
+ for (const o in n.renderer) {
1800
+ if (!(o in i))
1801
+ throw new Error(`renderer '${o}' does not exist`);
1802
+ if (["options", "parser"].includes(o))
1798
1803
  continue;
1799
- const o = s, a = n.renderer[o], p = i[o];
1800
- i[o] = (...l) => {
1801
- let c = a.apply(i, l);
1802
- return c === !1 && (c = p.apply(i, l)), c || "";
1804
+ const s = o, a = n.renderer[s], c = i[s];
1805
+ i[s] = (...l) => {
1806
+ let u = a.apply(i, l);
1807
+ return u === !1 && (u = c.apply(i, l)), u || "";
1803
1808
  };
1804
1809
  }
1805
1810
  r.renderer = i;
1806
1811
  }
1807
1812
  if (n.tokenizer) {
1808
- const i = this.defaults.tokenizer || new Z(this.defaults);
1809
- for (const s in n.tokenizer) {
1810
- if (!(s in i))
1811
- throw new Error(`tokenizer '${s}' does not exist`);
1812
- if (["options", "rules", "lexer"].includes(s))
1813
+ const i = this.defaults.tokenizer || new V(this.defaults);
1814
+ for (const o in n.tokenizer) {
1815
+ if (!(o in i))
1816
+ throw new Error(`tokenizer '${o}' does not exist`);
1817
+ if (["options", "rules", "lexer"].includes(o))
1813
1818
  continue;
1814
- const o = s, a = n.tokenizer[o], p = i[o];
1815
- i[o] = (...l) => {
1816
- let c = a.apply(i, l);
1817
- return c === !1 && (c = p.apply(i, l)), c;
1819
+ const s = o, a = n.tokenizer[s], c = i[s];
1820
+ i[s] = (...l) => {
1821
+ let u = a.apply(i, l);
1822
+ return u === !1 && (u = c.apply(i, l)), u;
1818
1823
  };
1819
1824
  }
1820
1825
  r.tokenizer = i;
1821
1826
  }
1822
1827
  if (n.hooks) {
1823
1828
  const i = this.defaults.hooks || new W();
1824
- for (const s in n.hooks) {
1825
- if (!(s in i))
1826
- throw new Error(`hook '${s}' does not exist`);
1827
- if (["options", "block"].includes(s))
1829
+ for (const o in n.hooks) {
1830
+ if (!(o in i))
1831
+ throw new Error(`hook '${o}' does not exist`);
1832
+ if (["options", "block"].includes(o))
1828
1833
  continue;
1829
- const o = s, a = n.hooks[o], p = i[o];
1830
- W.passThroughHooks.has(s) ? i[o] = (l) => {
1834
+ const s = o, a = n.hooks[s], c = i[s];
1835
+ W.passThroughHooks.has(o) ? i[s] = (l) => {
1831
1836
  if (this.defaults.async)
1832
- return Promise.resolve(a.call(i, l)).then((d) => p.call(i, d));
1833
- const c = a.call(i, l);
1834
- return p.call(i, c);
1835
- } : i[o] = (...l) => {
1836
- let c = a.apply(i, l);
1837
- return c === !1 && (c = p.apply(i, l)), c;
1837
+ return Promise.resolve(a.call(i, l)).then((f) => c.call(i, f));
1838
+ const u = a.call(i, l);
1839
+ return c.call(i, u);
1840
+ } : i[s] = (...l) => {
1841
+ let u = a.apply(i, l);
1842
+ return u === !1 && (u = c.apply(i, l)), u;
1838
1843
  };
1839
1844
  }
1840
1845
  r.hooks = i;
1841
1846
  }
1842
1847
  if (n.walkTokens) {
1843
- const i = this.defaults.walkTokens, s = n.walkTokens;
1844
- r.walkTokens = function(o) {
1848
+ const i = this.defaults.walkTokens, o = n.walkTokens;
1849
+ r.walkTokens = function(s) {
1845
1850
  let a = [];
1846
- return a.push(s.call(this, o)), i && (a = a.concat(i.call(this, o))), a;
1851
+ return a.push(o.call(this, s)), i && (a = a.concat(i.call(this, s))), a;
1847
1852
  };
1848
1853
  }
1849
1854
  this.defaults = { ...this.defaults, ...r };
@@ -1853,32 +1858,32 @@ ${t}</tr>
1853
1858
  return this.defaults = { ...this.defaults, ...t }, this;
1854
1859
  }
1855
1860
  lexer(t, e) {
1856
- return z.lex(t, e ?? this.defaults);
1861
+ return O.lex(t, e ?? this.defaults);
1857
1862
  }
1858
1863
  parser(t, e) {
1859
- return C.parse(t, e ?? this.defaults);
1864
+ return A.parse(t, e ?? this.defaults);
1860
1865
  }
1861
1866
  parseMarkdown(t) {
1862
1867
  return (n, r) => {
1863
- const i = { ...r }, s = { ...this.defaults, ...i }, o = this.onError(!!s.silent, !!s.async);
1868
+ const i = { ...r }, o = { ...this.defaults, ...i }, s = this.onError(!!o.silent, !!o.async);
1864
1869
  if (this.defaults.async === !0 && i.async === !1)
1865
- return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
1870
+ return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
1866
1871
  if (typeof n > "u" || n === null)
1867
- return o(new Error("marked(): input parameter is undefined or null"));
1872
+ return s(new Error("marked(): input parameter is undefined or null"));
1868
1873
  if (typeof n != "string")
1869
- return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
1870
- s.hooks && (s.hooks.options = s, s.hooks.block = t);
1871
- const a = s.hooks ? s.hooks.provideLexer() : t ? z.lex : z.lexInline, p = s.hooks ? s.hooks.provideParser() : t ? C.parse : C.parseInline;
1872
- if (s.async)
1873
- return Promise.resolve(s.hooks ? s.hooks.preprocess(n) : n).then((l) => a(l, s)).then((l) => s.hooks ? s.hooks.processAllTokens(l) : l).then((l) => s.walkTokens ? Promise.all(this.walkTokens(l, s.walkTokens)).then(() => l) : l).then((l) => p(l, s)).then((l) => s.hooks ? s.hooks.postprocess(l) : l).catch(o);
1874
+ return s(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
1875
+ o.hooks && (o.hooks.options = o, o.hooks.block = t);
1876
+ const a = o.hooks ? o.hooks.provideLexer() : t ? O.lex : O.lexInline, c = o.hooks ? o.hooks.provideParser() : t ? A.parse : A.parseInline;
1877
+ if (o.async)
1878
+ return Promise.resolve(o.hooks ? o.hooks.preprocess(n) : n).then((l) => a(l, o)).then((l) => o.hooks ? o.hooks.processAllTokens(l) : l).then((l) => o.walkTokens ? Promise.all(this.walkTokens(l, o.walkTokens)).then(() => l) : l).then((l) => c(l, o)).then((l) => o.hooks ? o.hooks.postprocess(l) : l).catch(s);
1874
1879
  try {
1875
- s.hooks && (n = s.hooks.preprocess(n));
1876
- let l = a(n, s);
1877
- s.hooks && (l = s.hooks.processAllTokens(l)), s.walkTokens && this.walkTokens(l, s.walkTokens);
1878
- let c = p(l, s);
1879
- return s.hooks && (c = s.hooks.postprocess(c)), c;
1880
+ o.hooks && (n = o.hooks.preprocess(n));
1881
+ let l = a(n, o);
1882
+ o.hooks && (l = o.hooks.processAllTokens(l)), o.walkTokens && this.walkTokens(l, o.walkTokens);
1883
+ let u = c(l, o);
1884
+ return o.hooks && (u = o.hooks.postprocess(u)), u;
1880
1885
  } catch (l) {
1881
- return o(l);
1886
+ return s(l);
1882
1887
  }
1883
1888
  };
1884
1889
  }
@@ -1886,7 +1891,7 @@ ${t}</tr>
1886
1891
  return (n) => {
1887
1892
  if (n.message += `
1888
1893
  Please report this to https://github.com/markedjs/marked.`, t) {
1889
- const r = "<p>An error occurred:</p><pre>" + $(n.message + "", !0) + "</pre>";
1894
+ const r = "<p>An error occurred:</p><pre>" + L(n.message + "", !0) + "</pre>";
1890
1895
  return e ? Promise.resolve(r) : r;
1891
1896
  }
1892
1897
  if (e)
@@ -1894,39 +1899,39 @@ Please report this to https://github.com/markedjs/marked.`, t) {
1894
1899
  throw n;
1895
1900
  };
1896
1901
  }
1897
- }, I = new Ht();
1898
- function m(t, e) {
1899
- return I.parse(t, e);
1902
+ }, D = new sn();
1903
+ function y(t, e) {
1904
+ return D.parse(t, e);
1900
1905
  }
1901
- m.options = m.setOptions = function(t) {
1902
- return I.setOptions(t), m.defaults = I.defaults, $e(m.defaults), m;
1906
+ y.options = y.setOptions = function(t) {
1907
+ return D.setOptions(t), y.defaults = D.defaults, He(y.defaults), y;
1903
1908
  };
1904
- m.getDefaults = oe;
1905
- m.defaults = L;
1906
- m.use = function(...t) {
1907
- return I.use(...t), m.defaults = I.defaults, $e(m.defaults), m;
1909
+ y.getDefaults = ge;
1910
+ y.defaults = B;
1911
+ y.use = function(...t) {
1912
+ return D.use(...t), y.defaults = D.defaults, He(y.defaults), y;
1908
1913
  };
1909
- m.walkTokens = function(t, e) {
1910
- return I.walkTokens(t, e);
1914
+ y.walkTokens = function(t, e) {
1915
+ return D.walkTokens(t, e);
1911
1916
  };
1912
- m.parseInline = I.parseInline;
1913
- m.Parser = C;
1914
- m.parser = C.parse;
1915
- m.Renderer = G;
1916
- m.TextRenderer = me;
1917
- m.Lexer = z;
1918
- m.lexer = z.lex;
1919
- m.Tokenizer = Z;
1920
- m.Hooks = W;
1921
- m.parse = m;
1922
- m.options;
1923
- m.setOptions;
1924
- m.use;
1925
- m.walkTokens;
1926
- m.parseInline;
1927
- C.parse;
1928
- z.lex;
1929
- const Se = ({ data: t, style: e }) => /* @__PURE__ */ u.createElement(
1917
+ y.parseInline = D.parseInline;
1918
+ y.Parser = A;
1919
+ y.parser = A.parse;
1920
+ y.Renderer = Z;
1921
+ y.TextRenderer = Se;
1922
+ y.Lexer = O;
1923
+ y.lexer = O.lex;
1924
+ y.Tokenizer = V;
1925
+ y.Hooks = W;
1926
+ y.parse = y;
1927
+ y.options;
1928
+ y.setOptions;
1929
+ y.use;
1930
+ y.walkTokens;
1931
+ y.parseInline;
1932
+ A.parse;
1933
+ O.lex;
1934
+ const ze = ({ data: t, style: e }) => /* @__PURE__ */ d.createElement(
1930
1935
  "div",
1931
1936
  {
1932
1937
  style: {
@@ -1934,29 +1939,60 @@ const Se = ({ data: t, style: e }) => /* @__PURE__ */ u.createElement(
1934
1939
  ...e
1935
1940
  }
1936
1941
  },
1937
- t && t.subject ? /* @__PURE__ */ u.createElement(
1942
+ t && t.subject ? /* @__PURE__ */ d.createElement(
1938
1943
  "div",
1939
1944
  {
1940
1945
  dangerouslySetInnerHTML: {
1941
- __html: m.parse(t.body, { async: !1 })
1946
+ __html: y.parse(t.body, { async: !1 })
1942
1947
  }
1943
1948
  }
1944
- ) : /* @__PURE__ */ u.createElement("p", { style: { margin: 0, whiteSpace: "pre-wrap" } }, t ? t.question : "")
1945
- ), Wt = ({
1949
+ ) : /* @__PURE__ */ d.createElement("p", { style: { margin: 0, whiteSpace: "pre-wrap" } }, t ? t.question : "")
1950
+ ), Ye = ({
1951
+ size: t = 40,
1952
+ color: e = "var(--primary-main)",
1953
+ thickness: n = 3.6
1954
+ }) => {
1955
+ const i = 2 * Math.PI * 20;
1956
+ return /* @__PURE__ */ E.createElement(
1957
+ "div",
1958
+ {
1959
+ className: "circular-container",
1960
+ style: { width: t, height: t },
1961
+ role: "progressbar"
1962
+ },
1963
+ /* @__PURE__ */ E.createElement("svg", { className: "circular-svg", viewBox: "22 22 44 44" }, /* @__PURE__ */ E.createElement(
1964
+ "circle",
1965
+ {
1966
+ className: "circular-circle",
1967
+ cx: "44",
1968
+ cy: "44",
1969
+ r: 20,
1970
+ fill: "none",
1971
+ stroke: e,
1972
+ strokeWidth: n,
1973
+ strokeDasharray: i,
1974
+ style: {
1975
+ strokeDashoffset: i * 0.7
1976
+ // Độ dài của thanh loading
1977
+ }
1978
+ }
1979
+ ))
1980
+ );
1981
+ }, an = ({
1946
1982
  items: t,
1947
1983
  onApply: e,
1948
1984
  getEditorContent: n
1949
1985
  }) => {
1950
1986
  const r = async (i) => {
1951
- const s = /제목:[^\n]*/g;
1952
- ((s.exec(i) || [])[0] || "").replace("제목: ", "").replace(`
1987
+ const o = /제목:[^\n]*/g;
1988
+ ((o.exec(i) || [])[0] || "").replace("제목: ", "").replace(`
1953
1989
  `, "");
1954
- const a = i.replace(s, "").replace("본문: ", "");
1955
- let p = await m.parse(a);
1956
- const l = /<!--HanbiroSignatureStart-->([\s\S]*?)<!--HanbiroSignatureEnd-->/g, c = n ? n() : "", d = l.exec(c) || [];
1957
- d[0] && (p = p + "<br>" + d[0]), e({ html: p });
1990
+ const a = i.replace(o, "").replace("본문: ", "");
1991
+ let c = await y.parse(a);
1992
+ const l = /<!--HanbiroSignatureStart-->([\s\S]*?)<!--HanbiroSignatureEnd-->/g, u = n ? n() : "", f = l.exec(u) || [];
1993
+ f[0] && (c = c + "<br>" + f[0]), e({ html: c });
1958
1994
  };
1959
- return /* @__PURE__ */ u.createElement(
1995
+ return /* @__PURE__ */ d.createElement(
1960
1996
  "div",
1961
1997
  {
1962
1998
  style: {
@@ -1971,7 +2007,7 @@ const Se = ({ data: t, style: e }) => /* @__PURE__ */ u.createElement(
1971
2007
  flexDirection: "column"
1972
2008
  }
1973
2009
  },
1974
- t && t.map((i) => /* @__PURE__ */ u.createElement(
2010
+ t && t.map((i) => /* @__PURE__ */ d.createElement(
1975
2011
  "div",
1976
2012
  {
1977
2013
  key: i.id,
@@ -1981,7 +2017,7 @@ const Se = ({ data: t, style: e }) => /* @__PURE__ */ u.createElement(
1981
2017
  marginBottom: 16
1982
2018
  }
1983
2019
  },
1984
- /* @__PURE__ */ u.createElement(
2020
+ /* @__PURE__ */ d.createElement(
1985
2021
  "div",
1986
2022
  {
1987
2023
  style: {
@@ -1993,8 +2029,8 @@ const Se = ({ data: t, style: e }) => /* @__PURE__ */ u.createElement(
1993
2029
  marginTop: 8
1994
2030
  }
1995
2031
  },
1996
- /* @__PURE__ */ u.createElement(
1997
- Se,
2032
+ /* @__PURE__ */ d.createElement(
2033
+ ze,
1998
2034
  {
1999
2035
  data: { question: i.question },
2000
2036
  style: {
@@ -2006,7 +2042,7 @@ const Se = ({ data: t, style: e }) => /* @__PURE__ */ u.createElement(
2006
2042
  }
2007
2043
  )
2008
2044
  ),
2009
- /* @__PURE__ */ u.createElement(
2045
+ /* @__PURE__ */ d.createElement(
2010
2046
  "div",
2011
2047
  {
2012
2048
  style: {
@@ -2018,17 +2054,7 @@ const Se = ({ data: t, style: e }) => /* @__PURE__ */ u.createElement(
2018
2054
  marginTop: 8
2019
2055
  }
2020
2056
  },
2021
- i.isLoading ? /* @__PURE__ */ u.createElement(
2022
- "div",
2023
- {
2024
- style: {
2025
- marginTop: 8,
2026
- fontStyle: "italic",
2027
- color: "var(--text-secondary)"
2028
- }
2029
- },
2030
- "Loading..."
2031
- ) : /* @__PURE__ */ u.createElement(
2057
+ i != null && i.isLoading ? /* @__PURE__ */ d.createElement(Ye, { size: 32 }) : /* @__PURE__ */ d.createElement(
2032
2058
  "div",
2033
2059
  {
2034
2060
  style: {
@@ -2038,8 +2064,8 @@ const Se = ({ data: t, style: e }) => /* @__PURE__ */ u.createElement(
2038
2064
  width: "100%"
2039
2065
  }
2040
2066
  },
2041
- /* @__PURE__ */ u.createElement(
2042
- Se,
2067
+ /* @__PURE__ */ d.createElement(
2068
+ ze,
2043
2069
  {
2044
2070
  data: { subject: i.subject, body: i.body },
2045
2071
  style: {
@@ -2051,46 +2077,775 @@ const Se = ({ data: t, style: e }) => /* @__PURE__ */ u.createElement(
2051
2077
  }
2052
2078
  }
2053
2079
  ),
2054
- /* @__PURE__ */ u.createElement(
2080
+ /* @__PURE__ */ d.createElement(
2055
2081
  "button",
2056
2082
  {
2057
2083
  type: "button",
2058
2084
  title: "Apply content",
2059
2085
  onClick: () => r(i.body),
2086
+ className: "icon-button small",
2060
2087
  style: {
2061
- marginLeft: 4,
2062
- background: "none",
2063
- border: "none",
2064
- cursor: "pointer",
2065
- display: "flex",
2066
- alignItems: "center",
2067
- justifyContent: "center",
2068
- padding: 8,
2069
- borderRadius: 4
2088
+ marginLeft: 4
2070
2089
  }
2071
2090
  },
2072
- /* @__PURE__ */ u.createElement(F, { size: 16, color: "#666" })
2091
+ /* @__PURE__ */ d.createElement(Q, { size: 16, color: "#666" })
2073
2092
  )
2074
2093
  )
2075
2094
  )
2076
2095
  ))
2077
2096
  );
2097
+ }, ln = {
2098
+ small: 28,
2099
+ medium: 40
2100
+ }, cn = ({
2101
+ style: t,
2102
+ fullHeight: e = !1,
2103
+ size: n = "medium",
2104
+ label: r
2105
+ }) => /* @__PURE__ */ E.createElement(
2106
+ "div",
2107
+ {
2108
+ style: {
2109
+ display: "flex",
2110
+ alignItems: "center",
2111
+ justifyContent: "center",
2112
+ width: "100%",
2113
+ height: e ? "100%" : 350,
2114
+ ...t
2115
+ }
2116
+ },
2117
+ /* @__PURE__ */ E.createElement(Ye, { size: ln[n] }),
2118
+ r && /* @__PURE__ */ E.createElement(
2119
+ "p",
2120
+ {
2121
+ color: "text.secondary",
2122
+ style: { marginTop: 16, fontSize: n === "small" ? 12 : 13 }
2123
+ },
2124
+ r
2125
+ )
2126
+ ), un = `
2127
+ ::-webkit-scrollbar,
2128
+ *::-webkit-scrollbar {
2129
+ width: 8px;
2130
+ height: 8px;
2131
+ }
2132
+
2133
+ *::-webkit-scrollbar-track {
2134
+ background: transparent;
2135
+ backdrop-filter: blur(6px);
2136
+ }
2137
+
2138
+ ::-webkit-scrollbar-thumb,
2139
+ *::-webkit-scrollbar-thumb {
2140
+ background: #e0e0e0;
2141
+ }
2142
+
2143
+ ::-webkit-scrollbar-thumb:focus,
2144
+ *::-webkit-scrollbar-thumb:focus {
2145
+ background: #bdbdbd;
2146
+ }
2147
+
2148
+ ::-webkit-scrollbar-thumb:active,
2149
+ *::-webkit-scrollbar-thumb:active {
2150
+ background: #bdbdbd;
2151
+ }
2152
+
2153
+ ::-webkit-scrollbar-thumb:hover,
2154
+ *::-webkit-scrollbar-thumb:hover {
2155
+ background: #bdbdbd;
2156
+ }
2157
+
2158
+ ::-webkit-scrollbar-corner,
2159
+ *::-webkit-scrollbar-corner {
2160
+ background-color: transparent;
2161
+ }
2162
+ `;
2163
+ var ce = function() {
2164
+ return ce = Object.assign || function(t) {
2165
+ for (var e, n = 1, r = arguments.length; n < r; n++) {
2166
+ e = arguments[n];
2167
+ for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
2168
+ }
2169
+ return t;
2170
+ }, ce.apply(this, arguments);
2171
+ }, Xe = {
2172
+ onActivate: p.func,
2173
+ onAddUndo: p.func,
2174
+ onBeforeAddUndo: p.func,
2175
+ onBeforeExecCommand: p.func,
2176
+ onBeforeGetContent: p.func,
2177
+ onBeforeRenderUI: p.func,
2178
+ onBeforeSetContent: p.func,
2179
+ onBeforePaste: p.func,
2180
+ onBlur: p.func,
2181
+ onChange: p.func,
2182
+ onClearUndos: p.func,
2183
+ onClick: p.func,
2184
+ onContextMenu: p.func,
2185
+ onCommentChange: p.func,
2186
+ onCopy: p.func,
2187
+ onCut: p.func,
2188
+ onDblclick: p.func,
2189
+ onDeactivate: p.func,
2190
+ onDirty: p.func,
2191
+ onDrag: p.func,
2192
+ onDragDrop: p.func,
2193
+ onDragEnd: p.func,
2194
+ onDragGesture: p.func,
2195
+ onDragOver: p.func,
2196
+ onDrop: p.func,
2197
+ onExecCommand: p.func,
2198
+ onFocus: p.func,
2199
+ onFocusIn: p.func,
2200
+ onFocusOut: p.func,
2201
+ onGetContent: p.func,
2202
+ onHide: p.func,
2203
+ onInit: p.func,
2204
+ onKeyDown: p.func,
2205
+ onKeyPress: p.func,
2206
+ onKeyUp: p.func,
2207
+ onLoadContent: p.func,
2208
+ onMouseDown: p.func,
2209
+ onMouseEnter: p.func,
2210
+ onMouseLeave: p.func,
2211
+ onMouseMove: p.func,
2212
+ onMouseOut: p.func,
2213
+ onMouseOver: p.func,
2214
+ onMouseUp: p.func,
2215
+ onNodeChange: p.func,
2216
+ onObjectResizeStart: p.func,
2217
+ onObjectResized: p.func,
2218
+ onObjectSelected: p.func,
2219
+ onPaste: p.func,
2220
+ onPostProcess: p.func,
2221
+ onPostRender: p.func,
2222
+ onPreProcess: p.func,
2223
+ onProgressState: p.func,
2224
+ onRedo: p.func,
2225
+ onRemove: p.func,
2226
+ onReset: p.func,
2227
+ onSaveContent: p.func,
2228
+ onSelectionChange: p.func,
2229
+ onSetAttrib: p.func,
2230
+ onSetContent: p.func,
2231
+ onShow: p.func,
2232
+ onSubmit: p.func,
2233
+ onUndo: p.func,
2234
+ onVisualAid: p.func,
2235
+ onSkinLoadError: p.func,
2236
+ onThemeLoadError: p.func,
2237
+ onModelLoadError: p.func,
2238
+ onPluginLoadError: p.func,
2239
+ onIconsLoadError: p.func,
2240
+ onLanguageLoadError: p.func,
2241
+ onScriptsLoad: p.func,
2242
+ onScriptsLoadError: p.func
2243
+ }, pn = ce({ apiKey: p.string, id: p.string, inline: p.bool, init: p.object, initialValue: p.string, onEditorChange: p.func, value: p.string, tagName: p.string, cloudChannel: p.string, plugins: p.oneOfType([p.string, p.array]), toolbar: p.oneOfType([p.string, p.array]), disabled: p.bool, textareaName: p.string, tinymceScriptSrc: p.oneOfType([
2244
+ p.string,
2245
+ p.arrayOf(p.string),
2246
+ p.arrayOf(p.shape({
2247
+ src: p.string,
2248
+ async: p.bool,
2249
+ defer: p.bool
2250
+ }))
2251
+ ]), rollback: p.oneOfType([p.number, p.oneOf([!1])]), scriptLoading: p.shape({
2252
+ async: p.bool,
2253
+ defer: p.bool,
2254
+ delay: p.number
2255
+ }) }, Xe), X = function(t) {
2256
+ return typeof t == "function";
2257
+ }, Le = function(t) {
2258
+ return t in Xe;
2259
+ }, Pe = function(t) {
2260
+ return t.substr(2);
2261
+ }, hn = function(t, e, n, r, i, o, s) {
2262
+ var a = Object.keys(i).filter(Le), c = Object.keys(o).filter(Le), l = a.filter(function(f) {
2263
+ return o[f] === void 0;
2264
+ }), u = c.filter(function(f) {
2265
+ return i[f] === void 0;
2266
+ });
2267
+ l.forEach(function(f) {
2268
+ var h = Pe(f), v = s[h];
2269
+ n(h, v), delete s[h];
2270
+ }), u.forEach(function(f) {
2271
+ var h = r(t, f), v = Pe(f);
2272
+ s[v] = h, e(v, h);
2273
+ });
2274
+ }, fn = function(t, e, n, r, i) {
2275
+ return hn(
2276
+ i,
2277
+ t.on.bind(t),
2278
+ t.off.bind(t),
2279
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
2280
+ function(o, s) {
2281
+ return function(a) {
2282
+ var c;
2283
+ return (c = o(s)) === null || c === void 0 ? void 0 : c(a, t);
2284
+ };
2285
+ },
2286
+ e,
2287
+ n,
2288
+ r
2289
+ );
2290
+ }, Oe = 0, et = function(t) {
2291
+ var e = Date.now(), n = Math.floor(Math.random() * 1e9);
2292
+ return Oe++, t + "_" + n + Oe + String(e);
2293
+ }, Ae = function(t) {
2294
+ return t !== null && (t.tagName.toLowerCase() === "textarea" || t.tagName.toLowerCase() === "input");
2295
+ }, De = function(t) {
2296
+ return typeof t > "u" || t === "" ? [] : Array.isArray(t) ? t : t.split(" ");
2297
+ }, dn = function(t, e) {
2298
+ return De(t).concat(De(e));
2299
+ }, gn = function() {
2300
+ return window.InputEvent && typeof InputEvent.prototype.getTargetRanges == "function";
2301
+ }, mn = function(t) {
2302
+ if (!("isConnected" in Node.prototype)) {
2303
+ for (var e = t, n = t.parentNode; n != null; )
2304
+ e = n, n = e.parentNode;
2305
+ return e === t.ownerDocument;
2306
+ }
2307
+ return t.isConnected;
2308
+ }, Be = function(t, e) {
2309
+ t !== void 0 && (t.mode != null && typeof t.mode == "object" && typeof t.mode.set == "function" ? t.mode.set(e) : t.setMode(e));
2310
+ }, ue = function() {
2311
+ return ue = Object.assign || function(t) {
2312
+ for (var e, n = 1, r = arguments.length; n < r; n++) {
2313
+ e = arguments[n];
2314
+ for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
2315
+ }
2316
+ return t;
2317
+ }, ue.apply(this, arguments);
2318
+ }, bn = function(t, e, n) {
2319
+ var r, i, o = t.createElement("script");
2320
+ o.referrerPolicy = "origin", o.type = "application/javascript", o.id = e.id, o.src = e.src, o.async = (r = e.async) !== null && r !== void 0 ? r : !1, o.defer = (i = e.defer) !== null && i !== void 0 ? i : !1;
2321
+ var s = function() {
2322
+ o.removeEventListener("load", s), o.removeEventListener("error", a), n(e.src);
2323
+ }, a = function(c) {
2324
+ o.removeEventListener("load", s), o.removeEventListener("error", a), n(e.src, c);
2325
+ };
2326
+ o.addEventListener("load", s), o.addEventListener("error", a), t.head && t.head.appendChild(o);
2327
+ }, kn = function(t) {
2328
+ var e = {}, n = function(s, a) {
2329
+ var c = e[s];
2330
+ c.done = !0, c.error = a;
2331
+ for (var l = 0, u = c.handlers; l < u.length; l++) {
2332
+ var f = u[l];
2333
+ f(s, a);
2334
+ }
2335
+ c.handlers = [];
2336
+ }, r = function(s, a, c) {
2337
+ var l = function(C) {
2338
+ return c !== void 0 ? c(C) : console.error(C);
2339
+ };
2340
+ if (s.length === 0) {
2341
+ l(new Error("At least one script must be provided"));
2342
+ return;
2343
+ }
2344
+ for (var u = 0, f = !1, h = function(C, S) {
2345
+ f || (S ? (f = !0, l(S)) : ++u === s.length && a());
2346
+ }, v = 0, g = s; v < g.length; v++) {
2347
+ var m = g[v], k = e[m.src];
2348
+ if (k)
2349
+ k.done ? h(m.src, k.error) : k.handlers.push(h);
2350
+ else {
2351
+ var w = et("tiny-");
2352
+ e[m.src] = {
2353
+ id: w,
2354
+ src: m.src,
2355
+ done: !1,
2356
+ error: null,
2357
+ handlers: [h]
2358
+ }, bn(t, ue({ id: w }, m), n);
2359
+ }
2360
+ }
2361
+ }, i = function() {
2362
+ for (var s, a = 0, c = Object.values(e); a < c.length; a++) {
2363
+ var l = c[a], u = t.getElementById(l.id);
2364
+ u != null && u.tagName === "SCRIPT" && ((s = u.parentNode) === null || s === void 0 || s.removeChild(u));
2365
+ }
2366
+ e = {};
2367
+ }, o = function() {
2368
+ return t;
2369
+ };
2370
+ return {
2371
+ loadScripts: r,
2372
+ deleteScripts: i,
2373
+ getDocument: o
2374
+ };
2375
+ }, vn = function() {
2376
+ var t = [], e = function(i) {
2377
+ var o = t.find(function(s) {
2378
+ return s.getDocument() === i;
2379
+ });
2380
+ return o === void 0 && (o = kn(i), t.push(o)), o;
2381
+ }, n = function(i, o, s, a, c) {
2382
+ var l = function() {
2383
+ return e(i).loadScripts(o, a, c);
2384
+ };
2385
+ s > 0 ? setTimeout(l, s) : l();
2386
+ }, r = function() {
2387
+ for (var i = t.pop(); i != null; i = t.pop())
2388
+ i.deleteScripts();
2389
+ };
2390
+ return {
2391
+ loadList: n,
2392
+ reinitialize: r
2393
+ };
2394
+ }, yn = vn(), ee = function(t) {
2395
+ var e = t;
2396
+ return e && e.tinymce ? e.tinymce : null;
2397
+ }, xn = /* @__PURE__ */ function() {
2398
+ var t = function(e, n) {
2399
+ return t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, i) {
2400
+ r.__proto__ = i;
2401
+ } || function(r, i) {
2402
+ for (var o in i) Object.prototype.hasOwnProperty.call(i, o) && (r[o] = i[o]);
2403
+ }, t(e, n);
2404
+ };
2405
+ return function(e, n) {
2406
+ if (typeof n != "function" && n !== null)
2407
+ throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");
2408
+ t(e, n);
2409
+ function r() {
2410
+ this.constructor = e;
2411
+ }
2412
+ e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype, new r());
2413
+ };
2414
+ }(), K = function() {
2415
+ return K = Object.assign || function(t) {
2416
+ for (var e, n = 1, r = arguments.length; n < r; n++) {
2417
+ e = arguments[n];
2418
+ for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
2419
+ }
2420
+ return t;
2421
+ }, K.apply(this, arguments);
2422
+ }, wn = (
2423
+ /** @class */
2424
+ function(t) {
2425
+ xn(e, t);
2426
+ function e(n) {
2427
+ var r, i, o, s = t.call(this, n) || this;
2428
+ return s.rollbackTimer = void 0, s.valueCursor = void 0, s.rollbackChange = function() {
2429
+ var a = s.editor, c = s.props.value;
2430
+ a && c && c !== s.currentContent && a.undoManager.ignore(function() {
2431
+ if (a.setContent(c), s.valueCursor && (!s.inline || a.hasFocus()))
2432
+ try {
2433
+ a.selection.moveToBookmark(s.valueCursor);
2434
+ } catch {
2435
+ }
2436
+ }), s.rollbackTimer = void 0;
2437
+ }, s.handleBeforeInput = function(a) {
2438
+ if (s.props.value !== void 0 && s.props.value === s.currentContent && s.editor && (!s.inline || s.editor.hasFocus()))
2439
+ try {
2440
+ s.valueCursor = s.editor.selection.getBookmark(3);
2441
+ } catch {
2442
+ }
2443
+ }, s.handleBeforeInputSpecial = function(a) {
2444
+ (a.key === "Enter" || a.key === "Backspace" || a.key === "Delete") && s.handleBeforeInput(a);
2445
+ }, s.handleEditorChange = function(a) {
2446
+ var c = s.editor;
2447
+ if (c && c.initialized) {
2448
+ var l = c.getContent();
2449
+ s.props.value !== void 0 && s.props.value !== l && s.props.rollback !== !1 && (s.rollbackTimer || (s.rollbackTimer = window.setTimeout(s.rollbackChange, typeof s.props.rollback == "number" ? s.props.rollback : 200))), l !== s.currentContent && (s.currentContent = l, X(s.props.onEditorChange) && s.props.onEditorChange(l, c));
2450
+ }
2451
+ }, s.handleEditorChangeSpecial = function(a) {
2452
+ (a.key === "Backspace" || a.key === "Delete") && s.handleEditorChange(a);
2453
+ }, s.initialise = function(a) {
2454
+ var c, l, u;
2455
+ a === void 0 && (a = 0);
2456
+ var f = s.elementRef.current;
2457
+ if (f) {
2458
+ if (!mn(f)) {
2459
+ if (a === 0)
2460
+ setTimeout(function() {
2461
+ return s.initialise(1);
2462
+ }, 1);
2463
+ else if (a < 100)
2464
+ setTimeout(function() {
2465
+ return s.initialise(a + 1);
2466
+ }, 100);
2467
+ else
2468
+ throw new Error("tinymce can only be initialised when in a document");
2469
+ return;
2470
+ }
2471
+ var h = ee(s.view);
2472
+ if (!h)
2473
+ throw new Error("tinymce should have been loaded into global scope");
2474
+ var v = K(K({}, s.props.init), { selector: void 0, target: f, readonly: s.props.disabled, inline: s.inline, plugins: dn((c = s.props.init) === null || c === void 0 ? void 0 : c.plugins, s.props.plugins), toolbar: (l = s.props.toolbar) !== null && l !== void 0 ? l : (u = s.props.init) === null || u === void 0 ? void 0 : u.toolbar, setup: function(g) {
2475
+ s.editor = g, s.bindHandlers({}), s.inline && !Ae(f) && g.once("PostRender", function(m) {
2476
+ g.setContent(s.getInitialValue(), { no_events: !0 });
2477
+ }), s.props.init && X(s.props.init.setup) && s.props.init.setup(g);
2478
+ }, init_instance_callback: function(g) {
2479
+ var m, k, w = s.getInitialValue();
2480
+ s.currentContent = (m = s.currentContent) !== null && m !== void 0 ? m : g.getContent(), s.currentContent !== w && (s.currentContent = w, g.setContent(w), g.undoManager.clear(), g.undoManager.add(), g.setDirty(!1));
2481
+ var C = (k = s.props.disabled) !== null && k !== void 0 ? k : !1;
2482
+ Be(s.editor, C ? "readonly" : "design"), s.props.init && X(s.props.init.init_instance_callback) && s.props.init.init_instance_callback(g);
2483
+ } });
2484
+ s.inline || (f.style.visibility = ""), Ae(f) && (f.value = s.getInitialValue()), h.init(v);
2485
+ }
2486
+ }, s.id = s.props.id || et("tiny-react"), s.elementRef = d.createRef(), s.inline = (o = (r = s.props.inline) !== null && r !== void 0 ? r : (i = s.props.init) === null || i === void 0 ? void 0 : i.inline) !== null && o !== void 0 ? o : !1, s.boundHandlers = {}, s;
2487
+ }
2488
+ return Object.defineProperty(e.prototype, "view", {
2489
+ get: function() {
2490
+ var n, r;
2491
+ return (r = (n = this.elementRef.current) === null || n === void 0 ? void 0 : n.ownerDocument.defaultView) !== null && r !== void 0 ? r : window;
2492
+ },
2493
+ enumerable: !1,
2494
+ configurable: !0
2495
+ }), e.prototype.componentDidUpdate = function(n) {
2496
+ var r = this, i, o;
2497
+ if (this.rollbackTimer && (clearTimeout(this.rollbackTimer), this.rollbackTimer = void 0), this.editor && (this.bindHandlers(n), this.editor.initialized)) {
2498
+ if (this.currentContent = (i = this.currentContent) !== null && i !== void 0 ? i : this.editor.getContent(), typeof this.props.initialValue == "string" && this.props.initialValue !== n.initialValue)
2499
+ this.editor.setContent(this.props.initialValue), this.editor.undoManager.clear(), this.editor.undoManager.add(), this.editor.setDirty(!1);
2500
+ else if (typeof this.props.value == "string" && this.props.value !== this.currentContent) {
2501
+ var s = this.editor;
2502
+ s.undoManager.transact(function() {
2503
+ var c;
2504
+ if (!r.inline || s.hasFocus())
2505
+ try {
2506
+ c = s.selection.getBookmark(3);
2507
+ } catch {
2508
+ }
2509
+ var l = r.valueCursor;
2510
+ if (s.setContent(r.props.value), !r.inline || s.hasFocus())
2511
+ for (var u = 0, f = [c, l]; u < f.length; u++) {
2512
+ var h = f[u];
2513
+ if (h)
2514
+ try {
2515
+ s.selection.moveToBookmark(h), r.valueCursor = h;
2516
+ break;
2517
+ } catch {
2518
+ }
2519
+ }
2520
+ });
2521
+ }
2522
+ if (this.props.disabled !== n.disabled) {
2523
+ var a = (o = this.props.disabled) !== null && o !== void 0 ? o : !1;
2524
+ Be(this.editor, a ? "readonly" : "design");
2525
+ }
2526
+ }
2527
+ }, e.prototype.componentDidMount = function() {
2528
+ var n = this, r, i, o, s, a;
2529
+ if (ee(this.view) !== null)
2530
+ this.initialise();
2531
+ else if (Array.isArray(this.props.tinymceScriptSrc) && this.props.tinymceScriptSrc.length === 0)
2532
+ (i = (r = this.props).onScriptsLoadError) === null || i === void 0 || i.call(r, new Error("No `tinymce` global is present but the `tinymceScriptSrc` prop was an empty array."));
2533
+ else if (!((o = this.elementRef.current) === null || o === void 0) && o.ownerDocument) {
2534
+ var c = function() {
2535
+ var u, f;
2536
+ (f = (u = n.props).onScriptsLoad) === null || f === void 0 || f.call(u), n.initialise();
2537
+ }, l = function(u) {
2538
+ var f, h;
2539
+ (h = (f = n.props).onScriptsLoadError) === null || h === void 0 || h.call(f, u);
2540
+ };
2541
+ yn.loadList(this.elementRef.current.ownerDocument, this.getScriptSources(), (a = (s = this.props.scriptLoading) === null || s === void 0 ? void 0 : s.delay) !== null && a !== void 0 ? a : 0, c, l);
2542
+ }
2543
+ }, e.prototype.componentWillUnmount = function() {
2544
+ var n = this, r = this.editor;
2545
+ r && (r.off(this.changeEvents(), this.handleEditorChange), r.off(this.beforeInputEvent(), this.handleBeforeInput), r.off("keypress", this.handleEditorChangeSpecial), r.off("keydown", this.handleBeforeInputSpecial), r.off("NewBlock", this.handleEditorChange), Object.keys(this.boundHandlers).forEach(function(i) {
2546
+ r.off(i, n.boundHandlers[i]);
2547
+ }), this.boundHandlers = {}, r.remove(), this.editor = void 0);
2548
+ }, e.prototype.render = function() {
2549
+ return this.inline ? this.renderInline() : this.renderIframe();
2550
+ }, e.prototype.changeEvents = function() {
2551
+ var n, r, i, o = (i = (r = (n = ee(this.view)) === null || n === void 0 ? void 0 : n.Env) === null || r === void 0 ? void 0 : r.browser) === null || i === void 0 ? void 0 : i.isIE();
2552
+ return o ? "change keyup compositionend setcontent CommentChange" : "change input compositionend setcontent CommentChange";
2553
+ }, e.prototype.beforeInputEvent = function() {
2554
+ return gn() ? "beforeinput SelectionChange" : "SelectionChange";
2555
+ }, e.prototype.renderInline = function() {
2556
+ var n = this.props.tagName, r = n === void 0 ? "div" : n;
2557
+ return d.createElement(r, {
2558
+ ref: this.elementRef,
2559
+ id: this.id
2560
+ });
2561
+ }, e.prototype.renderIframe = function() {
2562
+ return d.createElement("textarea", {
2563
+ ref: this.elementRef,
2564
+ style: { visibility: "hidden" },
2565
+ name: this.props.textareaName,
2566
+ id: this.id
2567
+ });
2568
+ }, e.prototype.getScriptSources = function() {
2569
+ var n, r, i = (n = this.props.scriptLoading) === null || n === void 0 ? void 0 : n.async, o = (r = this.props.scriptLoading) === null || r === void 0 ? void 0 : r.defer;
2570
+ if (this.props.tinymceScriptSrc !== void 0)
2571
+ return typeof this.props.tinymceScriptSrc == "string" ? [{ src: this.props.tinymceScriptSrc, async: i, defer: o }] : this.props.tinymceScriptSrc.map(function(l) {
2572
+ return typeof l == "string" ? { src: l, async: i, defer: o } : l;
2573
+ });
2574
+ var s = this.props.cloudChannel, a = this.props.apiKey ? this.props.apiKey : "no-api-key", c = "https://cdn.tiny.cloud/1/".concat(a, "/tinymce/").concat(s, "/tinymce.min.js");
2575
+ return [{ src: c, async: i, defer: o }];
2576
+ }, e.prototype.getInitialValue = function() {
2577
+ return typeof this.props.initialValue == "string" ? this.props.initialValue : typeof this.props.value == "string" ? this.props.value : "";
2578
+ }, e.prototype.bindHandlers = function(n) {
2579
+ var r = this;
2580
+ if (this.editor !== void 0) {
2581
+ fn(this.editor, n, this.props, this.boundHandlers, function(a) {
2582
+ return r.props[a];
2583
+ });
2584
+ var i = function(a) {
2585
+ return a.onEditorChange !== void 0 || a.value !== void 0;
2586
+ }, o = i(n), s = i(this.props);
2587
+ !o && s ? (this.editor.on(this.changeEvents(), this.handleEditorChange), this.editor.on(this.beforeInputEvent(), this.handleBeforeInput), this.editor.on("keydown", this.handleBeforeInputSpecial), this.editor.on("keyup", this.handleEditorChangeSpecial), this.editor.on("NewBlock", this.handleEditorChange)) : o && !s && (this.editor.off(this.changeEvents(), this.handleEditorChange), this.editor.off(this.beforeInputEvent(), this.handleBeforeInput), this.editor.off("keydown", this.handleBeforeInputSpecial), this.editor.off("keyup", this.handleEditorChangeSpecial), this.editor.off("NewBlock", this.handleEditorChange));
2588
+ }
2589
+ }, e.propTypes = pn, e.defaultProps = {
2590
+ cloudChannel: "6"
2591
+ }, e;
2592
+ }(d.Component)
2593
+ );
2594
+ const pe = {
2595
+ baseUrl: "V3",
2596
+ signer: null
2597
+ }, In = ({ baseUrl: t, signer: e }) => {
2598
+ pe.baseUrl = t, pe.signer = e;
2599
+ }, Sn = () => {
2600
+ const t = window.location, { hostname: e } = t;
2601
+ return e === "localhost" || e === "127.0.0.1";
2602
+ }, tt = Sn(), nt = () => {
2603
+ var n;
2604
+ let t = window.location;
2605
+ const { host: e } = t;
2606
+ if (tt) {
2607
+ const r = (n = pe.baseUrl) == null ? void 0 : n.split("/");
2608
+ return r ? "https://" + (r == null ? void 0 : r[2]) : "https://vndev.hanbiro.com";
2609
+ } else {
2610
+ const r = localStorage.getItem("host") || e, i = r == null ? void 0 : r.split("/");
2611
+ return "https://" + (i == null ? void 0 : i[0]);
2612
+ }
2613
+ }, $n = () => {
2614
+ let t = window.location;
2615
+ if (tt)
2616
+ return nt() || "https://vndev.hanbiro.com/ngw";
2617
+ {
2618
+ window.location !== window.parent.location && (t = window.parent.location);
2619
+ const { hostname: e, protocol: n } = t;
2620
+ return [n, "//", e, "/ngw"].join("");
2621
+ }
2622
+ }, En = (t) => {
2623
+ const { isSimple: e, noImage: n } = t, r = 13, i = void 0, o = 0, s = "en", a = nt(), c = "jpeg,JPEG,jpg,JPG,jpe,JPE,jfi,jif,jfif,png,PNG,gif,GIF,bmp,BMP,webp,WEBP", l = {
2624
+ ko: '맑은고딕=Malgun Gothic;돋움="돋움",Dotum;돋움체="돋움체",DotumChe;굴림="굴림",Gulim;굴림체="굴림체",GulimChe;바탕="바탕",Batang;바탕체="바탕체",BatangChe;궁서="궁서",Gungseo;',
2625
+ en: "MS PGothic=MS PGothic,Sans-serif;Meiryo UI=Meiryo UI,Sans-serif;HiraKakuProN-W3=HiraKakuProN-W3;MS PMincho=MS PMincho,Sans-serif;MS Gothic=MS Gothic,Sans-serif;MS Mincho=MS Mincho,Sans-serif;",
2626
+ ch: "Microsoft YaHei=Microsoft YaHei,Sans-serif;"
2627
+ }[s] + "Andale Mono=andale mono,times; Arial=arial,helvetica,sans-serif; Arial Black=arial black,avant garde; Book Antiqua=book antiqua,palatino; Comic Sans MS=comic sans ms,sans-serif; Courier New=courier new,courier; Georgia=georgia,palatino; Helvetica=helvetica; Impact=impact,chicago; Symbol=symbol; Tahoma=tahoma,arial,helvetica,sans-serif; Terminal=terminal,monaco; Times New Roman=times new roman,times; Trebuchet MS=trebuchet ms,geneva; Verdana=verdana,geneva; Webdings=webdings; Wingdings=wingdings,zapf dingbats;", u = (() => {
2628
+ let m = window.location;
2629
+ const { hostname: k } = m;
2630
+ return k === "localhost" || k === "127.0.0.1" ? `${a}/ngw/app/lib/tinymce/plugins/jbimages/ci/index.php?upload/dropupload` : `${a}/ngw/app/lib/tinymce/plugins/jbimages/ci/index.php?upload/dropupload`;
2631
+ })();
2632
+ let f, h = [];
2633
+ e ? (f = "hanbiroclip", h = [
2634
+ "fontfamily fontsize",
2635
+ "bold italic underline",
2636
+ "forecolor backcolor",
2637
+ "bullist numlist",
2638
+ "emoticons"
2639
+ ]) : (f = "checklist lists link image table code codesample insertdatetime emoticons fullscreen wordcount hanbiroclip", h = [
2640
+ "fontfamily fontsize styles",
2641
+ "align lineheight checklist",
2642
+ "bold italic underline",
2643
+ "forecolor backcolor",
2644
+ "bullist numlist",
2645
+ "link image table",
2646
+ "code codesample",
2647
+ "insertdatetime emoticons",
2648
+ "fullscreen",
2649
+ "removeformat"
2650
+ ]);
2651
+ const v = (m) => {
2652
+ m.on("init", () => {
2653
+ setTimeout(() => {
2654
+ const k = m == null ? void 0 : m.getBody(), w = [];
2655
+ m.execCommand("FontSize", !1, r), w.push(`font-size: ${r}pt;`), (w == null ? void 0 : w.length) > 0 && (k == null || k.setAttribute("style", w.join(" "))), Number(o) && m.execCommand("Bold");
2656
+ }, 0);
2657
+ }), n && m.on("BeforeSetContent", (k) => {
2658
+ /<img[\s\S]*?>/i.test(k == null ? void 0 : k.content) && m.windowManager.alert("Image is not allowed!");
2659
+ });
2660
+ }, g = function(m) {
2661
+ const k = document.createElement("input");
2662
+ k.setAttribute("type", "file"), k.setAttribute("accept", "image/*"), k.onchange = function(w) {
2663
+ const C = w.target, S = C.files && C.files[0];
2664
+ if (S) {
2665
+ const $ = new FileReader();
2666
+ $.onload = function() {
2667
+ const P = "blobid" + (/* @__PURE__ */ new Date()).getTime(), z = window.tinymce.activeEditor.editorUpload.blobCache, _ = $.result;
2668
+ if (_ && typeof _ == "string") {
2669
+ const j = _.split(",")[1], Ee = z.create(P, S, j);
2670
+ z.add(Ee), m(Ee.blobUri(), { title: S.name });
2671
+ }
2672
+ }, $.readAsDataURL(S);
2673
+ }
2674
+ }, k.click();
2675
+ };
2676
+ return {
2677
+ defaultPlugins: f,
2678
+ defaultToolbar: h == null ? void 0 : h.join(" | "),
2679
+ imageUploadBasePath: a,
2680
+ imageUploadUrl: u,
2681
+ supportImageTypes: c,
2682
+ fontfamily: l,
2683
+ setupFunction: v,
2684
+ filePickerHandle: g,
2685
+ defaultFontType: i,
2686
+ defaultFontSize: r,
2687
+ isFontWeightBold: Number(o) === 1
2688
+ };
2078
2689
  };
2079
- class Ut extends u.Component {
2690
+ class Cn extends E.Component {
2080
2691
  constructor(n) {
2081
2692
  super(n);
2082
- g(this, "containerRef");
2083
- g(this, "handleClickOutside", (n) => {
2084
- this.containerRef.current && !this.containerRef.current.contains(n.target) && this.setState({ open: !1 });
2693
+ b(this, "editorRef", null);
2694
+ // Các hàm public được expose ra (tương tự như useImperativeHandle trước đó)
2695
+ b(this, "getContent", () => {
2696
+ var r;
2697
+ return {
2698
+ content: ((r = this.editorRef) == null ? void 0 : r.getContent()) || ""
2699
+ };
2700
+ });
2701
+ b(this, "getRawContent", () => {
2702
+ var r;
2703
+ return ((r = this.editorRef) == null ? void 0 : r.getContent()) || "";
2085
2704
  });
2086
- g(this, "togglePopper", () => {
2705
+ b(this, "handleEditorChange", (n) => {
2706
+ this.props.onChange && this.props.onChange(n);
2707
+ });
2708
+ this.state = {
2709
+ showEditor: !1
2710
+ };
2711
+ }
2712
+ render() {
2713
+ const {
2714
+ value: n,
2715
+ isSimple: r = !1,
2716
+ disabled: i = !1,
2717
+ height: o = 550,
2718
+ skin: s = "tinymce-5",
2719
+ onClick: a,
2720
+ style: c,
2721
+ lang: l = "en",
2722
+ placeholder: u = "",
2723
+ options: f,
2724
+ noImage: h = !1
2725
+ } = this.props, { showEditor: v } = this.state, {
2726
+ defaultPlugins: g,
2727
+ defaultToolbar: m,
2728
+ imageUploadBasePath: k,
2729
+ imageUploadUrl: w,
2730
+ supportImageTypes: C,
2731
+ fontfamily: S,
2732
+ setupFunction: $,
2733
+ filePickerHandle: P,
2734
+ defaultFontSize: z
2735
+ } = En({
2736
+ isSimple: r,
2737
+ noImage: h
2738
+ });
2739
+ return /* @__PURE__ */ E.createElement(
2740
+ "div",
2741
+ {
2742
+ style: {
2743
+ position: "relative",
2744
+ borderRadius: 1,
2745
+ height: o,
2746
+ ...c
2747
+ }
2748
+ },
2749
+ !v && /* @__PURE__ */ E.createElement(
2750
+ cn,
2751
+ {
2752
+ style: {
2753
+ position: "absolute",
2754
+ top: 0,
2755
+ left: 0,
2756
+ right: 0,
2757
+ zIndex: 12,
2758
+ background: "#ffffff",
2759
+ border: "1px solid var(--grey-main)",
2760
+ borderRadius: 1,
2761
+ height: (f == null ? void 0 : f.height) || o
2762
+ }
2763
+ }
2764
+ ),
2765
+ /* @__PURE__ */ E.createElement(
2766
+ wn,
2767
+ {
2768
+ disabled: i,
2769
+ onEditorChange: this.handleEditorChange,
2770
+ value: n,
2771
+ onInit: (_, j) => {
2772
+ this.setState({ showEditor: !0 }), this.editorRef = j;
2773
+ },
2774
+ onClick: a,
2775
+ plugins: g,
2776
+ init: {
2777
+ text_patterns: !1,
2778
+ placeholder: u,
2779
+ indent: !1,
2780
+ // skin: skin,
2781
+ visual: !1,
2782
+ promotion: !1,
2783
+ language: l || "en",
2784
+ // language_url: language
2785
+ // ? `${process.env.PUBLIC_URL || ""}/js/tinymce/langs/${language}.js`
2786
+ // : undefined,
2787
+ branding: !1,
2788
+ elementpath: !1,
2789
+ height: o,
2790
+ menubar: !r,
2791
+ verify_html: !0,
2792
+ toolbar: m,
2793
+ toolbar_mode: "sliding",
2794
+ images_upload_base_path: k,
2795
+ images_upload_url: w,
2796
+ images_upload_credentials: !0,
2797
+ automatic_uploads: !0,
2798
+ images_file_types: C,
2799
+ font_family_formats: S,
2800
+ paste_data_images: !0,
2801
+ a11y_advanced_options: !0,
2802
+ image_advtab: !0,
2803
+ file_picker_types: "file image media",
2804
+ file_picker_callback: P,
2805
+ forced_root_block_attrs: { style: "margin: 0;" },
2806
+ font_size_formats: "6pt 8pt 9pt 10pt 11pt 12pt 14pt 16pt 18pt 20pt 22pt 24pt 26pt 28pt 36pt 48pt 72pt",
2807
+ ...h && {
2808
+ invalid_elements: "img"
2809
+ },
2810
+ content_style: `
2811
+ ${un}
2812
+ [data-mce-placeholder]::before {
2813
+ color: rgba(0, 23, 55, 0.42) !important;
2814
+ }
2815
+ body {
2816
+ font-family: Helvetica,Arial,sans-serif;
2817
+ font-size: ${z}pt;
2818
+ line-height: unset;
2819
+ background: var(--background-softGrey);
2820
+ color: var(--text-primary);
2821
+ }`,
2822
+ setup: $,
2823
+ relative_urls: !1,
2824
+ remove_script_host: !1,
2825
+ document_base_url: "/"
2826
+ }
2827
+ }
2828
+ )
2829
+ );
2830
+ }
2831
+ }
2832
+ class Rn extends d.Component {
2833
+ constructor(n) {
2834
+ super(n);
2835
+ b(this, "containerRef");
2836
+ b(this, "popperRef");
2837
+ b(this, "handleClickOutside", (n) => {
2838
+ const r = n.target;
2839
+ this.containerRef.current && !this.containerRef.current.contains(r) && (!this.popperRef.current || !this.popperRef.current.contains(r)) && this.setState({ open: !1 });
2840
+ });
2841
+ b(this, "togglePopper", () => {
2087
2842
  this.setState((n) => ({ open: !n.open }));
2088
2843
  });
2089
- g(this, "handleLangChange", (n) => {
2090
- const r = ee.find((i) => i.value === n.target.value);
2844
+ b(this, "handleLangChange", (n) => {
2845
+ const r = oe.find((i) => i.value === n.target.value);
2091
2846
  this.props.setLang(r || null);
2092
2847
  });
2093
- this.state = { open: !1 }, this.containerRef = u.createRef();
2848
+ this.state = { open: !1 }, this.containerRef = d.createRef(), this.popperRef = d.createRef();
2094
2849
  }
2095
2850
  componentDidMount() {
2096
2851
  document.addEventListener("mousedown", this.handleClickOutside);
@@ -2099,133 +2854,165 @@ class Ut extends u.Component {
2099
2854
  document.removeEventListener("mousedown", this.handleClickOutside);
2100
2855
  }
2101
2856
  render() {
2102
- const { lang: n, originalEmail: r, setOriginalEmail: i, getEditorContent: s } = this.props, { open: o } = this.state;
2103
- return /* @__PURE__ */ u.createElement(
2857
+ const {
2858
+ lang: n,
2859
+ originalEmail: r,
2860
+ setOriginalEmail: i,
2861
+ getEditorContent: o,
2862
+ parentRef: s
2863
+ } = this.props, { open: a } = this.state;
2864
+ let c = 0, l = 0, u = 320;
2865
+ if (a && this.containerRef.current) {
2866
+ const f = this.containerRef.current.getBoundingClientRect();
2867
+ if (c = f.top + (window.scrollY || document.documentElement.scrollTop) - 8, l = f.left + (window.scrollX || document.documentElement.scrollLeft), s && s.current) {
2868
+ const h = s.current.getBoundingClientRect();
2869
+ u = h.width - 16, l = h.left + 8;
2870
+ }
2871
+ }
2872
+ return /* @__PURE__ */ d.createElement(
2104
2873
  "div",
2105
2874
  {
2106
2875
  ref: this.containerRef,
2107
2876
  style: { position: "relative", display: "inline-block" }
2108
2877
  },
2109
- /* @__PURE__ */ u.createElement(
2878
+ /* @__PURE__ */ d.createElement(
2110
2879
  "button",
2111
2880
  {
2112
2881
  type: "button",
2113
2882
  onClick: this.togglePopper,
2114
2883
  className: "icon-button small"
2115
2884
  },
2116
- /* @__PURE__ */ u.createElement(le, { size: 16 })
2885
+ /* @__PURE__ */ d.createElement(de, { size: 16 })
2117
2886
  ),
2118
- o && /* @__PURE__ */ u.createElement(
2119
- "div",
2120
- {
2121
- style: {
2122
- position: "absolute",
2123
- bottom: "100%",
2124
- left: 0,
2125
- zIndex: 1051,
2126
- background: "#fff",
2127
- border: "1px solid #ddd",
2128
- boxShadow: "0px 4px 12px rgba(0, 0, 0, 0.1)",
2129
- borderRadius: 8,
2130
- padding: 16,
2131
- width: 320,
2132
- marginBottom: 8
2133
- }
2134
- },
2135
- /* @__PURE__ */ u.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 12 } }, /* @__PURE__ */ u.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 4 } }, /* @__PURE__ */ u.createElement(
2136
- "span",
2137
- {
2138
- style: {
2139
- fontSize: 12,
2140
- fontWeight: 500,
2141
- color: "var(--text-secondary)"
2142
- }
2143
- },
2144
- "Language"
2145
- ), /* @__PURE__ */ u.createElement(
2146
- "select",
2147
- {
2148
- value: n ? n.value : "",
2149
- onChange: this.handleLangChange,
2150
- style: {
2151
- padding: "6px 8px",
2152
- borderRadius: 4,
2153
- border: "1px solid #ccc",
2154
- fontSize: 14
2155
- }
2156
- },
2157
- /* @__PURE__ */ u.createElement("option", { value: "", disabled: !0 }, "Select Language"),
2158
- ee.map((a) => /* @__PURE__ */ u.createElement("option", { key: a.value, value: a.value }, a.label))
2159
- )), /* @__PURE__ */ u.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 4 } }, /* @__PURE__ */ u.createElement(
2887
+ a && this.containerRef.current && ot.createPortal(
2888
+ /* @__PURE__ */ d.createElement(
2160
2889
  "div",
2161
2890
  {
2891
+ ref: this.popperRef,
2162
2892
  style: {
2163
- display: "flex",
2164
- alignItems: "center",
2165
- justifyContent: "space-between"
2893
+ position: "absolute",
2894
+ top: c,
2895
+ left: l,
2896
+ transform: "translateY(-100%)",
2897
+ zIndex: 1051,
2898
+ background: "#fff",
2899
+ border: "1px solid #ddd",
2900
+ boxShadow: "0px 4px 12px rgba(0, 0, 0, 0.1)",
2901
+ borderRadius: 8,
2902
+ padding: 16,
2903
+ width: u,
2904
+ boxSizing: "border-box"
2166
2905
  }
2167
2906
  },
2168
- /* @__PURE__ */ u.createElement(
2169
- "span",
2907
+ /* @__PURE__ */ d.createElement(
2908
+ "div",
2170
2909
  {
2171
- style: {
2172
- fontSize: 12,
2173
- fontWeight: 500,
2174
- color: "var(--text-secondary)"
2175
- }
2910
+ style: { display: "flex", flexDirection: "column", gap: 12 }
2176
2911
  },
2177
- "AI Context"
2178
- ),
2179
- s && /* @__PURE__ */ u.createElement(
2180
- "button",
2181
- {
2182
- type: "button",
2183
- title: "Copy from origin email",
2184
- onClick: () => {
2185
- const a = s();
2186
- i(a);
2912
+ /* @__PURE__ */ d.createElement(
2913
+ "div",
2914
+ {
2915
+ style: { display: "flex", flexDirection: "column", gap: 4 }
2187
2916
  },
2188
- className: "icon-button"
2189
- },
2190
- /* @__PURE__ */ u.createElement(F, null)
2917
+ /* @__PURE__ */ d.createElement(
2918
+ "span",
2919
+ {
2920
+ style: {
2921
+ fontSize: 12,
2922
+ fontWeight: 500
2923
+ // color: "var(--text-secondary)",
2924
+ }
2925
+ },
2926
+ "Language"
2927
+ ),
2928
+ /* @__PURE__ */ d.createElement(
2929
+ "select",
2930
+ {
2931
+ value: n ? n.value : "",
2932
+ onChange: this.handleLangChange,
2933
+ style: {
2934
+ padding: "6px 8px",
2935
+ borderRadius: 4,
2936
+ border: "1px solid #ccc",
2937
+ fontSize: 14
2938
+ }
2939
+ },
2940
+ /* @__PURE__ */ d.createElement("option", { value: "", disabled: !0 }, "Select Language"),
2941
+ oe.map((f) => /* @__PURE__ */ d.createElement("option", { key: f.value, value: f.value }, f.label))
2942
+ )
2943
+ ),
2944
+ /* @__PURE__ */ d.createElement(
2945
+ "div",
2946
+ {
2947
+ style: { display: "flex", flexDirection: "column", gap: 4 }
2948
+ },
2949
+ /* @__PURE__ */ d.createElement(
2950
+ "div",
2951
+ {
2952
+ style: {
2953
+ display: "flex",
2954
+ alignItems: "center",
2955
+ justifyContent: "space-between"
2956
+ }
2957
+ },
2958
+ /* @__PURE__ */ d.createElement(
2959
+ "span",
2960
+ {
2961
+ style: {
2962
+ fontSize: 12,
2963
+ fontWeight: 500
2964
+ // color: "var(--text-secondary)",
2965
+ }
2966
+ },
2967
+ "AI Context"
2968
+ ),
2969
+ o && /* @__PURE__ */ d.createElement(
2970
+ "button",
2971
+ {
2972
+ type: "button",
2973
+ title: "Copy from origin email",
2974
+ onClick: () => {
2975
+ const f = o();
2976
+ i(f);
2977
+ },
2978
+ className: "icon-button"
2979
+ },
2980
+ /* @__PURE__ */ d.createElement(Q, null)
2981
+ )
2982
+ ),
2983
+ /* @__PURE__ */ d.createElement(
2984
+ Cn,
2985
+ {
2986
+ value: r,
2987
+ onChange: (f) => i(f),
2988
+ height: 350,
2989
+ isSimple: !0
2990
+ }
2991
+ )
2992
+ )
2191
2993
  )
2192
- ), /* @__PURE__ */ u.createElement(
2193
- "textarea",
2194
- {
2195
- value: r,
2196
- onChange: (a) => i(a.target.value),
2197
- style: {
2198
- width: "100%",
2199
- height: 120,
2200
- resize: "vertical",
2201
- padding: 8,
2202
- border: "1px solid #ccc",
2203
- borderRadius: 4,
2204
- fontSize: 13,
2205
- fontFamily: "inherit",
2206
- boxSizing: "border-box"
2207
- }
2208
- }
2209
- )))
2994
+ ),
2995
+ document.body
2210
2996
  )
2211
2997
  );
2212
2998
  }
2213
2999
  }
2214
- class Qt extends u.Component {
3000
+ class zn extends d.Component {
2215
3001
  constructor(n) {
2216
3002
  super(n);
3003
+ b(this, "rootRef");
2217
3004
  // Equivalent to useImperativeHandle
2218
- g(this, "setAiContext", (n) => {
3005
+ b(this, "setAiContext", (n) => {
2219
3006
  this.setState({ originalEmail: n });
2220
3007
  });
2221
- g(this, "handleMessageChange", (n) => {
3008
+ b(this, "handleMessageChange", (n) => {
2222
3009
  this.setState({ message: n.target.value });
2223
3010
  });
2224
- g(this, "handleSubmit", async () => {
2225
- const { message: n, messages: r, lang: i, originalEmail: s, conversationId: o } = this.state, { signer: a, baseUrl: p = "" } = this.props;
3011
+ b(this, "handleSubmit", async () => {
3012
+ const { message: n, messages: r, lang: i, originalEmail: o, conversationId: s } = this.state, { signer: a, baseUrl: c = "" } = this.props;
2226
3013
  if (!n.trim()) return;
2227
- const l = Ge();
2228
- let c = {
3014
+ const l = ut();
3015
+ let u = {
2229
3016
  id: l,
2230
3017
  question: n,
2231
3018
  subject: "",
@@ -2233,65 +3020,66 @@ class Qt extends u.Component {
2233
3020
  created_at: (/* @__PURE__ */ new Date()).getTime(),
2234
3021
  isLoading: !0
2235
3022
  };
2236
- const d = [...r, c];
3023
+ const f = [...r, u];
2237
3024
  this.setState({
2238
- messages: d,
3025
+ messages: f,
2239
3026
  message: "",
2240
3027
  isSending: !0
2241
3028
  });
2242
3029
  const h = {
2243
3030
  query: n,
2244
3031
  default_language: i ? i.value : "KR",
2245
- original_email: s,
3032
+ original_email: o,
2246
3033
  debug_grpc: !0
2247
3034
  };
2248
- o && (h.conversation_id = o), await at(h, {
2249
- setContent: (v) => {
2250
- this.setState((T) => ({ messages: T.messages.map(
3035
+ s && (h.conversation_id = s), await St(h, {
3036
+ setContent: (k) => {
3037
+ this.setState((w) => ({ messages: w.messages.map(
2251
3038
  (S) => S.id === l ? {
2252
3039
  ...S,
2253
3040
  subject: "Some thing not used",
2254
- body: v,
3041
+ body: k,
2255
3042
  isLoading: !1,
2256
3043
  created_at: (/* @__PURE__ */ new Date()).getTime()
2257
3044
  } : S
2258
3045
  ) }));
2259
3046
  },
2260
- setIsLoading: (v) => {
2261
- this.setState((T) => ({ messages: T.messages.map(
2262
- (S) => S.id === l ? { ...S, isLoading: v } : S
3047
+ setIsLoading: (k) => {
3048
+ this.setState((w) => ({ messages: w.messages.map(
3049
+ (S) => S.id === l ? { ...S, isLoading: k } : S
2263
3050
  ) }));
2264
3051
  },
2265
- setConversationId: (v) => {
2266
- this.setState({ conversationId: v });
3052
+ setConversationId: (k) => {
3053
+ this.setState({ conversationId: k });
2267
3054
  },
2268
3055
  signer: a,
2269
- baseUrl: p
3056
+ baseUrl: c
2270
3057
  }), this.setState({ isSending: !1 });
2271
3058
  });
2272
- g(this, "handleKeyDown", (n) => {
3059
+ b(this, "handleKeyDown", (n) => {
2273
3060
  !n.shiftKey && n.key === "Enter" && !this.state.isSending && (n.preventDefault(), this.handleSubmit());
2274
3061
  });
2275
- g(this, "setLang", (n) => {
3062
+ b(this, "setLang", (n) => {
2276
3063
  this.setState({ lang: n });
2277
3064
  });
2278
- g(this, "setOriginalEmail", (n) => {
3065
+ b(this, "setOriginalEmail", (n) => {
2279
3066
  this.setState({ originalEmail: n });
2280
3067
  });
2281
- this.state = {
3068
+ this.rootRef = d.createRef(), this.state = {
2282
3069
  message: "",
2283
3070
  messages: [],
2284
3071
  isSending: !1,
2285
- lang: ee[0],
3072
+ lang: oe[0],
2286
3073
  conversationId: "",
2287
3074
  originalEmail: ""
2288
3075
  };
2289
3076
  }
2290
3077
  render() {
2291
- const { onApply: n, getEditorContent: r } = this.props, { message: i, messages: s, isSending: o, lang: a, originalEmail: p } = this.state;
2292
- return /* @__PURE__ */ u.createElement(
3078
+ const { onApply: n, getEditorContent: r } = this.props, { message: i, messages: o, isSending: s, lang: a, originalEmail: c } = this.state;
3079
+ return /* @__PURE__ */ d.createElement(
2293
3080
  "div",
2294
3081
  {
3082
+ ref: this.rootRef,
2295
3083
  style: {
2296
3084
  display: "flex",
2297
3085
  height: "100%",
@@ -2302,14 +3090,14 @@ class Qt extends u.Component {
2302
3090
  boxSizing: "border-box"
2303
3091
  }
2304
3092
  },
2305
- s.length > 0 ? /* @__PURE__ */ u.createElement(
2306
- Wt,
3093
+ o.length > 0 ? /* @__PURE__ */ d.createElement(
3094
+ an,
2307
3095
  {
2308
- items: s,
3096
+ items: o,
2309
3097
  onApply: n,
2310
3098
  getEditorContent: r
2311
3099
  }
2312
- ) : /* @__PURE__ */ u.createElement(
3100
+ ) : /* @__PURE__ */ d.createElement(
2313
3101
  "div",
2314
3102
  {
2315
3103
  style: {
@@ -2322,8 +3110,8 @@ class Qt extends u.Component {
2322
3110
  color: "var(--grey-light)"
2323
3111
  }
2324
3112
  },
2325
- /* @__PURE__ */ u.createElement(st, { size: 46 }),
2326
- /* @__PURE__ */ u.createElement(
3113
+ /* @__PURE__ */ d.createElement(wt, { size: 46 }),
3114
+ /* @__PURE__ */ d.createElement(
2327
3115
  "h2",
2328
3116
  {
2329
3117
  style: {
@@ -2336,20 +3124,20 @@ class Qt extends u.Component {
2336
3124
  "Build with Agent"
2337
3125
  )
2338
3126
  ),
2339
- /* @__PURE__ */ u.createElement(
3127
+ /* @__PURE__ */ d.createElement(
2340
3128
  "div",
2341
3129
  {
2342
3130
  style: {
2343
3131
  width: "100%",
2344
3132
  border: "1px solid #ddd",
2345
3133
  borderRadius: 4,
2346
- // overflow: "hidden",
2347
- background: o ? "var(--background-lightGrey)" : "#fff",
3134
+ overflow: "hidden",
3135
+ background: "#fff",
2348
3136
  display: "flex",
2349
3137
  flexDirection: "column"
2350
3138
  }
2351
3139
  },
2352
- /* @__PURE__ */ u.createElement(
3140
+ /* @__PURE__ */ d.createElement(
2353
3141
  "textarea",
2354
3142
  {
2355
3143
  value: i,
@@ -2357,7 +3145,7 @@ class Qt extends u.Component {
2357
3145
  placeholder: "Describe your email",
2358
3146
  name: "ai-content",
2359
3147
  onKeyDown: this.handleKeyDown,
2360
- disabled: o,
3148
+ disabled: s,
2361
3149
  style: {
2362
3150
  flex: 1,
2363
3151
  minWidth: 0,
@@ -2372,7 +3160,7 @@ class Qt extends u.Component {
2372
3160
  }
2373
3161
  }
2374
3162
  ),
2375
- /* @__PURE__ */ u.createElement(
3163
+ /* @__PURE__ */ d.createElement(
2376
3164
  "div",
2377
3165
  {
2378
3166
  style: {
@@ -2385,65 +3173,37 @@ class Qt extends u.Component {
2385
3173
  boxSizing: "border-box"
2386
3174
  }
2387
3175
  },
2388
- /* @__PURE__ */ u.createElement(
2389
- Ut,
3176
+ /* @__PURE__ */ d.createElement(
3177
+ Rn,
2390
3178
  {
2391
3179
  lang: a,
2392
3180
  setLang: this.setLang,
2393
- originalEmail: p,
3181
+ originalEmail: c,
2394
3182
  setOriginalEmail: this.setOriginalEmail,
2395
- getEditorContent: r
3183
+ getEditorContent: r,
3184
+ parentRef: this.rootRef
2396
3185
  }
2397
3186
  ),
2398
- /* @__PURE__ */ u.createElement(
3187
+ /* @__PURE__ */ d.createElement(
2399
3188
  "button",
2400
3189
  {
2401
- disabled: !i.trim() || o,
3190
+ disabled: !i.trim() || s,
2402
3191
  onClick: this.handleSubmit,
2403
3192
  className: "icon-button",
2404
3193
  color: "primary"
2405
3194
  },
2406
- /* @__PURE__ */ u.createElement(ae, null)
3195
+ /* @__PURE__ */ d.createElement(fe, null)
2407
3196
  )
2408
3197
  )
2409
3198
  )
2410
3199
  );
2411
3200
  }
2412
3201
  }
2413
- const ie = {
2414
- baseUrl: "V3",
2415
- signer: null
2416
- }, Kt = ({ baseUrl: t, signer: e }) => {
2417
- ie.baseUrl = t, ie.signer = e;
2418
- }, Zt = () => {
2419
- const t = window.location, { hostname: e } = t;
2420
- return e === "localhost" || e === "127.0.0.1";
2421
- }, Be = Zt(), Gt = () => {
2422
- var n;
2423
- let t = window.location;
2424
- const { host: e } = t;
2425
- if (Be) {
2426
- const r = (n = ie.baseUrl) == null ? void 0 : n.split("/");
2427
- return r ? "https://" + (r == null ? void 0 : r[2]) : "https://vndev.hanbiro.com";
2428
- } else {
2429
- const r = localStorage.getItem("host") || e, i = r == null ? void 0 : r.split("/");
2430
- return "https://" + (i == null ? void 0 : i[0]);
2431
- }
2432
- }, Jt = () => {
2433
- let t = window.location;
2434
- if (Be)
2435
- return Gt() || "https://vndev.hanbiro.com/ngw";
2436
- {
2437
- window.location !== window.parent.location && (t = window.parent.location);
2438
- const { hostname: e, protocol: n } = t;
2439
- return [n, "//", e, "/ngw"].join("");
2440
- }
2441
- };
2442
3202
  export {
2443
- Qt as ChatAIDraft,
2444
- ie as SDKConfig,
2445
- Gt as getBaseUrl,
2446
- Jt as getGroupwareUrl,
2447
- Kt as initHanbiroReactSDK,
2448
- Be as isDevelopment
3203
+ zn as ChatAIDraft,
3204
+ Ye as LoadingCircular,
3205
+ cn as LoadingContainer,
3206
+ nt as getBaseUrl,
3207
+ $n as getGroupwareUrl,
3208
+ In as initHanbiroReactSDK
2449
3209
  };