reactive-md 0.9.0 → 0.9.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.
Files changed (162) hide show
  1. package/CHANGELOG-ch.md +13 -0
  2. package/CHANGELOG.md +13 -0
  3. package/README-ch.md +6 -6
  4. package/README-en.md +6 -6
  5. package/README.md +6 -6
  6. package/SECURITY-ch.md +3 -3
  7. package/SECURITY.md +3 -3
  8. package/THIRD_PARTY_NOTICES.md +111 -1
  9. package/cli/build.mjs +1 -0
  10. package/cli/init.mjs +1 -1
  11. package/dist-library/{LocalDocumentView-K7Y-2bRJ.js → LocalDocumentView-sthUP0ct.js} +10 -10
  12. package/dist-library/LocalDocumentViewCore-GiWV3bey.js +9829 -0
  13. package/dist-library/LocalReactiveDocumentCore-ZjQSGyHE.js +275 -0
  14. package/dist-library/{authoring-Co_TiE-P.js → authoring-Dsune4Hy.js} +40 -20
  15. package/dist-library/{compile-LhpTKqCR.js → compile-wUv8KEge.js} +1 -1
  16. package/dist-library/{compiler-core-DTxY-qYz.js → compiler-core-As_m-MNm.js} +2449 -1742
  17. package/dist-library/{compiler-DfGbQhyD.js → compiler-eOfcinZs.js} +19 -19
  18. package/dist-library/{component-state-BBJ08vML.js → component-state-C52ZFJGl.js} +1 -1
  19. package/dist-library/{config-BUo-8O5C.js → config-BadfhjdP.js} +1 -1
  20. package/dist-library/{config-validation-C5kJYk-J.js → config-validation-F47AcE6o.js} +49 -1
  21. package/dist-library/{controls-BWiLLtBO.js → controls-CcT6n7k_.js} +2433 -2409
  22. package/dist-library/{coordinate-BSl6enWV.js → coordinate-CWS9p5q_.js} +108 -107
  23. package/dist-library/{data-table-DfvytZKQ.js → data-table-Bgccxd7h.js} +68 -65
  24. package/dist-library/{display-lw3BT1TA.js → display-B-VhqVND.js} +1 -1
  25. package/dist-library/{export-C7IDW9ul.js → export-BqVmTXm8.js} +145 -87
  26. package/dist-library/{gallery-B8kSt1oI.js → gallery-CY6mTx8i.js} +151 -147
  27. package/dist-library/html-CNT4KD-2.js +757 -0
  28. package/dist-library/{incremental-D_6vwAAE.js → incremental-Dv0FSp_U.js} +404 -142
  29. package/dist-library/layout-C0YlEPGr.js +562 -0
  30. package/dist-library/{mount-preset-C5s9ebEH.js → mount-preset-KxvtKgJb.js} +2 -2
  31. package/dist-library/options-1aDLK7JY.js +121 -0
  32. package/dist-library/{package-core-D0POW4Gd.js → package-core-WFK1RhAZ.js} +3 -3
  33. package/dist-library/{parser-standard-OToYcOBL.js → parser-standard-Yuf3A_VI.js} +3270 -3778
  34. package/dist-library/react-D5iGiUdL.js +7 -0
  35. package/dist-library/reactive-md-authoring.js +16 -18
  36. package/dist-library/reactive-md-build.js +51 -51
  37. package/dist-library/reactive-md-compiler-standard.js +10 -9
  38. package/dist-library/reactive-md-compiler.js +3 -3
  39. package/dist-library/reactive-md-export.js +4 -4
  40. package/dist-library/reactive-md-minimal-react-preset.js +3 -3
  41. package/dist-library/reactive-md-pdf.js +127 -3
  42. package/dist-library/reactive-md-plugin-chart.js +2 -2
  43. package/dist-library/reactive-md-plugin-data.js +4 -4
  44. package/dist-library/reactive-md-plugin-diagram.js +3 -3
  45. package/dist-library/reactive-md-plugin-forms.js +2 -2
  46. package/dist-library/reactive-md-plugin-gallery.js +2 -2
  47. package/dist-library/reactive-md-plugin-navigation.js +2 -2
  48. package/dist-library/reactive-md-plugin-network.js +117 -115
  49. package/dist-library/reactive-md-plugin-plot.js +3 -3
  50. package/dist-library/reactive-md-react-minimal.js +4 -4
  51. package/dist-library/reactive-md-react-server.js +6 -6
  52. package/dist-library/reactive-md-react-unstyled.js +10 -11
  53. package/dist-library/reactive-md-react.js +10 -11
  54. package/dist-library/reactive-md-sdk.js +3 -3
  55. package/dist-library/reactive-md-standalone-configured.js +2 -2
  56. package/dist-library/reactive-md-standalone-host.js +2 -2
  57. package/dist-library/reactive-md-testing-browser.js +2 -2
  58. package/dist-library/reactive-md-testing-react.js +6 -6
  59. package/dist-library/reactive-md-testing.js +4 -4
  60. package/dist-library/reactive-md.js +280 -193
  61. package/dist-library/{registry-05JiqmEp.js → registry-B9NGct4d.js} +1 -1
  62. package/dist-library/{resources-IeJomeUT.js → resources-D2GDQS0p.js} +1 -1
  63. package/dist-library/{runtime-CuOyRe9f.js → runtime-kcA7bG7G.js} +341 -341
  64. package/dist-library/{schema-C-AeByPp.js → schema-BufhKUSM.js} +5 -5
  65. package/dist-library/{sdk-core-BJLJaVR5.js → sdk-core-BoJT1SIt.js} +490 -150
  66. package/dist-library/{session-core-BGka5D1J.js → session-core-nmJHuR9c.js} +170 -156
  67. package/dist-library/{shareable-jkGi2g6y.js → shareable-DpbE-59H.js} +207 -242
  68. package/dist-library/types/authoring/catalog.d.ts +1 -2
  69. package/dist-library/types/components/shared/visual-frame.d.ts +6 -2
  70. package/dist-library/types/local/compilation/compiler-capabilities.d.ts +3 -0
  71. package/dist-library/types/local/compilation/compiler-core.d.ts +11 -3
  72. package/dist-library/types/local/compilation/compiler-services.d.ts +8 -4
  73. package/dist-library/types/local/compilation/compiler.d.ts +3 -3
  74. package/dist-library/types/local/compilation/session/incremental.d.ts +20 -5
  75. package/dist-library/types/local/compilation/streaming.d.ts +27 -0
  76. package/dist-library/types/local/configuration/capability-policy.d.ts +3 -0
  77. package/dist-library/types/local/configuration/diagnostic-messages.d.ts +48 -0
  78. package/dist-library/types/local/configuration/options-core.d.ts +1 -2
  79. package/dist-library/types/local/configuration/options.d.ts +1 -0
  80. package/dist-library/types/local/css/author-css.d.ts +66 -0
  81. package/dist-library/types/local/html/extended-fragment.d.ts +41 -0
  82. package/dist-library/types/local/html/html.d.ts +39 -3
  83. package/dist-library/types/local/index.d.ts +1 -1
  84. package/dist-library/types/local/parsing/author-markdown.d.ts +11 -0
  85. package/dist-library/types/local/parsing/parse-session.d.ts +2 -2
  86. package/dist-library/types/local/parsing/parser-convert.d.ts +2 -1
  87. package/dist-library/types/local/parsing/parser-core.d.ts +8 -1
  88. package/dist-library/types/local/parsing/parser.d.ts +2 -2
  89. package/dist-library/types/local/rendering/document/ExtendedHtmlFragment.d.ts +14 -0
  90. package/dist-library/types/local/rendering/document/LocalDocumentViewCore.d.ts +25 -1
  91. package/dist-library/types/local/rendering/document/LocalReactiveDocumentCore.d.ts +1 -1
  92. package/dist-library/types/local/rendering/document/use-author-script.d.ts +3 -0
  93. package/dist-library/types/local/rendering/document/view-render-context.d.ts +11 -1
  94. package/dist-library/types/local/runtime/author-script-protocol.d.ts +59 -0
  95. package/dist-library/types/local/transport/worker.d.ts +27 -4
  96. package/dist-library/types/local/types.d.ts +52 -16
  97. package/dist-library/types/react/component-api.d.ts +10 -1
  98. package/dist-library/types/react/component-utils.d.ts +9 -1
  99. package/dist-library/types/react/sdk-core.d.ts +4 -1
  100. package/dist-library/types/shareable.d.ts +5 -4
  101. package/dist-library/types/standalone/prepare.d.ts +1 -1
  102. package/dist-library/types/standalone/session-core.d.ts +3 -2
  103. package/dist-library/{types-BFC5rzC4.js → types-BeNtPqdY.js} +1 -1
  104. package/dist-library/{validation-BlDL2uD9.js → validation-BEBA_HvS.js} +88 -72
  105. package/dist-library/{visual-frame-G8PHoj1e.js → visual-frame-CyV1FXzs.js} +6 -5
  106. package/dist-library/{visuals-BkYRmYGO.js → visuals-BZbZYA7w.js} +24181 -24180
  107. package/dist-standalone/reactive-md-standalone.js +124 -117
  108. package/docs/README-ch.md +2 -1
  109. package/docs/README.md +2 -1
  110. package/docs/compatibility/compatibility-ch.md +6 -6
  111. package/docs/compatibility/compatibility-en.md +6 -6
  112. package/docs/compatibility/source-versioning-ch.md +1 -1
  113. package/docs/compatibility/source-versioning-en.md +1 -1
  114. package/docs/development/component-development-ch.md +2 -2
  115. package/docs/development/component-development-en.md +2 -2
  116. package/docs/development/component-development-reference-ch.md +2 -2
  117. package/docs/development/component-development-reference-en.md +2 -2
  118. package/docs/development/component-protocol-ch.md +2 -2
  119. package/docs/development/component-protocol-en.md +2 -2
  120. package/docs/development/extension-tutorial-ch.md +3 -3
  121. package/docs/development/extension-tutorial-en.md +3 -3
  122. package/docs/integration/author-tools-ch.md +1 -1
  123. package/docs/integration/author-tools-en.md +1 -1
  124. package/docs/integration/compiler-ch.md +3 -1
  125. package/docs/integration/compiler-en.md +3 -1
  126. package/docs/integration/editor-ch.md +3 -3
  127. package/docs/integration/editor-en.md +3 -3
  128. package/docs/integration/extension-sdk-ch.md +2 -2
  129. package/docs/integration/extension-sdk-en.md +2 -2
  130. package/docs/integration/local-integration-ch.md +130 -8
  131. package/docs/integration/local-integration-en.md +130 -8
  132. package/docs/integration/shareable-export-ch.md +4 -2
  133. package/docs/integration/shareable-export-en.md +4 -2
  134. package/docs/reference/html-compatibility-ch.md +20 -67
  135. package/docs/reference/html-compatibility-en.md +19 -64
  136. package/docs/reference/public-api-ch.md +10 -7
  137. package/docs/reference/public-api-en.md +10 -7
  138. package/docs/releases/release-0.9.1-ch.md +29 -0
  139. package/docs/releases/release-0.9.1-en.md +29 -0
  140. package/examples/component-package/README-ch.md +1 -1
  141. package/examples/component-package/README.md +1 -1
  142. package/examples/game-2048-package/README-ch.md +1 -1
  143. package/examples/game-2048-package/README.md +1 -1
  144. package/examples/integration/README-ch.md +21 -2
  145. package/examples/integration/README.md +21 -2
  146. package/examples/integration/extension-sdk/README-ch.md +1 -1
  147. package/examples/integration/extension-sdk/README.md +1 -1
  148. package/examples/integration/streaming/index.html +48 -0
  149. package/examples/integration/streaming/main.js +175 -0
  150. package/examples/integration/streaming/package.json +13 -0
  151. package/examples/integration/streaming/worker.js +3 -0
  152. package/examples/minimal-extension/README-ch.md +3 -3
  153. package/examples/minimal-extension/README.md +3 -3
  154. package/examples/tetris-package/README-ch.md +1 -1
  155. package/examples/tetris-package/README.md +1 -1
  156. package/package.json +6 -1
  157. package/dist-library/LocalDocumentViewCore-BLG4hMuO.js +0 -9535
  158. package/dist-library/LocalReactiveDocumentCore-DVQ6WA9G.js +0 -259
  159. package/dist-library/component-utils-BvHL8VGt.js +0 -298
  160. package/dist-library/layout-C22VjZh0.js +0 -542
  161. package/dist-library/options-CdSKOi7p.js +0 -116
  162. package/dist-library/react-LY5qsVeP.js +0 -7
@@ -1,4 +1,4 @@
1
- import { L as e, V as t } from "./config-validation-C5kJYk-J.js";
1
+ import { L as e, V as t } from "./config-validation-F47AcE6o.js";
2
2
  // node_modules/katex/dist/katex.mjs
3
3
  var n = class e extends Error {
4
4
  constructor(t, n) {
@@ -1,73 +1,82 @@
1
1
  import { O as e } from "./preset-core-CKc5YXSM.js";
2
- import { f as t, l as n, u as r } from "./config-validation-C5kJYk-J.js";
3
- import { c as i, d as a, l as o, s } from "./parser-standard-OToYcOBL.js";
4
- import { l as c, s as l, y as u } from "./config-BUo-8O5C.js";
5
- import { n as d } from "./registry-05JiqmEp.js";
6
- import { _ as f, c as p, i as m, l as h, o as g, r as _, s as v } from "./shareable-jkGi2g6y.js";
7
- import { i as y, n as b, r as x, t as S } from "./resources-IeJomeUT.js";
2
+ import { f as t, l as n, u as r } from "./config-validation-F47AcE6o.js";
3
+ import { a as i, l as a, o, s } from "./parser-standard-Yuf3A_VI.js";
4
+ import { l as c, s as l, y as u } from "./config-BadfhjdP.js";
5
+ import { n as d } from "./registry-B9NGct4d.js";
6
+ import { _ as f, c as p, i as m, l as h, o as g, r as _, s as v } from "./shareable-DpbE-59H.js";
7
+ import { i as y, n as b, r as x, t as S } from "./resources-D2GDQS0p.js";
8
8
  // src/export/render-markup.ts
9
- var C = "data-rmd-extension-error", w = "data-local-extension-error", ee = "data-local-host-component", T = "local-sdk-unavailable", E = 300, D = /(?:data-rmd-extension-error|data-local-extension-error|local-sdk-unavailable)/i;
10
- function O(e, t) {
9
+ var C = "data-rmd-extension-error", ee = "data-local-extension-error", te = "data-local-host-component", ne = "local-sdk-unavailable", w = 300, T = /(?:data-rmd-extension-error|data-local-extension-error|local-sdk-unavailable)/i;
10
+ function E(e, t) {
11
11
  for (let n of e.attrs) if (n.name.toLowerCase() === t) return n.value;
12
12
  }
13
- function te(e, t) {
14
- let n = O(e, "class");
13
+ function D(e, t) {
14
+ let n = E(e, "class");
15
15
  return n !== void 0 && n.split(/\s+/).includes(t);
16
16
  }
17
- function k(e) {
17
+ function O(e) {
18
18
  let t = e?.replace(/\s+/g, " ").trim();
19
- if (t) return t.length > E ? `${t.slice(0, E)}…` : t;
19
+ if (t) return t.length > w ? `${t.slice(0, w)}…` : t;
20
20
  }
21
- function A(e) {
22
- let t = O(e, C);
21
+ function k(e) {
22
+ let t = E(e, C);
23
23
  if (t !== void 0) {
24
- let e = k(t);
24
+ let e = O(t);
25
25
  return {
26
26
  reason: "extension-error",
27
27
  ...e === void 0 ? {} : { detail: e }
28
28
  };
29
29
  }
30
- if (O(e, w) !== void 0) return { reason: "extension-error" };
31
- let n = O(e, ee);
32
- if (n !== void 0 && te(e, T)) {
33
- let e = k(n);
30
+ if (E(e, ee) !== void 0) return { reason: "extension-error" };
31
+ let n = E(e, te);
32
+ if (n !== void 0 && D(e, ne)) {
33
+ let e = O(n);
34
34
  return {
35
35
  reason: "sdk-unavailable",
36
36
  ...e === void 0 ? {} : { component: e }
37
37
  };
38
38
  }
39
39
  }
40
- function j(e) {
41
- if (typeof e != "string" || e.trim() === "" || !D.test(e)) return null;
40
+ function A(e) {
41
+ if (typeof e != "string" || e.trim() === "" || !T.test(e)) return null;
42
42
  let t;
43
43
  try {
44
- t = i(e, { scriptingEnabled: !1 });
44
+ t = o(e, { scriptingEnabled: !1 });
45
45
  } catch {
46
46
  return null;
47
47
  }
48
48
  let n = [];
49
- for (M(t, n); n.length > 0;) {
49
+ for (j(t, n); n.length > 0;) {
50
50
  let e = n.pop();
51
51
  if (!a.isElementNode(e)) continue;
52
- let t = A(e);
52
+ let t = k(e);
53
53
  if (t) return t;
54
54
  let r = e.tagName.toLowerCase() === "template" ? a.getTemplateContent(e).childNodes : e.childNodes;
55
55
  for (let e = r.length - 1; e >= 0; --e) n.push(r[e]);
56
56
  }
57
57
  return null;
58
58
  }
59
- function M(e, t) {
59
+ function j(e, t) {
60
60
  for (let n = e.childNodes.length - 1; n >= 0; --n) t.push(e.childNodes[n]);
61
61
  }
62
- function N(e) {
62
+ function M(e) {
63
63
  return e.reason === "sdk-unavailable" ? e.component ? `Rendered output leaves host component <${e.component}> unavailable.` : "Rendered output leaves a host component unavailable." : e.detail ? `Rendered output contains an unavailable extension component: ${e.detail}` : "Rendered output contains an unavailable extension component.";
64
64
  }
65
65
  // src/export/print-document.ts
66
- var P = "reactive-md-native-document", F = "reactive-md-native-frame", I = "reactive-md-export-root", L = /^reactive-md-html\/v[0-9]+$/, R = /^\s*<!doctype html>/i, z = /* @__PURE__ */ new Set([
66
+ var N = "reactive-md-native-document", P = "reactive-md-native-frame", F = "reactive-md-export-root", I = "local-extended-fragment-frame", re = "http://www.w3.org/1999/xhtml", ie = /* @__PURE__ */ new Set(/* @__PURE__ */ "article.section.header.footer.div.p.span.figure.figcaption.h1.h2.h3.h4.h5.h6.blockquote.pre.code.br.hr.b.strong.i.em.u.s.del.mark.sub.sup.img.dl.dd.dt.ol.ul.li.table.caption.colgroup.col.thead.tbody.tfoot.tr.th.td".split(".")), ae = /* @__PURE__ */ new Set([
67
+ "alt",
68
+ "title",
69
+ "dir",
70
+ "lang",
71
+ "start",
72
+ "colspan",
73
+ "rowspan",
74
+ "scope"
75
+ ]), oe = /^data:image\/(?:png|jpeg|gif|webp);base64,[a-z0-9+/]+=*$/i, se = /^reactive-md-html\/v[0-9]+$/, ce = /^\s*<!doctype html>/i, L = /* @__PURE__ */ new Set([
67
76
  "script",
68
77
  "base",
69
78
  "link"
70
- ]), B = /* @__PURE__ */ new Set([
79
+ ]), R = /* @__PURE__ */ new Set([
71
80
  "src",
72
81
  "srcset",
73
82
  "poster",
@@ -75,54 +84,54 @@ var P = "reactive-md-native-document", F = "reactive-md-native-frame", I = "reac
75
84
  "xlink:href",
76
85
  "background"
77
86
  ]);
78
- function V(e) {
87
+ function z(e) {
79
88
  return a.isElementNode(e);
80
89
  }
81
- function H(e) {
90
+ function B(e) {
82
91
  return a.isTextNode(e);
83
92
  }
84
- function U(e) {
93
+ function V(e) {
85
94
  return a.getTemplateContent(e);
86
95
  }
87
- function W(e, t) {
96
+ function H(e, t) {
88
97
  return e.attrs.find((e) => e.name.toLowerCase() === t)?.value;
89
98
  }
90
- function G(e) {
91
- let t = W(e, "class");
99
+ function U(e) {
100
+ let t = H(e, "class");
92
101
  return t === void 0 ? [] : t.split(/\s+/).filter(Boolean);
93
102
  }
94
- function K(e, t) {
95
- return G(e).includes(t);
103
+ function W(e, t) {
104
+ return U(e).includes(t);
96
105
  }
97
- function q(e, t) {
98
- for (let n of e.childNodes) if (V(n) && n.tagName.toLowerCase() === t) return n;
106
+ function G(e, t) {
107
+ for (let n of e.childNodes) if (z(n) && n.tagName.toLowerCase() === t) return n;
99
108
  return null;
100
109
  }
101
- function J(e, t) {
102
- for (let n of e.childNodes) if (V(n) && n.tagName === "meta" && W(n, "name")?.trim().toLowerCase() === t) return W(n, "content");
110
+ function K(e, t) {
111
+ for (let n of e.childNodes) if (z(n) && n.tagName === "meta" && H(n, "name")?.trim().toLowerCase() === t) return H(n, "content");
103
112
  }
104
- function Y(e) {
105
- let t = J(e, "reactive-md-html-format");
106
- return t !== void 0 && L.test(t.trim()) && J(e, "reactive-md-output")?.trim().toLowerCase() === "static";
113
+ function le(e) {
114
+ let t = K(e, "reactive-md-html-format");
115
+ return t !== void 0 && se.test(t.trim()) && K(e, "reactive-md-output")?.trim().toLowerCase() === "static";
107
116
  }
108
- function X(e) {
109
- let t = e.childNodes.filter((e) => !(H(e) && e.value.trim() === ""));
110
- return t.length === 1 && V(t[0]) ? t[0] : null;
117
+ function q(e) {
118
+ let t = e.childNodes.filter((e) => !(B(e) && e.value.trim() === ""));
119
+ return t.length === 1 && z(t[0]) ? t[0] : null;
111
120
  }
112
- function Z(e) {
113
- let t = e.childNodes.find((e) => V(e) && K(e, I));
114
- if (!t || !V(t)) return;
115
- let n = X(t);
116
- if (!n || !K(n, P)) return;
117
- let r = X(n);
118
- if (!r || r.tagName !== "iframe" || !K(r, F)) return;
119
- let i = W(r, "sandbox");
120
- if (!(i === void 0 || /\ballow-(?:same-origin|scripts)\b/i.test(i))) return W(r, "srcdoc");
121
+ function ue(e) {
122
+ let t = e.childNodes.find((e) => z(e) && W(e, F));
123
+ if (!t || !z(t)) return;
124
+ let n = q(t);
125
+ if (!n || !W(n, N)) return;
126
+ let r = q(n);
127
+ if (!r || r.tagName !== "iframe" || !W(r, P)) return;
128
+ let i = H(r, "sandbox");
129
+ if (!(i === void 0 || /\ballow-(?:same-origin|scripts)\b/i.test(i))) return H(r, "srcdoc");
121
130
  }
122
- function ne(e) {
123
- return e.childNodes.some((e) => V(e) && e.tagName === "meta" && W(e, "http-equiv")?.trim().toLowerCase() === "content-security-policy");
131
+ function J(e) {
132
+ return e.childNodes.some((e) => z(e) && e.tagName === "meta" && H(e, "http-equiv")?.trim().toLowerCase() === "content-security-policy");
124
133
  }
125
- function re(e) {
134
+ function de(e) {
126
135
  return e.split(/[\s,]+/).some((e) => {
127
136
  let t = e.trim();
128
137
  if (t === "" || t.startsWith("#") || t.startsWith("//")) return t.startsWith("//");
@@ -130,50 +139,99 @@ function re(e) {
130
139
  return n !== void 0 && n !== "data" && n !== "about";
131
140
  });
132
141
  }
133
- function Q(e) {
142
+ function Y(e) {
134
143
  let t = [];
135
144
  for (let n of e) {
136
- if (!V(n)) {
145
+ if (!z(n)) {
137
146
  t.push(n);
138
147
  continue;
139
148
  }
140
149
  let e = n.tagName.toLowerCase();
141
- if (!(z.has(e) || e === "meta" && W(n, "http-equiv") !== void 0)) {
150
+ if (!(L.has(e) || e === "meta" && H(n, "http-equiv") !== void 0)) {
142
151
  if (n.attrs = n.attrs.filter((e) => {
143
152
  let t = e.name.toLowerCase();
144
- return t.startsWith("on") ? !1 : !B.has(t) || !re(e.value);
153
+ return t.startsWith("on") ? !1 : !R.has(t) || !de(e.value);
145
154
  }), e === "template") {
146
- let e = U(n);
147
- e.childNodes = Q(e.childNodes);
155
+ let e = V(n);
156
+ e.childNodes = Y(e.childNodes);
148
157
  }
149
- n.childNodes = Q(n.childNodes), t.push(n);
158
+ n.childNodes = Y(n.childNodes), t.push(n);
150
159
  }
151
160
  }
152
161
  return t;
153
162
  }
154
- function ie(e) {
155
- if (!e.includes(P) || !e.includes(F)) return e;
156
- let t = q(s(e, { scriptingEnabled: !1 }), "html"), n = t && q(t, "head"), r = t && q(t, "body");
157
- if (!n || !r || !Y(n)) return e;
158
- let i = Z(r);
159
- if (!i || !R.test(i)) return e;
160
- let c = s(i, { scriptingEnabled: !1 }), l = q(c, "html"), u = l && q(l, "head"), d = l && q(l, "body");
161
- if (!u || !d || !ne(u)) return e;
162
- let f = a.createElement("meta", n.namespaceURI, [{
163
+ function X(e, t) {
164
+ let n = H(e, "srcdoc"), r = H(e, "sandbox");
165
+ if (n && r !== void 0 && !/\ballow-(?:same-origin|scripts)\b/i.test(r) && t < 5) {
166
+ let e = G(i(n, { scriptingEnabled: !1 }), "html"), r = e && G(e, "head"), a = e && G(e, "body");
167
+ if (r && a && J(r)) return Z(a.childNodes, t + 1);
168
+ }
169
+ let a = H(e, "title");
170
+ return a ? [{
171
+ nodeName: "#text",
172
+ value: a,
173
+ parentNode: null
174
+ }] : [];
175
+ }
176
+ function Z(e, t) {
177
+ let n = [];
178
+ for (let r of e) {
179
+ if (B(r)) {
180
+ n.push(r);
181
+ continue;
182
+ }
183
+ if (!z(r) || r.namespaceURI !== re) continue;
184
+ if (r.tagName === "iframe") {
185
+ let e = a.createElement("div", r.namespaceURI, []);
186
+ for (let n of X(r, t)) a.appendChild(e, n);
187
+ n.push(e);
188
+ continue;
189
+ }
190
+ if (L.has(r.tagName) || r.tagName === "style" || r.tagName === "template") continue;
191
+ let e = Z(r.childNodes, t);
192
+ ie.has(r.tagName) ? (r.attrs = r.attrs.filter(({ name: e, value: t, namespace: n }) => !n && (ae.has(e) || r.tagName === "img" && e === "src" && oe.test(t))), r.childNodes = e, n.push(r)) : n.push(...e);
193
+ }
194
+ return n;
195
+ }
196
+ function Q(e) {
197
+ let t = !1;
198
+ for (let n of e.childNodes) {
199
+ if (!z(n)) continue;
200
+ if (H(n, "data-extended-html") !== "sandbox") {
201
+ Q(n) && (t = !0);
202
+ continue;
203
+ }
204
+ let e = q(n);
205
+ e && e.tagName === "iframe" && W(e, I) && (n.childNodes = X(e, 0), t = !0);
206
+ }
207
+ return t;
208
+ }
209
+ function fe(e) {
210
+ if (!(e.includes(N) && e.includes(P)) && !e.includes(I)) return e;
211
+ let t = i(e, { scriptingEnabled: !1 }), n = G(t, "html"), r = n && G(n, "head"), o = n && G(n, "body");
212
+ if (!r || !o || !le(r)) return e;
213
+ let c = ue(o);
214
+ if (!c || !ce.test(c)) {
215
+ let n = o.childNodes.find((e) => z(e) && W(e, F));
216
+ return n && z(n) && Q(n) ? s(t, { scriptingEnabled: !1 }) : e;
217
+ }
218
+ let l = i(c, { scriptingEnabled: !1 }), u = G(l, "html"), d = u && G(u, "head"), f = u && G(u, "body");
219
+ if (!d || !f || !J(d)) return e;
220
+ let p = a.createElement("meta", r.namespaceURI, [{
163
221
  name: "http-equiv",
164
222
  value: "Content-Security-Policy"
165
223
  }, {
166
224
  name: "content",
167
225
  value: "default-src 'none'; style-src 'unsafe-inline'; img-src data:; font-src data:; frame-src about: data: blob:; base-uri 'none'; form-action 'none'"
168
- }]), p = n.childNodes.filter((e) => V(e) && e.tagName === "style"), m = u.childNodes.filter((e) => V(e) && e.tagName === "style");
169
- return u.childNodes = [
170
- f,
171
- ...n.childNodes.filter((e) => V(e) && (e.tagName === "meta" || e.tagName === "title") && W(e, "http-equiv")?.toLowerCase() !== "refresh"),
172
- ...p,
173
- ...Q(m)
174
- ], d.childNodes = Q(d.childNodes), o(c, { scriptingEnabled: !1 });
226
+ }]), m = r.childNodes.filter((e) => z(e) && e.tagName === "style"), h = d.childNodes.filter((e) => z(e) && e.tagName === "style");
227
+ return d.childNodes = [
228
+ p,
229
+ ...r.childNodes.filter((e) => z(e) && (e.tagName === "meta" || e.tagName === "title") && H(e, "http-equiv")?.toLowerCase() !== "refresh"),
230
+ ...m,
231
+ ...Y(h)
232
+ ], f.childNodes = Y(f.childNodes), s(l, { scriptingEnabled: !1 });
175
233
  }
176
- async function ae(e) {
234
+ async function pe(e) {
177
235
  let t = /[\u0000-\u001f\u007f-\u009f]/g, n = (e, n) => {
178
236
  let r = typeof e.alt == "string" ? e.alt.replace(t, " ").trim() : "", i = r === "" || /^[a-z][a-z0-9+.-]*:/i.test(r) || r.startsWith("//") ? "" : r, a = i === "" ? `#${n + 1}` : i;
179
237
  return a.length > 120 ? `${a.slice(0, 117)}...` : a;
@@ -204,7 +262,7 @@ async function ae(e) {
204
262
  }), s;
205
263
  }
206
264
  // src/export/index.ts
207
- function oe(t, n) {
265
+ function me(t, n) {
208
266
  let r = l(n);
209
267
  if (typeof t != "string" || !t.trim() || t.length > 33554432) throw TypeError("A standalone bundle must contain a nonempty script of at most 32 MiB.");
210
268
  return Object.freeze({
@@ -280,7 +338,7 @@ function $(e) {
280
338
  ok: o.length === 0
281
339
  });
282
340
  }
283
- function se(e) {
341
+ function he(e) {
284
342
  if (e.document.source !== e.source) throw TypeError("The compiled document does not belong to this source.");
285
343
  let t = f(e.state);
286
344
  if (!t.ok) throw TypeError(t.diagnostics.map((e) => `[${e.code}] ${e.message}`).join("\n"));
@@ -293,8 +351,8 @@ function se(e) {
293
351
  target: e.mode === "static" ? "static" : "offline"
294
352
  });
295
353
  if (!i.ok) throw TypeError(i.diagnostics.map((e) => `[${e.code}] ${e.message}`).join("\n"));
296
- let a = j(e.staticMarkup);
297
- if (a) throw TypeError(N(a));
354
+ let a = A(e.staticMarkup);
355
+ if (a) throw TypeError(M(a));
298
356
  return _({
299
357
  ...e,
300
358
  compileOptions: {
@@ -308,4 +366,4 @@ function se(e) {
308
366
  css: `${e.css}\n${i.css}`
309
367
  });
310
368
  }
311
- export { ae as a, ie as i, se as n, j as o, oe as r, N as s, $ as t };
369
+ export { pe as a, fe as i, he as n, A as o, me as r, M as s, $ as t };