markdown-flow-ui 0.3.8 → 0.3.9

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 (42) hide show
  1. package/dist/_virtual/index6.cjs +1 -1
  2. package/dist/_virtual/index6.es.js +3 -5
  3. package/dist/_virtual/index6.es.js.map +1 -1
  4. package/dist/_virtual/index7.cjs +1 -1
  5. package/dist/_virtual/index7.es.js +5 -3
  6. package/dist/_virtual/index7.es.js.map +1 -1
  7. package/dist/components/ContentRender/ContentRender.cjs +2 -2
  8. package/dist/components/ContentRender/ContentRender.cjs.map +1 -1
  9. package/dist/components/ContentRender/ContentRender.d.ts +0 -2
  10. package/dist/components/ContentRender/ContentRender.es.js +361 -365
  11. package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
  12. package/dist/components/ContentRender/IframeSandbox.cjs +4 -4
  13. package/dist/components/ContentRender/IframeSandbox.cjs.map +1 -1
  14. package/dist/components/ContentRender/IframeSandbox.d.ts +0 -2
  15. package/dist/components/ContentRender/IframeSandbox.es.js +299 -296
  16. package/dist/components/ContentRender/IframeSandbox.es.js.map +1 -1
  17. package/dist/components/ContentRender/SandboxApp.cjs +2 -2
  18. package/dist/components/ContentRender/SandboxApp.cjs.map +1 -1
  19. package/dist/components/ContentRender/SandboxApp.d.ts +4 -3
  20. package/dist/components/ContentRender/SandboxApp.es.js +110 -141
  21. package/dist/components/ContentRender/SandboxApp.es.js.map +1 -1
  22. package/dist/components/ContentRender/contentRenderI18n.cjs.map +1 -1
  23. package/dist/components/ContentRender/contentRenderI18n.d.ts +0 -2
  24. package/dist/components/ContentRender/contentRenderI18n.es.js.map +1 -1
  25. package/dist/components/ContentRender/locales/contentRender.json.cjs +1 -1
  26. package/dist/components/ContentRender/locales/contentRender.json.d.ts +0 -22
  27. package/dist/components/ContentRender/locales/contentRender.json.es.js +11 -11
  28. package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.cjs +1 -1
  29. package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.es.js +1 -1
  30. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-6MUBBAK2.cjs +1 -1
  31. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-6MUBBAK2.es.js +1 -1
  32. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-HFQBQIA3.cjs +1 -1
  33. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-HFQBQIA3.es.js +1 -1
  34. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-MALGAFMO.cjs +1 -1
  35. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-MALGAFMO.es.js +1 -1
  36. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-23REXITY.cjs +1 -1
  37. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-23REXITY.es.js +1 -1
  38. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-5NDRBG5M.cjs +1 -1
  39. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-5NDRBG5M.es.js +1 -1
  40. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/swimlanesDiagram-OMPLPG4O.cjs +1 -1
  41. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/swimlanesDiagram-OMPLPG4O.es.js +1 -1
  42. package/package.json +1 -1
@@ -1,79 +1,79 @@
1
- import { jsx as s, jsxs as Fe, Fragment as dt } from "react/jsx-runtime";
2
- import { d as Ge } from "../../_virtual/index.es.js";
3
- import X, { useMemo as h, useState as _e, useRef as b, useEffect as te } from "react";
4
- import { sanitizeInvalidTagName as mt } from "./utils/sanitize-invalid-tag-name.es.js";
5
- import { stripSvgTextLineBreaks as pt } from "./utils/strip-svg-text-line-breaks.es.js";
1
+ import { jsx as s, jsxs as We, Fragment as ut } from "react/jsx-runtime";
2
+ import { d as ze } from "../../_virtual/index.es.js";
3
+ import X, { useMemo as h, useState as Fe, useRef as T, useEffect as ne } from "react";
4
+ import { sanitizeInvalidTagName as lt } from "./utils/sanitize-invalid-tag-name.es.js";
5
+ import { stripSvgTextLineBreaks as dt } 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 ft, { CodeBlockContext as ht } from "./CodeBlock.es.js";
11
- import gt from "./plugins/CustomVariable.es.js";
12
- import ke from "./plugins/MermaidChart.es.js";
13
- import { preserveCustomVariableProperties as vt, restoreCustomVariableProperties as xt } from "./utils/custom-variable-props.es.js";
14
- import { subsetLanguages as yt, highlightLanguages as wt } from "./utils/highlight-languages.es.js";
15
- import { parseMarkdownSegments as je, mermaidBlockIsComplete as Ct } from "./utils/mermaid-parse.es.js";
16
- import { getMarkdownSourceAnalysis as kt, getInlineCodeRanges as Tt } from "./utils/inline-code-ranges.es.js";
17
- import { remarkPlugins as Ue } from "./utils/markdown-plugins.es.js";
18
- import { normalizeInlineHtml as we } from "./utils/normalize-inline-html.es.js";
19
- import { escapeTypedMarkdownMetadata as Te } from "./utils/escape-typed-metadata.es.js";
20
- import bt from "./IframeSandbox.es.js";
21
- import { getTrailingTypewriterGrapheme as Ce, appendContentAwareTypewriterQueue as He, consumeContentAwareTypewriterQueue as St, CONTENT_AWARE_TYPEWRITER_TICK_BUDGET as Rt, isContentAwareTypewriterQueueEmpty as Bt } from "./utils/typewriter-pacing.es.js";
22
- import { normalizeWrappedSandboxContent as Nt, splitContentSegments as Lt } from "./utils/split-content.es.js";
23
- import { getInteractionDefaultValues as Mt } from "../../lib/interaction-defaults.es.js";
24
- import { getMarkdownFlowDirection as At, getMarkdownFlowLanguage as Vt } from "../../lib/locale.es.js";
25
- import { getContentRenderLocaleTexts as Se } from "./contentRenderI18n.es.js";
26
- import { createVideoMarkdownRunPlan as $t, cloneVideoMarkdownSourceTree as Et, prepareVideoMarkdownRun as Pt, projectVideoMarkdownRun as It, getVideoMarkdownNodeState as Dt } from "./utils/video-markdown-run.es.js";
27
- import { unified as qe } from "../../node_modules/unified/lib/index.es.js";
28
- import Wt from "../../node_modules/remark-rehype/lib/index.es.js";
29
- import zt from "../../node_modules/rehype-raw/lib/index.es.js";
30
- import Ft from "../../node_modules/rehype-highlight/lib/index.es.js";
31
- import Gt from "../../node_modules/rehype-katex/lib/index.es.js";
32
- import { Markdown as Ke } from "../../node_modules/react-markdown/lib/index.es.js";
33
- const _t = 2, be = ({
10
+ import mt, { CodeBlockContext as pt } from "./CodeBlock.es.js";
11
+ import ft from "./plugins/CustomVariable.es.js";
12
+ import Ce from "./plugins/MermaidChart.es.js";
13
+ import { preserveCustomVariableProperties as ht, restoreCustomVariableProperties as gt } from "./utils/custom-variable-props.es.js";
14
+ import { subsetLanguages as vt, highlightLanguages as yt } from "./utils/highlight-languages.es.js";
15
+ import { parseMarkdownSegments as Ge, mermaidBlockIsComplete as xt } from "./utils/mermaid-parse.es.js";
16
+ import { getMarkdownSourceAnalysis as wt, getInlineCodeRanges as Ct } from "./utils/inline-code-ranges.es.js";
17
+ import { remarkPlugins as Qe } from "./utils/markdown-plugins.es.js";
18
+ import { normalizeInlineHtml as xe } from "./utils/normalize-inline-html.es.js";
19
+ import { escapeTypedMarkdownMetadata as ke } from "./utils/escape-typed-metadata.es.js";
20
+ import kt from "./IframeSandbox.es.js";
21
+ 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";
22
+ import { normalizeWrappedSandboxContent as Rt, splitContentSegments as Bt } from "./utils/split-content.es.js";
23
+ import { getInteractionDefaultValues as Nt } from "../../lib/interaction-defaults.es.js";
24
+ import { getMarkdownFlowDirection as Mt, getMarkdownFlowLanguage as Lt } from "../../lib/locale.es.js";
25
+ import { getContentRenderLocaleTexts as be } from "./contentRenderI18n.es.js";
26
+ import { createVideoMarkdownRunPlan as At, cloneVideoMarkdownSourceTree as Vt, prepareVideoMarkdownRun as $t, projectVideoMarkdownRun as Et, getVideoMarkdownNodeState as Pt } from "./utils/video-markdown-run.es.js";
27
+ import { unified as je } from "../../node_modules/unified/lib/index.es.js";
28
+ import It from "../../node_modules/remark-rehype/lib/index.es.js";
29
+ import Dt from "../../node_modules/rehype-raw/lib/index.es.js";
30
+ import Wt from "../../node_modules/rehype-highlight/lib/index.es.js";
31
+ import zt from "../../node_modules/rehype-katex/lib/index.es.js";
32
+ import { Markdown as Oe } from "../../node_modules/react-markdown/lib/index.es.js";
33
+ const Ft = 2, Te = ({
34
34
  svg: t,
35
35
  inline: r = !1
36
36
  }) => {
37
- const c = b(null), o = r ? "span" : "div";
38
- return te(() => {
37
+ const c = T(null), o = r ? "span" : "div";
38
+ return ne(() => {
39
39
  const u = c.current;
40
40
  if (!u) return;
41
- const m = u.shadowRoot ?? u.attachShadow({ mode: "open" }), y = "content-render-svg-style";
42
- let g = m.getElementById(y);
43
- g || (g = document.createElement("style"), g.id = y, g.textContent = `
41
+ const m = u.shadowRoot ?? u.attachShadow({ mode: "open" }), x = "content-render-svg-style";
42
+ let g = m.getElementById(x);
43
+ g || (g = document.createElement("style"), g.id = x, g.textContent = `
44
44
  svg { height: auto; display: inline-block; }
45
45
  svg.content-render-svg-el--responsive { width: 100%; max-width: 100%; }
46
46
  svg.content-render-svg-el--fixed { max-width: none; }
47
47
  `, m.appendChild(g)), Array.from(m.childNodes).filter(
48
48
  (i) => i !== g
49
49
  ).forEach((i) => m.removeChild(i));
50
- const Q = document.createElement("template"), f = pt(t);
50
+ const Q = document.createElement("template"), f = dt(t);
51
51
  Q.innerHTML = f, m.append(Q.content.cloneNode(!0));
52
- let S = !1, A = !1;
52
+ let b = !1, V = !1;
53
53
  m.querySelectorAll("svg").forEach((i) => {
54
- const V = i.getAttribute("viewBox");
55
- if (!V) return;
56
- const W = V.trim().split(/[\s,]+/).map((w) => Number(w));
57
- if (W.length !== 4 || W.some(Number.isNaN)) return;
58
- const [, , I, C] = W, O = i.getAttribute("width"), D = i.getAttribute("height"), U = (w) => {
59
- if (!w) return !1;
60
- const $ = w.trim().toLowerCase();
61
- return $ === "auto" || $.endsWith("%");
62
- }, ne = (w) => {
63
- if (!w) return null;
64
- const $ = w.trim().toLowerCase();
65
- if ($ === "auto" || $.endsWith("%"))
54
+ const $ = i.getAttribute("viewBox");
55
+ if (!$) return;
56
+ const z = $.trim().split(/[\s,]+/).map((S) => Number(S));
57
+ if (z.length !== 4 || z.some(Number.isNaN)) return;
58
+ const [, , I, w] = z, O = i.getAttribute("width"), D = i.getAttribute("height"), U = (S) => {
59
+ if (!S) return !1;
60
+ const N = S.trim().toLowerCase();
61
+ return N === "auto" || N.endsWith("%");
62
+ }, re = (S) => {
63
+ if (!S) return null;
64
+ const N = S.trim().toLowerCase();
65
+ if (N === "auto" || N.endsWith("%"))
66
66
  return null;
67
- const j = Number.parseFloat($);
68
- return Number.isNaN(j) ? null : j;
69
- }, ie = U(O), ue = U(D), re = !O || O === "0", oe = !D || D === "0", le = ne(O), de = ne(D);
70
- if (ie || ue || re && oe || le === I && de === C) {
71
- S = !0, i.classList.add("content-render-svg-el--responsive"), i.classList.remove("content-render-svg-el--fixed"), i.style.width = "100%", i.style.height = "auto", !i.style.aspectRatio && C > 0 && (i.style.aspectRatio = `${I} / ${C}`);
67
+ const te = Number.parseFloat(N);
68
+ return Number.isNaN(te) ? null : te;
69
+ }, de = U(O), me = U(D), oe = !O || O === "0", se = !D || D === "0", ae = re(O), ce = re(D);
70
+ if (de || me || oe && se || ae === I && ce === w) {
71
+ b = !0, i.classList.add("content-render-svg-el--responsive"), i.classList.remove("content-render-svg-el--fixed"), i.style.width = "100%", i.style.height = "auto", !i.style.aspectRatio && w > 0 && (i.style.aspectRatio = `${I} / ${w}`);
72
72
  return;
73
73
  }
74
- A = !0, i.classList.add("content-render-svg-el--fixed"), i.classList.remove("content-render-svg-el--responsive"), re && I > 0 && i.setAttribute("width", `${I}`), oe && C > 0 && i.setAttribute("height", `${C}`);
74
+ V = !0, i.classList.add("content-render-svg-el--fixed"), i.classList.remove("content-render-svg-el--responsive"), oe && I > 0 && i.setAttribute("width", `${I}`), se && w > 0 && i.setAttribute("height", `${w}`);
75
75
  });
76
- const l = S && !A;
76
+ const l = b && !V;
77
77
  u.classList.toggle("content-render-svg--responsive", l), u.classList.toggle("content-render-svg--fixed", !l);
78
78
  }, [t]), /* @__PURE__ */ s(o, { className: "content-render-svg-scroll", children: /* @__PURE__ */ s(
79
79
  o,
@@ -84,23 +84,23 @@ const _t = 2, be = ({
84
84
  }
85
85
  }
86
86
  ) });
87
- }, ce = X.createContext(
87
+ }, le = X.createContext(
88
88
  null
89
- ), Ye = (t) => {
90
- const { receivedTree: r, ...c } = t, o = X.useContext(ce), u = X.useContext(ht);
89
+ ), Ue = (t) => {
90
+ const { receivedTree: r, ...c } = t, o = X.useContext(le), u = X.useContext(pt);
91
91
  if (!o)
92
92
  throw new Error("Markdown code renderer requires ContentRender context.");
93
- const { className: m, children: y, ...g } = c;
93
+ const { className: m, children: x, ...g } = c;
94
94
  if (/language-(\w+)/.exec(m || "")?.[1] === "mermaid") {
95
- const f = y?.toString().replace(/\n$/, "") || "", S = Ct(
95
+ const f = x?.toString().replace(/\n$/, "") || "", b = xt(
96
96
  o.current.renderContent,
97
97
  f
98
98
  );
99
99
  return /* @__PURE__ */ s(
100
- ke,
100
+ Ce,
101
101
  {
102
102
  chart: f,
103
- frozen: r ? !S : S,
103
+ frozen: r ? !b : b,
104
104
  messages: o.current.mermaidMessages
105
105
  }
106
106
  );
@@ -111,123 +111,123 @@ const _t = 2, be = ({
111
111
  className: m,
112
112
  ...g,
113
113
  dir: g.dir ?? (u ? void 0 : "ltr"),
114
- children: y
114
+ children: x
115
115
  }
116
116
  );
117
- }, Xe = [
118
- vt,
119
- zt,
120
- mt,
121
- xt
122
- ], Ze = [
123
- [Ft, { languages: wt, subset: yt }],
124
- Gt
125
- ], jt = [
126
- ...Xe,
127
- ...Ze
128
- ], Qe = ({ content: t, components: r, locale: c }) => {
129
- const o = Se(c);
117
+ }, Ke = [
118
+ ht,
119
+ Dt,
120
+ lt,
121
+ gt
122
+ ], Ye = [
123
+ [Wt, { languages: yt, subset: vt }],
124
+ zt
125
+ ], Gt = [
126
+ ...Ke,
127
+ ...Ye
128
+ ], He = ({ content: t, components: r, locale: c }) => {
129
+ const o = be(c);
130
130
  return /* @__PURE__ */ s("div", { className: "markdown-renderer", children: /* @__PURE__ */ s(
131
- Ke,
131
+ Oe,
132
132
  {
133
- remarkPlugins: Ue,
134
- rehypePlugins: jt,
133
+ remarkPlugins: Qe,
134
+ rehypePlugins: Gt,
135
135
  remarkRehypeOptions: {
136
136
  footnoteLabel: o.footnoteLabel,
137
137
  footnoteBackLabel: (u, m) => {
138
- const y = String(u + 1) + (m > 1 ? `-${m}` : "");
139
- return o.footnoteBackLabel.replace("{reference}", y);
138
+ const x = String(u + 1) + (m > 1 ? `-${m}` : "");
139
+ return o.footnoteBackLabel.replace("{reference}", x);
140
140
  }
141
141
  },
142
142
  components: r,
143
143
  children: t
144
144
  }
145
145
  ) });
146
- }, Ht = function() {
146
+ }, _t = function() {
147
147
  this.parser = () => ({ type: "root", children: [] });
148
- }, qt = ({ plan: t, renderedSegments: r, components: c, locale: o }) => {
148
+ }, jt = ({ plan: t, renderedSegments: r, components: c, locale: o }) => {
149
149
  const u = h(() => {
150
- const f = Se(o), S = qe().use(Ue).use(Wt, {
150
+ const f = be(o), b = je().use(Qe).use(It, {
151
151
  allowDangerousHtml: !0,
152
152
  footnoteLabel: f.footnoteLabel,
153
- footnoteBackLabel: (i, V) => f.footnoteBackLabel.replace(
153
+ footnoteBackLabel: (i, $) => f.footnoteBackLabel.replace(
154
154
  "{reference}",
155
- String(i + 1) + (V > 1 ? `-${V}` : "")
155
+ String(i + 1) + ($ > 1 ? `-${$}` : "")
156
156
  )
157
- }).use(Xe), A = qe().use(Ze), l = S.runSync(
158
- Et(t),
157
+ }).use(Ke), V = je().use(Ye), l = b.runSync(
158
+ Vt(t),
159
159
  t.markdownSource
160
160
  );
161
- return Pt(
161
+ return $t(
162
162
  t,
163
163
  l,
164
- (i) => A.runSync(i, t.fullSource)
164
+ (i) => V.runSync(i, t.fullSource)
165
165
  );
166
166
  }, [t, o]), m = h(
167
- () => It(u, r),
167
+ () => Et(u, r),
168
168
  [u, r]
169
- ), y = b(c);
170
- y.current = c;
171
- const g = b(
169
+ ), x = T(c);
170
+ x.current = c;
171
+ const g = T(
172
172
  /* @__PURE__ */ new Map()
173
173
  ), J = h(() => {
174
- const f = /* @__PURE__ */ new Set(), S = (l) => {
175
- l.type === "element" && f.add(l.tagName), "children" in l && l.children.forEach(S);
174
+ const f = /* @__PURE__ */ new Set(), b = (l) => {
175
+ l.type === "element" && f.add(l.tagName), "children" in l && l.children.forEach(b);
176
176
  };
177
- S(u.tree);
178
- const A = {};
177
+ b(u.tree);
178
+ const V = {};
179
179
  for (const l of f) {
180
180
  if (!g.current.has(l)) {
181
181
  const i = ({
182
- node: V,
183
- children: W,
182
+ node: $,
183
+ children: z,
184
184
  ...I
185
185
  }) => {
186
- const C = Dt(V);
187
- if (C?.svg)
188
- return C.svgSource ? /* @__PURE__ */ s(be, { svg: C.svgSource, inline: !0 }) : null;
189
- if (C?.atomic)
190
- return C.active ? /* @__PURE__ */ s(dt, { children: W }) : null;
191
- if (C?.active === !1 && l !== "a") return null;
192
- const D = y.current[l], U = C?.active === !1 ? { ...I, href: void 0, tabIndex: -1 } : I;
186
+ const w = Pt($);
187
+ if (w?.svg)
188
+ return w.svgSource ? /* @__PURE__ */ s(Te, { svg: w.svgSource, inline: !0 }) : null;
189
+ if (w?.atomic)
190
+ return w.active ? /* @__PURE__ */ s(ut, { children: z }) : null;
191
+ if (w?.active === !1 && l !== "a") return null;
192
+ const D = x.current[l], U = w?.active === !1 ? { ...I, href: void 0, tabIndex: -1 } : I;
193
193
  return D ? X.createElement(
194
194
  D,
195
195
  {
196
196
  ...U,
197
- node: V,
198
- ...D === Ye ? { receivedTree: !0 } : {}
197
+ node: $,
198
+ ...D === Ue ? { receivedTree: !0 } : {}
199
199
  },
200
- W
201
- ) : X.createElement(l, U, W);
200
+ z
201
+ ) : X.createElement(l, U, z);
202
202
  };
203
203
  i.displayName = `StableMarkdown(${l})`, g.current.set(l, i);
204
204
  }
205
- A[l] = g.current.get(l);
205
+ V[l] = g.current.get(l);
206
206
  }
207
- return A;
207
+ return V;
208
208
  }, [u]), Q = h(
209
209
  () => [() => () => m],
210
210
  [m]
211
211
  );
212
212
  return /* @__PURE__ */ s("div", { className: "markdown-renderer", children: /* @__PURE__ */ s(
213
- Ke,
213
+ Oe,
214
214
  {
215
- remarkPlugins: [Ht],
215
+ remarkPlugins: [_t],
216
216
  rehypePlugins: Q,
217
217
  components: J,
218
218
  children: ""
219
219
  }
220
220
  ) });
221
- }, _ = (t) => t.type === "markdown" && t.immediate === !0, Qt = (t) => {
221
+ }, j = (t) => t.type === "markdown" && t.immediate === !0, Ht = (t) => {
222
222
  if (t.length <= 1) return t;
223
223
  const r = [];
224
224
  return t.forEach((c) => {
225
- if (c.type === "sandbox" || _(c)) {
225
+ if (c.type === "sandbox" || j(c)) {
226
226
  r.push(c);
227
227
  return;
228
228
  }
229
229
  const o = r[r.length - 1];
230
- if (o && o.type !== "sandbox" && !_(o)) {
230
+ if (o && o.type !== "sandbox" && !j(o)) {
231
231
  r[r.length - 1] = {
232
232
  type: "markdown",
233
233
  value: `${o.value}${c.value}`
@@ -236,10 +236,10 @@ const _t = 2, be = ({
236
236
  }
237
237
  r.push({ type: "markdown", value: c.value });
238
238
  }), r;
239
- }, Ot = (t, r, c) => {
239
+ }, qt = (t, r, c) => {
240
240
  if (t.length >= r.length) return t;
241
241
  const o = c.find(
242
- ({ start: y, end: g }) => y < t.length && t.length < g
242
+ ({ start: x, end: g }) => x < t.length && t.length < g
243
243
  );
244
244
  if (!o) return t;
245
245
  const u = /^`+/.exec(r.slice(o.start))?.[0];
@@ -247,83 +247,81 @@ const _t = 2, be = ({
247
247
  return t;
248
248
  const m = o.end - u.length;
249
249
  return t.length > m ? t + u.slice(t.length - m) : t + (t.endsWith("`") ? " " : "") + u;
250
- }, Oe = (t, r, c, o, u = 0) => {
251
- const m = Ot(t, r, c);
252
- return Te(t, o, u) + m.slice(t.length);
253
- }, Ut = (t, r) => {
250
+ }, qe = (t, r, c, o, u = 0) => {
251
+ const m = qt(t, r, c);
252
+ return ke(t, o, u) + m.slice(t.length);
253
+ }, Qt = (t, r) => {
254
254
  const c = Math.max(1, r), o = Array.from(t);
255
255
  return {
256
256
  chunk: o.slice(0, c).join(""),
257
257
  rest: o.slice(c).join("")
258
258
  };
259
- }, Kt = (t, r) => t === r ? !0 : !t || !r || t.length !== r.length ? !1 : t.every((c, o) => c === r[o]), Yt = (t) => {
260
- const r = b(t);
261
- return Kt(r.current, t) || (r.current = t), r.current;
262
- }, Vn = ({
259
+ }, Ot = (t, r) => t === r ? !0 : !t || !r || t.length !== r.length ? !1 : t.every((c, o) => c === r[o]), Ut = (t) => {
260
+ const r = T(t);
261
+ return Ot(r.current, t) || (r.current = t), r.current;
262
+ }, Ln = ({
263
263
  onPlaceholderAccepted: t,
264
264
  content: r,
265
265
  contentType: c,
266
266
  locale: o,
267
267
  lang: u,
268
268
  dir: m,
269
- customRenderBar: y,
269
+ customRenderBar: x,
270
270
  onSend: g,
271
271
  typingSpeed: J = 30,
272
272
  enableTypewriter: Q = !1,
273
273
  typewriterPacing: f = "fixed",
274
- onTypeFinished: S,
275
- onTypewriterStateChange: A,
274
+ onTypeFinished: b,
275
+ onTypewriterStateChange: V,
276
276
  userInput: l,
277
277
  interactionDefaultValueOptions: i,
278
- defaultButtonText: V,
279
- defaultInputText: W,
278
+ defaultButtonText: $,
279
+ defaultInputText: z,
280
280
  defaultSelectedValues: I,
281
- readonly: C = !1,
281
+ readonly: w = !1,
282
282
  confirmButtonText: O,
283
283
  copyButtonText: D,
284
284
  copiedButtonText: U,
285
- sandboxLoadingText: ne,
286
- sandboxStyleLoadingText: ie,
287
- sandboxScriptLoadingText: ue,
288
- disableSandboxLoadingOverlay: re = !1,
289
- sandboxFullscreenButtonText: oe,
290
- sandboxExitFullscreenButtonText: le,
291
- sandboxMode: de = "content",
292
- onClickCustomButtonAfterContent: me,
293
- beforeSend: pe
285
+ sandboxLoadingText: re,
286
+ disableSandboxLoadingOverlay: de = !1,
287
+ sandboxFullscreenButtonText: me,
288
+ sandboxExitFullscreenButtonText: oe,
289
+ sandboxMode: se = "content",
290
+ onClickCustomButtonAfterContent: ae,
291
+ beforeSend: ce
294
292
  }) => {
295
- const w = Se(o), $ = h(
293
+ const W = be(o), ee = h(
296
294
  () => ({
297
- loading: w.mermaidLoadingText,
298
- emptyChart: w.mermaidEmptyChartText,
299
- error: w.mermaidErrorText
295
+ loading: W.mermaidLoadingText,
296
+ emptyChart: W.mermaidEmptyChartText,
297
+ error: W.mermaidErrorText
300
298
  }),
301
- [w]
302
- ), j = m ?? At(o), ee = u ?? Vt(o), Re = O || w.confirmButtonText, Be = D || w.copyButtonText, Ne = U || w.copiedButtonText, Je = oe || w.sandboxFullscreenButtonText, et = le || w.sandboxExitFullscreenButtonText, p = !!Q && (!c || c === "text"), R = h(
303
- () => Nt(r),
299
+ [W]
300
+ ), S = m ?? Mt(o), N = u ?? Lt(o), te = O || W.confirmButtonText, Se = D || W.copyButtonText, Re = U || W.copiedButtonText, Xe = me || W.sandboxFullscreenButtonText, Ze = oe || W.sandboxExitFullscreenButtonText, p = !!Q && (!c || c === "text"), R = h(
301
+ () => Rt(r),
304
302
  [r]
305
- ), N = h(
306
- () => kt(R),
303
+ ), M = h(
304
+ () => wt(R),
307
305
  [R]
308
- ), k = h(() => {
309
- const e = Qt(
310
- Lt(R, !0, !0, N)
306
+ ), C = h(() => {
307
+ const e = Ht(
308
+ Bt(R, !0, !0, M)
311
309
  );
312
- return R !== r && e.length && (e[0].type === "sandbox" || _(e[0])) ? [{ type: "text", value: "" }, ...e] : e;
313
- }, [r, R, N]), K = k.some(
314
- (e) => e.type === "sandbox" || _(e)
315
- ), v = K ? k.filter(
316
- (e) => e.type !== "sandbox" && !_(e)
317
- ).map((e) => e.value).join("") : R, Le = Math.max(0, J), tt = f === "fixed" ? v : void 0, [E, Me] = _e(
310
+ return R !== r && e.length && (e[0].type === "sandbox" || j(e[0])) ? [{ type: "text", value: "" }, ...e] : e;
311
+ }, [r, R, M]), K = C.some(
312
+ (e) => e.type === "sandbox" || j(e)
313
+ ), v = K ? C.filter(
314
+ (e) => e.type !== "sandbox" && !j(e)
315
+ ).map((e) => e.value).join("") : R, Be = Math.max(0, J), Je = f === "fixed" ? v : void 0, [E, Ne] = Fe(
318
316
  () => p ? "" : v
319
- ), se = b(E), L = b(""), P = b({
317
+ ), ie = T(E), L = T(""), P = T({
320
318
  tokens: [],
321
319
  head: 0,
322
320
  trailingGrapheme: ""
323
- }), H = b(0), Ae = b(p), Ve = b(f), $e = b(v), fe = b(r), he = b(!1), [nt, rt] = _e(0);
324
- te(() => {
325
- const e = Ae.current, n = Ve.current, a = $e.current, d = !!L.current, T = fe.current !== r, ye = T && r.startsWith(fe.current);
326
- fe.current = r, Ae.current = p, Ve.current = f, $e.current = v, (T || p !== e) && (he.current = !1);
321
+ }), H = T(0), Me = T(p), Le = T(f), Ae = T(v), pe = T(r), fe = T(!1), [et, tt] = Fe(0);
322
+ ne(() => {
323
+ const e = Me.current, n = Le.current, a = Ae.current, d = !!L.current, k = pe.current !== r, ye = k && r.startsWith(pe.current);
324
+ pe.current = r, Me.current = p, Le.current = f, Ae.current = v, (k || p !== e) && (fe.current = !1);
327
325
  const Y = () => {
328
326
  L.current = "", P.current = {
329
327
  tokens: [],
@@ -331,61 +329,61 @@ const _t = 2, be = ({
331
329
  trailingGrapheme: ""
332
330
  }, H.current = 0;
333
331
  }, Z = (B) => {
334
- se.current = B, Me(B);
332
+ ie.current = B, Ne(B);
335
333
  };
336
334
  if (!p) {
337
335
  Y(), Z(v);
338
336
  return;
339
337
  }
340
338
  e || (Y(), Z(""));
341
- let M = e ? se.current : "";
342
- if (!v.startsWith(M)) {
339
+ let A = e ? ie.current : "";
340
+ if (!v.startsWith(A)) {
343
341
  if (Y(), !ye) {
344
342
  Z(v), f === "content-aware" && (P.current = {
345
343
  tokens: [],
346
344
  head: 0,
347
- trailingGrapheme: Ce(v)
345
+ trailingGrapheme: we(v)
348
346
  });
349
347
  return;
350
348
  }
351
349
  let B = 0;
352
- for (; B < M.length && B < v.length && M[B] === v[B]; )
350
+ for (; B < A.length && B < v.length && A[B] === v[B]; )
353
351
  B += 1;
354
- M = M.slice(0, B), Z(M);
352
+ A = A.slice(0, B), Z(A);
355
353
  }
356
- let q = v.slice(M.length);
354
+ let q = v.slice(A.length);
357
355
  if (!q) {
358
356
  L.current = "", H.current = 0, P.current = f === "content-aware" ? {
359
357
  tokens: [],
360
358
  head: 0,
361
- trailingGrapheme: Ce(M)
359
+ trailingGrapheme: we(A)
362
360
  } : { tokens: [], head: 0, trailingGrapheme: "" };
363
361
  return;
364
362
  }
365
363
  if (f === "content-aware") {
366
364
  const B = a.slice(
367
- M.length
365
+ A.length
368
366
  );
369
367
  if (e && n === "content-aware" && v.startsWith(a) && L.current === B) {
370
- const G = He(
368
+ const _ = _e(
371
369
  P.current,
372
370
  v.slice(a.length)
373
371
  );
374
- P.current = G.queue, G.immediateChunk && (q = q.slice(
375
- G.immediateChunk.length
376
- ), Z(`${M}${G.immediateChunk}`));
372
+ P.current = _.queue, _.immediateChunk && (q = q.slice(
373
+ _.immediateChunk.length
374
+ ), Z(`${A}${_.immediateChunk}`));
377
375
  } else {
378
- const G = He(
376
+ const _ = _e(
379
377
  {
380
378
  tokens: [],
381
379
  head: 0,
382
- trailingGrapheme: Ce(M)
380
+ trailingGrapheme: we(A)
383
381
  },
384
382
  q
385
383
  );
386
- P.current = G.queue, G.immediateChunk && (q = q.slice(
387
- G.immediateChunk.length
388
- ), Z(`${M}${G.immediateChunk}`)), H.current = 0;
384
+ P.current = _.queue, _.immediateChunk && (q = q.slice(
385
+ _.immediateChunk.length
386
+ ), Z(`${A}${_.immediateChunk}`)), H.current = 0;
389
387
  }
390
388
  } else
391
389
  P.current = {
@@ -393,16 +391,16 @@ const _t = 2, be = ({
393
391
  head: 0,
394
392
  trailingGrapheme: ""
395
393
  }, H.current = 0;
396
- L.current = q, !d && q && rt((B) => B + 1);
397
- }, [r, v, p, f]), te(() => {
398
- p && (he.current || L.current || E !== v || (he.current = !0, S?.()));
394
+ L.current = q, !d && q && tt((B) => B + 1);
395
+ }, [r, v, p, f]), ne(() => {
396
+ p && (fe.current || L.current || E !== v || (fe.current = !0, b?.()));
399
397
  }, [
400
398
  r,
401
399
  v,
402
400
  E,
403
401
  p,
404
- S
405
- ]), te(() => {
402
+ b
403
+ ]), ne(() => {
406
404
  if (!p || !L.current)
407
405
  return;
408
406
  const e = window.setTimeout(() => {
@@ -410,15 +408,15 @@ const _t = 2, be = ({
410
408
  return;
411
409
  let n = "";
412
410
  if (f === "content-aware") {
413
- const d = St(
411
+ const d = Tt(
414
412
  P.current,
415
- H.current + Rt
413
+ H.current + bt
416
414
  );
417
- n = d.chunk, P.current = d.queue, Bt(d.queue) ? H.current = 0 : H.current = d.remainingBudget;
415
+ n = d.chunk, P.current = d.queue, St(d.queue) ? H.current = 0 : H.current = d.remainingBudget;
418
416
  } else
419
- n = Ut(
417
+ n = Qt(
420
418
  L.current,
421
- _t
419
+ Ft
422
420
  ).chunk;
423
421
  if (!n)
424
422
  return;
@@ -427,23 +425,23 @@ const _t = 2, be = ({
427
425
  head: 0,
428
426
  trailingGrapheme: P.current.trailingGrapheme
429
427
  } : { tokens: [], head: 0, trailingGrapheme: "" }, H.current = 0);
430
- const a = `${se.current}${n}`;
431
- se.current = a, Me(a);
432
- }, Le);
428
+ const a = `${ie.current}${n}`;
429
+ ie.current = a, Ne(a);
430
+ }, Be);
433
431
  return () => window.clearTimeout(e);
434
432
  }, [
435
433
  E,
436
- tt,
434
+ Je,
437
435
  p,
438
436
  f,
439
- Le,
440
- nt
437
+ Be,
438
+ et
441
439
  ]);
442
- const z = h(() => {
440
+ const F = h(() => {
443
441
  let e = 0;
444
- return k.map((n) => {
442
+ return C.map((n) => {
445
443
  if (!p) return n;
446
- if (n.type === "sandbox" || _(n))
444
+ if (n.type === "sandbox" || j(n))
447
445
  return E.length >= e ? n : { ...n, value: "" };
448
446
  const a = E.slice(
449
447
  e,
@@ -451,13 +449,13 @@ const _t = 2, be = ({
451
449
  );
452
450
  return e += n.value.length, { ...n, value: a };
453
451
  });
454
- }, [k, E, p]), Ee = h(
452
+ }, [C, E, p]), Ve = h(
455
453
  () => ({
456
454
  isTypewriterEnabled: p,
457
455
  isTyping: p && E !== v,
458
456
  isComplete: E === v,
459
- renderedLength: r.length - k.reduce(
460
- (e, n, a) => e + n.value.length - z[a].value.length,
457
+ renderedLength: r.length - C.reduce(
458
+ (e, n, a) => e + n.value.length - F[a].value.length,
461
459
  0
462
460
  ),
463
461
  totalLength: r.length
@@ -467,134 +465,134 @@ const _t = 2, be = ({
467
465
  v,
468
466
  E,
469
467
  p,
470
- k,
471
- z
468
+ C,
469
+ F
472
470
  ]
473
471
  );
474
- te(() => {
475
- A?.(Ee);
476
- }, [A, Ee]);
477
- const ge = h(() => {
472
+ ne(() => {
473
+ V?.(Ve);
474
+ }, [V, Ve]);
475
+ const he = h(() => {
478
476
  let e = 0;
479
- return k.map((n) => {
477
+ return C.map((n) => {
480
478
  const a = e;
481
479
  return e += n.value.length, a;
482
480
  });
483
- }, [k]), ae = h(
484
- () => p ? k.map(
485
- (e) => e.type === "sandbox" || _(e) ? [] : e.value === R ? N.inline : Tt(e.value)
481
+ }, [C]), ue = h(
482
+ () => p ? C.map(
483
+ (e) => e.type === "sandbox" || j(e) ? [] : e.value === R ? M.inline : Ct(e.value)
486
484
  ) : [],
487
- [p, k, R, N]
488
- ), ot = h(
489
- () => K ? z.map(
490
- (e, n) => e.type === "sandbox" || _(e) ? e.value : p ? Oe(
485
+ [p, C, R, M]
486
+ ), nt = h(
487
+ () => K ? F.map(
488
+ (e, n) => e.type === "sandbox" || j(e) ? e.value : p ? qe(
491
489
  e.value,
492
- k[n].value,
493
- ae[n] ?? [],
494
- N.metadata,
495
- ge[n]
496
- ) : Te(
490
+ C[n].value,
491
+ ue[n] ?? [],
492
+ M.metadata,
493
+ he[n]
494
+ ) : ke(
497
495
  e.value,
498
- N.metadata,
499
- ge[n]
496
+ M.metadata,
497
+ he[n]
500
498
  )
501
499
  ) : [],
502
500
  [
503
501
  K,
504
502
  p,
505
- z,
506
- ae,
507
- k,
508
- N.metadata,
509
- ge
503
+ F,
504
+ ue,
505
+ C,
506
+ M.metadata,
507
+ he
510
508
  ]
511
- ), st = h(() => {
509
+ ), rt = h(() => {
512
510
  const e = [];
513
- k.forEach((n, a) => {
511
+ C.forEach((n, a) => {
514
512
  const d = e.at(-1);
515
513
  n.type !== "sandbox" && d && !d.sandbox ? d.indices.push(a) : e.push({ indices: [a], sandbox: n.type === "sandbox" });
516
514
  });
517
515
  for (const n of e)
518
- if (!n.sandbox && n.indices.some((a) => _(k[a]))) {
519
- const a = n.indices.map((T) => k[T]), d = a.map((T) => T.value).join("");
520
- n.plan = $t(
516
+ if (!n.sandbox && n.indices.some((a) => j(C[a]))) {
517
+ const a = n.indices.map((k) => C[k]), d = a.map((k) => k.value).join("");
518
+ n.plan = At(
521
519
  a,
522
- d === R ? N : void 0
520
+ d === R ? M : void 0
523
521
  );
524
522
  }
525
523
  return e;
526
- }, [k, R, N]), F = K ? z.map((e) => e.value).join("") : p ? E : R, at = h(
527
- () => y ? we(F) : "",
528
- [y, F]
529
- ), Pe = h(
530
- () => K ? "" : we(
531
- p ? Oe(
532
- F,
524
+ }, [C, R, M]), G = K ? F.map((e) => e.value).join("") : p ? E : R, ot = h(
525
+ () => x ? xe(G) : "",
526
+ [x, G]
527
+ ), $e = h(
528
+ () => K ? "" : xe(
529
+ p ? qe(
530
+ G,
533
531
  R,
534
- ae[0] ?? [],
535
- N.metadata
536
- ) : Te(
537
- F,
538
- N.metadata
532
+ ue[0] ?? [],
533
+ M.metadata
534
+ ) : ke(
535
+ G,
536
+ M.metadata
539
537
  )
540
538
  ),
541
539
  [
542
540
  R,
543
541
  K,
544
542
  p,
545
- F,
546
- ae,
547
- N.metadata
543
+ G,
544
+ ue,
545
+ M.metadata
548
546
  ]
549
- ), ve = h(
550
- () => Mt(
551
- F,
547
+ ), ge = h(
548
+ () => Nt(
549
+ G,
552
550
  l,
553
551
  i
554
552
  ),
555
- [i, F, l]
556
- ), Ie = (V ? Ge.trimVariablePadding(V) : void 0) || ve.buttonText, De = W?.trim() || ve.inputText, ct = h(
557
- () => l ? l.split(",").map((e) => Ge.trimVariablePadding(e)).filter(Boolean) : void 0,
553
+ [i, G, l]
554
+ ), Ee = ($ ? ze.trimVariablePadding($) : void 0) || ge.buttonText, Pe = z?.trim() || ge.inputText, st = h(
555
+ () => l ? l.split(",").map((e) => ze.trimVariablePadding(e)).filter(Boolean) : void 0,
558
556
  [l]
559
- ), it = I?.length ? I : ve.selectedValues || ct, We = Yt(
560
- it
561
- ), x = b({
557
+ ), at = I?.length ? I : ge.selectedValues || st, Ie = Ut(
558
+ at
559
+ ), y = T({
562
560
  onPlaceholderAccepted: t,
563
- direction: j,
564
- language: ee,
565
- mermaidMessages: $,
566
- beforeSend: pe,
561
+ direction: S,
562
+ language: N,
563
+ mermaidMessages: ee,
564
+ beforeSend: ce,
567
565
  locale: o,
568
- onClickCustomButtonAfterContent: me,
566
+ onClickCustomButtonAfterContent: ae,
569
567
  onSend: g,
570
- readonly: C,
571
- renderContent: F,
572
- resolvedConfirmButtonText: Re,
573
- resolvedCopiedButtonText: Ne,
574
- resolvedCopyButtonText: Be,
575
- resolvedDefaultButtonText: Ie,
576
- resolvedDefaultInputText: De,
577
- resolvedDefaultSelectedValues: We
568
+ readonly: w,
569
+ renderContent: G,
570
+ resolvedConfirmButtonText: te,
571
+ resolvedCopiedButtonText: Re,
572
+ resolvedCopyButtonText: Se,
573
+ resolvedDefaultButtonText: Ee,
574
+ resolvedDefaultInputText: Pe,
575
+ resolvedDefaultSelectedValues: Ie
578
576
  });
579
- x.current = {
577
+ y.current = {
580
578
  onPlaceholderAccepted: t,
581
- direction: j,
582
- language: ee,
583
- mermaidMessages: $,
584
- beforeSend: pe,
579
+ direction: S,
580
+ language: N,
581
+ mermaidMessages: ee,
582
+ beforeSend: ce,
585
583
  locale: o,
586
- onClickCustomButtonAfterContent: me,
584
+ onClickCustomButtonAfterContent: ae,
587
585
  onSend: g,
588
- readonly: C,
589
- renderContent: F,
590
- resolvedConfirmButtonText: Re,
591
- resolvedCopiedButtonText: Ne,
592
- resolvedCopyButtonText: Be,
593
- resolvedDefaultButtonText: Ie,
594
- resolvedDefaultInputText: De,
595
- resolvedDefaultSelectedValues: We
586
+ readonly: w,
587
+ renderContent: G,
588
+ resolvedConfirmButtonText: te,
589
+ resolvedCopiedButtonText: Re,
590
+ resolvedCopyButtonText: Se,
591
+ resolvedDefaultButtonText: Ee,
592
+ resolvedDefaultInputText: Pe,
593
+ resolvedDefaultSelectedValues: Ie
596
594
  };
597
- const xe = h(
595
+ const ve = h(
598
596
  () => ({
599
597
  "custom-button-after-content": ({
600
598
  children: e
@@ -602,28 +600,28 @@ const _t = 2, be = ({
602
600
  "button",
603
601
  {
604
602
  className: "content-render-custom-button-after-content",
605
- onClick: x.current.onClickCustomButtonAfterContent,
603
+ onClick: y.current.onClickCustomButtonAfterContent,
606
604
  children: /* @__PURE__ */ s("span", { className: "content-render-custom-button-after-content-inner", children: e })
607
605
  }
608
606
  ),
609
607
  "custom-variable": (e) => /* @__PURE__ */ s(
610
- gt,
608
+ ft,
611
609
  {
612
610
  ...e,
613
- readonly: x.current.readonly,
614
- defaultButtonText: x.current.resolvedDefaultButtonText,
615
- defaultInputText: x.current.resolvedDefaultInputText,
616
- defaultSelectedValues: x.current.resolvedDefaultSelectedValues,
617
- onSend: x.current.onSend,
618
- onPlaceholderAccepted: x.current.onPlaceholderAccepted,
619
- beforeSend: x.current.beforeSend,
620
- locale: x.current.locale,
621
- dir: x.current.direction,
622
- lang: x.current.language,
623
- confirmButtonText: x.current.resolvedConfirmButtonText
611
+ readonly: y.current.readonly,
612
+ defaultButtonText: y.current.resolvedDefaultButtonText,
613
+ defaultInputText: y.current.resolvedDefaultInputText,
614
+ defaultSelectedValues: y.current.resolvedDefaultSelectedValues,
615
+ onSend: y.current.onSend,
616
+ onPlaceholderAccepted: y.current.onPlaceholderAccepted,
617
+ beforeSend: y.current.beforeSend,
618
+ locale: y.current.locale,
619
+ dir: y.current.direction,
620
+ lang: y.current.language,
621
+ confirmButtonText: y.current.resolvedConfirmButtonText
624
622
  }
625
623
  ),
626
- code: Ye,
624
+ code: Ue,
627
625
  table: ({ ...e }) => /* @__PURE__ */ s("div", { className: "content-render-table-container", children: /* @__PURE__ */ s("table", { className: "content-render-table", ...e }) }),
628
626
  th: ({ ...e }) => /* @__PURE__ */ s("th", { className: "content-render-th", ...e }),
629
627
  td: ({ ...e }) => /* @__PURE__ */ s("td", { className: "content-render-td", ...e }),
@@ -645,122 +643,120 @@ const _t = 2, be = ({
645
643
  ) : /* @__PURE__ */ s("input", { ...e }),
646
644
  a: ({ children: e, ...n }) => /* @__PURE__ */ s("a", { target: "_blank", rel: "noopener noreferrer", ...n, children: e }),
647
645
  pre: (e) => /* @__PURE__ */ s(
648
- ft,
646
+ mt,
649
647
  {
650
648
  ...e,
651
- copyButtonText: x.current.resolvedCopyButtonText,
652
- copiedButtonText: x.current.resolvedCopiedButtonText
649
+ copyButtonText: y.current.resolvedCopyButtonText,
650
+ copiedButtonText: y.current.resolvedCopiedButtonText
653
651
  }
654
652
  )
655
653
  }),
656
654
  []
657
- ), ut = h(
658
- () => je(Pe),
659
- [Pe]
660
- ), lt = (e, n) => {
661
- const a = we(e);
662
- return je(a).map((T, ye) => {
663
- const Y = `${n}-${T.type}-${ye}`;
664
- return T.type === "text" ? /* @__PURE__ */ s(
665
- ce.Provider,
655
+ ), ct = h(
656
+ () => Ge($e),
657
+ [$e]
658
+ ), it = (e, n) => {
659
+ const a = xe(e);
660
+ return Ge(a).map((k, ye) => {
661
+ const Y = `${n}-${k.type}-${ye}`;
662
+ return k.type === "text" ? /* @__PURE__ */ s(
663
+ le.Provider,
666
664
  {
667
- value: x,
665
+ value: y,
668
666
  children: /* @__PURE__ */ s(
669
- Qe,
667
+ He,
670
668
  {
671
669
  locale: o,
672
- components: xe,
673
- content: T.value
670
+ components: ve,
671
+ content: k.value
674
672
  }
675
673
  )
676
674
  },
677
675
  Y
678
- ) : T.type === "mermaid" ? /* @__PURE__ */ s(
679
- ke,
676
+ ) : k.type === "mermaid" ? /* @__PURE__ */ s(
677
+ Ce,
680
678
  {
681
- chart: T.value,
682
- frozen: !T.complete,
683
- messages: $
679
+ chart: k.value,
680
+ frozen: !k.complete,
681
+ messages: ee
684
682
  },
685
683
  Y
686
- ) : T.type === "svg" ? /* @__PURE__ */ s(be, { svg: T.value }, Y) : null;
684
+ ) : k.type === "svg" ? /* @__PURE__ */ s(Te, { svg: k.value }, Y) : null;
687
685
  });
688
- }, ze = y ? /* @__PURE__ */ s("div", { className: "content-render-custom-bar", children: X.createElement(y, {
686
+ }, De = x ? /* @__PURE__ */ s("div", { className: "content-render-custom-bar", children: X.createElement(x, {
689
687
  content: r,
690
- displayContent: at,
688
+ displayContent: ot,
691
689
  onSend: g
692
690
  }) }) : null;
693
- return K ? /* @__PURE__ */ Fe(
691
+ return K ? /* @__PURE__ */ We(
694
692
  "div",
695
693
  {
696
694
  className: "content-render markdown-body",
697
- dir: j,
698
- lang: ee,
695
+ dir: S,
696
+ lang: N,
699
697
  children: [
700
- st.map((e) => {
701
- const n = e.indices[0], a = z[n];
698
+ rt.map((e) => {
699
+ const n = e.indices[0], a = F[n];
702
700
  return e.sandbox ? a.type === "sandbox" && a.value && !a.pending ? /* @__PURE__ */ s(
703
- bt,
701
+ kt,
704
702
  {
705
703
  hideFullScreen: !0,
706
704
  type: "sandbox",
707
705
  content: a.value,
708
706
  className: "content-render-iframe",
709
707
  locale: o,
710
- dir: j,
711
- lang: ee,
712
- loadingText: ne,
713
- styleLoadingText: ie,
714
- scriptLoadingText: ue,
715
- disableLoadingOverlay: re,
716
- fullScreenButtonText: Je,
717
- exitFullScreenButtonText: et,
718
- mode: de
708
+ dir: S,
709
+ lang: N,
710
+ loadingText: re,
711
+ disableLoadingOverlay: de,
712
+ fullScreenButtonText: Xe,
713
+ exitFullScreenButtonText: Ze,
714
+ mode: se
719
715
  },
720
716
  `sandbox-${n}`
721
717
  ) : null : e.plan ? /* @__PURE__ */ s(
722
- ce.Provider,
718
+ le.Provider,
723
719
  {
724
- value: x,
720
+ value: y,
725
721
  children: /* @__PURE__ */ s(
726
- qt,
722
+ jt,
727
723
  {
728
724
  locale: o,
729
- components: xe,
725
+ components: ve,
730
726
  plan: e.plan,
731
727
  renderedSegments: e.indices.map(
732
- (d) => z[d]
728
+ (d) => F[d]
733
729
  )
734
730
  }
735
731
  )
736
732
  },
737
733
  `md-${n}`
738
- ) : e.indices.map((d) => /* @__PURE__ */ s(X.Fragment, { children: z[d].type === "markdown" && z[d].pending ? null : lt(
739
- ot[d],
734
+ ) : e.indices.map((d) => /* @__PURE__ */ s(X.Fragment, { children: F[d].type === "markdown" && F[d].pending ? null : it(
735
+ nt[d],
740
736
  `md-${d}`
741
737
  ) }, `md-${d}`));
742
738
  }),
743
- ze
739
+ De
744
740
  ]
745
741
  }
746
- ) : /* @__PURE__ */ Fe(
742
+ ) : /* @__PURE__ */ We(
747
743
  "div",
748
744
  {
749
745
  className: "content-render markdown-body",
750
- dir: j,
751
- lang: ee,
746
+ dir: S,
747
+ lang: N,
752
748
  children: [
753
- ut.map((e, n) => {
749
+ ct.map((e, n) => {
754
750
  if (e.type === "text")
755
751
  return /* @__PURE__ */ s(
756
- ce.Provider,
752
+ le.Provider,
757
753
  {
758
- value: x,
754
+ value: y,
759
755
  children: /* @__PURE__ */ s(
760
- Qe,
756
+ He,
761
757
  {
762
758
  locale: o,
763
- components: xe,
759
+ components: ve,
764
760
  content: e.value
765
761
  }
766
762
  )
@@ -769,24 +765,24 @@ const _t = 2, be = ({
769
765
  );
770
766
  if (e.type === "mermaid")
771
767
  return /* @__PURE__ */ s(
772
- ke,
768
+ Ce,
773
769
  {
774
770
  chart: e.value,
775
771
  frozen: !e.complete,
776
- messages: $
772
+ messages: ee
777
773
  },
778
774
  n
779
775
  );
780
776
  if (e.type === "svg")
781
- return /* @__PURE__ */ s(be, { svg: e.value }, n);
777
+ return /* @__PURE__ */ s(Te, { svg: e.value }, n);
782
778
  }),
783
- ze
779
+ De
784
780
  ]
785
781
  }
786
782
  );
787
783
  };
788
784
  export {
789
- Qe as MarkdownRenderer,
790
- Vn as default
785
+ He as MarkdownRenderer,
786
+ Ln as default
791
787
  };
792
788
  //# sourceMappingURL=ContentRender.es.js.map