markdown-flow-ui 0.2.19-dev.1 → 0.2.20-dev.1

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,91 +1,91 @@
1
- import { jsx as r, jsxs as We } from "react/jsx-runtime";
2
- import Q, { useMemo as C, useState as be, useRef as x, useEffect as P } from "react";
3
- import He from "../../_virtual/index.es.js";
1
+ import { jsx as r, jsxs as He } from "react/jsx-runtime";
2
+ import Q, { useMemo as C, useState as be, useRef as v, useEffect as P } from "react";
3
+ import qe from "../../_virtual/index.es.js";
4
4
  import { sanitizeInvalidTagName as Pe } from "./utils/sanitize-invalid-tag-name.es.js";
5
5
  import { stripSvgTextLineBreaks as Qe } from "./utils/strip-svg-text-line-breaks.es.js";
6
6
  /* empty css */
7
7
  /* empty css */
8
8
  /* empty css */
9
9
  /* empty css */
10
- import qe, { CodeBlockContext as je } from "./CodeBlock.es.js";
11
- import Ue from "./plugins/CustomVariable.es.js";
10
+ import je, { CodeBlockContext as Ue } from "./CodeBlock.es.js";
11
+ import Ke from "./plugins/CustomVariable.es.js";
12
12
  import ie from "./plugins/MermaidChart.es.js";
13
- import { preserveCustomVariableProperties as Ke, restoreCustomVariableProperties as Oe } from "./utils/custom-variable-props.es.js";
14
- import { subsetLanguages as Xe, highlightLanguages as Ye } from "./utils/highlight-languages.es.js";
15
- import { parseMarkdownSegments as Be, mermaidBlockIsComplete as Ze } from "./utils/mermaid-parse.es.js";
13
+ import { preserveCustomVariableProperties as Oe, restoreCustomVariableProperties as Xe } from "./utils/custom-variable-props.es.js";
14
+ import { subsetLanguages as Ye, highlightLanguages as Ze } from "./utils/highlight-languages.es.js";
15
+ import { parseMarkdownSegments as Be, mermaidBlockIsComplete as Je } from "./utils/mermaid-parse.es.js";
16
16
  import { normalizeInlineHtml as Se } from "./utils/normalize-inline-html.es.js";
17
- import Je from "./IframeSandbox.es.js";
18
- import { getTrailingTypewriterGrapheme as ae, appendContentAwareTypewriterQueue as et, createContentAwareTypewriterQueue as tt, consumeContentAwareTypewriterQueue as rt, CONTENT_AWARE_TYPEWRITER_TICK_BUDGET as nt, isContentAwareTypewriterQueueEmpty as ot } from "./utils/typewriter-pacing.es.js";
19
- import { splitContentSegments as st } from "./utils/split-content.es.js";
20
- import { getInteractionDefaultValues as at } from "../../lib/interaction-defaults.es.js";
21
- import { getMarkdownFlowDirection as it, getMarkdownFlowLanguage as ct } from "../../lib/locale.es.js";
22
- import { getContentRenderLocaleTexts as Ae } from "./contentRenderI18n.es.js";
23
- import { Markdown as lt } from "../../node_modules/react-markdown/lib/index.es.js";
24
- import ut from "../../node_modules/rehype-raw/lib/index.es.js";
25
- import dt from "../../node_modules/rehype-highlight/lib/index.es.js";
26
- import mt from "../../node_modules/rehype-katex/lib/index.es.js";
27
- import pt from "../../node_modules/remark-gfm/lib/index.es.js";
28
- import ht from "../../node_modules/remark-math/lib/index.es.js";
29
- import ft from "../../node_modules/remark-breaks/lib/index.es.js";
30
- const gt = /<(script|style|link|iframe|html|head|body|meta|title|base|template|div|section|article|main)\b/i, xt = 2, Re = ({ svg: t }) => {
31
- const n = x(null);
17
+ import et from "./IframeSandbox.es.js";
18
+ import { getTrailingTypewriterGrapheme as ae, appendContentAwareTypewriterQueue as Re, consumeContentAwareTypewriterQueue as tt, CONTENT_AWARE_TYPEWRITER_TICK_BUDGET as rt, isContentAwareTypewriterQueueEmpty as nt } from "./utils/typewriter-pacing.es.js";
19
+ import { splitContentSegments as ot } from "./utils/split-content.es.js";
20
+ import { getInteractionDefaultValues as st } from "../../lib/interaction-defaults.es.js";
21
+ import { getMarkdownFlowDirection as at, getMarkdownFlowLanguage as it } from "../../lib/locale.es.js";
22
+ import { getContentRenderLocaleTexts as Le } from "./contentRenderI18n.es.js";
23
+ import { Markdown as ct } from "../../node_modules/react-markdown/lib/index.es.js";
24
+ import lt from "../../node_modules/rehype-raw/lib/index.es.js";
25
+ import ut from "../../node_modules/rehype-highlight/lib/index.es.js";
26
+ import dt from "../../node_modules/rehype-katex/lib/index.es.js";
27
+ import mt from "../../node_modules/remark-gfm/lib/index.es.js";
28
+ import pt from "../../node_modules/remark-math/lib/index.es.js";
29
+ import ht from "../../node_modules/remark-breaks/lib/index.es.js";
30
+ const ft = /<(script|style|link|iframe|html|head|body|meta|title|base|template|div|section|article|main)\b/i, gt = 2, Ne = ({ svg: t }) => {
31
+ const n = v(null);
32
32
  return P(() => {
33
33
  const o = n.current;
34
34
  if (!o) return;
35
- const s = o.shadowRoot ?? o.attachShadow({ mode: "open" }), w = "content-render-svg-style";
36
- let u = s.getElementById(w);
37
- u || (u = document.createElement("style"), u.id = w, u.textContent = `
35
+ const s = o.shadowRoot ?? o.attachShadow({ mode: "open" }), k = "content-render-svg-style";
36
+ let u = s.getElementById(k);
37
+ u || (u = document.createElement("style"), u.id = k, u.textContent = `
38
38
  svg { height: auto; display: inline-block; }
39
39
  svg.content-render-svg-el--responsive { width: 100%; max-width: 100%; }
40
40
  svg.content-render-svg-el--fixed { max-width: none; }
41
41
  `, s.appendChild(u)), Array.from(s.childNodes).filter(
42
42
  (a) => a !== u
43
43
  ).forEach((a) => s.removeChild(a));
44
- const I = document.createElement("template"), L = Qe(t);
45
- I.innerHTML = L, s.append(I.content.cloneNode(!0));
46
- let d = !1, G = !1;
44
+ const G = document.createElement("template"), D = Qe(t);
45
+ G.innerHTML = D, s.append(G.content.cloneNode(!0));
46
+ let d = !1, F = !1;
47
47
  s.querySelectorAll("svg").forEach((a) => {
48
- const _ = a.getAttribute("viewBox");
49
- if (!_) return;
50
- const z = _.trim().split(/[\s,]+/).map((v) => Number(v));
51
- if (z.length !== 4 || z.some(Number.isNaN)) return;
52
- const [, , M, B] = z, N = a.getAttribute("width"), $ = a.getAttribute("height"), q = (v) => {
53
- if (!v) return !1;
54
- const c = v.trim().toLowerCase();
48
+ const z = a.getAttribute("viewBox");
49
+ if (!z) return;
50
+ const W = z.trim().split(/[\s,]+/).map((T) => Number(T));
51
+ if (W.length !== 4 || W.some(Number.isNaN)) return;
52
+ const [, , E, S] = W, L = a.getAttribute("width"), V = a.getAttribute("height"), j = (T) => {
53
+ if (!T) return !1;
54
+ const c = T.trim().toLowerCase();
55
55
  return c === "auto" || c.endsWith("%");
56
- }, j = (v) => {
57
- if (!v) return null;
58
- const c = v.trim().toLowerCase();
56
+ }, U = (T) => {
57
+ if (!T) return null;
58
+ const c = T.trim().toLowerCase();
59
59
  if (c === "auto" || c.endsWith("%"))
60
60
  return null;
61
- const A = Number.parseFloat(c);
62
- return Number.isNaN(A) ? null : A;
63
- }, Y = q(N), Z = q($), U = !N || N === "0", K = !$ || $ === "0", J = j(N), ee = j($);
64
- if (Y || Z || U && K || J === M && ee === B) {
65
- d = !0, a.classList.add("content-render-svg-el--responsive"), a.classList.remove("content-render-svg-el--fixed"), a.style.width = "100%", a.style.height = "auto", !a.style.aspectRatio && B > 0 && (a.style.aspectRatio = `${M} / ${B}`);
61
+ const M = Number.parseFloat(c);
62
+ return Number.isNaN(M) ? null : M;
63
+ }, Y = j(L), Z = j(V), K = !L || L === "0", O = !V || V === "0", J = U(L), ee = U(V);
64
+ if (Y || Z || K && O || J === E && ee === S) {
65
+ d = !0, a.classList.add("content-render-svg-el--responsive"), a.classList.remove("content-render-svg-el--fixed"), a.style.width = "100%", a.style.height = "auto", !a.style.aspectRatio && S > 0 && (a.style.aspectRatio = `${E} / ${S}`);
66
66
  return;
67
67
  }
68
- G = !0, a.classList.add("content-render-svg-el--fixed"), a.classList.remove("content-render-svg-el--responsive"), U && M > 0 && a.setAttribute("width", `${M}`), K && B > 0 && a.setAttribute("height", `${B}`);
68
+ F = !0, a.classList.add("content-render-svg-el--fixed"), a.classList.remove("content-render-svg-el--responsive"), K && E > 0 && a.setAttribute("width", `${E}`), O && S > 0 && a.setAttribute("height", `${S}`);
69
69
  });
70
- const F = d && !G;
71
- o.classList.toggle("content-render-svg--responsive", F), o.classList.toggle("content-render-svg--fixed", !F);
70
+ const _ = d && !F;
71
+ o.classList.toggle("content-render-svg--responsive", _), o.classList.toggle("content-render-svg--fixed", !_);
72
72
  }, [t]), /* @__PURE__ */ r("div", { className: "content-render-svg-scroll", children: /* @__PURE__ */ r("div", { className: "content-render-svg", ref: n }) });
73
73
  }, ce = Q.createContext(
74
74
  null
75
- ), vt = (t) => {
76
- const n = Q.useContext(ce), o = Q.useContext(je);
75
+ ), xt = (t) => {
76
+ const n = Q.useContext(ce), o = Q.useContext(Ue);
77
77
  if (!n)
78
78
  throw new Error("Markdown code renderer requires ContentRender context.");
79
- const { className: s, children: w, ...u } = t;
79
+ const { className: s, children: k, ...u } = t;
80
80
  if (/language-(\w+)/.exec(s || "")?.[1] === "mermaid") {
81
- const L = w?.toString().replace(/\n$/, "") || "", d = Ze(
81
+ const D = k?.toString().replace(/\n$/, "") || "", d = Je(
82
82
  n.current.renderContent,
83
- L
83
+ D
84
84
  );
85
85
  return /* @__PURE__ */ r(
86
86
  ie,
87
87
  {
88
- chart: L,
88
+ chart: D,
89
89
  frozen: d,
90
90
  messages: n.current.mermaidMessages
91
91
  }
@@ -97,40 +97,40 @@ const gt = /<(script|style|link|iframe|html|head|body|meta|title|base|template|d
97
97
  className: s,
98
98
  ...u,
99
99
  dir: u.dir ?? (o ? void 0 : "ltr"),
100
- children: w
100
+ children: k
101
101
  }
102
102
  );
103
- }, Tt = [
103
+ }, vt = [
104
+ mt,
104
105
  pt,
105
- ht,
106
- He,
107
- ft
108
- ], yt = [
109
- Ke,
110
- ut,
111
- Pe,
106
+ qe,
107
+ ht
108
+ ], Tt = [
112
109
  Oe,
113
- [dt, { languages: Ye, subset: Xe }],
114
- mt
115
- ], Ne = ({ content: t, components: n, locale: o }) => {
116
- const s = Ae(o);
110
+ lt,
111
+ Pe,
112
+ Xe,
113
+ [ut, { languages: Ze, subset: Ye }],
114
+ dt
115
+ ], Ae = ({ content: t, components: n, locale: o }) => {
116
+ const s = Le(o);
117
117
  return /* @__PURE__ */ r("div", { className: "markdown-renderer", children: /* @__PURE__ */ r(
118
- lt,
118
+ ct,
119
119
  {
120
- remarkPlugins: Tt,
121
- rehypePlugins: yt,
120
+ remarkPlugins: vt,
121
+ rehypePlugins: Tt,
122
122
  remarkRehypeOptions: {
123
123
  footnoteLabel: s.footnoteLabel,
124
- footnoteBackLabel: (w, u) => {
125
- const R = String(w + 1) + (u > 1 ? `-${u}` : "");
126
- return s.footnoteBackLabel.replace("{reference}", R);
124
+ footnoteBackLabel: (k, u) => {
125
+ const A = String(k + 1) + (u > 1 ? `-${u}` : "");
126
+ return s.footnoteBackLabel.replace("{reference}", A);
127
127
  }
128
128
  },
129
129
  components: n,
130
130
  children: t
131
131
  }
132
132
  ) });
133
- }, Ct = (t) => {
133
+ }, yt = (t) => {
134
134
  if (t.length <= 1) return t;
135
135
  const n = [];
136
136
  return t.forEach((o) => {
@@ -148,62 +148,62 @@ const gt = /<(script|style|link|iframe|html|head|body|meta|title|base|template|d
148
148
  }
149
149
  n.push({ type: "markdown", value: o.value });
150
150
  }), n;
151
- }, wt = (t, n) => {
151
+ }, Ct = (t, n) => {
152
152
  const o = Math.max(1, n), s = Array.from(t);
153
153
  return {
154
154
  chunk: s.slice(0, o).join(""),
155
155
  rest: s.slice(o).join("")
156
156
  };
157
- }, kt = (t, n) => t === n ? !0 : !t || !n || t.length !== n.length ? !1 : t.every((o, s) => o === n[s]), bt = (t) => {
158
- const n = x(t);
157
+ }, kt = (t, n) => t === n ? !0 : !t || !n || t.length !== n.length ? !1 : t.every((o, s) => o === n[s]), wt = (t) => {
158
+ const n = v(t);
159
159
  return kt(n.current, t) || (n.current = t), n.current;
160
- }, rr = ({
160
+ }, tr = ({
161
161
  content: t,
162
162
  contentType: n,
163
163
  locale: o,
164
164
  lang: s,
165
- dir: w,
165
+ dir: k,
166
166
  customRenderBar: u,
167
- onSend: R,
168
- typingSpeed: I = 40,
169
- enableTypewriter: L = !1,
167
+ onSend: A,
168
+ typingSpeed: G = 40,
169
+ enableTypewriter: D = !1,
170
170
  typewriterPacing: d = "fixed",
171
- onTypeFinished: G,
172
- onTypewriterStateChange: F,
171
+ onTypeFinished: F,
172
+ onTypewriterStateChange: _,
173
173
  userInput: a,
174
- interactionDefaultValueOptions: _,
175
- defaultButtonText: z,
176
- defaultInputText: M,
177
- defaultSelectedValues: B,
178
- readonly: N = !1,
179
- confirmButtonText: $,
180
- copyButtonText: q,
181
- copiedButtonText: j,
174
+ interactionDefaultValueOptions: z,
175
+ defaultButtonText: W,
176
+ defaultInputText: E,
177
+ defaultSelectedValues: S,
178
+ readonly: L = !1,
179
+ confirmButtonText: V,
180
+ copyButtonText: j,
181
+ copiedButtonText: U,
182
182
  sandboxLoadingText: Y,
183
183
  sandboxStyleLoadingText: Z,
184
- sandboxScriptLoadingText: U,
185
- disableSandboxLoadingOverlay: K = !1,
184
+ sandboxScriptLoadingText: K,
185
+ disableSandboxLoadingOverlay: O = !1,
186
186
  sandboxFullscreenButtonText: J,
187
187
  sandboxExitFullscreenButtonText: ee,
188
188
  sandboxMode: le = "content",
189
189
  onClickCustomButtonAfterContent: te,
190
- beforeSend: v
190
+ beforeSend: T
191
191
  // tooltipMinLength,
192
192
  }) => {
193
- const c = Ae(o), A = C(
193
+ const c = Le(o), M = C(
194
194
  () => ({
195
195
  loading: c.mermaidLoadingText,
196
196
  emptyChart: c.mermaidEmptyChartText,
197
197
  error: c.mermaidErrorText
198
198
  }),
199
199
  [c]
200
- ), W = w ?? it(o), H = s ?? ct(o), ue = $ || c.confirmButtonText, de = q || c.copyButtonText, me = j || c.copiedButtonText, Le = J || c.sandboxFullscreenButtonText, Me = ee || c.sandboxExitFullscreenButtonText, m = !!L && (!n || n === "text"), pe = Math.max(0, I), $e = d === "fixed" ? t : void 0, [k, he] = be(
200
+ ), H = k ?? at(o), q = s ?? it(o), ue = V || c.confirmButtonText, de = j || c.copyButtonText, me = U || c.copiedButtonText, Me = J || c.sandboxFullscreenButtonText, $e = ee || c.sandboxExitFullscreenButtonText, m = !!D && (!n || n === "text"), pe = Math.max(0, G), De = d === "fixed" ? t : void 0, [w, he] = be(
201
201
  () => m ? "" : t
202
- ), O = x(k), h = x(""), g = x({
202
+ ), X = v(w), h = v(""), g = v({
203
203
  tokens: [],
204
204
  head: 0,
205
205
  trailingGrapheme: ""
206
- }), S = x(0), fe = x(m), ge = x(d), xe = x(t), re = x(!1), [De, Ee] = be(0);
206
+ }), R = v(0), fe = v(m), ge = v(d), xe = v(t), re = v(!1), [Ee, Ve] = be(0);
207
207
  P(() => {
208
208
  const e = fe.current, i = ge.current, p = xe.current, b = !!h.current;
209
209
  fe.current = m, ge.current = d, xe.current = t, (t !== p || m !== e) && (re.current = !1);
@@ -212,60 +212,68 @@ const gt = /<(script|style|link|iframe|html|head|body|meta|title|base|template|d
212
212
  tokens: [],
213
213
  head: 0,
214
214
  trailingGrapheme: ""
215
- }, S.current = 0;
216
- }, D = (V) => {
217
- O.current = V, he(V);
215
+ }, R.current = 0;
216
+ }, $ = (I) => {
217
+ X.current = I, he(I);
218
218
  };
219
219
  if (!m) {
220
- f(), D(t);
220
+ f(), $(t);
221
221
  return;
222
222
  }
223
- e || (f(), D(""));
224
- const y = e ? O.current : "";
225
- if (!t.startsWith(y)) {
226
- f(), D(t), d === "content-aware" && (g.current = {
223
+ e || (f(), $(""));
224
+ const x = e ? X.current : "";
225
+ if (!t.startsWith(x)) {
226
+ f(), $(t), d === "content-aware" && (g.current = {
227
227
  tokens: [],
228
228
  head: 0,
229
229
  trailingGrapheme: ae(t)
230
230
  });
231
231
  return;
232
232
  }
233
- let E = t.slice(y.length);
234
- if (!E) {
235
- h.current = "", S.current = 0, g.current = d === "content-aware" ? {
233
+ let N = t.slice(x.length);
234
+ if (!N) {
235
+ h.current = "", R.current = 0, g.current = d === "content-aware" ? {
236
236
  tokens: [],
237
237
  head: 0,
238
- trailingGrapheme: ae(y)
238
+ trailingGrapheme: ae(x)
239
239
  } : { tokens: [], head: 0, trailingGrapheme: "" };
240
240
  return;
241
241
  }
242
242
  if (d === "content-aware") {
243
- const V = p.slice(
244
- y.length
243
+ const I = p.slice(
244
+ x.length
245
245
  );
246
- if (e && i === "content-aware" && t.startsWith(p) && h.current === V) {
247
- const X = et(
246
+ if (e && i === "content-aware" && t.startsWith(p) && h.current === I) {
247
+ const B = Re(
248
248
  g.current,
249
249
  t.slice(p.length)
250
250
  );
251
- g.current = X.queue, X.immediateChunk && (E = E.slice(
252
- X.immediateChunk.length
253
- ), D(`${y}${X.immediateChunk}`));
254
- } else
255
- g.current = {
256
- ...tt(E),
257
- trailingGrapheme: ae(y)
258
- }, S.current = 0;
251
+ g.current = B.queue, B.immediateChunk && (N = N.slice(
252
+ B.immediateChunk.length
253
+ ), $(`${x}${B.immediateChunk}`));
254
+ } else {
255
+ const B = Re(
256
+ {
257
+ tokens: [],
258
+ head: 0,
259
+ trailingGrapheme: ae(x)
260
+ },
261
+ N
262
+ );
263
+ g.current = B.queue, B.immediateChunk && (N = N.slice(
264
+ B.immediateChunk.length
265
+ ), $(`${x}${B.immediateChunk}`)), R.current = 0;
266
+ }
259
267
  } else
260
268
  g.current = {
261
269
  tokens: [],
262
270
  head: 0,
263
271
  trailingGrapheme: ""
264
- }, S.current = 0;
265
- h.current = E, !b && E && Ee((V) => V + 1);
272
+ }, R.current = 0;
273
+ h.current = N, !b && N && Ve((I) => I + 1);
266
274
  }, [t, m, d]), P(() => {
267
- m && (re.current || h.current || k !== t || (re.current = !0, G?.()));
268
- }, [t, k, m, G]), P(() => {
275
+ m && (re.current || h.current || w !== t || (re.current = !0, F?.()));
276
+ }, [t, w, m, F]), P(() => {
269
277
  if (!m || !h.current)
270
278
  return;
271
279
  const e = window.setTimeout(() => {
@@ -273,15 +281,15 @@ const gt = /<(script|style|link|iframe|html|head|body|meta|title|base|template|d
273
281
  return;
274
282
  let i = "";
275
283
  if (d === "content-aware") {
276
- const b = rt(
284
+ const b = tt(
277
285
  g.current,
278
- S.current + nt
286
+ R.current + rt
279
287
  );
280
- i = b.chunk, g.current = b.queue, ot(b.queue) ? S.current = 0 : S.current = b.remainingBudget;
288
+ i = b.chunk, g.current = b.queue, nt(b.queue) ? R.current = 0 : R.current = b.remainingBudget;
281
289
  } else
282
- i = wt(
290
+ i = Ct(
283
291
  h.current,
284
- xt
292
+ gt
285
293
  ).chunk;
286
294
  if (!i)
287
295
  return;
@@ -289,57 +297,57 @@ const gt = /<(script|style|link|iframe|html|head|body|meta|title|base|template|d
289
297
  tokens: [],
290
298
  head: 0,
291
299
  trailingGrapheme: g.current.trailingGrapheme
292
- } : { tokens: [], head: 0, trailingGrapheme: "" }, S.current = 0);
293
- const p = `${O.current}${i}`;
294
- O.current = p, he(p);
300
+ } : { tokens: [], head: 0, trailingGrapheme: "" }, R.current = 0);
301
+ const p = `${X.current}${i}`;
302
+ X.current = p, he(p);
295
303
  }, pe);
296
304
  return () => window.clearTimeout(e);
297
305
  }, [
298
- k,
299
- $e,
306
+ w,
307
+ De,
300
308
  m,
301
309
  d,
302
310
  pe,
303
- De
311
+ Ee
304
312
  ]);
305
313
  const ve = C(
306
314
  () => ({
307
315
  isTypewriterEnabled: m,
308
- isTyping: m && k !== t,
309
- isComplete: k === t,
310
- renderedLength: k.length,
316
+ isTyping: m && w !== t,
317
+ isComplete: w === t,
318
+ renderedLength: w.length,
311
319
  totalLength: t.length
312
320
  }),
313
- [t, k, m]
321
+ [t, w, m]
314
322
  );
315
323
  P(() => {
316
- F?.(ve);
317
- }, [F, ve]);
318
- const T = m ? k : t, ne = C(
319
- () => Se(T),
320
- [T]
324
+ _?.(ve);
325
+ }, [_, ve]);
326
+ const y = m ? w : t, ne = C(
327
+ () => Se(y),
328
+ [y]
321
329
  ), oe = C(
322
- () => at(
323
- T,
330
+ () => st(
331
+ y,
324
332
  a,
325
- _
333
+ z
326
334
  ),
327
- [_, T, a]
328
- ), Te = z?.trim() || oe.buttonText, ye = M?.trim() || oe.inputText, Ve = C(
335
+ [z, y, a]
336
+ ), Te = W?.trim() || oe.buttonText, ye = E?.trim() || oe.inputText, Ie = C(
329
337
  () => a ? a.split(",").map((e) => e.trim()).filter(Boolean) : void 0,
330
338
  [a]
331
- ), Ie = B?.length ? B : oe.selectedValues || Ve, Ce = bt(
332
- Ie
333
- ), l = x({
334
- direction: W,
335
- language: H,
336
- mermaidMessages: A,
337
- beforeSend: v,
339
+ ), Ge = S?.length ? S : oe.selectedValues || Ie, Ce = wt(
340
+ Ge
341
+ ), l = v({
342
+ direction: H,
343
+ language: q,
344
+ mermaidMessages: M,
345
+ beforeSend: T,
338
346
  locale: o,
339
347
  onClickCustomButtonAfterContent: te,
340
- onSend: R,
341
- readonly: N,
342
- renderContent: T,
348
+ onSend: A,
349
+ readonly: L,
350
+ renderContent: y,
343
351
  resolvedConfirmButtonText: ue,
344
352
  resolvedCopiedButtonText: me,
345
353
  resolvedCopyButtonText: de,
@@ -348,15 +356,15 @@ const gt = /<(script|style|link|iframe|html|head|body|meta|title|base|template|d
348
356
  resolvedDefaultSelectedValues: Ce
349
357
  });
350
358
  l.current = {
351
- direction: W,
352
- language: H,
353
- mermaidMessages: A,
354
- beforeSend: v,
359
+ direction: H,
360
+ language: q,
361
+ mermaidMessages: M,
362
+ beforeSend: T,
355
363
  locale: o,
356
364
  onClickCustomButtonAfterContent: te,
357
- onSend: R,
358
- readonly: N,
359
- renderContent: T,
365
+ onSend: A,
366
+ readonly: L,
367
+ renderContent: y,
360
368
  resolvedConfirmButtonText: ue,
361
369
  resolvedCopiedButtonText: me,
362
370
  resolvedCopyButtonText: de,
@@ -364,7 +372,7 @@ const gt = /<(script|style|link|iframe|html|head|body|meta|title|base|template|d
364
372
  resolvedDefaultInputText: ye,
365
373
  resolvedDefaultSelectedValues: Ce
366
374
  };
367
- const we = C(
375
+ const ke = C(
368
376
  () => ({
369
377
  "custom-button-after-content": ({
370
378
  children: e
@@ -377,7 +385,7 @@ const gt = /<(script|style|link|iframe|html|head|body|meta|title|base|template|d
377
385
  }
378
386
  ),
379
387
  "custom-variable": (e) => /* @__PURE__ */ r(
380
- Ue,
388
+ Ke,
381
389
  {
382
390
  ...e,
383
391
  readonly: l.current.readonly,
@@ -392,7 +400,7 @@ const gt = /<(script|style|link|iframe|html|head|body|meta|title|base|template|d
392
400
  confirmButtonText: l.current.resolvedConfirmButtonText
393
401
  }
394
402
  ),
395
- code: vt,
403
+ code: xt,
396
404
  table: ({ ...e }) => /* @__PURE__ */ r("div", { className: "content-render-table-container", children: /* @__PURE__ */ r("table", { className: "content-render-table", ...e }) }),
397
405
  th: ({ ...e }) => /* @__PURE__ */ r("th", { className: "content-render-th", ...e }),
398
406
  td: ({ ...e }) => /* @__PURE__ */ r("td", { className: "content-render-td", ...e }),
@@ -414,7 +422,7 @@ const gt = /<(script|style|link|iframe|html|head|body|meta|title|base|template|d
414
422
  ) : /* @__PURE__ */ r("input", { ...e }),
415
423
  a: ({ children: e, ...i }) => /* @__PURE__ */ r("a", { target: "_blank", rel: "noopener noreferrer", ...i, children: e }),
416
424
  pre: (e) => /* @__PURE__ */ r(
417
- qe,
425
+ je,
418
426
  {
419
427
  ...e,
420
428
  copyButtonText: l.current.resolvedCopyButtonText,
@@ -423,96 +431,96 @@ const gt = /<(script|style|link|iframe|html|head|body|meta|title|base|template|d
423
431
  )
424
432
  }),
425
433
  []
426
- ), ke = C(
427
- () => gt.test(T),
428
- [T]
434
+ ), we = C(
435
+ () => ft.test(y),
436
+ [y]
429
437
  ), se = C(
430
- () => ke ? st(T, !0) : [],
431
- [T, ke]
432
- ), Ge = se.some(
438
+ () => we ? ot(y, !0) : [],
439
+ [y, we]
440
+ ), Fe = se.some(
433
441
  (e) => e.type === "sandbox"
434
- ), Fe = C(
435
- () => Ct(se),
436
- [se]
437
442
  ), _e = C(
443
+ () => yt(se),
444
+ [se]
445
+ ), ze = C(
438
446
  () => Be(ne),
439
447
  [ne]
440
- ), ze = (e, i) => {
448
+ ), We = (e, i) => {
441
449
  const p = Se(e);
442
- return Be(p).map((f, D) => {
443
- const y = `${i}-${f.type}-${D}`;
450
+ return Be(p).map((f, $) => {
451
+ const x = `${i}-${f.type}-${$}`;
444
452
  return f.type === "text" ? /* @__PURE__ */ r(
445
453
  ce.Provider,
446
454
  {
447
455
  value: l,
448
456
  children: /* @__PURE__ */ r(
449
- Ne,
457
+ Ae,
450
458
  {
451
459
  locale: o,
452
- components: we,
460
+ components: ke,
453
461
  content: f.value
454
462
  }
455
463
  )
456
464
  },
457
- y
465
+ x
458
466
  ) : f.type === "mermaid" ? /* @__PURE__ */ r(
459
467
  ie,
460
468
  {
461
469
  chart: f.value,
462
470
  frozen: !f.complete,
463
- messages: A
471
+ messages: M
464
472
  },
465
- y
466
- ) : f.type === "svg" ? /* @__PURE__ */ r(Re, { svg: f.value }, y) : null;
473
+ x
474
+ ) : f.type === "svg" ? /* @__PURE__ */ r(Ne, { svg: f.value }, x) : null;
467
475
  });
468
476
  };
469
- return Ge ? /* @__PURE__ */ r(
477
+ return Fe ? /* @__PURE__ */ r(
470
478
  "div",
471
479
  {
472
480
  className: "content-render markdown-body",
473
- dir: W,
474
- lang: H,
475
- children: Fe.map(
481
+ dir: H,
482
+ lang: q,
483
+ children: _e.map(
476
484
  (e, i) => e.type === "sandbox" ? /* @__PURE__ */ r(
477
- Je,
485
+ et,
478
486
  {
479
487
  hideFullScreen: !0,
480
488
  type: "sandbox",
481
489
  content: e.value,
482
490
  className: "content-render-iframe",
483
491
  locale: o,
484
- dir: W,
485
- lang: H,
492
+ dir: H,
493
+ lang: q,
486
494
  loadingText: Y,
487
495
  styleLoadingText: Z,
488
- scriptLoadingText: U,
489
- disableLoadingOverlay: K,
490
- fullScreenButtonText: Le,
491
- exitFullScreenButtonText: Me,
496
+ scriptLoadingText: K,
497
+ disableLoadingOverlay: O,
498
+ fullScreenButtonText: Me,
499
+ exitFullScreenButtonText: $e,
492
500
  mode: le
493
501
  },
494
502
  `sandbox-${i}`
495
- ) : /* @__PURE__ */ r(Q.Fragment, { children: ze(e.value, `md-${i}`) }, `md-${i}`)
503
+ ) : /* @__PURE__ */ r(Q.Fragment, { children: We(e.value, `md-${i}`) }, `md-${i}`)
496
504
  )
497
505
  }
498
- ) : /* @__PURE__ */ We(
506
+ ) : /* @__PURE__ */ He(
499
507
  "div",
500
508
  {
501
509
  className: "content-render markdown-body",
502
- dir: W,
503
- lang: H,
510
+ dir: H,
511
+ lang: q,
504
512
  children: [
505
- _e.map((e, i) => {
513
+ ze.map((e, i) => {
506
514
  if (e.type === "text")
507
515
  return /* @__PURE__ */ r(
508
516
  ce.Provider,
509
517
  {
510
518
  value: l,
511
519
  children: /* @__PURE__ */ r(
512
- Ne,
520
+ Ae,
513
521
  {
514
522
  locale: o,
515
- components: we,
523
+ components: ke,
516
524
  content: e.value
517
525
  }
518
526
  )
@@ -525,24 +533,24 @@ const gt = /<(script|style|link|iframe|html|head|body|meta|title|base|template|d
525
533
  {
526
534
  chart: e.value,
527
535
  frozen: !e.complete,
528
- messages: A
536
+ messages: M
529
537
  },
530
538
  i
531
539
  );
532
540
  if (e.type === "svg")
533
- return /* @__PURE__ */ r(Re, { svg: e.value }, i);
541
+ return /* @__PURE__ */ r(Ne, { svg: e.value }, i);
534
542
  }),
535
543
  u && /* @__PURE__ */ r("div", { className: "content-render-custom-bar", children: Q.createElement(u, {
536
544
  content: t,
537
545
  displayContent: ne,
538
- onSend: R
546
+ onSend: A
539
547
  }) })
540
548
  ]
541
549
  }
542
550
  );
543
551
  };
544
552
  export {
545
- Ne as MarkdownRenderer,
546
- rr as default
553
+ Ae as MarkdownRenderer,
554
+ tr as default
547
555
  };
548
556
  //# sourceMappingURL=ContentRender.es.js.map