@omniviewdev/editors 4.0.0 → 5.0.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.
- package/dist/editors.css +1 -1
- package/dist/index.d.ts +135 -0
- package/dist/index.js +1749 -1261
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,285 +1,285 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import et, { forwardRef as _e, useRef as G, useState as me, useMemo as Oe, useEffect as U, useImperativeHandle as xt, useCallback as De, Suspense as kt, lazy as Rt, Children as Ft, isValidElement as Ut, useId as Yt, useLayoutEffect as St, useSyncExternalStore as Gt } from "react";
|
|
2
|
+
import { useTheme as Jt, Checkbox as Ve, Separator as Kt, Blockquote as Xt, Link as Zt, Table as be, CodeBlock as Qt, Code as er, Accordion as st, CommandList as ue, useCommandListConfig as tr, useCommandListStoreContext as rr, utf16ToUtf8 as nr, utf8ToUtf16 as or } from "@omniviewdev/base-ui";
|
|
3
|
+
import * as W from "monaco-editor";
|
|
4
|
+
import ir from "remark-gfm";
|
|
5
|
+
import sr from "rehype-raw";
|
|
6
|
+
import ar, { defaultSchema as Fe } from "rehype-sanitize";
|
|
7
7
|
import "@xterm/xterm/css/xterm.css";
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
if (
|
|
12
|
-
|
|
8
|
+
var je = { exports: {} }, Re = {};
|
|
9
|
+
var at;
|
|
10
|
+
function cr() {
|
|
11
|
+
if (at) return Re;
|
|
12
|
+
at = 1;
|
|
13
13
|
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
14
|
-
function r(n, c,
|
|
14
|
+
function r(n, c, i) {
|
|
15
15
|
var l = null;
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
for (var
|
|
19
|
-
|
|
20
|
-
} else
|
|
21
|
-
return c =
|
|
16
|
+
if (i !== void 0 && (l = "" + i), c.key !== void 0 && (l = "" + c.key), "key" in c) {
|
|
17
|
+
i = {};
|
|
18
|
+
for (var d in c)
|
|
19
|
+
d !== "key" && (i[d] = c[d]);
|
|
20
|
+
} else i = c;
|
|
21
|
+
return c = i.ref, {
|
|
22
22
|
$$typeof: e,
|
|
23
23
|
type: n,
|
|
24
24
|
key: l,
|
|
25
25
|
ref: c !== void 0 ? c : null,
|
|
26
|
-
props:
|
|
26
|
+
props: i
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
return
|
|
30
|
-
}
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
function
|
|
34
|
-
return
|
|
35
|
-
function e(
|
|
36
|
-
if (
|
|
37
|
-
if (typeof
|
|
38
|
-
return
|
|
39
|
-
if (typeof
|
|
40
|
-
switch (
|
|
41
|
-
case
|
|
29
|
+
return Re.Fragment = t, Re.jsx = r, Re.jsxs = r, Re;
|
|
30
|
+
}
|
|
31
|
+
var Se = {};
|
|
32
|
+
var ct;
|
|
33
|
+
function lr() {
|
|
34
|
+
return ct || (ct = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
35
|
+
function e(a) {
|
|
36
|
+
if (a == null) return null;
|
|
37
|
+
if (typeof a == "function")
|
|
38
|
+
return a.$$typeof === b ? null : a.displayName || a.name || null;
|
|
39
|
+
if (typeof a == "string") return a;
|
|
40
|
+
switch (a) {
|
|
41
|
+
case x:
|
|
42
42
|
return "Fragment";
|
|
43
|
-
case
|
|
43
|
+
case S:
|
|
44
44
|
return "Profiler";
|
|
45
|
-
case
|
|
45
|
+
case z:
|
|
46
46
|
return "StrictMode";
|
|
47
|
-
case
|
|
47
|
+
case N:
|
|
48
48
|
return "Suspense";
|
|
49
|
-
case
|
|
49
|
+
case q:
|
|
50
50
|
return "SuspenseList";
|
|
51
|
-
case
|
|
51
|
+
case K:
|
|
52
52
|
return "Activity";
|
|
53
53
|
}
|
|
54
|
-
if (typeof
|
|
55
|
-
switch (typeof
|
|
54
|
+
if (typeof a == "object")
|
|
55
|
+
switch (typeof a.tag == "number" && console.error(
|
|
56
56
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
57
|
-
),
|
|
57
|
+
), a.$$typeof) {
|
|
58
58
|
case H:
|
|
59
59
|
return "Portal";
|
|
60
|
-
case W:
|
|
61
|
-
return o.displayName || "Context";
|
|
62
60
|
case I:
|
|
63
|
-
return
|
|
64
|
-
case U:
|
|
65
|
-
var w = o.render;
|
|
66
|
-
return o = o.displayName, o || (o = w.displayName || w.name || "", o = o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"), o;
|
|
61
|
+
return a.displayName || "Context";
|
|
67
62
|
case D:
|
|
68
|
-
return
|
|
69
|
-
case
|
|
70
|
-
w =
|
|
63
|
+
return (a._context.displayName || "Context") + ".Consumer";
|
|
64
|
+
case B:
|
|
65
|
+
var w = a.render;
|
|
66
|
+
return a = a.displayName, a || (a = w.displayName || w.name || "", a = a !== "" ? "ForwardRef(" + a + ")" : "ForwardRef"), a;
|
|
67
|
+
case P:
|
|
68
|
+
return w = a.displayName || null, w !== null ? w : e(a.type) || "Memo";
|
|
69
|
+
case V:
|
|
70
|
+
w = a._payload, a = a._init;
|
|
71
71
|
try {
|
|
72
|
-
return e(
|
|
72
|
+
return e(a(w));
|
|
73
73
|
} catch {
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
return null;
|
|
77
77
|
}
|
|
78
|
-
function t(
|
|
79
|
-
return "" +
|
|
78
|
+
function t(a) {
|
|
79
|
+
return "" + a;
|
|
80
80
|
}
|
|
81
|
-
function r(
|
|
81
|
+
function r(a) {
|
|
82
82
|
try {
|
|
83
|
-
t(
|
|
83
|
+
t(a);
|
|
84
84
|
var w = !1;
|
|
85
85
|
} catch {
|
|
86
86
|
w = !0;
|
|
87
87
|
}
|
|
88
88
|
if (w) {
|
|
89
89
|
w = console;
|
|
90
|
-
var A = w.error,
|
|
90
|
+
var A = w.error, L = typeof Symbol == "function" && Symbol.toStringTag && a[Symbol.toStringTag] || a.constructor.name || "Object";
|
|
91
91
|
return A.call(
|
|
92
92
|
w,
|
|
93
93
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
94
|
-
|
|
95
|
-
), t(
|
|
94
|
+
L
|
|
95
|
+
), t(a);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
function n(
|
|
99
|
-
if (
|
|
100
|
-
if (typeof
|
|
98
|
+
function n(a) {
|
|
99
|
+
if (a === x) return "<>";
|
|
100
|
+
if (typeof a == "object" && a !== null && a.$$typeof === V)
|
|
101
101
|
return "<...>";
|
|
102
102
|
try {
|
|
103
|
-
var w = e(
|
|
103
|
+
var w = e(a);
|
|
104
104
|
return w ? "<" + w + ">" : "<...>";
|
|
105
105
|
} catch {
|
|
106
106
|
return "<...>";
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
function c() {
|
|
110
|
-
var
|
|
111
|
-
return
|
|
110
|
+
var a = o.A;
|
|
111
|
+
return a === null ? null : a.getOwner();
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function i() {
|
|
114
114
|
return Error("react-stack-top-frame");
|
|
115
115
|
}
|
|
116
|
-
function l(
|
|
117
|
-
if (
|
|
118
|
-
var w = Object.getOwnPropertyDescriptor(
|
|
116
|
+
function l(a) {
|
|
117
|
+
if (v.call(a, "key")) {
|
|
118
|
+
var w = Object.getOwnPropertyDescriptor(a, "key").get;
|
|
119
119
|
if (w && w.isReactWarning) return !1;
|
|
120
120
|
}
|
|
121
|
-
return
|
|
121
|
+
return a.key !== void 0;
|
|
122
122
|
}
|
|
123
|
-
function a
|
|
123
|
+
function d(a, w) {
|
|
124
124
|
function A() {
|
|
125
|
-
|
|
125
|
+
u || (u = !0, console.error(
|
|
126
126
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
127
127
|
w
|
|
128
128
|
));
|
|
129
129
|
}
|
|
130
|
-
A.isReactWarning = !0, Object.defineProperty(
|
|
130
|
+
A.isReactWarning = !0, Object.defineProperty(a, "key", {
|
|
131
131
|
get: A,
|
|
132
132
|
configurable: !0
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
var
|
|
137
|
-
return
|
|
135
|
+
function y() {
|
|
136
|
+
var a = e(this.type);
|
|
137
|
+
return f[a] || (f[a] = !0, console.error(
|
|
138
138
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
139
|
-
)),
|
|
139
|
+
)), a = this.props.ref, a !== void 0 ? a : null;
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
var
|
|
143
|
-
return
|
|
141
|
+
function h(a, w, A, L, F, O) {
|
|
142
|
+
var $ = A.ref;
|
|
143
|
+
return a = {
|
|
144
144
|
$$typeof: R,
|
|
145
|
-
type:
|
|
145
|
+
type: a,
|
|
146
146
|
key: w,
|
|
147
147
|
props: A,
|
|
148
|
-
_owner:
|
|
149
|
-
}, (
|
|
148
|
+
_owner: L
|
|
149
|
+
}, ($ !== void 0 ? $ : null) !== null ? Object.defineProperty(a, "ref", {
|
|
150
150
|
enumerable: !1,
|
|
151
|
-
get:
|
|
152
|
-
}) : Object.defineProperty(
|
|
151
|
+
get: y
|
|
152
|
+
}) : Object.defineProperty(a, "ref", { enumerable: !1, value: null }), a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
153
153
|
configurable: !1,
|
|
154
154
|
enumerable: !1,
|
|
155
155
|
writable: !0,
|
|
156
156
|
value: 0
|
|
157
|
-
}), Object.defineProperty(
|
|
157
|
+
}), Object.defineProperty(a, "_debugInfo", {
|
|
158
158
|
configurable: !1,
|
|
159
159
|
enumerable: !1,
|
|
160
160
|
writable: !0,
|
|
161
161
|
value: null
|
|
162
|
-
}), Object.defineProperty(
|
|
162
|
+
}), Object.defineProperty(a, "_debugStack", {
|
|
163
163
|
configurable: !1,
|
|
164
164
|
enumerable: !1,
|
|
165
165
|
writable: !0,
|
|
166
|
-
value:
|
|
167
|
-
}), Object.defineProperty(
|
|
166
|
+
value: F
|
|
167
|
+
}), Object.defineProperty(a, "_debugTask", {
|
|
168
168
|
configurable: !1,
|
|
169
169
|
enumerable: !1,
|
|
170
170
|
writable: !0,
|
|
171
171
|
value: O
|
|
172
|
-
}), Object.freeze && (Object.freeze(
|
|
172
|
+
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
var
|
|
176
|
-
if (
|
|
177
|
-
if (
|
|
178
|
-
if (
|
|
179
|
-
for (
|
|
180
|
-
|
|
181
|
-
Object.freeze && Object.freeze(
|
|
174
|
+
function k(a, w, A, L, F, O) {
|
|
175
|
+
var $ = w.children;
|
|
176
|
+
if ($ !== void 0)
|
|
177
|
+
if (L)
|
|
178
|
+
if (p($)) {
|
|
179
|
+
for (L = 0; L < $.length; L++)
|
|
180
|
+
j($[L]);
|
|
181
|
+
Object.freeze && Object.freeze($);
|
|
182
182
|
} else
|
|
183
183
|
console.error(
|
|
184
184
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
185
185
|
);
|
|
186
|
-
else
|
|
187
|
-
if (
|
|
188
|
-
|
|
186
|
+
else j($);
|
|
187
|
+
if (v.call(w, "key")) {
|
|
188
|
+
$ = e(a);
|
|
189
189
|
var J = Object.keys(w).filter(function(oe) {
|
|
190
190
|
return oe !== "key";
|
|
191
191
|
});
|
|
192
|
-
|
|
192
|
+
L = 0 < J.length ? "{key: someKey, " + J.join(": ..., ") + ": ...}" : "{key: someKey}", C[$ + L] || (J = 0 < J.length ? "{" + J.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
193
193
|
`A props object containing a "key" prop is being spread into JSX:
|
|
194
194
|
let props = %s;
|
|
195
195
|
<%s {...props} />
|
|
196
196
|
React keys must be passed directly to JSX without using spread:
|
|
197
197
|
let props = %s;
|
|
198
198
|
<%s key={someKey} {...props} />`,
|
|
199
|
-
j,
|
|
200
199
|
L,
|
|
200
|
+
$,
|
|
201
201
|
J,
|
|
202
|
-
|
|
203
|
-
),
|
|
202
|
+
$
|
|
203
|
+
), C[$ + L] = !0);
|
|
204
204
|
}
|
|
205
|
-
if (
|
|
205
|
+
if ($ = null, A !== void 0 && (r(A), $ = "" + A), l(w) && (r(w.key), $ = "" + w.key), "key" in w) {
|
|
206
206
|
A = {};
|
|
207
|
-
for (var
|
|
208
|
-
|
|
207
|
+
for (var Z in w)
|
|
208
|
+
Z !== "key" && (A[Z] = w[Z]);
|
|
209
209
|
} else A = w;
|
|
210
|
-
return
|
|
210
|
+
return $ && d(
|
|
211
211
|
A,
|
|
212
|
-
typeof
|
|
213
|
-
),
|
|
214
|
-
|
|
215
|
-
|
|
212
|
+
typeof a == "function" ? a.displayName || a.name || "Unknown" : a
|
|
213
|
+
), h(
|
|
214
|
+
a,
|
|
215
|
+
$,
|
|
216
216
|
A,
|
|
217
217
|
c(),
|
|
218
|
-
|
|
218
|
+
F,
|
|
219
219
|
O
|
|
220
220
|
);
|
|
221
221
|
}
|
|
222
|
-
function
|
|
223
|
-
m(
|
|
222
|
+
function j(a) {
|
|
223
|
+
m(a) ? a._store && (a._store.validated = 1) : typeof a == "object" && a !== null && a.$$typeof === V && (a._payload.status === "fulfilled" ? m(a._payload.value) && a._payload.value._store && (a._payload.value._store.validated = 1) : a._store && (a._store.validated = 1));
|
|
224
224
|
}
|
|
225
|
-
function m(
|
|
226
|
-
return typeof
|
|
225
|
+
function m(a) {
|
|
226
|
+
return typeof a == "object" && a !== null && a.$$typeof === R;
|
|
227
227
|
}
|
|
228
|
-
var T =
|
|
228
|
+
var T = et, R = /* @__PURE__ */ Symbol.for("react.transitional.element"), H = /* @__PURE__ */ Symbol.for("react.portal"), x = /* @__PURE__ */ Symbol.for("react.fragment"), z = /* @__PURE__ */ Symbol.for("react.strict_mode"), S = /* @__PURE__ */ Symbol.for("react.profiler"), D = /* @__PURE__ */ Symbol.for("react.consumer"), I = /* @__PURE__ */ Symbol.for("react.context"), B = /* @__PURE__ */ Symbol.for("react.forward_ref"), N = /* @__PURE__ */ Symbol.for("react.suspense"), q = /* @__PURE__ */ Symbol.for("react.suspense_list"), P = /* @__PURE__ */ Symbol.for("react.memo"), V = /* @__PURE__ */ Symbol.for("react.lazy"), K = /* @__PURE__ */ Symbol.for("react.activity"), b = /* @__PURE__ */ Symbol.for("react.client.reference"), o = T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, v = Object.prototype.hasOwnProperty, p = Array.isArray, s = console.createTask ? console.createTask : function() {
|
|
229
229
|
return null;
|
|
230
230
|
};
|
|
231
231
|
T = {
|
|
232
|
-
react_stack_bottom_frame: function(
|
|
233
|
-
return
|
|
232
|
+
react_stack_bottom_frame: function(a) {
|
|
233
|
+
return a();
|
|
234
234
|
}
|
|
235
235
|
};
|
|
236
|
-
var
|
|
236
|
+
var u, f = {}, g = T.react_stack_bottom_frame.bind(
|
|
237
237
|
T,
|
|
238
|
-
|
|
239
|
-
)(),
|
|
240
|
-
|
|
241
|
-
var
|
|
242
|
-
return
|
|
243
|
-
|
|
238
|
+
i
|
|
239
|
+
)(), _ = s(n(i)), C = {};
|
|
240
|
+
Se.Fragment = x, Se.jsx = function(a, w, A) {
|
|
241
|
+
var L = 1e4 > o.recentlyCreatedOwnerStacks++;
|
|
242
|
+
return k(
|
|
243
|
+
a,
|
|
244
244
|
w,
|
|
245
245
|
A,
|
|
246
246
|
!1,
|
|
247
|
-
|
|
248
|
-
|
|
247
|
+
L ? Error("react-stack-top-frame") : g,
|
|
248
|
+
L ? s(n(a)) : _
|
|
249
249
|
);
|
|
250
|
-
},
|
|
251
|
-
var
|
|
252
|
-
return
|
|
253
|
-
|
|
250
|
+
}, Se.jsxs = function(a, w, A) {
|
|
251
|
+
var L = 1e4 > o.recentlyCreatedOwnerStacks++;
|
|
252
|
+
return k(
|
|
253
|
+
a,
|
|
254
254
|
w,
|
|
255
255
|
A,
|
|
256
256
|
!0,
|
|
257
|
-
|
|
258
|
-
|
|
257
|
+
L ? Error("react-stack-top-frame") : g,
|
|
258
|
+
L ? s(n(a)) : _
|
|
259
259
|
);
|
|
260
260
|
};
|
|
261
|
-
})()),
|
|
262
|
-
}
|
|
263
|
-
var st;
|
|
264
|
-
function rr() {
|
|
265
|
-
return st || (st = 1, process.env.NODE_ENV === "production" ? Ee.exports = er() : Ee.exports = tr()), Ee.exports;
|
|
261
|
+
})()), Se;
|
|
266
262
|
}
|
|
267
|
-
var
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
263
|
+
var lt;
|
|
264
|
+
function ur() {
|
|
265
|
+
return lt || (lt = 1, process.env.NODE_ENV === "production" ? je.exports = cr() : je.exports = lr()), je.exports;
|
|
266
|
+
}
|
|
267
|
+
var E = ur(), Ne = { exports: {} }, Ue = {};
|
|
268
|
+
var ut;
|
|
269
|
+
function dr() {
|
|
270
|
+
if (ut) return Ue;
|
|
271
|
+
ut = 1;
|
|
272
|
+
var e = et.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
273
|
+
return Ue.c = function(t) {
|
|
274
274
|
return e.H.useMemoCache(t);
|
|
275
|
-
},
|
|
276
|
-
}
|
|
277
|
-
var
|
|
278
|
-
var
|
|
279
|
-
function
|
|
280
|
-
return
|
|
281
|
-
var e =
|
|
282
|
-
|
|
275
|
+
}, Ue;
|
|
276
|
+
}
|
|
277
|
+
var Ye = {};
|
|
278
|
+
var dt;
|
|
279
|
+
function fr() {
|
|
280
|
+
return dt || (dt = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
281
|
+
var e = et.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
282
|
+
Ye.c = function(t) {
|
|
283
283
|
var r = e.H;
|
|
284
284
|
return r === null && console.error(
|
|
285
285
|
`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
@@ -289,27 +289,27 @@ function or() {
|
|
|
289
289
|
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`
|
|
290
290
|
), r.useMemoCache(t);
|
|
291
291
|
};
|
|
292
|
-
})()),
|
|
292
|
+
})()), Ye;
|
|
293
293
|
}
|
|
294
|
-
var
|
|
295
|
-
function
|
|
296
|
-
return
|
|
294
|
+
var ft;
|
|
295
|
+
function gr() {
|
|
296
|
+
return ft || (ft = 1, process.env.NODE_ENV === "production" ? Ne.exports = dr() : Ne.exports = fr()), Ne.exports;
|
|
297
297
|
}
|
|
298
|
-
var
|
|
299
|
-
function
|
|
298
|
+
var Ce = gr();
|
|
299
|
+
function Et(e) {
|
|
300
300
|
return typeof document > "u" ? null : e?.closest("[data-ov-theme]") ?? e ?? document.documentElement;
|
|
301
301
|
}
|
|
302
|
-
function
|
|
303
|
-
const t =
|
|
302
|
+
function tt(e) {
|
|
303
|
+
const t = Et(e);
|
|
304
304
|
return t ? getComputedStyle(t) : null;
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
return
|
|
306
|
+
function To(e, t) {
|
|
307
|
+
return tt(t)?.getPropertyValue(e).trim() ?? "";
|
|
308
308
|
}
|
|
309
|
-
function
|
|
310
|
-
const e =
|
|
309
|
+
function rt() {
|
|
310
|
+
const e = Ce.c(2), {
|
|
311
311
|
activeTheme: t
|
|
312
|
-
} =
|
|
312
|
+
} = Jt();
|
|
313
313
|
let r;
|
|
314
314
|
return e[0] !== t ? (r = {
|
|
315
315
|
id: t.id,
|
|
@@ -317,22 +317,22 @@ function Ke() {
|
|
|
317
317
|
registration: t
|
|
318
318
|
}, e[0] = t, e[1] = r) : r = e[1], r;
|
|
319
319
|
}
|
|
320
|
-
const
|
|
320
|
+
const mr = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i, hr = /^rgba?\(\s*([\d.]+)(?:\s*,\s*|\s+)([\d.]+)(?:\s*,\s*|\s+)([\d.]+)(?:\s*(?:,|\/)\s*([\d.]+))?\s*\)$/i;
|
|
321
321
|
function he(e) {
|
|
322
322
|
return Math.max(0, Math.min(255, Math.round(e))).toString(16).padStart(2, "0");
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function Ge(e) {
|
|
325
325
|
const t = e.trim();
|
|
326
|
-
if (
|
|
327
|
-
const r = t.match(
|
|
326
|
+
if (mr.test(t)) return t;
|
|
327
|
+
const r = t.match(hr);
|
|
328
328
|
if (!r) return "";
|
|
329
329
|
const n = r[4] === void 0 ? 1 : Number(r[4]), c = `#${he(Number(r[1]))}${he(Number(r[2]))}${he(Number(r[3]))}`;
|
|
330
330
|
return n >= 1 ? c : `${c}${he(n * 255)}`;
|
|
331
331
|
}
|
|
332
|
-
function
|
|
332
|
+
function pr(e) {
|
|
333
333
|
if (!e)
|
|
334
334
|
return {
|
|
335
|
-
normalize:
|
|
335
|
+
normalize: Ge,
|
|
336
336
|
dispose() {
|
|
337
337
|
}
|
|
338
338
|
};
|
|
@@ -341,19 +341,19 @@ function cr(e) {
|
|
|
341
341
|
let r;
|
|
342
342
|
return {
|
|
343
343
|
normalize(n) {
|
|
344
|
-
const c =
|
|
344
|
+
const c = Ge(n);
|
|
345
345
|
if (c) return c;
|
|
346
346
|
if (t.style.color = "", t.style.color = n.trim(), !t.style.color) return "";
|
|
347
|
-
const
|
|
347
|
+
const i = getComputedStyle(t).color, l = Ge(i);
|
|
348
348
|
if (l) return l;
|
|
349
|
-
if (!/^(?:color|lab|lch|oklab|oklch)\(/i.test(
|
|
349
|
+
if (!/^(?:color|lab|lch|oklab|oklch)\(/i.test(i)) return "";
|
|
350
350
|
try {
|
|
351
351
|
if (r ??= t.getContext("2d", {
|
|
352
352
|
willReadFrequently: !0
|
|
353
|
-
}), !r || (r.clearRect(0, 0, 1, 1), r.fillStyle = "#010203", r.fillStyle =
|
|
353
|
+
}), !r || (r.clearRect(0, 0, 1, 1), r.fillStyle = "#010203", r.fillStyle = i, r.fillStyle === "#010203")) return "";
|
|
354
354
|
r.fillRect(0, 0, 1, 1);
|
|
355
|
-
const
|
|
356
|
-
return
|
|
355
|
+
const d = r.getImageData(0, 0, 1, 1).data, y = `#${he(d[0])}${he(d[1])}${he(d[2])}`;
|
|
356
|
+
return d[3] === 255 ? y : `${y}${he(d[3])}`;
|
|
357
357
|
} catch {
|
|
358
358
|
return "";
|
|
359
359
|
}
|
|
@@ -363,7 +363,7 @@ function cr(e) {
|
|
|
363
363
|
}
|
|
364
364
|
};
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function yr(e) {
|
|
367
367
|
switch (e) {
|
|
368
368
|
case "light":
|
|
369
369
|
case "solarized-light":
|
|
@@ -376,30 +376,30 @@ function lr(e) {
|
|
|
376
376
|
return "vs-dark";
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function vr(e, t, r, n, c, i) {
|
|
380
380
|
const l = n.normalize(r?.getPropertyValue(t).trim() ?? "");
|
|
381
381
|
if (!l) return null;
|
|
382
|
-
const
|
|
382
|
+
const d = {
|
|
383
383
|
token: e,
|
|
384
384
|
foreground: l.slice(1)
|
|
385
385
|
};
|
|
386
|
-
return c && (
|
|
386
|
+
return c && (d.fontStyle = r?.getPropertyValue(c).trim() || i || ""), d;
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function br(e) {
|
|
389
389
|
const t = {};
|
|
390
390
|
for (const [r, n] of Object.entries(e))
|
|
391
391
|
n && (t[r] = n);
|
|
392
392
|
return t;
|
|
393
393
|
}
|
|
394
|
-
function
|
|
395
|
-
const r =
|
|
394
|
+
function $e(e, t) {
|
|
395
|
+
const r = Et(t), n = tt(r), c = pr(r), i = (d, y, h, k) => vr(d, y, n, c, h, k), l = (d) => c.normalize(n?.getPropertyValue(d).trim() ?? "");
|
|
396
396
|
try {
|
|
397
|
-
const
|
|
397
|
+
const d = [i("comment", "--ov-syntax-comment", "--ov-syntax-style-comment", "italic"), i("string", "--ov-syntax-string"), i("string.escape", "--ov-syntax-string-escape"), i("number", "--ov-syntax-number"), i("keyword", "--ov-syntax-keyword", "--ov-syntax-style-keyword"), i("keyword.control", "--ov-syntax-keyword-control"), i("keyword.operator", "--ov-syntax-keyword-operator"), i("type", "--ov-syntax-type", "--ov-syntax-style-type"), i("type.identifier", "--ov-syntax-type"), i("class", "--ov-syntax-class"), i("interface", "--ov-syntax-interface"), i("function", "--ov-syntax-function", "--ov-syntax-style-function"), i("function.declaration", "--ov-syntax-function"), i("method", "--ov-syntax-method"), i("variable", "--ov-syntax-variable"), i("parameter", "--ov-syntax-parameter"), i("property", "--ov-syntax-property"), i("namespace", "--ov-syntax-namespace"), i("decorator", "--ov-syntax-decorator"), i("regexp", "--ov-syntax-regexp"), i("operator", "--ov-syntax-operator"), i("delimiter", "--ov-syntax-punctuation"), i("delimiter.bracket", "--ov-syntax-punctuation")].filter((y) => y !== null);
|
|
398
398
|
return {
|
|
399
|
-
base:
|
|
399
|
+
base: yr(e),
|
|
400
400
|
inherit: !0,
|
|
401
|
-
rules:
|
|
402
|
-
colors:
|
|
401
|
+
rules: d,
|
|
402
|
+
colors: br({
|
|
403
403
|
"editor.background": l("--ov-color-editor-bg"),
|
|
404
404
|
"editor.foreground": l("--ov-color-editor-fg"),
|
|
405
405
|
"editorCursor.foreground": l("--ov-color-editor-cursor"),
|
|
@@ -442,7 +442,7 @@ function Oe(e, t) {
|
|
|
442
442
|
c.dispose();
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
|
-
const
|
|
445
|
+
const pe = "ov-theme", wr = {
|
|
446
446
|
js: "javascript",
|
|
447
447
|
jsx: "javascript",
|
|
448
448
|
ts: "typescript",
|
|
@@ -501,32 +501,32 @@ const ge = "ov-theme", fr = {
|
|
|
501
501
|
vue: "html",
|
|
502
502
|
svelte: "html"
|
|
503
503
|
};
|
|
504
|
-
function
|
|
504
|
+
function _r(e) {
|
|
505
505
|
const t = e.toLowerCase(), r = t.split("/").pop() ?? t;
|
|
506
506
|
if (r === "dockerfile") return "dockerfile";
|
|
507
507
|
if (r === "makefile") return "makefile";
|
|
508
508
|
const n = r.split(".").pop();
|
|
509
509
|
if (n)
|
|
510
|
-
return
|
|
510
|
+
return wr[n];
|
|
511
511
|
}
|
|
512
512
|
function se(...e) {
|
|
513
513
|
}
|
|
514
|
-
function
|
|
515
|
-
let r = 0, n = 0, c = -1,
|
|
514
|
+
function Cr(e, t) {
|
|
515
|
+
let r = 0, n = 0, c = -1, i = -1;
|
|
516
516
|
for (; n < t.length; )
|
|
517
517
|
if (r < e.length && (e[r] === t[n] || e[r] === "?"))
|
|
518
518
|
r++, n++;
|
|
519
519
|
else if (r < e.length && e[r] === "*")
|
|
520
|
-
c = r,
|
|
520
|
+
c = r, i = n, r++;
|
|
521
521
|
else if (c >= 0)
|
|
522
|
-
r = c + 1,
|
|
522
|
+
r = c + 1, i++, n = i;
|
|
523
523
|
else
|
|
524
524
|
return !1;
|
|
525
525
|
for (; r < e.length && e[r] === "*"; )
|
|
526
526
|
r++;
|
|
527
527
|
return r === e.length;
|
|
528
528
|
}
|
|
529
|
-
class
|
|
529
|
+
class xr {
|
|
530
530
|
_schemas = /* @__PURE__ */ new Map();
|
|
531
531
|
_listeners = /* @__PURE__ */ new Set();
|
|
532
532
|
_yamlHandle = null;
|
|
@@ -570,7 +570,7 @@ class gr {
|
|
|
570
570
|
* model URI string. Uses the same glob-like matching that monaco-yaml uses.
|
|
571
571
|
*/
|
|
572
572
|
getSchemasForUri(t) {
|
|
573
|
-
return this.schemas.filter((r) => r.fileMatch.some((n) =>
|
|
573
|
+
return this.schemas.filter((r) => r.fileMatch.some((n) => Cr(n, t)));
|
|
574
574
|
}
|
|
575
575
|
/** Whether the YAML handle has been injected (workers initialized). */
|
|
576
576
|
get isYamlReady() {
|
|
@@ -615,10 +615,10 @@ class gr {
|
|
|
615
615
|
applyJsonSchemas(t) {
|
|
616
616
|
const r = t, n = {
|
|
617
617
|
validate: !0,
|
|
618
|
-
schemas: this.schemas.map((
|
|
619
|
-
uri:
|
|
620
|
-
fileMatch:
|
|
621
|
-
schema:
|
|
618
|
+
schemas: this.schemas.map((i) => ({
|
|
619
|
+
uri: i.uri,
|
|
620
|
+
fileMatch: i.fileMatch,
|
|
621
|
+
schema: i.schema
|
|
622
622
|
}))
|
|
623
623
|
}, c = r.json?.jsonDefaults ?? r.languages?.json?.jsonDefaults;
|
|
624
624
|
se("applyJsonSchemas() —", this.schemas.length, "schemas, jsonDefaults available:", !!c), c?.setDiagnosticsOptions(n);
|
|
@@ -640,42 +640,42 @@ class gr {
|
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
642
|
}
|
|
643
|
-
const fe = new
|
|
644
|
-
Root:
|
|
645
|
-
Inner:
|
|
643
|
+
const fe = new xr(), kr = "_Root_1729c_1", Rr = "_Inner_1729c_17", gt = {
|
|
644
|
+
Root: kr,
|
|
645
|
+
Inner: Rr
|
|
646
646
|
};
|
|
647
|
-
function
|
|
647
|
+
function Pe(...e) {
|
|
648
648
|
}
|
|
649
|
-
function
|
|
649
|
+
function Sr(...e) {
|
|
650
650
|
return e.filter(Boolean).join(" ");
|
|
651
651
|
}
|
|
652
|
-
function
|
|
652
|
+
function mt(e, t, r) {
|
|
653
653
|
if (r) {
|
|
654
|
-
const n =
|
|
655
|
-
|
|
656
|
-
const c =
|
|
657
|
-
return c ||
|
|
654
|
+
const n = W.Uri.parse(r);
|
|
655
|
+
Pe("getOrCreateModel — parsed URI:", n.toString(), "| language:", t);
|
|
656
|
+
const c = W.editor.getModel(n);
|
|
657
|
+
return c || W.editor.createModel(e, t, n);
|
|
658
658
|
}
|
|
659
|
-
return
|
|
659
|
+
return W.editor.createModel(e, t);
|
|
660
660
|
}
|
|
661
|
-
function
|
|
661
|
+
function Tt(e) {
|
|
662
662
|
switch (e) {
|
|
663
|
-
case
|
|
663
|
+
case W.MarkerSeverity.Error:
|
|
664
664
|
return "error";
|
|
665
|
-
case
|
|
665
|
+
case W.MarkerSeverity.Warning:
|
|
666
666
|
return "warning";
|
|
667
|
-
case
|
|
667
|
+
case W.MarkerSeverity.Info:
|
|
668
668
|
return "info";
|
|
669
669
|
default:
|
|
670
670
|
return "hint";
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
|
-
function
|
|
674
|
-
return
|
|
673
|
+
function ht(e) {
|
|
674
|
+
return W.editor.getModelMarkers({
|
|
675
675
|
resource: e.uri
|
|
676
676
|
}).map((t) => ({
|
|
677
677
|
message: t.message,
|
|
678
|
-
severity:
|
|
678
|
+
severity: Tt(t.severity),
|
|
679
679
|
startLineNumber: t.startLineNumber,
|
|
680
680
|
startColumn: t.startColumn,
|
|
681
681
|
endLineNumber: t.endLineNumber,
|
|
@@ -684,39 +684,39 @@ function ft(e) {
|
|
|
684
684
|
code: typeof t.code == "string" ? t.code : t.code?.value
|
|
685
685
|
}));
|
|
686
686
|
}
|
|
687
|
-
const
|
|
687
|
+
const Mt = _e(function({
|
|
688
688
|
value: t,
|
|
689
689
|
onChange: r,
|
|
690
690
|
onMount: n,
|
|
691
691
|
onDiagnostics: c,
|
|
692
|
-
onCursorChange:
|
|
692
|
+
onCursorChange: i,
|
|
693
693
|
language: l,
|
|
694
|
-
filename:
|
|
695
|
-
readOnly:
|
|
696
|
-
lineNumbers:
|
|
697
|
-
minimap:
|
|
698
|
-
wordWrap:
|
|
694
|
+
filename: d,
|
|
695
|
+
readOnly: y = !1,
|
|
696
|
+
lineNumbers: h = !0,
|
|
697
|
+
minimap: k = !1,
|
|
698
|
+
wordWrap: j = !1,
|
|
699
699
|
tabSize: m = 2,
|
|
700
700
|
diagnostics: T = !1,
|
|
701
701
|
quickSuggestions: R = !1,
|
|
702
702
|
syntaxHighlighting: H = !0,
|
|
703
|
-
height:
|
|
704
|
-
width:
|
|
705
|
-
bordered:
|
|
706
|
-
className:
|
|
707
|
-
},
|
|
708
|
-
const
|
|
709
|
-
if (
|
|
703
|
+
height: x = "100%",
|
|
704
|
+
width: z = "100%",
|
|
705
|
+
bordered: S = !0,
|
|
706
|
+
className: D
|
|
707
|
+
}, I) {
|
|
708
|
+
const B = rt(), N = G(null), q = G(null), [P, V] = me(!1), K = G(!1), b = G(null), o = G(null), v = G(null), p = l ?? (d ? _r(d) : void 0), s = Oe(() => {
|
|
709
|
+
if (p === "json" && t)
|
|
710
710
|
try {
|
|
711
711
|
return JSON.stringify(JSON.parse(t), null, 2);
|
|
712
712
|
} catch {
|
|
713
713
|
return t;
|
|
714
714
|
}
|
|
715
715
|
return t;
|
|
716
|
-
}, [
|
|
717
|
-
|
|
718
|
-
if (!
|
|
719
|
-
|
|
716
|
+
}, [p, t]);
|
|
717
|
+
U(() => {
|
|
718
|
+
if (!q.current) return;
|
|
719
|
+
W.editor.defineTheme(pe, $e(B.base, q.current)), W.editor.setTheme(pe), W.languages.typescript.typescriptDefaults.setCompilerOptions({
|
|
720
720
|
jsx: 2,
|
|
721
721
|
// JsxEmit.React
|
|
722
722
|
jsxFactory: "React.createElement",
|
|
@@ -725,16 +725,16 @@ const br = ve(function({
|
|
|
725
725
|
target: 99
|
|
726
726
|
// ESNext
|
|
727
727
|
});
|
|
728
|
-
const
|
|
729
|
-
|
|
730
|
-
const
|
|
731
|
-
model:
|
|
732
|
-
readOnly:
|
|
733
|
-
lineNumbers:
|
|
728
|
+
const g = mt(s, H ? p : "plaintext", d);
|
|
729
|
+
Pe(" model created — uri:", g.uri.toString());
|
|
730
|
+
const _ = W.editor.create(q.current, {
|
|
731
|
+
model: g,
|
|
732
|
+
readOnly: y,
|
|
733
|
+
lineNumbers: h ? "on" : "off",
|
|
734
734
|
minimap: {
|
|
735
|
-
enabled:
|
|
735
|
+
enabled: k
|
|
736
736
|
},
|
|
737
|
-
wordWrap:
|
|
737
|
+
wordWrap: j ? "on" : "off",
|
|
738
738
|
quickSuggestions: R ? {
|
|
739
739
|
other: !0,
|
|
740
740
|
strings: !0,
|
|
@@ -747,34 +747,34 @@ const br = ve(function({
|
|
|
747
747
|
tabSize: m,
|
|
748
748
|
renderValidationDecorations: T ? "on" : "off"
|
|
749
749
|
});
|
|
750
|
-
return
|
|
751
|
-
|
|
752
|
-
const
|
|
753
|
-
|
|
750
|
+
return N.current = _, fe.applyYamlSchemas(), fe.applyJsonSchemas(W), n?.(_, W), V(!0), () => {
|
|
751
|
+
b.current?.dispose(), b.current = null, o.current?.dispose(), o.current = null, v.current?.dispose(), v.current = null;
|
|
752
|
+
const C = _.getModel();
|
|
753
|
+
_.setModel(null), C?.dispose(), _.dispose(), N.current = null, V(!1);
|
|
754
754
|
};
|
|
755
|
-
}, []),
|
|
756
|
-
const
|
|
757
|
-
if (!(!
|
|
758
|
-
if (
|
|
759
|
-
|
|
760
|
-
else if (
|
|
761
|
-
const
|
|
762
|
-
if (!
|
|
763
|
-
|
|
764
|
-
range:
|
|
765
|
-
text:
|
|
755
|
+
}, []), U(() => {
|
|
756
|
+
const g = N.current;
|
|
757
|
+
if (!(!g || !P || s === void 0)) {
|
|
758
|
+
if (g.getOption(W.editor.EditorOption.readOnly))
|
|
759
|
+
g.setValue(s);
|
|
760
|
+
else if (s !== g.getValue()) {
|
|
761
|
+
const _ = g.getModel();
|
|
762
|
+
if (!_) return;
|
|
763
|
+
K.current = !0, g.executeEdits("", [{
|
|
764
|
+
range: _.getFullModelRange(),
|
|
765
|
+
text: s,
|
|
766
766
|
forceMoveMarkers: !0
|
|
767
|
-
}]),
|
|
767
|
+
}]), g.pushUndoStop(), K.current = !1;
|
|
768
768
|
}
|
|
769
769
|
}
|
|
770
|
-
}, [
|
|
771
|
-
!
|
|
772
|
-
readOnly:
|
|
773
|
-
lineNumbers:
|
|
770
|
+
}, [s, P]), U(() => {
|
|
771
|
+
!N.current || !P || N.current.updateOptions({
|
|
772
|
+
readOnly: y,
|
|
773
|
+
lineNumbers: h ? "on" : "off",
|
|
774
774
|
minimap: {
|
|
775
|
-
enabled:
|
|
775
|
+
enabled: k
|
|
776
776
|
},
|
|
777
|
-
wordWrap:
|
|
777
|
+
wordWrap: j ? "on" : "off",
|
|
778
778
|
quickSuggestions: R ? {
|
|
779
779
|
other: !0,
|
|
780
780
|
strings: !0,
|
|
@@ -783,181 +783,184 @@ const br = ve(function({
|
|
|
783
783
|
tabSize: m,
|
|
784
784
|
renderValidationDecorations: T ? "on" : "off"
|
|
785
785
|
});
|
|
786
|
-
}, [
|
|
787
|
-
if (!
|
|
788
|
-
const
|
|
789
|
-
if (
|
|
790
|
-
const
|
|
791
|
-
|
|
792
|
-
}
|
|
793
|
-
}, [
|
|
794
|
-
const
|
|
795
|
-
|
|
796
|
-
const
|
|
797
|
-
if (!
|
|
798
|
-
|
|
799
|
-
const
|
|
800
|
-
|
|
801
|
-
const
|
|
802
|
-
|
|
803
|
-
}, [
|
|
804
|
-
|
|
805
|
-
}, [
|
|
806
|
-
!
|
|
807
|
-
|
|
786
|
+
}, [y, h, k, j, R, m, T, P]), U(() => {
|
|
787
|
+
if (!N.current || !P) return;
|
|
788
|
+
const g = N.current.getModel();
|
|
789
|
+
if (g) {
|
|
790
|
+
const _ = H ? p ?? "plaintext" : "plaintext";
|
|
791
|
+
W.editor.setModelLanguage(g, _);
|
|
792
|
+
}
|
|
793
|
+
}, [p, H, P]);
|
|
794
|
+
const u = G(d);
|
|
795
|
+
U(() => {
|
|
796
|
+
const g = N.current;
|
|
797
|
+
if (!g || !P || u.current === d) return;
|
|
798
|
+
Pe("filename changed:", u.current, "→", d), u.current = d;
|
|
799
|
+
const _ = g.getModel(), C = _?.getValue?.() ?? s;
|
|
800
|
+
g.setModel(null), _?.dispose();
|
|
801
|
+
const a = mt(C, H ? p : "plaintext", d);
|
|
802
|
+
g.setModel(a), Pe(" new model set — uri:", a.uri.toString());
|
|
803
|
+
}, [d, P, p, H, s]), U(() => {
|
|
804
|
+
P && (W.editor.defineTheme(pe, $e(B.base, q.current)), W.editor.setTheme(pe));
|
|
805
|
+
}, [P, B.registration]), U(() => {
|
|
806
|
+
!N.current || !P || (b.current?.dispose(), r && (b.current = N.current.onDidChangeModelContent(() => {
|
|
807
|
+
K.current || r(N.current.getValue());
|
|
808
808
|
})));
|
|
809
|
-
}, [r,
|
|
810
|
-
|
|
811
|
-
const
|
|
812
|
-
if (!
|
|
813
|
-
const
|
|
814
|
-
|
|
809
|
+
}, [r, P]), U(() => {
|
|
810
|
+
P && (o.current?.dispose(), c && (o.current = W.editor.onDidChangeMarkers((g) => {
|
|
811
|
+
const _ = N.current?.getModel();
|
|
812
|
+
if (!_) return;
|
|
813
|
+
const C = _.uri.toString();
|
|
814
|
+
g.some((a) => a.toString() === C) && c(ht(_));
|
|
815
815
|
})));
|
|
816
|
-
}, [c,
|
|
817
|
-
!
|
|
818
|
-
|
|
819
|
-
lineNumber:
|
|
820
|
-
column:
|
|
816
|
+
}, [c, P]), U(() => {
|
|
817
|
+
!N.current || !P || (v.current?.dispose(), i && (v.current = N.current.onDidChangeCursorPosition((g) => {
|
|
818
|
+
i({
|
|
819
|
+
lineNumber: g.position.lineNumber,
|
|
820
|
+
column: g.position.column
|
|
821
821
|
});
|
|
822
822
|
})));
|
|
823
|
-
}, [
|
|
824
|
-
if (
|
|
823
|
+
}, [i, P]), U(() => {
|
|
824
|
+
if (P)
|
|
825
825
|
return fe.onChange(() => {
|
|
826
|
-
fe.applyYamlSchemas(), fe.applyJsonSchemas(
|
|
826
|
+
fe.applyYamlSchemas(), fe.applyJsonSchemas(W);
|
|
827
827
|
});
|
|
828
|
-
}, [
|
|
829
|
-
getEditor: () =>
|
|
830
|
-
getMonaco: () =>
|
|
831
|
-
focus: () =>
|
|
828
|
+
}, [P]), xt(I, () => ({
|
|
829
|
+
getEditor: () => N.current,
|
|
830
|
+
getMonaco: () => W,
|
|
831
|
+
focus: () => N.current?.focus(),
|
|
832
832
|
getDiagnostics: () => {
|
|
833
|
-
const
|
|
834
|
-
return
|
|
833
|
+
const g = N.current?.getModel();
|
|
834
|
+
return g ? ht(g) : [];
|
|
835
835
|
},
|
|
836
836
|
getDebugState: () => {
|
|
837
|
-
const
|
|
838
|
-
resource:
|
|
839
|
-
}) : [],
|
|
837
|
+
const g = N.current, _ = g?.getModel() ?? null, C = _ ? W.editor.getModelMarkers({
|
|
838
|
+
resource: _.uri
|
|
839
|
+
}) : [], a = _?.uri.toString() ?? null, w = {
|
|
840
840
|
error: 0,
|
|
841
841
|
warning: 0,
|
|
842
842
|
info: 0,
|
|
843
843
|
hint: 0
|
|
844
844
|
}, A = {};
|
|
845
|
-
for (const
|
|
846
|
-
const J =
|
|
845
|
+
for (const $ of C) {
|
|
846
|
+
const J = Tt($.severity);
|
|
847
847
|
w[J]++;
|
|
848
|
-
const
|
|
849
|
-
A[
|
|
848
|
+
const Z = $.source ?? "unknown";
|
|
849
|
+
A[Z] = (A[Z] ?? 0) + 1;
|
|
850
850
|
}
|
|
851
|
-
const
|
|
852
|
-
uri:
|
|
853
|
-
name:
|
|
854
|
-
fileMatch:
|
|
855
|
-
})) : [],
|
|
851
|
+
const L = a ? fe.getSchemasForUri(a).map(($) => ({
|
|
852
|
+
uri: $.uri,
|
|
853
|
+
name: $.name,
|
|
854
|
+
fileMatch: $.fileMatch
|
|
855
|
+
})) : [], F = g?.getPosition() ?? null, O = g?.getSelections() ?? [];
|
|
856
856
|
return {
|
|
857
|
-
modelUri:
|
|
858
|
-
modelLanguage:
|
|
859
|
-
modelLineCount:
|
|
860
|
-
modelContentLength:
|
|
861
|
-
modelVersionId:
|
|
862
|
-
modelEOL:
|
|
863
|
-
cursorPosition:
|
|
864
|
-
lineNumber:
|
|
865
|
-
column:
|
|
857
|
+
modelUri: a,
|
|
858
|
+
modelLanguage: _?.getLanguageId() ?? null,
|
|
859
|
+
modelLineCount: _?.getLineCount() ?? 0,
|
|
860
|
+
modelContentLength: _?.getValueLength() ?? 0,
|
|
861
|
+
modelVersionId: _?.getVersionId() ?? 0,
|
|
862
|
+
modelEOL: _?.getEOL() ?? null,
|
|
863
|
+
cursorPosition: F ? {
|
|
864
|
+
lineNumber: F.lineNumber,
|
|
865
|
+
column: F.column
|
|
866
866
|
} : null,
|
|
867
|
-
selections: O.map((
|
|
868
|
-
startLineNumber:
|
|
869
|
-
startColumn:
|
|
870
|
-
endLineNumber:
|
|
871
|
-
endColumn:
|
|
867
|
+
selections: O.map(($) => ({
|
|
868
|
+
startLineNumber: $.startLineNumber,
|
|
869
|
+
startColumn: $.startColumn,
|
|
870
|
+
endLineNumber: $.endLineNumber,
|
|
871
|
+
endColumn: $.endColumn
|
|
872
872
|
})),
|
|
873
|
-
diagnosticsTotal:
|
|
873
|
+
diagnosticsTotal: C.length,
|
|
874
874
|
diagnosticsBySeverity: w,
|
|
875
875
|
diagnosticsBySource: A,
|
|
876
876
|
registeredSchemaCount: fe.schemas.length,
|
|
877
|
-
matchingSchemas:
|
|
878
|
-
isReadOnly:
|
|
879
|
-
isFocused:
|
|
880
|
-
totalModelCount:
|
|
881
|
-
registeredLanguageCount:
|
|
877
|
+
matchingSchemas: L,
|
|
878
|
+
isReadOnly: g?.getOption(W.editor.EditorOption.readOnly) ?? !1,
|
|
879
|
+
isFocused: g?.hasWidgetFocus() ?? !1,
|
|
880
|
+
totalModelCount: W.editor.getModels().length,
|
|
881
|
+
registeredLanguageCount: W.languages.getLanguages().length,
|
|
882
882
|
yamlHandleSet: fe.isYamlReady
|
|
883
883
|
};
|
|
884
884
|
}
|
|
885
885
|
}));
|
|
886
|
-
const
|
|
887
|
-
return /* @__PURE__ */
|
|
888
|
-
"--_editor-height":
|
|
889
|
-
"--_editor-width":
|
|
890
|
-
}, "data-testid": "code-editor", ...
|
|
886
|
+
const f = (g) => typeof g == "number" ? `${g}px` : g;
|
|
887
|
+
return /* @__PURE__ */ E.jsx("div", { className: Sr(gt.Root, D), style: {
|
|
888
|
+
"--_editor-height": f(x),
|
|
889
|
+
"--_editor-width": f(z)
|
|
890
|
+
}, "data-testid": "code-editor", ...S ? {} : {
|
|
891
891
|
"data-borderless": ""
|
|
892
|
-
}, children: /* @__PURE__ */
|
|
892
|
+
}, children: /* @__PURE__ */ E.jsx("div", { ref: q, className: gt.Inner }) });
|
|
893
893
|
});
|
|
894
|
-
|
|
895
|
-
const
|
|
896
|
-
|
|
897
|
-
|
|
894
|
+
Mt.displayName = "CodeEditor";
|
|
895
|
+
const Er = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
896
|
+
__proto__: null,
|
|
897
|
+
CodeEditor: Mt
|
|
898
|
+
}, Symbol.toStringTag, { value: "Module" })), Tr = "_Root_1ltbg_1", Mr = "_Inner_1ltbg_16", pt = {
|
|
899
|
+
Root: Tr,
|
|
900
|
+
Inner: Mr
|
|
898
901
|
};
|
|
899
|
-
function
|
|
902
|
+
function jr(...e) {
|
|
900
903
|
return e.filter(Boolean).join(" ");
|
|
901
904
|
}
|
|
902
|
-
const
|
|
905
|
+
const Nr = _e(function({
|
|
903
906
|
original: t,
|
|
904
907
|
modified: r,
|
|
905
908
|
language: n,
|
|
906
909
|
mode: c = "side-by-side",
|
|
907
|
-
readOnly:
|
|
910
|
+
readOnly: i = !0,
|
|
908
911
|
height: l = "100%",
|
|
909
|
-
bordered:
|
|
910
|
-
className:
|
|
911
|
-
},
|
|
912
|
-
const
|
|
913
|
-
|
|
914
|
-
if (!
|
|
915
|
-
|
|
916
|
-
const
|
|
917
|
-
readOnly:
|
|
912
|
+
bordered: d = !0,
|
|
913
|
+
className: y
|
|
914
|
+
}, h) {
|
|
915
|
+
const k = rt(), j = G(null), m = G(null), [T, R] = me(!1);
|
|
916
|
+
U(() => {
|
|
917
|
+
if (!j.current) return;
|
|
918
|
+
W.editor.defineTheme(pe, $e(k.base, j.current)), W.editor.setTheme(pe);
|
|
919
|
+
const x = W.editor.createDiffEditor(j.current, {
|
|
920
|
+
readOnly: i,
|
|
918
921
|
renderSideBySide: c === "side-by-side",
|
|
919
922
|
renderValidationDecorations: "off",
|
|
920
923
|
scrollBeyondLastLine: !1,
|
|
921
924
|
automaticLayout: !0,
|
|
922
925
|
fontSize: 13,
|
|
923
926
|
fontFamily: "var(--ov-font-family-mono, monospace)"
|
|
924
|
-
}),
|
|
925
|
-
return
|
|
926
|
-
original:
|
|
927
|
-
modified:
|
|
928
|
-
}), m.current =
|
|
929
|
-
|
|
927
|
+
}), z = W.editor.createModel(t, n), S = W.editor.createModel(r, n);
|
|
928
|
+
return x.setModel({
|
|
929
|
+
original: z,
|
|
930
|
+
modified: S
|
|
931
|
+
}), m.current = x, R(!0), () => {
|
|
932
|
+
x.getModel()?.original?.dispose(), x.getModel()?.modified?.dispose(), x.dispose(), m.current = null, R(!1);
|
|
930
933
|
};
|
|
931
|
-
}, []),
|
|
934
|
+
}, []), U(() => {
|
|
932
935
|
if (!m.current || !T) return;
|
|
933
|
-
const
|
|
934
|
-
|
|
935
|
-
}, [t, T]),
|
|
936
|
+
const x = m.current.getModel()?.original;
|
|
937
|
+
x && t !== x.getValue() && x.setValue(t);
|
|
938
|
+
}, [t, T]), U(() => {
|
|
936
939
|
if (!m.current || !T) return;
|
|
937
|
-
const
|
|
938
|
-
r !==
|
|
939
|
-
}, [r, T]),
|
|
940
|
+
const x = m.current.getModifiedEditor();
|
|
941
|
+
r !== x.getValue() && m.current.getModel()?.modified?.setValue(r);
|
|
942
|
+
}, [r, T]), U(() => {
|
|
940
943
|
if (!m.current || !T) return;
|
|
941
|
-
const
|
|
942
|
-
|
|
943
|
-
}, [n, T]),
|
|
944
|
+
const x = n ?? "plaintext", z = m.current.getModel();
|
|
945
|
+
z?.original && W.editor.setModelLanguage(z.original, x), z?.modified && W.editor.setModelLanguage(z.modified, x);
|
|
946
|
+
}, [n, T]), U(() => {
|
|
944
947
|
!m.current || !T || m.current.updateOptions({
|
|
945
|
-
readOnly:
|
|
948
|
+
readOnly: i,
|
|
946
949
|
renderSideBySide: c === "side-by-side"
|
|
947
950
|
});
|
|
948
|
-
}, [
|
|
949
|
-
T && (
|
|
950
|
-
}, [T,
|
|
951
|
-
const H = (
|
|
952
|
-
return /* @__PURE__ */
|
|
951
|
+
}, [i, c, T]), U(() => {
|
|
952
|
+
T && (W.editor.defineTheme(pe, $e(k.base, j.current)), W.editor.setTheme(pe));
|
|
953
|
+
}, [T, k.registration]);
|
|
954
|
+
const H = (x) => typeof x == "number" ? `${x}px` : x;
|
|
955
|
+
return /* @__PURE__ */ E.jsx("div", { ref: h, className: jr(pt.Root, y), style: {
|
|
953
956
|
"--_diff-height": H(l ?? "100%")
|
|
954
|
-
}, "data-testid": "diff-viewer", ...
|
|
957
|
+
}, "data-testid": "diff-viewer", ...d ? {} : {
|
|
955
958
|
"data-borderless": ""
|
|
956
|
-
}, children: /* @__PURE__ */
|
|
959
|
+
}, children: /* @__PURE__ */ E.jsx("div", { ref: j, className: pt.Inner }) });
|
|
957
960
|
});
|
|
958
|
-
|
|
959
|
-
function
|
|
960
|
-
const t =
|
|
961
|
+
Nr.displayName = "DiffViewer";
|
|
962
|
+
function Je(e) {
|
|
963
|
+
const t = tt(e), r = (n, c = "") => t?.getPropertyValue(n).trim() || c;
|
|
961
964
|
return {
|
|
962
965
|
background: r("--ov-color-terminal-bg", "#0d0e10"),
|
|
963
966
|
foreground: r("--ov-color-terminal-fg", "#e2e7ee"),
|
|
@@ -982,13 +985,13 @@ function Ye(e) {
|
|
|
982
985
|
brightWhite: r("--ov-color-ansi-bright-white", "#eceff4")
|
|
983
986
|
};
|
|
984
987
|
}
|
|
985
|
-
const
|
|
986
|
-
Root:
|
|
988
|
+
const Ar = "_Root_1s8vo_1", Lr = {
|
|
989
|
+
Root: Ar
|
|
987
990
|
};
|
|
988
|
-
function
|
|
991
|
+
function Pr(...e) {
|
|
989
992
|
return e.filter(Boolean).join(" ");
|
|
990
993
|
}
|
|
991
|
-
function
|
|
994
|
+
function Or(e, t) {
|
|
992
995
|
let r = null;
|
|
993
996
|
return {
|
|
994
997
|
run: (...n) => {
|
|
@@ -1001,91 +1004,91 @@ function Er(e, t) {
|
|
|
1001
1004
|
}
|
|
1002
1005
|
};
|
|
1003
1006
|
}
|
|
1004
|
-
const
|
|
1007
|
+
const Dr = _e(function({
|
|
1005
1008
|
onData: t,
|
|
1006
1009
|
onBinaryData: r,
|
|
1007
1010
|
onResize: n,
|
|
1008
1011
|
onSignal: c,
|
|
1009
|
-
onError:
|
|
1012
|
+
onError: i,
|
|
1010
1013
|
onClose: l,
|
|
1011
|
-
onReady:
|
|
1012
|
-
onBell:
|
|
1013
|
-
onTitleChange:
|
|
1014
|
-
onKey:
|
|
1015
|
-
onSelectionChange:
|
|
1014
|
+
onReady: d,
|
|
1015
|
+
onBell: y,
|
|
1016
|
+
onTitleChange: h,
|
|
1017
|
+
onKey: k,
|
|
1018
|
+
onSelectionChange: j,
|
|
1016
1019
|
onLineFeed: m,
|
|
1017
1020
|
onScroll: T,
|
|
1018
1021
|
onWriteParsed: R,
|
|
1019
1022
|
fontSize: H = 13,
|
|
1020
|
-
fontFamily:
|
|
1021
|
-
fontWeight:
|
|
1022
|
-
fontWeightBold:
|
|
1023
|
-
scrollback:
|
|
1024
|
-
cursorBlink:
|
|
1025
|
-
cursorStyle:
|
|
1026
|
-
cursorWidth:
|
|
1027
|
-
lineHeight:
|
|
1028
|
-
letterSpacing:
|
|
1029
|
-
drawBoldTextInBrightColors:
|
|
1030
|
-
convertEol:
|
|
1031
|
-
allowTransparency:
|
|
1032
|
-
macOptionIsMeta:
|
|
1033
|
-
macOptionClickForcesSelection:
|
|
1034
|
-
linkHandling:
|
|
1035
|
-
disableStdin:
|
|
1036
|
-
customKeyEventHandler:
|
|
1037
|
-
autoFocus:
|
|
1038
|
-
renderer:
|
|
1039
|
-
rows:
|
|
1040
|
-
cols:
|
|
1041
|
-
screenReaderMode:
|
|
1023
|
+
fontFamily: x,
|
|
1024
|
+
fontWeight: z,
|
|
1025
|
+
fontWeightBold: S,
|
|
1026
|
+
scrollback: D = 5e3,
|
|
1027
|
+
cursorBlink: I = !0,
|
|
1028
|
+
cursorStyle: B,
|
|
1029
|
+
cursorWidth: N,
|
|
1030
|
+
lineHeight: q,
|
|
1031
|
+
letterSpacing: P,
|
|
1032
|
+
drawBoldTextInBrightColors: V = !0,
|
|
1033
|
+
convertEol: K = !0,
|
|
1034
|
+
allowTransparency: b = !0,
|
|
1035
|
+
macOptionIsMeta: o = !0,
|
|
1036
|
+
macOptionClickForcesSelection: v = !0,
|
|
1037
|
+
linkHandling: p = !0,
|
|
1038
|
+
disableStdin: s,
|
|
1039
|
+
customKeyEventHandler: u,
|
|
1040
|
+
autoFocus: f = !1,
|
|
1041
|
+
renderer: g = "auto",
|
|
1042
|
+
rows: _,
|
|
1043
|
+
cols: C,
|
|
1044
|
+
screenReaderMode: a,
|
|
1042
1045
|
minimumContrastRatio: w,
|
|
1043
1046
|
className: A
|
|
1044
|
-
},
|
|
1045
|
-
const
|
|
1047
|
+
}, L) {
|
|
1048
|
+
const F = G(null), O = G(null), $ = G(null), J = G(null), Z = G(null), oe = G([]), le = G(null), ae = G(null), X = G(null), ce = rt(), te = G({
|
|
1046
1049
|
onData: t,
|
|
1047
1050
|
onBinaryData: r,
|
|
1048
1051
|
onResize: n,
|
|
1049
1052
|
onSignal: c,
|
|
1050
|
-
onError:
|
|
1053
|
+
onError: i,
|
|
1051
1054
|
onClose: l,
|
|
1052
|
-
onReady:
|
|
1053
|
-
onBell:
|
|
1054
|
-
onTitleChange:
|
|
1055
|
-
onKey:
|
|
1056
|
-
onSelectionChange:
|
|
1055
|
+
onReady: d,
|
|
1056
|
+
onBell: y,
|
|
1057
|
+
onTitleChange: h,
|
|
1058
|
+
onKey: k,
|
|
1059
|
+
onSelectionChange: j,
|
|
1057
1060
|
onLineFeed: m,
|
|
1058
1061
|
onScroll: T,
|
|
1059
1062
|
onWriteParsed: R
|
|
1060
1063
|
});
|
|
1061
|
-
|
|
1064
|
+
te.current = {
|
|
1062
1065
|
onData: t,
|
|
1063
1066
|
onBinaryData: r,
|
|
1064
1067
|
onResize: n,
|
|
1065
1068
|
onSignal: c,
|
|
1066
|
-
onError:
|
|
1069
|
+
onError: i,
|
|
1067
1070
|
onClose: l,
|
|
1068
|
-
onReady:
|
|
1069
|
-
onBell:
|
|
1070
|
-
onTitleChange:
|
|
1071
|
-
onKey:
|
|
1072
|
-
onSelectionChange:
|
|
1071
|
+
onReady: d,
|
|
1072
|
+
onBell: y,
|
|
1073
|
+
onTitleChange: h,
|
|
1074
|
+
onKey: k,
|
|
1075
|
+
onSelectionChange: j,
|
|
1073
1076
|
onLineFeed: m,
|
|
1074
1077
|
onScroll: T,
|
|
1075
1078
|
onWriteParsed: R
|
|
1076
1079
|
};
|
|
1077
|
-
const
|
|
1080
|
+
const Ie = De(() => {
|
|
1078
1081
|
try {
|
|
1079
|
-
|
|
1082
|
+
$.current?.fit?.();
|
|
1080
1083
|
} catch {
|
|
1081
1084
|
}
|
|
1082
1085
|
}, []);
|
|
1083
|
-
return
|
|
1084
|
-
write: (
|
|
1085
|
-
O.current?.write?.(
|
|
1086
|
+
return xt(L, () => ({
|
|
1087
|
+
write: (M) => {
|
|
1088
|
+
O.current?.write?.(M);
|
|
1086
1089
|
},
|
|
1087
|
-
writeln: (
|
|
1088
|
-
O.current?.writeln?.(
|
|
1090
|
+
writeln: (M) => {
|
|
1091
|
+
O.current?.writeln?.(M);
|
|
1089
1092
|
},
|
|
1090
1093
|
clear: () => {
|
|
1091
1094
|
O.current?.clear?.();
|
|
@@ -1096,12 +1099,12 @@ const Tr = ve(function({
|
|
|
1096
1099
|
blur: () => {
|
|
1097
1100
|
O.current?.blur?.();
|
|
1098
1101
|
},
|
|
1099
|
-
fit:
|
|
1102
|
+
fit: Ie,
|
|
1100
1103
|
getDimensions: () => {
|
|
1101
|
-
const
|
|
1102
|
-
return
|
|
1103
|
-
cols:
|
|
1104
|
-
rows:
|
|
1104
|
+
const M = O.current;
|
|
1105
|
+
return M && typeof M.cols == "number" && typeof M.rows == "number" ? {
|
|
1106
|
+
cols: M.cols,
|
|
1107
|
+
rows: M.rows
|
|
1105
1108
|
} : null;
|
|
1106
1109
|
},
|
|
1107
1110
|
reset: () => {
|
|
@@ -1110,8 +1113,8 @@ const Tr = ve(function({
|
|
|
1110
1113
|
scrollToBottom: () => {
|
|
1111
1114
|
O.current?.scrollToBottom?.();
|
|
1112
1115
|
},
|
|
1113
|
-
findNext: (
|
|
1114
|
-
findPrevious: (
|
|
1116
|
+
findNext: (M, re) => J.current?.findNext?.(M, re) ?? !1,
|
|
1117
|
+
findPrevious: (M, re) => J.current?.findPrevious?.(M, re) ?? !1,
|
|
1115
1118
|
clearSearch: () => {
|
|
1116
1119
|
J.current?.clearDecorations?.();
|
|
1117
1120
|
},
|
|
@@ -1123,229 +1126,229 @@ const Tr = ve(function({
|
|
|
1123
1126
|
clearSelection: () => {
|
|
1124
1127
|
O.current?.clearSelection?.();
|
|
1125
1128
|
},
|
|
1126
|
-
scrollToLine: (
|
|
1127
|
-
O.current?.scrollToLine?.(
|
|
1129
|
+
scrollToLine: (M) => {
|
|
1130
|
+
O.current?.scrollToLine?.(M);
|
|
1128
1131
|
},
|
|
1129
|
-
scrollUp: (
|
|
1130
|
-
O.current?.scrollLines?.(-
|
|
1132
|
+
scrollUp: (M) => {
|
|
1133
|
+
O.current?.scrollLines?.(-M);
|
|
1131
1134
|
},
|
|
1132
|
-
scrollDown: (
|
|
1133
|
-
O.current?.scrollLines?.(
|
|
1135
|
+
scrollDown: (M) => {
|
|
1136
|
+
O.current?.scrollLines?.(M);
|
|
1134
1137
|
},
|
|
1135
|
-
paste: (
|
|
1136
|
-
O.current?.paste?.(
|
|
1138
|
+
paste: (M) => {
|
|
1139
|
+
O.current?.paste?.(M);
|
|
1137
1140
|
},
|
|
1138
|
-
getBufferContent: () =>
|
|
1139
|
-
})),
|
|
1140
|
-
const
|
|
1141
|
-
if (!
|
|
1142
|
-
let
|
|
1143
|
-
async function
|
|
1141
|
+
getBufferContent: () => Z.current?.serialize?.() ?? ""
|
|
1142
|
+
})), U(() => {
|
|
1143
|
+
const M = F.current;
|
|
1144
|
+
if (!M) return;
|
|
1145
|
+
let re = !1;
|
|
1146
|
+
async function We() {
|
|
1144
1147
|
await document.fonts.ready;
|
|
1145
1148
|
const [{
|
|
1146
|
-
Terminal:
|
|
1149
|
+
Terminal: ye
|
|
1147
1150
|
}, {
|
|
1148
|
-
FitAddon:
|
|
1151
|
+
FitAddon: He
|
|
1149
1152
|
}, {
|
|
1150
|
-
SearchAddon:
|
|
1153
|
+
SearchAddon: Bt
|
|
1151
1154
|
}, {
|
|
1152
|
-
SerializeAddon:
|
|
1155
|
+
SerializeAddon: qt
|
|
1153
1156
|
}, {
|
|
1154
|
-
Unicode11Addon:
|
|
1157
|
+
Unicode11Addon: zt
|
|
1155
1158
|
}] = await Promise.all([import("@xterm/xterm"), import("@xterm/addon-fit"), import("@xterm/addon-search"), import("@xterm/addon-serialize"), import("@xterm/addon-unicode11")]);
|
|
1156
|
-
if (
|
|
1157
|
-
const
|
|
1159
|
+
if (re) return;
|
|
1160
|
+
const Vt = Je(M), ie = {
|
|
1158
1161
|
fontSize: H,
|
|
1159
|
-
fontFamily:
|
|
1160
|
-
theme:
|
|
1161
|
-
allowTransparency:
|
|
1162
|
-
cursorBlink:
|
|
1163
|
-
convertEol:
|
|
1164
|
-
scrollback:
|
|
1165
|
-
macOptionIsMeta:
|
|
1166
|
-
macOptionClickForcesSelection:
|
|
1162
|
+
fontFamily: x || "'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace",
|
|
1163
|
+
theme: Vt,
|
|
1164
|
+
allowTransparency: b,
|
|
1165
|
+
cursorBlink: I,
|
|
1166
|
+
convertEol: K,
|
|
1167
|
+
scrollback: D,
|
|
1168
|
+
macOptionIsMeta: o,
|
|
1169
|
+
macOptionClickForcesSelection: v,
|
|
1167
1170
|
allowProposedApi: !0,
|
|
1168
|
-
drawBoldTextInBrightColors:
|
|
1171
|
+
drawBoldTextInBrightColors: V
|
|
1169
1172
|
};
|
|
1170
|
-
|
|
1171
|
-
const
|
|
1172
|
-
|
|
1173
|
-
const
|
|
1174
|
-
if (
|
|
1173
|
+
z !== void 0 && (ie.fontWeight = z), S !== void 0 && (ie.fontWeightBold = S), s !== void 0 && (ie.disableStdin = s), B !== void 0 && (ie.cursorStyle = B), N !== void 0 && (ie.cursorWidth = N), q !== void 0 && (ie.lineHeight = q), P !== void 0 && (ie.letterSpacing = P), _ !== void 0 && (ie.rows = _), C !== void 0 && (ie.cols = C), a !== void 0 && (ie.screenReaderMode = a), w !== void 0 && (ie.minimumContrastRatio = w);
|
|
1174
|
+
const Y = new ye(ie);
|
|
1175
|
+
u && Y.attachCustomKeyEventHandler(u);
|
|
1176
|
+
const xe = [], ke = new He(), Be = new Bt(), qe = new qt(), nt = new zt();
|
|
1177
|
+
if (Y.loadAddon(ke), Y.loadAddon(Be), Y.loadAddon(qe), Y.loadAddon(nt), xe.push(ke, Be, qe, nt), Y.unicode.activeVersion = "11", p)
|
|
1175
1178
|
try {
|
|
1176
1179
|
const {
|
|
1177
|
-
WebLinksAddon:
|
|
1180
|
+
WebLinksAddon: Q
|
|
1178
1181
|
} = await import("@xterm/addon-web-links");
|
|
1179
|
-
if (!
|
|
1180
|
-
const de = new
|
|
1181
|
-
|
|
1182
|
+
if (!re) {
|
|
1183
|
+
const de = new Q();
|
|
1184
|
+
Y.loadAddon(de), xe.push(de);
|
|
1182
1185
|
}
|
|
1183
1186
|
} catch {
|
|
1184
1187
|
}
|
|
1185
|
-
if (
|
|
1186
|
-
|
|
1188
|
+
if (re) {
|
|
1189
|
+
Y.dispose();
|
|
1187
1190
|
return;
|
|
1188
1191
|
}
|
|
1189
|
-
if (
|
|
1192
|
+
if (Y.open(M), g === "auto" || g === "webgl")
|
|
1190
1193
|
try {
|
|
1191
1194
|
const {
|
|
1192
|
-
WebglAddon:
|
|
1195
|
+
WebglAddon: Q
|
|
1193
1196
|
} = await import("@xterm/addon-webgl");
|
|
1194
|
-
if (!
|
|
1195
|
-
const de = new
|
|
1197
|
+
if (!re) {
|
|
1198
|
+
const de = new Q();
|
|
1196
1199
|
de.onContextLoss(() => {
|
|
1197
1200
|
de.dispose();
|
|
1198
|
-
}),
|
|
1201
|
+
}), Y.loadAddon(de), xe.push(de);
|
|
1199
1202
|
}
|
|
1200
1203
|
} catch {
|
|
1201
1204
|
}
|
|
1202
|
-
if (
|
|
1203
|
-
for (const
|
|
1205
|
+
if (re) {
|
|
1206
|
+
for (const Q of xe)
|
|
1204
1207
|
try {
|
|
1205
|
-
|
|
1208
|
+
Q.dispose();
|
|
1206
1209
|
} catch {
|
|
1207
1210
|
}
|
|
1208
|
-
|
|
1211
|
+
Y.dispose();
|
|
1209
1212
|
return;
|
|
1210
1213
|
}
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
}),
|
|
1214
|
-
|
|
1215
|
-
}),
|
|
1216
|
-
cols:
|
|
1214
|
+
Y.options.theme = Je(M), ke.fit(), O.current = Y, $.current = ke, J.current = Be, Z.current = qe, oe.current = xe, Y.onData((Q) => {
|
|
1215
|
+
te.current.onData?.(Q);
|
|
1216
|
+
}), Y.onBinary((Q) => {
|
|
1217
|
+
te.current.onBinaryData?.(Q);
|
|
1218
|
+
}), Y.onResize(({
|
|
1219
|
+
cols: Q,
|
|
1217
1220
|
rows: de
|
|
1218
1221
|
}) => {
|
|
1219
|
-
|
|
1220
|
-
}),
|
|
1221
|
-
|
|
1222
|
-
}),
|
|
1223
|
-
|
|
1224
|
-
}),
|
|
1225
|
-
|
|
1226
|
-
}),
|
|
1227
|
-
|
|
1228
|
-
}),
|
|
1229
|
-
|
|
1230
|
-
}),
|
|
1231
|
-
|
|
1232
|
-
}),
|
|
1233
|
-
|
|
1222
|
+
te.current.onResize?.(Q, de);
|
|
1223
|
+
}), Y.onBell(() => {
|
|
1224
|
+
te.current.onBell?.();
|
|
1225
|
+
}), Y.onTitleChange((Q) => {
|
|
1226
|
+
te.current.onTitleChange?.(Q);
|
|
1227
|
+
}), Y.onKey((Q) => {
|
|
1228
|
+
te.current.onKey?.(Q);
|
|
1229
|
+
}), Y.onSelectionChange(() => {
|
|
1230
|
+
te.current.onSelectionChange?.();
|
|
1231
|
+
}), Y.onLineFeed(() => {
|
|
1232
|
+
te.current.onLineFeed?.();
|
|
1233
|
+
}), Y.onScroll((Q) => {
|
|
1234
|
+
te.current.onScroll?.(Q);
|
|
1235
|
+
}), Y.onWriteParsed(() => {
|
|
1236
|
+
te.current.onWriteParsed?.();
|
|
1234
1237
|
});
|
|
1235
|
-
const
|
|
1238
|
+
const ze = Or(() => {
|
|
1236
1239
|
try {
|
|
1237
|
-
|
|
1240
|
+
ke.fit();
|
|
1238
1241
|
} catch {
|
|
1239
1242
|
}
|
|
1240
1243
|
}, 10);
|
|
1241
|
-
ae.current =
|
|
1242
|
-
const
|
|
1243
|
-
|
|
1244
|
+
ae.current = ze;
|
|
1245
|
+
const ot = new ResizeObserver(() => {
|
|
1246
|
+
ze.run();
|
|
1244
1247
|
});
|
|
1245
|
-
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1248
|
+
ot.observe(M), le.current = ot;
|
|
1249
|
+
const it = () => {
|
|
1250
|
+
ze.run();
|
|
1248
1251
|
};
|
|
1249
|
-
window.addEventListener("resize",
|
|
1250
|
-
window.removeEventListener("resize",
|
|
1251
|
-
},
|
|
1252
|
-
cols:
|
|
1253
|
-
rows:
|
|
1252
|
+
window.addEventListener("resize", it), X.current = () => {
|
|
1253
|
+
window.removeEventListener("resize", it);
|
|
1254
|
+
}, f && Y.focus(), te.current.onReady?.({
|
|
1255
|
+
cols: Y.cols,
|
|
1256
|
+
rows: Y.rows
|
|
1254
1257
|
});
|
|
1255
1258
|
}
|
|
1256
|
-
return
|
|
1257
|
-
|
|
1259
|
+
return We().catch((ye) => {
|
|
1260
|
+
te.current.onError?.(ye instanceof Error ? ye : new Error(String(ye)));
|
|
1258
1261
|
}), () => {
|
|
1259
|
-
|
|
1260
|
-
for (const
|
|
1262
|
+
re = !0, ae.current?.cancel(), ae.current = null, le.current?.disconnect(), le.current = null, X.current?.(), X.current = null;
|
|
1263
|
+
for (const He of oe.current)
|
|
1261
1264
|
try {
|
|
1262
|
-
|
|
1265
|
+
He.dispose();
|
|
1263
1266
|
} catch {
|
|
1264
1267
|
}
|
|
1265
1268
|
oe.current = [];
|
|
1266
|
-
const
|
|
1269
|
+
const ye = O.current;
|
|
1267
1270
|
try {
|
|
1268
|
-
|
|
1271
|
+
ye?.dispose?.();
|
|
1269
1272
|
} catch {
|
|
1270
1273
|
}
|
|
1271
|
-
O.current = null,
|
|
1274
|
+
O.current = null, $.current = null, J.current = null, Z.current = null;
|
|
1272
1275
|
};
|
|
1273
|
-
}, []),
|
|
1274
|
-
const
|
|
1275
|
-
|
|
1276
|
-
}, [ce.registration]),
|
|
1277
|
-
const
|
|
1278
|
-
|
|
1279
|
-
}, [H]),
|
|
1280
|
-
const
|
|
1281
|
-
|
|
1282
|
-
}, [
|
|
1283
|
-
const
|
|
1284
|
-
|
|
1285
|
-
}, [
|
|
1286
|
-
const
|
|
1287
|
-
|
|
1288
|
-
}, [
|
|
1289
|
-
const
|
|
1290
|
-
|
|
1291
|
-
}, [
|
|
1292
|
-
const
|
|
1293
|
-
|
|
1294
|
-
}, [
|
|
1276
|
+
}, []), U(() => {
|
|
1277
|
+
const M = O.current;
|
|
1278
|
+
M?.options && (M.options.theme = Je(F.current));
|
|
1279
|
+
}, [ce.registration]), U(() => {
|
|
1280
|
+
const M = O.current;
|
|
1281
|
+
M?.options && (M.options.fontSize = H, ae.current?.run());
|
|
1282
|
+
}, [H]), U(() => {
|
|
1283
|
+
const M = O.current;
|
|
1284
|
+
M?.options && I !== void 0 && (M.options.cursorBlink = I);
|
|
1285
|
+
}, [I]), U(() => {
|
|
1286
|
+
const M = O.current;
|
|
1287
|
+
M?.options && B !== void 0 && (M.options.cursorStyle = B);
|
|
1288
|
+
}, [B]), U(() => {
|
|
1289
|
+
const M = O.current;
|
|
1290
|
+
M?.options && D !== void 0 && (M.options.scrollback = D);
|
|
1291
|
+
}, [D]), U(() => {
|
|
1292
|
+
const M = O.current;
|
|
1293
|
+
M?.options && q !== void 0 && (M.options.lineHeight = q, ae.current?.run());
|
|
1294
|
+
}, [q]), U(() => {
|
|
1295
|
+
const M = O.current;
|
|
1296
|
+
M?.options && P !== void 0 && (M.options.letterSpacing = P, ae.current?.run());
|
|
1297
|
+
}, [P]), /* @__PURE__ */ E.jsx("div", { ref: F, className: Pr(Lr.Root, A), "data-testid": "terminal" });
|
|
1295
1298
|
});
|
|
1296
|
-
|
|
1297
|
-
const
|
|
1298
|
-
Root:
|
|
1299
|
-
Loading:
|
|
1300
|
-
},
|
|
1301
|
-
function
|
|
1299
|
+
Dr.displayName = "Terminal";
|
|
1300
|
+
const $r = "_Root_1wl3o_1", Ir = "_Loading_1wl3o_92", yt = {
|
|
1301
|
+
Root: $r,
|
|
1302
|
+
Loading: Ir
|
|
1303
|
+
}, Wr = [ir], Hr = Rt(() => import("react-markdown"));
|
|
1304
|
+
function Br(...e) {
|
|
1302
1305
|
return e.filter(Boolean).join(" ");
|
|
1303
1306
|
}
|
|
1304
|
-
function
|
|
1305
|
-
return e ? e.type === "text" ? e.value ?? "" : Array.isArray(e.children) ? e.children.map(
|
|
1307
|
+
function jt(e) {
|
|
1308
|
+
return e ? e.type === "text" ? e.value ?? "" : Array.isArray(e.children) ? e.children.map(jt).join("") : "" : "";
|
|
1306
1309
|
}
|
|
1307
|
-
function
|
|
1308
|
-
const t =
|
|
1310
|
+
function qr(e) {
|
|
1311
|
+
const t = Ce.c(4), {
|
|
1309
1312
|
summaryText: r,
|
|
1310
1313
|
children: n
|
|
1311
|
-
} = e,
|
|
1314
|
+
} = e, i = `md-details-${Yt()}`;
|
|
1312
1315
|
let l;
|
|
1313
|
-
return t[0] !== n || t[1] !==
|
|
1316
|
+
return t[0] !== n || t[1] !== i || t[2] !== r ? (l = /* @__PURE__ */ E.jsx(st, { animation: "fast", children: /* @__PURE__ */ E.jsx(st.Item, { id: i, title: r, children: n }) }), t[0] = n, t[1] = i, t[2] = r, t[3] = l) : l = t[3], l;
|
|
1314
1317
|
}
|
|
1315
|
-
const
|
|
1318
|
+
const zr = {
|
|
1316
1319
|
// Code blocks & inline code
|
|
1317
1320
|
pre: ({
|
|
1318
1321
|
children: e
|
|
1319
|
-
}) => /* @__PURE__ */
|
|
1322
|
+
}) => /* @__PURE__ */ E.jsx(E.Fragment, { children: e }),
|
|
1320
1323
|
code: ({
|
|
1321
1324
|
className: e,
|
|
1322
1325
|
children: t
|
|
1323
1326
|
}) => {
|
|
1324
1327
|
const r = /language-([^\s]+)/.exec(e ?? ""), n = String(t).replace(/\n$/, "");
|
|
1325
1328
|
return r || n.includes(`
|
|
1326
|
-
`) ? /* @__PURE__ */
|
|
1329
|
+
`) ? /* @__PURE__ */ E.jsx(Qt, { language: r?.[1], copyable: !0, children: n }) : /* @__PURE__ */ E.jsx(er, { children: t });
|
|
1327
1330
|
},
|
|
1328
1331
|
// Tables
|
|
1329
1332
|
table: ({
|
|
1330
1333
|
children: e
|
|
1331
|
-
}) => /* @__PURE__ */
|
|
1334
|
+
}) => /* @__PURE__ */ E.jsx(be.Root, { striped: !0, hoverable: !0, size: "sm", children: e }),
|
|
1332
1335
|
thead: ({
|
|
1333
1336
|
children: e
|
|
1334
|
-
}) => /* @__PURE__ */
|
|
1337
|
+
}) => /* @__PURE__ */ E.jsx(be.Head, { children: e }),
|
|
1335
1338
|
tbody: ({
|
|
1336
1339
|
children: e
|
|
1337
|
-
}) => /* @__PURE__ */
|
|
1340
|
+
}) => /* @__PURE__ */ E.jsx(be.Body, { children: e }),
|
|
1338
1341
|
tr: ({
|
|
1339
1342
|
children: e
|
|
1340
|
-
}) => /* @__PURE__ */
|
|
1343
|
+
}) => /* @__PURE__ */ E.jsx(be.Row, { children: e }),
|
|
1341
1344
|
th: ({
|
|
1342
1345
|
children: e,
|
|
1343
1346
|
style: t
|
|
1344
|
-
}) => /* @__PURE__ */
|
|
1347
|
+
}) => /* @__PURE__ */ E.jsx(be.HeaderCell, { style: t, children: e }),
|
|
1345
1348
|
td: ({
|
|
1346
1349
|
children: e,
|
|
1347
1350
|
style: t
|
|
1348
|
-
}) => /* @__PURE__ */
|
|
1351
|
+
}) => /* @__PURE__ */ E.jsx(be.Cell, { style: t, children: e }),
|
|
1349
1352
|
// Links
|
|
1350
1353
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1351
1354
|
a: ({
|
|
@@ -1353,13 +1356,13 @@ const Lr = {
|
|
|
1353
1356
|
href: t,
|
|
1354
1357
|
node: r,
|
|
1355
1358
|
...n
|
|
1356
|
-
}) => /* @__PURE__ */
|
|
1359
|
+
}) => /* @__PURE__ */ E.jsx(Zt, { ...n, href: t, target: "_blank", rel: "noopener noreferrer", underline: "hover", children: e }),
|
|
1357
1360
|
// Blockquotes
|
|
1358
1361
|
blockquote: ({
|
|
1359
1362
|
children: e
|
|
1360
|
-
}) => /* @__PURE__ */
|
|
1363
|
+
}) => /* @__PURE__ */ E.jsx(Xt, { variant: "plain", children: e }),
|
|
1361
1364
|
// Horizontal rules
|
|
1362
|
-
hr: () => /* @__PURE__ */
|
|
1365
|
+
hr: () => /* @__PURE__ */ E.jsx(Kt, {}),
|
|
1363
1366
|
// Details/summary → Accordion — extract title from the hast node's summary child
|
|
1364
1367
|
details: ({
|
|
1365
1368
|
children: e,
|
|
@@ -1367,365 +1370,365 @@ const Lr = {
|
|
|
1367
1370
|
}) => {
|
|
1368
1371
|
let r = "Details";
|
|
1369
1372
|
if (t?.children) {
|
|
1370
|
-
const c = t.children.find((
|
|
1373
|
+
const c = t.children.find((i) => i.tagName === "summary");
|
|
1371
1374
|
if (c) {
|
|
1372
|
-
const
|
|
1373
|
-
|
|
1375
|
+
const i = jt(c).trim();
|
|
1376
|
+
i && (r = i);
|
|
1374
1377
|
}
|
|
1375
1378
|
}
|
|
1376
1379
|
const n = [];
|
|
1377
|
-
return
|
|
1378
|
-
|
|
1379
|
-
}), /* @__PURE__ */
|
|
1380
|
+
return Ft.forEach(e, (c) => {
|
|
1381
|
+
Ut(c) && c.props?.["data-md-summary"] || n.push(c);
|
|
1382
|
+
}), /* @__PURE__ */ E.jsx(qr, { summaryText: r, children: n });
|
|
1380
1383
|
},
|
|
1381
1384
|
// Mark summary so details can filter it out; text is extracted from hast node
|
|
1382
1385
|
summary: ({
|
|
1383
1386
|
children: e
|
|
1384
|
-
}) => /* @__PURE__ */
|
|
1387
|
+
}) => /* @__PURE__ */ E.jsx("span", { hidden: !0, "data-md-summary": !0, children: e }),
|
|
1385
1388
|
// Task list checkboxes — use compound parts for inline rendering
|
|
1386
1389
|
input: ({
|
|
1387
1390
|
type: e,
|
|
1388
1391
|
checked: t,
|
|
1389
1392
|
disabled: r
|
|
1390
|
-
}) => e === "checkbox" ? /* @__PURE__ */
|
|
1391
|
-
},
|
|
1392
|
-
const n =
|
|
1393
|
-
let c,
|
|
1393
|
+
}) => e === "checkbox" ? /* @__PURE__ */ E.jsx(Ve.Root, { checked: t, disabled: r, size: "sm", className: "ov-md-checkbox", children: /* @__PURE__ */ E.jsx(Ve.Control, { children: /* @__PURE__ */ E.jsx(Ve.Indicator, { keepMounted: !0 }) }) }) : null
|
|
1394
|
+
}, Vr = _e(function(t, r) {
|
|
1395
|
+
const n = Ce.c(16);
|
|
1396
|
+
let c, i, l, d;
|
|
1394
1397
|
n[0] !== t ? ({
|
|
1395
|
-
content:
|
|
1396
|
-
allowHtml:
|
|
1398
|
+
content: i,
|
|
1399
|
+
allowHtml: d,
|
|
1397
1400
|
className: c,
|
|
1398
1401
|
...l
|
|
1399
|
-
} = t, n[0] = t, n[1] = c, n[2] =
|
|
1400
|
-
const
|
|
1401
|
-
let
|
|
1402
|
-
n[5] !== c ? (
|
|
1403
|
-
let
|
|
1404
|
-
n[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
1405
|
-
let
|
|
1406
|
-
n[8] !==
|
|
1402
|
+
} = t, n[0] = t, n[1] = c, n[2] = i, n[3] = l, n[4] = d) : (c = n[1], i = n[2], l = n[3], d = n[4]);
|
|
1403
|
+
const y = d === void 0 ? !1 : d;
|
|
1404
|
+
let h;
|
|
1405
|
+
n[5] !== c ? (h = Br(yt.Root, c), n[5] = c, n[6] = h) : h = n[6];
|
|
1406
|
+
let k;
|
|
1407
|
+
n[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ E.jsx("div", { className: yt.Loading, "data-testid": "markdown-loading", children: "Loading…" }), n[7] = k) : k = n[7];
|
|
1408
|
+
let j;
|
|
1409
|
+
n[8] !== y || n[9] !== i ? (j = /* @__PURE__ */ E.jsx(kt, { fallback: k, children: /* @__PURE__ */ E.jsx(Ur, { content: i, allowHtml: y }) }), n[8] = y, n[9] = i, n[10] = j) : j = n[10];
|
|
1407
1410
|
let m;
|
|
1408
|
-
return n[11] !== l || n[12] !== r || n[13] !==
|
|
1411
|
+
return n[11] !== l || n[12] !== r || n[13] !== h || n[14] !== j ? (m = /* @__PURE__ */ E.jsx("div", { ref: r, className: h, "data-testid": "markdown-preview", ...l, children: j }), n[11] = l, n[12] = r, n[13] = h, n[14] = j, n[15] = m) : m = n[15], m;
|
|
1409
1412
|
});
|
|
1410
|
-
|
|
1411
|
-
const
|
|
1412
|
-
...
|
|
1413
|
+
Vr.displayName = "MarkdownPreview";
|
|
1414
|
+
const Fr = {
|
|
1415
|
+
...Fe,
|
|
1413
1416
|
attributes: {
|
|
1414
|
-
...
|
|
1415
|
-
"*": [...
|
|
1417
|
+
...Fe.attributes,
|
|
1418
|
+
"*": [...Fe.attributes?.["*"] ?? [], "className"]
|
|
1416
1419
|
}
|
|
1417
1420
|
};
|
|
1418
|
-
function
|
|
1419
|
-
const t =
|
|
1421
|
+
function Ur(e) {
|
|
1422
|
+
const t = Ce.c(6), {
|
|
1420
1423
|
content: r,
|
|
1421
1424
|
allowHtml: n
|
|
1422
1425
|
} = e;
|
|
1423
1426
|
let c;
|
|
1424
|
-
t[0] !== n ? (c = n ? [
|
|
1425
|
-
const
|
|
1426
|
-
let
|
|
1427
|
-
return t[2] !== r || t[3] !== l || t[4] !==
|
|
1428
|
-
}
|
|
1429
|
-
const
|
|
1430
|
-
Overlay:
|
|
1431
|
-
Root:
|
|
1432
|
-
CommandList:
|
|
1433
|
-
Results:
|
|
1434
|
-
Message:
|
|
1427
|
+
t[0] !== n ? (c = n ? [sr, [ar, Fr]] : [], t[0] = n, t[1] = c) : c = t[1];
|
|
1428
|
+
const i = c, l = !n, d = i;
|
|
1429
|
+
let y;
|
|
1430
|
+
return t[2] !== r || t[3] !== l || t[4] !== d ? (y = /* @__PURE__ */ E.jsx(Hr, { skipHtml: l, remarkPlugins: Wr, rehypePlugins: d, components: zr, children: r }), t[2] = r, t[3] = l, t[4] = d, t[5] = y) : y = t[5], y;
|
|
1431
|
+
}
|
|
1432
|
+
const Yr = "_Overlay_pgin5_1", Gr = "_Root_pgin5_12", Jr = "_CommandList_pgin5_25", Kr = "_Results_pgin5_30", Xr = "_Message_pgin5_35", Ee = {
|
|
1433
|
+
Overlay: Yr,
|
|
1434
|
+
Root: Gr,
|
|
1435
|
+
CommandList: Jr,
|
|
1436
|
+
Results: Kr,
|
|
1437
|
+
Message: Xr
|
|
1435
1438
|
};
|
|
1436
|
-
function
|
|
1439
|
+
function Zr(e) {
|
|
1437
1440
|
return e.id;
|
|
1438
1441
|
}
|
|
1439
|
-
function
|
|
1442
|
+
function Ke(e, t) {
|
|
1440
1443
|
const r = e.toLowerCase(), n = t.toLowerCase();
|
|
1441
1444
|
let c = 0;
|
|
1442
|
-
for (let
|
|
1443
|
-
r[
|
|
1445
|
+
for (let i = 0; i < r.length && c < n.length; i++)
|
|
1446
|
+
r[i] === n[c] && c++;
|
|
1444
1447
|
return c === n.length;
|
|
1445
1448
|
}
|
|
1446
|
-
function
|
|
1447
|
-
return
|
|
1449
|
+
function Qr(e, t) {
|
|
1450
|
+
return Ke(e.label, t) || (e.description ? Ke(e.description, t) : !1) || (e.group ? Ke(e.group, t) : !1);
|
|
1448
1451
|
}
|
|
1449
|
-
const
|
|
1450
|
-
function
|
|
1451
|
-
const t =
|
|
1452
|
+
const en = [];
|
|
1453
|
+
function tn(e) {
|
|
1454
|
+
const t = Ce.c(7), {
|
|
1452
1455
|
inputRef: r
|
|
1453
1456
|
} = e, {
|
|
1454
1457
|
listId: n
|
|
1455
|
-
} =
|
|
1456
|
-
activeKey:
|
|
1457
|
-
} =
|
|
1458
|
-
let
|
|
1459
|
-
t[0] !== l || t[1] !== r ? (
|
|
1458
|
+
} = tr(), c = rr(), {
|
|
1459
|
+
activeKey: i
|
|
1460
|
+
} = Gt(c.subscribe, c.getSnapshot, c.getSnapshot), l = i != null ? `${n}-item-${i}` : void 0;
|
|
1461
|
+
let d, y;
|
|
1462
|
+
t[0] !== l || t[1] !== r ? (d = () => {
|
|
1460
1463
|
l && r.current?.ownerDocument.getElementById(l)?.scrollIntoView?.({
|
|
1461
1464
|
block: "nearest"
|
|
1462
1465
|
});
|
|
1463
|
-
},
|
|
1464
|
-
let
|
|
1465
|
-
return t[4] !== l || t[5] !== r ? (
|
|
1466
|
+
}, y = [l, r], t[0] = l, t[1] = r, t[2] = d, t[3] = y) : (d = t[2], y = t[3]), St(d, y);
|
|
1467
|
+
let h;
|
|
1468
|
+
return t[4] !== l || t[5] !== r ? (h = /* @__PURE__ */ E.jsx(ue.Input, { ref: r, autoFocus: !1, role: "combobox", "aria-label": "Search commands", "aria-expanded": "true", "aria-haspopup": "listbox", "aria-activedescendant": l, autoComplete: "off", spellCheck: !1, "data-testid": "command-palette-input" }), t[4] = l, t[5] = r, t[6] = h) : h = t[6], h;
|
|
1466
1469
|
}
|
|
1467
|
-
const
|
|
1470
|
+
const rn = _e(function({
|
|
1468
1471
|
open: t,
|
|
1469
1472
|
onClose: r,
|
|
1470
1473
|
commands: n,
|
|
1471
1474
|
onSelect: c,
|
|
1472
|
-
placeholder:
|
|
1475
|
+
placeholder: i = "Type a command…",
|
|
1473
1476
|
loading: l = !1,
|
|
1474
|
-
error:
|
|
1475
|
-
},
|
|
1476
|
-
const
|
|
1477
|
-
const
|
|
1478
|
-
let
|
|
1479
|
-
for (const
|
|
1480
|
-
const
|
|
1481
|
-
|
|
1482
|
-
const
|
|
1483
|
-
|
|
1477
|
+
error: d
|
|
1478
|
+
}, y) {
|
|
1479
|
+
const h = G(null), k = G(null), j = G(!1), m = d !== void 0, T = Oe(() => n.filter((S) => !S.disabled), [n]), R = m || l ? en : T, H = Oe(() => {
|
|
1480
|
+
const S = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map();
|
|
1481
|
+
let I, B = -1;
|
|
1482
|
+
for (const N of R) {
|
|
1483
|
+
const q = N.group || "Other commands";
|
|
1484
|
+
q !== I && B++, I = q;
|
|
1485
|
+
const P = String(B);
|
|
1486
|
+
S.set(N.id, P), D.set(P, q);
|
|
1484
1487
|
}
|
|
1485
1488
|
return {
|
|
1486
|
-
keys:
|
|
1487
|
-
labels:
|
|
1488
|
-
grouped: R.some((
|
|
1489
|
+
keys: S,
|
|
1490
|
+
labels: D,
|
|
1491
|
+
grouped: R.some((N) => N.group)
|
|
1489
1492
|
};
|
|
1490
|
-
}, [R]),
|
|
1491
|
-
return
|
|
1493
|
+
}, [R]), x = De((S) => H.keys.get(S.id), [H]), z = De((S) => H.labels.get(S), [H]);
|
|
1494
|
+
return St(() => {
|
|
1492
1495
|
if (!t) return;
|
|
1493
|
-
const
|
|
1494
|
-
return
|
|
1496
|
+
const S = h.current, D = S?.ownerDocument, I = D?.activeElement;
|
|
1497
|
+
return j.current = !1, k.current?.focus({
|
|
1495
1498
|
preventScroll: !0
|
|
1496
1499
|
}), () => {
|
|
1497
|
-
|
|
1500
|
+
I instanceof HTMLElement && I.isConnected && (D?.activeElement === D?.body || S?.contains(D?.activeElement ?? null)) && I.focus({
|
|
1498
1501
|
preventScroll: !0
|
|
1499
1502
|
});
|
|
1500
1503
|
};
|
|
1501
|
-
}, [t]), t ? /* @__PURE__ */
|
|
1502
|
-
if (
|
|
1503
|
-
|
|
1504
|
-
}, className:
|
|
1505
|
-
|
|
1504
|
+
}, [t]), t ? /* @__PURE__ */ E.jsx("div", { role: "presentation", className: Ee.Overlay, onClick: r, "data-testid": "command-palette-overlay", children: /* @__PURE__ */ E.jsx("div", { ref: (S) => {
|
|
1505
|
+
if (h.current = S, typeof y == "function") return y(S);
|
|
1506
|
+
y && (y.current = S);
|
|
1507
|
+
}, className: Ee.Root, onClick: (S) => S.stopPropagation(), onMouseDown: (S) => {
|
|
1508
|
+
S.button === 0 && S.target instanceof Element && !S.target.closest("input, button") && (S.preventDefault(), k.current?.focus({
|
|
1506
1509
|
preventScroll: !0
|
|
1507
1510
|
}));
|
|
1508
|
-
}, onKeyDown: (
|
|
1509
|
-
|
|
1511
|
+
}, onKeyDown: (S) => S.stopPropagation(), onCompositionStartCapture: () => {
|
|
1512
|
+
j.current = !0;
|
|
1510
1513
|
}, onCompositionEndCapture: () => {
|
|
1511
|
-
|
|
1512
|
-
}, onKeyDownCapture: (
|
|
1513
|
-
if (
|
|
1514
|
-
|
|
1514
|
+
j.current = !1;
|
|
1515
|
+
}, onKeyDownCapture: (S) => {
|
|
1516
|
+
if (j.current || S.nativeEvent.isComposing || S.keyCode === 229) {
|
|
1517
|
+
S.stopPropagation();
|
|
1515
1518
|
return;
|
|
1516
1519
|
}
|
|
1517
|
-
if (
|
|
1518
|
-
|
|
1520
|
+
if (S.target instanceof HTMLButtonElement && S.key !== "Escape" && S.key !== "Tab") {
|
|
1521
|
+
S.stopPropagation();
|
|
1519
1522
|
return;
|
|
1520
1523
|
}
|
|
1521
|
-
if (
|
|
1522
|
-
|
|
1523
|
-
else if (
|
|
1524
|
-
const
|
|
1525
|
-
if (!
|
|
1526
|
-
const
|
|
1527
|
-
(
|
|
1528
|
-
}
|
|
1529
|
-
}, role: "dialog", "aria-modal": "true", "aria-label": "Command palette", "data-testid": "command-palette", children: /* @__PURE__ */
|
|
1530
|
-
|
|
1531
|
-
/* @__PURE__ */
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
] }), filterFn:
|
|
1535
|
-
const
|
|
1536
|
-
|
|
1537
|
-
}, onDismiss: r, placeholder:
|
|
1538
|
-
/* @__PURE__ */
|
|
1539
|
-
/* @__PURE__ */
|
|
1540
|
-
m ? /* @__PURE__ */
|
|
1541
|
-
/* @__PURE__ */
|
|
1542
|
-
/* @__PURE__ */
|
|
1524
|
+
if (S.key === "Escape")
|
|
1525
|
+
S.preventDefault(), S.stopPropagation(), r();
|
|
1526
|
+
else if (S.key === "Tab") {
|
|
1527
|
+
const D = h.current?.querySelectorAll("input:not(:disabled), button:not(:disabled)");
|
|
1528
|
+
if (!D?.length) return;
|
|
1529
|
+
const I = D[0], B = D[D.length - 1], N = I.ownerDocument.activeElement;
|
|
1530
|
+
(S.shiftKey && N === I || !S.shiftKey && N === B) && (S.preventDefault(), (S.shiftKey ? B : I).focus());
|
|
1531
|
+
}
|
|
1532
|
+
}, role: "dialog", "aria-modal": "true", "aria-label": "Command palette", "data-testid": "command-palette", children: /* @__PURE__ */ E.jsxs(ue.Root, { className: Ee.CommandList, role: "presentation", "aria-expanded": void 0, "aria-haspopup": void 0, "aria-owns": void 0, "aria-activedescendant": void 0, items: R, itemKey: Zr, renderItem: (S, D) => /* @__PURE__ */ E.jsxs(ue.Item, { itemKey: D.key, "data-testid": `command-item-${S.id}`, children: [
|
|
1533
|
+
S.icon && /* @__PURE__ */ E.jsx(ue.ItemIcon, { "aria-hidden": "true", children: S.icon }),
|
|
1534
|
+
/* @__PURE__ */ E.jsx(ue.ItemLabel, { children: S.label }),
|
|
1535
|
+
S.description && /* @__PURE__ */ E.jsx(ue.ItemDescription, { children: S.description }),
|
|
1536
|
+
S.shortcut && /* @__PURE__ */ E.jsx(ue.ItemShortcut, { children: S.shortcut })
|
|
1537
|
+
] }), filterFn: Qr, sortByScore: !1, groupBy: H.grouped ? x : void 0, groupLabel: z, loading: l && !m, onAction: (S) => {
|
|
1538
|
+
const D = R.find((I) => I.id === S && !I.disabled);
|
|
1539
|
+
D && (c(D), r());
|
|
1540
|
+
}, onDismiss: r, placeholder: i, density: "compact", children: [
|
|
1541
|
+
/* @__PURE__ */ E.jsx(tn, { inputRef: k }),
|
|
1542
|
+
/* @__PURE__ */ E.jsx(ue.Results, { className: Ee.Results, "aria-label": "Commands", "aria-busy": l && !m, "data-testid": "command-palette-list" }),
|
|
1543
|
+
m ? /* @__PURE__ */ E.jsx("div", { role: "alert", className: Ee.Message, "data-testid": "command-palette-error", children: d || "Unable to load commands." }) : /* @__PURE__ */ E.jsxs(E.Fragment, { children: [
|
|
1544
|
+
/* @__PURE__ */ E.jsx(ue.Loading, { role: "status", "data-testid": "command-palette-loading", children: "Loading commands…" }),
|
|
1545
|
+
/* @__PURE__ */ E.jsx(ue.Empty, { role: "status", "data-testid": "command-palette-empty", children: "No matching commands" })
|
|
1543
1546
|
] })
|
|
1544
1547
|
] }) }) }) : null;
|
|
1545
1548
|
});
|
|
1546
|
-
|
|
1547
|
-
const
|
|
1548
|
-
Root:
|
|
1549
|
-
Toolbar:
|
|
1550
|
-
SearchInput:
|
|
1551
|
-
CopyButton:
|
|
1552
|
-
Tree:
|
|
1553
|
-
Node:
|
|
1554
|
-
Row:
|
|
1555
|
-
RowHighlight:
|
|
1556
|
-
Chevron:
|
|
1557
|
-
ChevronExpanded:
|
|
1558
|
-
ChevronSpacer:
|
|
1559
|
-
Key:
|
|
1560
|
-
Colon:
|
|
1561
|
-
Value:
|
|
1562
|
-
Preview:
|
|
1563
|
-
Comma:
|
|
1549
|
+
rn.displayName = "CommandPalette";
|
|
1550
|
+
const nn = "_Root_1b5sv_1", on = "_Toolbar_1b5sv_12", sn = "_SearchInput_1b5sv_20", an = "_CopyButton_1b5sv_41", cn = "_Tree_1b5sv_55", ln = "_Node_1b5sv_59", un = "_Row_1b5sv_63", dn = "_RowHighlight_1b5sv_76", fn = "_Chevron_1b5sv_80", gn = "_ChevronExpanded_1b5sv_93", mn = "_ChevronSpacer_1b5sv_97", hn = "_Key_1b5sv_103", pn = "_Colon_1b5sv_107", yn = "_Value_1b5sv_111", vn = "_Preview_1b5sv_129", bn = "_Comma_1b5sv_134", ne = {
|
|
1551
|
+
Root: nn,
|
|
1552
|
+
Toolbar: on,
|
|
1553
|
+
SearchInput: sn,
|
|
1554
|
+
CopyButton: an,
|
|
1555
|
+
Tree: cn,
|
|
1556
|
+
Node: ln,
|
|
1557
|
+
Row: un,
|
|
1558
|
+
RowHighlight: dn,
|
|
1559
|
+
Chevron: fn,
|
|
1560
|
+
ChevronExpanded: gn,
|
|
1561
|
+
ChevronSpacer: mn,
|
|
1562
|
+
Key: hn,
|
|
1563
|
+
Colon: pn,
|
|
1564
|
+
Value: yn,
|
|
1565
|
+
Preview: vn,
|
|
1566
|
+
Comma: bn
|
|
1564
1567
|
};
|
|
1565
|
-
function
|
|
1568
|
+
function Xe(...e) {
|
|
1566
1569
|
return e.filter(Boolean).join(" ");
|
|
1567
1570
|
}
|
|
1568
|
-
function
|
|
1571
|
+
function Nt(e) {
|
|
1569
1572
|
return e === null ? "null" : e === void 0 ? "undefined" : Array.isArray(e) ? "array" : typeof e;
|
|
1570
1573
|
}
|
|
1571
|
-
function
|
|
1574
|
+
function wn(e) {
|
|
1572
1575
|
return e === null ? "null" : e === void 0 ? "undefined" : typeof e == "string" ? JSON.stringify(e) : String(e);
|
|
1573
1576
|
}
|
|
1574
|
-
function
|
|
1577
|
+
function _n(e, t) {
|
|
1575
1578
|
return typeof e == "boolean" ? e : t < e;
|
|
1576
1579
|
}
|
|
1577
|
-
function
|
|
1580
|
+
function At(e, t, r) {
|
|
1578
1581
|
const n = r.toLowerCase();
|
|
1579
1582
|
return !!(e.toLowerCase().includes(n) || typeof t == "string" && t.toLowerCase().includes(n) || typeof t == "number" && String(t).includes(n) || typeof t == "boolean" && String(t).includes(n));
|
|
1580
1583
|
}
|
|
1581
|
-
function
|
|
1584
|
+
function Me(e) {
|
|
1582
1585
|
return e !== null && (typeof e == "object" || typeof e == "function");
|
|
1583
1586
|
}
|
|
1584
|
-
function
|
|
1587
|
+
function Lt(e, t, r, n) {
|
|
1585
1588
|
if (!t) return !1;
|
|
1586
|
-
const c =
|
|
1587
|
-
if (c !== "object" && c !== "array" || e == null ||
|
|
1588
|
-
if (
|
|
1589
|
-
const
|
|
1590
|
-
has: (
|
|
1589
|
+
const c = Nt(e);
|
|
1590
|
+
if (c !== "object" && c !== "array" || e == null || Me(e) && r.has(e)) return !1;
|
|
1591
|
+
if (Me(e) && n.has(e)) return n.get(e);
|
|
1592
|
+
const i = {
|
|
1593
|
+
has: (d) => d === e || r.has(d)
|
|
1591
1594
|
};
|
|
1592
1595
|
let l = !1;
|
|
1593
|
-
for (const [
|
|
1594
|
-
if (
|
|
1596
|
+
for (const [d, y] of Object.entries(e))
|
|
1597
|
+
if (At(d, y, t) || Lt(y, t, i, n)) {
|
|
1595
1598
|
l = !0;
|
|
1596
1599
|
break;
|
|
1597
1600
|
}
|
|
1598
|
-
return
|
|
1601
|
+
return Me(e) && n.set(e, l), l;
|
|
1599
1602
|
}
|
|
1600
|
-
function
|
|
1601
|
-
const t =
|
|
1603
|
+
function Pt(e) {
|
|
1604
|
+
const t = Ce.c(80), {
|
|
1602
1605
|
nodeKey: r,
|
|
1603
1606
|
value: n,
|
|
1604
1607
|
depth: c,
|
|
1605
|
-
defaultExpanded:
|
|
1608
|
+
defaultExpanded: i,
|
|
1606
1609
|
searchQuery: l,
|
|
1607
|
-
isLast:
|
|
1608
|
-
ancestors:
|
|
1609
|
-
searchCache:
|
|
1610
|
+
isLast: d,
|
|
1611
|
+
ancestors: y,
|
|
1612
|
+
searchCache: h
|
|
1610
1613
|
} = e;
|
|
1611
|
-
let
|
|
1612
|
-
t[0] !== n ? (
|
|
1613
|
-
const
|
|
1614
|
+
let k;
|
|
1615
|
+
t[0] !== n ? (k = Nt(n), t[0] = n, t[1] = k) : k = t[1];
|
|
1616
|
+
const j = k, m = j === "object" || j === "array";
|
|
1614
1617
|
let T;
|
|
1615
|
-
t[2] !==
|
|
1618
|
+
t[2] !== y || t[3] !== m || t[4] !== n ? (T = m && Me(n) && y.has(n), t[2] = y, t[3] = m, t[4] = n, t[5] = T) : T = t[5];
|
|
1616
1619
|
const R = T;
|
|
1617
1620
|
let H;
|
|
1618
|
-
t[6] !==
|
|
1619
|
-
const [
|
|
1620
|
-
let
|
|
1621
|
-
t[11] !==
|
|
1622
|
-
const
|
|
1623
|
-
let
|
|
1624
|
-
t[16] !==
|
|
1625
|
-
l &&
|
|
1626
|
-
},
|
|
1627
|
-
let
|
|
1621
|
+
t[6] !== i || t[7] !== c || t[8] !== R || t[9] !== m ? (H = () => m && !R && _n(i, c), t[6] = i, t[7] = c, t[8] = R, t[9] = m, t[10] = H) : H = t[10];
|
|
1622
|
+
const [x, z] = me(H), S = G(!1), D = G(!1);
|
|
1623
|
+
let I;
|
|
1624
|
+
t[11] !== y || t[12] !== h || t[13] !== l || t[14] !== n ? (I = l ? Lt(n, l, y, h) : !1, t[11] = y, t[12] = h, t[13] = l, t[14] = n, t[15] = I) : I = t[15];
|
|
1625
|
+
const B = I;
|
|
1626
|
+
let N, q;
|
|
1627
|
+
t[16] !== x || t[17] !== B || t[18] !== R || t[19] !== m || t[20] !== l ? (N = () => {
|
|
1628
|
+
l && B && m && !R && !x && (S.current || (D.current = x), S.current = !0, z(!0)), S.current && (!l || !B) && (S.current = !1, z(D.current));
|
|
1629
|
+
}, q = [l, B, m, R, x], t[16] = x, t[17] = B, t[18] = R, t[19] = m, t[20] = l, t[21] = N, t[22] = q) : (N = t[21], q = t[22]), U(N, q);
|
|
1630
|
+
let P;
|
|
1628
1631
|
e: {
|
|
1629
|
-
if (!m || !
|
|
1630
|
-
|
|
1632
|
+
if (!m || !Me(n) || R) {
|
|
1633
|
+
P = y;
|
|
1631
1634
|
break e;
|
|
1632
1635
|
}
|
|
1633
|
-
let
|
|
1634
|
-
t[23] !==
|
|
1635
|
-
has: (ce) => ce === n ||
|
|
1636
|
-
}, t[23] =
|
|
1636
|
+
let X;
|
|
1637
|
+
t[23] !== y || t[24] !== n ? (X = {
|
|
1638
|
+
has: (ce) => ce === n || y.has(ce)
|
|
1639
|
+
}, t[23] = y, t[24] = n, t[25] = X) : X = t[25], P = X;
|
|
1637
1640
|
}
|
|
1638
|
-
const
|
|
1639
|
-
let
|
|
1641
|
+
const V = P;
|
|
1642
|
+
let K;
|
|
1640
1643
|
e: {
|
|
1641
1644
|
if (!m || n === null || n === void 0 || R) {
|
|
1642
1645
|
let ce;
|
|
1643
|
-
t[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ce = [], t[26] = ce) : ce = t[26],
|
|
1646
|
+
t[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ce = [], t[26] = ce) : ce = t[26], K = ce;
|
|
1644
1647
|
break e;
|
|
1645
1648
|
}
|
|
1646
|
-
let
|
|
1647
|
-
t[27] !== n ? (
|
|
1649
|
+
let X;
|
|
1650
|
+
t[27] !== n ? (X = Object.entries(n), t[27] = n, t[28] = X) : X = t[28], K = X;
|
|
1648
1651
|
}
|
|
1649
|
-
const
|
|
1650
|
-
let
|
|
1651
|
-
t[29] !== R || t[30] !== m ? (
|
|
1652
|
-
m && !R &&
|
|
1653
|
-
}, t[29] = R, t[30] = m, t[31] =
|
|
1654
|
-
const
|
|
1655
|
-
let
|
|
1656
|
-
t[32] !== r || t[33] !== l || t[34] !== n ? (
|
|
1657
|
-
const
|
|
1658
|
-
let
|
|
1659
|
-
t[36] !==
|
|
1660
|
-
const
|
|
1661
|
-
let
|
|
1662
|
-
t[38] !==
|
|
1663
|
-
"--_inspector-depth-indent":
|
|
1664
|
-
}, t[38] =
|
|
1665
|
-
const
|
|
1652
|
+
const b = K;
|
|
1653
|
+
let o;
|
|
1654
|
+
t[29] !== R || t[30] !== m ? (o = () => {
|
|
1655
|
+
m && !R && z(Cn);
|
|
1656
|
+
}, t[29] = R, t[30] = m, t[31] = o) : o = t[31];
|
|
1657
|
+
const v = o;
|
|
1658
|
+
let p;
|
|
1659
|
+
t[32] !== r || t[33] !== l || t[34] !== n ? (p = l && At(r, n, l), t[32] = r, t[33] = l, t[34] = n, t[35] = p) : p = t[35];
|
|
1660
|
+
const s = p, u = R ? "[Circular]" : m ? j === "array" ? `Array(${n.length})` : `{${b.length}}` : null, f = s && ne.RowHighlight;
|
|
1661
|
+
let g;
|
|
1662
|
+
t[36] !== f ? (g = Xe(ne.Row, f), t[36] = f, t[37] = g) : g = t[37];
|
|
1663
|
+
const _ = `${c * 16}px`;
|
|
1664
|
+
let C;
|
|
1665
|
+
t[38] !== _ ? (C = {
|
|
1666
|
+
"--_inspector-depth-indent": _
|
|
1667
|
+
}, t[38] = _, t[39] = C) : C = t[39];
|
|
1668
|
+
const a = C;
|
|
1666
1669
|
let w;
|
|
1667
|
-
t[40] !==
|
|
1668
|
-
(
|
|
1669
|
-
}, t[40] =
|
|
1670
|
-
const A = m && !R ?
|
|
1671
|
-
let
|
|
1672
|
-
t[42] !==
|
|
1670
|
+
t[40] !== v ? (w = (X) => {
|
|
1671
|
+
(X.key === "Enter" || X.key === " ") && (X.preventDefault(), v());
|
|
1672
|
+
}, t[40] = v, t[41] = w) : w = t[41];
|
|
1673
|
+
const A = m && !R ? x : void 0, L = `inspector-node-${r}`;
|
|
1674
|
+
let F;
|
|
1675
|
+
t[42] !== x || t[43] !== R || t[44] !== m ? (F = m && !R ? /* @__PURE__ */ E.jsx("span", { className: Xe(ne.Chevron, x && ne.ChevronExpanded), children: "▸" }) : /* @__PURE__ */ E.jsx("span", { className: ne.ChevronSpacer }), t[42] = x, t[43] = R, t[44] = m, t[45] = F) : F = t[45];
|
|
1673
1676
|
let O;
|
|
1674
|
-
t[46] !== r ? (O = /* @__PURE__ */
|
|
1675
|
-
let
|
|
1676
|
-
t[48] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
1677
|
+
t[46] !== r ? (O = /* @__PURE__ */ E.jsx("span", { className: ne.Key, children: r }), t[46] = r, t[47] = O) : O = t[47];
|
|
1678
|
+
let $;
|
|
1679
|
+
t[48] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? ($ = /* @__PURE__ */ E.jsx("span", { className: ne.Colon, children: ": " }), t[48] = $) : $ = t[48];
|
|
1677
1680
|
let J;
|
|
1678
|
-
t[49] !== m || t[50] !==
|
|
1679
|
-
let
|
|
1680
|
-
t[54] !==
|
|
1681
|
+
t[49] !== m || t[50] !== u || t[51] !== j || t[52] !== n ? (J = m ? /* @__PURE__ */ E.jsx("span", { className: ne.Preview, children: u }) : /* @__PURE__ */ E.jsx("span", { className: ne.Value, "data-type": j, children: wn(n) }), t[49] = m, t[50] = u, t[51] = j, t[52] = n, t[53] = J) : J = t[53];
|
|
1682
|
+
let Z;
|
|
1683
|
+
t[54] !== x || t[55] !== d ? (Z = !d && !x && /* @__PURE__ */ E.jsx("span", { className: ne.Comma, children: "," }), t[54] = x, t[55] = d, t[56] = Z) : Z = t[56];
|
|
1681
1684
|
let oe;
|
|
1682
|
-
t[57] !==
|
|
1683
|
-
|
|
1685
|
+
t[57] !== g || t[58] !== a || t[59] !== w || t[60] !== A || t[61] !== L || t[62] !== F || t[63] !== O || t[64] !== J || t[65] !== Z || t[66] !== v ? (oe = /* @__PURE__ */ E.jsxs("div", { className: g, style: a, onClick: v, onKeyDown: w, tabIndex: 0, role: "treeitem", "aria-expanded": A, "data-testid": L, children: [
|
|
1686
|
+
F,
|
|
1684
1687
|
O,
|
|
1685
|
-
|
|
1688
|
+
$,
|
|
1686
1689
|
J,
|
|
1687
|
-
|
|
1688
|
-
] }), t[57] =
|
|
1690
|
+
Z
|
|
1691
|
+
] }), t[57] = g, t[58] = a, t[59] = w, t[60] = A, t[61] = L, t[62] = F, t[63] = O, t[64] = J, t[65] = Z, t[66] = v, t[67] = oe) : oe = t[67];
|
|
1689
1692
|
let le;
|
|
1690
|
-
t[68] !==
|
|
1691
|
-
const [
|
|
1692
|
-
return /* @__PURE__ */
|
|
1693
|
-
}), t[68] =
|
|
1693
|
+
t[68] !== V || t[69] !== i || t[70] !== c || t[71] !== b || t[72] !== x || t[73] !== h || t[74] !== l ? (le = x && b.map((X, ce) => {
|
|
1694
|
+
const [te, Ie] = X;
|
|
1695
|
+
return /* @__PURE__ */ E.jsx(Pt, { nodeKey: te, value: Ie, depth: c + 1, defaultExpanded: i, searchQuery: l, isLast: ce === b.length - 1, ancestors: V, searchCache: h }, te);
|
|
1696
|
+
}), t[68] = V, t[69] = i, t[70] = c, t[71] = b, t[72] = x, t[73] = h, t[74] = l, t[75] = le) : le = t[75];
|
|
1694
1697
|
let ae;
|
|
1695
|
-
return t[76] !== c || t[77] !== oe || t[78] !== le ? (ae = /* @__PURE__ */
|
|
1698
|
+
return t[76] !== c || t[77] !== oe || t[78] !== le ? (ae = /* @__PURE__ */ E.jsxs("div", { className: ne.Node, "data-depth": c, children: [
|
|
1696
1699
|
oe,
|
|
1697
1700
|
le
|
|
1698
1701
|
] }), t[76] = c, t[77] = oe, t[78] = le, t[79] = ae) : ae = t[79], ae;
|
|
1699
1702
|
}
|
|
1700
|
-
function
|
|
1703
|
+
function Cn(e) {
|
|
1701
1704
|
return !e;
|
|
1702
1705
|
}
|
|
1703
|
-
const
|
|
1706
|
+
const xn = /* @__PURE__ */ new WeakSet(), kn = _e(function({
|
|
1704
1707
|
data: t,
|
|
1705
1708
|
format: r = "json",
|
|
1706
1709
|
defaultExpanded: n = 1,
|
|
1707
1710
|
searchable: c = !1,
|
|
1708
|
-
copyable:
|
|
1711
|
+
copyable: i = !1,
|
|
1709
1712
|
className: l,
|
|
1710
|
-
...
|
|
1711
|
-
},
|
|
1712
|
-
const [
|
|
1713
|
+
...d
|
|
1714
|
+
}, y) {
|
|
1715
|
+
const [h, k] = me(""), j = De(async () => {
|
|
1713
1716
|
try {
|
|
1714
1717
|
let R;
|
|
1715
|
-
r === "yaml" ? R =
|
|
1718
|
+
r === "yaml" ? R = Ze(t) : R = Rn(t), await navigator.clipboard.writeText(R);
|
|
1716
1719
|
} catch {
|
|
1717
1720
|
}
|
|
1718
|
-
}, [t, r]), m =
|
|
1719
|
-
return /* @__PURE__ */
|
|
1720
|
-
(c ||
|
|
1721
|
-
c && /* @__PURE__ */
|
|
1722
|
-
|
|
1721
|
+
}, [t, r]), m = xn, T = Oe(() => /* @__PURE__ */ new WeakMap(), [h]);
|
|
1722
|
+
return /* @__PURE__ */ E.jsxs("div", { ref: y, className: Xe(ne.Root, l), "data-testid": "object-inspector", "data-format": r, ...d, children: [
|
|
1723
|
+
(c || i) && /* @__PURE__ */ E.jsxs("div", { className: ne.Toolbar, children: [
|
|
1724
|
+
c && /* @__PURE__ */ E.jsx("input", { className: ne.SearchInput, type: "text", value: h, onChange: (R) => k(R.target.value), placeholder: "Search keys/values…", "aria-label": "Search object", "data-testid": "inspector-search" }),
|
|
1725
|
+
i && /* @__PURE__ */ E.jsx("button", { className: ne.CopyButton, onClick: j, "data-testid": "inspector-copy", type: "button", children: "Copy" })
|
|
1723
1726
|
] }),
|
|
1724
|
-
/* @__PURE__ */
|
|
1727
|
+
/* @__PURE__ */ E.jsx("div", { className: ne.Tree, role: "tree", "data-testid": "inspector-tree", children: /* @__PURE__ */ E.jsx(Pt, { nodeKey: "root", value: t, depth: 0, defaultExpanded: n, searchQuery: h, isLast: !0, ancestors: m, searchCache: T }) })
|
|
1725
1728
|
] });
|
|
1726
1729
|
});
|
|
1727
|
-
|
|
1728
|
-
function
|
|
1730
|
+
kn.displayName = "ObjectInspector";
|
|
1731
|
+
function Rn(e) {
|
|
1729
1732
|
const t = [];
|
|
1730
1733
|
return JSON.stringify(e, function(r, n) {
|
|
1731
1734
|
if (typeof n != "object" || n === null) return n;
|
|
@@ -1734,268 +1737,752 @@ function yn(e) {
|
|
|
1734
1737
|
return t.includes(n) ? "[Circular]" : (t.push(n), n);
|
|
1735
1738
|
}, 2);
|
|
1736
1739
|
}
|
|
1737
|
-
function
|
|
1740
|
+
function Ot(e) {
|
|
1738
1741
|
return !!(e === "" || /^[\s]/.test(e) || /[\s]$/.test(e) || /^[-?:,[\]{}#&*!|>'"%@`]/.test(e) || /[:\s]#|:\s|[{}[\],]/.test(e) || /^(true|false|yes|no|on|off|null|~)$/i.test(e) || /^[+-]?(\d+\.?\d*|\.inf|\.nan)$/i.test(e));
|
|
1739
1742
|
}
|
|
1740
|
-
function
|
|
1743
|
+
function Dt(e) {
|
|
1741
1744
|
return '"' + e.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\t/g, "\\t").replace(/\r/g, "\\r") + '"';
|
|
1742
1745
|
}
|
|
1743
|
-
function
|
|
1746
|
+
function Sn(e, t) {
|
|
1744
1747
|
const r = " ".repeat(t);
|
|
1745
1748
|
return e.includes(`
|
|
1746
1749
|
`) ? `|
|
|
1747
1750
|
${r} ${e.split(`
|
|
1748
1751
|
`).join(`
|
|
1749
|
-
${r} `)}` :
|
|
1752
|
+
${r} `)}` : Ot(e) ? Dt(e) : e;
|
|
1750
1753
|
}
|
|
1751
|
-
function
|
|
1754
|
+
function Ze(e, t = 0, r) {
|
|
1752
1755
|
const n = " ".repeat(t);
|
|
1753
1756
|
if (e === null || e === void 0) return "null";
|
|
1754
|
-
if (typeof e == "string") return
|
|
1757
|
+
if (typeof e == "string") return Sn(e, t);
|
|
1755
1758
|
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
1756
1759
|
if (typeof e == "object") {
|
|
1757
1760
|
const c = r ?? [];
|
|
1758
1761
|
if (c.includes(e)) return '"[Circular]"';
|
|
1759
|
-
const
|
|
1762
|
+
const i = [...c, e];
|
|
1760
1763
|
if (Array.isArray(e))
|
|
1761
|
-
return e.length === 0 ? "[]" : e.map((
|
|
1764
|
+
return e.length === 0 ? "[]" : e.map((d) => `${n}- ${Ze(d, t + 1, i).trimStart()}`).join(`
|
|
1762
1765
|
`);
|
|
1763
1766
|
const l = Object.entries(e);
|
|
1764
|
-
return l.length === 0 ? "{}" : l.map(([
|
|
1765
|
-
const
|
|
1766
|
-
return typeof
|
|
1767
|
-
${
|
|
1767
|
+
return l.length === 0 ? "{}" : l.map(([d, y]) => {
|
|
1768
|
+
const h = Ot(d) ? Dt(d) : d, k = Ze(y, t + 1, i);
|
|
1769
|
+
return typeof y == "object" && y !== null && (Array.isArray(y) ? y.length > 0 : Object.keys(y).length > 0) ? `${n}${h}:
|
|
1770
|
+
${k}` : `${n}${h}: ${k}`;
|
|
1768
1771
|
}).join(`
|
|
1769
1772
|
`);
|
|
1770
1773
|
}
|
|
1771
1774
|
return String(e);
|
|
1772
1775
|
}
|
|
1773
|
-
|
|
1776
|
+
const we = "cel", vt = /* @__PURE__ */ new WeakSet();
|
|
1777
|
+
function En(e) {
|
|
1778
|
+
vt.has(e) || (vt.add(e), e.languages.register({
|
|
1779
|
+
id: we,
|
|
1780
|
+
extensions: [".cel"],
|
|
1781
|
+
aliases: ["CEL"]
|
|
1782
|
+
}), e.languages.setLanguageConfiguration(we, {
|
|
1783
|
+
comments: {
|
|
1784
|
+
lineComment: "//"
|
|
1785
|
+
},
|
|
1786
|
+
brackets: [["{", "}"], ["[", "]"], ["(", ")"]],
|
|
1787
|
+
autoClosingPairs: [{
|
|
1788
|
+
open: "{",
|
|
1789
|
+
close: "}"
|
|
1790
|
+
}, {
|
|
1791
|
+
open: "[",
|
|
1792
|
+
close: "]"
|
|
1793
|
+
}, {
|
|
1794
|
+
open: "(",
|
|
1795
|
+
close: ")"
|
|
1796
|
+
}, {
|
|
1797
|
+
open: '"',
|
|
1798
|
+
close: '"',
|
|
1799
|
+
notIn: ["string", "comment"]
|
|
1800
|
+
}, {
|
|
1801
|
+
open: "'",
|
|
1802
|
+
close: "'",
|
|
1803
|
+
notIn: ["string", "comment"]
|
|
1804
|
+
}],
|
|
1805
|
+
surroundingPairs: [{
|
|
1806
|
+
open: "{",
|
|
1807
|
+
close: "}"
|
|
1808
|
+
}, {
|
|
1809
|
+
open: "[",
|
|
1810
|
+
close: "]"
|
|
1811
|
+
}, {
|
|
1812
|
+
open: "(",
|
|
1813
|
+
close: ")"
|
|
1814
|
+
}, {
|
|
1815
|
+
open: '"',
|
|
1816
|
+
close: '"'
|
|
1817
|
+
}, {
|
|
1818
|
+
open: "'",
|
|
1819
|
+
close: "'"
|
|
1820
|
+
}],
|
|
1821
|
+
wordPattern: /[a-zA-Z_][a-zA-Z_0-9]*/g
|
|
1822
|
+
}), e.languages.setMonarchTokensProvider(we, {
|
|
1823
|
+
keywords: ["true", "false", "null", "in"],
|
|
1824
|
+
tokenizer: {
|
|
1825
|
+
root: [[/\/\/.*$/, "comment"], [/[rR]?[bB]?'''/, "string", "@tripleSingle"], [/[rR]?[bB]?"""/, "string", "@tripleDouble"], [/[rR]?[bB]?'/, "string", "@single"], [/[rR]?[bB]?"/, "string", "@double"], [/0[xX][0-9a-fA-F]+[uU]?/, "number.hex"], [/(?:\d+\.\d*|\.\d+|\d+)(?:[eE][+-]?\d+)?[uU]?/, "number"], [/[a-zA-Z_][a-zA-Z_0-9]*(?=\s*\()/, "type.identifier"], [/[a-zA-Z_][a-zA-Z_0-9]*/, {
|
|
1826
|
+
cases: {
|
|
1827
|
+
"@keywords": "keyword",
|
|
1828
|
+
"@default": "identifier"
|
|
1829
|
+
}
|
|
1830
|
+
}], [/[{}()[\]]/, "@brackets"], [/[!<>=&|+*/%?:-]+/, "operator"], [/[.,]/, "delimiter"], [/\s+/, "white"]],
|
|
1831
|
+
single: [[/\\./, "string.escape"], [/'/, "string", "@pop"], [/[^'\\]+/, "string"]],
|
|
1832
|
+
double: [[/\\./, "string.escape"], [/"/, "string", "@pop"], [/[^"\\]+/, "string"]],
|
|
1833
|
+
tripleSingle: [[/'''/, "string", "@pop"], [/\\./, "string.escape"], [/[^'\\]+|'/, "string"]],
|
|
1834
|
+
tripleDouble: [[/"""/, "string", "@pop"], [/\\./, "string.escape"], [/[^"\\]+|"/, "string"]]
|
|
1835
|
+
}
|
|
1836
|
+
}));
|
|
1837
|
+
}
|
|
1838
|
+
function bt(e, t) {
|
|
1839
|
+
const r = or(e, t);
|
|
1840
|
+
let n = 1, c = 0;
|
|
1841
|
+
for (let i = 0; i < r; i++)
|
|
1842
|
+
if (e[i] === "\r" || e[i] === `
|
|
1843
|
+
`) {
|
|
1844
|
+
if (e[i] === "\r" && e[i + 1] === `
|
|
1845
|
+
` && i++, i >= r) throw new RangeError("Offset splits a line ending");
|
|
1846
|
+
n++, c = i + 1;
|
|
1847
|
+
}
|
|
1848
|
+
return {
|
|
1849
|
+
lineNumber: n,
|
|
1850
|
+
column: r - c + 1
|
|
1851
|
+
};
|
|
1852
|
+
}
|
|
1853
|
+
function Tn(e, t) {
|
|
1854
|
+
if (!Number.isSafeInteger(t.lineNumber) || t.lineNumber < 1 || !Number.isSafeInteger(t.column) || t.column < 1) throw new RangeError("Expected a one-based source position");
|
|
1855
|
+
let r = 1, n = 0;
|
|
1856
|
+
for (; r < t.lineNumber; ) {
|
|
1857
|
+
let l = n;
|
|
1858
|
+
for (; l < e.length && e[l] !== "\r" && e[l] !== `
|
|
1859
|
+
`; ) l++;
|
|
1860
|
+
if (l === e.length) throw new RangeError("Position exceeds source lines");
|
|
1861
|
+
n = l + (e[l] === "\r" && e[l + 1] === `
|
|
1862
|
+
` ? 2 : 1), r++;
|
|
1863
|
+
}
|
|
1864
|
+
const c = n + t.column - 1;
|
|
1865
|
+
let i = n;
|
|
1866
|
+
for (; i < e.length && e[i] !== "\r" && e[i] !== `
|
|
1867
|
+
`; ) i++;
|
|
1868
|
+
if (c > i) throw new RangeError("Position exceeds source line");
|
|
1869
|
+
return nr(e, c);
|
|
1870
|
+
}
|
|
1871
|
+
function Mn(e, t) {
|
|
1872
|
+
let r = 0;
|
|
1873
|
+
const n = e.toLocaleLowerCase();
|
|
1874
|
+
for (const c of t.toLocaleLowerCase())
|
|
1875
|
+
if (c === n[r] && r++, r === n.length) return !0;
|
|
1876
|
+
return n.length === 0;
|
|
1877
|
+
}
|
|
1878
|
+
function Ae() {
|
|
1879
|
+
let e;
|
|
1880
|
+
return {
|
|
1881
|
+
begin() {
|
|
1882
|
+
return e?.abort(), e = new AbortController(), e;
|
|
1883
|
+
},
|
|
1884
|
+
current(t) {
|
|
1885
|
+
return e === t && !t.signal.aborted;
|
|
1886
|
+
},
|
|
1887
|
+
cancel() {
|
|
1888
|
+
e?.abort(), e = void 0;
|
|
1889
|
+
}
|
|
1890
|
+
};
|
|
1891
|
+
}
|
|
1892
|
+
function jn(e, t = 250) {
|
|
1893
|
+
let r;
|
|
1894
|
+
const n = () => {
|
|
1895
|
+
clearTimeout(r), r = void 0;
|
|
1896
|
+
};
|
|
1897
|
+
return {
|
|
1898
|
+
schedule(c = t) {
|
|
1899
|
+
n(), r = setTimeout(() => {
|
|
1900
|
+
r = void 0, e();
|
|
1901
|
+
}, c);
|
|
1902
|
+
},
|
|
1903
|
+
immediate() {
|
|
1904
|
+
n(), e();
|
|
1905
|
+
},
|
|
1906
|
+
cancel: n
|
|
1907
|
+
};
|
|
1908
|
+
}
|
|
1909
|
+
function Nn(e, t, r, n, c = 250) {
|
|
1910
|
+
const i = e.getModel();
|
|
1911
|
+
if (!i) throw new Error("CEL editor requires its own model");
|
|
1912
|
+
En(t), t.editor.setModelLanguage(i, we);
|
|
1913
|
+
const l = Ae(), d = Ae(), y = Ae(), h = Ae();
|
|
1914
|
+
let k = !1, j = !1, m = 0, T, R = !1, H = !1, x;
|
|
1915
|
+
const z = `cel:${i.uri.toString()}`, S = {
|
|
1916
|
+
language: we,
|
|
1917
|
+
scheme: i.uri.scheme,
|
|
1918
|
+
pattern: i.uri.path
|
|
1919
|
+
}, D = () => {
|
|
1920
|
+
const o = r();
|
|
1921
|
+
return k || i.isDisposed() || j || o.disabled || !!(o.availability && o.availability.status !== "ready");
|
|
1922
|
+
};
|
|
1923
|
+
function I() {
|
|
1924
|
+
e.trigger("cel", "closeParameterHints", {}), e.getContribution("editor.contrib.contentHover")?._hideWidgets();
|
|
1925
|
+
}
|
|
1926
|
+
function B(o, v) {
|
|
1927
|
+
if (v.unit !== "utf8-byte" || v.end < v.start) throw new RangeError("Expected a half-open UTF-8 range");
|
|
1928
|
+
const p = bt(o, v.start), s = bt(o, v.end);
|
|
1929
|
+
return {
|
|
1930
|
+
startLineNumber: p.lineNumber,
|
|
1931
|
+
startColumn: p.column,
|
|
1932
|
+
endLineNumber: s.lineNumber,
|
|
1933
|
+
endColumn: s.column
|
|
1934
|
+
};
|
|
1935
|
+
}
|
|
1936
|
+
async function N(o, v, p, s) {
|
|
1937
|
+
if (!o || D() || s?.isCancellationRequested) return;
|
|
1938
|
+
const u = r(), f = {
|
|
1939
|
+
...u.document,
|
|
1940
|
+
uri: i.uri.toString()
|
|
1941
|
+
}, g = i.getVersionId(), _ = m, C = p.begin(), a = s?.onCancellationRequested(() => C.abort());
|
|
1942
|
+
try {
|
|
1943
|
+
const w = await o({
|
|
1944
|
+
document: f,
|
|
1945
|
+
contextKey: u.contextKey,
|
|
1946
|
+
cursor: {
|
|
1947
|
+
offset: Tn(f.text, v),
|
|
1948
|
+
unit: "utf8-byte"
|
|
1949
|
+
},
|
|
1950
|
+
signal: C.signal
|
|
1951
|
+
}), A = r();
|
|
1952
|
+
return D() || !p.current(C) || _ !== m || i.isDisposed() || i.getVersionId() !== g || A.contextKey !== u.contextKey || A.document.version !== f.version || A.document.text !== f.text || w.documentVersion !== f.version || w.contextKey !== u.contextKey ? void 0 : (w.status !== "ready" && w.status !== "empty" && n(w.message ?? `CEL language service ${w.status}.`), w);
|
|
1953
|
+
} catch (w) {
|
|
1954
|
+
!C.signal.aborted && p.current(C) && !k && n(w instanceof Error ? w.message : "CEL language service request failed.");
|
|
1955
|
+
return;
|
|
1956
|
+
} finally {
|
|
1957
|
+
a?.dispose();
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
function q(o) {
|
|
1961
|
+
if (o.status === "denied" || o.status === "unavailable") {
|
|
1962
|
+
t.editor.setModelMarkers(i, z, []);
|
|
1963
|
+
return;
|
|
1964
|
+
}
|
|
1965
|
+
const v = {
|
|
1966
|
+
error: t.MarkerSeverity.Error,
|
|
1967
|
+
warning: t.MarkerSeverity.Warning,
|
|
1968
|
+
info: t.MarkerSeverity.Info,
|
|
1969
|
+
hint: t.MarkerSeverity.Hint
|
|
1970
|
+
}, p = [];
|
|
1971
|
+
for (const s of o.diagnostics)
|
|
1972
|
+
try {
|
|
1973
|
+
p.push({
|
|
1974
|
+
...B(r().document.text, s.range),
|
|
1975
|
+
severity: v[s.severity],
|
|
1976
|
+
message: s.message,
|
|
1977
|
+
source: "CEL",
|
|
1978
|
+
code: s.id
|
|
1979
|
+
});
|
|
1980
|
+
} catch {
|
|
1981
|
+
n("The language service returned an invalid UTF-8 diagnostic range.");
|
|
1982
|
+
}
|
|
1983
|
+
t.editor.setModelMarkers(i, z, p);
|
|
1984
|
+
}
|
|
1985
|
+
function P(o, v, p) {
|
|
1986
|
+
if (o.disabledReason) return;
|
|
1987
|
+
const s = r().document.text, u = B(s, o.edit.range);
|
|
1988
|
+
if (u.startLineNumber !== p.lineNumber || u.endLineNumber !== p.lineNumber || u.startColumn > p.column || u.endColumn < p.column) throw new RangeError("Completion range must contain the cursor on one line");
|
|
1989
|
+
const f = i.getValueInRange({
|
|
1990
|
+
...u,
|
|
1991
|
+
endColumn: p.column
|
|
1992
|
+
});
|
|
1993
|
+
if (!Mn(f, o.filterText ?? o.label)) return;
|
|
1994
|
+
const g = {
|
|
1995
|
+
field: t.languages.CompletionItemKind.Field,
|
|
1996
|
+
operator: t.languages.CompletionItemKind.Operator,
|
|
1997
|
+
value: t.languages.CompletionItemKind.Value,
|
|
1998
|
+
parameter: t.languages.CompletionItemKind.Variable,
|
|
1999
|
+
function: t.languages.CompletionItemKind.Function
|
|
2000
|
+
};
|
|
2001
|
+
return {
|
|
2002
|
+
label: {
|
|
2003
|
+
label: o.label,
|
|
2004
|
+
detail: o.type ? `: ${o.type}` : void 0
|
|
2005
|
+
},
|
|
2006
|
+
kind: g[o.kind],
|
|
2007
|
+
detail: o.detail ?? o.type,
|
|
2008
|
+
documentation: o.description || o.condition ? {
|
|
2009
|
+
value: [o.description, o.condition].filter(Boolean).join(`
|
|
2010
|
+
|
|
2011
|
+
`),
|
|
2012
|
+
isTrusted: !1
|
|
2013
|
+
} : void 0,
|
|
2014
|
+
filterText: o.filterText ?? o.label,
|
|
2015
|
+
sortText: o.sortText ?? String(v).padStart(6, "0"),
|
|
2016
|
+
insertText: o.edit.text,
|
|
2017
|
+
insertTextRules: o.insertTextFormat === "snippet" ? t.languages.CompletionItemInsertTextRule.InsertAsSnippet : void 0,
|
|
2018
|
+
range: u
|
|
2019
|
+
};
|
|
2020
|
+
}
|
|
2021
|
+
const V = jn(() => {
|
|
2022
|
+
if (D()) return;
|
|
2023
|
+
const o = r(), v = e.getPosition();
|
|
2024
|
+
v && (o.check && N(o.check, v, d).then((p) => {
|
|
2025
|
+
p && (n(p.message), q(p));
|
|
2026
|
+
}), o.request && !R && e.hasTextFocus() && (T = i.getVersionId(), e.trigger("cel", "editor.action.triggerSuggest", {})));
|
|
2027
|
+
}, c), K = [t.languages.registerCompletionItemProvider(S, {
|
|
2028
|
+
async provideCompletionItems(o, v, p, s) {
|
|
2029
|
+
if (o !== i || D()) return {
|
|
2030
|
+
suggestions: []
|
|
2031
|
+
};
|
|
2032
|
+
if (p.triggerKind !== 0 || T !== i.getVersionId()) return {
|
|
2033
|
+
suggestions: []
|
|
2034
|
+
};
|
|
2035
|
+
T = void 0;
|
|
2036
|
+
const u = r(), f = await N(u.request, v, l, s);
|
|
2037
|
+
if (!f) return {
|
|
2038
|
+
suggestions: []
|
|
2039
|
+
};
|
|
2040
|
+
if (u.check || q(f), f.status !== "ready") return {
|
|
2041
|
+
suggestions: []
|
|
2042
|
+
};
|
|
2043
|
+
n(f.message);
|
|
2044
|
+
const g = [];
|
|
2045
|
+
for (const [_, C] of f.completions.slice(0, u.maxSuggestions ?? 100).entries())
|
|
2046
|
+
try {
|
|
2047
|
+
const a = P(C, _, v);
|
|
2048
|
+
a && g.push(a);
|
|
2049
|
+
} catch {
|
|
2050
|
+
n("The language service returned an invalid UTF-8 completion range.");
|
|
2051
|
+
}
|
|
2052
|
+
return {
|
|
2053
|
+
suggestions: g,
|
|
2054
|
+
incomplete: f.incomplete ?? !1
|
|
2055
|
+
};
|
|
2056
|
+
}
|
|
2057
|
+
}), t.languages.registerHoverProvider(S, {
|
|
2058
|
+
async provideHover(o, v, p) {
|
|
2059
|
+
if (o !== i) return;
|
|
2060
|
+
const s = await N(r().hover, v, y, p);
|
|
2061
|
+
if (!(s?.status !== "ready" || !s.hover))
|
|
2062
|
+
try {
|
|
2063
|
+
return {
|
|
2064
|
+
range: B(r().document.text, s.hover.range),
|
|
2065
|
+
contents: [{
|
|
2066
|
+
value: s.hover.contents,
|
|
2067
|
+
isTrusted: !1
|
|
2068
|
+
}]
|
|
2069
|
+
};
|
|
2070
|
+
} catch {
|
|
2071
|
+
n("The language service returned an invalid UTF-8 hover range.");
|
|
2072
|
+
return;
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
}), t.languages.registerSignatureHelpProvider(S, {
|
|
2076
|
+
signatureHelpTriggerCharacters: ["(", ","],
|
|
2077
|
+
signatureHelpRetriggerCharacters: [","],
|
|
2078
|
+
async provideSignatureHelp(o, v, p) {
|
|
2079
|
+
if (o !== i) return;
|
|
2080
|
+
const s = await N(r().signature, v, h, p);
|
|
2081
|
+
if (s?.status !== "ready" || !s.signature) return;
|
|
2082
|
+
const u = s.signature;
|
|
2083
|
+
return {
|
|
2084
|
+
value: {
|
|
2085
|
+
activeSignature: 0,
|
|
2086
|
+
activeParameter: Math.max(0, Math.min(u.activeParameter, u.parameters.length - 1)),
|
|
2087
|
+
signatures: [{
|
|
2088
|
+
label: u.label,
|
|
2089
|
+
documentation: u.documentation ? {
|
|
2090
|
+
value: u.documentation,
|
|
2091
|
+
isTrusted: !1
|
|
2092
|
+
} : void 0,
|
|
2093
|
+
parameters: u.parameters.map((f) => ({
|
|
2094
|
+
label: f.label,
|
|
2095
|
+
documentation: f.documentation ? {
|
|
2096
|
+
value: f.documentation,
|
|
2097
|
+
isTrusted: !1
|
|
2098
|
+
} : void 0
|
|
2099
|
+
}))
|
|
2100
|
+
}]
|
|
2101
|
+
},
|
|
2102
|
+
dispose() {
|
|
2103
|
+
}
|
|
2104
|
+
};
|
|
2105
|
+
}
|
|
2106
|
+
}), e.onDidChangeModelContent(() => {
|
|
2107
|
+
H = !0, R = !1, T = void 0, l.cancel(), d.cancel(), y.cancel(), h.cancel(), e.trigger("cel", "hideSuggestWidget", {}), t.editor.setModelMarkers(i, z, []), j || V.schedule(r().debounceMs ?? c);
|
|
2108
|
+
}), e.onDidChangeCursorPosition(() => {
|
|
2109
|
+
T = void 0, l.cancel(), h.cancel();
|
|
2110
|
+
}), e.onDidCompositionStart(() => {
|
|
2111
|
+
j = !0, T = void 0, V.cancel(), l.cancel(), d.cancel(), y.cancel(), h.cancel(), e.trigger("cel", "hideSuggestWidget", {}), I();
|
|
2112
|
+
}), e.onDidCompositionEnd(() => {
|
|
2113
|
+
j = !1, V.schedule(r().debounceMs ?? c);
|
|
2114
|
+
}), e.onKeyDown((o) => {
|
|
2115
|
+
o.keyCode === t.KeyCode.Escape && (T = void 0, R = !0, l.cancel());
|
|
2116
|
+
}), e.addAction({
|
|
2117
|
+
id: `cel.complete.${i.id}`,
|
|
2118
|
+
label: "CEL: Show contextual suggestions",
|
|
2119
|
+
precondition: "!suggestWidgetVisible || !suggestWidgetHasFocusedSuggestion",
|
|
2120
|
+
keybindings: [t.KeyMod.CtrlCmd | t.KeyCode.Space, t.KeyMod.WinCtrl | t.KeyCode.Space],
|
|
2121
|
+
run: () => {
|
|
2122
|
+
D() || (R = !1, V.immediate());
|
|
2123
|
+
}
|
|
2124
|
+
}), e.addAction({
|
|
2125
|
+
id: `cel.run.${i.id}`,
|
|
2126
|
+
label: "CEL: Run query",
|
|
2127
|
+
keybindings: [t.KeyMod.CtrlCmd | t.KeyCode.Enter],
|
|
2128
|
+
run: () => {
|
|
2129
|
+
D() || r().onSubmit?.();
|
|
2130
|
+
}
|
|
2131
|
+
})];
|
|
2132
|
+
function b() {
|
|
2133
|
+
if (k || i.isDisposed()) return;
|
|
2134
|
+
const o = r(), v = x && x.contextKey === o.contextKey && x.request === o.request && x.check === o.check && x.hover === o.hover && x.signature === o.signature && x.disabled === o.disabled && x.maxSuggestions === o.maxSuggestions && x.debounceMs === o.debounceMs && x.availability?.status === o.availability?.status && x.availability?.message === o.availability?.message;
|
|
2135
|
+
x && (x.contextKey !== o.contextKey || x.request !== o.request || x.check !== o.check || x.hover !== o.hover || x.signature !== o.signature) && x.onDocumentClose?.(i.uri.toString());
|
|
2136
|
+
const p = H && i.getValue() === o.document.text, s = x?.document.text === o.document.text && x.document.version === o.document.version;
|
|
2137
|
+
x = {
|
|
2138
|
+
...o,
|
|
2139
|
+
document: {
|
|
2140
|
+
...o.document
|
|
2141
|
+
},
|
|
2142
|
+
availability: o.availability ? {
|
|
2143
|
+
...o.availability
|
|
2144
|
+
} : void 0
|
|
2145
|
+
}, H = !1, !(v && (p || s)) && (T = void 0, R = !1, m++, l.cancel(), d.cancel(), y.cancel(), h.cancel(), V.cancel(), e.trigger("cel", "hideSuggestWidget", {}), I(), t.editor.setModelMarkers(i, z, []), e.updateOptions({
|
|
2146
|
+
quickSuggestions: !1,
|
|
2147
|
+
suggestOnTriggerCharacters: !1,
|
|
2148
|
+
wordBasedSuggestions: "off",
|
|
2149
|
+
parameterHints: {
|
|
2150
|
+
enabled: !0
|
|
2151
|
+
},
|
|
2152
|
+
suggest: {
|
|
2153
|
+
showWords: !1,
|
|
2154
|
+
showStatusBar: !0,
|
|
2155
|
+
preview: !1,
|
|
2156
|
+
selectionMode: "always"
|
|
2157
|
+
},
|
|
2158
|
+
acceptSuggestionOnEnter: "on",
|
|
2159
|
+
tabCompletion: "off",
|
|
2160
|
+
renderValidationDecorations: "on",
|
|
2161
|
+
fixedOverflowWidgets: !0,
|
|
2162
|
+
padding: {
|
|
2163
|
+
top: 8,
|
|
2164
|
+
bottom: 8
|
|
2165
|
+
}
|
|
2166
|
+
}), n(r().availability?.message), D() || V.schedule(o.debounceMs ?? c));
|
|
2167
|
+
}
|
|
2168
|
+
return b(), {
|
|
2169
|
+
refresh: b,
|
|
2170
|
+
dispose() {
|
|
2171
|
+
if (!k) {
|
|
2172
|
+
k = !0, T = void 0, V.cancel(), l.cancel(), d.cancel(), y.cancel(), h.cancel(), x?.onDocumentClose?.(i.uri.toString());
|
|
2173
|
+
for (const o of K) o.dispose();
|
|
2174
|
+
i.isDisposed() || I(), i.isDisposed() || t.editor.setModelMarkers(i, z, []);
|
|
2175
|
+
}
|
|
2176
|
+
}
|
|
2177
|
+
};
|
|
2178
|
+
}
|
|
2179
|
+
const An = "_Root_im36v_1", Ln = "_Label_im36v_7", Pn = "_Surface_im36v_12", On = "_Placeholder_im36v_24", Dn = "_Loading_im36v_31", $n = "_Message_im36v_35", In = "_Hint_im36v_40", ve = {
|
|
2180
|
+
Root: An,
|
|
2181
|
+
Label: Ln,
|
|
2182
|
+
Surface: Pn,
|
|
2183
|
+
Placeholder: On,
|
|
2184
|
+
Loading: Dn,
|
|
2185
|
+
Message: $n,
|
|
2186
|
+
Hint: In
|
|
2187
|
+
}, Wn = Rt(() => Promise.resolve().then(() => Er).then((e) => ({
|
|
2188
|
+
default: e.CodeEditor
|
|
2189
|
+
})));
|
|
2190
|
+
let Hn = 0;
|
|
2191
|
+
function Mo(e) {
|
|
2192
|
+
const {
|
|
2193
|
+
document: t,
|
|
2194
|
+
contextKey: r,
|
|
2195
|
+
request: n,
|
|
2196
|
+
check: c,
|
|
2197
|
+
hover: i,
|
|
2198
|
+
signature: l,
|
|
2199
|
+
disabled: d,
|
|
2200
|
+
availability: y,
|
|
2201
|
+
debounceMs: h = 250,
|
|
2202
|
+
maxSuggestions: k = 100,
|
|
2203
|
+
label: j = "CEL query",
|
|
2204
|
+
placeholder: m = "Enter a CEL expression…",
|
|
2205
|
+
minHeight: T = 52,
|
|
2206
|
+
maxHeight: R = 180,
|
|
2207
|
+
className: H
|
|
2208
|
+
} = e, x = G(e);
|
|
2209
|
+
x.current = e;
|
|
2210
|
+
const [z] = me(() => `cel-query-${++Hn}:///query.cel`), [S, D] = me(T), [I, B] = me(), [N, q] = me(null), P = G(null), V = d || !!(y && y.status !== "ready");
|
|
2211
|
+
U(() => {
|
|
2212
|
+
const b = N?.editor.getModel();
|
|
2213
|
+
if (!N || !b || b.isDisposed()) return;
|
|
2214
|
+
const {
|
|
2215
|
+
editor: o,
|
|
2216
|
+
monaco: v
|
|
2217
|
+
} = N, p = Nn(o, v, () => x.current, B);
|
|
2218
|
+
P.current = p;
|
|
2219
|
+
const s = () => D(Math.max(x.current.minHeight ?? 52, Math.min(x.current.maxHeight ?? 180, o.getContentHeight())));
|
|
2220
|
+
s();
|
|
2221
|
+
const u = o.onDidContentSizeChange(s);
|
|
2222
|
+
return () => {
|
|
2223
|
+
u.dispose(), p.dispose(), P.current === p && (P.current = null);
|
|
2224
|
+
};
|
|
2225
|
+
}, [N]), U(() => {
|
|
2226
|
+
P.current?.refresh();
|
|
2227
|
+
}, [t.text, t.version, r, n, c, i, l, d, y?.status, y?.message, k, h, N]), U(() => {
|
|
2228
|
+
const b = N?.editor;
|
|
2229
|
+
b?.getModel() && (b.updateOptions({
|
|
2230
|
+
ariaLabel: j
|
|
2231
|
+
}), D(Math.max(T, Math.min(R, b.getContentHeight()))));
|
|
2232
|
+
}, [j, T, R, N]);
|
|
2233
|
+
function K(b, o) {
|
|
2234
|
+
q({
|
|
2235
|
+
editor: b,
|
|
2236
|
+
monaco: o
|
|
2237
|
+
}), x.current.onMount?.(b, o);
|
|
2238
|
+
}
|
|
2239
|
+
return /* @__PURE__ */ E.jsxs("div", { className: `${ve.Root} ${H ?? ""}`, "data-testid": "cel-query-editor", "data-context-key": r, "data-availability": y?.status ?? "ready", children: [
|
|
2240
|
+
/* @__PURE__ */ E.jsx("div", { className: ve.Label, children: j }),
|
|
2241
|
+
/* @__PURE__ */ E.jsxs("div", { className: ve.Surface, style: {
|
|
2242
|
+
"--_cel-editor-min-height": `${T}px`
|
|
2243
|
+
}, children: [
|
|
2244
|
+
/* @__PURE__ */ E.jsx(kt, { fallback: /* @__PURE__ */ E.jsx("div", { role: "status", className: ve.Loading, children: "Loading CEL editor…" }), children: /* @__PURE__ */ E.jsx(Wn, { value: t.text, onChange: (b) => {
|
|
2245
|
+
const o = x.current;
|
|
2246
|
+
x.current = {
|
|
2247
|
+
...o,
|
|
2248
|
+
document: {
|
|
2249
|
+
text: b,
|
|
2250
|
+
version: o.document.version + 1
|
|
2251
|
+
}
|
|
2252
|
+
}, o.onChange(b);
|
|
2253
|
+
}, filename: z, language: we, readOnly: V, lineNumbers: !1, minimap: !1, wordWrap: !0, quickSuggestions: !1, diagnostics: !0, bordered: !1, height: S, onMount: K }) }),
|
|
2254
|
+
!t.text && !V ? /* @__PURE__ */ E.jsx("div", { className: ve.Placeholder, "aria-hidden": "true", children: m }) : null
|
|
2255
|
+
] }),
|
|
2256
|
+
I || y?.message ? /* @__PURE__ */ E.jsx("div", { role: y?.status === "denied" || y?.status === "error" ? "alert" : "status", className: ve.Message, children: I ?? y?.message }) : null,
|
|
2257
|
+
/* @__PURE__ */ E.jsx("div", { className: ve.Hint, children: "Ctrl+Space suggestions · ⌘/Ctrl+Enter run · Enter accepts a suggestion" })
|
|
2258
|
+
] });
|
|
2259
|
+
}
|
|
2260
|
+
var $t;
|
|
1774
2261
|
(() => {
|
|
1775
|
-
var e = { 975: (
|
|
1776
|
-
function s
|
|
1777
|
-
if (typeof
|
|
2262
|
+
var e = { 975: (b) => {
|
|
2263
|
+
function o(s) {
|
|
2264
|
+
if (typeof s != "string") throw new TypeError("Path must be a string. Received " + JSON.stringify(s));
|
|
1778
2265
|
}
|
|
1779
|
-
function
|
|
1780
|
-
for (var
|
|
1781
|
-
if (w <
|
|
2266
|
+
function v(s, u) {
|
|
2267
|
+
for (var f, g = "", _ = 0, C = -1, a = 0, w = 0; w <= s.length; ++w) {
|
|
2268
|
+
if (w < s.length) f = s.charCodeAt(w);
|
|
1782
2269
|
else {
|
|
1783
|
-
if (
|
|
1784
|
-
|
|
2270
|
+
if (f === 47) break;
|
|
2271
|
+
f = 47;
|
|
1785
2272
|
}
|
|
1786
|
-
if (
|
|
1787
|
-
if (!(
|
|
1788
|
-
if (
|
|
1789
|
-
if (
|
|
1790
|
-
var A =
|
|
1791
|
-
if (A !==
|
|
1792
|
-
A === -1 ? (
|
|
2273
|
+
if (f === 47) {
|
|
2274
|
+
if (!(C === w - 1 || a === 1)) if (C !== w - 1 && a === 2) {
|
|
2275
|
+
if (g.length < 2 || _ !== 2 || g.charCodeAt(g.length - 1) !== 46 || g.charCodeAt(g.length - 2) !== 46) {
|
|
2276
|
+
if (g.length > 2) {
|
|
2277
|
+
var A = g.lastIndexOf("/");
|
|
2278
|
+
if (A !== g.length - 1) {
|
|
2279
|
+
A === -1 ? (g = "", _ = 0) : _ = (g = g.slice(0, A)).length - 1 - g.lastIndexOf("/"), C = w, a = 0;
|
|
1793
2280
|
continue;
|
|
1794
2281
|
}
|
|
1795
|
-
} else if (
|
|
1796
|
-
|
|
2282
|
+
} else if (g.length === 2 || g.length === 1) {
|
|
2283
|
+
g = "", _ = 0, C = w, a = 0;
|
|
1797
2284
|
continue;
|
|
1798
2285
|
}
|
|
1799
2286
|
}
|
|
1800
|
-
|
|
1801
|
-
} else
|
|
1802
|
-
|
|
1803
|
-
} else
|
|
2287
|
+
u && (g.length > 0 ? g += "/.." : g = "..", _ = 2);
|
|
2288
|
+
} else g.length > 0 ? g += "/" + s.slice(C + 1, w) : g = s.slice(C + 1, w), _ = w - C - 1;
|
|
2289
|
+
C = w, a = 0;
|
|
2290
|
+
} else f === 46 && a !== -1 ? ++a : a = -1;
|
|
1804
2291
|
}
|
|
1805
|
-
return
|
|
2292
|
+
return g;
|
|
1806
2293
|
}
|
|
1807
|
-
var
|
|
1808
|
-
for (var
|
|
1809
|
-
var
|
|
1810
|
-
|
|
2294
|
+
var p = { resolve: function() {
|
|
2295
|
+
for (var s, u = "", f = !1, g = arguments.length - 1; g >= -1 && !f; g--) {
|
|
2296
|
+
var _;
|
|
2297
|
+
g >= 0 ? _ = arguments[g] : (s === void 0 && (s = process.cwd()), _ = s), o(_), _.length !== 0 && (u = _ + "/" + u, f = _.charCodeAt(0) === 47);
|
|
1811
2298
|
}
|
|
1812
|
-
return
|
|
1813
|
-
}, normalize: function(
|
|
1814
|
-
if (s
|
|
1815
|
-
var
|
|
1816
|
-
return (
|
|
1817
|
-
}, isAbsolute: function(
|
|
1818
|
-
return s
|
|
2299
|
+
return u = v(u, !f), f ? u.length > 0 ? "/" + u : "/" : u.length > 0 ? u : ".";
|
|
2300
|
+
}, normalize: function(s) {
|
|
2301
|
+
if (o(s), s.length === 0) return ".";
|
|
2302
|
+
var u = s.charCodeAt(0) === 47, f = s.charCodeAt(s.length - 1) === 47;
|
|
2303
|
+
return (s = v(s, !u)).length !== 0 || u || (s = "."), s.length > 0 && f && (s += "/"), u ? "/" + s : s;
|
|
2304
|
+
}, isAbsolute: function(s) {
|
|
2305
|
+
return o(s), s.length > 0 && s.charCodeAt(0) === 47;
|
|
1819
2306
|
}, join: function() {
|
|
1820
2307
|
if (arguments.length === 0) return ".";
|
|
1821
|
-
for (var
|
|
1822
|
-
var
|
|
1823
|
-
|
|
2308
|
+
for (var s, u = 0; u < arguments.length; ++u) {
|
|
2309
|
+
var f = arguments[u];
|
|
2310
|
+
o(f), f.length > 0 && (s === void 0 ? s = f : s += "/" + f);
|
|
1824
2311
|
}
|
|
1825
|
-
return
|
|
1826
|
-
}, relative: function(
|
|
1827
|
-
if (s
|
|
1828
|
-
for (var
|
|
1829
|
-
for (var
|
|
1830
|
-
for (var
|
|
1831
|
-
if (
|
|
1832
|
-
if (
|
|
1833
|
-
if (
|
|
1834
|
-
if (
|
|
1835
|
-
} else
|
|
2312
|
+
return s === void 0 ? "." : p.normalize(s);
|
|
2313
|
+
}, relative: function(s, u) {
|
|
2314
|
+
if (o(s), o(u), s === u || (s = p.resolve(s)) === (u = p.resolve(u))) return "";
|
|
2315
|
+
for (var f = 1; f < s.length && s.charCodeAt(f) === 47; ++f) ;
|
|
2316
|
+
for (var g = s.length, _ = g - f, C = 1; C < u.length && u.charCodeAt(C) === 47; ++C) ;
|
|
2317
|
+
for (var a = u.length - C, w = _ < a ? _ : a, A = -1, L = 0; L <= w; ++L) {
|
|
2318
|
+
if (L === w) {
|
|
2319
|
+
if (a > w) {
|
|
2320
|
+
if (u.charCodeAt(C + L) === 47) return u.slice(C + L + 1);
|
|
2321
|
+
if (L === 0) return u.slice(C + L);
|
|
2322
|
+
} else _ > w && (s.charCodeAt(f + L) === 47 ? A = L : L === 0 && (A = 0));
|
|
1836
2323
|
break;
|
|
1837
2324
|
}
|
|
1838
|
-
var
|
|
1839
|
-
if (
|
|
1840
|
-
|
|
2325
|
+
var F = s.charCodeAt(f + L);
|
|
2326
|
+
if (F !== u.charCodeAt(C + L)) break;
|
|
2327
|
+
F === 47 && (A = L);
|
|
1841
2328
|
}
|
|
1842
2329
|
var O = "";
|
|
1843
|
-
for (
|
|
1844
|
-
return O.length > 0 ? O +
|
|
1845
|
-
}, _makeLong: function(
|
|
1846
|
-
return
|
|
1847
|
-
}, dirname: function(
|
|
1848
|
-
if (s
|
|
1849
|
-
for (var
|
|
1850
|
-
if (!
|
|
1851
|
-
|
|
2330
|
+
for (L = f + A + 1; L <= g; ++L) L !== g && s.charCodeAt(L) !== 47 || (O.length === 0 ? O += ".." : O += "/..");
|
|
2331
|
+
return O.length > 0 ? O + u.slice(C + A) : (C += A, u.charCodeAt(C) === 47 && ++C, u.slice(C));
|
|
2332
|
+
}, _makeLong: function(s) {
|
|
2333
|
+
return s;
|
|
2334
|
+
}, dirname: function(s) {
|
|
2335
|
+
if (o(s), s.length === 0) return ".";
|
|
2336
|
+
for (var u = s.charCodeAt(0), f = u === 47, g = -1, _ = !0, C = s.length - 1; C >= 1; --C) if ((u = s.charCodeAt(C)) === 47) {
|
|
2337
|
+
if (!_) {
|
|
2338
|
+
g = C;
|
|
1852
2339
|
break;
|
|
1853
2340
|
}
|
|
1854
|
-
} else
|
|
1855
|
-
return
|
|
1856
|
-
}, basename: function(
|
|
1857
|
-
if (
|
|
1858
|
-
s
|
|
1859
|
-
var
|
|
1860
|
-
if (
|
|
1861
|
-
if (
|
|
1862
|
-
var
|
|
1863
|
-
for (
|
|
1864
|
-
var A =
|
|
2341
|
+
} else _ = !1;
|
|
2342
|
+
return g === -1 ? f ? "/" : "." : f && g === 1 ? "//" : s.slice(0, g);
|
|
2343
|
+
}, basename: function(s, u) {
|
|
2344
|
+
if (u !== void 0 && typeof u != "string") throw new TypeError('"ext" argument must be a string');
|
|
2345
|
+
o(s);
|
|
2346
|
+
var f, g = 0, _ = -1, C = !0;
|
|
2347
|
+
if (u !== void 0 && u.length > 0 && u.length <= s.length) {
|
|
2348
|
+
if (u.length === s.length && u === s) return "";
|
|
2349
|
+
var a = u.length - 1, w = -1;
|
|
2350
|
+
for (f = s.length - 1; f >= 0; --f) {
|
|
2351
|
+
var A = s.charCodeAt(f);
|
|
1865
2352
|
if (A === 47) {
|
|
1866
|
-
if (!
|
|
1867
|
-
|
|
2353
|
+
if (!C) {
|
|
2354
|
+
g = f + 1;
|
|
1868
2355
|
break;
|
|
1869
2356
|
}
|
|
1870
|
-
} else w === -1 && (
|
|
2357
|
+
} else w === -1 && (C = !1, w = f + 1), a >= 0 && (A === u.charCodeAt(a) ? --a == -1 && (_ = f) : (a = -1, _ = w));
|
|
1871
2358
|
}
|
|
1872
|
-
return
|
|
2359
|
+
return g === _ ? _ = w : _ === -1 && (_ = s.length), s.slice(g, _);
|
|
1873
2360
|
}
|
|
1874
|
-
for (
|
|
1875
|
-
if (!
|
|
1876
|
-
|
|
2361
|
+
for (f = s.length - 1; f >= 0; --f) if (s.charCodeAt(f) === 47) {
|
|
2362
|
+
if (!C) {
|
|
2363
|
+
g = f + 1;
|
|
1877
2364
|
break;
|
|
1878
2365
|
}
|
|
1879
|
-
} else
|
|
1880
|
-
return
|
|
1881
|
-
}, extname: function(
|
|
1882
|
-
s
|
|
1883
|
-
for (var
|
|
1884
|
-
var w =
|
|
1885
|
-
if (w !== 47)
|
|
1886
|
-
else if (!
|
|
1887
|
-
|
|
2366
|
+
} else _ === -1 && (C = !1, _ = f + 1);
|
|
2367
|
+
return _ === -1 ? "" : s.slice(g, _);
|
|
2368
|
+
}, extname: function(s) {
|
|
2369
|
+
o(s);
|
|
2370
|
+
for (var u = -1, f = 0, g = -1, _ = !0, C = 0, a = s.length - 1; a >= 0; --a) {
|
|
2371
|
+
var w = s.charCodeAt(a);
|
|
2372
|
+
if (w !== 47) g === -1 && (_ = !1, g = a + 1), w === 46 ? u === -1 ? u = a : C !== 1 && (C = 1) : u !== -1 && (C = -1);
|
|
2373
|
+
else if (!_) {
|
|
2374
|
+
f = a + 1;
|
|
1888
2375
|
break;
|
|
1889
2376
|
}
|
|
1890
2377
|
}
|
|
1891
|
-
return
|
|
1892
|
-
}, format: function(
|
|
1893
|
-
if (
|
|
1894
|
-
return (function(
|
|
1895
|
-
var
|
|
1896
|
-
return
|
|
1897
|
-
})(0,
|
|
1898
|
-
}, parse: function(
|
|
1899
|
-
s
|
|
1900
|
-
var
|
|
1901
|
-
if (
|
|
1902
|
-
var
|
|
1903
|
-
|
|
1904
|
-
for (var
|
|
2378
|
+
return u === -1 || g === -1 || C === 0 || C === 1 && u === g - 1 && u === f + 1 ? "" : s.slice(u, g);
|
|
2379
|
+
}, format: function(s) {
|
|
2380
|
+
if (s === null || typeof s != "object") throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof s);
|
|
2381
|
+
return (function(u, f) {
|
|
2382
|
+
var g = f.dir || f.root, _ = f.base || (f.name || "") + (f.ext || "");
|
|
2383
|
+
return g ? g === f.root ? g + _ : g + "/" + _ : _;
|
|
2384
|
+
})(0, s);
|
|
2385
|
+
}, parse: function(s) {
|
|
2386
|
+
o(s);
|
|
2387
|
+
var u = { root: "", dir: "", base: "", ext: "", name: "" };
|
|
2388
|
+
if (s.length === 0) return u;
|
|
2389
|
+
var f, g = s.charCodeAt(0), _ = g === 47;
|
|
2390
|
+
_ ? (u.root = "/", f = 1) : f = 0;
|
|
2391
|
+
for (var C = -1, a = 0, w = -1, A = !0, L = s.length - 1, F = 0; L >= f; --L) if ((g = s.charCodeAt(L)) !== 47) w === -1 && (A = !1, w = L + 1), g === 46 ? C === -1 ? C = L : F !== 1 && (F = 1) : C !== -1 && (F = -1);
|
|
1905
2392
|
else if (!A) {
|
|
1906
|
-
|
|
2393
|
+
a = L + 1;
|
|
1907
2394
|
break;
|
|
1908
2395
|
}
|
|
1909
|
-
return
|
|
2396
|
+
return C === -1 || w === -1 || F === 0 || F === 1 && C === w - 1 && C === a + 1 ? w !== -1 && (u.base = u.name = a === 0 && _ ? s.slice(1, w) : s.slice(a, w)) : (a === 0 && _ ? (u.name = s.slice(1, C), u.base = s.slice(1, w)) : (u.name = s.slice(a, C), u.base = s.slice(a, w)), u.ext = s.slice(C, w)), a > 0 ? u.dir = s.slice(0, a - 1) : _ && (u.dir = "/"), u;
|
|
1910
2397
|
}, sep: "/", delimiter: ":", win32: null, posix: null };
|
|
1911
|
-
|
|
2398
|
+
p.posix = p, b.exports = p;
|
|
1912
2399
|
} }, t = {};
|
|
1913
|
-
function r(
|
|
1914
|
-
var
|
|
1915
|
-
if (
|
|
1916
|
-
var
|
|
1917
|
-
return e[
|
|
2400
|
+
function r(b) {
|
|
2401
|
+
var o = t[b];
|
|
2402
|
+
if (o !== void 0) return o.exports;
|
|
2403
|
+
var v = t[b] = { exports: {} };
|
|
2404
|
+
return e[b](v, v.exports, r), v.exports;
|
|
1918
2405
|
}
|
|
1919
|
-
r.d = (
|
|
1920
|
-
for (var
|
|
1921
|
-
}, r.o = (
|
|
1922
|
-
typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(
|
|
2406
|
+
r.d = (b, o) => {
|
|
2407
|
+
for (var v in o) r.o(o, v) && !r.o(b, v) && Object.defineProperty(b, v, { enumerable: !0, get: o[v] });
|
|
2408
|
+
}, r.o = (b, o) => Object.prototype.hasOwnProperty.call(b, o), r.r = (b) => {
|
|
2409
|
+
typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(b, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(b, "__esModule", { value: !0 });
|
|
1923
2410
|
};
|
|
1924
2411
|
var n = {};
|
|
1925
2412
|
let c;
|
|
1926
|
-
r.r(n), r.d(n, { URI: () => m, Utils: () =>
|
|
1927
|
-
const
|
|
1928
|
-
function
|
|
1929
|
-
if (!
|
|
1930
|
-
if (
|
|
1931
|
-
if (
|
|
1932
|
-
if (
|
|
1933
|
-
if (!l.test(
|
|
1934
|
-
} else if (
|
|
2413
|
+
r.r(n), r.d(n, { URI: () => m, Utils: () => K }), typeof process == "object" ? c = process.platform === "win32" : typeof navigator == "object" && (c = navigator.userAgent.indexOf("Windows") >= 0);
|
|
2414
|
+
const i = /^\w[\w\d+.-]*$/, l = /^\//, d = /^\/\//;
|
|
2415
|
+
function y(b, o) {
|
|
2416
|
+
if (!b.scheme && o) throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${b.authority}", path: "${b.path}", query: "${b.query}", fragment: "${b.fragment}"}`);
|
|
2417
|
+
if (b.scheme && !i.test(b.scheme)) throw new Error("[UriError]: Scheme contains illegal characters.");
|
|
2418
|
+
if (b.path) {
|
|
2419
|
+
if (b.authority) {
|
|
2420
|
+
if (!l.test(b.path)) throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character');
|
|
2421
|
+
} else if (d.test(b.path)) throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")');
|
|
1935
2422
|
}
|
|
1936
2423
|
}
|
|
1937
|
-
const
|
|
2424
|
+
const h = "", k = "/", j = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
|
|
1938
2425
|
class m {
|
|
1939
|
-
static isUri(
|
|
1940
|
-
return
|
|
2426
|
+
static isUri(o) {
|
|
2427
|
+
return o instanceof m || !!o && typeof o.authority == "string" && typeof o.fragment == "string" && typeof o.path == "string" && typeof o.query == "string" && typeof o.scheme == "string" && typeof o.fsPath == "string" && typeof o.with == "function" && typeof o.toString == "function";
|
|
1941
2428
|
}
|
|
1942
2429
|
scheme;
|
|
1943
2430
|
authority;
|
|
1944
2431
|
path;
|
|
1945
2432
|
query;
|
|
1946
2433
|
fragment;
|
|
1947
|
-
constructor(
|
|
1948
|
-
typeof
|
|
1949
|
-
return
|
|
1950
|
-
})(
|
|
1951
|
-
switch (
|
|
2434
|
+
constructor(o, v, p, s, u, f = !1) {
|
|
2435
|
+
typeof o == "object" ? (this.scheme = o.scheme || h, this.authority = o.authority || h, this.path = o.path || h, this.query = o.query || h, this.fragment = o.fragment || h) : (this.scheme = /* @__PURE__ */ (function(g, _) {
|
|
2436
|
+
return g || _ ? g : "file";
|
|
2437
|
+
})(o, f), this.authority = v || h, this.path = (function(g, _) {
|
|
2438
|
+
switch (g) {
|
|
1952
2439
|
case "https":
|
|
1953
2440
|
case "http":
|
|
1954
2441
|
case "file":
|
|
1955
|
-
|
|
2442
|
+
_ ? _[0] !== k && (_ = k + _) : _ = k;
|
|
1956
2443
|
}
|
|
1957
|
-
return
|
|
1958
|
-
})(this.scheme,
|
|
2444
|
+
return _;
|
|
2445
|
+
})(this.scheme, p || h), this.query = s || h, this.fragment = u || h, y(this, f));
|
|
1959
2446
|
}
|
|
1960
2447
|
get fsPath() {
|
|
1961
|
-
return
|
|
1962
|
-
}
|
|
1963
|
-
with(
|
|
1964
|
-
if (!
|
|
1965
|
-
let { scheme:
|
|
1966
|
-
return
|
|
1967
|
-
}
|
|
1968
|
-
static parse(
|
|
1969
|
-
const
|
|
1970
|
-
return
|
|
1971
|
-
}
|
|
1972
|
-
static file(
|
|
1973
|
-
let
|
|
1974
|
-
if (c && (
|
|
1975
|
-
const
|
|
1976
|
-
|
|
2448
|
+
return S(this);
|
|
2449
|
+
}
|
|
2450
|
+
with(o) {
|
|
2451
|
+
if (!o) return this;
|
|
2452
|
+
let { scheme: v, authority: p, path: s, query: u, fragment: f } = o;
|
|
2453
|
+
return v === void 0 ? v = this.scheme : v === null && (v = h), p === void 0 ? p = this.authority : p === null && (p = h), s === void 0 ? s = this.path : s === null && (s = h), u === void 0 ? u = this.query : u === null && (u = h), f === void 0 ? f = this.fragment : f === null && (f = h), v === this.scheme && p === this.authority && s === this.path && u === this.query && f === this.fragment ? this : new R(v, p, s, u, f);
|
|
2454
|
+
}
|
|
2455
|
+
static parse(o, v = !1) {
|
|
2456
|
+
const p = j.exec(o);
|
|
2457
|
+
return p ? new R(p[2] || h, N(p[4] || h), N(p[5] || h), N(p[7] || h), N(p[9] || h), v) : new R(h, h, h, h, h);
|
|
2458
|
+
}
|
|
2459
|
+
static file(o) {
|
|
2460
|
+
let v = h;
|
|
2461
|
+
if (c && (o = o.replace(/\\/g, k)), o[0] === k && o[1] === k) {
|
|
2462
|
+
const p = o.indexOf(k, 2);
|
|
2463
|
+
p === -1 ? (v = o.substring(2), o = k) : (v = o.substring(2, p), o = o.substring(p) || k);
|
|
1977
2464
|
}
|
|
1978
|
-
return new R("file",
|
|
2465
|
+
return new R("file", v, o, h, h);
|
|
1979
2466
|
}
|
|
1980
|
-
static from(
|
|
1981
|
-
const
|
|
1982
|
-
return
|
|
2467
|
+
static from(o) {
|
|
2468
|
+
const v = new R(o.scheme, o.authority, o.path, o.query, o.fragment);
|
|
2469
|
+
return y(v, !0), v;
|
|
1983
2470
|
}
|
|
1984
|
-
toString(
|
|
1985
|
-
return
|
|
2471
|
+
toString(o = !1) {
|
|
2472
|
+
return D(this, o);
|
|
1986
2473
|
}
|
|
1987
2474
|
toJSON() {
|
|
1988
2475
|
return this;
|
|
1989
2476
|
}
|
|
1990
|
-
static revive(
|
|
1991
|
-
if (
|
|
1992
|
-
if (
|
|
2477
|
+
static revive(o) {
|
|
2478
|
+
if (o) {
|
|
2479
|
+
if (o instanceof m) return o;
|
|
1993
2480
|
{
|
|
1994
|
-
const
|
|
1995
|
-
return
|
|
2481
|
+
const v = new R(o);
|
|
2482
|
+
return v._formatted = o.external, v._fsPath = o._sep === T ? o.fsPath : null, v;
|
|
1996
2483
|
}
|
|
1997
2484
|
}
|
|
1998
|
-
return
|
|
2485
|
+
return o;
|
|
1999
2486
|
}
|
|
2000
2487
|
}
|
|
2001
2488
|
const T = c ? 1 : void 0;
|
|
@@ -2003,112 +2490,112 @@ var jt;
|
|
|
2003
2490
|
_formatted = null;
|
|
2004
2491
|
_fsPath = null;
|
|
2005
2492
|
get fsPath() {
|
|
2006
|
-
return this._fsPath || (this._fsPath =
|
|
2493
|
+
return this._fsPath || (this._fsPath = S(this)), this._fsPath;
|
|
2007
2494
|
}
|
|
2008
|
-
toString(
|
|
2009
|
-
return
|
|
2495
|
+
toString(o = !1) {
|
|
2496
|
+
return o ? D(this, !0) : (this._formatted || (this._formatted = D(this, !1)), this._formatted);
|
|
2010
2497
|
}
|
|
2011
2498
|
toJSON() {
|
|
2012
|
-
const
|
|
2013
|
-
return this._fsPath && (
|
|
2499
|
+
const o = { $mid: 1 };
|
|
2500
|
+
return this._fsPath && (o.fsPath = this._fsPath, o._sep = T), this._formatted && (o.external = this._formatted), this.path && (o.path = this.path), this.scheme && (o.scheme = this.scheme), this.authority && (o.authority = this.authority), this.query && (o.query = this.query), this.fragment && (o.fragment = this.fragment), o;
|
|
2014
2501
|
}
|
|
2015
2502
|
}
|
|
2016
2503
|
const H = { 58: "%3A", 47: "%2F", 63: "%3F", 35: "%23", 91: "%5B", 93: "%5D", 64: "%40", 33: "%21", 36: "%24", 38: "%26", 39: "%27", 40: "%28", 41: "%29", 42: "%2A", 43: "%2B", 44: "%2C", 59: "%3B", 61: "%3D", 32: "%20" };
|
|
2017
|
-
function
|
|
2018
|
-
let
|
|
2019
|
-
for (let
|
|
2020
|
-
const
|
|
2021
|
-
if (
|
|
2504
|
+
function x(b, o, v) {
|
|
2505
|
+
let p, s = -1;
|
|
2506
|
+
for (let u = 0; u < b.length; u++) {
|
|
2507
|
+
const f = b.charCodeAt(u);
|
|
2508
|
+
if (f >= 97 && f <= 122 || f >= 65 && f <= 90 || f >= 48 && f <= 57 || f === 45 || f === 46 || f === 95 || f === 126 || o && f === 47 || v && f === 91 || v && f === 93 || v && f === 58) s !== -1 && (p += encodeURIComponent(b.substring(s, u)), s = -1), p !== void 0 && (p += b.charAt(u));
|
|
2022
2509
|
else {
|
|
2023
|
-
|
|
2024
|
-
const
|
|
2025
|
-
|
|
2510
|
+
p === void 0 && (p = b.substr(0, u));
|
|
2511
|
+
const g = H[f];
|
|
2512
|
+
g !== void 0 ? (s !== -1 && (p += encodeURIComponent(b.substring(s, u)), s = -1), p += g) : s === -1 && (s = u);
|
|
2026
2513
|
}
|
|
2027
2514
|
}
|
|
2028
|
-
return
|
|
2515
|
+
return s !== -1 && (p += encodeURIComponent(b.substring(s))), p !== void 0 ? p : b;
|
|
2029
2516
|
}
|
|
2030
|
-
function
|
|
2031
|
-
let
|
|
2032
|
-
for (let
|
|
2033
|
-
const
|
|
2034
|
-
|
|
2517
|
+
function z(b) {
|
|
2518
|
+
let o;
|
|
2519
|
+
for (let v = 0; v < b.length; v++) {
|
|
2520
|
+
const p = b.charCodeAt(v);
|
|
2521
|
+
p === 35 || p === 63 ? (o === void 0 && (o = b.substr(0, v)), o += H[p]) : o !== void 0 && (o += b[v]);
|
|
2035
2522
|
}
|
|
2036
|
-
return
|
|
2523
|
+
return o !== void 0 ? o : b;
|
|
2037
2524
|
}
|
|
2038
|
-
function
|
|
2039
|
-
let
|
|
2040
|
-
return
|
|
2525
|
+
function S(b, o) {
|
|
2526
|
+
let v;
|
|
2527
|
+
return v = b.authority && b.path.length > 1 && b.scheme === "file" ? `//${b.authority}${b.path}` : b.path.charCodeAt(0) === 47 && (b.path.charCodeAt(1) >= 65 && b.path.charCodeAt(1) <= 90 || b.path.charCodeAt(1) >= 97 && b.path.charCodeAt(1) <= 122) && b.path.charCodeAt(2) === 58 ? b.path[1].toLowerCase() + b.path.substr(2) : b.path, c && (v = v.replace(/\//g, "\\")), v;
|
|
2041
2528
|
}
|
|
2042
|
-
function
|
|
2043
|
-
const
|
|
2044
|
-
let
|
|
2045
|
-
if (
|
|
2046
|
-
let
|
|
2047
|
-
if (
|
|
2048
|
-
const
|
|
2049
|
-
|
|
2529
|
+
function D(b, o) {
|
|
2530
|
+
const v = o ? z : x;
|
|
2531
|
+
let p = "", { scheme: s, authority: u, path: f, query: g, fragment: _ } = b;
|
|
2532
|
+
if (s && (p += s, p += ":"), (u || s === "file") && (p += k, p += k), u) {
|
|
2533
|
+
let C = u.indexOf("@");
|
|
2534
|
+
if (C !== -1) {
|
|
2535
|
+
const a = u.substr(0, C);
|
|
2536
|
+
u = u.substr(C + 1), C = a.lastIndexOf(":"), C === -1 ? p += v(a, !1, !1) : (p += v(a.substr(0, C), !1, !1), p += ":", p += v(a.substr(C + 1), !1, !0)), p += "@";
|
|
2050
2537
|
}
|
|
2051
|
-
|
|
2052
|
-
}
|
|
2053
|
-
if (
|
|
2054
|
-
if (
|
|
2055
|
-
const
|
|
2056
|
-
|
|
2057
|
-
} else if (
|
|
2058
|
-
const
|
|
2059
|
-
|
|
2538
|
+
u = u.toLowerCase(), C = u.lastIndexOf(":"), C === -1 ? p += v(u, !1, !0) : (p += v(u.substr(0, C), !1, !0), p += u.substr(C));
|
|
2539
|
+
}
|
|
2540
|
+
if (f) {
|
|
2541
|
+
if (f.length >= 3 && f.charCodeAt(0) === 47 && f.charCodeAt(2) === 58) {
|
|
2542
|
+
const C = f.charCodeAt(1);
|
|
2543
|
+
C >= 65 && C <= 90 && (f = `/${String.fromCharCode(C + 32)}:${f.substr(3)}`);
|
|
2544
|
+
} else if (f.length >= 2 && f.charCodeAt(1) === 58) {
|
|
2545
|
+
const C = f.charCodeAt(0);
|
|
2546
|
+
C >= 65 && C <= 90 && (f = `${String.fromCharCode(C + 32)}:${f.substr(2)}`);
|
|
2060
2547
|
}
|
|
2061
|
-
|
|
2548
|
+
p += v(f, !0, !1);
|
|
2062
2549
|
}
|
|
2063
|
-
return
|
|
2550
|
+
return g && (p += "?", p += v(g, !1, !1)), _ && (p += "#", p += o ? _ : x(_, !1, !1)), p;
|
|
2064
2551
|
}
|
|
2065
|
-
function
|
|
2552
|
+
function I(b) {
|
|
2066
2553
|
try {
|
|
2067
|
-
return decodeURIComponent(
|
|
2554
|
+
return decodeURIComponent(b);
|
|
2068
2555
|
} catch {
|
|
2069
|
-
return
|
|
2556
|
+
return b.length > 3 ? b.substr(0, 3) + I(b.substr(3)) : b;
|
|
2070
2557
|
}
|
|
2071
2558
|
}
|
|
2072
|
-
const
|
|
2073
|
-
function
|
|
2074
|
-
return
|
|
2559
|
+
const B = /(%[0-9A-Za-z][0-9A-Za-z])+/g;
|
|
2560
|
+
function N(b) {
|
|
2561
|
+
return b.match(B) ? b.replace(B, ((o) => I(o))) : b;
|
|
2075
2562
|
}
|
|
2076
|
-
var
|
|
2077
|
-
const
|
|
2078
|
-
var
|
|
2079
|
-
(function(
|
|
2080
|
-
|
|
2081
|
-
return
|
|
2082
|
-
},
|
|
2083
|
-
let
|
|
2084
|
-
|
|
2085
|
-
let
|
|
2086
|
-
return
|
|
2087
|
-
},
|
|
2088
|
-
if (
|
|
2089
|
-
let
|
|
2090
|
-
return
|
|
2091
|
-
},
|
|
2092
|
-
return
|
|
2093
|
-
},
|
|
2094
|
-
return
|
|
2563
|
+
var q = r(975);
|
|
2564
|
+
const P = q.posix || q, V = "/";
|
|
2565
|
+
var K;
|
|
2566
|
+
(function(b) {
|
|
2567
|
+
b.joinPath = function(o, ...v) {
|
|
2568
|
+
return o.with({ path: P.join(o.path, ...v) });
|
|
2569
|
+
}, b.resolvePath = function(o, ...v) {
|
|
2570
|
+
let p = o.path, s = !1;
|
|
2571
|
+
p[0] !== V && (p = V + p, s = !0);
|
|
2572
|
+
let u = P.resolve(p, ...v);
|
|
2573
|
+
return s && u[0] === V && !o.authority && (u = u.substring(1)), o.with({ path: u });
|
|
2574
|
+
}, b.dirname = function(o) {
|
|
2575
|
+
if (o.path.length === 0 || o.path === V) return o;
|
|
2576
|
+
let v = P.dirname(o.path);
|
|
2577
|
+
return v.length === 1 && v.charCodeAt(0) === 46 && (v = ""), o.with({ path: v });
|
|
2578
|
+
}, b.basename = function(o) {
|
|
2579
|
+
return P.basename(o.path);
|
|
2580
|
+
}, b.extname = function(o) {
|
|
2581
|
+
return P.extname(o.path);
|
|
2095
2582
|
};
|
|
2096
|
-
})(
|
|
2583
|
+
})(K || (K = {})), $t = n;
|
|
2097
2584
|
})();
|
|
2098
|
-
const { URI:
|
|
2099
|
-
function
|
|
2585
|
+
const { URI: ge, Utils: jo } = $t;
|
|
2586
|
+
function Bn(e) {
|
|
2100
2587
|
return e === 4 ? 1 : e === 3 ? 2 : e === 2 ? 4 : 8;
|
|
2101
2588
|
}
|
|
2102
|
-
function
|
|
2589
|
+
function qn(e) {
|
|
2103
2590
|
return e;
|
|
2104
2591
|
}
|
|
2105
|
-
function
|
|
2592
|
+
function zn(e) {
|
|
2106
2593
|
return {
|
|
2107
2594
|
start: { line: e.startLineNumber - 1, character: e.startColumn - 1 },
|
|
2108
2595
|
end: { line: e.endLineNumber - 1, character: e.endColumn - 1 }
|
|
2109
2596
|
};
|
|
2110
2597
|
}
|
|
2111
|
-
function
|
|
2598
|
+
function ee(e) {
|
|
2112
2599
|
return {
|
|
2113
2600
|
startLineNumber: e.start.line + 1,
|
|
2114
2601
|
startColumn: e.start.character + 1,
|
|
@@ -2116,192 +2603,192 @@ function K(e) {
|
|
|
2116
2603
|
endColumn: e.end.character + 1
|
|
2117
2604
|
};
|
|
2118
2605
|
}
|
|
2119
|
-
function
|
|
2606
|
+
function Vn(e) {
|
|
2120
2607
|
return {
|
|
2121
|
-
...
|
|
2608
|
+
...ee(e.location.range),
|
|
2122
2609
|
message: e.message,
|
|
2123
|
-
resource:
|
|
2610
|
+
resource: ge.parse(e.location.uri)
|
|
2124
2611
|
};
|
|
2125
2612
|
}
|
|
2126
|
-
function
|
|
2613
|
+
function It(e) {
|
|
2127
2614
|
const t = {
|
|
2128
|
-
...
|
|
2615
|
+
...ee(e.range),
|
|
2129
2616
|
message: e.message,
|
|
2130
|
-
severity: e.severity ?
|
|
2617
|
+
severity: e.severity ? Bn(e.severity) : 8
|
|
2131
2618
|
};
|
|
2132
|
-
return e.code != null && (t.code = e.codeDescription == null ? String(e.code) : { value: String(e.code), target:
|
|
2619
|
+
return e.code != null && (t.code = e.codeDescription == null ? String(e.code) : { value: String(e.code), target: ge.parse(e.codeDescription.href) }), e.relatedInformation && (t.relatedInformation = e.relatedInformation.map(Vn)), e.tags && (t.tags = e.tags.map(qn)), e.source != null && (t.source = e.source), t;
|
|
2133
2620
|
}
|
|
2134
|
-
function
|
|
2621
|
+
function Qe(e) {
|
|
2135
2622
|
return {
|
|
2136
|
-
range:
|
|
2623
|
+
range: ee(e.range),
|
|
2137
2624
|
text: e.newText
|
|
2138
2625
|
};
|
|
2139
2626
|
}
|
|
2140
|
-
function
|
|
2627
|
+
function Fn(e) {
|
|
2141
2628
|
const t = {};
|
|
2142
2629
|
return e.ignoreIfExists != null && (t.ignoreIfExists = e.ignoreIfExists), e.ignoreIfNotExists != null && (t.ignoreIfNotExists = e.ignoreIfNotExists), e.overwrite != null && (t.overwrite = e.overwrite), e.recursive != null && (t.recursive = e.recursive), t;
|
|
2143
2630
|
}
|
|
2144
|
-
function
|
|
2145
|
-
const t = e.kind === "create" ? { newResource:
|
|
2146
|
-
oldResource:
|
|
2147
|
-
newResource:
|
|
2631
|
+
function Un(e) {
|
|
2632
|
+
const t = e.kind === "create" ? { newResource: ge.parse(e.uri) } : e.kind === "delete" ? { oldResource: ge.parse(e.uri) } : {
|
|
2633
|
+
oldResource: ge.parse(e.oldUri),
|
|
2634
|
+
newResource: ge.parse(e.newUri)
|
|
2148
2635
|
};
|
|
2149
|
-
return e.options && (t.options =
|
|
2636
|
+
return e.options && (t.options = Fn(e.options)), t;
|
|
2150
2637
|
}
|
|
2151
|
-
function
|
|
2638
|
+
function wt(e, t, r) {
|
|
2152
2639
|
return {
|
|
2153
|
-
resource:
|
|
2640
|
+
resource: ge.parse(t),
|
|
2154
2641
|
versionId: r,
|
|
2155
|
-
textEdit:
|
|
2642
|
+
textEdit: Qe(e)
|
|
2156
2643
|
};
|
|
2157
2644
|
}
|
|
2158
|
-
function
|
|
2645
|
+
function Yn(e) {
|
|
2159
2646
|
var t;
|
|
2160
2647
|
const r = [];
|
|
2161
2648
|
if (e.changes)
|
|
2162
2649
|
for (const [n, c] of Object.entries(e.changes))
|
|
2163
|
-
for (const
|
|
2164
|
-
r.push(
|
|
2650
|
+
for (const i of c)
|
|
2651
|
+
r.push(wt(i, n));
|
|
2165
2652
|
if (e.documentChanges)
|
|
2166
2653
|
for (const n of e.documentChanges)
|
|
2167
2654
|
if ("textDocument" in n)
|
|
2168
2655
|
for (const c of n.edits)
|
|
2169
|
-
r.push(
|
|
2656
|
+
r.push(wt(c, n.textDocument.uri, (t = n.textDocument.version) !== null && t !== void 0 ? t : void 0));
|
|
2170
2657
|
else
|
|
2171
|
-
r.push(
|
|
2658
|
+
r.push(Un(n));
|
|
2172
2659
|
return {
|
|
2173
2660
|
edits: r
|
|
2174
2661
|
};
|
|
2175
2662
|
}
|
|
2176
|
-
function
|
|
2663
|
+
function Gn(e) {
|
|
2177
2664
|
const t = {
|
|
2178
2665
|
title: e.title,
|
|
2179
2666
|
isPreferred: e.isPreferred
|
|
2180
2667
|
};
|
|
2181
|
-
return e.diagnostics && (t.diagnostics = e.diagnostics.map(
|
|
2668
|
+
return e.diagnostics && (t.diagnostics = e.diagnostics.map(It)), e.disabled && (t.disabled = e.disabled.reason), e.edit && (t.edit = Yn(e.edit)), e.isPreferred != null && (t.isPreferred = e.isPreferred), e.kind && (t.kind = e.kind), t;
|
|
2182
2669
|
}
|
|
2183
|
-
function
|
|
2670
|
+
function Jn(e) {
|
|
2184
2671
|
const t = {
|
|
2185
2672
|
title: e.title,
|
|
2186
2673
|
id: e.command
|
|
2187
2674
|
};
|
|
2188
2675
|
return e.arguments && (t.arguments = e.arguments), t;
|
|
2189
2676
|
}
|
|
2190
|
-
function
|
|
2677
|
+
function Kn(e) {
|
|
2191
2678
|
return e === 1 ? 18 : e === 2 ? 0 : e === 3 ? 1 : e === 4 ? 2 : e === 5 ? 3 : e === 6 ? 4 : e === 7 ? 5 : e === 8 ? 7 : e === 9 ? 8 : e === 10 ? 9 : e === 11 ? 12 : e === 12 ? 13 : e === 13 ? 15 : e === 14 ? 17 : e === 15 ? 27 : e === 16 ? 19 : e === 17 ? 20 : e === 18 ? 21 : e === 19 ? 23 : e === 20 ? 16 : e === 21 ? 14 : e === 22 ? 6 : e === 23 ? 10 : e === 24 ? 11 : 24;
|
|
2192
2679
|
}
|
|
2193
|
-
function
|
|
2680
|
+
function Xn(e) {
|
|
2194
2681
|
return e;
|
|
2195
2682
|
}
|
|
2196
|
-
function
|
|
2683
|
+
function Wt(e) {
|
|
2197
2684
|
return {
|
|
2198
2685
|
value: e.value
|
|
2199
2686
|
};
|
|
2200
2687
|
}
|
|
2201
|
-
function
|
|
2688
|
+
function Zn(e) {
|
|
2202
2689
|
return {
|
|
2203
|
-
range:
|
|
2690
|
+
range: ee(e.range),
|
|
2204
2691
|
text: e.newText
|
|
2205
2692
|
};
|
|
2206
2693
|
}
|
|
2207
|
-
function
|
|
2208
|
-
return "range" in e ?
|
|
2209
|
-
insert:
|
|
2210
|
-
replace:
|
|
2211
|
-
} :
|
|
2212
|
-
}
|
|
2213
|
-
function
|
|
2214
|
-
var r, n, c,
|
|
2215
|
-
const
|
|
2694
|
+
function Qn(e) {
|
|
2695
|
+
return "range" in e ? ee(e.range) : "insert" in e && "replace" in e ? {
|
|
2696
|
+
insert: ee(e.insert),
|
|
2697
|
+
replace: ee(e.replace)
|
|
2698
|
+
} : ee(e);
|
|
2699
|
+
}
|
|
2700
|
+
function eo(e, t) {
|
|
2701
|
+
var r, n, c, i, l;
|
|
2702
|
+
const d = (r = t.itemDefaults) !== null && r !== void 0 ? r : {}, y = (n = e.textEdit) !== null && n !== void 0 ? n : d.editRange, h = (c = e.commitCharacters) !== null && c !== void 0 ? c : d.commitCharacters, k = (i = e.insertTextFormat) !== null && i !== void 0 ? i : d.insertTextFormat, j = (l = e.insertTextMode) !== null && l !== void 0 ? l : d.insertTextMode;
|
|
2216
2703
|
let m = e.insertText, T;
|
|
2217
|
-
|
|
2704
|
+
y ? (T = Qn(y), "newText" in y && (m = y.newText)) : T = { ...t.range };
|
|
2218
2705
|
const R = {
|
|
2219
2706
|
insertText: m ?? e.label,
|
|
2220
|
-
kind: e.kind == null ? 18 :
|
|
2707
|
+
kind: e.kind == null ? 18 : Kn(e.kind),
|
|
2221
2708
|
label: e.label,
|
|
2222
2709
|
range: T
|
|
2223
2710
|
};
|
|
2224
|
-
return e.additionalTextEdits && (R.additionalTextEdits = e.additionalTextEdits.map(
|
|
2711
|
+
return e.additionalTextEdits && (R.additionalTextEdits = e.additionalTextEdits.map(Zn)), e.command && (R.command = Jn(e.command)), h && (R.commitCharacters = h), e.detail != null && (R.detail = e.detail), typeof e.documentation == "string" ? R.documentation = e.documentation : e.documentation && (R.documentation = Wt(e.documentation)), e.filterText != null && (R.filterText = e.filterText), k === 2 ? R.insertTextRules = 4 : j === 2 && (R.insertTextRules = 1), e.preselect != null && (R.preselect = e.preselect), e.sortText != null && (R.sortText = e.sortText), e.tags && (R.tags = e.tags.map(Xn)), R;
|
|
2225
2712
|
}
|
|
2226
|
-
function
|
|
2713
|
+
function to(e, t) {
|
|
2227
2714
|
return {
|
|
2228
2715
|
incomplete: !!e.isIncomplete,
|
|
2229
|
-
suggestions: e.items.map((r) =>
|
|
2716
|
+
suggestions: e.items.map((r) => eo(r, { range: t.range, itemDefaults: e.itemDefaults }))
|
|
2230
2717
|
};
|
|
2231
2718
|
}
|
|
2232
|
-
function
|
|
2719
|
+
function ro(e) {
|
|
2233
2720
|
return e === 1 ? 0 : e === 2 ? 1 : e === 3 ? 2 : e === 4 ? 3 : e === 5 ? 4 : e === 6 ? 5 : e === 7 ? 6 : e === 8 ? 7 : e === 9 ? 8 : e === 10 ? 9 : e === 11 ? 10 : e === 12 ? 11 : e === 13 ? 12 : e === 14 ? 13 : e === 15 ? 14 : e === 16 ? 15 : e === 17 ? 16 : e === 18 ? 17 : e === 19 ? 18 : e === 20 ? 19 : e === 21 ? 20 : e === 22 ? 21 : e === 23 ? 22 : e === 24 ? 23 : e === 25 ? 24 : 25;
|
|
2234
2721
|
}
|
|
2235
|
-
function
|
|
2722
|
+
function no(e) {
|
|
2236
2723
|
return e;
|
|
2237
2724
|
}
|
|
2238
|
-
function
|
|
2725
|
+
function Ht(e) {
|
|
2239
2726
|
var t, r, n;
|
|
2240
2727
|
const c = {
|
|
2241
2728
|
detail: (t = e.detail) !== null && t !== void 0 ? t : "",
|
|
2242
|
-
kind:
|
|
2729
|
+
kind: ro(e.kind),
|
|
2243
2730
|
name: e.name,
|
|
2244
|
-
range:
|
|
2245
|
-
selectionRange:
|
|
2246
|
-
tags: (n = (r = e.tags) === null || r === void 0 ? void 0 : r.map(
|
|
2731
|
+
range: ee(e.range),
|
|
2732
|
+
selectionRange: ee(e.selectionRange),
|
|
2733
|
+
tags: (n = (r = e.tags) === null || r === void 0 ? void 0 : r.map(no)) !== null && n !== void 0 ? n : []
|
|
2247
2734
|
};
|
|
2248
|
-
return e.children && (c.children = e.children.map(
|
|
2735
|
+
return e.children && (c.children = e.children.map(Ht)), c;
|
|
2249
2736
|
}
|
|
2250
|
-
function
|
|
2737
|
+
function oo(e) {
|
|
2251
2738
|
const t = {
|
|
2252
2739
|
start: e.startLine + 1,
|
|
2253
2740
|
end: e.endLine + 1
|
|
2254
2741
|
};
|
|
2255
2742
|
return e.kind != null && (t.kind = { value: e.kind }), t;
|
|
2256
2743
|
}
|
|
2257
|
-
function
|
|
2744
|
+
function io(e) {
|
|
2258
2745
|
return {
|
|
2259
2746
|
insertSpaces: e.insertSpaces,
|
|
2260
2747
|
tabSize: e.tabSize
|
|
2261
2748
|
};
|
|
2262
2749
|
}
|
|
2263
|
-
function
|
|
2750
|
+
function _t(e) {
|
|
2264
2751
|
return typeof e == "string" ? { value: e } : { value: `\`\`\`${e.language}
|
|
2265
2752
|
${e.value}
|
|
2266
2753
|
\`\`\`` };
|
|
2267
2754
|
}
|
|
2268
|
-
function
|
|
2269
|
-
return typeof e == "string" || "language" in e ? [
|
|
2755
|
+
function so(e) {
|
|
2756
|
+
return typeof e == "string" || "language" in e ? [_t(e)] : Array.isArray(e) ? e.map(_t) : [Wt(e)];
|
|
2270
2757
|
}
|
|
2271
|
-
function
|
|
2758
|
+
function ao(e) {
|
|
2272
2759
|
const t = {
|
|
2273
|
-
contents:
|
|
2760
|
+
contents: so(e.contents)
|
|
2274
2761
|
};
|
|
2275
|
-
return e.range && (t.range =
|
|
2762
|
+
return e.range && (t.range = ee(e.range)), t;
|
|
2276
2763
|
}
|
|
2277
|
-
function
|
|
2764
|
+
function Te(e) {
|
|
2278
2765
|
return { character: e.column - 1, line: e.lineNumber - 1 };
|
|
2279
2766
|
}
|
|
2280
|
-
function
|
|
2767
|
+
function co(e) {
|
|
2281
2768
|
const t = {
|
|
2282
|
-
range:
|
|
2769
|
+
range: ee(e.range)
|
|
2283
2770
|
};
|
|
2284
|
-
return e.tooltip != null && (t.tooltip = e.tooltip), e.target != null && (t.url =
|
|
2771
|
+
return e.tooltip != null && (t.tooltip = e.tooltip), e.target != null && (t.url = ge.parse(e.target)), t;
|
|
2285
2772
|
}
|
|
2286
|
-
function
|
|
2773
|
+
function lo(e) {
|
|
2287
2774
|
const t = {
|
|
2288
|
-
range:
|
|
2289
|
-
targetSelectionRange:
|
|
2290
|
-
uri:
|
|
2775
|
+
range: ee(e.targetRange),
|
|
2776
|
+
targetSelectionRange: ee(e.targetSelectionRange),
|
|
2777
|
+
uri: ge.parse(e.targetUri)
|
|
2291
2778
|
};
|
|
2292
|
-
return e.originSelectionRange && (t.originSelectionRange =
|
|
2779
|
+
return e.originSelectionRange && (t.originSelectionRange = ee(e.originSelectionRange)), t;
|
|
2293
2780
|
}
|
|
2294
|
-
function
|
|
2781
|
+
function uo(e) {
|
|
2295
2782
|
const t = [];
|
|
2296
2783
|
let r = e;
|
|
2297
2784
|
for (; r; )
|
|
2298
2785
|
t.push({
|
|
2299
|
-
range:
|
|
2786
|
+
range: ee(r.range)
|
|
2300
2787
|
}), r = r.parent;
|
|
2301
2788
|
return t;
|
|
2302
2789
|
}
|
|
2303
|
-
function
|
|
2304
|
-
const n = /* @__PURE__ */ new Map(), c = (m) => Array.isArray(t) ? t.includes(m) : t === m,
|
|
2790
|
+
function fo(e, t, r) {
|
|
2791
|
+
const n = /* @__PURE__ */ new Map(), c = (m) => Array.isArray(t) ? t.includes(m) : t === m, i = async (m) => {
|
|
2305
2792
|
const T = m.getVersionId(), R = await r.provideMarkerData(m);
|
|
2306
2793
|
!m.isDisposed() && T === m.getVersionId() && c(m.getLanguageId()) && e.editor.setModelMarkers(m, r.owner, R ?? []);
|
|
2307
2794
|
}, l = (m) => {
|
|
@@ -2310,68 +2797,68 @@ function zn(e, t, r) {
|
|
|
2310
2797
|
let T;
|
|
2311
2798
|
const R = m.onDidChangeContent(() => {
|
|
2312
2799
|
clearTimeout(T), T = setTimeout(() => {
|
|
2313
|
-
|
|
2800
|
+
i(m);
|
|
2314
2801
|
}, 500);
|
|
2315
2802
|
});
|
|
2316
2803
|
n.set(m, {
|
|
2317
2804
|
dispose() {
|
|
2318
2805
|
clearTimeout(T), R.dispose();
|
|
2319
2806
|
}
|
|
2320
|
-
}),
|
|
2321
|
-
},
|
|
2807
|
+
}), i(m);
|
|
2808
|
+
}, d = (m) => {
|
|
2322
2809
|
e.editor.setModelMarkers(m, r.owner, []);
|
|
2323
2810
|
const T = n.get(m);
|
|
2324
2811
|
T && (T.dispose(), n.delete(m));
|
|
2325
2812
|
};
|
|
2326
|
-
function
|
|
2813
|
+
function y(m, T = m.getLanguageId()) {
|
|
2327
2814
|
r.doReset && c(T) && r.doReset(m);
|
|
2328
2815
|
}
|
|
2329
|
-
const
|
|
2330
|
-
|
|
2331
|
-
}),
|
|
2332
|
-
|
|
2816
|
+
const h = e.editor.onDidCreateModel(l), k = e.editor.onWillDisposeModel((m) => {
|
|
2817
|
+
d(m), y(m);
|
|
2818
|
+
}), j = e.editor.onDidChangeModelLanguage(({ model: m, oldLanguage: T }) => {
|
|
2819
|
+
d(m), l(m), y(m, T);
|
|
2333
2820
|
});
|
|
2334
2821
|
for (const m of e.editor.getModels())
|
|
2335
2822
|
l(m);
|
|
2336
2823
|
return {
|
|
2337
2824
|
dispose() {
|
|
2338
2825
|
for (const m of n.keys())
|
|
2339
|
-
|
|
2340
|
-
|
|
2826
|
+
d(m);
|
|
2827
|
+
h.dispose(), k.dispose(), j.dispose();
|
|
2341
2828
|
},
|
|
2342
2829
|
async revalidate() {
|
|
2343
|
-
await Promise.all(e.editor.getModels().map(
|
|
2830
|
+
await Promise.all(e.editor.getModels().map(i));
|
|
2344
2831
|
}
|
|
2345
2832
|
};
|
|
2346
2833
|
}
|
|
2347
|
-
function
|
|
2348
|
-
let { createData: r, interval: n = 3e4, label: c, moduleId:
|
|
2349
|
-
const
|
|
2350
|
-
|
|
2351
|
-
},
|
|
2352
|
-
if (!
|
|
2834
|
+
function go(e, t) {
|
|
2835
|
+
let { createData: r, interval: n = 3e4, label: c, moduleId: i, stopWhenIdleFor: l = 12e4 } = t, d, y = 0, h = !1;
|
|
2836
|
+
const k = () => {
|
|
2837
|
+
d && (d.dispose(), d = void 0);
|
|
2838
|
+
}, j = setInterval(() => {
|
|
2839
|
+
if (!d)
|
|
2353
2840
|
return;
|
|
2354
|
-
Date.now() -
|
|
2841
|
+
Date.now() - y > l && k();
|
|
2355
2842
|
}, n);
|
|
2356
2843
|
return {
|
|
2357
2844
|
dispose() {
|
|
2358
|
-
|
|
2845
|
+
h = !0, clearInterval(j), k();
|
|
2359
2846
|
},
|
|
2360
2847
|
getWorker(...m) {
|
|
2361
|
-
if (
|
|
2848
|
+
if (h)
|
|
2362
2849
|
throw new Error("Worker manager has been disposed");
|
|
2363
|
-
return
|
|
2850
|
+
return y = Date.now(), d || (d = e.editor.createWebWorker({
|
|
2364
2851
|
createData: r,
|
|
2365
2852
|
label: c,
|
|
2366
|
-
moduleId:
|
|
2367
|
-
})),
|
|
2853
|
+
moduleId: i
|
|
2854
|
+
})), d.withSyncedResources(m);
|
|
2368
2855
|
},
|
|
2369
2856
|
updateCreateData(m) {
|
|
2370
|
-
r = m,
|
|
2857
|
+
r = m, k();
|
|
2371
2858
|
}
|
|
2372
2859
|
};
|
|
2373
2860
|
}
|
|
2374
|
-
function
|
|
2861
|
+
function mo(e, t) {
|
|
2375
2862
|
const r = {
|
|
2376
2863
|
completion: !0,
|
|
2377
2864
|
customTags: [],
|
|
@@ -2390,93 +2877,93 @@ function Vn(e, t) {
|
|
|
2390
2877
|
aliases: ["YAML", "yaml", "YML", "yml"],
|
|
2391
2878
|
mimetypes: ["application/x-yaml"]
|
|
2392
2879
|
});
|
|
2393
|
-
const n =
|
|
2880
|
+
const n = go(e, {
|
|
2394
2881
|
label: "yaml",
|
|
2395
2882
|
moduleId: "monaco-yaml/yaml.worker",
|
|
2396
2883
|
createData: r
|
|
2397
|
-
}), c = /* @__PURE__ */ new WeakMap(),
|
|
2884
|
+
}), c = /* @__PURE__ */ new WeakMap(), i = fo(e, "yaml", {
|
|
2398
2885
|
owner: "yaml",
|
|
2399
|
-
async provideMarkerData(
|
|
2400
|
-
const
|
|
2401
|
-
return c.set(
|
|
2886
|
+
async provideMarkerData(d) {
|
|
2887
|
+
const h = await (await n.getWorker(d.uri)).doValidation(String(d.uri));
|
|
2888
|
+
return c.set(d, h), h?.map(It);
|
|
2402
2889
|
},
|
|
2403
|
-
async doReset(
|
|
2404
|
-
await (await n.getWorker(
|
|
2890
|
+
async doReset(d) {
|
|
2891
|
+
await (await n.getWorker(d.uri)).resetSchema(String(d.uri));
|
|
2405
2892
|
}
|
|
2406
2893
|
}), l = [
|
|
2407
2894
|
n,
|
|
2408
|
-
|
|
2895
|
+
i,
|
|
2409
2896
|
e.languages.registerCompletionItemProvider("yaml", {
|
|
2410
2897
|
triggerCharacters: [" ", ":"],
|
|
2411
|
-
async provideCompletionItems(
|
|
2412
|
-
const
|
|
2413
|
-
if (
|
|
2414
|
-
return
|
|
2898
|
+
async provideCompletionItems(d, y) {
|
|
2899
|
+
const h = d.getWordUntilPosition(y), j = await (await n.getWorker(d.uri)).doComplete(String(d.uri), Te(y));
|
|
2900
|
+
if (j)
|
|
2901
|
+
return to(j, {
|
|
2415
2902
|
range: {
|
|
2416
|
-
startLineNumber:
|
|
2417
|
-
startColumn:
|
|
2418
|
-
endLineNumber:
|
|
2419
|
-
endColumn:
|
|
2903
|
+
startLineNumber: y.lineNumber,
|
|
2904
|
+
startColumn: h.startColumn,
|
|
2905
|
+
endLineNumber: y.lineNumber,
|
|
2906
|
+
endColumn: h.endColumn
|
|
2420
2907
|
}
|
|
2421
2908
|
});
|
|
2422
2909
|
}
|
|
2423
2910
|
}),
|
|
2424
2911
|
e.languages.registerHoverProvider("yaml", {
|
|
2425
|
-
async provideHover(
|
|
2426
|
-
const
|
|
2427
|
-
if (
|
|
2428
|
-
return
|
|
2912
|
+
async provideHover(d, y) {
|
|
2913
|
+
const k = await (await n.getWorker(d.uri)).doHover(String(d.uri), Te(y));
|
|
2914
|
+
if (k)
|
|
2915
|
+
return ao(k);
|
|
2429
2916
|
}
|
|
2430
2917
|
}),
|
|
2431
2918
|
e.languages.registerDefinitionProvider("yaml", {
|
|
2432
|
-
async provideDefinition(
|
|
2433
|
-
const
|
|
2434
|
-
return
|
|
2919
|
+
async provideDefinition(d, y) {
|
|
2920
|
+
const k = await (await n.getWorker(d.uri)).doDefinition(String(d.uri), Te(y));
|
|
2921
|
+
return k?.map(lo);
|
|
2435
2922
|
}
|
|
2436
2923
|
}),
|
|
2437
2924
|
e.languages.registerDocumentSymbolProvider("yaml", {
|
|
2438
2925
|
displayName: "yaml",
|
|
2439
|
-
async provideDocumentSymbols(
|
|
2440
|
-
const
|
|
2441
|
-
return
|
|
2926
|
+
async provideDocumentSymbols(d) {
|
|
2927
|
+
const h = await (await n.getWorker(d.uri)).findDocumentSymbols(String(d.uri));
|
|
2928
|
+
return h?.map(Ht);
|
|
2442
2929
|
}
|
|
2443
2930
|
}),
|
|
2444
2931
|
e.languages.registerDocumentFormattingEditProvider("yaml", {
|
|
2445
2932
|
displayName: "yaml",
|
|
2446
|
-
async provideDocumentFormattingEdits(
|
|
2447
|
-
const
|
|
2448
|
-
return
|
|
2933
|
+
async provideDocumentFormattingEdits(d) {
|
|
2934
|
+
const h = await (await n.getWorker(d.uri)).format(String(d.uri));
|
|
2935
|
+
return h?.map(Qe);
|
|
2449
2936
|
}
|
|
2450
2937
|
}),
|
|
2451
2938
|
e.languages.registerLinkProvider("yaml", {
|
|
2452
|
-
async provideLinks(
|
|
2453
|
-
const
|
|
2454
|
-
if (
|
|
2939
|
+
async provideLinks(d) {
|
|
2940
|
+
const h = await (await n.getWorker(d.uri)).findLinks(String(d.uri));
|
|
2941
|
+
if (h)
|
|
2455
2942
|
return {
|
|
2456
|
-
links:
|
|
2943
|
+
links: h.map(co)
|
|
2457
2944
|
};
|
|
2458
2945
|
}
|
|
2459
2946
|
}),
|
|
2460
2947
|
e.languages.registerCodeActionProvider("yaml", {
|
|
2461
|
-
async provideCodeActions(
|
|
2462
|
-
var
|
|
2463
|
-
const m = await (await n.getWorker(
|
|
2464
|
-
diagnostics: ((
|
|
2465
|
-
only:
|
|
2466
|
-
triggerKind:
|
|
2948
|
+
async provideCodeActions(d, y, h) {
|
|
2949
|
+
var k;
|
|
2950
|
+
const m = await (await n.getWorker(d.uri)).getCodeAction(String(d.uri), zn(y), {
|
|
2951
|
+
diagnostics: ((k = c.get(d)) == null ? void 0 : k.filter((T) => y.intersectRanges(ee(T.range)))) || [],
|
|
2952
|
+
only: h.only ? [h.only] : void 0,
|
|
2953
|
+
triggerKind: h.trigger
|
|
2467
2954
|
});
|
|
2468
2955
|
if (m)
|
|
2469
2956
|
return {
|
|
2470
|
-
actions: m.map(
|
|
2957
|
+
actions: m.map(Gn),
|
|
2471
2958
|
dispose() {
|
|
2472
2959
|
}
|
|
2473
2960
|
};
|
|
2474
2961
|
}
|
|
2475
2962
|
}),
|
|
2476
2963
|
e.languages.registerFoldingRangeProvider("yaml", {
|
|
2477
|
-
async provideFoldingRanges(
|
|
2478
|
-
const
|
|
2479
|
-
return
|
|
2964
|
+
async provideFoldingRanges(d) {
|
|
2965
|
+
const h = await (await n.getWorker(d.uri)).getFoldingRanges(String(d.uri));
|
|
2966
|
+
return h?.map(oo);
|
|
2480
2967
|
}
|
|
2481
2968
|
}),
|
|
2482
2969
|
e.languages.setLanguageConfiguration("yaml", {
|
|
@@ -2506,76 +2993,76 @@ function Vn(e, t) {
|
|
|
2506
2993
|
e.languages.registerOnTypeFormattingEditProvider("yaml", {
|
|
2507
2994
|
autoFormatTriggerCharacters: [`
|
|
2508
2995
|
`],
|
|
2509
|
-
async provideOnTypeFormattingEdits(
|
|
2510
|
-
const m = await (await n.getWorker(
|
|
2511
|
-
String(
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2996
|
+
async provideOnTypeFormattingEdits(d, y, h, k) {
|
|
2997
|
+
const m = await (await n.getWorker(d.uri)).doDocumentOnTypeFormatting(
|
|
2998
|
+
String(d.uri),
|
|
2999
|
+
Te(y),
|
|
3000
|
+
h,
|
|
3001
|
+
io(k)
|
|
2515
3002
|
);
|
|
2516
|
-
return m?.map(
|
|
3003
|
+
return m?.map(Qe);
|
|
2517
3004
|
}
|
|
2518
3005
|
}),
|
|
2519
3006
|
e.languages.registerSelectionRangeProvider("yaml", {
|
|
2520
|
-
async provideSelectionRanges(
|
|
2521
|
-
const
|
|
2522
|
-
String(
|
|
2523
|
-
|
|
3007
|
+
async provideSelectionRanges(d, y) {
|
|
3008
|
+
const k = await (await n.getWorker(d.uri)).getSelectionRanges(
|
|
3009
|
+
String(d.uri),
|
|
3010
|
+
y.map(Te)
|
|
2524
3011
|
);
|
|
2525
|
-
return
|
|
3012
|
+
return k?.map(uo);
|
|
2526
3013
|
}
|
|
2527
3014
|
})
|
|
2528
3015
|
];
|
|
2529
3016
|
return {
|
|
2530
3017
|
dispose() {
|
|
2531
|
-
for (const
|
|
2532
|
-
|
|
3018
|
+
for (const d of l)
|
|
3019
|
+
d.dispose();
|
|
2533
3020
|
},
|
|
2534
|
-
async update(
|
|
2535
|
-
n.updateCreateData(Object.assign(r,
|
|
3021
|
+
async update(d) {
|
|
3022
|
+
n.updateCreateData(Object.assign(r, d)), await i.revalidate();
|
|
2536
3023
|
},
|
|
2537
3024
|
getOptions() {
|
|
2538
3025
|
return r;
|
|
2539
3026
|
}
|
|
2540
3027
|
};
|
|
2541
3028
|
}
|
|
2542
|
-
function
|
|
3029
|
+
function ho(e) {
|
|
2543
3030
|
return new Worker("/assets/editor.worker-CpuX8TSY.js", {
|
|
2544
3031
|
name: e?.name
|
|
2545
3032
|
});
|
|
2546
3033
|
}
|
|
2547
|
-
function
|
|
3034
|
+
function po(e) {
|
|
2548
3035
|
return new Worker("/assets/json.worker-B4VHhH6h.js", {
|
|
2549
3036
|
name: e?.name
|
|
2550
3037
|
});
|
|
2551
3038
|
}
|
|
2552
|
-
function
|
|
3039
|
+
function yo(e) {
|
|
2553
3040
|
return new Worker("/assets/ts.worker-sl17zBDo.js", {
|
|
2554
3041
|
name: e?.name
|
|
2555
3042
|
});
|
|
2556
3043
|
}
|
|
2557
|
-
function
|
|
3044
|
+
function vo(e) {
|
|
2558
3045
|
return new Worker("/assets/css.worker-Dmf38jDD.js", {
|
|
2559
3046
|
name: e?.name
|
|
2560
3047
|
});
|
|
2561
3048
|
}
|
|
2562
|
-
function
|
|
3049
|
+
function bo(e) {
|
|
2563
3050
|
return new Worker("/assets/html.worker-DotaEs7v.js", {
|
|
2564
3051
|
name: e?.name
|
|
2565
3052
|
});
|
|
2566
3053
|
}
|
|
2567
|
-
function
|
|
3054
|
+
function wo(e) {
|
|
2568
3055
|
return new Worker("/assets/yaml.worker-JJoHBMla.js", {
|
|
2569
3056
|
name: e?.name
|
|
2570
3057
|
});
|
|
2571
3058
|
}
|
|
2572
|
-
function
|
|
3059
|
+
function Le(...e) {
|
|
2573
3060
|
}
|
|
2574
|
-
function
|
|
3061
|
+
function _o(...e) {
|
|
2575
3062
|
}
|
|
2576
|
-
const
|
|
2577
|
-
if (!globalThis[
|
|
2578
|
-
globalThis[
|
|
3063
|
+
const Ct = "__omniview_monaco_setup__";
|
|
3064
|
+
if (!globalThis[Ct]) {
|
|
3065
|
+
globalThis[Ct] = !0;
|
|
2579
3066
|
const e = self.MonacoEnvironment ?? {};
|
|
2580
3067
|
self.MonacoEnvironment = {
|
|
2581
3068
|
...e,
|
|
@@ -2584,67 +3071,68 @@ if (!globalThis[yt]) {
|
|
|
2584
3071
|
try {
|
|
2585
3072
|
switch (r) {
|
|
2586
3073
|
case "yaml":
|
|
2587
|
-
n = new
|
|
3074
|
+
n = new wo();
|
|
2588
3075
|
break;
|
|
2589
3076
|
case "json":
|
|
2590
|
-
n = new
|
|
3077
|
+
n = new po();
|
|
2591
3078
|
break;
|
|
2592
3079
|
case "typescript":
|
|
2593
3080
|
case "javascript":
|
|
2594
|
-
n = new
|
|
3081
|
+
n = new yo();
|
|
2595
3082
|
break;
|
|
2596
3083
|
case "css":
|
|
2597
3084
|
case "scss":
|
|
2598
3085
|
case "less":
|
|
2599
|
-
n = new
|
|
3086
|
+
n = new vo();
|
|
2600
3087
|
break;
|
|
2601
3088
|
case "html":
|
|
2602
3089
|
case "handlebars":
|
|
2603
3090
|
case "razor":
|
|
2604
|
-
n = new
|
|
3091
|
+
n = new bo();
|
|
2605
3092
|
break;
|
|
2606
3093
|
default:
|
|
2607
|
-
n = new
|
|
3094
|
+
n = new ho();
|
|
2608
3095
|
break;
|
|
2609
3096
|
}
|
|
2610
|
-
|
|
3097
|
+
Le(`Worker created for "${r}" — instanceof Worker: ${n instanceof Worker}`);
|
|
2611
3098
|
} catch (c) {
|
|
2612
3099
|
throw c;
|
|
2613
3100
|
}
|
|
2614
3101
|
return n.onerror = (c) => {
|
|
2615
|
-
|
|
3102
|
+
_o(`Worker "${r}" error:`, c.message, "| filename:", c.filename);
|
|
2616
3103
|
}, n.addEventListener("message", (c) => {
|
|
2617
|
-
|
|
3104
|
+
Le(`Worker "${r}" first message:`, JSON.stringify(c.data).slice(0, 200));
|
|
2618
3105
|
}, {
|
|
2619
3106
|
once: !0
|
|
2620
3107
|
}), n;
|
|
2621
3108
|
}
|
|
2622
3109
|
};
|
|
2623
3110
|
try {
|
|
2624
|
-
const t =
|
|
3111
|
+
const t = mo(W, {
|
|
2625
3112
|
enableSchemaRequest: !1,
|
|
2626
3113
|
schemas: []
|
|
2627
3114
|
});
|
|
2628
|
-
|
|
3115
|
+
Le("configureMonacoYaml succeeded — handle keys:", Object.keys(t)), fe._setYamlHandle(t), Le("YAML handle injected into EditorSchemaRegistry");
|
|
2629
3116
|
} catch (t) {
|
|
2630
3117
|
console.error("[monaco-setup] configureMonacoYaml FAILED:", t);
|
|
2631
3118
|
}
|
|
2632
3119
|
}
|
|
2633
|
-
function
|
|
3120
|
+
function No() {
|
|
2634
3121
|
}
|
|
2635
3122
|
export {
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
3123
|
+
Mo as CelQueryEditor,
|
|
3124
|
+
Mt as CodeEditor,
|
|
3125
|
+
rn as CommandPalette,
|
|
3126
|
+
Nr as DiffViewer,
|
|
3127
|
+
Vr as MarkdownPreview,
|
|
3128
|
+
pe as OV_MONACO_THEME,
|
|
3129
|
+
kn as ObjectInspector,
|
|
3130
|
+
Dr as Terminal,
|
|
3131
|
+
$e as buildMonacoTheme,
|
|
3132
|
+
Je as buildXtermTheme,
|
|
2645
3133
|
fe as editorSchemas,
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
3134
|
+
To as getComputedToken,
|
|
3135
|
+
No as setupMonacoWorkers,
|
|
3136
|
+
rt as useEditorTheme
|
|
2649
3137
|
};
|
|
2650
3138
|
//# sourceMappingURL=index.js.map
|