claude-maestro 0.1.16

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 (125) hide show
  1. package/README.md +130 -0
  2. package/bin/maestro.mjs +45 -0
  3. package/out/main/index.js +5293 -0
  4. package/out/preload/index.js +130 -0
  5. package/out/renderer/assets/apl-fqmucPXA.js +140 -0
  6. package/out/renderer/assets/asciiarmor-DucZyvP0.js +56 -0
  7. package/out/renderer/assets/asn1-BnOEsgAm.js +144 -0
  8. package/out/renderer/assets/asterisk-QAlztEwS.js +345 -0
  9. package/out/renderer/assets/brainfuck-DZVCuF_t.js +53 -0
  10. package/out/renderer/assets/clike-xqXYL6ge.js +805 -0
  11. package/out/renderer/assets/clojure-BhXMqnxz.js +849 -0
  12. package/out/renderer/assets/cmake-BGaNd9E7.js +71 -0
  13. package/out/renderer/assets/cobol-4yqQntpt.js +120 -0
  14. package/out/renderer/assets/coffeescript-D2dXvhEc.js +308 -0
  15. package/out/renderer/assets/commonlisp-CF_VNHQR.js +130 -0
  16. package/out/renderer/assets/crystal-DyuLTqLs.js +398 -0
  17. package/out/renderer/assets/css-c-jst79C.js +1783 -0
  18. package/out/renderer/assets/cypher-Dlu_3r4V.js +121 -0
  19. package/out/renderer/assets/d-UURgV0Ux.js +179 -0
  20. package/out/renderer/assets/diff-B_Bi2Crb.js +25 -0
  21. package/out/renderer/assets/dockerfile-Bvk733Ga.js +201 -0
  22. package/out/renderer/assets/dtd-Dy74G54E.js +114 -0
  23. package/out/renderer/assets/dylan-TSb-Nfix.js +314 -0
  24. package/out/renderer/assets/ebnf-4fKAGW3a.js +140 -0
  25. package/out/renderer/assets/ecl-B59qGGVg.js +178 -0
  26. package/out/renderer/assets/eiffel-Dze7nlu3.js +134 -0
  27. package/out/renderer/assets/elm-DG7jkhNZ.js +176 -0
  28. package/out/renderer/assets/erlang-BO6gOnGA.js +674 -0
  29. package/out/renderer/assets/factor-CMxFHDqz.js +65 -0
  30. package/out/renderer/assets/fcl-CDDUNjTj.js +141 -0
  31. package/out/renderer/assets/forth-B9D2JCeE.js +116 -0
  32. package/out/renderer/assets/fortran-CAG2BFbe.js +467 -0
  33. package/out/renderer/assets/gas-d3KEcW3x.js +294 -0
  34. package/out/renderer/assets/gherkin-DhZlEZiy.js +115 -0
  35. package/out/renderer/assets/groovy-CpwJiBl7.js +223 -0
  36. package/out/renderer/assets/haskell-ySd-OUo8.js +459 -0
  37. package/out/renderer/assets/haxe-7MlzfeYV.js +514 -0
  38. package/out/renderer/assets/http-BqypyemW.js +79 -0
  39. package/out/renderer/assets/idl-4HIGJlDI.js +985 -0
  40. package/out/renderer/assets/index-2SQReYbL.js +117 -0
  41. package/out/renderer/assets/index-B4G_DF7l.js +178 -0
  42. package/out/renderer/assets/index-BJ7HHtlW.css +4015 -0
  43. package/out/renderer/assets/index-BLk1t3tc.js +151 -0
  44. package/out/renderer/assets/index-BLtm0KYA.js +157 -0
  45. package/out/renderer/assets/index-BPgGZ4iY.js +82 -0
  46. package/out/renderer/assets/index-BQE9vCdv.js +332 -0
  47. package/out/renderer/assets/index-BYr39Do3.js +61 -0
  48. package/out/renderer/assets/index-Ba0sUbhl.js +47177 -0
  49. package/out/renderer/assets/index-BewSkGJT.js +1041 -0
  50. package/out/renderer/assets/index-BnId7J8H.js +1021 -0
  51. package/out/renderer/assets/index-Btn996gP.js +406 -0
  52. package/out/renderer/assets/index-C7i4WyfA.js +311 -0
  53. package/out/renderer/assets/index-CW9SAu99.js +385 -0
  54. package/out/renderer/assets/index-CXmk7jHk.js +291 -0
  55. package/out/renderer/assets/index-CyQp9UDR.js +82 -0
  56. package/out/renderer/assets/index-Da2gJ_Wd.js +704 -0
  57. package/out/renderer/assets/index-DkFO-IXC.js +2488 -0
  58. package/out/renderer/assets/index-DqrDpNqn.js +689 -0
  59. package/out/renderer/assets/index-Dw7p19YD.js +327 -0
  60. package/out/renderer/assets/index-QPm3UFYR.js +97 -0
  61. package/out/renderer/assets/index-RGiHNShF.js +1768 -0
  62. package/out/renderer/assets/index-RgZE5T_I.js +642 -0
  63. package/out/renderer/assets/index-t8kJBumF.js +312 -0
  64. package/out/renderer/assets/javascript-C_OHM9hj.js +994 -0
  65. package/out/renderer/assets/julia-Bs6JJhYG.js +407 -0
  66. package/out/renderer/assets/livescript-DmzgM3Yt.js +296 -0
  67. package/out/renderer/assets/lua-Cvg8VrAA.js +256 -0
  68. package/out/renderer/assets/mathematica-DNLOL9PQ.js +110 -0
  69. package/out/renderer/assets/mbox-Ga7d4MMN.js +117 -0
  70. package/out/renderer/assets/mirc-Dma3B8rS.js +107 -0
  71. package/out/renderer/assets/mllike-DHn7xckP.js +334 -0
  72. package/out/renderer/assets/modelica-0d55jYY0.js +147 -0
  73. package/out/renderer/assets/mscgen-DdqZYINH.js +135 -0
  74. package/out/renderer/assets/mumps-Btr8VblO.js +93 -0
  75. package/out/renderer/assets/nginx-DTDtBDVN.js +141 -0
  76. package/out/renderer/assets/nsis-3zG7tgur.js +62 -0
  77. package/out/renderer/assets/ntriples-CvgOYMpL.js +153 -0
  78. package/out/renderer/assets/octave-DYBj3-tl.js +200 -0
  79. package/out/renderer/assets/oz-R_e8WMIi.js +231 -0
  80. package/out/renderer/assets/pascal-GD8iposT.js +105 -0
  81. package/out/renderer/assets/perl-DL9mHpoi.js +1105 -0
  82. package/out/renderer/assets/pig-C_4T4YIV.js +101 -0
  83. package/out/renderer/assets/powershell-B0suO7Vd.js +328 -0
  84. package/out/renderer/assets/properties-BR-vP1aU.js +58 -0
  85. package/out/renderer/assets/protobuf-BxgpyhoW.js +77 -0
  86. package/out/renderer/assets/pug-CTXt1f8z.js +405 -0
  87. package/out/renderer/assets/puppet-Bdao66PW.js +137 -0
  88. package/out/renderer/assets/python-CvWbmiX4.js +427 -0
  89. package/out/renderer/assets/q-CrbCVq4a.js +131 -0
  90. package/out/renderer/assets/r-V7nswm59.js +170 -0
  91. package/out/renderer/assets/rpm-C-DLY-If.js +109 -0
  92. package/out/renderer/assets/ruby-JDKLJNK0.js +330 -0
  93. package/out/renderer/assets/sas-D2UG-yhZ.js +207 -0
  94. package/out/renderer/assets/scheme-BKzrkGJD.js +222 -0
  95. package/out/renderer/assets/shell-BlsXDxCn.js +222 -0
  96. package/out/renderer/assets/sieve-CjwBwOY5.js +135 -0
  97. package/out/renderer/assets/simple-mode-DMneyfDu.js +130 -0
  98. package/out/renderer/assets/smalltalk-BOIGQuhN.js +121 -0
  99. package/out/renderer/assets/solr-CwD7U71z.js +69 -0
  100. package/out/renderer/assets/sparql-DYskk2vE.js +249 -0
  101. package/out/renderer/assets/spreadsheet-Bgtt3oLP.js +87 -0
  102. package/out/renderer/assets/sql-BSrOzCRI.js +354 -0
  103. package/out/renderer/assets/stex-B6LNC55o.js +231 -0
  104. package/out/renderer/assets/stylus-BkS-boTH.js +565 -0
  105. package/out/renderer/assets/swift-FRZi1uvB.js +291 -0
  106. package/out/renderer/assets/tcl-CUcaCdmq.js +114 -0
  107. package/out/renderer/assets/textile-BnFpjsrl.js +414 -0
  108. package/out/renderer/assets/tiddlywiki-CjprD-Qp.js +218 -0
  109. package/out/renderer/assets/tiki-DK9DOeWn.js +268 -0
  110. package/out/renderer/assets/toml-BOuWGMcf.js +76 -0
  111. package/out/renderer/assets/troff-E1bJ0PPL.js +61 -0
  112. package/out/renderer/assets/ttcn-cfg-Dc39-fIP.js +133 -0
  113. package/out/renderer/assets/ttcn-tKd4HLu4.js +192 -0
  114. package/out/renderer/assets/turtle-Dq7-1WAf.js +124 -0
  115. package/out/renderer/assets/vb-Dp90gtsv.js +196 -0
  116. package/out/renderer/assets/vbscript-CI6_mxxU.js +479 -0
  117. package/out/renderer/assets/velocity-BwIZK1TH.js +149 -0
  118. package/out/renderer/assets/verilog-DDCYnHN8.js +430 -0
  119. package/out/renderer/assets/vhdl-DCkMIyT9.js +158 -0
  120. package/out/renderer/assets/webidl-BTLTThCm.js +204 -0
  121. package/out/renderer/assets/xquery-BrBUuxMR.js +525 -0
  122. package/out/renderer/assets/yacas-b5lAVEIl.js +130 -0
  123. package/out/renderer/assets/z80-BZV19vqv.js +93 -0
  124. package/out/renderer/index.html +16 -0
  125. package/package.json +109 -0
@@ -0,0 +1,385 @@
1
+ import { L as LRParser, E as ExternalTokenizer, C as ContextTracker } from "./index-RGiHNShF.js";
2
+ import { s as styleTags, t as tags, E as EditorView, e as syntaxTree, l as EditorSelection, a as LanguageSupport, L as LRLanguage, i as indentNodeProp, f as foldNodeProp, G as bracketMatchingHandle } from "./index-Ba0sUbhl.js";
3
+ const StartTag = 1, StartCloseTag = 2, MissingCloseTag = 3, mismatchedStartCloseTag = 4, incompleteStartCloseTag = 5, commentContent$1 = 36, piContent$1 = 37, cdataContent$1 = 38, Element$1 = 11, OpenTag = 13;
4
+ function nameChar(ch) {
5
+ return ch == 45 || ch == 46 || ch == 58 || ch >= 65 && ch <= 90 || ch == 95 || ch >= 97 && ch <= 122 || ch >= 161;
6
+ }
7
+ function isSpace(ch) {
8
+ return ch == 9 || ch == 10 || ch == 13 || ch == 32;
9
+ }
10
+ let cachedName = null, cachedInput = null, cachedPos = 0;
11
+ function tagNameAfter(input, offset) {
12
+ let pos = input.pos + offset;
13
+ if (cachedInput == input && cachedPos == pos) return cachedName;
14
+ while (isSpace(input.peek(offset))) offset++;
15
+ let name = "";
16
+ for (; ; ) {
17
+ let next = input.peek(offset);
18
+ if (!nameChar(next)) break;
19
+ name += String.fromCharCode(next);
20
+ offset++;
21
+ }
22
+ cachedInput = input;
23
+ cachedPos = pos;
24
+ return cachedName = name || null;
25
+ }
26
+ function ElementContext(name, parent) {
27
+ this.name = name;
28
+ this.parent = parent;
29
+ }
30
+ const elementContext = new ContextTracker({
31
+ start: null,
32
+ shift(context, term, stack, input) {
33
+ return term == StartTag ? new ElementContext(tagNameAfter(input, 1) || "", context) : context;
34
+ },
35
+ reduce(context, term) {
36
+ return term == Element$1 && context ? context.parent : context;
37
+ },
38
+ reuse(context, node, _stack, input) {
39
+ let type = node.type.id;
40
+ return type == StartTag || type == OpenTag ? new ElementContext(tagNameAfter(input, 1) || "", context) : context;
41
+ },
42
+ strict: false
43
+ });
44
+ const startTag = new ExternalTokenizer((input, stack) => {
45
+ if (input.next != 60) return;
46
+ input.advance();
47
+ if (input.next == 47) {
48
+ input.advance();
49
+ let name = tagNameAfter(input, 0);
50
+ if (!name) return input.acceptToken(incompleteStartCloseTag);
51
+ if (stack.context && name == stack.context.name) return input.acceptToken(StartCloseTag);
52
+ for (let cx = stack.context; cx; cx = cx.parent) if (cx.name == name) return input.acceptToken(MissingCloseTag, -2);
53
+ input.acceptToken(mismatchedStartCloseTag);
54
+ } else if (input.next != 33 && input.next != 63) {
55
+ return input.acceptToken(StartTag);
56
+ }
57
+ }, { contextual: true });
58
+ function scanTo(type, end) {
59
+ return new ExternalTokenizer((input) => {
60
+ let len = 0, first = end.charCodeAt(0);
61
+ scan: for (; ; input.advance(), len++) {
62
+ if (input.next < 0) break;
63
+ if (input.next == first) {
64
+ for (let i = 1; i < end.length; i++)
65
+ if (input.peek(i) != end.charCodeAt(i)) continue scan;
66
+ break;
67
+ }
68
+ }
69
+ if (len) input.acceptToken(type);
70
+ });
71
+ }
72
+ const commentContent = scanTo(commentContent$1, "-->");
73
+ const piContent = scanTo(piContent$1, "?>");
74
+ const cdataContent = scanTo(cdataContent$1, "]]>");
75
+ const xmlHighlighting = styleTags({
76
+ Text: tags.content,
77
+ "StartTag StartCloseTag EndTag SelfCloseEndTag": tags.angleBracket,
78
+ TagName: tags.tagName,
79
+ "MismatchedCloseTag/TagName": [tags.tagName, tags.invalid],
80
+ AttributeName: tags.attributeName,
81
+ AttributeValue: tags.attributeValue,
82
+ Is: tags.definitionOperator,
83
+ "EntityReference CharacterReference": tags.character,
84
+ Comment: tags.blockComment,
85
+ ProcessingInst: tags.processingInstruction,
86
+ DoctypeDecl: tags.documentMeta,
87
+ Cdata: tags.special(tags.string)
88
+ });
89
+ const parser = LRParser.deserialize({
90
+ version: 14,
91
+ states: ",lOQOaOOOrOxO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^`Oz^O~OPQOQcOSVOTWOVWOWWOXWOyPO!QTO!SUO~ORdO~P!SOteO!PgO~OuhO!RjO~O^lOz^O~OvZOxoO~O^qOz^O~O[vO`sOdwOz^O~ORyO~P!SO^{Oz^O~OteO!P}O~OuhO!R!PO~O^!QOz^O~O[!SOz^O~O[!VO`sOd!WOz^O~Oa!YOz^O~Oz^O[mX`mXdmX~O[!VO`sOd!WO~O^!]Oz^O~O[!_Oz^O~O[!aOz^O~O[!cO`sOd!dOz^O~O[!cO`sOd!dO~Oa!eOz^O~Oz^O{!gO}!hO~Oz^O[ma`madma~O[!kOz^O~O[!lOz^O~O[!mO`sOd!nO~OW!qOX!qO{!sO|!qO~OW!tOX!tO}!sO!O!tO~O[!vOz^O~OW!qOX!qO{!yO|!qO~OW!tOX!tO}!yO!O!tO~O",
93
+ goto: "%cxPPPPPPPPPPyyP!PP!VPP!`!jP!pyyyP!v!|#S$[$k$q$w$}%TPPPP%ZXWORYbXRORYb_t`qru!T!U!bQ!i!YS!p!e!fR!w!oQdRRybXSORYbQYORmYQ[PRn[Q_QQkVjp_krz!R!T!X!Z!^!`!f!j!oQr`QzcQ!RlQ!TqQ!XsQ!ZtQ!^{Q!`!QQ!f!YQ!j!]R!o!eQu`S!UqrU![u!U!bR!b!TQ!r!gR!x!rQ!u!hR!z!uQbRRxbQfTR|fQiUR!OiSXOYTaRb",
94
+ nodeNames: "⚠ StartTag StartCloseTag MissingCloseTag StartCloseTag StartCloseTag Document Text EntityReference CharacterReference Cdata Element EndTag OpenTag TagName Attribute AttributeName Is AttributeValue CloseTag SelfCloseEndTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag DoctypeDecl",
95
+ maxTerm: 50,
96
+ context: elementContext,
97
+ nodeProps: [
98
+ ["closedBy", 1, "SelfCloseEndTag EndTag", 13, "CloseTag MissingCloseTag"],
99
+ ["openedBy", 12, "StartTag StartCloseTag", 19, "OpenTag", 20, "StartTag"],
100
+ ["isolate", -6, 13, 18, 19, 21, 22, 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!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!%mZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!&`!a;'S$q;'S;=`)c<%lO$qk!&kX!RQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!'aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_#P$q#P#Q!(S#Q;'S$q;'S;=`)c<%lO$qk!(]ZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!)O!a;'S$q;'S;=`)c<%lO$qk!)ZXxQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$q",
106
+ tokenizers: [startTag, commentContent, piContent, cdataContent, 0, 1, 2, 3, 4],
107
+ topRules: { "Document": [0, 6] },
108
+ tokenPrec: 0
109
+ });
110
+ function tagName(doc, tag) {
111
+ let name = tag && tag.getChild("TagName");
112
+ return name ? doc.sliceString(name.from, name.to) : "";
113
+ }
114
+ function elementName$1(doc, tree) {
115
+ let tag = tree && tree.firstChild;
116
+ return !tag || tag.name != "OpenTag" ? "" : tagName(doc, tag);
117
+ }
118
+ function attrName(doc, tag, pos) {
119
+ let attr = tag && tag.getChildren("Attribute").find((a) => a.from <= pos && a.to >= pos);
120
+ let name = attr && attr.getChild("AttributeName");
121
+ return name ? doc.sliceString(name.from, name.to) : "";
122
+ }
123
+ function findParentElement(tree) {
124
+ for (let cur = tree && tree.parent; cur; cur = cur.parent)
125
+ if (cur.name == "Element")
126
+ return cur;
127
+ return null;
128
+ }
129
+ function findLocation(state, pos) {
130
+ var _a;
131
+ let at = syntaxTree(state).resolveInner(pos, -1), inTag = null;
132
+ for (let cur = at; !inTag && cur.parent; cur = cur.parent)
133
+ if (cur.name == "OpenTag" || cur.name == "CloseTag" || cur.name == "SelfClosingTag" || cur.name == "MismatchedCloseTag")
134
+ inTag = cur;
135
+ if (inTag && (inTag.to > pos || inTag.lastChild.type.isError)) {
136
+ let elt = inTag.parent;
137
+ if (at.name == "TagName")
138
+ return inTag.name == "CloseTag" || inTag.name == "MismatchedCloseTag" ? { type: "closeTag", from: at.from, context: elt } : { type: "openTag", from: at.from, context: findParentElement(elt) };
139
+ if (at.name == "AttributeName")
140
+ return { type: "attrName", from: at.from, context: inTag };
141
+ if (at.name == "AttributeValue")
142
+ return { type: "attrValue", from: at.from, context: inTag };
143
+ let before = at == inTag || at.name == "Attribute" ? at.childBefore(pos) : at;
144
+ if ((before === null || before === void 0 ? void 0 : before.name) == "StartTag")
145
+ return { type: "openTag", from: pos, context: findParentElement(elt) };
146
+ if ((before === null || before === void 0 ? void 0 : before.name) == "StartCloseTag" && before.to <= pos)
147
+ return { type: "closeTag", from: pos, context: elt };
148
+ if ((before === null || before === void 0 ? void 0 : before.name) == "Is")
149
+ return { type: "attrValue", from: pos, context: inTag };
150
+ if (before)
151
+ return { type: "attrName", from: pos, context: inTag };
152
+ return null;
153
+ } else if (at.name == "StartCloseTag") {
154
+ return { type: "closeTag", from: pos, context: at.parent };
155
+ }
156
+ while (at.parent && at.to == pos && !((_a = at.lastChild) === null || _a === void 0 ? void 0 : _a.type.isError))
157
+ at = at.parent;
158
+ if (at.name == "Element" || at.name == "Text" || at.name == "Document")
159
+ return { type: "tag", from: pos, context: at.name == "Element" ? at : findParentElement(at) };
160
+ return null;
161
+ }
162
+ class Element {
163
+ constructor(spec, attrs, attrValues) {
164
+ this.attrs = attrs;
165
+ this.attrValues = attrValues;
166
+ this.children = [];
167
+ this.name = spec.name;
168
+ this.completion = Object.assign(Object.assign({ type: "type" }, spec.completion || {}), { label: this.name });
169
+ this.openCompletion = Object.assign(Object.assign({}, this.completion), { label: "<" + this.name });
170
+ this.closeCompletion = Object.assign(Object.assign({}, this.completion), { label: "</" + this.name + ">", boost: 2 });
171
+ this.closeNameCompletion = Object.assign(Object.assign({}, this.completion), { label: this.name + ">" });
172
+ this.text = spec.textContent ? spec.textContent.map((s) => ({ label: s, type: "text" })) : [];
173
+ }
174
+ }
175
+ const Identifier = /^[:\-\.\w\u00b7-\uffff]*$/;
176
+ function attrCompletion(spec) {
177
+ return Object.assign(Object.assign({ type: "property" }, spec.completion || {}), { label: spec.name });
178
+ }
179
+ function valueCompletion(spec) {
180
+ return typeof spec == "string" ? { label: `"${spec}"`, type: "constant" } : /^"/.test(spec.label) ? spec : Object.assign(Object.assign({}, spec), { label: `"${spec.label}"` });
181
+ }
182
+ function completeFromSchema(eltSpecs, attrSpecs) {
183
+ let allAttrs = [], globalAttrs = [];
184
+ let attrValues = /* @__PURE__ */ Object.create(null);
185
+ for (let s of attrSpecs) {
186
+ let completion = attrCompletion(s);
187
+ allAttrs.push(completion);
188
+ if (s.global)
189
+ globalAttrs.push(completion);
190
+ if (s.values)
191
+ attrValues[s.name] = s.values.map(valueCompletion);
192
+ }
193
+ let allElements = [], topElements = [];
194
+ let byName = /* @__PURE__ */ Object.create(null);
195
+ for (let s of eltSpecs) {
196
+ let attrs = globalAttrs, attrVals = attrValues;
197
+ if (s.attributes)
198
+ attrs = attrs.concat(s.attributes.map((s2) => {
199
+ if (typeof s2 == "string")
200
+ return allAttrs.find((a) => a.label == s2) || { label: s2, type: "property" };
201
+ if (s2.values) {
202
+ if (attrVals == attrValues)
203
+ attrVals = Object.create(attrVals);
204
+ attrVals[s2.name] = s2.values.map(valueCompletion);
205
+ }
206
+ return attrCompletion(s2);
207
+ }));
208
+ let elt = new Element(s, attrs, attrVals);
209
+ byName[elt.name] = elt;
210
+ allElements.push(elt);
211
+ if (s.top)
212
+ topElements.push(elt);
213
+ }
214
+ if (!topElements.length)
215
+ topElements = allElements;
216
+ for (let i = 0; i < allElements.length; i++) {
217
+ let s = eltSpecs[i], elt = allElements[i];
218
+ if (s.children) {
219
+ for (let ch of s.children)
220
+ if (byName[ch])
221
+ elt.children.push(byName[ch]);
222
+ } else {
223
+ elt.children = allElements;
224
+ }
225
+ }
226
+ return (cx) => {
227
+ var _a;
228
+ let { doc } = cx.state, loc = findLocation(cx.state, cx.pos);
229
+ if (!loc || loc.type == "tag" && !cx.explicit)
230
+ return null;
231
+ let { type, from, context } = loc;
232
+ if (type == "openTag") {
233
+ let children = topElements;
234
+ let parentName = elementName$1(doc, context);
235
+ if (parentName) {
236
+ let parent = byName[parentName];
237
+ children = (parent === null || parent === void 0 ? void 0 : parent.children) || allElements;
238
+ }
239
+ return {
240
+ from,
241
+ options: children.map((ch) => ch.completion),
242
+ validFor: Identifier
243
+ };
244
+ } else if (type == "closeTag") {
245
+ let parentName = elementName$1(doc, context);
246
+ return parentName ? {
247
+ from,
248
+ to: cx.pos + (doc.sliceString(cx.pos, cx.pos + 1) == ">" ? 1 : 0),
249
+ options: [((_a = byName[parentName]) === null || _a === void 0 ? void 0 : _a.closeNameCompletion) || { label: parentName + ">", type: "type" }],
250
+ validFor: Identifier
251
+ } : null;
252
+ } else if (type == "attrName") {
253
+ let parent = byName[tagName(doc, context)];
254
+ return {
255
+ from,
256
+ options: (parent === null || parent === void 0 ? void 0 : parent.attrs) || globalAttrs,
257
+ validFor: Identifier
258
+ };
259
+ } else if (type == "attrValue") {
260
+ let attr = attrName(doc, context, from);
261
+ if (!attr)
262
+ return null;
263
+ let parent = byName[tagName(doc, context)];
264
+ let values = ((parent === null || parent === void 0 ? void 0 : parent.attrValues) || attrValues)[attr];
265
+ if (!values || !values.length)
266
+ return null;
267
+ return {
268
+ from,
269
+ to: cx.pos + (doc.sliceString(cx.pos, cx.pos + 1) == '"' ? 1 : 0),
270
+ options: values,
271
+ validFor: /^"[^"]*"?$/
272
+ };
273
+ } else if (type == "tag") {
274
+ let parentName = elementName$1(doc, context), parent = byName[parentName];
275
+ let closing = [], last = context && context.lastChild;
276
+ if (parentName && (!last || last.name != "CloseTag" || tagName(doc, last) != parentName))
277
+ closing.push(parent ? parent.closeCompletion : { label: "</" + parentName + ">", type: "type", boost: 2 });
278
+ let options = closing.concat(((parent === null || parent === void 0 ? void 0 : parent.children) || (context ? allElements : topElements)).map((e) => e.openCompletion));
279
+ if (context && (parent === null || parent === void 0 ? void 0 : parent.text.length)) {
280
+ let openTag = context.firstChild;
281
+ if (openTag.to > cx.pos - 20 && !/\S/.test(cx.state.sliceDoc(openTag.to, cx.pos)))
282
+ options = options.concat(parent.text);
283
+ }
284
+ return {
285
+ from,
286
+ options,
287
+ validFor: /^<\/?[:\-\.\w\u00b7-\uffff]*$/
288
+ };
289
+ } else {
290
+ return null;
291
+ }
292
+ };
293
+ }
294
+ const xmlLanguage = /* @__PURE__ */ LRLanguage.define({
295
+ name: "xml",
296
+ parser: /* @__PURE__ */ parser.configure({
297
+ props: [
298
+ /* @__PURE__ */ indentNodeProp.add({
299
+ Element(context) {
300
+ let closed = /^\s*<\//.test(context.textAfter);
301
+ return context.lineIndent(context.node.from) + (closed ? 0 : context.unit);
302
+ },
303
+ "OpenTag CloseTag SelfClosingTag"(context) {
304
+ return context.column(context.node.from) + context.unit;
305
+ }
306
+ }),
307
+ /* @__PURE__ */ foldNodeProp.add({
308
+ Element(subtree) {
309
+ let first = subtree.firstChild, last = subtree.lastChild;
310
+ if (!first || first.name != "OpenTag")
311
+ return null;
312
+ return { from: first.to, to: last.name == "CloseTag" ? last.from : subtree.to };
313
+ }
314
+ }),
315
+ /* @__PURE__ */ bracketMatchingHandle.add({
316
+ "OpenTag CloseTag": (node) => node.getChild("TagName")
317
+ })
318
+ ]
319
+ }),
320
+ languageData: {
321
+ commentTokens: { block: { open: "<!--", close: "-->" } },
322
+ indentOnInput: /^\s*<\/$/
323
+ }
324
+ });
325
+ function xml(conf = {}) {
326
+ let support = [xmlLanguage.data.of({
327
+ autocomplete: completeFromSchema(conf.elements || [], conf.attributes || [])
328
+ })];
329
+ if (conf.autoCloseTags !== false)
330
+ support.push(autoCloseTags);
331
+ return new LanguageSupport(xmlLanguage, support);
332
+ }
333
+ function elementName(doc, tree, max = doc.length) {
334
+ if (!tree)
335
+ return "";
336
+ let tag = tree.firstChild;
337
+ let name = tag && tag.getChild("TagName");
338
+ return name ? doc.sliceString(name.from, Math.min(name.to, max)) : "";
339
+ }
340
+ const autoCloseTags = /* @__PURE__ */ EditorView.inputHandler.of((view, from, to, text, insertTransaction) => {
341
+ if (view.composing || view.state.readOnly || from != to || text != ">" && text != "/" || !xmlLanguage.isActiveAt(view.state, from, -1))
342
+ return false;
343
+ let base = insertTransaction(), { state } = base;
344
+ let closeTags = state.changeByRange((range) => {
345
+ var _a, _b, _c;
346
+ let { head } = range;
347
+ let didType = state.doc.sliceString(head - 1, head) == text;
348
+ let after = syntaxTree(state).resolveInner(head, -1), name;
349
+ if (didType && text == ">" && after.name == "EndTag") {
350
+ let tag = after.parent;
351
+ if (((_b = (_a = tag.parent) === null || _a === void 0 ? void 0 : _a.lastChild) === null || _b === void 0 ? void 0 : _b.name) != "CloseTag" && (name = elementName(state.doc, tag.parent, head))) {
352
+ let to2 = head + (state.doc.sliceString(head, head + 1) === ">" ? 1 : 0);
353
+ let insert = `</${name}>`;
354
+ return { range, changes: { from: head, to: to2, insert } };
355
+ }
356
+ } else if (didType && text == "/" && after.name == "StartCloseTag") {
357
+ let base2 = after.parent;
358
+ if (after.from == head - 2 && ((_c = base2.lastChild) === null || _c === void 0 ? void 0 : _c.name) != "CloseTag" && (name = elementName(state.doc, base2, head))) {
359
+ let to2 = head + (state.doc.sliceString(head, head + 1) === ">" ? 1 : 0);
360
+ let insert = `${name}>`;
361
+ return {
362
+ range: EditorSelection.cursor(head + insert.length, -1),
363
+ changes: { from: head, to: to2, insert }
364
+ };
365
+ }
366
+ }
367
+ return { range };
368
+ });
369
+ if (closeTags.changes.empty)
370
+ return false;
371
+ view.dispatch([
372
+ base,
373
+ state.update(closeTags, {
374
+ userEvent: "input.complete",
375
+ scrollIntoView: true
376
+ })
377
+ ]);
378
+ return true;
379
+ });
380
+ export {
381
+ autoCloseTags,
382
+ completeFromSchema,
383
+ xml,
384
+ xmlLanguage
385
+ };