markdown-flow-ui 0.2.31 → 0.2.32

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.
Files changed (37) hide show
  1. package/README.md +3 -3
  2. package/dist/_virtual/index.es3.js +5 -4
  3. package/dist/_virtual/index.es3.js.map +1 -1
  4. package/dist/_virtual/index.es4.js +4 -5
  5. package/dist/_virtual/index.es4.js.map +1 -1
  6. package/dist/_virtual/index.es8.js +2 -2
  7. package/dist/_virtual/index.es9.js +2 -2
  8. package/dist/_virtual/index3.cjs +1 -1
  9. package/dist/_virtual/index4.cjs +1 -1
  10. package/dist/_virtual/index8.cjs +1 -1
  11. package/dist/_virtual/index9.cjs +1 -1
  12. package/dist/components/ContentRender/ContentRender.cjs +2 -2
  13. package/dist/components/ContentRender/ContentRender.cjs.map +1 -1
  14. package/dist/components/ContentRender/ContentRender.d.ts +1 -1
  15. package/dist/components/ContentRender/ContentRender.es.js +183 -172
  16. package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
  17. package/dist/components/ContentRender/utils/video-markdown-run.cjs +13 -13
  18. package/dist/components/ContentRender/utils/video-markdown-run.cjs.map +1 -1
  19. package/dist/components/ContentRender/utils/video-markdown-run.es.js +223 -217
  20. package/dist/components/ContentRender/utils/video-markdown-run.es.js.map +1 -1
  21. package/dist/components/ui/inputGroup/textarea.cjs +1 -1
  22. package/dist/components/ui/inputGroup/textarea.es.js +1 -1
  23. package/dist/node_modules/@braintree/sanitize-url/dist/index.cjs +1 -1
  24. package/dist/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
  25. package/dist/node_modules/classnames/index.cjs +1 -1
  26. package/dist/node_modules/classnames/index.es.js +1 -1
  27. package/dist/node_modules/rc-input/es/BaseInput.cjs +1 -1
  28. package/dist/node_modules/rc-input/es/BaseInput.es.js +1 -1
  29. package/dist/node_modules/rc-textarea/es/ResizableTextArea.cjs +1 -1
  30. package/dist/node_modules/rc-textarea/es/ResizableTextArea.es.js +1 -1
  31. package/dist/node_modules/rc-textarea/es/TextArea.cjs +1 -1
  32. package/dist/node_modules/rc-textarea/es/TextArea.es.js +1 -1
  33. package/dist/node_modules/rc-textarea/es/index.cjs +1 -1
  34. package/dist/node_modules/rc-textarea/es/index.es.js +1 -1
  35. package/dist/node_modules/remark-flow/dist/interaction-plugin-core.cjs +1 -1
  36. package/dist/node_modules/remark-flow/dist/interaction-plugin-core.es.js +1 -1
  37. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { jsx as r, jsxs as ze, Fragment as ut } from "react/jsx-runtime";
2
- import Z, { useMemo as h, useState as Fe, useRef as b, useEffect as te } from "react";
2
+ import Z, { useMemo as f, useState as Fe, useRef as b, useEffect as te } from "react";
3
3
  import { sanitizeInvalidTagName as lt } from "./utils/sanitize-invalid-tag-name.es.js";
4
4
  import { stripSvgTextLineBreaks as dt } from "./utils/strip-svg-text-line-breaks.es.js";
5
5
  /* empty css */
@@ -20,7 +20,7 @@ import kt from "./IframeSandbox.es.js";
20
20
  import { getTrailingTypewriterGrapheme as we, appendContentAwareTypewriterQueue as _e, consumeContentAwareTypewriterQueue as Tt, CONTENT_AWARE_TYPEWRITER_TICK_BUDGET as bt, isContentAwareTypewriterQueueEmpty as St } from "./utils/typewriter-pacing.es.js";
21
21
  import { normalizeWrappedSandboxContent as Rt, splitContentSegments as Bt } from "./utils/split-content.es.js";
22
22
  import { getInteractionDefaultValues as Nt } from "../../lib/interaction-defaults.es.js";
23
- import { getMarkdownFlowDirection as Mt, getMarkdownFlowLanguage as Lt } from "../../lib/locale.es.js";
23
+ import { getMarkdownFlowDirection as Lt, getMarkdownFlowLanguage as Mt } from "../../lib/locale.es.js";
24
24
  import { getContentRenderLocaleTexts as be } from "./contentRenderI18n.es.js";
25
25
  import { createVideoMarkdownRunPlan as At, cloneVideoMarkdownSourceTree as Vt, prepareVideoMarkdownRun as $t, projectVideoMarkdownRun as Et, getVideoMarkdownNodeState as It } from "./utils/video-markdown-run.es.js";
26
26
  import { unified as je } from "../../node_modules/unified/lib/index.es.js";
@@ -48,31 +48,31 @@ const Ft = 2, Te = ({
48
48
  ).forEach((u) => l.removeChild(u));
49
49
  const y = document.createElement("template"), S = dt(t);
50
50
  y.innerHTML = S, l.append(y.content.cloneNode(!0));
51
- let R = !1, k = !1;
51
+ let R = !1, T = !1;
52
52
  l.querySelectorAll("svg").forEach((u) => {
53
53
  const P = u.getAttribute("viewBox");
54
54
  if (!P) return;
55
- const D = P.trim().split(/[\s,]+/).map((M) => Number(M));
55
+ const D = P.trim().split(/[\s,]+/).map((L) => Number(L));
56
56
  if (D.length !== 4 || D.some(Number.isNaN)) return;
57
- const [, , W, w] = D, O = u.getAttribute("width"), z = u.getAttribute("height"), U = (M) => {
58
- if (!M) return !1;
59
- const L = M.trim().toLowerCase();
60
- return L === "auto" || L.endsWith("%");
61
- }, ne = (M) => {
62
- if (!M) return null;
63
- const L = M.trim().toLowerCase();
64
- if (L === "auto" || L.endsWith("%"))
57
+ const [, , W, C] = D, U = u.getAttribute("width"), z = u.getAttribute("height"), K = (L) => {
58
+ if (!L) return !1;
59
+ const M = L.trim().toLowerCase();
60
+ return M === "auto" || M.endsWith("%");
61
+ }, ne = (L) => {
62
+ if (!L) return null;
63
+ const M = L.trim().toLowerCase();
64
+ if (M === "auto" || M.endsWith("%"))
65
65
  return null;
66
- const H = Number.parseFloat(L);
67
- return Number.isNaN(H) ? null : H;
68
- }, ue = U(O), le = U(z), re = !O || O === "0", oe = !z || z === "0", de = ne(O), se = ne(z);
69
- if (ue || le || re && oe || de === W && se === w) {
70
- R = !0, u.classList.add("content-render-svg-el--responsive"), u.classList.remove("content-render-svg-el--fixed"), u.style.width = "100%", u.style.height = "auto", !u.style.aspectRatio && w > 0 && (u.style.aspectRatio = `${W} / ${w}`);
66
+ const q = Number.parseFloat(M);
67
+ return Number.isNaN(q) ? null : q;
68
+ }, ue = K(U), le = K(z), re = !U || U === "0", oe = !z || z === "0", de = ne(U), se = ne(z);
69
+ if (ue || le || re && oe || de === W && se === C) {
70
+ R = !0, u.classList.add("content-render-svg-el--responsive"), u.classList.remove("content-render-svg-el--fixed"), u.style.width = "100%", u.style.height = "auto", !u.style.aspectRatio && C > 0 && (u.style.aspectRatio = `${W} / ${C}`);
71
71
  return;
72
72
  }
73
- k = !0, u.classList.add("content-render-svg-el--fixed"), u.classList.remove("content-render-svg-el--responsive"), re && W > 0 && u.setAttribute("width", `${W}`), oe && w > 0 && u.setAttribute("height", `${w}`);
73
+ T = !0, u.classList.add("content-render-svg-el--fixed"), u.classList.remove("content-render-svg-el--responsive"), re && W > 0 && u.setAttribute("width", `${W}`), oe && C > 0 && u.setAttribute("height", `${C}`);
74
74
  });
75
- const p = R && !k;
75
+ const p = R && !T;
76
76
  i.classList.toggle("content-render-svg--responsive", p), i.classList.toggle("content-render-svg--fixed", !p);
77
77
  }, [t]), /* @__PURE__ */ r(a, { className: "content-render-svg-scroll", children: /* @__PURE__ */ r(
78
78
  a,
@@ -145,7 +145,7 @@ const Ft = 2, Te = ({
145
145
  }, _t = function() {
146
146
  this.parser = () => ({ type: "root", children: [] });
147
147
  }, jt = ({ plan: t, renderedSegments: o, components: s, locale: a }) => {
148
- const i = h(() => {
148
+ const i = f(() => {
149
149
  const S = be(a), R = je().use(Qe).use(Pt, {
150
150
  allowDangerousHtml: !0,
151
151
  footnoteLabel: S.footnoteLabel,
@@ -153,28 +153,28 @@ const Ft = 2, Te = ({
153
153
  "{reference}",
154
154
  String(u + 1) + (P > 1 ? `-${P}` : "")
155
155
  )
156
- }).use(Ke), k = je().use(Ye), p = R.runSync(
156
+ }).use(Ke), T = je().use(Ye), p = R.runSync(
157
157
  Vt(t),
158
158
  t.markdownSource
159
159
  );
160
160
  return $t(
161
161
  t,
162
162
  p,
163
- (u) => k.runSync(u, t.fullSource)
163
+ (u) => T.runSync(u, t.fullSource)
164
164
  );
165
- }, [t, a]), l = h(
165
+ }, [t, a]), l = f(
166
166
  () => Et(i, o),
167
167
  [i, o]
168
168
  ), x = b(s);
169
169
  x.current = s;
170
170
  const g = b(
171
171
  /* @__PURE__ */ new Map()
172
- ), ee = h(() => {
172
+ ), ee = f(() => {
173
173
  const S = /* @__PURE__ */ new Set(), R = (p) => {
174
174
  p.type === "element" && S.add(p.tagName), "children" in p && p.children.forEach(R);
175
175
  };
176
176
  R(i.tree);
177
- const k = {};
177
+ const T = {};
178
178
  for (const p of S) {
179
179
  if (!g.current.has(p)) {
180
180
  const u = ({
@@ -182,29 +182,29 @@ const Ft = 2, Te = ({
182
182
  children: D,
183
183
  ...W
184
184
  }) => {
185
- const w = It(P);
186
- if (w?.svg)
187
- return w.svgSource ? /* @__PURE__ */ r(Te, { svg: w.svgSource, inline: !0 }) : null;
188
- if (w?.atomic)
189
- return w.active ? /* @__PURE__ */ r(ut, { children: D }) : null;
190
- if (w?.active === !1 && p !== "a") return null;
191
- const z = x.current[p], U = w?.active === !1 ? { ...W, href: void 0, tabIndex: -1 } : W;
185
+ const C = It(P);
186
+ if (C?.svg)
187
+ return C.svgSource ? /* @__PURE__ */ r(Te, { svg: C.svgSource, inline: !0 }) : null;
188
+ if (C?.atomic)
189
+ return C.active ? /* @__PURE__ */ r(ut, { children: D }) : null;
190
+ if (C?.active === !1 && p !== "a") return null;
191
+ const z = x.current[p], K = C?.active === !1 ? { ...W, href: void 0, tabIndex: -1 } : W;
192
192
  return z ? Z.createElement(
193
193
  z,
194
194
  {
195
- ...U,
195
+ ...K,
196
196
  node: P,
197
197
  ...z === Ue ? { receivedTree: !0 } : {}
198
198
  },
199
199
  D
200
- ) : Z.createElement(p, U, D);
200
+ ) : Z.createElement(p, K, D);
201
201
  };
202
202
  u.displayName = `StableMarkdown(${p})`, g.current.set(p, u);
203
203
  }
204
- k[p] = g.current.get(p);
204
+ T[p] = g.current.get(p);
205
205
  }
206
- return k;
207
- }, [i]), y = h(
206
+ return T;
207
+ }, [i]), y = f(
208
208
  () => [() => () => l],
209
209
  [l]
210
210
  );
@@ -217,16 +217,16 @@ const Ft = 2, Te = ({
217
217
  children: ""
218
218
  }
219
219
  ) });
220
- }, j = (t) => t.type === "markdown" && t.immediate === !0, Ht = (t) => {
220
+ }, H = (t) => t.type === "markdown" && t.immediate === !0, Ht = (t) => {
221
221
  if (t.length <= 1) return t;
222
222
  const o = [];
223
223
  return t.forEach((s) => {
224
- if (s.type === "sandbox" || j(s)) {
224
+ if (s.type === "sandbox" || H(s)) {
225
225
  o.push(s);
226
226
  return;
227
227
  }
228
228
  const a = o[o.length - 1];
229
- if (a && a.type !== "sandbox" && !j(a)) {
229
+ if (a && a.type !== "sandbox" && !H(a)) {
230
230
  o[o.length - 1] = {
231
231
  type: "markdown",
232
232
  value: `${a.value}${s.value}`
@@ -258,7 +258,7 @@ const Ft = 2, Te = ({
258
258
  }, Ot = (t, o) => t === o ? !0 : !t || !o || t.length !== o.length ? !1 : t.every((s, a) => s === o[a]), Ut = (t) => {
259
259
  const o = b(t);
260
260
  return Ot(o.current, t) || (o.current = t), o.current;
261
- }, Mn = ({
261
+ }, Ln = ({
262
262
  content: t,
263
263
  contentType: o,
264
264
  locale: s,
@@ -271,16 +271,16 @@ const Ft = 2, Te = ({
271
271
  typewriterPacing: y = "fixed",
272
272
  onTypeFinished: S,
273
273
  onTypewriterStateChange: R,
274
- userInput: k,
274
+ userInput: T,
275
275
  interactionDefaultValueOptions: p,
276
276
  defaultButtonText: u,
277
277
  defaultInputText: P,
278
278
  defaultSelectedValues: D,
279
279
  readonly: W = !1,
280
- confirmButtonText: w,
281
- copyButtonText: O,
280
+ confirmButtonText: C,
281
+ copyButtonText: U,
282
282
  copiedButtonText: z,
283
- sandboxLoadingText: U,
283
+ sandboxLoadingText: K,
284
284
  sandboxStyleLoadingText: ne,
285
285
  sandboxScriptLoadingText: ue,
286
286
  disableSandboxLoadingOverlay: le = !1,
@@ -291,70 +291,70 @@ const Ft = 2, Te = ({
291
291
  beforeSend: me
292
292
  // tooltipMinLength,
293
293
  }) => {
294
- const F = be(s), M = h(
294
+ const F = be(s), L = f(
295
295
  () => ({
296
296
  loading: F.mermaidLoadingText,
297
297
  emptyChart: F.mermaidEmptyChartText,
298
298
  error: F.mermaidErrorText
299
299
  }),
300
300
  [F]
301
- ), L = i ?? Mt(s), H = a ?? Lt(s), Se = w || F.confirmButtonText, Re = O || F.copyButtonText, Be = z || F.copiedButtonText, Xe = re || F.sandboxFullscreenButtonText, Ze = oe || F.sandboxExitFullscreenButtonText, m = !!ee && (!o || o === "text"), B = h(
301
+ ), M = i ?? Lt(s), q = a ?? Mt(s), Se = C || F.confirmButtonText, Re = U || F.copyButtonText, Be = z || F.copiedButtonText, Xe = re || F.sandboxFullscreenButtonText, Ze = oe || F.sandboxExitFullscreenButtonText, m = !!ee && (!o || o === "text"), B = f(
302
302
  () => Rt(t),
303
303
  [t]
304
- ), A = h(
304
+ ), A = f(
305
305
  () => wt(B),
306
306
  [B]
307
- ), T = h(() => {
307
+ ), w = f(() => {
308
308
  const e = Ht(
309
309
  Bt(B, !0, !0, A)
310
310
  );
311
- return B !== t && e.length && (e[0].type === "sandbox" || j(e[0])) ? [{ type: "text", value: "" }, ...e] : e;
312
- }, [t, B, A]), K = T.some(
313
- (e) => e.type === "sandbox" || j(e)
314
- ), f = K ? T.filter(
315
- (e) => e.type !== "sandbox" && !j(e)
316
- ).map((e) => e.value).join("") : B, Ne = Math.max(0, g), Je = y === "fixed" ? f : void 0, [E, Me] = Fe(
317
- () => m ? "" : f
311
+ return B !== t && e.length && (e[0].type === "sandbox" || H(e[0])) ? [{ type: "text", value: "" }, ...e] : e;
312
+ }, [t, B, A]), Y = w.some(
313
+ (e) => e.type === "sandbox" || H(e)
314
+ ), h = Y ? w.filter(
315
+ (e) => e.type !== "sandbox" && !H(e)
316
+ ).map((e) => e.value).join("") : B, Ne = Math.max(0, g), Je = y === "fixed" ? h : void 0, [E, Le] = Fe(
317
+ () => m ? "" : h
318
318
  ), ae = b(E), V = b(""), I = b({
319
319
  tokens: [],
320
320
  head: 0,
321
321
  trailingGrapheme: ""
322
- }), q = b(0), Le = b(m), Ae = b(y), Ve = b(f), pe = b(t), fe = b(!1), [et, tt] = Fe(0);
322
+ }), Q = b(0), Me = b(m), Ae = b(y), Ve = b(h), pe = b(t), fe = b(!1), [et, tt] = Fe(0);
323
323
  te(() => {
324
- const e = Le.current, n = Ae.current, c = Ve.current, d = !!V.current, C = pe.current !== t, xe = C && t.startsWith(pe.current);
325
- pe.current = t, Le.current = m, Ae.current = y, Ve.current = f, (C || m !== e) && (fe.current = !1);
324
+ const e = Me.current, n = Ae.current, c = Ve.current, d = !!V.current, k = pe.current !== t, xe = k && t.startsWith(pe.current);
325
+ pe.current = t, Me.current = m, Ae.current = y, Ve.current = h, (k || m !== e) && (fe.current = !1);
326
326
  const X = () => {
327
327
  V.current = "", I.current = {
328
328
  tokens: [],
329
329
  head: 0,
330
330
  trailingGrapheme: ""
331
- }, q.current = 0;
331
+ }, Q.current = 0;
332
332
  }, J = (N) => {
333
- ae.current = N, Me(N);
333
+ ae.current = N, Le(N);
334
334
  };
335
335
  if (!m) {
336
- X(), J(f);
336
+ X(), J(h);
337
337
  return;
338
338
  }
339
339
  e || (X(), J(""));
340
340
  let $ = e ? ae.current : "";
341
- if (!f.startsWith($)) {
341
+ if (!h.startsWith($)) {
342
342
  if (X(), !xe) {
343
- J(f), y === "content-aware" && (I.current = {
343
+ J(h), y === "content-aware" && (I.current = {
344
344
  tokens: [],
345
345
  head: 0,
346
- trailingGrapheme: we(f)
346
+ trailingGrapheme: we(h)
347
347
  });
348
348
  return;
349
349
  }
350
350
  let N = 0;
351
- for (; N < $.length && N < f.length && $[N] === f[N]; )
351
+ for (; N < $.length && N < h.length && $[N] === h[N]; )
352
352
  N += 1;
353
353
  $ = $.slice(0, N), J($);
354
354
  }
355
- let Q = f.slice($.length);
356
- if (!Q) {
357
- V.current = "", q.current = 0, I.current = y === "content-aware" ? {
355
+ let O = h.slice($.length);
356
+ if (!O) {
357
+ V.current = "", Q.current = 0, I.current = y === "content-aware" ? {
358
358
  tokens: [],
359
359
  head: 0,
360
360
  trailingGrapheme: we($)
@@ -365,39 +365,39 @@ const Ft = 2, Te = ({
365
365
  const N = c.slice(
366
366
  $.length
367
367
  );
368
- if (e && n === "content-aware" && f.startsWith(c) && V.current === N) {
369
- const _ = _e(
368
+ if (e && n === "content-aware" && h.startsWith(c) && V.current === N) {
369
+ const j = _e(
370
370
  I.current,
371
- f.slice(c.length)
371
+ h.slice(c.length)
372
372
  );
373
- I.current = _.queue, _.immediateChunk && (Q = Q.slice(
374
- _.immediateChunk.length
375
- ), J(`${$}${_.immediateChunk}`));
373
+ I.current = j.queue, j.immediateChunk && (O = O.slice(
374
+ j.immediateChunk.length
375
+ ), J(`${$}${j.immediateChunk}`));
376
376
  } else {
377
- const _ = _e(
377
+ const j = _e(
378
378
  {
379
379
  tokens: [],
380
380
  head: 0,
381
381
  trailingGrapheme: we($)
382
382
  },
383
- Q
383
+ O
384
384
  );
385
- I.current = _.queue, _.immediateChunk && (Q = Q.slice(
386
- _.immediateChunk.length
387
- ), J(`${$}${_.immediateChunk}`)), q.current = 0;
385
+ I.current = j.queue, j.immediateChunk && (O = O.slice(
386
+ j.immediateChunk.length
387
+ ), J(`${$}${j.immediateChunk}`)), Q.current = 0;
388
388
  }
389
389
  } else
390
390
  I.current = {
391
391
  tokens: [],
392
392
  head: 0,
393
393
  trailingGrapheme: ""
394
- }, q.current = 0;
395
- V.current = Q, !d && Q && tt((N) => N + 1);
396
- }, [t, f, m, y]), te(() => {
397
- m && (fe.current || V.current || E !== f || (fe.current = !0, S?.()));
394
+ }, Q.current = 0;
395
+ V.current = O, !d && O && tt((N) => N + 1);
396
+ }, [t, h, m, y]), te(() => {
397
+ m && (fe.current || V.current || E !== h || (fe.current = !0, S?.()));
398
398
  }, [
399
399
  t,
400
- f,
400
+ h,
401
401
  E,
402
402
  m,
403
403
  S
@@ -411,9 +411,9 @@ const Ft = 2, Te = ({
411
411
  if (y === "content-aware") {
412
412
  const d = Tt(
413
413
  I.current,
414
- q.current + bt
414
+ Q.current + bt
415
415
  );
416
- n = d.chunk, I.current = d.queue, St(d.queue) ? q.current = 0 : q.current = d.remainingBudget;
416
+ n = d.chunk, I.current = d.queue, St(d.queue) ? Q.current = 0 : Q.current = d.remainingBudget;
417
417
  } else
418
418
  n = Qt(
419
419
  V.current,
@@ -425,9 +425,9 @@ const Ft = 2, Te = ({
425
425
  tokens: [],
426
426
  head: 0,
427
427
  trailingGrapheme: I.current.trailingGrapheme
428
- } : { tokens: [], head: 0, trailingGrapheme: "" }, q.current = 0);
428
+ } : { tokens: [], head: 0, trailingGrapheme: "" }, Q.current = 0);
429
429
  const c = `${ae.current}${n}`;
430
- ae.current = c, Me(c);
430
+ ae.current = c, Le(c);
431
431
  }, Ne);
432
432
  return () => window.clearTimeout(e);
433
433
  }, [
@@ -438,46 +438,57 @@ const Ft = 2, Te = ({
438
438
  Ne,
439
439
  et
440
440
  ]);
441
- const $e = h(
441
+ const G = f(() => {
442
+ let e = 0;
443
+ return w.map((n) => {
444
+ if (!m) return n;
445
+ if (n.type === "sandbox" || H(n))
446
+ return E.length >= e ? n : { ...n, value: "" };
447
+ const c = E.slice(
448
+ e,
449
+ e + n.value.length
450
+ );
451
+ return e += n.value.length, { ...n, value: c };
452
+ });
453
+ }, [w, E, m]), $e = f(
442
454
  () => ({
443
455
  isTypewriterEnabled: m,
444
- isTyping: m && E !== f,
445
- isComplete: E === f,
446
- renderedLength: t.length - Math.max(0, f.length - E.length),
456
+ isTyping: m && E !== h,
457
+ isComplete: E === h,
458
+ renderedLength: t.length - w.reduce(
459
+ (e, n, c) => e + n.value.length - G[c].value.length,
460
+ 0
461
+ ),
447
462
  totalLength: t.length
448
463
  }),
449
- [t, f, E, m]
464
+ [
465
+ t,
466
+ h,
467
+ E,
468
+ m,
469
+ w,
470
+ G
471
+ ]
450
472
  );
451
473
  te(() => {
452
474
  R?.($e);
453
475
  }, [R, $e]);
454
- const Y = h(() => {
476
+ const he = f(() => {
455
477
  let e = 0;
456
- return T.map((n) => {
457
- if (n.type === "sandbox" || j(n) || !m)
458
- return n;
459
- const c = E.slice(
460
- e,
461
- e + n.value.length
462
- );
463
- return e += n.value.length, { ...n, value: c };
464
- });
465
- }, [T, E, m]), he = h(() => {
466
- let e = 0;
467
- return T.map((n) => {
478
+ return w.map((n) => {
468
479
  const c = e;
469
480
  return e += n.value.length, c;
470
481
  });
471
- }, [T]), ce = h(
472
- () => m ? T.map(
473
- (e) => e.type === "sandbox" || j(e) ? [] : e.value === B ? A.inline : Ct(e.value)
482
+ }, [w]), ce = f(
483
+ () => m ? w.map(
484
+ (e) => e.type === "sandbox" || H(e) ? [] : e.value === B ? A.inline : Ct(e.value)
474
485
  ) : [],
475
- [m, T, B, A]
476
- ), nt = h(
477
- () => K ? Y.map(
478
- (e, n) => e.type === "sandbox" || j(e) ? e.value : m ? qe(
486
+ [m, w, B, A]
487
+ ), nt = f(
488
+ () => Y ? G.map(
489
+ (e, n) => e.type === "sandbox" || H(e) ? e.value : m ? qe(
479
490
  e.value,
480
- T[n].value,
491
+ w[n].value,
481
492
  ce[n] ?? [],
482
493
  A.metadata,
483
494
  he[n]
@@ -488,74 +499,74 @@ const Ft = 2, Te = ({
488
499
  )
489
500
  ) : [],
490
501
  [
491
- K,
492
- m,
493
502
  Y,
503
+ m,
504
+ G,
494
505
  ce,
495
- T,
506
+ w,
496
507
  A.metadata,
497
508
  he
498
509
  ]
499
- ), rt = h(() => {
510
+ ), rt = f(() => {
500
511
  const e = [];
501
- T.forEach((n, c) => {
512
+ w.forEach((n, c) => {
502
513
  const d = e.at(-1);
503
514
  n.type !== "sandbox" && d && !d.sandbox ? d.indices.push(c) : e.push({ indices: [c], sandbox: n.type === "sandbox" });
504
515
  });
505
516
  for (const n of e)
506
- if (!n.sandbox && n.indices.some((c) => j(T[c]))) {
507
- const c = n.indices.map((C) => T[C]), d = c.map((C) => C.value).join("");
517
+ if (!n.sandbox && n.indices.some((c) => H(w[c]))) {
518
+ const c = n.indices.map((k) => w[k]), d = c.map((k) => k.value).join("");
508
519
  n.plan = At(
509
520
  c,
510
521
  d === B ? A : void 0
511
522
  );
512
523
  }
513
524
  return e;
514
- }, [T, B, A]), G = K ? Y.map((e) => e.value).join("") : m ? E : B, ot = h(
515
- () => l ? ye(G) : "",
516
- [l, G]
517
- ), Ee = h(
518
- () => K ? "" : ye(
525
+ }, [w, B, A]), _ = Y ? G.map((e) => e.value).join("") : m ? E : B, ot = f(
526
+ () => l ? ye(_) : "",
527
+ [l, _]
528
+ ), Ee = f(
529
+ () => Y ? "" : ye(
519
530
  m ? qe(
520
- G,
531
+ _,
521
532
  B,
522
533
  ce[0] ?? [],
523
534
  A.metadata
524
535
  ) : ke(
525
- G,
536
+ _,
526
537
  A.metadata
527
538
  )
528
539
  ),
529
540
  [
530
541
  B,
531
- K,
542
+ Y,
532
543
  m,
533
- G,
544
+ _,
534
545
  ce,
535
546
  A.metadata
536
547
  ]
537
- ), ge = h(
548
+ ), ge = f(
538
549
  () => Nt(
539
- G,
540
- k,
550
+ _,
551
+ T,
541
552
  p
542
553
  ),
543
- [p, G, k]
544
- ), Ie = u?.trim() || ge.buttonText, Pe = P?.trim() || ge.inputText, st = h(
545
- () => k ? k.split(",").map((e) => e.trim()).filter(Boolean) : void 0,
546
- [k]
554
+ [p, _, T]
555
+ ), Ie = u?.trim() || ge.buttonText, Pe = P?.trim() || ge.inputText, st = f(
556
+ () => T ? T.split(",").map((e) => e.trim()).filter(Boolean) : void 0,
557
+ [T]
547
558
  ), at = D?.length ? D : ge.selectedValues || st, De = Ut(
548
559
  at
549
560
  ), v = b({
550
- direction: L,
551
- language: H,
552
- mermaidMessages: M,
561
+ direction: M,
562
+ language: q,
563
+ mermaidMessages: L,
553
564
  beforeSend: me,
554
565
  locale: s,
555
566
  onClickCustomButtonAfterContent: se,
556
567
  onSend: x,
557
568
  readonly: W,
558
- renderContent: G,
569
+ renderContent: _,
559
570
  resolvedConfirmButtonText: Se,
560
571
  resolvedCopiedButtonText: Be,
561
572
  resolvedCopyButtonText: Re,
@@ -564,15 +575,15 @@ const Ft = 2, Te = ({
564
575
  resolvedDefaultSelectedValues: De
565
576
  });
566
577
  v.current = {
567
- direction: L,
568
- language: H,
569
- mermaidMessages: M,
578
+ direction: M,
579
+ language: q,
580
+ mermaidMessages: L,
570
581
  beforeSend: me,
571
582
  locale: s,
572
583
  onClickCustomButtonAfterContent: se,
573
584
  onSend: x,
574
585
  readonly: W,
575
- renderContent: G,
586
+ renderContent: _,
576
587
  resolvedConfirmButtonText: Se,
577
588
  resolvedCopiedButtonText: Be,
578
589
  resolvedCopyButtonText: Re,
@@ -580,7 +591,7 @@ const Ft = 2, Te = ({
580
591
  resolvedDefaultInputText: Pe,
581
592
  resolvedDefaultSelectedValues: De
582
593
  };
583
- const ve = h(
594
+ const ve = f(
584
595
  () => ({
585
596
  "custom-button-after-content": ({
586
597
  children: e
@@ -639,14 +650,14 @@ const Ft = 2, Te = ({
639
650
  )
640
651
  }),
641
652
  []
642
- ), ct = h(
653
+ ), ct = f(
643
654
  () => Ge(Ee),
644
655
  [Ee]
645
656
  ), it = (e, n) => {
646
657
  const c = ye(e);
647
- return Ge(c).map((C, xe) => {
648
- const X = `${n}-${C.type}-${xe}`;
649
- return C.type === "text" ? /* @__PURE__ */ r(
658
+ return Ge(c).map((k, xe) => {
659
+ const X = `${n}-${k.type}-${xe}`;
660
+ return k.type === "text" ? /* @__PURE__ */ r(
650
661
  ie.Provider,
651
662
  {
652
663
  value: v,
@@ -655,36 +666,36 @@ const Ft = 2, Te = ({
655
666
  {
656
667
  locale: s,
657
668
  components: ve,
658
- content: C.value
669
+ content: k.value
659
670
  }
660
671
  )
661
672
  },
662
673
  X
663
- ) : C.type === "mermaid" ? /* @__PURE__ */ r(
674
+ ) : k.type === "mermaid" ? /* @__PURE__ */ r(
664
675
  Ce,
665
676
  {
666
- chart: C.value,
667
- frozen: !C.complete,
668
- messages: M
677
+ chart: k.value,
678
+ frozen: !k.complete,
679
+ messages: L
669
680
  },
670
681
  X
671
- ) : C.type === "svg" ? /* @__PURE__ */ r(Te, { svg: C.value }, X) : null;
682
+ ) : k.type === "svg" ? /* @__PURE__ */ r(Te, { svg: k.value }, X) : null;
672
683
  });
673
684
  }, We = l ? /* @__PURE__ */ r("div", { className: "content-render-custom-bar", children: Z.createElement(l, {
674
685
  content: t,
675
686
  displayContent: ot,
676
687
  onSend: x
677
688
  }) }) : null;
678
- return K ? /* @__PURE__ */ ze(
689
+ return Y ? /* @__PURE__ */ ze(
679
690
  "div",
680
691
  {
681
692
  className: "content-render markdown-body",
682
- dir: L,
683
- lang: H,
693
+ dir: M,
694
+ lang: q,
684
695
  children: [
685
696
  rt.map((e) => {
686
- const n = e.indices[0], c = Y[n];
687
- return e.sandbox ? /* @__PURE__ */ r(
697
+ const n = e.indices[0], c = G[n];
698
+ return e.sandbox ? c.value ? /* @__PURE__ */ r(
688
699
  kt,
689
700
  {
690
701
  hideFullScreen: !0,
@@ -692,9 +703,9 @@ const Ft = 2, Te = ({
692
703
  content: c.value,
693
704
  className: "content-render-iframe",
694
705
  locale: s,
695
- dir: L,
696
- lang: H,
697
- loadingText: U,
706
+ dir: M,
707
+ lang: q,
708
+ loadingText: K,
698
709
  styleLoadingText: ne,
699
710
  scriptLoadingText: ue,
700
711
  disableLoadingOverlay: le,
@@ -703,7 +714,7 @@ const Ft = 2, Te = ({
703
714
  mode: de
704
715
  },
705
716
  `sandbox-${n}`
706
- ) : e.plan ? /* @__PURE__ */ r(
717
+ ) : null : e.plan ? /* @__PURE__ */ r(
707
718
  ie.Provider,
708
719
  {
709
720
  value: v,
@@ -714,13 +725,13 @@ const Ft = 2, Te = ({
714
725
  components: ve,
715
726
  plan: e.plan,
716
727
  renderedSegments: e.indices.map(
717
- (d) => Y[d]
728
+ (d) => G[d]
718
729
  )
719
730
  }
720
731
  )
721
732
  },
722
733
  `md-${n}`
723
- ) : e.indices.map((d) => /* @__PURE__ */ r(Z.Fragment, { children: Y[d].type === "markdown" && Y[d].pending ? null : it(
734
+ ) : e.indices.map((d) => /* @__PURE__ */ r(Z.Fragment, { children: G[d].type === "markdown" && G[d].pending ? null : it(
724
735
  nt[d],
725
736
  `md-${d}`
726
737
  ) }, `md-${d}`));
@@ -732,8 +743,8 @@ const Ft = 2, Te = ({
732
743
  "div",
733
744
  {
734
745
  className: "content-render markdown-body",
735
- dir: L,
736
- lang: H,
746
+ dir: M,
747
+ lang: q,
737
748
  children: [
738
749
  ct.map((e, n) => {
739
750
  if (e.type === "text")
@@ -758,7 +769,7 @@ const Ft = 2, Te = ({
758
769
  {
759
770
  chart: e.value,
760
771
  frozen: !e.complete,
761
- messages: M
772
+ messages: L
762
773
  },
763
774
  n
764
775
  );
@@ -772,6 +783,6 @@ const Ft = 2, Te = ({
772
783
  };
773
784
  export {
774
785
  He as MarkdownRenderer,
775
- Mn as default
786
+ Ln as default
776
787
  };
777
788
  //# sourceMappingURL=ContentRender.es.js.map