hanbiro-react16-sdk 1.0.0 → 1.0.2

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.
@@ -76,15 +76,15 @@ async function Ae(n, { setContent: e, setIsLoading: t, setConversationId: r, sig
76
76
  let c = "";
77
77
  try {
78
78
  t(!0);
79
- const l = {
79
+ const a = {
80
80
  method: "POST",
81
81
  baseURL: s,
82
82
  url: "/nmail/chatdraft",
83
83
  params: n
84
84
  };
85
85
  let h = {};
86
- i && typeof i.generateHeaders == "function" && (h = await i.generateHeaders(l));
87
- const a = await fetch(`${s}/nmail/chatdraft`, {
86
+ i && typeof i.generateHeaders == "function" && (h = await i.generateHeaders(a));
87
+ const l = await fetch(`${s}/nmail/chatdraft`, {
88
88
  method: "POST",
89
89
  body: JSON.stringify(n),
90
90
  headers: {
@@ -93,9 +93,9 @@ async function Ae(n, { setContent: e, setIsLoading: t, setConversationId: r, sig
93
93
  ...h
94
94
  }
95
95
  });
96
- if (t(!1), !a.body)
96
+ if (t(!1), !l.body)
97
97
  throw new Error("Response body is not available for streaming.");
98
- const o = a.body.getReader();
98
+ const o = l.body.getReader();
99
99
  let d = "", p = 0;
100
100
  for (; ; ) {
101
101
  const { done: x, value: f } = await o.read();
@@ -124,8 +124,8 @@ async function Ae(n, { setContent: e, setIsLoading: t, setConversationId: r, sig
124
124
  }
125
125
  }
126
126
  return c;
127
- } catch (l) {
128
- console.error("Summary error:", l), e("");
127
+ } catch (a) {
128
+ console.error("Summary error:", a), e("");
129
129
  } finally {
130
130
  t(!1);
131
131
  }
@@ -221,8 +221,8 @@ var w = {
221
221
  }, Ie = /^(?:[ \t]*(?:\n|$))+/, Le = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, _e = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, q = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Pe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, V = /(?:[*+-]|\d{1,9}[.)])/, ge = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, de = k(ge).replace(/bull/g, V).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(), Be = k(ge).replace(/bull/g, V).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(), X = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, De = /^[^\n]+/, Y = /(?!\s*\])(?:\\.|[^\[\]\\])+/, qe = k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Y).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Me = k(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, V).getRegex(), H = "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", ee = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Oe = k(
222
222
  "^ {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|$))",
223
223
  "i"
224
- ).replace("comment", ee).replace("tag", H).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), fe = k(X).replace("hr", q).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", H).getRegex(), je = k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", fe).getRegex(), te = {
225
- blockquote: je,
224
+ ).replace("comment", ee).replace("tag", H).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), fe = k(X).replace("hr", q).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", H).getRegex(), Ne = k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", fe).getRegex(), te = {
225
+ blockquote: Ne,
226
226
  code: Le,
227
227
  def: qe,
228
228
  fences: _e,
@@ -237,7 +237,7 @@ var w = {
237
237
  text: De
238
238
  }, se = k(
239
239
  "^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
240
- ).replace("hr", q).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", H).getRegex(), Ne = {
240
+ ).replace("hr", q).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", H).getRegex(), je = {
241
241
  ...te,
242
242
  lheading: Be,
243
243
  table: se,
@@ -259,7 +259,7 @@ var w = {
259
259
  "gu"
260
260
  ).replace(/notPunctSpace/g, ke).replace(/punctSpace/g, ne).replace(/punct/g, G).getRegex(), tt = k(/\\(punct)/, "gu").replace(/punct/g, G).getRegex(), nt = k(/^<(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(), rt = k(ee).replace("(?:-->|$)", "-->").getRegex(), it = k(
261
261
  "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>"
262
- ).replace("comment", rt).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), j = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, st = k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", j).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ye = k(/^!?\[(label)\]\[(ref)\]/).replace("label", j).replace("ref", Y).getRegex(), ve = k(/^!?\[(ref)\](?:\[\])?/).replace("ref", Y).getRegex(), lt = k("reflink|nolink(?!\\()", "g").replace("reflink", ye).replace("nolink", ve).getRegex(), re = {
262
+ ).replace("comment", rt).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), N = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, st = k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", N).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ye = k(/^!?\[(label)\]\[(ref)\]/).replace("label", N).replace("ref", Y).getRegex(), ve = k(/^!?\[(ref)\](?:\[\])?/).replace("ref", Y).getRegex(), at = k("reflink|nolink(?!\\()", "g").replace("reflink", ye).replace("nolink", ve).getRegex(), re = {
263
263
  _backpedal: D,
264
264
  // only used for GFM url
265
265
  anyPunctuation: tt,
@@ -276,14 +276,14 @@ var w = {
276
276
  nolink: ve,
277
277
  punctuation: We,
278
278
  reflink: ye,
279
- reflinkSearch: lt,
279
+ reflinkSearch: at,
280
280
  tag: it,
281
281
  text: Qe,
282
282
  url: D
283
- }, at = {
283
+ }, lt = {
284
284
  ...re,
285
- link: k(/^!?\[(label)\]\((.*?)\)/).replace("label", j).getRegex(),
286
- reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", j).getRegex()
285
+ link: k(/^!?\[(label)\]\((.*?)\)/).replace("label", N).getRegex(),
286
+ reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", N).getRegex()
287
287
  }, F = {
288
288
  ...re,
289
289
  emStrongRDelimAst: Ye,
@@ -298,29 +298,29 @@ var w = {
298
298
  text: k(F.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
299
299
  }, M = {
300
300
  normal: te,
301
- gfm: Ne,
301
+ gfm: je,
302
302
  pedantic: Ze
303
303
  }, P = {
304
304
  normal: re,
305
305
  gfm: F,
306
306
  breaks: ot,
307
- pedantic: at
307
+ pedantic: lt
308
308
  }, ct = {
309
309
  "&": "&amp;",
310
310
  "<": "&lt;",
311
311
  ">": "&gt;",
312
312
  '"': "&quot;",
313
313
  "'": "&#39;"
314
- }, le = (n) => ct[n];
314
+ }, ae = (n) => ct[n];
315
315
  function $(n, e) {
316
316
  if (e) {
317
317
  if (w.escapeTest.test(n))
318
- return n.replace(w.escapeReplace, le);
318
+ return n.replace(w.escapeReplace, ae);
319
319
  } else if (w.escapeTestNoEncode.test(n))
320
- return n.replace(w.escapeReplaceNoEncode, le);
320
+ return n.replace(w.escapeReplaceNoEncode, ae);
321
321
  return n;
322
322
  }
323
- function ae(n) {
323
+ function le(n) {
324
324
  try {
325
325
  n = encodeURI(n).replace(w.percentDecode, "%");
326
326
  } catch {
@@ -330,10 +330,10 @@ function ae(n) {
330
330
  }
331
331
  function oe(n, e) {
332
332
  var s;
333
- const t = n.replace(w.findPipe, (c, l, h) => {
334
- let a = !1, o = l;
335
- for (; --o >= 0 && h[o] === "\\"; ) a = !a;
336
- return a ? "|" : " |";
333
+ const t = n.replace(w.findPipe, (c, a, h) => {
334
+ let l = !1, o = a;
335
+ for (; --o >= 0 && h[o] === "\\"; ) l = !l;
336
+ return l ? "|" : " |";
337
337
  }), r = t.split(w.splitPipe);
338
338
  let i = 0;
339
339
  if (r[0].trim() || r.shift(), r.length > 0 && !((s = r.at(-1)) != null && s.trim()) && r.pop(), e)
@@ -368,15 +368,15 @@ function ht(n, e) {
368
368
  return t > 0 ? -2 : -1;
369
369
  }
370
370
  function ce(n, e, t, r, i) {
371
- const s = e.href, c = e.title || null, l = n[1].replace(i.other.outputLinkReplace, "$1");
371
+ const s = e.href, c = e.title || null, a = n[1].replace(i.other.outputLinkReplace, "$1");
372
372
  r.state.inLink = !0;
373
373
  const h = {
374
374
  type: n[0].charAt(0) === "!" ? "image" : "link",
375
375
  raw: t,
376
376
  href: s,
377
377
  title: c,
378
- text: l,
379
- tokens: r.inlineTokens(l)
378
+ text: a,
379
+ tokens: r.inlineTokens(a)
380
380
  };
381
381
  return r.state.inLink = !1, h;
382
382
  }
@@ -390,12 +390,12 @@ function pt(n, e, t) {
390
390
  const c = s.match(t.other.beginningSpace);
391
391
  if (c === null)
392
392
  return s;
393
- const [l] = c;
394
- return l.length >= i.length ? s.slice(i.length) : s;
393
+ const [a] = c;
394
+ return a.length >= i.length ? s.slice(i.length) : s;
395
395
  }).join(`
396
396
  `);
397
397
  }
398
- var N = class {
398
+ var j = class {
399
399
  // set by the lexer
400
400
  constructor(n) {
401
401
  g(this, "options");
@@ -472,21 +472,21 @@ var N = class {
472
472
  const s = [];
473
473
  for (; t.length > 0; ) {
474
474
  let c = !1;
475
- const l = [];
475
+ const a = [];
476
476
  let h;
477
477
  for (h = 0; h < t.length; h++)
478
478
  if (this.rules.other.blockquoteStart.test(t[h]))
479
- l.push(t[h]), c = !0;
479
+ a.push(t[h]), c = !0;
480
480
  else if (!c)
481
- l.push(t[h]);
481
+ a.push(t[h]);
482
482
  else
483
483
  break;
484
484
  t = t.slice(h);
485
- const a = l.join(`
486
- `), o = a.replace(this.rules.other.blockquoteSetextReplace, `
485
+ const l = a.join(`
486
+ `), o = l.replace(this.rules.other.blockquoteSetextReplace, `
487
487
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
488
488
  r = r ? `${r}
489
- ${a}` : a, i = i ? `${i}
489
+ ${l}` : l, i = i ? `${i}
490
490
  ${o}` : o;
491
491
  const d = this.lexer.state.top;
492
492
  if (this.lexer.state.top = !0, this.lexer.blockTokens(o, s, !0), this.lexer.state.top = d, t.length === 0)
@@ -533,14 +533,14 @@ ${o}` : o;
533
533
  const s = this.rules.other.listItemRegex(t);
534
534
  let c = !1;
535
535
  for (; n; ) {
536
- let h = !1, a = "", o = "";
536
+ let h = !1, l = "", o = "";
537
537
  if (!(e = s.exec(n)) || this.rules.block.hr.test(n))
538
538
  break;
539
- a = e[0], n = n.substring(a.length);
539
+ l = e[0], n = n.substring(l.length);
540
540
  let d = e[2].split(`
541
541
  `, 1)[0].replace(this.rules.other.listReplaceTabs, (S) => " ".repeat(3 * S.length)), p = n.split(`
542
542
  `, 1)[0], x = !d.trim(), f = 0;
543
- if (this.options.pedantic ? (f = 2, o = d.trimStart()) : x ? f = e[1].length + 1 : (f = e[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, o = d.slice(f), f += e[1].length), x && this.rules.other.blankLine.test(p) && (a += p + `
543
+ if (this.options.pedantic ? (f = 2, o = d.trimStart()) : x ? f = e[1].length + 1 : (f = e[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, o = d.slice(f), f += e[1].length), x && this.rules.other.blankLine.test(p) && (l += p + `
544
544
  `, n = n.substring(p.length + 1), h = !0), !h) {
545
545
  const S = this.rules.other.nextBulletRegex(f), A = this.rules.other.hrRegex(f), v = this.rules.other.fencesBeginRegex(f), I = this.rules.other.headingBeginRegex(f), L = this.rules.other.htmlBeginRegex(f);
546
546
  for (; n; ) {
@@ -558,31 +558,31 @@ ${o}` : o;
558
558
  o += `
559
559
  ` + p;
560
560
  }
561
- !x && !p.trim() && (x = !0), a += _ + `
561
+ !x && !p.trim() && (x = !0), l += _ + `
562
562
  `, n = n.substring(_.length + 1), d = R.slice(f);
563
563
  }
564
564
  }
565
- i.loose || (c ? i.loose = !0 : this.rules.other.doubleBlankLine.test(a) && (c = !0));
565
+ i.loose || (c ? i.loose = !0 : this.rules.other.doubleBlankLine.test(l) && (c = !0));
566
566
  let b = null, y;
567
567
  this.options.gfm && (b = this.rules.other.listIsTask.exec(o), b && (y = b[0] !== "[ ] ", o = o.replace(this.rules.other.listReplaceTask, ""))), i.items.push({
568
568
  type: "list_item",
569
- raw: a,
569
+ raw: l,
570
570
  task: !!b,
571
571
  checked: y,
572
572
  loose: !1,
573
573
  text: o,
574
574
  tokens: []
575
- }), i.raw += a;
575
+ }), i.raw += l;
576
576
  }
577
- const l = i.items.at(-1);
578
- if (l)
579
- l.raw = l.raw.trimEnd(), l.text = l.text.trimEnd();
577
+ const a = i.items.at(-1);
578
+ if (a)
579
+ a.raw = a.raw.trimEnd(), a.text = a.text.trimEnd();
580
580
  else
581
581
  return;
582
582
  i.raw = i.raw.trimEnd();
583
583
  for (let h = 0; h < i.items.length; h++)
584
584
  if (this.lexer.state.top = !1, i.items[h].tokens = this.lexer.blockTokens(i.items[h].text, []), !i.loose) {
585
- const a = i.items[h].tokens.filter((d) => d.type === "space"), o = a.length > 0 && a.some((d) => this.rules.other.anyLine.test(d.raw));
585
+ const l = i.items[h].tokens.filter((d) => d.type === "space"), o = l.length > 0 && l.some((d) => this.rules.other.anyLine.test(d.raw));
586
586
  i.loose = o;
587
587
  }
588
588
  if (i.loose)
@@ -629,21 +629,21 @@ ${o}` : o;
629
629
  rows: []
630
630
  };
631
631
  if (t.length === r.length) {
632
- for (const l of r)
633
- this.rules.other.tableAlignRight.test(l) ? s.align.push("right") : this.rules.other.tableAlignCenter.test(l) ? s.align.push("center") : this.rules.other.tableAlignLeft.test(l) ? s.align.push("left") : s.align.push(null);
634
- for (let l = 0; l < t.length; l++)
632
+ for (const a of r)
633
+ 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);
634
+ for (let a = 0; a < t.length; a++)
635
635
  s.header.push({
636
- text: t[l],
637
- tokens: this.lexer.inline(t[l]),
636
+ text: t[a],
637
+ tokens: this.lexer.inline(t[a]),
638
638
  header: !0,
639
- align: s.align[l]
639
+ align: s.align[a]
640
640
  });
641
- for (const l of i)
642
- s.rows.push(oe(l, s.header.length).map((h, a) => ({
641
+ for (const a of i)
642
+ s.rows.push(oe(a, s.header.length).map((h, l) => ({
643
643
  text: h,
644
644
  tokens: this.lexer.inline(h),
645
645
  header: !1,
646
- align: s.align[a]
646
+ align: s.align[l]
647
647
  })));
648
648
  return s;
649
649
  }
@@ -718,8 +718,8 @@ ${o}` : o;
718
718
  if (s === -2)
719
719
  return;
720
720
  if (s > -1) {
721
- const l = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + s;
722
- e[2] = e[2].substring(0, s), e[0] = e[0].substring(0, l).trim(), e[3] = "";
721
+ const a = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + s;
722
+ e[2] = e[2].substring(0, s), e[0] = e[0].substring(0, a).trim(), e[3] = "";
723
723
  }
724
724
  }
725
725
  let r = e[2], i = "";
@@ -754,21 +754,21 @@ ${o}` : o;
754
754
  if (!r || r[3] && t.match(this.rules.other.unicodeAlphaNumeric)) return;
755
755
  if (!(r[1] || r[2] || "") || !t || this.rules.inline.punctuation.exec(t)) {
756
756
  const s = [...r[0]].length - 1;
757
- let c, l, h = s, a = 0;
757
+ let c, a, h = s, l = 0;
758
758
  const o = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
759
759
  for (o.lastIndex = 0, e = e.slice(-1 * n.length + s); (r = o.exec(e)) != null; ) {
760
760
  if (c = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !c) continue;
761
- if (l = [...c].length, r[3] || r[4]) {
762
- h += l;
761
+ if (a = [...c].length, r[3] || r[4]) {
762
+ h += a;
763
763
  continue;
764
- } else if ((r[5] || r[6]) && s % 3 && !((s + l) % 3)) {
765
- a += l;
764
+ } else if ((r[5] || r[6]) && s % 3 && !((s + a) % 3)) {
765
+ l += a;
766
766
  continue;
767
767
  }
768
- if (h -= l, h > 0) continue;
769
- l = Math.min(l, l + h + a);
770
- const d = [...r[0]][0].length, p = n.slice(0, s + r.index + d + l);
771
- if (Math.min(s, l) % 2) {
768
+ if (h -= a, h > 0) continue;
769
+ a = Math.min(a, a + h + l);
770
+ const d = [...r[0]][0].length, p = n.slice(0, s + r.index + d + a);
771
+ if (Math.min(s, a) % 2) {
772
772
  const f = p.slice(1, -1);
773
773
  return {
774
774
  type: "em",
@@ -884,7 +884,7 @@ ${o}` : o;
884
884
  g(this, "state");
885
885
  g(this, "tokenizer");
886
886
  g(this, "inlineQueue");
887
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || z, this.options.tokenizer = this.options.tokenizer || new N(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
887
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || z, this.options.tokenizer = this.options.tokenizer || new j(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
888
888
  inLink: !1,
889
889
  inRawBlock: !1,
890
890
  top: !0
@@ -932,98 +932,98 @@ ${o}` : o;
932
932
  blockTokens(e, t = [], r = !1) {
933
933
  var i, s, c;
934
934
  for (this.options.pedantic && (e = e.replace(w.tabCharGlobal, " ").replace(w.spaceLine, "")); e; ) {
935
- let l;
936
- if ((s = (i = this.options.extensions) == null ? void 0 : i.block) != null && s.some((a) => (l = a.call({ lexer: this }, e, t)) ? (e = e.substring(l.raw.length), t.push(l), !0) : !1))
935
+ let a;
936
+ if ((s = (i = this.options.extensions) == null ? void 0 : i.block) != null && s.some((l) => (a = l.call({ lexer: this }, e, t)) ? (e = e.substring(a.raw.length), t.push(a), !0) : !1))
937
937
  continue;
938
- if (l = this.tokenizer.space(e)) {
939
- e = e.substring(l.raw.length);
940
- const a = t.at(-1);
941
- l.raw.length === 1 && a !== void 0 ? a.raw += `
942
- ` : t.push(l);
938
+ if (a = this.tokenizer.space(e)) {
939
+ e = e.substring(a.raw.length);
940
+ const l = t.at(-1);
941
+ a.raw.length === 1 && l !== void 0 ? l.raw += `
942
+ ` : t.push(a);
943
943
  continue;
944
944
  }
945
- if (l = this.tokenizer.code(e)) {
946
- e = e.substring(l.raw.length);
947
- const a = t.at(-1);
948
- (a == null ? void 0 : a.type) === "paragraph" || (a == null ? void 0 : a.type) === "text" ? (a.raw += `
949
- ` + l.raw, a.text += `
950
- ` + l.text, this.inlineQueue.at(-1).src = a.text) : t.push(l);
945
+ if (a = this.tokenizer.code(e)) {
946
+ e = e.substring(a.raw.length);
947
+ const l = t.at(-1);
948
+ (l == null ? void 0 : l.type) === "paragraph" || (l == null ? void 0 : l.type) === "text" ? (l.raw += `
949
+ ` + a.raw, l.text += `
950
+ ` + a.text, this.inlineQueue.at(-1).src = l.text) : t.push(a);
951
951
  continue;
952
952
  }
953
- if (l = this.tokenizer.fences(e)) {
954
- e = e.substring(l.raw.length), t.push(l);
953
+ if (a = this.tokenizer.fences(e)) {
954
+ e = e.substring(a.raw.length), t.push(a);
955
955
  continue;
956
956
  }
957
- if (l = this.tokenizer.heading(e)) {
958
- e = e.substring(l.raw.length), t.push(l);
957
+ if (a = this.tokenizer.heading(e)) {
958
+ e = e.substring(a.raw.length), t.push(a);
959
959
  continue;
960
960
  }
961
- if (l = this.tokenizer.hr(e)) {
962
- e = e.substring(l.raw.length), t.push(l);
961
+ if (a = this.tokenizer.hr(e)) {
962
+ e = e.substring(a.raw.length), t.push(a);
963
963
  continue;
964
964
  }
965
- if (l = this.tokenizer.blockquote(e)) {
966
- e = e.substring(l.raw.length), t.push(l);
965
+ if (a = this.tokenizer.blockquote(e)) {
966
+ e = e.substring(a.raw.length), t.push(a);
967
967
  continue;
968
968
  }
969
- if (l = this.tokenizer.list(e)) {
970
- e = e.substring(l.raw.length), t.push(l);
969
+ if (a = this.tokenizer.list(e)) {
970
+ e = e.substring(a.raw.length), t.push(a);
971
971
  continue;
972
972
  }
973
- if (l = this.tokenizer.html(e)) {
974
- e = e.substring(l.raw.length), t.push(l);
973
+ if (a = this.tokenizer.html(e)) {
974
+ e = e.substring(a.raw.length), t.push(a);
975
975
  continue;
976
976
  }
977
- if (l = this.tokenizer.def(e)) {
978
- e = e.substring(l.raw.length);
979
- const a = t.at(-1);
980
- (a == null ? void 0 : a.type) === "paragraph" || (a == null ? void 0 : a.type) === "text" ? (a.raw += `
981
- ` + l.raw, a.text += `
982
- ` + l.raw, this.inlineQueue.at(-1).src = a.text) : this.tokens.links[l.tag] || (this.tokens.links[l.tag] = {
983
- href: l.href,
984
- title: l.title
977
+ if (a = this.tokenizer.def(e)) {
978
+ e = e.substring(a.raw.length);
979
+ const l = t.at(-1);
980
+ (l == null ? void 0 : l.type) === "paragraph" || (l == null ? void 0 : l.type) === "text" ? (l.raw += `
981
+ ` + a.raw, l.text += `
982
+ ` + a.raw, this.inlineQueue.at(-1).src = l.text) : this.tokens.links[a.tag] || (this.tokens.links[a.tag] = {
983
+ href: a.href,
984
+ title: a.title
985
985
  });
986
986
  continue;
987
987
  }
988
- if (l = this.tokenizer.table(e)) {
989
- e = e.substring(l.raw.length), t.push(l);
988
+ if (a = this.tokenizer.table(e)) {
989
+ e = e.substring(a.raw.length), t.push(a);
990
990
  continue;
991
991
  }
992
- if (l = this.tokenizer.lheading(e)) {
993
- e = e.substring(l.raw.length), t.push(l);
992
+ if (a = this.tokenizer.lheading(e)) {
993
+ e = e.substring(a.raw.length), t.push(a);
994
994
  continue;
995
995
  }
996
996
  let h = e;
997
997
  if ((c = this.options.extensions) != null && c.startBlock) {
998
- let a = 1 / 0;
998
+ let l = 1 / 0;
999
999
  const o = e.slice(1);
1000
1000
  let d;
1001
1001
  this.options.extensions.startBlock.forEach((p) => {
1002
- d = p.call({ lexer: this }, o), typeof d == "number" && d >= 0 && (a = Math.min(a, d));
1003
- }), a < 1 / 0 && a >= 0 && (h = e.substring(0, a + 1));
1002
+ d = p.call({ lexer: this }, o), typeof d == "number" && d >= 0 && (l = Math.min(l, d));
1003
+ }), l < 1 / 0 && l >= 0 && (h = e.substring(0, l + 1));
1004
1004
  }
1005
- if (this.state.top && (l = this.tokenizer.paragraph(h))) {
1006
- const a = t.at(-1);
1007
- r && (a == null ? void 0 : a.type) === "paragraph" ? (a.raw += `
1008
- ` + l.raw, a.text += `
1009
- ` + l.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = a.text) : t.push(l), r = h.length !== e.length, e = e.substring(l.raw.length);
1005
+ if (this.state.top && (a = this.tokenizer.paragraph(h))) {
1006
+ const l = t.at(-1);
1007
+ r && (l == null ? void 0 : l.type) === "paragraph" ? (l.raw += `
1008
+ ` + a.raw, l.text += `
1009
+ ` + a.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : t.push(a), r = h.length !== e.length, e = e.substring(a.raw.length);
1010
1010
  continue;
1011
1011
  }
1012
- if (l = this.tokenizer.text(e)) {
1013
- e = e.substring(l.raw.length);
1014
- const a = t.at(-1);
1015
- (a == null ? void 0 : a.type) === "text" ? (a.raw += `
1016
- ` + l.raw, a.text += `
1017
- ` + l.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = a.text) : t.push(l);
1012
+ if (a = this.tokenizer.text(e)) {
1013
+ e = e.substring(a.raw.length);
1014
+ const l = t.at(-1);
1015
+ (l == null ? void 0 : l.type) === "text" ? (l.raw += `
1016
+ ` + a.raw, l.text += `
1017
+ ` + a.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : t.push(a);
1018
1018
  continue;
1019
1019
  }
1020
1020
  if (e) {
1021
- const a = "Infinite loop on byte: " + e.charCodeAt(0);
1021
+ const l = "Infinite loop on byte: " + e.charCodeAt(0);
1022
1022
  if (this.options.silent) {
1023
- console.error(a);
1023
+ console.error(l);
1024
1024
  break;
1025
1025
  } else
1026
- throw new Error(a);
1026
+ throw new Error(l);
1027
1027
  }
1028
1028
  }
1029
1029
  return this.state.top = !0, t;
@@ -1035,7 +1035,7 @@ ${o}` : o;
1035
1035
  * Lexing/Compiling
1036
1036
  */
1037
1037
  inlineTokens(e, t = []) {
1038
- var l, h, a;
1038
+ var a, h, l;
1039
1039
  let r = e, i = null;
1040
1040
  if (this.tokens.links) {
1041
1041
  const o = Object.keys(this.tokens.links);
@@ -1051,7 +1051,7 @@ ${o}` : o;
1051
1051
  for (; e; ) {
1052
1052
  s || (c = ""), s = !1;
1053
1053
  let o;
1054
- if ((h = (l = this.options.extensions) == null ? void 0 : l.inline) != null && h.some((p) => (o = p.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), !0) : !1))
1054
+ if ((h = (a = this.options.extensions) == null ? void 0 : a.inline) != null && h.some((p) => (o = p.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), !0) : !1))
1055
1055
  continue;
1056
1056
  if (o = this.tokenizer.escape(e)) {
1057
1057
  e = e.substring(o.raw.length), t.push(o);
@@ -1096,7 +1096,7 @@ ${o}` : o;
1096
1096
  continue;
1097
1097
  }
1098
1098
  let d = e;
1099
- if ((a = this.options.extensions) != null && a.startInline) {
1099
+ if ((l = this.options.extensions) != null && l.startInline) {
1100
1100
  let p = 1 / 0;
1101
1101
  const x = e.slice(1);
1102
1102
  let f;
@@ -1159,8 +1159,8 @@ ${this.parser.parse(n)}</blockquote>
1159
1159
  const e = n.ordered, t = n.start;
1160
1160
  let r = "";
1161
1161
  for (let c = 0; c < n.items.length; c++) {
1162
- const l = n.items[c];
1163
- r += this.listitem(l);
1162
+ const a = n.items[c];
1163
+ r += this.listitem(a);
1164
1164
  }
1165
1165
  const i = e ? "ol" : "ul", s = e && t !== 1 ? ' start="' + t + '"' : "";
1166
1166
  return "<" + i + s + `>
@@ -1237,7 +1237,7 @@ ${n}</tr>
1237
1237
  return `<del>${this.parser.parseInline(n)}</del>`;
1238
1238
  }
1239
1239
  link({ href: n, title: e, tokens: t }) {
1240
- const r = this.parser.parseInline(t), i = ae(n);
1240
+ const r = this.parser.parseInline(t), i = le(n);
1241
1241
  if (i === null)
1242
1242
  return r;
1243
1243
  n = i;
@@ -1246,7 +1246,7 @@ ${n}</tr>
1246
1246
  }
1247
1247
  image({ href: n, title: e, text: t, tokens: r }) {
1248
1248
  r && (t = this.parser.parseInline(r, this.parser.textRenderer));
1249
- const i = ae(n);
1249
+ const i = le(n);
1250
1250
  if (i === null)
1251
1251
  return $(t);
1252
1252
  n = i;
@@ -1311,15 +1311,15 @@ ${n}</tr>
1311
1311
  var i, s;
1312
1312
  let r = "";
1313
1313
  for (let c = 0; c < e.length; c++) {
1314
- const l = e[c];
1315
- if ((s = (i = this.options.extensions) == null ? void 0 : i.renderers) != null && s[l.type]) {
1316
- const a = l, o = this.options.extensions.renderers[a.type].call({ parser: this }, a);
1317
- if (o !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(a.type)) {
1314
+ const a = e[c];
1315
+ if ((s = (i = this.options.extensions) == null ? void 0 : i.renderers) != null && s[a.type]) {
1316
+ const l = a, o = this.options.extensions.renderers[l.type].call({ parser: this }, l);
1317
+ if (o !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(l.type)) {
1318
1318
  r += o || "";
1319
1319
  continue;
1320
1320
  }
1321
1321
  }
1322
- const h = l;
1322
+ const h = a;
1323
1323
  switch (h.type) {
1324
1324
  case "space": {
1325
1325
  r += this.renderer.space(h);
@@ -1358,10 +1358,10 @@ ${n}</tr>
1358
1358
  continue;
1359
1359
  }
1360
1360
  case "text": {
1361
- let a = h, o = this.renderer.text(a);
1361
+ let l = h, o = this.renderer.text(l);
1362
1362
  for (; c + 1 < e.length && e[c + 1].type === "text"; )
1363
- a = e[++c], o += `
1364
- ` + this.renderer.text(a);
1363
+ l = e[++c], o += `
1364
+ ` + this.renderer.text(l);
1365
1365
  t ? r += this.renderer.paragraph({
1366
1366
  type: "paragraph",
1367
1367
  raw: o,
@@ -1371,10 +1371,10 @@ ${n}</tr>
1371
1371
  continue;
1372
1372
  }
1373
1373
  default: {
1374
- const a = 'Token with "' + h.type + '" type was not found.';
1374
+ const l = 'Token with "' + h.type + '" type was not found.';
1375
1375
  if (this.options.silent)
1376
- return console.error(a), "";
1377
- throw new Error(a);
1376
+ return console.error(l), "";
1377
+ throw new Error(l);
1378
1378
  }
1379
1379
  }
1380
1380
  }
@@ -1387,15 +1387,15 @@ ${n}</tr>
1387
1387
  var i, s;
1388
1388
  let r = "";
1389
1389
  for (let c = 0; c < e.length; c++) {
1390
- const l = e[c];
1391
- if ((s = (i = this.options.extensions) == null ? void 0 : i.renderers) != null && s[l.type]) {
1392
- const a = this.options.extensions.renderers[l.type].call({ parser: this }, l);
1393
- if (a !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(l.type)) {
1394
- r += a || "";
1390
+ const a = e[c];
1391
+ if ((s = (i = this.options.extensions) == null ? void 0 : i.renderers) != null && s[a.type]) {
1392
+ const l = this.options.extensions.renderers[a.type].call({ parser: this }, a);
1393
+ if (l !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(a.type)) {
1394
+ r += l || "";
1395
1395
  continue;
1396
1396
  }
1397
1397
  }
1398
- const h = l;
1398
+ const h = a;
1399
1399
  switch (h.type) {
1400
1400
  case "escape": {
1401
1401
  r += t.text(h);
@@ -1438,10 +1438,10 @@ ${n}</tr>
1438
1438
  break;
1439
1439
  }
1440
1440
  default: {
1441
- const a = 'Token with "' + h.type + '" type was not found.';
1441
+ const l = 'Token with "' + h.type + '" type was not found.';
1442
1442
  if (this.options.silent)
1443
- return console.error(a), "";
1444
- throw new Error(a);
1443
+ return console.error(l), "";
1444
+ throw new Error(l);
1445
1445
  }
1446
1446
  }
1447
1447
  }
@@ -1497,7 +1497,7 @@ ${n}</tr>
1497
1497
  g(this, "Renderer", Z);
1498
1498
  g(this, "TextRenderer", ie);
1499
1499
  g(this, "Lexer", E);
1500
- g(this, "Tokenizer", N);
1500
+ g(this, "Tokenizer", j);
1501
1501
  g(this, "Hooks", O);
1502
1502
  this.use(...n);
1503
1503
  }
@@ -1511,10 +1511,10 @@ ${n}</tr>
1511
1511
  switch (t = t.concat(e.call(this, s)), s.type) {
1512
1512
  case "table": {
1513
1513
  const c = s;
1514
- for (const l of c.header)
1515
- t = t.concat(this.walkTokens(l.tokens, e));
1516
- for (const l of c.rows)
1517
- for (const h of l)
1514
+ for (const a of c.header)
1515
+ t = t.concat(this.walkTokens(a.tokens, e));
1516
+ for (const a of c.rows)
1517
+ for (const h of a)
1518
1518
  t = t.concat(this.walkTokens(h.tokens, e));
1519
1519
  break;
1520
1520
  }
@@ -1525,8 +1525,8 @@ ${n}</tr>
1525
1525
  }
1526
1526
  default: {
1527
1527
  const c = s;
1528
- (i = (r = this.defaults.extensions) == null ? void 0 : r.childTokens) != null && i[c.type] ? this.defaults.extensions.childTokens[c.type].forEach((l) => {
1529
- const h = c[l].flat(1 / 0);
1528
+ (i = (r = this.defaults.extensions) == null ? void 0 : r.childTokens) != null && i[c.type] ? this.defaults.extensions.childTokens[c.type].forEach((a) => {
1529
+ const h = c[a].flat(1 / 0);
1530
1530
  t = t.concat(this.walkTokens(h, e));
1531
1531
  }) : c.tokens && (t = t.concat(this.walkTokens(c.tokens, e)));
1532
1532
  }
@@ -1543,8 +1543,8 @@ ${n}</tr>
1543
1543
  if ("renderer" in i) {
1544
1544
  const s = e.renderers[i.name];
1545
1545
  s ? e.renderers[i.name] = function(...c) {
1546
- let l = i.renderer.apply(this, c);
1547
- return l === !1 && (l = s.apply(this, c)), l;
1546
+ let a = i.renderer.apply(this, c);
1547
+ return a === !1 && (a = s.apply(this, c)), a;
1548
1548
  } : e.renderers[i.name] = i.renderer;
1549
1549
  }
1550
1550
  if ("tokenizer" in i) {
@@ -1561,25 +1561,25 @@ ${n}</tr>
1561
1561
  throw new Error(`renderer '${s}' does not exist`);
1562
1562
  if (["options", "parser"].includes(s))
1563
1563
  continue;
1564
- const c = s, l = t.renderer[c], h = i[c];
1565
- i[c] = (...a) => {
1566
- let o = l.apply(i, a);
1567
- return o === !1 && (o = h.apply(i, a)), o || "";
1564
+ const c = s, a = t.renderer[c], h = i[c];
1565
+ i[c] = (...l) => {
1566
+ let o = a.apply(i, l);
1567
+ return o === !1 && (o = h.apply(i, l)), o || "";
1568
1568
  };
1569
1569
  }
1570
1570
  r.renderer = i;
1571
1571
  }
1572
1572
  if (t.tokenizer) {
1573
- const i = this.defaults.tokenizer || new N(this.defaults);
1573
+ const i = this.defaults.tokenizer || new j(this.defaults);
1574
1574
  for (const s in t.tokenizer) {
1575
1575
  if (!(s in i))
1576
1576
  throw new Error(`tokenizer '${s}' does not exist`);
1577
1577
  if (["options", "rules", "lexer"].includes(s))
1578
1578
  continue;
1579
- const c = s, l = t.tokenizer[c], h = i[c];
1580
- i[c] = (...a) => {
1581
- let o = l.apply(i, a);
1582
- return o === !1 && (o = h.apply(i, a)), o;
1579
+ const c = s, a = t.tokenizer[c], h = i[c];
1580
+ i[c] = (...l) => {
1581
+ let o = a.apply(i, l);
1582
+ return o === !1 && (o = h.apply(i, l)), o;
1583
1583
  };
1584
1584
  }
1585
1585
  r.tokenizer = i;
@@ -1591,15 +1591,15 @@ ${n}</tr>
1591
1591
  throw new Error(`hook '${s}' does not exist`);
1592
1592
  if (["options", "block"].includes(s))
1593
1593
  continue;
1594
- const c = s, l = t.hooks[c], h = i[c];
1595
- O.passThroughHooks.has(s) ? i[c] = (a) => {
1594
+ const c = s, a = t.hooks[c], h = i[c];
1595
+ O.passThroughHooks.has(s) ? i[c] = (l) => {
1596
1596
  if (this.defaults.async)
1597
- return Promise.resolve(l.call(i, a)).then((d) => h.call(i, d));
1598
- const o = l.call(i, a);
1597
+ return Promise.resolve(a.call(i, l)).then((d) => h.call(i, d));
1598
+ const o = a.call(i, l);
1599
1599
  return h.call(i, o);
1600
- } : i[c] = (...a) => {
1601
- let o = l.apply(i, a);
1602
- return o === !1 && (o = h.apply(i, a)), o;
1600
+ } : i[c] = (...l) => {
1601
+ let o = a.apply(i, l);
1602
+ return o === !1 && (o = h.apply(i, l)), o;
1603
1603
  };
1604
1604
  }
1605
1605
  r.hooks = i;
@@ -1607,8 +1607,8 @@ ${n}</tr>
1607
1607
  if (t.walkTokens) {
1608
1608
  const i = this.defaults.walkTokens, s = t.walkTokens;
1609
1609
  r.walkTokens = function(c) {
1610
- let l = [];
1611
- return l.push(s.call(this, c)), i && (l = l.concat(i.call(this, c))), l;
1610
+ let a = [];
1611
+ return a.push(s.call(this, c)), i && (a = a.concat(i.call(this, c))), a;
1612
1612
  };
1613
1613
  }
1614
1614
  this.defaults = { ...this.defaults, ...r };
@@ -1633,17 +1633,17 @@ ${n}</tr>
1633
1633
  if (typeof t != "string")
1634
1634
  return c(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
1635
1635
  s.hooks && (s.hooks.options = s, s.hooks.block = n);
1636
- const l = s.hooks ? s.hooks.provideLexer() : n ? E.lex : E.lexInline, h = s.hooks ? s.hooks.provideParser() : n ? T.parse : T.parseInline;
1636
+ const a = s.hooks ? s.hooks.provideLexer() : n ? E.lex : E.lexInline, h = s.hooks ? s.hooks.provideParser() : n ? T.parse : T.parseInline;
1637
1637
  if (s.async)
1638
- return Promise.resolve(s.hooks ? s.hooks.preprocess(t) : t).then((a) => l(a, s)).then((a) => s.hooks ? s.hooks.processAllTokens(a) : a).then((a) => s.walkTokens ? Promise.all(this.walkTokens(a, s.walkTokens)).then(() => a) : a).then((a) => h(a, s)).then((a) => s.hooks ? s.hooks.postprocess(a) : a).catch(c);
1638
+ return Promise.resolve(s.hooks ? s.hooks.preprocess(t) : t).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) => h(l, s)).then((l) => s.hooks ? s.hooks.postprocess(l) : l).catch(c);
1639
1639
  try {
1640
1640
  s.hooks && (t = s.hooks.preprocess(t));
1641
- let a = l(t, s);
1642
- s.hooks && (a = s.hooks.processAllTokens(a)), s.walkTokens && this.walkTokens(a, s.walkTokens);
1643
- let o = h(a, s);
1641
+ let l = a(t, s);
1642
+ s.hooks && (l = s.hooks.processAllTokens(l)), s.walkTokens && this.walkTokens(l, s.walkTokens);
1643
+ let o = h(l, s);
1644
1644
  return s.hooks && (o = s.hooks.postprocess(o)), o;
1645
- } catch (a) {
1646
- return c(a);
1645
+ } catch (l) {
1646
+ return c(l);
1647
1647
  }
1648
1648
  };
1649
1649
  }
@@ -1681,7 +1681,7 @@ m.Renderer = Z;
1681
1681
  m.TextRenderer = ie;
1682
1682
  m.Lexer = E;
1683
1683
  m.lexer = E.lex;
1684
- m.Tokenizer = N;
1684
+ m.Tokenizer = j;
1685
1685
  m.Hooks = O;
1686
1686
  m.parse = m;
1687
1687
  m.options;
@@ -1707,14 +1707,18 @@ const he = ({ data: n, style: e }) => /* @__PURE__ */ u.createElement(
1707
1707
  }
1708
1708
  }
1709
1709
  ) : /* @__PURE__ */ u.createElement("p", { style: { margin: 0, whiteSpace: "pre-wrap" } }, n ? n.question : "")
1710
- ), gt = ({ items: n, onApply: e, getEditorContent: t }) => {
1710
+ ), gt = ({
1711
+ items: n,
1712
+ onApply: e,
1713
+ getEditorContent: t
1714
+ }) => {
1711
1715
  const r = async (i) => {
1712
1716
  const s = /제목:[^\n]*/g;
1713
1717
  ((s.exec(i) || [])[0] || "").replace("제목: ", "").replace(`
1714
1718
  `, "");
1715
- const l = i.replace(s, "").replace("본문: ", "");
1716
- let h = await m.parse(l);
1717
- const a = /<!--HanbiroSignatureStart-->([\s\S]*?)<!--HanbiroSignatureEnd-->/g, o = t ? t() : "", d = a.exec(o) || [];
1719
+ const a = i.replace(s, "").replace("본문: ", "");
1720
+ let h = await m.parse(a);
1721
+ const l = /<!--HanbiroSignatureStart-->([\s\S]*?)<!--HanbiroSignatureEnd-->/g, o = t ? t() : "", d = l.exec(o) || [];
1718
1722
  d[0] && (h = h + "<br>" + d[0]), e({ html: h });
1719
1723
  };
1720
1724
  return /* @__PURE__ */ u.createElement(
@@ -1732,76 +1736,109 @@ const he = ({ data: n, style: e }) => /* @__PURE__ */ u.createElement(
1732
1736
  flexDirection: "column"
1733
1737
  }
1734
1738
  },
1735
- n && n.map((i) => /* @__PURE__ */ u.createElement("div", { key: i.id, style: { display: "flex", flexDirection: "column", marginBottom: 16 } }, /* @__PURE__ */ u.createElement(
1739
+ n && n.map((i) => /* @__PURE__ */ u.createElement(
1736
1740
  "div",
1737
1741
  {
1742
+ key: i.id,
1738
1743
  style: {
1739
- width: "100%",
1740
1744
  display: "flex",
1741
- alignItems: "flex-end",
1742
1745
  flexDirection: "column",
1743
- position: "relative",
1744
- marginTop: 8
1746
+ marginBottom: 16
1745
1747
  }
1746
1748
  },
1747
1749
  /* @__PURE__ */ u.createElement(
1748
- he,
1750
+ "div",
1749
1751
  {
1750
- data: { question: i.question },
1751
1752
  style: {
1752
- border: "1px solid #e0e0e0",
1753
- borderRadius: 8,
1754
- borderTopRightRadius: 0,
1755
- padding: "8px 12px",
1756
- background: "#f9f9f9"
1753
+ width: "100%",
1754
+ display: "flex",
1755
+ alignItems: "flex-end",
1756
+ flexDirection: "column",
1757
+ position: "relative",
1758
+ marginTop: 8
1757
1759
  }
1758
- }
1759
- )
1760
- ), /* @__PURE__ */ u.createElement(
1761
- "div",
1762
- {
1763
- style: {
1764
- width: "100%",
1765
- display: "flex",
1766
- alignItems: "flex-start",
1767
- flexDirection: "column",
1768
- position: "relative",
1769
- marginTop: 8
1770
- }
1771
- },
1772
- i.isLoading ? /* @__PURE__ */ u.createElement("div", { style: { marginTop: 8, fontStyle: "italic", color: "#888" } }, "Loading...") : /* @__PURE__ */ u.createElement("div", { style: { display: "flex", flexDirection: "row", alignItems: "flex-end", width: "100%" } }, /* @__PURE__ */ u.createElement(
1773
- he,
1774
- {
1775
- data: { subject: i.subject, body: i.body },
1776
- style: {
1777
- background: "#f5f5f5",
1778
- borderRadius: 8,
1779
- borderTopLeftRadius: 0,
1780
- padding: "8px 12px",
1781
- flexShrink: 0
1760
+ },
1761
+ /* @__PURE__ */ u.createElement(
1762
+ he,
1763
+ {
1764
+ data: { question: i.question },
1765
+ style: {
1766
+ borderRadius: 8,
1767
+ borderTopRightRadius: 0,
1768
+ padding: "8px 12px",
1769
+ background: "var(--background-softGrey)"
1770
+ }
1782
1771
  }
1783
- }
1784
- ), /* @__PURE__ */ u.createElement(
1785
- "button",
1772
+ )
1773
+ ),
1774
+ /* @__PURE__ */ u.createElement(
1775
+ "div",
1786
1776
  {
1787
- type: "button",
1788
- title: "Apply content",
1789
- onClick: () => r(i.body),
1790
1777
  style: {
1791
- marginLeft: 4,
1792
- background: "none",
1793
- border: "none",
1794
- cursor: "pointer",
1778
+ width: "100%",
1795
1779
  display: "flex",
1796
- alignItems: "center",
1797
- justifyContent: "center",
1798
- padding: 8,
1799
- borderRadius: 4
1780
+ alignItems: "flex-start",
1781
+ flexDirection: "column",
1782
+ position: "relative",
1783
+ marginTop: 8
1800
1784
  }
1801
1785
  },
1802
- /* @__PURE__ */ u.createElement(pe, { size: 16, color: "#666" })
1803
- ))
1804
- )))
1786
+ i.isLoading ? /* @__PURE__ */ u.createElement(
1787
+ "div",
1788
+ {
1789
+ style: {
1790
+ marginTop: 8,
1791
+ fontStyle: "italic",
1792
+ color: "var(--text-secondary)"
1793
+ }
1794
+ },
1795
+ "Loading..."
1796
+ ) : /* @__PURE__ */ u.createElement(
1797
+ "div",
1798
+ {
1799
+ style: {
1800
+ display: "flex",
1801
+ flexDirection: "row",
1802
+ alignItems: "flex-end",
1803
+ width: "100%"
1804
+ }
1805
+ },
1806
+ /* @__PURE__ */ u.createElement(
1807
+ he,
1808
+ {
1809
+ data: { subject: i.subject, body: i.body },
1810
+ style: {
1811
+ background: "var(--background-softGrey)",
1812
+ borderRadius: 8,
1813
+ borderTopLeftRadius: 0,
1814
+ padding: "8px 12px",
1815
+ flexShrink: 0
1816
+ }
1817
+ }
1818
+ ),
1819
+ /* @__PURE__ */ u.createElement(
1820
+ "button",
1821
+ {
1822
+ type: "button",
1823
+ title: "Apply content",
1824
+ onClick: () => r(i.body),
1825
+ style: {
1826
+ marginLeft: 4,
1827
+ background: "none",
1828
+ border: "none",
1829
+ cursor: "pointer",
1830
+ display: "flex",
1831
+ alignItems: "center",
1832
+ justifyContent: "center",
1833
+ padding: 8,
1834
+ borderRadius: 4
1835
+ }
1836
+ },
1837
+ /* @__PURE__ */ u.createElement(pe, { size: 16, color: "#666" })
1838
+ )
1839
+ )
1840
+ )
1841
+ ))
1805
1842
  );
1806
1843
  };
1807
1844
  class dt extends u.Component {
@@ -1828,94 +1865,115 @@ class dt extends u.Component {
1828
1865
  }
1829
1866
  render() {
1830
1867
  const { lang: t, originalEmail: r, setOriginalEmail: i, getEditorContent: s } = this.props, { open: c } = this.state;
1831
- return /* @__PURE__ */ u.createElement("div", { ref: this.containerRef, style: { position: "relative", display: "inline-block" } }, /* @__PURE__ */ u.createElement(
1832
- "button",
1833
- {
1834
- type: "button",
1835
- onClick: this.togglePopper,
1836
- style: {
1837
- background: "transparent",
1838
- border: "none",
1839
- cursor: "pointer",
1840
- width: 36,
1841
- height: 36,
1842
- display: "flex",
1843
- alignItems: "center",
1844
- justifyContent: "center",
1845
- color: c ? "#1976d2" : "#555",
1846
- borderRadius: 4
1847
- }
1848
- },
1849
- /* @__PURE__ */ u.createElement(Te, { size: 20 })
1850
- ), c && /* @__PURE__ */ u.createElement(
1868
+ return /* @__PURE__ */ u.createElement(
1851
1869
  "div",
1852
1870
  {
1853
- style: {
1854
- position: "absolute",
1855
- bottom: "100%",
1856
- left: 0,
1857
- zIndex: 1051,
1858
- background: "#fff",
1859
- border: "1px solid #ddd",
1860
- boxShadow: "0px 4px 12px rgba(0, 0, 0, 0.1)",
1861
- borderRadius: 8,
1862
- padding: 16,
1863
- width: 320,
1864
- marginBottom: 8
1865
- }
1871
+ ref: this.containerRef,
1872
+ style: { position: "relative", display: "inline-block" }
1866
1873
  },
1867
- /* @__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("span", { style: { fontSize: 12, fontWeight: 500, color: "#666" } }, "Language"), /* @__PURE__ */ u.createElement(
1868
- "select",
1869
- {
1870
- value: t ? t.value : "",
1871
- onChange: this.handleLangChange,
1872
- style: {
1873
- padding: "6px 8px",
1874
- borderRadius: 4,
1875
- border: "1px solid #ccc",
1876
- fontSize: 14
1877
- }
1878
- },
1879
- /* @__PURE__ */ u.createElement("option", { value: "", disabled: !0 }, "Select Language"),
1880
- W.map((l) => /* @__PURE__ */ u.createElement("option", { key: l.value, value: l.value }, l.label))
1881
- )), /* @__PURE__ */ u.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 4 } }, /* @__PURE__ */ u.createElement("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" } }, /* @__PURE__ */ u.createElement("span", { style: { fontSize: 12, fontWeight: 500, color: "#666" } }, "AI Context"), s && /* @__PURE__ */ u.createElement(
1874
+ /* @__PURE__ */ u.createElement(
1882
1875
  "button",
1883
1876
  {
1884
1877
  type: "button",
1885
- title: "Copy from origin email",
1886
- onClick: () => {
1887
- const l = s();
1888
- i(l);
1889
- },
1890
- style: {
1891
- background: "none",
1892
- border: "none",
1893
- cursor: "pointer",
1894
- display: "flex",
1895
- alignItems: "center",
1896
- padding: 2
1897
- }
1878
+ onClick: this.togglePopper,
1879
+ className: "icon-button small"
1898
1880
  },
1899
- /* @__PURE__ */ u.createElement(pe, { size: 14, color: "#1976d2" })
1900
- )), /* @__PURE__ */ u.createElement(
1901
- "textarea",
1881
+ /* @__PURE__ */ u.createElement(Te, { size: 16 })
1882
+ ),
1883
+ c && /* @__PURE__ */ u.createElement(
1884
+ "div",
1902
1885
  {
1903
- value: r,
1904
- onChange: (l) => i(l.target.value),
1905
1886
  style: {
1906
- width: "100%",
1907
- height: 120,
1908
- resize: "vertical",
1909
- padding: 8,
1910
- border: "1px solid #ccc",
1911
- borderRadius: 4,
1912
- fontSize: 13,
1913
- fontFamily: "inherit",
1914
- boxSizing: "border-box"
1887
+ position: "absolute",
1888
+ bottom: "100%",
1889
+ left: 0,
1890
+ zIndex: 1051,
1891
+ background: "#fff",
1892
+ border: "1px solid #ddd",
1893
+ boxShadow: "0px 4px 12px rgba(0, 0, 0, 0.1)",
1894
+ borderRadius: 8,
1895
+ padding: 16,
1896
+ width: 320,
1897
+ marginBottom: 8
1915
1898
  }
1916
- }
1917
- )))
1918
- ));
1899
+ },
1900
+ /* @__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(
1901
+ "span",
1902
+ {
1903
+ style: {
1904
+ fontSize: 12,
1905
+ fontWeight: 500,
1906
+ color: "var(--text-secondary)"
1907
+ }
1908
+ },
1909
+ "Language"
1910
+ ), /* @__PURE__ */ u.createElement(
1911
+ "select",
1912
+ {
1913
+ value: t ? t.value : "",
1914
+ onChange: this.handleLangChange,
1915
+ style: {
1916
+ padding: "6px 8px",
1917
+ borderRadius: 4,
1918
+ border: "1px solid #ccc",
1919
+ fontSize: 14
1920
+ }
1921
+ },
1922
+ /* @__PURE__ */ u.createElement("option", { value: "", disabled: !0 }, "Select Language"),
1923
+ W.map((a) => /* @__PURE__ */ u.createElement("option", { key: a.value, value: a.value }, a.label))
1924
+ )), /* @__PURE__ */ u.createElement("div", { style: { display: "flex", flexDirection: "column", gap: 4 } }, /* @__PURE__ */ u.createElement(
1925
+ "div",
1926
+ {
1927
+ style: {
1928
+ display: "flex",
1929
+ alignItems: "center",
1930
+ justifyContent: "space-between"
1931
+ }
1932
+ },
1933
+ /* @__PURE__ */ u.createElement(
1934
+ "span",
1935
+ {
1936
+ style: {
1937
+ fontSize: 12,
1938
+ fontWeight: 500,
1939
+ color: "var(--text-secondary)"
1940
+ }
1941
+ },
1942
+ "AI Context"
1943
+ ),
1944
+ s && /* @__PURE__ */ u.createElement(
1945
+ "button",
1946
+ {
1947
+ type: "button",
1948
+ title: "Copy from origin email",
1949
+ onClick: () => {
1950
+ const a = s();
1951
+ i(a);
1952
+ },
1953
+ className: "icon-button"
1954
+ },
1955
+ /* @__PURE__ */ u.createElement(pe, null)
1956
+ )
1957
+ ), /* @__PURE__ */ u.createElement(
1958
+ "textarea",
1959
+ {
1960
+ value: r,
1961
+ onChange: (a) => i(a.target.value),
1962
+ style: {
1963
+ width: "100%",
1964
+ height: 120,
1965
+ resize: "vertical",
1966
+ padding: 8,
1967
+ border: "1px solid #ccc",
1968
+ borderRadius: 4,
1969
+ fontSize: 13,
1970
+ fontFamily: "inherit",
1971
+ boxSizing: "border-box"
1972
+ }
1973
+ }
1974
+ )))
1975
+ )
1976
+ );
1919
1977
  }
1920
1978
  }
1921
1979
  class bt extends u.Component {
@@ -1929,11 +1987,11 @@ class bt extends u.Component {
1929
1987
  this.setState({ message: t.target.value });
1930
1988
  });
1931
1989
  g(this, "handleSubmit", async () => {
1932
- const { message: t, messages: r, lang: i, originalEmail: s, conversationId: c } = this.state, { signer: l, baseUrl: h = "" } = this.props;
1990
+ const { message: t, messages: r, lang: i, originalEmail: s, conversationId: c } = this.state, { signer: a, baseUrl: h = "" } = this.props;
1933
1991
  if (!t.trim()) return;
1934
- const a = Ee();
1992
+ const l = Ee();
1935
1993
  let o = {
1936
- id: a,
1994
+ id: l,
1937
1995
  question: t,
1938
1996
  subject: "",
1939
1997
  body: "",
@@ -1955,8 +2013,9 @@ class bt extends u.Component {
1955
2013
  c && (p.conversation_id = c), await Ae(p, {
1956
2014
  setContent: (y) => {
1957
2015
  this.setState((S) => ({ messages: S.messages.map(
1958
- (v) => v.id === a ? {
2016
+ (v) => v.id === l ? {
1959
2017
  ...v,
2018
+ subject: "Some thing not used",
1960
2019
  body: y,
1961
2020
  isLoading: !1,
1962
2021
  created_at: (/* @__PURE__ */ new Date()).getTime()
@@ -1965,13 +2024,13 @@ class bt extends u.Component {
1965
2024
  },
1966
2025
  setIsLoading: (y) => {
1967
2026
  this.setState((S) => ({ messages: S.messages.map(
1968
- (v) => v.id === a ? { ...v, isLoading: y } : v
2027
+ (v) => v.id === l ? { ...v, isLoading: y } : v
1969
2028
  ) }));
1970
2029
  },
1971
2030
  setConversationId: (y) => {
1972
2031
  this.setState({ conversationId: y });
1973
2032
  },
1974
- signer: l,
2033
+ signer: a,
1975
2034
  baseUrl: h
1976
2035
  }), this.setState({ isSending: !1 });
1977
2036
  });
@@ -1994,7 +2053,7 @@ class bt extends u.Component {
1994
2053
  };
1995
2054
  }
1996
2055
  render() {
1997
- const { onApply: t, getEditorContent: r } = this.props, { message: i, messages: s, isSending: c, lang: l, originalEmail: h } = this.state;
2056
+ const { onApply: t, getEditorContent: r } = this.props, { message: i, messages: s, isSending: c, lang: a, originalEmail: h } = this.state;
1998
2057
  return /* @__PURE__ */ u.createElement(
1999
2058
  "div",
2000
2059
  {
@@ -2025,7 +2084,7 @@ class bt extends u.Component {
2025
2084
  flexDirection: "column",
2026
2085
  alignItems: "center",
2027
2086
  justifyContent: "center",
2028
- color: "#ccc"
2087
+ color: "var(--grey-light)"
2029
2088
  }
2030
2089
  },
2031
2090
  /* @__PURE__ */ u.createElement(ze, { size: 46 }),
@@ -2035,7 +2094,7 @@ class bt extends u.Component {
2035
2094
  style: {
2036
2095
  marginTop: 16,
2037
2096
  fontWeight: 600,
2038
- color: "#999",
2097
+ color: "inherit",
2039
2098
  fontSize: 18
2040
2099
  }
2041
2100
  },
@@ -2048,9 +2107,9 @@ class bt extends u.Component {
2048
2107
  style: {
2049
2108
  width: "100%",
2050
2109
  border: "1px solid #ddd",
2051
- borderRadius: 8,
2110
+ borderRadius: 4,
2052
2111
  // overflow: "hidden",
2053
- background: c ? "#f9f9f9" : "#fff",
2112
+ background: c ? "var(--background-lightGrey)" : "#fff",
2054
2113
  display: "flex",
2055
2114
  flexDirection: "column"
2056
2115
  }
@@ -2061,12 +2120,13 @@ class bt extends u.Component {
2061
2120
  value: i,
2062
2121
  onChange: this.handleMessageChange,
2063
2122
  placeholder: "Describe your email",
2123
+ name: "ai-content",
2064
2124
  onKeyDown: this.handleKeyDown,
2065
2125
  disabled: c,
2066
2126
  style: {
2067
2127
  flex: 1,
2068
2128
  minWidth: 0,
2069
- borderRadius: 8,
2129
+ borderRadius: 4,
2070
2130
  padding: 12,
2071
2131
  fontSize: 13,
2072
2132
  border: "none",
@@ -2093,7 +2153,7 @@ class bt extends u.Component {
2093
2153
  /* @__PURE__ */ u.createElement(
2094
2154
  dt,
2095
2155
  {
2096
- lang: l,
2156
+ lang: a,
2097
2157
  setLang: this.setLang,
2098
2158
  originalEmail: h,
2099
2159
  setOriginalEmail: this.setOriginalEmail,
@@ -2105,21 +2165,10 @@ class bt extends u.Component {
2105
2165
  {
2106
2166
  disabled: !i.trim() || c,
2107
2167
  onClick: this.handleSubmit,
2108
- style: {
2109
- flexShrink: 0,
2110
- background: !i.trim() || c ? "#e0e0e0" : "#1976d2",
2111
- color: "#fff",
2112
- border: "none",
2113
- borderRadius: 4,
2114
- padding: "6px 12px",
2115
- cursor: !i.trim() || c ? "not-allowed" : "pointer",
2116
- display: "flex",
2117
- alignItems: "center",
2118
- justifyContent: "center",
2119
- transition: "background 0.2s"
2120
- }
2168
+ className: "icon-button",
2169
+ color: "primary"
2121
2170
  },
2122
- /* @__PURE__ */ u.createElement(Ce, { size: 16 })
2171
+ /* @__PURE__ */ u.createElement(Ce, null)
2123
2172
  )
2124
2173
  )
2125
2174
  )