@arach/arc 0.4.5 → 0.6.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.
@@ -0,0 +1,959 @@
1
+ import { L as Se, E as v, C as be } from "./index-CVhUGF67.js";
2
+ import { p as he, s as Te, t as S } from "./index-CvsZLy9v.js";
3
+ import { cssLanguage as H, css as Pe } from "./index-BtUi_w1W.js";
4
+ import { t as xe, j as Ve, a as ye, b as A, c as we } from "./index-Ds2bIH9V.js";
5
+ import { E as ve } from "./index-CnGsbmkP.js";
6
+ import { EditorSelection as Xe } from "./index-CI-w1U9t.js";
7
+ import { LRLanguage as $e, syntaxTree as K, LanguageSupport as qe, indentNodeProp as _e, foldNodeProp as Ce, bracketMatchingHandle as ke } from "./index-DBTOQDAV.js";
8
+ const Qe = 55, Ae = 1, Ye = 56, Me = 2, Re = 57, Ee = 3, B = 4, Ze = 5, Y = 6, J = 7, ee = 8, te = 9, ae = 10, Be = 11, ze = 12, De = 13, X = 58, We = 14, Ne = 15, z = 59, le = 21, Ge = 23, re = 24, Ie = 25, k = 27, ne = 28, je = 29, Ue = 32, Le = 35, Fe = 37, He = 38, Ke = 0, Je = 1, et = {
9
+ area: !0,
10
+ base: !0,
11
+ br: !0,
12
+ col: !0,
13
+ command: !0,
14
+ embed: !0,
15
+ frame: !0,
16
+ hr: !0,
17
+ img: !0,
18
+ input: !0,
19
+ keygen: !0,
20
+ link: !0,
21
+ meta: !0,
22
+ param: !0,
23
+ source: !0,
24
+ track: !0,
25
+ wbr: !0,
26
+ menuitem: !0
27
+ }, tt = {
28
+ dd: !0,
29
+ li: !0,
30
+ optgroup: !0,
31
+ option: !0,
32
+ p: !0,
33
+ rp: !0,
34
+ rt: !0,
35
+ tbody: !0,
36
+ td: !0,
37
+ tfoot: !0,
38
+ th: !0,
39
+ tr: !0
40
+ }, D = {
41
+ dd: { dd: !0, dt: !0 },
42
+ dt: { dd: !0, dt: !0 },
43
+ li: { li: !0 },
44
+ option: { option: !0, optgroup: !0 },
45
+ optgroup: { optgroup: !0 },
46
+ p: {
47
+ address: !0,
48
+ article: !0,
49
+ aside: !0,
50
+ blockquote: !0,
51
+ dir: !0,
52
+ div: !0,
53
+ dl: !0,
54
+ fieldset: !0,
55
+ footer: !0,
56
+ form: !0,
57
+ h1: !0,
58
+ h2: !0,
59
+ h3: !0,
60
+ h4: !0,
61
+ h5: !0,
62
+ h6: !0,
63
+ header: !0,
64
+ hgroup: !0,
65
+ hr: !0,
66
+ menu: !0,
67
+ nav: !0,
68
+ ol: !0,
69
+ p: !0,
70
+ pre: !0,
71
+ section: !0,
72
+ table: !0,
73
+ ul: !0
74
+ },
75
+ rp: { rp: !0, rt: !0 },
76
+ rt: { rp: !0, rt: !0 },
77
+ tbody: { tbody: !0, tfoot: !0 },
78
+ td: { td: !0, th: !0 },
79
+ tfoot: { tbody: !0 },
80
+ th: { td: !0, th: !0 },
81
+ thead: { tbody: !0, tfoot: !0 },
82
+ tr: { tr: !0 }
83
+ };
84
+ function at(e) {
85
+ return e == 45 || e == 46 || e == 58 || e >= 65 && e <= 90 || e == 95 || e >= 97 && e <= 122 || e >= 161;
86
+ }
87
+ let W = null, N = null, G = 0;
88
+ function Q(e, a) {
89
+ let r = e.pos + a;
90
+ if (G == r && N == e) return W;
91
+ let l = e.peek(a), t = "";
92
+ for (; at(l); )
93
+ t += String.fromCharCode(l), l = e.peek(++a);
94
+ return N = e, G = r, W = t ? t.toLowerCase() : l == lt || l == rt ? void 0 : null;
95
+ }
96
+ const se = 60, w = 62, M = 47, lt = 63, rt = 33, nt = 45;
97
+ function I(e, a) {
98
+ this.name = e, this.parent = a;
99
+ }
100
+ const st = [Y, ae, J, ee, te], ot = new be({
101
+ start: null,
102
+ shift(e, a, r, l) {
103
+ return st.indexOf(a) > -1 ? new I(Q(l, 1) || "", e) : e;
104
+ },
105
+ reduce(e, a) {
106
+ return a == le && e ? e.parent : e;
107
+ },
108
+ reuse(e, a, r, l) {
109
+ let t = a.type.id;
110
+ return t == Y || t == Fe ? new I(Q(l, 1) || "", e) : e;
111
+ },
112
+ strict: !1
113
+ }), it = new v((e, a) => {
114
+ if (e.next != se) {
115
+ e.next < 0 && a.context && e.acceptToken(X);
116
+ return;
117
+ }
118
+ e.advance();
119
+ let r = e.next == M;
120
+ r && e.advance();
121
+ let l = Q(e, 0);
122
+ if (l === void 0) return;
123
+ if (!l) return e.acceptToken(r ? Ne : We);
124
+ let t = a.context ? a.context.name : null;
125
+ if (r) {
126
+ if (l == t) return e.acceptToken(Be);
127
+ if (t && tt[t]) return e.acceptToken(X, -2);
128
+ if (a.dialectEnabled(Ke)) return e.acceptToken(ze);
129
+ for (let s = a.context; s; s = s.parent) if (s.name == l) return;
130
+ e.acceptToken(De);
131
+ } else {
132
+ if (l == "script") return e.acceptToken(J);
133
+ if (l == "style") return e.acceptToken(ee);
134
+ if (l == "textarea") return e.acceptToken(te);
135
+ if (et.hasOwnProperty(l)) return e.acceptToken(ae);
136
+ t && D[t] && D[t][l] ? e.acceptToken(X, -1) : e.acceptToken(Y);
137
+ }
138
+ }, { contextual: !0 }), ut = new v((e) => {
139
+ for (let a = 0, r = 0; ; r++) {
140
+ if (e.next < 0) {
141
+ r && e.acceptToken(z);
142
+ break;
143
+ }
144
+ if (e.next == nt)
145
+ a++;
146
+ else if (e.next == w && a >= 2) {
147
+ r >= 3 && e.acceptToken(z, -2);
148
+ break;
149
+ } else
150
+ a = 0;
151
+ e.advance();
152
+ }
153
+ });
154
+ function Ot(e) {
155
+ for (; e; e = e.parent)
156
+ if (e.name == "svg" || e.name == "math") return !0;
157
+ return !1;
158
+ }
159
+ const dt = new v((e, a) => {
160
+ if (e.next == M && e.peek(1) == w) {
161
+ let r = a.dialectEnabled(Je) || Ot(a.context);
162
+ e.acceptToken(r ? Ze : B, 2);
163
+ } else e.next == w && e.acceptToken(B, 1);
164
+ });
165
+ function R(e, a, r) {
166
+ let l = 2 + e.length;
167
+ return new v((t) => {
168
+ for (let s = 0, o = 0, i = 0; ; i++) {
169
+ if (t.next < 0) {
170
+ i && t.acceptToken(a);
171
+ break;
172
+ }
173
+ if (s == 0 && t.next == se || s == 1 && t.next == M || s >= 2 && s < l && t.next == e.charCodeAt(s - 2))
174
+ s++, o++;
175
+ else if (s == l && t.next == w) {
176
+ i > o ? t.acceptToken(a, -o) : t.acceptToken(r, -(o - 2));
177
+ break;
178
+ } else if ((t.next == 10 || t.next == 13) && i) {
179
+ t.acceptToken(a, 1);
180
+ break;
181
+ } else
182
+ s = o = 0;
183
+ t.advance();
184
+ }
185
+ });
186
+ }
187
+ const ct = R("script", Qe, Ae), pt = R("style", Ye, Me), mt = R("textarea", Re, Ee), ft = Te({
188
+ "Text RawText IncompleteTag IncompleteCloseTag": S.content,
189
+ "StartTag StartCloseTag SelfClosingEndTag EndTag": S.angleBracket,
190
+ TagName: S.tagName,
191
+ "MismatchedCloseTag/TagName": [S.tagName, S.invalid],
192
+ AttributeName: S.attributeName,
193
+ "AttributeValue UnquotedAttributeValue": S.attributeValue,
194
+ Is: S.definitionOperator,
195
+ "EntityReference CharacterReference": S.character,
196
+ Comment: S.blockComment,
197
+ ProcessingInst: S.processingInstruction,
198
+ DoctypeDecl: S.documentMeta
199
+ }), gt = Se.deserialize({
200
+ version: 14,
201
+ states: ",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ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P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",
203
+ goto: "%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",
204
+ nodeNames: "⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",
205
+ maxTerm: 68,
206
+ context: ot,
207
+ nodeProps: [
208
+ ["closedBy", -10, 1, 2, 3, 7, 8, 9, 10, 11, 12, 13, "EndTag", 6, "EndTag SelfClosingEndTag", -4, 22, 31, 34, 37, "CloseTag"],
209
+ ["openedBy", 4, "StartTag StartCloseTag", 5, "StartTag", -4, 30, 33, 36, 38, "OpenTag"],
210
+ ["group", -10, 14, 15, 18, 19, 20, 21, 40, 41, 42, 43, "Entity", 17, "Entity TextContent", -3, 29, 32, 35, "TextContent Entity"],
211
+ ["isolate", -11, 22, 30, 31, 33, 34, 36, 37, 38, 39, 42, 43, "ltr", -3, 27, 28, 40, ""]
212
+ ],
213
+ propSources: [ft],
214
+ skippedNodes: [0],
215
+ repeatNodeCount: 9,
216
+ tokenData: "!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({WaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!b`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!b`!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6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",
217
+ tokenizers: [ct, pt, mt, dt, it, ut, 0, 1, 2, 3, 4, 5],
218
+ topRules: { Document: [0, 16] },
219
+ dialects: { noMatch: 0, selfClosing: 515 },
220
+ tokenPrec: 517
221
+ });
222
+ function oe(e, a) {
223
+ let r = /* @__PURE__ */ Object.create(null);
224
+ for (let l of e.getChildren(re)) {
225
+ let t = l.getChild(Ie), s = l.getChild(k) || l.getChild(ne);
226
+ t && (r[a.read(t.from, t.to)] = s ? s.type.id == k ? a.read(s.from + 1, s.to - 1) : a.read(s.from, s.to) : "");
227
+ }
228
+ return r;
229
+ }
230
+ function j(e, a) {
231
+ let r = e.getChild(Ge);
232
+ return r ? a.read(r.from, r.to) : " ";
233
+ }
234
+ function $(e, a, r) {
235
+ let l;
236
+ for (let t of r)
237
+ if (!t.attrs || t.attrs(l || (l = oe(e.node.parent.firstChild, a))))
238
+ return { parser: t.parser, bracketed: !0 };
239
+ return null;
240
+ }
241
+ function ie(e = [], a = []) {
242
+ let r = [], l = [], t = [], s = [];
243
+ for (let i of e)
244
+ (i.tag == "script" ? r : i.tag == "style" ? l : i.tag == "textarea" ? t : s).push(i);
245
+ let o = a.length ? /* @__PURE__ */ Object.create(null) : null;
246
+ for (let i of a) (o[i.name] || (o[i.name] = [])).push(i);
247
+ return he((i, O) => {
248
+ let f = i.type.id;
249
+ if (f == je) return $(i, O, r);
250
+ if (f == Ue) return $(i, O, l);
251
+ if (f == Le) return $(i, O, t);
252
+ if (f == le && s.length) {
253
+ let m = i.node, u = m.firstChild, c = u && j(u, O), p;
254
+ if (c) {
255
+ for (let d of s)
256
+ if (d.tag == c && (!d.attrs || d.attrs(p || (p = oe(u, O))))) {
257
+ let h = m.lastChild, b = h.type.id == He ? h.from : m.to;
258
+ if (b > u.to)
259
+ return { parser: d.parser, overlay: [{ from: u.to, to: b }] };
260
+ }
261
+ }
262
+ }
263
+ if (o && f == re) {
264
+ let m = i.node, u;
265
+ if (u = m.firstChild) {
266
+ let c = o[O.read(u.from, u.to)];
267
+ if (c) for (let p of c) {
268
+ if (p.tagName && p.tagName != j(m.parent, O)) continue;
269
+ let d = m.lastChild;
270
+ if (d.type.id == k) {
271
+ let h = d.from + 1, b = d.lastChild, Z = d.to - (b && b.isError ? 0 : 1);
272
+ if (Z > h) return { parser: p.parser, overlay: [{ from: h, to: Z }], bracketed: !0 };
273
+ } else if (d.type.id == ne)
274
+ return { parser: p.parser, overlay: [{ from: d.from, to: d.to }] };
275
+ }
276
+ }
277
+ }
278
+ return null;
279
+ });
280
+ }
281
+ const x = ["_blank", "_self", "_top", "_parent"], q = ["ascii", "utf-8", "utf-16", "latin1", "latin1"], _ = ["get", "post", "put", "delete"], C = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"], g = ["true", "false"], n = {}, St = {
282
+ a: {
283
+ attrs: {
284
+ href: null,
285
+ ping: null,
286
+ type: null,
287
+ media: null,
288
+ target: x,
289
+ hreflang: null
290
+ }
291
+ },
292
+ abbr: n,
293
+ address: n,
294
+ area: {
295
+ attrs: {
296
+ alt: null,
297
+ coords: null,
298
+ href: null,
299
+ target: null,
300
+ ping: null,
301
+ media: null,
302
+ hreflang: null,
303
+ type: null,
304
+ shape: ["default", "rect", "circle", "poly"]
305
+ }
306
+ },
307
+ article: n,
308
+ aside: n,
309
+ audio: {
310
+ attrs: {
311
+ src: null,
312
+ mediagroup: null,
313
+ crossorigin: ["anonymous", "use-credentials"],
314
+ preload: ["none", "metadata", "auto"],
315
+ autoplay: ["autoplay"],
316
+ loop: ["loop"],
317
+ controls: ["controls"]
318
+ }
319
+ },
320
+ b: n,
321
+ base: { attrs: { href: null, target: x } },
322
+ bdi: n,
323
+ bdo: n,
324
+ blockquote: { attrs: { cite: null } },
325
+ body: n,
326
+ br: n,
327
+ button: {
328
+ attrs: {
329
+ form: null,
330
+ formaction: null,
331
+ name: null,
332
+ value: null,
333
+ autofocus: ["autofocus"],
334
+ disabled: ["autofocus"],
335
+ formenctype: C,
336
+ formmethod: _,
337
+ formnovalidate: ["novalidate"],
338
+ formtarget: x,
339
+ type: ["submit", "reset", "button"]
340
+ }
341
+ },
342
+ canvas: { attrs: { width: null, height: null } },
343
+ caption: n,
344
+ center: n,
345
+ cite: n,
346
+ code: n,
347
+ col: { attrs: { span: null } },
348
+ colgroup: { attrs: { span: null } },
349
+ command: {
350
+ attrs: {
351
+ type: ["command", "checkbox", "radio"],
352
+ label: null,
353
+ icon: null,
354
+ radiogroup: null,
355
+ command: null,
356
+ title: null,
357
+ disabled: ["disabled"],
358
+ checked: ["checked"]
359
+ }
360
+ },
361
+ data: { attrs: { value: null } },
362
+ datagrid: { attrs: { disabled: ["disabled"], multiple: ["multiple"] } },
363
+ datalist: { attrs: { data: null } },
364
+ dd: n,
365
+ del: { attrs: { cite: null, datetime: null } },
366
+ details: { attrs: { open: ["open"] } },
367
+ dfn: n,
368
+ div: n,
369
+ dl: n,
370
+ dt: n,
371
+ em: n,
372
+ embed: { attrs: { src: null, type: null, width: null, height: null } },
373
+ eventsource: { attrs: { src: null } },
374
+ fieldset: { attrs: { disabled: ["disabled"], form: null, name: null } },
375
+ figcaption: n,
376
+ figure: n,
377
+ footer: n,
378
+ form: {
379
+ attrs: {
380
+ action: null,
381
+ name: null,
382
+ "accept-charset": q,
383
+ autocomplete: ["on", "off"],
384
+ enctype: C,
385
+ method: _,
386
+ novalidate: ["novalidate"],
387
+ target: x
388
+ }
389
+ },
390
+ h1: n,
391
+ h2: n,
392
+ h3: n,
393
+ h4: n,
394
+ h5: n,
395
+ h6: n,
396
+ head: {
397
+ children: ["title", "base", "link", "style", "meta", "script", "noscript", "command"]
398
+ },
399
+ header: n,
400
+ hgroup: n,
401
+ hr: n,
402
+ html: {
403
+ attrs: { manifest: null }
404
+ },
405
+ i: n,
406
+ iframe: {
407
+ attrs: {
408
+ src: null,
409
+ srcdoc: null,
410
+ name: null,
411
+ width: null,
412
+ height: null,
413
+ sandbox: ["allow-top-navigation", "allow-same-origin", "allow-forms", "allow-scripts"],
414
+ seamless: ["seamless"]
415
+ }
416
+ },
417
+ img: {
418
+ attrs: {
419
+ alt: null,
420
+ src: null,
421
+ ismap: null,
422
+ usemap: null,
423
+ width: null,
424
+ height: null,
425
+ crossorigin: ["anonymous", "use-credentials"]
426
+ }
427
+ },
428
+ input: {
429
+ attrs: {
430
+ alt: null,
431
+ dirname: null,
432
+ form: null,
433
+ formaction: null,
434
+ height: null,
435
+ list: null,
436
+ max: null,
437
+ maxlength: null,
438
+ min: null,
439
+ name: null,
440
+ pattern: null,
441
+ placeholder: null,
442
+ size: null,
443
+ src: null,
444
+ step: null,
445
+ value: null,
446
+ width: null,
447
+ accept: ["audio/*", "video/*", "image/*"],
448
+ autocomplete: ["on", "off"],
449
+ autofocus: ["autofocus"],
450
+ checked: ["checked"],
451
+ disabled: ["disabled"],
452
+ formenctype: C,
453
+ formmethod: _,
454
+ formnovalidate: ["novalidate"],
455
+ formtarget: x,
456
+ multiple: ["multiple"],
457
+ readonly: ["readonly"],
458
+ required: ["required"],
459
+ type: [
460
+ "hidden",
461
+ "text",
462
+ "search",
463
+ "tel",
464
+ "url",
465
+ "email",
466
+ "password",
467
+ "datetime",
468
+ "date",
469
+ "month",
470
+ "week",
471
+ "time",
472
+ "datetime-local",
473
+ "number",
474
+ "range",
475
+ "color",
476
+ "checkbox",
477
+ "radio",
478
+ "file",
479
+ "submit",
480
+ "image",
481
+ "reset",
482
+ "button"
483
+ ]
484
+ }
485
+ },
486
+ ins: { attrs: { cite: null, datetime: null } },
487
+ kbd: n,
488
+ keygen: {
489
+ attrs: {
490
+ challenge: null,
491
+ form: null,
492
+ name: null,
493
+ autofocus: ["autofocus"],
494
+ disabled: ["disabled"],
495
+ keytype: ["RSA"]
496
+ }
497
+ },
498
+ label: { attrs: { for: null, form: null } },
499
+ legend: n,
500
+ li: { attrs: { value: null } },
501
+ link: {
502
+ attrs: {
503
+ href: null,
504
+ type: null,
505
+ hreflang: null,
506
+ media: null,
507
+ sizes: ["all", "16x16", "16x16 32x32", "16x16 32x32 64x64"]
508
+ }
509
+ },
510
+ map: { attrs: { name: null } },
511
+ mark: n,
512
+ menu: { attrs: { label: null, type: ["list", "context", "toolbar"] } },
513
+ meta: {
514
+ attrs: {
515
+ content: null,
516
+ charset: q,
517
+ name: ["viewport", "application-name", "author", "description", "generator", "keywords"],
518
+ "http-equiv": ["content-language", "content-type", "default-style", "refresh"]
519
+ }
520
+ },
521
+ meter: { attrs: { value: null, min: null, low: null, high: null, max: null, optimum: null } },
522
+ nav: n,
523
+ noscript: n,
524
+ object: {
525
+ attrs: {
526
+ data: null,
527
+ type: null,
528
+ name: null,
529
+ usemap: null,
530
+ form: null,
531
+ width: null,
532
+ height: null,
533
+ typemustmatch: ["typemustmatch"]
534
+ }
535
+ },
536
+ ol: {
537
+ attrs: { reversed: ["reversed"], start: null, type: ["1", "a", "A", "i", "I"] },
538
+ children: ["li", "script", "template", "ul", "ol"]
539
+ },
540
+ optgroup: { attrs: { disabled: ["disabled"], label: null } },
541
+ option: { attrs: { disabled: ["disabled"], label: null, selected: ["selected"], value: null } },
542
+ output: { attrs: { for: null, form: null, name: null } },
543
+ p: n,
544
+ param: { attrs: { name: null, value: null } },
545
+ pre: n,
546
+ progress: { attrs: { value: null, max: null } },
547
+ q: { attrs: { cite: null } },
548
+ rp: n,
549
+ rt: n,
550
+ ruby: n,
551
+ samp: n,
552
+ script: {
553
+ attrs: {
554
+ type: ["text/javascript"],
555
+ src: null,
556
+ async: ["async"],
557
+ defer: ["defer"],
558
+ charset: q
559
+ }
560
+ },
561
+ section: n,
562
+ select: {
563
+ attrs: {
564
+ form: null,
565
+ name: null,
566
+ size: null,
567
+ autofocus: ["autofocus"],
568
+ disabled: ["disabled"],
569
+ multiple: ["multiple"]
570
+ }
571
+ },
572
+ slot: { attrs: { name: null } },
573
+ small: n,
574
+ source: { attrs: { src: null, type: null, media: null } },
575
+ span: n,
576
+ strong: n,
577
+ style: {
578
+ attrs: {
579
+ type: ["text/css"],
580
+ media: null,
581
+ scoped: null
582
+ }
583
+ },
584
+ sub: n,
585
+ summary: n,
586
+ sup: n,
587
+ table: n,
588
+ tbody: n,
589
+ td: { attrs: { colspan: null, rowspan: null, headers: null } },
590
+ template: n,
591
+ textarea: {
592
+ attrs: {
593
+ dirname: null,
594
+ form: null,
595
+ maxlength: null,
596
+ name: null,
597
+ placeholder: null,
598
+ rows: null,
599
+ cols: null,
600
+ autofocus: ["autofocus"],
601
+ disabled: ["disabled"],
602
+ readonly: ["readonly"],
603
+ required: ["required"],
604
+ wrap: ["soft", "hard"]
605
+ }
606
+ },
607
+ tfoot: n,
608
+ th: { attrs: { colspan: null, rowspan: null, headers: null, scope: ["row", "col", "rowgroup", "colgroup"] } },
609
+ thead: n,
610
+ time: { attrs: { datetime: null } },
611
+ title: n,
612
+ tr: n,
613
+ track: {
614
+ attrs: {
615
+ src: null,
616
+ label: null,
617
+ default: null,
618
+ kind: ["subtitles", "captions", "descriptions", "chapters", "metadata"],
619
+ srclang: null
620
+ }
621
+ },
622
+ ul: { children: ["li", "script", "template", "ul", "ol"] },
623
+ var: n,
624
+ video: {
625
+ attrs: {
626
+ src: null,
627
+ poster: null,
628
+ width: null,
629
+ height: null,
630
+ crossorigin: ["anonymous", "use-credentials"],
631
+ preload: ["auto", "metadata", "none"],
632
+ autoplay: ["autoplay"],
633
+ mediagroup: ["movie"],
634
+ muted: ["muted"],
635
+ controls: ["controls"]
636
+ }
637
+ },
638
+ wbr: n
639
+ }, ue = {
640
+ accesskey: null,
641
+ class: null,
642
+ contenteditable: g,
643
+ contextmenu: null,
644
+ dir: ["ltr", "rtl", "auto"],
645
+ draggable: ["true", "false", "auto"],
646
+ dropzone: ["copy", "move", "link", "string:", "file:"],
647
+ hidden: ["hidden"],
648
+ id: null,
649
+ inert: ["inert"],
650
+ itemid: null,
651
+ itemprop: null,
652
+ itemref: null,
653
+ itemscope: ["itemscope"],
654
+ itemtype: null,
655
+ lang: ["ar", "bn", "de", "en-GB", "en-US", "es", "fr", "hi", "id", "ja", "pa", "pt", "ru", "tr", "zh"],
656
+ spellcheck: g,
657
+ autocorrect: g,
658
+ autocapitalize: g,
659
+ style: null,
660
+ tabindex: null,
661
+ title: null,
662
+ translate: ["yes", "no"],
663
+ rel: ["stylesheet", "alternate", "author", "bookmark", "help", "license", "next", "nofollow", "noreferrer", "prefetch", "prev", "search", "tag"],
664
+ role: /* @__PURE__ */ "alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),
665
+ "aria-activedescendant": null,
666
+ "aria-atomic": g,
667
+ "aria-autocomplete": ["inline", "list", "both", "none"],
668
+ "aria-busy": g,
669
+ "aria-checked": ["true", "false", "mixed", "undefined"],
670
+ "aria-controls": null,
671
+ "aria-describedby": null,
672
+ "aria-disabled": g,
673
+ "aria-dropeffect": null,
674
+ "aria-expanded": ["true", "false", "undefined"],
675
+ "aria-flowto": null,
676
+ "aria-grabbed": ["true", "false", "undefined"],
677
+ "aria-haspopup": g,
678
+ "aria-hidden": g,
679
+ "aria-invalid": ["true", "false", "grammar", "spelling"],
680
+ "aria-label": null,
681
+ "aria-labelledby": null,
682
+ "aria-level": null,
683
+ "aria-live": ["off", "polite", "assertive"],
684
+ "aria-multiline": g,
685
+ "aria-multiselectable": g,
686
+ "aria-owns": null,
687
+ "aria-posinset": null,
688
+ "aria-pressed": ["true", "false", "mixed", "undefined"],
689
+ "aria-readonly": g,
690
+ "aria-relevant": null,
691
+ "aria-required": g,
692
+ "aria-selected": ["true", "false", "undefined"],
693
+ "aria-setsize": null,
694
+ "aria-sort": ["ascending", "descending", "none", "other"],
695
+ "aria-valuemax": null,
696
+ "aria-valuemin": null,
697
+ "aria-valuenow": null,
698
+ "aria-valuetext": null
699
+ }, Oe = /* @__PURE__ */ "beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map((e) => "on" + e);
700
+ for (let e of Oe)
701
+ ue[e] = null;
702
+ class V {
703
+ constructor(a, r) {
704
+ this.tags = { ...St, ...a }, this.globalAttrs = { ...ue, ...r }, this.allTags = Object.keys(this.tags), this.globalAttrNames = Object.keys(this.globalAttrs);
705
+ }
706
+ }
707
+ V.default = /* @__PURE__ */ new V();
708
+ function T(e, a, r = e.length) {
709
+ if (!a)
710
+ return "";
711
+ let l = a.firstChild, t = l && l.getChild("TagName");
712
+ return t ? e.sliceString(t.from, Math.min(t.to, r)) : "";
713
+ }
714
+ function P(e, a = !1) {
715
+ for (; e; e = e.parent)
716
+ if (e.name == "Element")
717
+ if (a)
718
+ a = !1;
719
+ else
720
+ return e;
721
+ return null;
722
+ }
723
+ function de(e, a, r) {
724
+ let l = r.tags[T(e, P(a))];
725
+ return l?.children || r.allTags;
726
+ }
727
+ function E(e, a) {
728
+ let r = [];
729
+ for (let l = P(a); l && !l.type.isTop; l = P(l.parent)) {
730
+ let t = T(e, l);
731
+ if (t && l.lastChild.name == "CloseTag")
732
+ break;
733
+ t && r.indexOf(t) < 0 && (a.name == "EndTag" || a.from >= l.firstChild.to) && r.push(t);
734
+ }
735
+ return r;
736
+ }
737
+ const ce = /^[:\-\.\w\u00b7-\uffff]*$/;
738
+ function U(e, a, r, l, t) {
739
+ let s = /\s*>/.test(e.sliceDoc(t, t + 5)) ? "" : ">", o = P(r, r.name == "StartTag" || r.name == "TagName");
740
+ return {
741
+ from: l,
742
+ to: t,
743
+ options: de(e.doc, o, a).map((i) => ({ label: i, type: "type" })).concat(E(e.doc, r).map((i, O) => ({
744
+ label: "/" + i,
745
+ apply: "/" + i + s,
746
+ type: "type",
747
+ boost: 99 - O
748
+ }))),
749
+ validFor: /^\/?[:\-\.\w\u00b7-\uffff]*$/
750
+ };
751
+ }
752
+ function L(e, a, r, l) {
753
+ let t = /\s*>/.test(e.sliceDoc(l, l + 5)) ? "" : ">";
754
+ return {
755
+ from: r,
756
+ to: l,
757
+ options: E(e.doc, a).map((s, o) => ({ label: s, apply: s + t, type: "type", boost: 99 - o })),
758
+ validFor: ce
759
+ };
760
+ }
761
+ function bt(e, a, r, l) {
762
+ let t = [], s = 0;
763
+ for (let o of de(e.doc, r, a))
764
+ t.push({ label: "<" + o, type: "type" });
765
+ for (let o of E(e.doc, r))
766
+ t.push({ label: "</" + o + ">", type: "type", boost: 99 - s++ });
767
+ return { from: l, to: l, options: t, validFor: /^<\/?[:\-\.\w\u00b7-\uffff]*$/ };
768
+ }
769
+ function ht(e, a, r, l, t) {
770
+ let s = P(r), o = s ? a.tags[T(e.doc, s)] : null, i = o && o.attrs ? Object.keys(o.attrs) : [], O = o && o.globalAttrs === !1 ? i : i.length ? i.concat(a.globalAttrNames) : a.globalAttrNames;
771
+ return {
772
+ from: l,
773
+ to: t,
774
+ options: O.map((f) => ({ label: f, type: "property" })),
775
+ validFor: ce
776
+ };
777
+ }
778
+ function Tt(e, a, r, l, t) {
779
+ var s;
780
+ let o = (s = r.parent) === null || s === void 0 ? void 0 : s.getChild("AttributeName"), i = [], O;
781
+ if (o) {
782
+ let f = e.sliceDoc(o.from, o.to), m = a.globalAttrs[f];
783
+ if (!m) {
784
+ let u = P(r), c = u ? a.tags[T(e.doc, u)] : null;
785
+ m = c?.attrs && c.attrs[f];
786
+ }
787
+ if (m) {
788
+ let u = e.sliceDoc(l, t).toLowerCase(), c = '"', p = '"';
789
+ /^['"]/.test(u) ? (O = u[0] == '"' ? /^[^"]*$/ : /^[^']*$/, c = "", p = e.sliceDoc(t, t + 1) == u[0] ? "" : u[0], u = u.slice(1), l++) : O = /^[^\s<>='"]*$/;
790
+ for (let d of m)
791
+ i.push({ label: d, apply: c + d + p, type: "constant" });
792
+ }
793
+ }
794
+ return { from: l, to: t, options: i, validFor: O };
795
+ }
796
+ function pe(e, a) {
797
+ let { state: r, pos: l } = a, t = K(r).resolveInner(l, -1), s = t.resolve(l);
798
+ for (let o = l, i; s == t && (i = t.childBefore(o)); ) {
799
+ let O = i.lastChild;
800
+ if (!O || !O.type.isError || O.from < O.to)
801
+ break;
802
+ s = t = i, o = O.from;
803
+ }
804
+ return t.name == "TagName" ? t.parent && /CloseTag$/.test(t.parent.name) ? L(r, t, t.from, l) : U(r, e, t, t.from, l) : t.name == "StartTag" || t.name == "IncompleteTag" ? U(r, e, t, l, l) : t.name == "StartCloseTag" || t.name == "IncompleteCloseTag" ? L(r, t, l, l) : t.name == "OpenTag" || t.name == "SelfClosingTag" || t.name == "AttributeName" ? ht(r, e, t, t.name == "AttributeName" ? t.from : l, l) : t.name == "Is" || t.name == "AttributeValue" || t.name == "UnquotedAttributeValue" ? Tt(r, e, t, t.name == "Is" ? l : t.from, l) : a.explicit && (s.name == "Element" || s.name == "Text" || s.name == "Document") ? bt(r, e, t, l) : null;
805
+ }
806
+ function kt(e) {
807
+ return pe(V.default, e);
808
+ }
809
+ function Pt(e) {
810
+ let { extraTags: a, extraGlobalAttributes: r } = e, l = r || a ? new V(a, r) : V.default;
811
+ return (t) => pe(l, t);
812
+ }
813
+ const xt = /* @__PURE__ */ A.parser.configure({ top: "SingleExpression" }), me = [
814
+ {
815
+ tag: "script",
816
+ attrs: (e) => e.type == "text/typescript" || e.lang == "ts",
817
+ parser: xe.parser
818
+ },
819
+ {
820
+ tag: "script",
821
+ attrs: (e) => e.type == "text/babel" || e.type == "text/jsx",
822
+ parser: Ve.parser
823
+ },
824
+ {
825
+ tag: "script",
826
+ attrs: (e) => e.type == "text/typescript-jsx",
827
+ parser: ye.parser
828
+ },
829
+ {
830
+ tag: "script",
831
+ attrs(e) {
832
+ return /^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type);
833
+ },
834
+ parser: xt
835
+ },
836
+ {
837
+ tag: "script",
838
+ attrs(e) {
839
+ return !e.type || /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type);
840
+ },
841
+ parser: A.parser
842
+ },
843
+ {
844
+ tag: "style",
845
+ attrs(e) {
846
+ return (!e.lang || e.lang == "css") && (!e.type || /^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type));
847
+ },
848
+ parser: H.parser
849
+ }
850
+ ], fe = /* @__PURE__ */ [
851
+ {
852
+ name: "style",
853
+ parser: /* @__PURE__ */ H.parser.configure({ top: "Styles" })
854
+ }
855
+ ].concat(/* @__PURE__ */ Oe.map((e) => ({ name: e, parser: A.parser }))), ge = /* @__PURE__ */ $e.define({
856
+ name: "html",
857
+ parser: /* @__PURE__ */ gt.configure({
858
+ props: [
859
+ /* @__PURE__ */ _e.add({
860
+ Element(e) {
861
+ let a = /^(\s*)(<\/)?/.exec(e.textAfter);
862
+ return e.node.to <= e.pos + a[0].length ? e.continue() : e.lineIndent(e.node.from) + (a[2] ? 0 : e.unit);
863
+ },
864
+ "OpenTag CloseTag SelfClosingTag"(e) {
865
+ return e.column(e.node.from) + e.unit;
866
+ },
867
+ Document(e) {
868
+ if (e.pos + /\s*/.exec(e.textAfter)[0].length < e.node.to)
869
+ return e.continue();
870
+ let a = null, r;
871
+ for (let l = e.node; ; ) {
872
+ let t = l.lastChild;
873
+ if (!t || t.name != "Element" || t.to != l.to)
874
+ break;
875
+ a = l = t;
876
+ }
877
+ return a && !((r = a.lastChild) && (r.name == "CloseTag" || r.name == "SelfClosingTag")) ? e.lineIndent(a.from) + e.unit : null;
878
+ }
879
+ }),
880
+ /* @__PURE__ */ Ce.add({
881
+ Element(e) {
882
+ let a = e.firstChild, r = e.lastChild;
883
+ return !a || a.name != "OpenTag" ? null : { from: a.to, to: r.name == "CloseTag" ? r.from : e.to };
884
+ }
885
+ }),
886
+ /* @__PURE__ */ ke.add({
887
+ "OpenTag CloseTag": (e) => e.getChild("TagName")
888
+ })
889
+ ]
890
+ }),
891
+ languageData: {
892
+ commentTokens: { block: { open: "<!--", close: "-->" } },
893
+ indentOnInput: /^\s*<\/\w+\W$/,
894
+ wordChars: "-_"
895
+ }
896
+ }), y = /* @__PURE__ */ ge.configure({
897
+ wrap: /* @__PURE__ */ ie(me, fe)
898
+ });
899
+ function Qt(e = {}) {
900
+ let a = "", r;
901
+ e.matchClosingTags === !1 && (a = "noMatch"), e.selfClosingTags === !0 && (a = (a ? a + " " : "") + "selfClosing"), (e.nestedLanguages && e.nestedLanguages.length || e.nestedAttributes && e.nestedAttributes.length) && (r = ie((e.nestedLanguages || []).concat(me), (e.nestedAttributes || []).concat(fe)));
902
+ let l = r ? ge.configure({ wrap: r, dialect: a }) : a ? y.configure({ dialect: a }) : y;
903
+ return new qe(l, [
904
+ y.data.of({ autocomplete: Pt(e) }),
905
+ e.autoCloseTags !== !1 ? yt : [],
906
+ we().support,
907
+ Pe().support
908
+ ]);
909
+ }
910
+ const F = /* @__PURE__ */ new Set(/* @__PURE__ */ "area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" "));
911
+ function Vt(e, a, r) {
912
+ for (var l; ; ) {
913
+ if (((l = a.lastChild) === null || l === void 0 ? void 0 : l.name) != "CloseTag")
914
+ return !1;
915
+ let t = a.parent;
916
+ if (!t || T(e, t) != r)
917
+ return !0;
918
+ a = t;
919
+ }
920
+ }
921
+ const yt = /* @__PURE__ */ ve.inputHandler.of((e, a, r, l, t) => {
922
+ if (e.composing || e.state.readOnly || a != r || l != ">" && l != "/" || !y.isActiveAt(e.state, a, -1))
923
+ return !1;
924
+ let s = t(), { state: o } = s, i = o.changeByRange((O) => {
925
+ var f;
926
+ let m = o.doc.sliceString(O.from - 1, O.to) == l, { head: u } = O, c = K(o).resolveInner(u, -1), p;
927
+ if (m && l == ">" && c.name == "EndTag") {
928
+ let d = c.parent;
929
+ if ((p = T(o.doc, d.parent, u)) && !F.has(p) && !Vt(o.doc, d.parent, p)) {
930
+ let h = u + (o.doc.sliceString(u, u + 1) === ">" ? 1 : 0), b = `</${p}>`;
931
+ return { range: O, changes: { from: u, to: h, insert: b } };
932
+ }
933
+ } else if (m && l == "/" && c.name == "IncompleteCloseTag") {
934
+ let d = c.parent;
935
+ if (c.from == u - 2 && ((f = d.lastChild) === null || f === void 0 ? void 0 : f.name) != "CloseTag" && (p = T(o.doc, d, u)) && !F.has(p)) {
936
+ let h = u + (o.doc.sliceString(u, u + 1) === ">" ? 1 : 0), b = `${p}>`;
937
+ return {
938
+ range: Xe.cursor(u + b.length, -1),
939
+ changes: { from: u, to: h, insert: b }
940
+ };
941
+ }
942
+ }
943
+ return { range: O };
944
+ });
945
+ return i.changes.empty ? !1 : (e.dispatch([
946
+ s,
947
+ o.update(i, {
948
+ userEvent: "input.complete",
949
+ scrollIntoView: !0
950
+ })
951
+ ]), !0);
952
+ });
953
+ export {
954
+ yt as autoCloseTags,
955
+ Qt as html,
956
+ kt as htmlCompletionSource,
957
+ Pt as htmlCompletionSourceWith,
958
+ y as htmlLanguage
959
+ };