@pi-outpost/embed 0.35.2 → 0.37.0

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 (59) hide show
  1. package/dist/CodeEditor-2Vx8PHAy.js +2790 -0
  2. package/dist/CodeEditor-Cb6i9oIs.cjs +6 -0
  3. package/dist/clike-8rZWBES0.cjs +1 -0
  4. package/dist/clike-D-dOQnrm.js +587 -0
  5. package/dist/{conversationExport-DU5Xp2g-.js → conversationExport-BXEb1n8C.js} +2 -2
  6. package/dist/{conversationExport-DwLc0HDC.cjs → conversationExport-DEKaUq-d.cjs} +1 -1
  7. package/dist/{conversationHistory-DTP8xNqg.cjs → conversationHistory-BCj7z0AY.cjs} +5 -5
  8. package/dist/{conversationHistory-DHEPfViO.js → conversationHistory-BsL2Q-mL.js} +4759 -4747
  9. package/dist/dist-B0lO3k1f.js +410 -0
  10. package/dist/dist-B7I27gkN.cjs +1 -0
  11. package/dist/dist-B8gmxwh-.cjs +23 -0
  12. package/dist/dist-BBUKMRrs.js +69 -0
  13. package/dist/dist-BWlGU9XM.js +395 -0
  14. package/dist/dist-BZcglaBe.cjs +1 -0
  15. package/dist/dist-BZjcsPqi.cjs +13 -0
  16. package/dist/dist-BfQGuM1r.js +1340 -0
  17. package/dist/dist-BhNvvg0I.js +471 -0
  18. package/dist/dist-BhXQJ0x3.js +10805 -0
  19. package/dist/dist-BlD6NhiG.js +296 -0
  20. package/dist/dist-Bppoi_v9.js +357 -0
  21. package/dist/dist-BvsCdwbL.cjs +1 -0
  22. package/dist/dist-C0_uLrCb.cjs +6 -0
  23. package/dist/dist-C8jjSrIs.cjs +11 -0
  24. package/dist/dist-C9dtxVRR.cjs +1 -0
  25. package/dist/dist-CA6ERWRG.js +380 -0
  26. package/dist/dist-CHKg1Qb9.js +1583 -0
  27. package/dist/dist-CyFPTQ2l.cjs +1 -0
  28. package/dist/dist-D8I4FQ-Q.cjs +1 -0
  29. package/dist/dist-DEl2Ze0j.cjs +2 -0
  30. package/dist/dist-DJbgM591.cjs +1 -0
  31. package/dist/dist-DPXHxuWb.js +855 -0
  32. package/dist/dist-DZrtSp8H.js +607 -0
  33. package/dist/dist-Dja2VlN5.cjs +1 -0
  34. package/dist/dist-DqbI0un6.cjs +1 -0
  35. package/dist/dist-Dr4zY56l.js +440 -0
  36. package/dist/dist-Dvqp7T4I.cjs +1 -0
  37. package/dist/dist-FSzij9Rn.js +271 -0
  38. package/dist/dist-Xjm88mbq.js +756 -0
  39. package/dist/dist-qNFo_ASR.cjs +9 -0
  40. package/dist/dist-qq9a_ch2.js +431 -0
  41. package/dist/dockerfile-4x0UkDoN.js +291 -0
  42. package/dist/dockerfile-C67wRfne.cjs +1 -0
  43. package/dist/docxExport-BKC_hi5D.js +67 -0
  44. package/dist/docxExport-V7joLrkm.cjs +3 -0
  45. package/dist/{docxExport-BWwEuboU.js → loadReferencedImage-FGse7G4p.js} +538 -306
  46. package/dist/{docxExport-PjDC4XKL.cjs → loadReferencedImage-QespeGh9.cjs} +7 -9
  47. package/dist/pi-outpost-embed.cjs +51 -24
  48. package/dist/pi-outpost-embed.js +3026 -2743
  49. package/dist/properties-C85NeSsH.js +20 -0
  50. package/dist/properties-XjDvZYDm.cjs +1 -0
  51. package/dist/ruby-Bx72aP7E.cjs +1 -0
  52. package/dist/ruby-CjYBP7RB.js +166 -0
  53. package/dist/shell-CD1ADQh5.cjs +1 -0
  54. package/dist/shell-CevoiH_y.js +109 -0
  55. package/dist/toml-CPJF62TK.js +28 -0
  56. package/dist/toml-OuUxin0A.cjs +1 -0
  57. package/package.json +1 -1
  58. package/dist/loadReferencedImage-C8Hn2ejN.js +0 -268
  59. package/dist/loadReferencedImage-q-G47ESL.cjs +0 -1
@@ -0,0 +1,20 @@
1
+ //#region ../node_modules/@codemirror/legacy-modes/mode/properties.js
2
+ var e = {
3
+ name: "properties",
4
+ token: function(e, t) {
5
+ var n = e.sol() || t.afterSection, r = e.eol();
6
+ if (t.afterSection = !1, n && (t.nextMultiline ? (t.inMultiline = !0, t.nextMultiline = !1) : t.position = "def"), r && !t.nextMultiline && (t.inMultiline = !1, t.position = "def"), n) for (; e.eatSpace(););
7
+ var i = e.next();
8
+ return n && (i === "#" || i === "!" || i === ";") ? (t.position = "comment", e.skipToEnd(), "comment") : n && i === "[" ? (t.afterSection = !0, e.skipTo("]"), e.eat("]"), "header") : i === "=" || i === ":" ? (t.position = "quote", null) : (i === "\\" && t.position === "quote" && e.eol() && (t.nextMultiline = !0), t.position);
9
+ },
10
+ startState: function() {
11
+ return {
12
+ position: "def",
13
+ nextMultiline: !1,
14
+ inMultiline: !1,
15
+ afterSection: !1
16
+ };
17
+ }
18
+ };
19
+ //#endregion
20
+ export { e as properties };
@@ -0,0 +1 @@
1
+ var e={name:`properties`,token:function(e,t){var n=e.sol()||t.afterSection,r=e.eol();if(t.afterSection=!1,n&&(t.nextMultiline?(t.inMultiline=!0,t.nextMultiline=!1):t.position=`def`),r&&!t.nextMultiline&&(t.inMultiline=!1,t.position=`def`),n)for(;e.eatSpace(););var i=e.next();return n&&(i===`#`||i===`!`||i===`;`)?(t.position=`comment`,e.skipToEnd(),`comment`):n&&i===`[`?(t.afterSection=!0,e.skipTo(`]`),e.eat(`]`),`header`):i===`=`||i===`:`?(t.position=`quote`,null):(i===`\\`&&t.position===`quote`&&e.eol()&&(t.nextMultiline=!0),t.position)},startState:function(){return{position:`def`,nextMultiline:!1,inMultiline:!1,afterSection:!1}}};exports.properties=e;
@@ -0,0 +1 @@
1
+ function e(e){for(var t={},n=0,r=e.length;n<r;++n)t[e[n]]=!0;return t}var t=`alias.and.BEGIN.begin.break.case.class.def.defined?.do.else.elsif.END.end.ensure.false.for.if.in.module.next.not.or.redo.rescue.retry.return.self.super.then.true.undef.unless.until.when.while.yield.nil.raise.throw.catch.fail.loop.callcc.caller.lambda.proc.public.protected.private.require.load.require_relative.extend.autoload.__END__.__FILE__.__LINE__.__dir__`.split(`.`),n=e(t),r=e([`def`,`class`,`case`,`for`,`while`,`until`,`module`,`catch`,`loop`,`proc`,`begin`]),i=e([`end`,`until`]),a={"[":`]`,"{":`}`,"(":`)`},o={"]":`[`,"}":`{`,")":`(`},s;function c(e,t,n){return n.tokenize.push(e),e(t,n)}function l(e,t){if(e.sol()&&e.match(`=begin`)&&e.eol())return t.tokenize.push(h),`comment`;if(e.eatSpace())return null;var n=e.next(),r;if(n=="`"||n==`'`||n==`"`)return c(p(n,`string`,n==`"`||n=="`"),e,t);if(n==`/`)return u(e)?c(p(n,`string.special`,!0),e,t):`operator`;if(n==`%`){var i=`string`,o=!0;e.eat(`s`)?i=`atom`:e.eat(/[WQ]/)?i=`string`:e.eat(/[r]/)?i=`string.special`:e.eat(/[wxq]/)&&(i=`string`,o=!1);var l=e.eat(/[^\w\s=]/);return l?(a.propertyIsEnumerable(l)&&(l=a[l]),c(p(l,i,o,!0),e,t)):`operator`}if(n==`#`)return e.skipToEnd(),`comment`;if(n==`<`&&(r=e.match(/^<([-~])[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return c(m(r[2],r[1]),e,t);if(n==`0`)return e.eat(`x`)?e.eatWhile(/[\da-fA-F]/):e.eat(`b`)?e.eatWhile(/[01]/):e.eat(`.`)?e.eat(/[\d_]*(?:[eE][+\-]?[\d_]+)?/):e.eatWhile(/[0-7]/),`number`;if(/\d/.test(n))return e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),`number`;if(n==`?`){for(;e.match(/^\\[CM]-/););return e.eat(`\\`)?e.eatWhile(/\w/):e.next(),`string`}if(n==`:`)return e.eat(`'`)?c(p(`'`,`atom`,!1),e,t):e.eat(`"`)?c(p(`"`,`atom`,!0),e,t):e.eat(/[\<\>]/)?(e.eat(/[\<\>]/),`atom`):e.eat(/[\+\-\*\/\&\|\:\!]/)?`atom`:e.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(e.eatWhile(/[\w$\xa1-\uffff]/),e.eat(/[\?\!\=]/),`atom`):`operator`;if(n==`@`&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/))return e.eat(`@`),e.eatWhile(/[\w\xa1-\uffff]/),`propertyName`;if(n==`$`)return e.eat(/[a-zA-Z_]/)?e.eatWhile(/[\w]/):e.eat(/\d/)?e.eat(/\d/):e.next(),`variableName.special`;if(/[a-zA-Z_\xa1-\uffff]/.test(n))return e.eatWhile(/[\w\xa1-\uffff]/),e.eat(/[\?\!]/),e.eat(`:`)?`atom`:`variable`;if(n==`|`&&(t.varList||t.lastTok==`{`||t.lastTok==`do`))return s=`|`,null;if(/[\(\)\[\]{}\\;]/.test(n))return s=n,null;if(n==`-`&&e.eat(`>`))return`operator`;if(/[=+\-\/*:\.^%<>~|]/.test(n)){var d=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return n==`.`&&!d&&(s=`.`),`operator`}return null}function u(e){for(var t=e.pos,n=0,r,i=!1,a=!1;(r=e.next())!=null;)if(a)a=!1;else{if(`[{(`.indexOf(r)>-1)n++;else if(`]})`.indexOf(r)>-1){if(n--,n<0)break}else if(r==`/`&&n==0){i=!0;break}a=r==`\\`}return e.backUp(e.pos-t),i}function d(e){return e||=1,function(t,n){if(t.peek()==`}`){if(e==1)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n);n.tokenize[n.tokenize.length-1]=d(e-1)}else t.peek()==`{`&&(n.tokenize[n.tokenize.length-1]=d(e+1));return l(t,n)}}function f(){var e=!1;return function(t,n){return e?(n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)):(e=!0,l(t,n))}}function p(e,t,n,r){return function(i,a){var o=!1,s;for(a.context.type===`read-quoted-paused`&&(a.context=a.context.prev,i.eat(`}`));(s=i.next())!=null;){if(s==e&&(r||!o)){a.tokenize.pop();break}if(n&&s==`#`&&!o){if(i.eat(`{`)){e==`}`&&(a.context={prev:a.context,type:`read-quoted-paused`}),a.tokenize.push(d());break}if(/[@\$]/.test(i.peek())){a.tokenize.push(f());break}}o=!o&&s==`\\`}return t}}function m(e,t){return function(n,r){return t&&n.eatSpace(),n.match(e)?r.tokenize.pop():n.skipToEnd(),`string`}}function h(e,t){return e.sol()&&e.match(`=end`)&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),`comment`}var g={name:`ruby`,startState:function(e){return{tokenize:[l],indented:0,context:{type:`top`,indented:-e},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){s=null,e.sol()&&(t.indented=e.indentation());var a=t.tokenize[t.tokenize.length-1](e,t),o,c=s;if(a==`variable`){var l=e.current();a=t.lastTok==`.`?`property`:n.propertyIsEnumerable(e.current())?`keyword`:/^[A-Z]/.test(l)?`tag`:t.lastTok==`def`||t.lastTok==`class`||t.varList?`def`:`variable`,a==`keyword`&&(c=l,r.propertyIsEnumerable(l)?o=`indent`:i.propertyIsEnumerable(l)?o=`dedent`:((l==`if`||l==`unless`)&&e.column()==e.indentation()||l==`do`&&t.context.indented<t.indented)&&(o=`indent`))}return(s||a&&a!=`comment`)&&(t.lastTok=c),s==`|`&&(t.varList=!t.varList),o==`indent`||/[\(\[\{]/.test(s)?t.context={prev:t.context,type:s||a,indented:t.indented}:(o==`dedent`||/[\)\]\}]/.test(s))&&t.context.prev&&(t.context=t.context.prev),e.eol()&&(t.continuedLine=s==`\\`||a==`operator`),a},indent:function(e,t,n){if(e.tokenize[e.tokenize.length-1]!=l)return null;var r=t&&t.charAt(0),i=e.context,a=i.type==o[r]||i.type==`keyword`&&/^(?:end|until|else|elsif|when|rescue)\b/.test(t);return i.indented+(a?0:n.unit)+(e.continuedLine?n.unit:0)},languageData:{indentOnInput:/^\s*(?:end|rescue|elsif|else|\})$/,commentTokens:{line:`#`},autocomplete:t}};exports.ruby=g;
@@ -0,0 +1,166 @@
1
+ //#region ../node_modules/@codemirror/legacy-modes/mode/ruby.js
2
+ function e(e) {
3
+ for (var t = {}, n = 0, r = e.length; n < r; ++n) t[e[n]] = !0;
4
+ return t;
5
+ }
6
+ var t = /* @__PURE__ */ "alias.and.BEGIN.begin.break.case.class.def.defined?.do.else.elsif.END.end.ensure.false.for.if.in.module.next.not.or.redo.rescue.retry.return.self.super.then.true.undef.unless.until.when.while.yield.nil.raise.throw.catch.fail.loop.callcc.caller.lambda.proc.public.protected.private.require.load.require_relative.extend.autoload.__END__.__FILE__.__LINE__.__dir__".split("."), n = e(t), r = e([
7
+ "def",
8
+ "class",
9
+ "case",
10
+ "for",
11
+ "while",
12
+ "until",
13
+ "module",
14
+ "catch",
15
+ "loop",
16
+ "proc",
17
+ "begin"
18
+ ]), i = e(["end", "until"]), a = {
19
+ "[": "]",
20
+ "{": "}",
21
+ "(": ")"
22
+ }, o = {
23
+ "]": "[",
24
+ "}": "{",
25
+ ")": "("
26
+ }, s;
27
+ function c(e, t, n) {
28
+ return n.tokenize.push(e), e(t, n);
29
+ }
30
+ function l(e, t) {
31
+ if (e.sol() && e.match("=begin") && e.eol()) return t.tokenize.push(h), "comment";
32
+ if (e.eatSpace()) return null;
33
+ var n = e.next(), r;
34
+ if (n == "`" || n == "'" || n == "\"") return c(p(n, "string", n == "\"" || n == "`"), e, t);
35
+ if (n == "/") return u(e) ? c(p(n, "string.special", !0), e, t) : "operator";
36
+ if (n == "%") {
37
+ var i = "string", o = !0;
38
+ e.eat("s") ? i = "atom" : e.eat(/[WQ]/) ? i = "string" : e.eat(/[r]/) ? i = "string.special" : e.eat(/[wxq]/) && (i = "string", o = !1);
39
+ var l = e.eat(/[^\w\s=]/);
40
+ return l ? (a.propertyIsEnumerable(l) && (l = a[l]), c(p(l, i, o, !0), e, t)) : "operator";
41
+ }
42
+ if (n == "#") return e.skipToEnd(), "comment";
43
+ if (n == "<" && (r = e.match(/^<([-~])[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/))) return c(m(r[2], r[1]), e, t);
44
+ if (n == "0") return e.eat("x") ? e.eatWhile(/[\da-fA-F]/) : e.eat("b") ? e.eatWhile(/[01]/) : e.eat(".") ? e.eat(/[\d_]*(?:[eE][+\-]?[\d_]+)?/) : e.eatWhile(/[0-7]/), "number";
45
+ if (/\d/.test(n)) return e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/), "number";
46
+ if (n == "?") {
47
+ for (; e.match(/^\\[CM]-/););
48
+ return e.eat("\\") ? e.eatWhile(/\w/) : e.next(), "string";
49
+ }
50
+ if (n == ":") return e.eat("'") ? c(p("'", "atom", !1), e, t) : e.eat("\"") ? c(p("\"", "atom", !0), e, t) : e.eat(/[\<\>]/) ? (e.eat(/[\<\>]/), "atom") : e.eat(/[\+\-\*\/\&\|\:\!]/) ? "atom" : e.eat(/[a-zA-Z$@_\xa1-\uffff]/) ? (e.eatWhile(/[\w$\xa1-\uffff]/), e.eat(/[\?\!\=]/), "atom") : "operator";
51
+ if (n == "@" && e.match(/^@?[a-zA-Z_\xa1-\uffff]/)) return e.eat("@"), e.eatWhile(/[\w\xa1-\uffff]/), "propertyName";
52
+ if (n == "$") return e.eat(/[a-zA-Z_]/) ? e.eatWhile(/[\w]/) : e.eat(/\d/) ? e.eat(/\d/) : e.next(), "variableName.special";
53
+ if (/[a-zA-Z_\xa1-\uffff]/.test(n)) return e.eatWhile(/[\w\xa1-\uffff]/), e.eat(/[\?\!]/), e.eat(":") ? "atom" : "variable";
54
+ if (n == "|" && (t.varList || t.lastTok == "{" || t.lastTok == "do")) return s = "|", null;
55
+ if (/[\(\)\[\]{}\\;]/.test(n)) return s = n, null;
56
+ if (n == "-" && e.eat(">")) return "operator";
57
+ if (/[=+\-\/*:\.^%<>~|]/.test(n)) {
58
+ var d = e.eatWhile(/[=+\-\/*:\.^%<>~|]/);
59
+ return n == "." && !d && (s = "."), "operator";
60
+ }
61
+ return null;
62
+ }
63
+ function u(e) {
64
+ for (var t = e.pos, n = 0, r, i = !1, a = !1; (r = e.next()) != null;) if (a) a = !1;
65
+ else {
66
+ if ("[{(".indexOf(r) > -1) n++;
67
+ else if ("]})".indexOf(r) > -1) {
68
+ if (n--, n < 0) break;
69
+ } else if (r == "/" && n == 0) {
70
+ i = !0;
71
+ break;
72
+ }
73
+ a = r == "\\";
74
+ }
75
+ return e.backUp(e.pos - t), i;
76
+ }
77
+ function d(e) {
78
+ return e ||= 1, function(t, n) {
79
+ if (t.peek() == "}") {
80
+ if (e == 1) return n.tokenize.pop(), n.tokenize[n.tokenize.length - 1](t, n);
81
+ n.tokenize[n.tokenize.length - 1] = d(e - 1);
82
+ } else t.peek() == "{" && (n.tokenize[n.tokenize.length - 1] = d(e + 1));
83
+ return l(t, n);
84
+ };
85
+ }
86
+ function f() {
87
+ var e = !1;
88
+ return function(t, n) {
89
+ return e ? (n.tokenize.pop(), n.tokenize[n.tokenize.length - 1](t, n)) : (e = !0, l(t, n));
90
+ };
91
+ }
92
+ function p(e, t, n, r) {
93
+ return function(i, a) {
94
+ var o = !1, s;
95
+ for (a.context.type === "read-quoted-paused" && (a.context = a.context.prev, i.eat("}")); (s = i.next()) != null;) {
96
+ if (s == e && (r || !o)) {
97
+ a.tokenize.pop();
98
+ break;
99
+ }
100
+ if (n && s == "#" && !o) {
101
+ if (i.eat("{")) {
102
+ e == "}" && (a.context = {
103
+ prev: a.context,
104
+ type: "read-quoted-paused"
105
+ }), a.tokenize.push(d());
106
+ break;
107
+ }
108
+ if (/[@\$]/.test(i.peek())) {
109
+ a.tokenize.push(f());
110
+ break;
111
+ }
112
+ }
113
+ o = !o && s == "\\";
114
+ }
115
+ return t;
116
+ };
117
+ }
118
+ function m(e, t) {
119
+ return function(n, r) {
120
+ return t && n.eatSpace(), n.match(e) ? r.tokenize.pop() : n.skipToEnd(), "string";
121
+ };
122
+ }
123
+ function h(e, t) {
124
+ return e.sol() && e.match("=end") && e.eol() && t.tokenize.pop(), e.skipToEnd(), "comment";
125
+ }
126
+ var g = {
127
+ name: "ruby",
128
+ startState: function(e) {
129
+ return {
130
+ tokenize: [l],
131
+ indented: 0,
132
+ context: {
133
+ type: "top",
134
+ indented: -e
135
+ },
136
+ continuedLine: !1,
137
+ lastTok: null,
138
+ varList: !1
139
+ };
140
+ },
141
+ token: function(e, t) {
142
+ s = null, e.sol() && (t.indented = e.indentation());
143
+ var a = t.tokenize[t.tokenize.length - 1](e, t), o, c = s;
144
+ if (a == "variable") {
145
+ var l = e.current();
146
+ a = t.lastTok == "." ? "property" : n.propertyIsEnumerable(e.current()) ? "keyword" : /^[A-Z]/.test(l) ? "tag" : t.lastTok == "def" || t.lastTok == "class" || t.varList ? "def" : "variable", a == "keyword" && (c = l, r.propertyIsEnumerable(l) ? o = "indent" : i.propertyIsEnumerable(l) ? o = "dedent" : ((l == "if" || l == "unless") && e.column() == e.indentation() || l == "do" && t.context.indented < t.indented) && (o = "indent"));
147
+ }
148
+ return (s || a && a != "comment") && (t.lastTok = c), s == "|" && (t.varList = !t.varList), o == "indent" || /[\(\[\{]/.test(s) ? t.context = {
149
+ prev: t.context,
150
+ type: s || a,
151
+ indented: t.indented
152
+ } : (o == "dedent" || /[\)\]\}]/.test(s)) && t.context.prev && (t.context = t.context.prev), e.eol() && (t.continuedLine = s == "\\" || a == "operator"), a;
153
+ },
154
+ indent: function(e, t, n) {
155
+ if (e.tokenize[e.tokenize.length - 1] != l) return null;
156
+ var r = t && t.charAt(0), i = e.context, a = i.type == o[r] || i.type == "keyword" && /^(?:end|until|else|elsif|when|rescue)\b/.test(t);
157
+ return i.indented + (a ? 0 : n.unit) + (e.continuedLine ? n.unit : 0);
158
+ },
159
+ languageData: {
160
+ indentOnInput: /^\s*(?:end|rescue|elsif|else|\})$/,
161
+ commentTokens: { line: "#" },
162
+ autocomplete: t
163
+ }
164
+ };
165
+ //#endregion
166
+ export { g as ruby };
@@ -0,0 +1 @@
1
+ var e={};function t(t,n){for(var r=0;r<n.length;r++)e[n[r]]=t}var n=[`true`,`false`],r=[`if`,`then`,`do`,`else`,`elif`,`while`,`until`,`for`,`in`,`esac`,`fi`,`fin`,`fil`,`done`,`exit`,`set`,`unset`,`export`,`function`],i=`ab.awk.bash.beep.cat.cc.cd.chown.chmod.chroot.clear.cp.curl.cut.diff.echo.find.gawk.gcc.get.git.grep.hg.kill.killall.ln.ls.make.mkdir.openssl.mv.nc.nl.node.npm.ping.ps.restart.rm.rmdir.sed.service.sh.shopt.shred.source.sort.sleep.ssh.start.stop.su.sudo.svn.tee.telnet.top.touch.vi.vim.wall.wc.wget.who.write.yes.zsh`.split(`.`);t(`atom`,n),t(`keyword`,r),t(`builtin`,i);function a(t,n){if(t.eatSpace())return null;var r=t.sol(),i=t.next();if(i===`\\`)return t.next(),null;if(i===`'`||i===`"`||i==="`")return n.tokens.unshift(o(i,i==="`"?`quote`:`string`)),u(t,n);if(i===`#`)return r&&t.eat(`!`)?(t.skipToEnd(),`meta`):(t.skipToEnd(),`comment`);if(i===`$`)return n.tokens.unshift(c),u(t,n);if(i===`+`||i===`=`)return`operator`;if(i===`-`)return t.eat(`-`),t.eatWhile(/\w/),`attribute`;if(i==`<`){if(t.match(`<<`))return`operator`;var a=t.match(/^<-?\s*(?:['"]([^'"]*)['"]|([^'"\s]*))/);if(a)return n.tokens.unshift(l(a[1]||a[2])),`string.special`}if(/\d/.test(i)&&(t.eatWhile(/\d/),t.eol()||!/\w/.test(t.peek())))return`number`;t.eatWhile(/[\w-]/);var s=t.current();return t.peek()===`=`&&/\w+/.test(s)?`def`:e.hasOwnProperty(s)?e[s]:null}function o(e,t){var n=e==`(`?`)`:e==`{`?`}`:e;return function(r,i){for(var a,l=!1;(a=r.next())!=null;){if(a===n&&!l){i.tokens.shift();break}if(a===`$`&&!l&&e!==`'`&&r.peek()!=n){l=!0,r.backUp(1),i.tokens.unshift(c);break}if(!l&&e!==n&&a===e)return i.tokens.unshift(o(e,t)),u(r,i);if(!l&&/['"]/.test(a)&&!/['"]/.test(e)){i.tokens.unshift(s(a,`string`)),r.backUp(1);break}l=!l&&a===`\\`}return t}}function s(e,t){return function(n,r){return r.tokens[0]=o(e,t),n.next(),u(n,r)}}var c=function(e,t){t.tokens.length>1&&e.eat(`$`);var n=e.next();return/['"({]/.test(n)?(t.tokens[0]=o(n,n==`(`?`quote`:n==`{`?`def`:`string`),u(e,t)):(/\d/.test(n)||e.eatWhile(/\w/),t.tokens.shift(),`def`)};function l(e){return function(t,n){return t.sol()&&t.string==e&&n.tokens.shift(),t.skipToEnd(),`string.special`}}function u(e,t){return(t.tokens[0]||a)(e,t)}var d={name:`shell`,startState:function(){return{tokens:[]}},token:function(e,t){return u(e,t)},languageData:{autocomplete:n.concat(r,i),closeBrackets:{brackets:[`(`,`[`,`{`,`'`,`"`,"`"]},commentTokens:{line:`#`}}};exports.shell=d;
@@ -0,0 +1,109 @@
1
+ //#region ../node_modules/@codemirror/legacy-modes/mode/shell.js
2
+ var e = {};
3
+ function t(t, n) {
4
+ for (var r = 0; r < n.length; r++) e[n[r]] = t;
5
+ }
6
+ var n = ["true", "false"], r = [
7
+ "if",
8
+ "then",
9
+ "do",
10
+ "else",
11
+ "elif",
12
+ "while",
13
+ "until",
14
+ "for",
15
+ "in",
16
+ "esac",
17
+ "fi",
18
+ "fin",
19
+ "fil",
20
+ "done",
21
+ "exit",
22
+ "set",
23
+ "unset",
24
+ "export",
25
+ "function"
26
+ ], i = /* @__PURE__ */ "ab.awk.bash.beep.cat.cc.cd.chown.chmod.chroot.clear.cp.curl.cut.diff.echo.find.gawk.gcc.get.git.grep.hg.kill.killall.ln.ls.make.mkdir.openssl.mv.nc.nl.node.npm.ping.ps.restart.rm.rmdir.sed.service.sh.shopt.shred.source.sort.sleep.ssh.start.stop.su.sudo.svn.tee.telnet.top.touch.vi.vim.wall.wc.wget.who.write.yes.zsh".split(".");
27
+ t("atom", n), t("keyword", r), t("builtin", i);
28
+ function a(t, n) {
29
+ if (t.eatSpace()) return null;
30
+ var r = t.sol(), i = t.next();
31
+ if (i === "\\") return t.next(), null;
32
+ if (i === "'" || i === "\"" || i === "`") return n.tokens.unshift(o(i, i === "`" ? "quote" : "string")), u(t, n);
33
+ if (i === "#") return r && t.eat("!") ? (t.skipToEnd(), "meta") : (t.skipToEnd(), "comment");
34
+ if (i === "$") return n.tokens.unshift(c), u(t, n);
35
+ if (i === "+" || i === "=") return "operator";
36
+ if (i === "-") return t.eat("-"), t.eatWhile(/\w/), "attribute";
37
+ if (i == "<") {
38
+ if (t.match("<<")) return "operator";
39
+ var a = t.match(/^<-?\s*(?:['"]([^'"]*)['"]|([^'"\s]*))/);
40
+ if (a) return n.tokens.unshift(l(a[1] || a[2])), "string.special";
41
+ }
42
+ if (/\d/.test(i) && (t.eatWhile(/\d/), t.eol() || !/\w/.test(t.peek()))) return "number";
43
+ t.eatWhile(/[\w-]/);
44
+ var s = t.current();
45
+ return t.peek() === "=" && /\w+/.test(s) ? "def" : e.hasOwnProperty(s) ? e[s] : null;
46
+ }
47
+ function o(e, t) {
48
+ var n = e == "(" ? ")" : e == "{" ? "}" : e;
49
+ return function(r, i) {
50
+ for (var a, l = !1; (a = r.next()) != null;) {
51
+ if (a === n && !l) {
52
+ i.tokens.shift();
53
+ break;
54
+ }
55
+ if (a === "$" && !l && e !== "'" && r.peek() != n) {
56
+ l = !0, r.backUp(1), i.tokens.unshift(c);
57
+ break;
58
+ }
59
+ if (!l && e !== n && a === e) return i.tokens.unshift(o(e, t)), u(r, i);
60
+ if (!l && /['"]/.test(a) && !/['"]/.test(e)) {
61
+ i.tokens.unshift(s(a, "string")), r.backUp(1);
62
+ break;
63
+ }
64
+ l = !l && a === "\\";
65
+ }
66
+ return t;
67
+ };
68
+ }
69
+ function s(e, t) {
70
+ return function(n, r) {
71
+ return r.tokens[0] = o(e, t), n.next(), u(n, r);
72
+ };
73
+ }
74
+ var c = function(e, t) {
75
+ t.tokens.length > 1 && e.eat("$");
76
+ var n = e.next();
77
+ return /['"({]/.test(n) ? (t.tokens[0] = o(n, n == "(" ? "quote" : n == "{" ? "def" : "string"), u(e, t)) : (/\d/.test(n) || e.eatWhile(/\w/), t.tokens.shift(), "def");
78
+ };
79
+ function l(e) {
80
+ return function(t, n) {
81
+ return t.sol() && t.string == e && n.tokens.shift(), t.skipToEnd(), "string.special";
82
+ };
83
+ }
84
+ function u(e, t) {
85
+ return (t.tokens[0] || a)(e, t);
86
+ }
87
+ var d = {
88
+ name: "shell",
89
+ startState: function() {
90
+ return { tokens: [] };
91
+ },
92
+ token: function(e, t) {
93
+ return u(e, t);
94
+ },
95
+ languageData: {
96
+ autocomplete: n.concat(r, i),
97
+ closeBrackets: { brackets: [
98
+ "(",
99
+ "[",
100
+ "{",
101
+ "'",
102
+ "\"",
103
+ "`"
104
+ ] },
105
+ commentTokens: { line: "#" }
106
+ }
107
+ };
108
+ //#endregion
109
+ export { d as shell };
@@ -0,0 +1,28 @@
1
+ //#region ../node_modules/@codemirror/legacy-modes/mode/toml.js
2
+ var e = {
3
+ name: "toml",
4
+ startState: function() {
5
+ return {
6
+ inString: !1,
7
+ stringType: "",
8
+ lhs: !0,
9
+ inArray: 0
10
+ };
11
+ },
12
+ token: function(e, t) {
13
+ let n;
14
+ if (!t.inString && (n = e.match(/^('''|"""|'|")/)) && (t.stringType = n[0], t.inString = !0), e.sol() && !t.inString && t.inArray === 0 && (t.lhs = !0), t.inString) {
15
+ for (; t.inString;) if (e.match(t.stringType)) t.inString = !1;
16
+ else if (e.peek() === "\\") e.next(), e.next();
17
+ else if (e.eol()) break;
18
+ else e.match(/^.[^\\\"\']*/);
19
+ return t.lhs ? "property" : "string";
20
+ }
21
+ return t.inArray && e.peek() === "]" ? (e.next(), t.inArray--, "bracket") : t.lhs && e.peek() === "[" && e.skipTo("]") ? (e.next(), e.peek() === "]" && e.next(), "atom") : e.peek() === "#" ? (e.skipToEnd(), "comment") : e.eatSpace() ? null : t.lhs && e.eatWhile(function(e) {
22
+ return e != "=" && e != " ";
23
+ }) ? "property" : t.lhs && e.peek() === "=" ? (e.next(), t.lhs = !1, null) : !t.lhs && e.match(/^\d\d\d\d[\d\-\:\.T]*Z/) || !t.lhs && (e.match("true") || e.match("false")) ? "atom" : !t.lhs && e.peek() === "[" ? (t.inArray++, e.next(), "bracket") : !t.lhs && e.match(/^\-?\d+(?:\.\d+)?/) ? "number" : (e.eatSpace() || e.next(), null);
24
+ },
25
+ languageData: { commentTokens: { line: "#" } }
26
+ };
27
+ //#endregion
28
+ export { e as toml };
@@ -0,0 +1 @@
1
+ var e={name:`toml`,startState:function(){return{inString:!1,stringType:``,lhs:!0,inArray:0}},token:function(e,t){let n;if(!t.inString&&(n=e.match(/^('''|"""|'|")/))&&(t.stringType=n[0],t.inString=!0),e.sol()&&!t.inString&&t.inArray===0&&(t.lhs=!0),t.inString){for(;t.inString;)if(e.match(t.stringType))t.inString=!1;else if(e.peek()===`\\`)e.next(),e.next();else if(e.eol())break;else e.match(/^.[^\\\"\']*/);return t.lhs?`property`:`string`}return t.inArray&&e.peek()===`]`?(e.next(),t.inArray--,`bracket`):t.lhs&&e.peek()===`[`&&e.skipTo(`]`)?(e.next(),e.peek()===`]`&&e.next(),`atom`):e.peek()===`#`?(e.skipToEnd(),`comment`):e.eatSpace()?null:t.lhs&&e.eatWhile(function(e){return e!=`=`&&e!=` `})?`property`:t.lhs&&e.peek()===`=`?(e.next(),t.lhs=!1,null):!t.lhs&&e.match(/^\d\d\d\d[\d\-\:\.T]*Z/)||!t.lhs&&(e.match(`true`)||e.match(`false`))?`atom`:!t.lhs&&e.peek()===`[`?(t.inArray++,e.next(),`bracket`):!t.lhs&&e.match(/^\-?\d+(?:\.\d+)?/)?`number`:(e.eatSpace()||e.next(),null)},languageData:{commentTokens:{line:`#`}}};exports.toml=e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-outpost/embed",
3
- "version": "0.35.2",
3
+ "version": "0.37.0",
4
4
  "type": "module",
5
5
  "description": "Mount pi-outpost as a Shadow-DOM-isolated widget inside another web app.",
6
6
  "license": "MIT",
@@ -1,268 +0,0 @@
1
- import { g as e } from "./lib-BgQYQRfw.js";
2
- import { a as t, n, s as r } from "./workspacePath-Dzahj9-k.js";
3
- //#region ../ui/src/export/mermaidToImage.ts
4
- var i = class extends Error {
5
- constructor(e) {
6
- super(e), this.name = "DiagramError";
7
- }
8
- };
9
- function a(e) {
10
- let t = /viewBox="\s*[\d.-]+[\s,]+[\d.-]+[\s,]+([\d.]+)[\s,]+([\d.]+)/.exec(e), n = t ? Number(t[1]) : NaN, r = t ? Number(t[2]) : NaN;
11
- if (!Number.isFinite(n) || !Number.isFinite(r) || n <= 0 || r <= 0) throw new i("diagram has no usable viewBox");
12
- return {
13
- width: n,
14
- height: r
15
- };
16
- }
17
- function o(e, t, n) {
18
- let r = /^[\s\S]*?<svg\b[^>]*>/.exec(e);
19
- return r === null ? e : r[0].replace(/\swidth="[^"]*"/, "").replace(/\sheight="[^"]*"/, "").replace(/\sstyle="[^"]*"/, (e) => {
20
- let t = e.replace(/max-width:[^;"]*;?/, "");
21
- return /style="\s*"/.test(t) ? "" : t;
22
- }).replace(/>$/, ` width="${t}" height="${n}">`) + e.slice(r[0].length);
23
- }
24
- var s = [
25
- "fill",
26
- "fill-opacity",
27
- "stroke",
28
- "stroke-width",
29
- "stroke-opacity",
30
- "stroke-dasharray",
31
- "stroke-linecap",
32
- "stroke-linejoin",
33
- "opacity",
34
- "font-family",
35
- "font-size",
36
- "font-weight",
37
- "font-style",
38
- "text-anchor",
39
- "dominant-baseline"
40
- ];
41
- function c(e) {
42
- let t = document.createElement("div");
43
- t.setAttribute("style", "position:absolute;left:-10000px;top:0;width:0;height:0;overflow:hidden"), t.innerHTML = e;
44
- let n = t.querySelector("svg");
45
- if (n === null) return e;
46
- document.body.append(t);
47
- try {
48
- let e = [n, ...n.querySelectorAll("*")].filter((e) => e.tagName.toLowerCase() !== "style").map((e) => {
49
- let t = window.getComputedStyle(e), n = [];
50
- for (let e of s) {
51
- let r = t.getPropertyValue(e);
52
- r !== "" && n.push([e, r]);
53
- }
54
- return {
55
- element: e,
56
- painted: n
57
- };
58
- });
59
- for (let { element: t, painted: n } of e) {
60
- for (let [e, r] of n) t.setAttribute(e, r);
61
- t.removeAttribute("style"), t.removeAttribute("class");
62
- }
63
- for (let e of [...n.querySelectorAll("style")]) e.remove();
64
- return n.outerHTML;
65
- } finally {
66
- t.remove();
67
- }
68
- }
69
- async function l(t, n) {
70
- return e(async () => {
71
- let e = (await import("./mermaid.core-BJkDCzqA.js").then((e) => e.t)).default, r;
72
- try {
73
- e.initialize({
74
- startOnLoad: !1,
75
- theme: "default",
76
- look: "classic",
77
- securityLevel: "strict",
78
- suppressErrorRendering: !0,
79
- flowchart: { htmlLabels: !1 },
80
- htmlLabels: !1
81
- }), {svg: r} = await e.render(n, t);
82
- } catch (e) {
83
- throw new i(`mermaid could not render the diagram: ${String(e)}`);
84
- } finally {
85
- e.initialize({
86
- startOnLoad: !1,
87
- look: "classic",
88
- securityLevel: "strict",
89
- suppressErrorRendering: !0
90
- });
91
- }
92
- let { width: s, height: l } = a(r), u = o(r, s, l), f = await d(u, s, l);
93
- return {
94
- svg: c(u),
95
- png: f,
96
- width: s,
97
- height: l
98
- };
99
- });
100
- }
101
- var u = 2;
102
- async function d(e, t, n) {
103
- let r = document.createElement("canvas");
104
- r.width = Math.max(1, Math.round(t * u)), r.height = Math.max(1, Math.round(n * u));
105
- let a = r.getContext("2d");
106
- if (a === null) throw new i("no 2d canvas context for the fallback image");
107
- let o = URL.createObjectURL(new Blob([e], { type: "image/svg+xml;charset=utf-8" }));
108
- try {
109
- let e = await f(o);
110
- return a.fillStyle = "#ffffff", a.fillRect(0, 0, r.width, r.height), a.drawImage(e, 0, 0, r.width, r.height), await p(r);
111
- } finally {
112
- URL.revokeObjectURL(o);
113
- }
114
- }
115
- function f(e) {
116
- return new Promise((t, n) => {
117
- let r = new Image();
118
- r.onload = () => t(r), r.onerror = () => n(new i("the browser would not draw the diagram")), r.src = e;
119
- });
120
- }
121
- async function p(e) {
122
- let t = await new Promise((t) => e.toBlob(t, "image/png"));
123
- if (t === null) throw new i("the canvas produced no image");
124
- return new Uint8Array(await t.arrayBuffer());
125
- }
126
- //#endregion
127
- //#region ../ui/src/export/loadReferencedImage.ts
128
- function m(e) {
129
- return e !== "" && !n(e);
130
- }
131
- function h(e, n, i, a, o) {
132
- if (m(n)) return t(i, r(e, n), a, void 0, o);
133
- }
134
- async function g(e, t, n, r, i) {
135
- let a = h(e, t, n, r, i);
136
- if (a !== void 0) try {
137
- let e = await fetch(a);
138
- return e.ok ? await _(new Uint8Array(await e.arrayBuffer())) : void 0;
139
- } catch {
140
- return;
141
- }
142
- }
143
- async function _(e) {
144
- if (v(e)) return y(new TextDecoder().decode(e));
145
- let t = S(e);
146
- return t === void 0 ? void 0 : {
147
- kind: "raster",
148
- ...t,
149
- bytes: e
150
- };
151
- }
152
- function v(e) {
153
- return new TextDecoder().decode(e.subarray(0, 512)).toLowerCase().includes("<svg");
154
- }
155
- async function y(e) {
156
- try {
157
- let { width: t, height: n } = b(e), r = o(e, t, n), i = await d(r, t, n);
158
- return {
159
- kind: "vector",
160
- image: {
161
- svg: c(r),
162
- png: i,
163
- width: t,
164
- height: n
165
- }
166
- };
167
- } catch {
168
- return;
169
- }
170
- }
171
- function b(e) {
172
- try {
173
- return a(e);
174
- } catch {
175
- let t = /<svg\b[^>]*>/.exec(e), n = x(t?.[0] ?? "", "width"), r = x(t?.[0] ?? "", "height");
176
- if (n === void 0 || r === void 0) throw new i("the referenced svg states no size");
177
- return {
178
- width: n,
179
- height: r
180
- };
181
- }
182
- }
183
- function x(e, t) {
184
- let n = RegExp(`\\s${t}="([^"]*)"`).exec(e)?.[1];
185
- if (n === void 0) return;
186
- let r = Number.parseFloat(n.replace(/px$/i, ""));
187
- return Number.isFinite(r) && r > 0 && !n.includes("%") ? r : void 0;
188
- }
189
- function S(e) {
190
- return D(e) ?? O(e) ?? k(e) ?? j(e);
191
- }
192
- function C(e, t) {
193
- return (e[t] << 24 | e[t + 1] << 16 | e[t + 2] << 8 | e[t + 3]) >>> 0;
194
- }
195
- function w(e, t) {
196
- return e[t] | e[t + 1] << 8;
197
- }
198
- function T(e, t) {
199
- return e[t] | e[t + 1] << 8 | e[t + 2] << 16 | e[t + 3] << 24 | 0;
200
- }
201
- var E = [
202
- 137,
203
- 80,
204
- 78,
205
- 71,
206
- 13,
207
- 10,
208
- 26,
209
- 10
210
- ];
211
- function D(e) {
212
- if (!(e.length < 24) && E.every((t, n) => e[n] === t)) return M("png", C(e, 16), C(e, 20));
213
- }
214
- function O(e) {
215
- if (e.length < 10) return;
216
- let t = String.fromCharCode(...e.subarray(0, 6));
217
- if (t === "GIF87a" || t === "GIF89a") return M("gif", w(e, 6), w(e, 8));
218
- }
219
- function k(e) {
220
- if (!(e.length < 26 || e[0] !== 66 || e[1] !== 77)) return M("bmp", Math.abs(T(e, 18)), Math.abs(T(e, 22)));
221
- }
222
- var A = /* @__PURE__ */ new Set([
223
- 192,
224
- 193,
225
- 194,
226
- 195,
227
- 197,
228
- 198,
229
- 199,
230
- 201,
231
- 202,
232
- 203,
233
- 205,
234
- 206,
235
- 207
236
- ]);
237
- function j(e) {
238
- if (e.length < 4 || e[0] !== 255 || e[1] !== 216) return;
239
- let t = 2;
240
- for (; t + 9 < e.length;) {
241
- if (e[t] !== 255) {
242
- t += 1;
243
- continue;
244
- }
245
- let n = e[t + 1];
246
- if (n === 255) {
247
- t += 1;
248
- continue;
249
- }
250
- if (n === 216 || n === 1 || n >= 208 && n <= 215) {
251
- t += 2;
252
- continue;
253
- }
254
- if (A.has(n)) return M("jpg", e[t + 7] << 8 | e[t + 8], e[t + 5] << 8 | e[t + 6]);
255
- let r = e[t + 2] << 8 | e[t + 3];
256
- if (r < 2) return;
257
- t += 2 + r;
258
- }
259
- }
260
- function M(e, t, n) {
261
- return t > 0 && n > 0 ? {
262
- type: e,
263
- width: t,
264
- height: n
265
- } : void 0;
266
- }
267
- //#endregion
268
- export { a, l as i, h as n, o, c as r, g as t };
@@ -1 +0,0 @@
1
- const e=require("./lib-DVuUFI8o.cjs"),t=require("./workspacePath-D0C-ViGF.cjs");var n=class extends Error{constructor(e){super(e),this.name=`DiagramError`}};function r(e){let t=/viewBox="\s*[\d.-]+[\s,]+[\d.-]+[\s,]+([\d.]+)[\s,]+([\d.]+)/.exec(e),r=t?Number(t[1]):NaN,i=t?Number(t[2]):NaN;if(!Number.isFinite(r)||!Number.isFinite(i)||r<=0||i<=0)throw new n(`diagram has no usable viewBox`);return{width:r,height:i}}function i(e,t,n){let r=/^[\s\S]*?<svg\b[^>]*>/.exec(e);return r===null?e:r[0].replace(/\swidth="[^"]*"/,``).replace(/\sheight="[^"]*"/,``).replace(/\sstyle="[^"]*"/,e=>{let t=e.replace(/max-width:[^;"]*;?/,``);return/style="\s*"/.test(t)?``:t}).replace(/>$/,` width="${t}" height="${n}">`)+e.slice(r[0].length)}var a=[`fill`,`fill-opacity`,`stroke`,`stroke-width`,`stroke-opacity`,`stroke-dasharray`,`stroke-linecap`,`stroke-linejoin`,`opacity`,`font-family`,`font-size`,`font-weight`,`font-style`,`text-anchor`,`dominant-baseline`];function o(e){let t=document.createElement(`div`);t.setAttribute(`style`,`position:absolute;left:-10000px;top:0;width:0;height:0;overflow:hidden`),t.innerHTML=e;let n=t.querySelector(`svg`);if(n===null)return e;document.body.append(t);try{let e=[n,...n.querySelectorAll(`*`)].filter(e=>e.tagName.toLowerCase()!==`style`).map(e=>{let t=window.getComputedStyle(e),n=[];for(let e of a){let r=t.getPropertyValue(e);r!==``&&n.push([e,r])}return{element:e,painted:n}});for(let{element:t,painted:n}of e){for(let[e,r]of n)t.setAttribute(e,r);t.removeAttribute(`style`),t.removeAttribute(`class`)}for(let e of[...n.querySelectorAll(`style`)])e.remove();return n.outerHTML}finally{t.remove()}}async function s(t,a){return e.g(async()=>{let e=(await Promise.resolve().then(()=>require("./mermaid.core-4MZ-Iwu7.cjs")).then(e=>e.t)).default,s;try{e.initialize({startOnLoad:!1,theme:`default`,look:`classic`,securityLevel:`strict`,suppressErrorRendering:!0,flowchart:{htmlLabels:!1},htmlLabels:!1}),{svg:s}=await e.render(a,t)}catch(e){throw new n(`mermaid could not render the diagram: ${String(e)}`)}finally{e.initialize({startOnLoad:!1,look:`classic`,securityLevel:`strict`,suppressErrorRendering:!0})}let{width:c,height:u}=r(s),d=i(s,c,u),f=await l(d,c,u);return{svg:o(d),png:f,width:c,height:u}})}var c=2;async function l(e,t,r){let i=document.createElement(`canvas`);i.width=Math.max(1,Math.round(t*c)),i.height=Math.max(1,Math.round(r*c));let a=i.getContext(`2d`);if(a===null)throw new n(`no 2d canvas context for the fallback image`);let o=URL.createObjectURL(new Blob([e],{type:`image/svg+xml;charset=utf-8`}));try{let e=await u(o);return a.fillStyle=`#ffffff`,a.fillRect(0,0,i.width,i.height),a.drawImage(e,0,0,i.width,i.height),await d(i)}finally{URL.revokeObjectURL(o)}}function u(e){return new Promise((t,r)=>{let i=new Image;i.onload=()=>t(i),i.onerror=()=>r(new n(`the browser would not draw the diagram`)),i.src=e})}async function d(e){let t=await new Promise(t=>e.toBlob(t,`image/png`));if(t===null)throw new n(`the canvas produced no image`);return new Uint8Array(await t.arrayBuffer())}function f(e){return e!==``&&!t.n(e)}function p(e,n,r,i,a){if(f(n))return t.a(r,t.s(e,n),i,void 0,a)}async function m(e,t,n,r,i){let a=p(e,t,n,r,i);if(a!==void 0)try{let e=await fetch(a);return e.ok?await h(new Uint8Array(await e.arrayBuffer())):void 0}catch{return}}async function h(e){if(g(e))return _(new TextDecoder().decode(e));let t=b(e);return t===void 0?void 0:{kind:`raster`,...t,bytes:e}}function g(e){return new TextDecoder().decode(e.subarray(0,512)).toLowerCase().includes(`<svg`)}async function _(e){try{let{width:t,height:n}=v(e),r=i(e,t,n),a=await l(r,t,n);return{kind:`vector`,image:{svg:o(r),png:a,width:t,height:n}}}catch{return}}function v(e){try{return r(e)}catch{let t=/<svg\b[^>]*>/.exec(e),r=y(t?.[0]??``,`width`),i=y(t?.[0]??``,`height`);if(r===void 0||i===void 0)throw new n(`the referenced svg states no size`);return{width:r,height:i}}}function y(e,t){let n=RegExp(`\\s${t}="([^"]*)"`).exec(e)?.[1];if(n===void 0)return;let r=Number.parseFloat(n.replace(/px$/i,``));return Number.isFinite(r)&&r>0&&!n.includes(`%`)?r:void 0}function b(e){return T(e)??E(e)??D(e)??k(e)}function x(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function S(e,t){return e[t]|e[t+1]<<8}function C(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24|0}var w=[137,80,78,71,13,10,26,10];function T(e){if(!(e.length<24)&&w.every((t,n)=>e[n]===t))return A(`png`,x(e,16),x(e,20))}function E(e){if(e.length<10)return;let t=String.fromCharCode(...e.subarray(0,6));if(t===`GIF87a`||t===`GIF89a`)return A(`gif`,S(e,6),S(e,8))}function D(e){if(!(e.length<26||e[0]!==66||e[1]!==77))return A(`bmp`,Math.abs(C(e,18)),Math.abs(C(e,22)))}var O=new Set([192,193,194,195,197,198,199,201,202,203,205,206,207]);function k(e){if(e.length<4||e[0]!==255||e[1]!==216)return;let t=2;for(;t+9<e.length;){if(e[t]!==255){t+=1;continue}let n=e[t+1];if(n===255){t+=1;continue}if(n===216||n===1||n>=208&&n<=215){t+=2;continue}if(O.has(n))return A(`jpg`,e[t+7]<<8|e[t+8],e[t+5]<<8|e[t+6]);let r=e[t+2]<<8|e[t+3];if(r<2)return;t+=2+r}}function A(e,t,n){return t>0&&n>0?{type:e,width:t,height:n}:void 0}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return m}});