react-reinspect 0.1.7 → 0.1.9
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/README.md +35 -41
- package/dist/lib/autoWrap.d.ts +1 -8
- package/dist/lib/autoWrap.d.ts.map +1 -1
- package/dist/lib/constants.d.ts +3 -2
- package/dist/lib/constants.d.ts.map +1 -1
- package/dist/lib/context.d.ts +1 -3
- package/dist/lib/context.d.ts.map +1 -1
- package/dist/lib/core/renderCounter.d.ts +11 -0
- package/dist/lib/core/renderCounter.d.ts.map +1 -0
- package/dist/lib/core/state.d.ts +67 -0
- package/dist/lib/core/state.d.ts.map +1 -0
- package/dist/lib/dom/styleInjection.d.ts +2 -0
- package/dist/lib/dom/styleInjection.d.ts.map +1 -0
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/index.d.ts +2 -5
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +781 -1199
- package/dist/lib/injectStyles.d.ts +1 -1
- package/dist/lib/injectStyles.d.ts.map +1 -1
- package/dist/lib/internal/auto-wrap.cjs +1 -0
- package/dist/lib/internal/auto-wrap.d.ts +9 -0
- package/dist/lib/internal/auto-wrap.d.ts.map +1 -0
- package/dist/lib/internal/auto-wrap.js +12 -0
- package/dist/lib/propsInspector.d.ts +8 -2
- package/dist/lib/propsInspector.d.ts.map +1 -1
- package/dist/lib/react/context.d.ts +3 -0
- package/dist/lib/react/context.d.ts.map +1 -0
- package/dist/lib/react/focusTrap.d.ts +3 -0
- package/dist/lib/react/focusTrap.d.ts.map +1 -0
- package/dist/lib/react/overlay.d.ts +14 -0
- package/dist/lib/react/overlay.d.ts.map +1 -0
- package/dist/lib/react/provider.d.ts +4 -0
- package/dist/lib/react/provider.d.ts.map +1 -0
- package/dist/lib/react/wrap.d.ts +11 -0
- package/dist/lib/react/wrap.d.ts.map +1 -0
- package/dist/lib/store.d.ts +1 -2
- package/dist/lib/store.d.ts.map +1 -1
- package/dist/lib/style.css +1 -1
- package/dist/lib/syntaxHighlight.d.ts +6 -0
- package/dist/lib/syntaxHighlight.d.ts.map +1 -0
- package/dist/lib/types.d.ts +70 -18
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/utils.d.ts +33 -4
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/withReinspect.d.ts +1 -6
- package/dist/lib/withReinspect.d.ts.map +1 -1
- package/dist/lib/wrap-Cc3mMcCA.cjs +2 -0
- package/dist/lib/wrap-DkOzTshV.js +2456 -0
- package/dist/lib/wrapInspectableMap.d.ts +1 -1
- package/dist/lib/wrapInspectableMap.d.ts.map +1 -1
- package/dist/lib/wrapMarker.d.ts +6 -3
- package/dist/lib/wrapMarker.d.ts.map +1 -1
- package/dist/plugin/internal/autoDiscoverTransform.d.ts +26 -0
- package/dist/plugin/internal/autoDiscoverTransform.d.ts.map +1 -0
- package/dist/plugin/internal/autoDiscoverTransform.js +397 -0
- package/dist/plugin/reinspectAutoDiscoverPlugin.d.ts +5 -8
- package/dist/plugin/reinspectAutoDiscoverPlugin.d.ts.map +1 -1
- package/dist/plugin/reinspectAutoDiscoverPlugin.js +11 -358
- package/dist/plugin/reinspectNextAutoDiscoverLoader.d.ts +1 -0
- package/dist/plugin/reinspectNextAutoDiscoverLoader.d.ts.map +1 -1
- package/dist/plugin/reinspectNextAutoDiscoverLoader.js +5 -27
- package/dist/plugin/reinspectNextPlugin.d.ts +2 -0
- package/dist/plugin/reinspectNextPlugin.d.ts.map +1 -1
- package/dist/plugin/reinspectNextPlugin.js +19 -15
- package/docs/assets/screenshot-example.png +0 -0
- package/package.json +32 -3
|
@@ -0,0 +1,2456 @@
|
|
|
1
|
+
import { Profiler as e, createContext as t, useCallback as n, useContext as r, useEffect as i, useMemo as a, useRef as o, useState as s, useSyncExternalStore as c } from "react";
|
|
2
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
3
|
+
import { createPortal as f } from "react-dom";
|
|
4
|
+
//#region \0rolldown/runtime.js
|
|
5
|
+
var p = Object.create, m = Object.defineProperty, h = Object.getOwnPropertyDescriptor, g = Object.getOwnPropertyNames, _ = Object.getPrototypeOf, v = Object.prototype.hasOwnProperty, ee = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), te = (e, t, n, r) => {
|
|
6
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = g(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !v.call(e, s) && s !== n && m(e, s, {
|
|
7
|
+
get: ((e) => t[e]).bind(null, s),
|
|
8
|
+
enumerable: !(r = h(t, s)) || r.enumerable
|
|
9
|
+
});
|
|
10
|
+
return e;
|
|
11
|
+
}, y = (e, t, n) => (n = e == null ? {} : p(_(e)), te(t || !e || !e.__esModule ? m(n, "default", {
|
|
12
|
+
value: e,
|
|
13
|
+
enumerable: !0
|
|
14
|
+
}) : n, e)), b = t(null), x = [
|
|
15
|
+
"a[href]",
|
|
16
|
+
"button:not([disabled])",
|
|
17
|
+
"input:not([disabled]):not([type=\"hidden\"])",
|
|
18
|
+
"select:not([disabled])",
|
|
19
|
+
"textarea:not([disabled])",
|
|
20
|
+
"[tabindex]:not([tabindex=\"-1\"])"
|
|
21
|
+
].join(", ");
|
|
22
|
+
function S(e) {
|
|
23
|
+
let t = window.getComputedStyle(e);
|
|
24
|
+
return t.display !== "none" && t.visibility !== "hidden";
|
|
25
|
+
}
|
|
26
|
+
function C(e) {
|
|
27
|
+
return Array.from(e.querySelectorAll(x)).filter((e) => S(e));
|
|
28
|
+
}
|
|
29
|
+
function w(e) {
|
|
30
|
+
let t = C(e)[0];
|
|
31
|
+
if (t) {
|
|
32
|
+
t.focus();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
e.focus();
|
|
36
|
+
}
|
|
37
|
+
function ne(e, t) {
|
|
38
|
+
if (e.key !== "Tab") return;
|
|
39
|
+
let n = C(t);
|
|
40
|
+
if (n.length === 0) {
|
|
41
|
+
e.preventDefault(), t.focus();
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
let r = n[0], i = n[n.length - 1];
|
|
45
|
+
if (!r || !i) {
|
|
46
|
+
e.preventDefault(), t.focus();
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
let a = document.activeElement instanceof HTMLElement ? document.activeElement : null, o = a && t.contains(a);
|
|
50
|
+
if (e.shiftKey) {
|
|
51
|
+
(!o || a === r) && (e.preventDefault(), i.focus());
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
(!o || a === i) && (e.preventDefault(), r.focus());
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/reinspect/constants.ts
|
|
58
|
+
var T = [
|
|
59
|
+
"backgroundColor",
|
|
60
|
+
"color",
|
|
61
|
+
"fontSize",
|
|
62
|
+
"padding",
|
|
63
|
+
"margin",
|
|
64
|
+
"borderRadius",
|
|
65
|
+
"borderWidth",
|
|
66
|
+
"borderColor",
|
|
67
|
+
"opacity",
|
|
68
|
+
"width",
|
|
69
|
+
"height",
|
|
70
|
+
"gap"
|
|
71
|
+
], E = "#1f2937", D = new Set([
|
|
72
|
+
"backgroundColor",
|
|
73
|
+
"color",
|
|
74
|
+
"borderColor"
|
|
75
|
+
]), re = new Set([
|
|
76
|
+
"fontSize",
|
|
77
|
+
"padding",
|
|
78
|
+
"margin",
|
|
79
|
+
"borderRadius",
|
|
80
|
+
"borderWidth",
|
|
81
|
+
"width",
|
|
82
|
+
"height",
|
|
83
|
+
"gap"
|
|
84
|
+
]), O = 2147483e3, k = "reinspect.inspectMode", ie = "reinspect.inspectWhitelist", A = "reinspect.inspectBlacklist", j = "reinspect.propsSerializationMode", M = "reinspect.menuTheme", ae = "reinspect.menuOpenGesture", N = {
|
|
85
|
+
ctrl: !1,
|
|
86
|
+
alt: !1,
|
|
87
|
+
shift: !0,
|
|
88
|
+
meta: !1
|
|
89
|
+
}, oe = {
|
|
90
|
+
mode: "right-click",
|
|
91
|
+
modifiers: N
|
|
92
|
+
}, P = [
|
|
93
|
+
"wrapped",
|
|
94
|
+
"first-party",
|
|
95
|
+
"all"
|
|
96
|
+
], se = [
|
|
97
|
+
"off",
|
|
98
|
+
"attempts",
|
|
99
|
+
"commits",
|
|
100
|
+
"both"
|
|
101
|
+
], F = ["distilled", "complete"], ce = ["light", "dark"], le = ["right-click", "modifier-right-click"], ue = !1;
|
|
102
|
+
function I(e) {
|
|
103
|
+
return typeof e == "object" && !!e;
|
|
104
|
+
}
|
|
105
|
+
function L() {
|
|
106
|
+
ue || typeof console > "u" || (ue = !0, console.warn("[react-reinspect] `shouldCountRenders` and `renderCaptureMode` are deprecated. Use `renderCounters` instead."));
|
|
107
|
+
}
|
|
108
|
+
function R(e) {
|
|
109
|
+
return typeof e == "string" && P.includes(e);
|
|
110
|
+
}
|
|
111
|
+
function de(e) {
|
|
112
|
+
return typeof e == "string" && se.includes(e);
|
|
113
|
+
}
|
|
114
|
+
function z(e) {
|
|
115
|
+
return typeof e == "string" && F.includes(e);
|
|
116
|
+
}
|
|
117
|
+
function fe(e) {
|
|
118
|
+
return typeof e == "string" && ce.includes(e);
|
|
119
|
+
}
|
|
120
|
+
function B(e) {
|
|
121
|
+
return typeof e == "string" && le.includes(e);
|
|
122
|
+
}
|
|
123
|
+
function V(e) {
|
|
124
|
+
let t = {
|
|
125
|
+
ctrl: e?.ctrl === !0,
|
|
126
|
+
alt: e?.alt === !0,
|
|
127
|
+
shift: e?.shift === !0,
|
|
128
|
+
meta: e?.meta === !0
|
|
129
|
+
};
|
|
130
|
+
return t.ctrl || t.alt || t.shift || t.meta ? t : { ...N };
|
|
131
|
+
}
|
|
132
|
+
function H(e) {
|
|
133
|
+
return {
|
|
134
|
+
mode: B(e?.mode) ? e.mode : oe.mode,
|
|
135
|
+
modifiers: V(e?.modifiers)
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
function U(e) {
|
|
139
|
+
let t = [];
|
|
140
|
+
if (Array.isArray(e?.patterns)) for (let n of e.patterns) {
|
|
141
|
+
if (typeof n != "string") continue;
|
|
142
|
+
let e = n.trim();
|
|
143
|
+
e.length !== 0 && t.push(e);
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
patterns: t,
|
|
147
|
+
regex: e?.regex === !0,
|
|
148
|
+
wholeWord: e?.wholeWord === !0,
|
|
149
|
+
matchCase: e?.matchCase === !0
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function pe() {
|
|
153
|
+
if (!(typeof window > "u")) try {
|
|
154
|
+
let e = window.sessionStorage.getItem(k);
|
|
155
|
+
return R(e) ? e : void 0;
|
|
156
|
+
} catch {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
function W(e) {
|
|
161
|
+
return pe() || (R(e) ? e : "wrapped");
|
|
162
|
+
}
|
|
163
|
+
function me(e) {
|
|
164
|
+
if (!(typeof window > "u")) try {
|
|
165
|
+
window.sessionStorage.setItem(k, e);
|
|
166
|
+
} catch {}
|
|
167
|
+
}
|
|
168
|
+
function G(e) {
|
|
169
|
+
if (!(typeof window > "u")) try {
|
|
170
|
+
let t = window.sessionStorage.getItem(e);
|
|
171
|
+
if (!t) return;
|
|
172
|
+
let n = JSON.parse(t);
|
|
173
|
+
return I(n) ? U(n) : void 0;
|
|
174
|
+
} catch {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
function he(e, t) {
|
|
179
|
+
return G(t) || U(e);
|
|
180
|
+
}
|
|
181
|
+
function ge(e) {
|
|
182
|
+
return he(e, ie);
|
|
183
|
+
}
|
|
184
|
+
function _e(e) {
|
|
185
|
+
return he(e, A);
|
|
186
|
+
}
|
|
187
|
+
function ve(e, t) {
|
|
188
|
+
if (!(typeof window > "u")) try {
|
|
189
|
+
let n = U(t);
|
|
190
|
+
window.sessionStorage.setItem(e, JSON.stringify(n));
|
|
191
|
+
} catch {}
|
|
192
|
+
}
|
|
193
|
+
function ye(e) {
|
|
194
|
+
ve(ie, e);
|
|
195
|
+
}
|
|
196
|
+
function be(e) {
|
|
197
|
+
ve(A, e);
|
|
198
|
+
}
|
|
199
|
+
function K() {
|
|
200
|
+
if (!(typeof window > "u")) try {
|
|
201
|
+
let e = window.sessionStorage.getItem(j);
|
|
202
|
+
return z(e) ? e : void 0;
|
|
203
|
+
} catch {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
function xe(e) {
|
|
208
|
+
return K() || (z(e) ? e : "distilled");
|
|
209
|
+
}
|
|
210
|
+
function q(e) {
|
|
211
|
+
if (!(typeof window > "u")) try {
|
|
212
|
+
window.sessionStorage.setItem(j, e);
|
|
213
|
+
} catch {}
|
|
214
|
+
}
|
|
215
|
+
function Se() {
|
|
216
|
+
if (!(typeof window > "u")) try {
|
|
217
|
+
let e = window.sessionStorage.getItem(M);
|
|
218
|
+
return fe(e) ? e : void 0;
|
|
219
|
+
} catch {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
function Ce(e) {
|
|
224
|
+
return Se() || (fe(e) ? e : "light");
|
|
225
|
+
}
|
|
226
|
+
function we(e) {
|
|
227
|
+
if (!(typeof window > "u")) try {
|
|
228
|
+
window.sessionStorage.setItem(M, e);
|
|
229
|
+
} catch {}
|
|
230
|
+
}
|
|
231
|
+
function Te() {
|
|
232
|
+
if (!(typeof window > "u")) try {
|
|
233
|
+
let e = window.sessionStorage.getItem(ae);
|
|
234
|
+
if (!e) return;
|
|
235
|
+
let t = JSON.parse(e);
|
|
236
|
+
return I(t) ? H(t) : void 0;
|
|
237
|
+
} catch {
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
function Ee(e) {
|
|
242
|
+
return Te() || H(e);
|
|
243
|
+
}
|
|
244
|
+
function De(e) {
|
|
245
|
+
if (!(typeof window > "u")) try {
|
|
246
|
+
let t = H(e);
|
|
247
|
+
window.sessionStorage.setItem(ae, JSON.stringify(t));
|
|
248
|
+
} catch {}
|
|
249
|
+
}
|
|
250
|
+
function J(e) {
|
|
251
|
+
return de(e.renderCounters) ? e.renderCounters : ((e.shouldCountRenders !== void 0 || e.renderCaptureMode !== void 0) && L(), e.shouldCountRenders === !1 ? "off" : e.shouldCountRenders === !0 ? e.renderCaptureMode ?? "attempts" : e.renderCaptureMode ? e.renderCaptureMode : "off");
|
|
252
|
+
}
|
|
253
|
+
function Oe(e) {
|
|
254
|
+
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
255
|
+
}
|
|
256
|
+
function ke(e) {
|
|
257
|
+
let t = U(e), n = [], r = [], i = t.matchCase ? "" : "i";
|
|
258
|
+
for (let e of t.patterns) {
|
|
259
|
+
let a = t.regex ? e : Oe(e), o = t.wholeWord ? `\\b(?:${a})\\b` : a;
|
|
260
|
+
try {
|
|
261
|
+
n.push(new RegExp(o, i));
|
|
262
|
+
} catch {
|
|
263
|
+
r.push(e);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
return {
|
|
267
|
+
hasPatterns: n.length > 0,
|
|
268
|
+
invalidPatterns: r,
|
|
269
|
+
matches: (e) => n.some((t) => t.test(e))
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
function Ae(e, t, n) {
|
|
273
|
+
return !(!(!t.hasPatterns || t.matches(e)) || n.hasPatterns && n.matches(e));
|
|
274
|
+
}
|
|
275
|
+
function Y(e = {}) {
|
|
276
|
+
let t = e.enabled ?? !1, n = e.editableProps && e.editableProps.length > 0 ? e.editableProps : T;
|
|
277
|
+
return {
|
|
278
|
+
enabled: t,
|
|
279
|
+
startActive: e.startActive ?? !0,
|
|
280
|
+
showFloatingToggle: e.showFloatingToggle ?? t,
|
|
281
|
+
inspectMode: W(e.inspectMode),
|
|
282
|
+
inspectWhitelist: ge(e.inspectWhitelist),
|
|
283
|
+
inspectBlacklist: _e(e.inspectBlacklist),
|
|
284
|
+
editableProps: n,
|
|
285
|
+
zIndexBase: e.zIndexBase ?? O,
|
|
286
|
+
renderCounters: J(e),
|
|
287
|
+
countRendersForComponents: e.countRendersForComponents ?? [],
|
|
288
|
+
propsSerializationMode: xe(e.propsSerializationMode),
|
|
289
|
+
menuTheme: Ce(e.menuTheme),
|
|
290
|
+
menuOpenGesture: Ee(e.menuOpenGesture)
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
function je(e, t) {
|
|
294
|
+
if (!e) return {};
|
|
295
|
+
let n = {};
|
|
296
|
+
for (let r of t) {
|
|
297
|
+
let t = e[r];
|
|
298
|
+
t == null || t === "" || (n[r] = t);
|
|
299
|
+
}
|
|
300
|
+
return n;
|
|
301
|
+
}
|
|
302
|
+
function Me(e) {
|
|
303
|
+
let t = e.trim();
|
|
304
|
+
if (t.length === 0) return;
|
|
305
|
+
if (t.endsWith("%")) {
|
|
306
|
+
let e = Number(t.slice(0, -1));
|
|
307
|
+
return Number.isFinite(e) ? Math.min(255, Math.max(0, Math.round(e / 100 * 255))) : void 0;
|
|
308
|
+
}
|
|
309
|
+
let n = Number(t);
|
|
310
|
+
if (Number.isFinite(n)) return Math.min(255, Math.max(0, Math.round(n)));
|
|
311
|
+
}
|
|
312
|
+
function Ne(e) {
|
|
313
|
+
return e.toString(16).padStart(2, "0");
|
|
314
|
+
}
|
|
315
|
+
function X(e) {
|
|
316
|
+
if (!e) return;
|
|
317
|
+
let t = e.trim();
|
|
318
|
+
if (/^#[0-9a-fA-F]{6}$/.test(t)) return t.toLowerCase();
|
|
319
|
+
if (/^#[0-9a-fA-F]{3}$/.test(t)) {
|
|
320
|
+
let [, e = "0", n = "0", r = "0"] = t;
|
|
321
|
+
return `#${e}${e}${n}${n}${r}${r}`.toLowerCase();
|
|
322
|
+
}
|
|
323
|
+
let n = t.match(/^rgba?\((.+)\)$/i);
|
|
324
|
+
if (n) {
|
|
325
|
+
let e = (n[1] ?? "").replace(/\//g, " ").split(/[,\s]+/).filter((e) => e.length > 0), t = Me(e[0] ?? ""), r = Me(e[1] ?? ""), i = Me(e[2] ?? "");
|
|
326
|
+
if (t !== void 0 && r !== void 0 && i !== void 0) return `#${Ne(t)}${Ne(r)}${Ne(i)}`;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
function Pe(e) {
|
|
330
|
+
if (typeof document > "u" || typeof window > "u") return;
|
|
331
|
+
let t = document.createElement("span");
|
|
332
|
+
if (t.style.position = "fixed", t.style.left = "-9999px", t.style.top = "-9999px", t.style.color = "", t.style.color = e, t.style.color) {
|
|
333
|
+
document.body.appendChild(t);
|
|
334
|
+
try {
|
|
335
|
+
let e = window.getComputedStyle(t).color;
|
|
336
|
+
return X(e);
|
|
337
|
+
} finally {
|
|
338
|
+
t.remove();
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
function Fe(e) {
|
|
343
|
+
let t = X(e);
|
|
344
|
+
if (t) return t;
|
|
345
|
+
if (e) {
|
|
346
|
+
let t = Pe(e);
|
|
347
|
+
if (t) return t;
|
|
348
|
+
}
|
|
349
|
+
return Pe("var(--reinspect-menu-text)") || Pe("CanvasText") || E;
|
|
350
|
+
}
|
|
351
|
+
function Ie(e) {
|
|
352
|
+
let t = Number(e);
|
|
353
|
+
if (Number.isFinite(t)) return t;
|
|
354
|
+
}
|
|
355
|
+
//#endregion
|
|
356
|
+
//#region src/reinspect/propsInspector.ts
|
|
357
|
+
var Le = 4, Re = 40, ze = 40, Be = "__reinspect_placeholder__", Ve = "__reinspect__displayName__", Z = "display", Q = Symbol("reinspect.omitSerialization"), He = new Set([
|
|
358
|
+
"$$typeof",
|
|
359
|
+
"_owner",
|
|
360
|
+
"_store",
|
|
361
|
+
"_self",
|
|
362
|
+
"_source"
|
|
363
|
+
]);
|
|
364
|
+
function Ue(e, t) {
|
|
365
|
+
return { [Ve]: t };
|
|
366
|
+
}
|
|
367
|
+
function We(e) {
|
|
368
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
369
|
+
}
|
|
370
|
+
function Ge(e) {
|
|
371
|
+
if (!We(e)) return !1;
|
|
372
|
+
let t = Object.getPrototypeOf(e);
|
|
373
|
+
return t === Object.prototype || t === null;
|
|
374
|
+
}
|
|
375
|
+
function Ke(e) {
|
|
376
|
+
if (!We(e)) return !1;
|
|
377
|
+
let t = e[Be];
|
|
378
|
+
if (t !== void 0 && typeof t != "string") return !1;
|
|
379
|
+
let n = e[Ve];
|
|
380
|
+
if (n !== void 0 && typeof n != "string") return !1;
|
|
381
|
+
let r = e[Z];
|
|
382
|
+
return r !== void 0 && typeof r != "string" ? !1 : typeof t == "string" || typeof n == "string";
|
|
383
|
+
}
|
|
384
|
+
function qe(e) {
|
|
385
|
+
try {
|
|
386
|
+
return JSON.stringify(e, null, 2);
|
|
387
|
+
} catch {
|
|
388
|
+
return null;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
function Je(e) {
|
|
392
|
+
try {
|
|
393
|
+
let t = Function.prototype.toString.call(e);
|
|
394
|
+
return typeof t != "string" || t.trim().length === 0 ? "[Function source unavailable]" : t;
|
|
395
|
+
} catch {
|
|
396
|
+
return "[Function source unavailable]";
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
function Ye(e) {
|
|
400
|
+
let t = e.replace(/\s+/g, " ").trim();
|
|
401
|
+
return t.length <= 120 ? t : `${t.slice(0, 117)}...`;
|
|
402
|
+
}
|
|
403
|
+
function Xe(e) {
|
|
404
|
+
return e?.mode === "complete" ? "complete" : "distilled";
|
|
405
|
+
}
|
|
406
|
+
function Ze(e) {
|
|
407
|
+
return "$$typeof" in e && "props" in e;
|
|
408
|
+
}
|
|
409
|
+
function Qe(e, t) {
|
|
410
|
+
let n = Object.entries(e);
|
|
411
|
+
return t !== "distilled" || !Ze(e) ? n : n.filter(([e]) => !He.has(e));
|
|
412
|
+
}
|
|
413
|
+
function $e(e, t, n, r) {
|
|
414
|
+
let i = (e, t) => r === "complete" ? Ue(e, t) : Q;
|
|
415
|
+
if (n > Le) return i("truncated", "[Max depth reached]");
|
|
416
|
+
if (e === null) return null;
|
|
417
|
+
let a = typeof e;
|
|
418
|
+
if (a === "string" || a === "boolean") return e;
|
|
419
|
+
if (a === "number") return Number.isFinite(e) ? e : i("non-finite-number", String(e));
|
|
420
|
+
if (a === "undefined") return i("undefined", "undefined");
|
|
421
|
+
if (a === "bigint") return i("bigint", `${String(e)}n`);
|
|
422
|
+
if (a === "symbol") return i("symbol", String(e));
|
|
423
|
+
if (a === "function") return i("function", `[Function ${e.name || "anonymous"}]`);
|
|
424
|
+
if (e instanceof Date) return i("date", Number.isNaN(e.getTime()) ? "Invalid Date" : e.toISOString());
|
|
425
|
+
if (e instanceof RegExp) return i("regexp", e.toString());
|
|
426
|
+
if (a === "object") {
|
|
427
|
+
let a = e;
|
|
428
|
+
if (t.has(a)) return i("circular", "[Circular]");
|
|
429
|
+
if (t.add(a), Array.isArray(e)) {
|
|
430
|
+
let o = [], s = Math.min(e.length, ze);
|
|
431
|
+
for (let i = 0; i < s; i += 1) {
|
|
432
|
+
let a = $e(e[i], t, n + 1, r);
|
|
433
|
+
a !== Q && o.push(a);
|
|
434
|
+
}
|
|
435
|
+
if (e.length > ze) {
|
|
436
|
+
let t = i("truncated", `${e.length - ze} more items`);
|
|
437
|
+
t !== Q && o.push(t);
|
|
438
|
+
}
|
|
439
|
+
return t.delete(a), o;
|
|
440
|
+
}
|
|
441
|
+
let o = {}, s = Qe(e, r), c = Math.min(s.length, Re);
|
|
442
|
+
for (let e = 0; e < c; e += 1) {
|
|
443
|
+
let i = s[e];
|
|
444
|
+
if (!i) continue;
|
|
445
|
+
let [a, c] = i, l = $e(c, t, n + 1, r);
|
|
446
|
+
l !== Q && (o[a] = l);
|
|
447
|
+
}
|
|
448
|
+
if (s.length > Re) {
|
|
449
|
+
let e = i("truncated", `${s.length - Re} more keys`);
|
|
450
|
+
e !== Q && (o.__reinspect_truncated__ = e);
|
|
451
|
+
}
|
|
452
|
+
return t.delete(a), o;
|
|
453
|
+
}
|
|
454
|
+
return i("unsupported", "[Unsupported value]");
|
|
455
|
+
}
|
|
456
|
+
function et(e) {
|
|
457
|
+
if (e === null) return {
|
|
458
|
+
kind: "null",
|
|
459
|
+
summary: "null",
|
|
460
|
+
copyText: "null"
|
|
461
|
+
};
|
|
462
|
+
let t = typeof e;
|
|
463
|
+
if (t === "undefined") return {
|
|
464
|
+
kind: "undefined",
|
|
465
|
+
summary: "undefined",
|
|
466
|
+
copyText: "undefined"
|
|
467
|
+
};
|
|
468
|
+
if (t === "boolean") return {
|
|
469
|
+
kind: "boolean",
|
|
470
|
+
summary: String(e),
|
|
471
|
+
copyText: String(e)
|
|
472
|
+
};
|
|
473
|
+
if (t === "number") return {
|
|
474
|
+
kind: "number",
|
|
475
|
+
summary: String(e),
|
|
476
|
+
copyText: String(e)
|
|
477
|
+
};
|
|
478
|
+
if (t === "string") return {
|
|
479
|
+
kind: "string",
|
|
480
|
+
summary: JSON.stringify(e),
|
|
481
|
+
copyText: String(e)
|
|
482
|
+
};
|
|
483
|
+
if (t === "bigint") return {
|
|
484
|
+
kind: "bigint",
|
|
485
|
+
summary: `${String(e)}n`,
|
|
486
|
+
copyText: `${String(e)}n`
|
|
487
|
+
};
|
|
488
|
+
if (t === "symbol") {
|
|
489
|
+
let t = String(e);
|
|
490
|
+
return {
|
|
491
|
+
kind: "symbol",
|
|
492
|
+
summary: t,
|
|
493
|
+
copyText: t
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
if (t === "function") {
|
|
497
|
+
let t = e, n = Je(t), r = t.name || "anonymous";
|
|
498
|
+
return {
|
|
499
|
+
kind: "function",
|
|
500
|
+
summary: `Function ${r}(${t.length})`,
|
|
501
|
+
copyText: n,
|
|
502
|
+
functionMeta: {
|
|
503
|
+
name: r,
|
|
504
|
+
arity: t.length,
|
|
505
|
+
preview: Ye(n),
|
|
506
|
+
source: n
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
if (e instanceof Date) {
|
|
511
|
+
let t = Number.isNaN(e.getTime()) ? "Invalid Date" : e.toISOString();
|
|
512
|
+
return {
|
|
513
|
+
kind: "date",
|
|
514
|
+
summary: `Date ${t}`,
|
|
515
|
+
copyText: t
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
if (e instanceof RegExp) {
|
|
519
|
+
let t = e.toString();
|
|
520
|
+
return {
|
|
521
|
+
kind: "regexp",
|
|
522
|
+
summary: t,
|
|
523
|
+
copyText: t
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
return Array.isArray(e) ? {
|
|
527
|
+
kind: "array",
|
|
528
|
+
summary: `Array(${e.length})`
|
|
529
|
+
} : We(e) ? {
|
|
530
|
+
kind: "object",
|
|
531
|
+
summary: `Object(${Object.keys(e).length})`
|
|
532
|
+
} : {
|
|
533
|
+
kind: "unknown",
|
|
534
|
+
summary: String(e)
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
function tt(e) {
|
|
538
|
+
if (!Ke(e)) {
|
|
539
|
+
if (Array.isArray(e)) {
|
|
540
|
+
let t = [];
|
|
541
|
+
for (let n of e) {
|
|
542
|
+
let e = tt(n);
|
|
543
|
+
if (e === void 0) return;
|
|
544
|
+
t.push(e);
|
|
545
|
+
}
|
|
546
|
+
return t;
|
|
547
|
+
}
|
|
548
|
+
if (We(e)) {
|
|
549
|
+
let t = {};
|
|
550
|
+
for (let [n, r] of Object.entries(e)) {
|
|
551
|
+
let e = tt(r);
|
|
552
|
+
e !== void 0 && (t[n] = e);
|
|
553
|
+
}
|
|
554
|
+
return t;
|
|
555
|
+
}
|
|
556
|
+
return e;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
function nt(e) {
|
|
560
|
+
return Object.keys(e).map((t) => ({
|
|
561
|
+
key: t,
|
|
562
|
+
value: et(e[t])
|
|
563
|
+
}));
|
|
564
|
+
}
|
|
565
|
+
function rt(e, t) {
|
|
566
|
+
let n = $e(e, /* @__PURE__ */ new WeakSet(), 0, Xe(t));
|
|
567
|
+
return n === Q ? "{}" : qe(n) ?? "{}";
|
|
568
|
+
}
|
|
569
|
+
function it(e, t) {
|
|
570
|
+
let n = $e(e, /* @__PURE__ */ new WeakSet(), 0, Xe(t));
|
|
571
|
+
return n === Q ? null : qe(n);
|
|
572
|
+
}
|
|
573
|
+
function at(e) {
|
|
574
|
+
if (e === null) return !0;
|
|
575
|
+
let t = typeof e;
|
|
576
|
+
return t === "string" || t === "number" || t === "boolean" || Array.isArray(e) ? !0 : Ge(e);
|
|
577
|
+
}
|
|
578
|
+
function ot(e) {
|
|
579
|
+
let t = e.trim();
|
|
580
|
+
if (t.length === 0) return {
|
|
581
|
+
parsed: null,
|
|
582
|
+
error: "Value JSON cannot be empty."
|
|
583
|
+
};
|
|
584
|
+
try {
|
|
585
|
+
let e = tt(JSON.parse(t));
|
|
586
|
+
return e === void 0 || !at(e) ? {
|
|
587
|
+
parsed: null,
|
|
588
|
+
error: "Only objects, arrays, and primitive JSON values are editable."
|
|
589
|
+
} : {
|
|
590
|
+
parsed: e,
|
|
591
|
+
error: null
|
|
592
|
+
};
|
|
593
|
+
} catch {
|
|
594
|
+
return {
|
|
595
|
+
parsed: null,
|
|
596
|
+
error: "Invalid JSON. Fix syntax and try Apply again."
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
function st(e) {
|
|
601
|
+
let t = e.trim();
|
|
602
|
+
if (t.length === 0) return {
|
|
603
|
+
parsed: {},
|
|
604
|
+
error: null
|
|
605
|
+
};
|
|
606
|
+
try {
|
|
607
|
+
let e = JSON.parse(t);
|
|
608
|
+
if (typeof e != "object" || !e || Array.isArray(e)) return {
|
|
609
|
+
parsed: null,
|
|
610
|
+
error: "Props JSON must be an object (example: {\"title\":\"Demo\"})."
|
|
611
|
+
};
|
|
612
|
+
let n = {};
|
|
613
|
+
for (let [t, r] of Object.entries(e)) {
|
|
614
|
+
let e = tt(r);
|
|
615
|
+
e !== void 0 && (n[t] = e);
|
|
616
|
+
}
|
|
617
|
+
return {
|
|
618
|
+
parsed: n,
|
|
619
|
+
error: null
|
|
620
|
+
};
|
|
621
|
+
} catch {
|
|
622
|
+
return {
|
|
623
|
+
parsed: null,
|
|
624
|
+
error: "Invalid JSON. Fix syntax and try Apply again."
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
//#endregion
|
|
629
|
+
//#region src/reinspect/wrapMarker.ts
|
|
630
|
+
var ct = Symbol.for("reinspect.wrapped");
|
|
631
|
+
function lt(e) {
|
|
632
|
+
return e[ct];
|
|
633
|
+
}
|
|
634
|
+
function ut(e, t) {
|
|
635
|
+
e[ct] = t;
|
|
636
|
+
}
|
|
637
|
+
//#endregion
|
|
638
|
+
//#region src/reinspect/core/renderCounter.ts
|
|
639
|
+
var dt = {
|
|
640
|
+
attempts: 0,
|
|
641
|
+
commits: 0
|
|
642
|
+
}, ft = /* @__PURE__ */ new Map(), $ = /* @__PURE__ */ new Map();
|
|
643
|
+
function pt(e) {
|
|
644
|
+
let t = ft.get(e);
|
|
645
|
+
if (t) return t;
|
|
646
|
+
let n = {
|
|
647
|
+
attempts: 0,
|
|
648
|
+
commits: 0
|
|
649
|
+
};
|
|
650
|
+
return ft.set(e, n), n;
|
|
651
|
+
}
|
|
652
|
+
function mt(e) {
|
|
653
|
+
let t = $.get(e);
|
|
654
|
+
if (t) for (let e of t) e();
|
|
655
|
+
}
|
|
656
|
+
function ht(e) {
|
|
657
|
+
let t = pt(e);
|
|
658
|
+
ft.set(e, {
|
|
659
|
+
attempts: t.attempts + 1,
|
|
660
|
+
commits: t.commits + 1
|
|
661
|
+
}), mt(e);
|
|
662
|
+
}
|
|
663
|
+
function gt(e) {
|
|
664
|
+
return ft.get(e) || dt;
|
|
665
|
+
}
|
|
666
|
+
function _t(e) {
|
|
667
|
+
ft.delete(e), mt(e);
|
|
668
|
+
}
|
|
669
|
+
function vt(e, t) {
|
|
670
|
+
let n = $.get(e);
|
|
671
|
+
return n ? n.add(t) : $.set(e, new Set([t])), () => {
|
|
672
|
+
let n = $.get(e);
|
|
673
|
+
n && (n.delete(t), n.size === 0 && $.delete(e));
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
function yt(e) {
|
|
677
|
+
return c(n((t) => vt(e, t), [e]), n(() => gt(e), [e]), () => dt);
|
|
678
|
+
}
|
|
679
|
+
function bt(e, t) {
|
|
680
|
+
return t === "commits" ? `${e.commits} commits` : t === "both" ? `${e.attempts} attempts | ${e.commits} commits` : `${e.attempts} attempts`;
|
|
681
|
+
}
|
|
682
|
+
//#endregion
|
|
683
|
+
//#region node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-javascript.js
|
|
684
|
+
var xt = /* @__PURE__ */ y((/* @__PURE__ */ ee(((e, t) => {
|
|
685
|
+
var n = function(e) {
|
|
686
|
+
var t = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, n = 0, r = {}, i = {
|
|
687
|
+
manual: e.Prism && e.Prism.manual,
|
|
688
|
+
disableWorkerMessageHandler: e.Prism && e.Prism.disableWorkerMessageHandler,
|
|
689
|
+
util: {
|
|
690
|
+
encode: function e(t) {
|
|
691
|
+
return t instanceof a ? new a(t.type, e(t.content), t.alias) : Array.isArray(t) ? t.map(e) : t.replace(/&/g, "&").replace(/</g, "<").replace(/\u00a0/g, " ");
|
|
692
|
+
},
|
|
693
|
+
type: function(e) {
|
|
694
|
+
return Object.prototype.toString.call(e).slice(8, -1);
|
|
695
|
+
},
|
|
696
|
+
objId: function(e) {
|
|
697
|
+
return e.__id || Object.defineProperty(e, "__id", { value: ++n }), e.__id;
|
|
698
|
+
},
|
|
699
|
+
clone: function e(t, n) {
|
|
700
|
+
n ||= {};
|
|
701
|
+
var r, a;
|
|
702
|
+
switch (i.util.type(t)) {
|
|
703
|
+
case "Object":
|
|
704
|
+
if (a = i.util.objId(t), n[a]) return n[a];
|
|
705
|
+
for (var o in r = {}, n[a] = r, t) t.hasOwnProperty(o) && (r[o] = e(t[o], n));
|
|
706
|
+
return r;
|
|
707
|
+
case "Array": return a = i.util.objId(t), n[a] ? n[a] : (r = [], n[a] = r, t.forEach(function(t, i) {
|
|
708
|
+
r[i] = e(t, n);
|
|
709
|
+
}), r);
|
|
710
|
+
default: return t;
|
|
711
|
+
}
|
|
712
|
+
},
|
|
713
|
+
getLanguage: function(e) {
|
|
714
|
+
for (; e;) {
|
|
715
|
+
var n = t.exec(e.className);
|
|
716
|
+
if (n) return n[1].toLowerCase();
|
|
717
|
+
e = e.parentElement;
|
|
718
|
+
}
|
|
719
|
+
return "none";
|
|
720
|
+
},
|
|
721
|
+
setLanguage: function(e, n) {
|
|
722
|
+
e.className = e.className.replace(RegExp(t, "gi"), ""), e.classList.add("language-" + n);
|
|
723
|
+
},
|
|
724
|
+
currentScript: function() {
|
|
725
|
+
if (typeof document > "u") return null;
|
|
726
|
+
if (document.currentScript && document.currentScript.tagName === "SCRIPT") return document.currentScript;
|
|
727
|
+
try {
|
|
728
|
+
throw Error();
|
|
729
|
+
} catch (r) {
|
|
730
|
+
var e = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack) || [])[1];
|
|
731
|
+
if (e) {
|
|
732
|
+
var t = document.getElementsByTagName("script");
|
|
733
|
+
for (var n in t) if (t[n].src == e) return t[n];
|
|
734
|
+
}
|
|
735
|
+
return null;
|
|
736
|
+
}
|
|
737
|
+
},
|
|
738
|
+
isActive: function(e, t, n) {
|
|
739
|
+
for (var r = "no-" + t; e;) {
|
|
740
|
+
var i = e.classList;
|
|
741
|
+
if (i.contains(t)) return !0;
|
|
742
|
+
if (i.contains(r)) return !1;
|
|
743
|
+
e = e.parentElement;
|
|
744
|
+
}
|
|
745
|
+
return !!n;
|
|
746
|
+
}
|
|
747
|
+
},
|
|
748
|
+
languages: {
|
|
749
|
+
plain: r,
|
|
750
|
+
plaintext: r,
|
|
751
|
+
text: r,
|
|
752
|
+
txt: r,
|
|
753
|
+
extend: function(e, t) {
|
|
754
|
+
var n = i.util.clone(i.languages[e]);
|
|
755
|
+
for (var r in t) n[r] = t[r];
|
|
756
|
+
return n;
|
|
757
|
+
},
|
|
758
|
+
insertBefore: function(e, t, n, r) {
|
|
759
|
+
r ||= i.languages;
|
|
760
|
+
var a = r[e], o = {};
|
|
761
|
+
for (var s in a) if (a.hasOwnProperty(s)) {
|
|
762
|
+
if (s == t) for (var c in n) n.hasOwnProperty(c) && (o[c] = n[c]);
|
|
763
|
+
n.hasOwnProperty(s) || (o[s] = a[s]);
|
|
764
|
+
}
|
|
765
|
+
var l = r[e];
|
|
766
|
+
return r[e] = o, i.languages.DFS(i.languages, function(t, n) {
|
|
767
|
+
n === l && t != e && (this[t] = o);
|
|
768
|
+
}), o;
|
|
769
|
+
},
|
|
770
|
+
DFS: function e(t, n, r, a) {
|
|
771
|
+
a ||= {};
|
|
772
|
+
var o = i.util.objId;
|
|
773
|
+
for (var s in t) if (t.hasOwnProperty(s)) {
|
|
774
|
+
n.call(t, s, t[s], r || s);
|
|
775
|
+
var c = t[s], l = i.util.type(c);
|
|
776
|
+
l === "Object" && !a[o(c)] ? (a[o(c)] = !0, e(c, n, null, a)) : l === "Array" && !a[o(c)] && (a[o(c)] = !0, e(c, n, s, a));
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
},
|
|
780
|
+
plugins: {},
|
|
781
|
+
highlightAll: function(e, t) {
|
|
782
|
+
i.highlightAllUnder(document, e, t);
|
|
783
|
+
},
|
|
784
|
+
highlightAllUnder: function(e, t, n) {
|
|
785
|
+
var r = {
|
|
786
|
+
callback: n,
|
|
787
|
+
container: e,
|
|
788
|
+
selector: "code[class*=\"language-\"], [class*=\"language-\"] code, code[class*=\"lang-\"], [class*=\"lang-\"] code"
|
|
789
|
+
};
|
|
790
|
+
i.hooks.run("before-highlightall", r), r.elements = Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)), i.hooks.run("before-all-elements-highlight", r);
|
|
791
|
+
for (var a = 0, o; o = r.elements[a++];) i.highlightElement(o, t === !0, r.callback);
|
|
792
|
+
},
|
|
793
|
+
highlightElement: function(t, n, r) {
|
|
794
|
+
var a = i.util.getLanguage(t), o = i.languages[a];
|
|
795
|
+
i.util.setLanguage(t, a);
|
|
796
|
+
var s = t.parentElement;
|
|
797
|
+
s && s.nodeName.toLowerCase() === "pre" && i.util.setLanguage(s, a);
|
|
798
|
+
var c = {
|
|
799
|
+
element: t,
|
|
800
|
+
language: a,
|
|
801
|
+
grammar: o,
|
|
802
|
+
code: t.textContent
|
|
803
|
+
};
|
|
804
|
+
function l(e) {
|
|
805
|
+
c.highlightedCode = e, i.hooks.run("before-insert", c), c.element.innerHTML = c.highlightedCode, i.hooks.run("after-highlight", c), i.hooks.run("complete", c), r && r.call(c.element);
|
|
806
|
+
}
|
|
807
|
+
if (i.hooks.run("before-sanity-check", c), s = c.element.parentElement, s && s.nodeName.toLowerCase() === "pre" && !s.hasAttribute("tabindex") && s.setAttribute("tabindex", "0"), !c.code) {
|
|
808
|
+
i.hooks.run("complete", c), r && r.call(c.element);
|
|
809
|
+
return;
|
|
810
|
+
}
|
|
811
|
+
if (i.hooks.run("before-highlight", c), !c.grammar) {
|
|
812
|
+
l(i.util.encode(c.code));
|
|
813
|
+
return;
|
|
814
|
+
}
|
|
815
|
+
if (n && e.Worker) {
|
|
816
|
+
var u = new Worker(i.filename);
|
|
817
|
+
u.onmessage = function(e) {
|
|
818
|
+
l(e.data);
|
|
819
|
+
}, u.postMessage(JSON.stringify({
|
|
820
|
+
language: c.language,
|
|
821
|
+
code: c.code,
|
|
822
|
+
immediateClose: !0
|
|
823
|
+
}));
|
|
824
|
+
} else l(i.highlight(c.code, c.grammar, c.language));
|
|
825
|
+
},
|
|
826
|
+
highlight: function(e, t, n) {
|
|
827
|
+
var r = {
|
|
828
|
+
code: e,
|
|
829
|
+
grammar: t,
|
|
830
|
+
language: n
|
|
831
|
+
};
|
|
832
|
+
if (i.hooks.run("before-tokenize", r), !r.grammar) throw Error("The language \"" + r.language + "\" has no grammar.");
|
|
833
|
+
return r.tokens = i.tokenize(r.code, r.grammar), i.hooks.run("after-tokenize", r), a.stringify(i.util.encode(r.tokens), r.language);
|
|
834
|
+
},
|
|
835
|
+
tokenize: function(e, t) {
|
|
836
|
+
var n = t.rest;
|
|
837
|
+
if (n) {
|
|
838
|
+
for (var r in n) t[r] = n[r];
|
|
839
|
+
delete t.rest;
|
|
840
|
+
}
|
|
841
|
+
var i = new c();
|
|
842
|
+
return l(i, i.head, e), s(e, i, t, i.head, 0), d(i);
|
|
843
|
+
},
|
|
844
|
+
hooks: {
|
|
845
|
+
all: {},
|
|
846
|
+
add: function(e, t) {
|
|
847
|
+
var n = i.hooks.all;
|
|
848
|
+
n[e] = n[e] || [], n[e].push(t);
|
|
849
|
+
},
|
|
850
|
+
run: function(e, t) {
|
|
851
|
+
var n = i.hooks.all[e];
|
|
852
|
+
if (!(!n || !n.length)) for (var r = 0, a; a = n[r++];) a(t);
|
|
853
|
+
}
|
|
854
|
+
},
|
|
855
|
+
Token: a
|
|
856
|
+
};
|
|
857
|
+
e.Prism = i;
|
|
858
|
+
function a(e, t, n, r) {
|
|
859
|
+
this.type = e, this.content = t, this.alias = n, this.length = (r || "").length | 0;
|
|
860
|
+
}
|
|
861
|
+
a.stringify = function e(t, n) {
|
|
862
|
+
if (typeof t == "string") return t;
|
|
863
|
+
if (Array.isArray(t)) {
|
|
864
|
+
var r = "";
|
|
865
|
+
return t.forEach(function(t) {
|
|
866
|
+
r += e(t, n);
|
|
867
|
+
}), r;
|
|
868
|
+
}
|
|
869
|
+
var a = {
|
|
870
|
+
type: t.type,
|
|
871
|
+
content: e(t.content, n),
|
|
872
|
+
tag: "span",
|
|
873
|
+
classes: ["token", t.type],
|
|
874
|
+
attributes: {},
|
|
875
|
+
language: n
|
|
876
|
+
}, o = t.alias;
|
|
877
|
+
o && (Array.isArray(o) ? Array.prototype.push.apply(a.classes, o) : a.classes.push(o)), i.hooks.run("wrap", a);
|
|
878
|
+
var s = "";
|
|
879
|
+
for (var c in a.attributes) s += " " + c + "=\"" + (a.attributes[c] || "").replace(/"/g, """) + "\"";
|
|
880
|
+
return "<" + a.tag + " class=\"" + a.classes.join(" ") + "\"" + s + ">" + a.content + "</" + a.tag + ">";
|
|
881
|
+
};
|
|
882
|
+
function o(e, t, n, r) {
|
|
883
|
+
e.lastIndex = t;
|
|
884
|
+
var i = e.exec(n);
|
|
885
|
+
if (i && r && i[1]) {
|
|
886
|
+
var a = i[1].length;
|
|
887
|
+
i.index += a, i[0] = i[0].slice(a);
|
|
888
|
+
}
|
|
889
|
+
return i;
|
|
890
|
+
}
|
|
891
|
+
function s(e, t, n, r, c, d) {
|
|
892
|
+
for (var f in n) if (!(!n.hasOwnProperty(f) || !n[f])) {
|
|
893
|
+
var p = n[f];
|
|
894
|
+
p = Array.isArray(p) ? p : [p];
|
|
895
|
+
for (var m = 0; m < p.length; ++m) {
|
|
896
|
+
if (d && d.cause == f + "," + m) return;
|
|
897
|
+
var h = p[m], g = h.inside, _ = !!h.lookbehind, v = !!h.greedy, ee = h.alias;
|
|
898
|
+
if (v && !h.pattern.global) {
|
|
899
|
+
var te = h.pattern.toString().match(/[imsuy]*$/)[0];
|
|
900
|
+
h.pattern = RegExp(h.pattern.source, te + "g");
|
|
901
|
+
}
|
|
902
|
+
for (var y = h.pattern || h, b = r.next, x = c; b !== t.tail && !(d && x >= d.reach); x += b.value.length, b = b.next) {
|
|
903
|
+
var S = b.value;
|
|
904
|
+
if (t.length > e.length) return;
|
|
905
|
+
if (!(S instanceof a)) {
|
|
906
|
+
var C = 1, w;
|
|
907
|
+
if (v) {
|
|
908
|
+
if (w = o(y, x, e, _), !w || w.index >= e.length) break;
|
|
909
|
+
var ne = w.index, T = w.index + w[0].length, E = x;
|
|
910
|
+
for (E += b.value.length; ne >= E;) b = b.next, E += b.value.length;
|
|
911
|
+
if (E -= b.value.length, x = E, b.value instanceof a) continue;
|
|
912
|
+
for (var D = b; D !== t.tail && (E < T || typeof D.value == "string"); D = D.next) C++, E += D.value.length;
|
|
913
|
+
C--, S = e.slice(x, E), w.index -= x;
|
|
914
|
+
} else if (w = o(y, 0, S, _), !w) continue;
|
|
915
|
+
var ne = w.index, re = w[0], O = S.slice(0, ne), k = S.slice(ne + re.length), ie = x + S.length;
|
|
916
|
+
d && ie > d.reach && (d.reach = ie);
|
|
917
|
+
var A = b.prev;
|
|
918
|
+
O && (A = l(t, A, O), x += O.length), u(t, A, C);
|
|
919
|
+
var j = new a(f, g ? i.tokenize(re, g) : re, ee, re);
|
|
920
|
+
if (b = l(t, A, j), k && l(t, b, k), C > 1) {
|
|
921
|
+
var M = {
|
|
922
|
+
cause: f + "," + m,
|
|
923
|
+
reach: ie
|
|
924
|
+
};
|
|
925
|
+
s(e, t, n, b.prev, x, M), d && M.reach > d.reach && (d.reach = M.reach);
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
function c() {
|
|
933
|
+
var e = {
|
|
934
|
+
value: null,
|
|
935
|
+
prev: null,
|
|
936
|
+
next: null
|
|
937
|
+
}, t = {
|
|
938
|
+
value: null,
|
|
939
|
+
prev: e,
|
|
940
|
+
next: null
|
|
941
|
+
};
|
|
942
|
+
e.next = t, this.head = e, this.tail = t, this.length = 0;
|
|
943
|
+
}
|
|
944
|
+
function l(e, t, n) {
|
|
945
|
+
var r = t.next, i = {
|
|
946
|
+
value: n,
|
|
947
|
+
prev: t,
|
|
948
|
+
next: r
|
|
949
|
+
};
|
|
950
|
+
return t.next = i, r.prev = i, e.length++, i;
|
|
951
|
+
}
|
|
952
|
+
function u(e, t, n) {
|
|
953
|
+
for (var r = t.next, i = 0; i < n && r !== e.tail; i++) r = r.next;
|
|
954
|
+
t.next = r, r.prev = t, e.length -= i;
|
|
955
|
+
}
|
|
956
|
+
function d(e) {
|
|
957
|
+
for (var t = [], n = e.head.next; n !== e.tail;) t.push(n.value), n = n.next;
|
|
958
|
+
return t;
|
|
959
|
+
}
|
|
960
|
+
if (!e.document) return e.addEventListener && (i.disableWorkerMessageHandler || e.addEventListener("message", function(t) {
|
|
961
|
+
var n = JSON.parse(t.data), r = n.language, a = n.code, o = n.immediateClose;
|
|
962
|
+
e.postMessage(i.highlight(a, i.languages[r], r)), o && e.close();
|
|
963
|
+
}, !1)), i;
|
|
964
|
+
var f = i.util.currentScript();
|
|
965
|
+
f && (i.filename = f.src, f.hasAttribute("data-manual") && (i.manual = !0));
|
|
966
|
+
function p() {
|
|
967
|
+
i.manual || i.highlightAll();
|
|
968
|
+
}
|
|
969
|
+
if (!i.manual) {
|
|
970
|
+
var m = document.readyState;
|
|
971
|
+
m === "loading" || m === "interactive" && f && f.defer ? document.addEventListener("DOMContentLoaded", p) : window.requestAnimationFrame ? window.requestAnimationFrame(p) : window.setTimeout(p, 16);
|
|
972
|
+
}
|
|
973
|
+
return i;
|
|
974
|
+
}(typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {});
|
|
975
|
+
t !== void 0 && t.exports && (t.exports = n), typeof global < "u" && (global.Prism = n), n.languages.markup = {
|
|
976
|
+
comment: {
|
|
977
|
+
pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
|
|
978
|
+
greedy: !0
|
|
979
|
+
},
|
|
980
|
+
prolog: {
|
|
981
|
+
pattern: /<\?[\s\S]+?\?>/,
|
|
982
|
+
greedy: !0
|
|
983
|
+
},
|
|
984
|
+
doctype: {
|
|
985
|
+
pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
|
|
986
|
+
greedy: !0,
|
|
987
|
+
inside: {
|
|
988
|
+
"internal-subset": {
|
|
989
|
+
pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
|
|
990
|
+
lookbehind: !0,
|
|
991
|
+
greedy: !0,
|
|
992
|
+
inside: null
|
|
993
|
+
},
|
|
994
|
+
string: {
|
|
995
|
+
pattern: /"[^"]*"|'[^']*'/,
|
|
996
|
+
greedy: !0
|
|
997
|
+
},
|
|
998
|
+
punctuation: /^<!|>$|[[\]]/,
|
|
999
|
+
"doctype-tag": /^DOCTYPE/i,
|
|
1000
|
+
name: /[^\s<>'"]+/
|
|
1001
|
+
}
|
|
1002
|
+
},
|
|
1003
|
+
cdata: {
|
|
1004
|
+
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
1005
|
+
greedy: !0
|
|
1006
|
+
},
|
|
1007
|
+
tag: {
|
|
1008
|
+
pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
|
|
1009
|
+
greedy: !0,
|
|
1010
|
+
inside: {
|
|
1011
|
+
tag: {
|
|
1012
|
+
pattern: /^<\/?[^\s>\/]+/,
|
|
1013
|
+
inside: {
|
|
1014
|
+
punctuation: /^<\/?/,
|
|
1015
|
+
namespace: /^[^\s>\/:]+:/
|
|
1016
|
+
}
|
|
1017
|
+
},
|
|
1018
|
+
"special-attr": [],
|
|
1019
|
+
"attr-value": {
|
|
1020
|
+
pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
|
|
1021
|
+
inside: { punctuation: [{
|
|
1022
|
+
pattern: /^=/,
|
|
1023
|
+
alias: "attr-equals"
|
|
1024
|
+
}, {
|
|
1025
|
+
pattern: /^(\s*)["']|["']$/,
|
|
1026
|
+
lookbehind: !0
|
|
1027
|
+
}] }
|
|
1028
|
+
},
|
|
1029
|
+
punctuation: /\/?>/,
|
|
1030
|
+
"attr-name": {
|
|
1031
|
+
pattern: /[^\s>\/]+/,
|
|
1032
|
+
inside: { namespace: /^[^\s>\/:]+:/ }
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
},
|
|
1036
|
+
entity: [{
|
|
1037
|
+
pattern: /&[\da-z]{1,8};/i,
|
|
1038
|
+
alias: "named-entity"
|
|
1039
|
+
}, /&#x?[\da-f]{1,8};/i]
|
|
1040
|
+
}, n.languages.markup.tag.inside["attr-value"].inside.entity = n.languages.markup.entity, n.languages.markup.doctype.inside["internal-subset"].inside = n.languages.markup, n.hooks.add("wrap", function(e) {
|
|
1041
|
+
e.type === "entity" && (e.attributes.title = e.content.replace(/&/, "&"));
|
|
1042
|
+
}), Object.defineProperty(n.languages.markup.tag, "addInlined", { value: function(e, t) {
|
|
1043
|
+
var r = {};
|
|
1044
|
+
r["language-" + t] = {
|
|
1045
|
+
pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
|
|
1046
|
+
lookbehind: !0,
|
|
1047
|
+
inside: n.languages[t]
|
|
1048
|
+
}, r.cdata = /^<!\[CDATA\[|\]\]>$/i;
|
|
1049
|
+
var i = { "included-cdata": {
|
|
1050
|
+
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
1051
|
+
inside: r
|
|
1052
|
+
} };
|
|
1053
|
+
i["language-" + t] = {
|
|
1054
|
+
pattern: /[\s\S]+/,
|
|
1055
|
+
inside: n.languages[t]
|
|
1056
|
+
};
|
|
1057
|
+
var a = {};
|
|
1058
|
+
a[e] = {
|
|
1059
|
+
pattern: RegExp("(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)".replace(/__/g, function() {
|
|
1060
|
+
return e;
|
|
1061
|
+
}), "i"),
|
|
1062
|
+
lookbehind: !0,
|
|
1063
|
+
greedy: !0,
|
|
1064
|
+
inside: i
|
|
1065
|
+
}, n.languages.insertBefore("markup", "cdata", a);
|
|
1066
|
+
} }), Object.defineProperty(n.languages.markup.tag, "addAttribute", { value: function(e, t) {
|
|
1067
|
+
n.languages.markup.tag.inside["special-attr"].push({
|
|
1068
|
+
pattern: RegExp("(^|[\"'\\s])(?:" + e + ")\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))", "i"),
|
|
1069
|
+
lookbehind: !0,
|
|
1070
|
+
inside: {
|
|
1071
|
+
"attr-name": /^[^\s=]+/,
|
|
1072
|
+
"attr-value": {
|
|
1073
|
+
pattern: /=[\s\S]+/,
|
|
1074
|
+
inside: {
|
|
1075
|
+
value: {
|
|
1076
|
+
pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
|
|
1077
|
+
lookbehind: !0,
|
|
1078
|
+
alias: [t, "language-" + t],
|
|
1079
|
+
inside: n.languages[t]
|
|
1080
|
+
},
|
|
1081
|
+
punctuation: [{
|
|
1082
|
+
pattern: /^=/,
|
|
1083
|
+
alias: "attr-equals"
|
|
1084
|
+
}, /"|'/]
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
});
|
|
1089
|
+
} }), n.languages.html = n.languages.markup, n.languages.mathml = n.languages.markup, n.languages.svg = n.languages.markup, n.languages.xml = n.languages.extend("markup", {}), n.languages.ssml = n.languages.xml, n.languages.atom = n.languages.xml, n.languages.rss = n.languages.xml, (function(e) {
|
|
1090
|
+
var t = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
1091
|
+
e.languages.css = {
|
|
1092
|
+
comment: /\/\*[\s\S]*?\*\//,
|
|
1093
|
+
atrule: {
|
|
1094
|
+
pattern: RegExp("@[\\w-](?:[^;{\\s\"']|\\s+(?!\\s)|" + t.source + ")*?(?:;|(?=\\s*\\{))"),
|
|
1095
|
+
inside: {
|
|
1096
|
+
rule: /^@[\w-]+/,
|
|
1097
|
+
"selector-function-argument": {
|
|
1098
|
+
pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
|
|
1099
|
+
lookbehind: !0,
|
|
1100
|
+
alias: "selector"
|
|
1101
|
+
},
|
|
1102
|
+
keyword: {
|
|
1103
|
+
pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
|
|
1104
|
+
lookbehind: !0
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
},
|
|
1108
|
+
url: {
|
|
1109
|
+
pattern: RegExp("\\burl\\((?:" + t.source + "|(?:[^\\\\\\r\\n()\"']|\\\\[\\s\\S])*)\\)", "i"),
|
|
1110
|
+
greedy: !0,
|
|
1111
|
+
inside: {
|
|
1112
|
+
function: /^url/i,
|
|
1113
|
+
punctuation: /^\(|\)$/,
|
|
1114
|
+
string: {
|
|
1115
|
+
pattern: RegExp("^" + t.source + "$"),
|
|
1116
|
+
alias: "url"
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
},
|
|
1120
|
+
selector: {
|
|
1121
|
+
pattern: RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|" + t.source + ")*(?=\\s*\\{)"),
|
|
1122
|
+
lookbehind: !0
|
|
1123
|
+
},
|
|
1124
|
+
string: {
|
|
1125
|
+
pattern: t,
|
|
1126
|
+
greedy: !0
|
|
1127
|
+
},
|
|
1128
|
+
property: {
|
|
1129
|
+
pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
|
|
1130
|
+
lookbehind: !0
|
|
1131
|
+
},
|
|
1132
|
+
important: /!important\b/i,
|
|
1133
|
+
function: {
|
|
1134
|
+
pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
|
|
1135
|
+
lookbehind: !0
|
|
1136
|
+
},
|
|
1137
|
+
punctuation: /[(){};:,]/
|
|
1138
|
+
}, e.languages.css.atrule.inside.rest = e.languages.css;
|
|
1139
|
+
var n = e.languages.markup;
|
|
1140
|
+
n && (n.tag.addInlined("style", "css"), n.tag.addAttribute("style", "css"));
|
|
1141
|
+
})(n), n.languages.clike = {
|
|
1142
|
+
comment: [{
|
|
1143
|
+
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
|
1144
|
+
lookbehind: !0,
|
|
1145
|
+
greedy: !0
|
|
1146
|
+
}, {
|
|
1147
|
+
pattern: /(^|[^\\:])\/\/.*/,
|
|
1148
|
+
lookbehind: !0,
|
|
1149
|
+
greedy: !0
|
|
1150
|
+
}],
|
|
1151
|
+
string: {
|
|
1152
|
+
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
|
|
1153
|
+
greedy: !0
|
|
1154
|
+
},
|
|
1155
|
+
"class-name": {
|
|
1156
|
+
pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
|
|
1157
|
+
lookbehind: !0,
|
|
1158
|
+
inside: { punctuation: /[.\\]/ }
|
|
1159
|
+
},
|
|
1160
|
+
keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
|
|
1161
|
+
boolean: /\b(?:false|true)\b/,
|
|
1162
|
+
function: /\b\w+(?=\()/,
|
|
1163
|
+
number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
|
|
1164
|
+
operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
|
|
1165
|
+
punctuation: /[{}[\];(),.:]/
|
|
1166
|
+
}, n.languages.javascript = n.languages.extend("clike", {
|
|
1167
|
+
"class-name": [n.languages.clike["class-name"], {
|
|
1168
|
+
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
|
|
1169
|
+
lookbehind: !0
|
|
1170
|
+
}],
|
|
1171
|
+
keyword: [{
|
|
1172
|
+
pattern: /((?:^|\})\s*)catch\b/,
|
|
1173
|
+
lookbehind: !0
|
|
1174
|
+
}, {
|
|
1175
|
+
pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
|
|
1176
|
+
lookbehind: !0
|
|
1177
|
+
}],
|
|
1178
|
+
function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
|
|
1179
|
+
number: {
|
|
1180
|
+
pattern: RegExp("(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])"),
|
|
1181
|
+
lookbehind: !0
|
|
1182
|
+
},
|
|
1183
|
+
operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
|
|
1184
|
+
}), n.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, n.languages.insertBefore("javascript", "keyword", {
|
|
1185
|
+
regex: {
|
|
1186
|
+
pattern: RegExp("((?:^|[^$\\w\\xA0-\\uFFFF.\"'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))"),
|
|
1187
|
+
lookbehind: !0,
|
|
1188
|
+
greedy: !0,
|
|
1189
|
+
inside: {
|
|
1190
|
+
"regex-source": {
|
|
1191
|
+
pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
|
|
1192
|
+
lookbehind: !0,
|
|
1193
|
+
alias: "language-regex",
|
|
1194
|
+
inside: n.languages.regex
|
|
1195
|
+
},
|
|
1196
|
+
"regex-delimiter": /^\/|\/$/,
|
|
1197
|
+
"regex-flags": /^[a-z]+$/
|
|
1198
|
+
}
|
|
1199
|
+
},
|
|
1200
|
+
"function-variable": {
|
|
1201
|
+
pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
|
|
1202
|
+
alias: "function"
|
|
1203
|
+
},
|
|
1204
|
+
parameter: [
|
|
1205
|
+
{
|
|
1206
|
+
pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
|
|
1207
|
+
lookbehind: !0,
|
|
1208
|
+
inside: n.languages.javascript
|
|
1209
|
+
},
|
|
1210
|
+
{
|
|
1211
|
+
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
|
|
1212
|
+
lookbehind: !0,
|
|
1213
|
+
inside: n.languages.javascript
|
|
1214
|
+
},
|
|
1215
|
+
{
|
|
1216
|
+
pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
|
|
1217
|
+
lookbehind: !0,
|
|
1218
|
+
inside: n.languages.javascript
|
|
1219
|
+
},
|
|
1220
|
+
{
|
|
1221
|
+
pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
|
|
1222
|
+
lookbehind: !0,
|
|
1223
|
+
inside: n.languages.javascript
|
|
1224
|
+
}
|
|
1225
|
+
],
|
|
1226
|
+
constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
|
|
1227
|
+
}), n.languages.insertBefore("javascript", "string", {
|
|
1228
|
+
hashbang: {
|
|
1229
|
+
pattern: /^#!.*/,
|
|
1230
|
+
greedy: !0,
|
|
1231
|
+
alias: "comment"
|
|
1232
|
+
},
|
|
1233
|
+
"template-string": {
|
|
1234
|
+
pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
|
|
1235
|
+
greedy: !0,
|
|
1236
|
+
inside: {
|
|
1237
|
+
"template-punctuation": {
|
|
1238
|
+
pattern: /^`|`$/,
|
|
1239
|
+
alias: "string"
|
|
1240
|
+
},
|
|
1241
|
+
interpolation: {
|
|
1242
|
+
pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
|
|
1243
|
+
lookbehind: !0,
|
|
1244
|
+
inside: {
|
|
1245
|
+
"interpolation-punctuation": {
|
|
1246
|
+
pattern: /^\$\{|\}$/,
|
|
1247
|
+
alias: "punctuation"
|
|
1248
|
+
},
|
|
1249
|
+
rest: n.languages.javascript
|
|
1250
|
+
}
|
|
1251
|
+
},
|
|
1252
|
+
string: /[\s\S]+/
|
|
1253
|
+
}
|
|
1254
|
+
},
|
|
1255
|
+
"string-property": {
|
|
1256
|
+
pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
|
|
1257
|
+
lookbehind: !0,
|
|
1258
|
+
greedy: !0,
|
|
1259
|
+
alias: "property"
|
|
1260
|
+
}
|
|
1261
|
+
}), n.languages.insertBefore("javascript", "operator", { "literal-property": {
|
|
1262
|
+
pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
|
|
1263
|
+
lookbehind: !0,
|
|
1264
|
+
alias: "property"
|
|
1265
|
+
} }), n.languages.markup && (n.languages.markup.tag.addInlined("script", "javascript"), n.languages.markup.tag.addAttribute("on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)", "javascript")), n.languages.js = n.languages.javascript, (function() {
|
|
1266
|
+
if (n === void 0 || typeof document > "u") return;
|
|
1267
|
+
Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
|
|
1268
|
+
var e = "Loading…", t = function(e, t) {
|
|
1269
|
+
return "✖ Error " + e + " while fetching file: " + t;
|
|
1270
|
+
}, r = "✖ Error: File does not exist or is empty", i = {
|
|
1271
|
+
js: "javascript",
|
|
1272
|
+
py: "python",
|
|
1273
|
+
rb: "ruby",
|
|
1274
|
+
ps1: "powershell",
|
|
1275
|
+
psm1: "powershell",
|
|
1276
|
+
sh: "bash",
|
|
1277
|
+
bat: "batch",
|
|
1278
|
+
h: "c",
|
|
1279
|
+
tex: "latex"
|
|
1280
|
+
}, a = "data-src-status", o = "loading", s = "loaded", c = "failed", l = "pre[data-src]:not([" + a + "=\"" + s + "\"]):not([" + a + "=\"" + o + "\"])";
|
|
1281
|
+
function u(e, n, i) {
|
|
1282
|
+
var a = new XMLHttpRequest();
|
|
1283
|
+
a.open("GET", e, !0), a.onreadystatechange = function() {
|
|
1284
|
+
a.readyState == 4 && (a.status < 400 && a.responseText ? n(a.responseText) : a.status >= 400 ? i(t(a.status, a.statusText)) : i(r));
|
|
1285
|
+
}, a.send(null);
|
|
1286
|
+
}
|
|
1287
|
+
function d(e) {
|
|
1288
|
+
var t = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e || "");
|
|
1289
|
+
if (t) {
|
|
1290
|
+
var n = Number(t[1]), r = t[2], i = t[3];
|
|
1291
|
+
return r ? i ? [n, Number(i)] : [n, void 0] : [n, n];
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
n.hooks.add("before-highlightall", function(e) {
|
|
1295
|
+
e.selector += ", " + l;
|
|
1296
|
+
}), n.hooks.add("before-sanity-check", function(t) {
|
|
1297
|
+
var r = t.element;
|
|
1298
|
+
if (r.matches(l)) {
|
|
1299
|
+
t.code = "", r.setAttribute(a, o);
|
|
1300
|
+
var f = r.appendChild(document.createElement("CODE"));
|
|
1301
|
+
f.textContent = e;
|
|
1302
|
+
var p = r.getAttribute("data-src"), m = t.language;
|
|
1303
|
+
if (m === "none") {
|
|
1304
|
+
var h = (/\.(\w+)$/.exec(p) || [, "none"])[1];
|
|
1305
|
+
m = i[h] || h;
|
|
1306
|
+
}
|
|
1307
|
+
n.util.setLanguage(f, m), n.util.setLanguage(r, m);
|
|
1308
|
+
var g = n.plugins.autoloader;
|
|
1309
|
+
g && g.loadLanguages(m), u(p, function(e) {
|
|
1310
|
+
r.setAttribute(a, s);
|
|
1311
|
+
var t = d(r.getAttribute("data-range"));
|
|
1312
|
+
if (t) {
|
|
1313
|
+
var i = e.split(/\r\n?|\n/g), o = t[0], c = t[1] == null ? i.length : t[1];
|
|
1314
|
+
o < 0 && (o += i.length), o = Math.max(0, Math.min(o - 1, i.length)), c < 0 && (c += i.length), c = Math.max(0, Math.min(c, i.length)), e = i.slice(o, c).join("\n"), r.hasAttribute("data-start") || r.setAttribute("data-start", String(o + 1));
|
|
1315
|
+
}
|
|
1316
|
+
f.textContent = e, n.highlightElement(f);
|
|
1317
|
+
}, function(e) {
|
|
1318
|
+
r.setAttribute(a, c), f.textContent = e;
|
|
1319
|
+
});
|
|
1320
|
+
}
|
|
1321
|
+
}), n.plugins.fileHighlight = { highlight: function(e) {
|
|
1322
|
+
for (var t = (e || document).querySelectorAll(l), r = 0, i; i = t[r++];) n.highlightElement(i);
|
|
1323
|
+
} };
|
|
1324
|
+
var f = !1;
|
|
1325
|
+
n.fileHighlight = function() {
|
|
1326
|
+
f ||= (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), !0), n.plugins.fileHighlight.highlight.apply(this, arguments);
|
|
1327
|
+
};
|
|
1328
|
+
})();
|
|
1329
|
+
})))(), 1);
|
|
1330
|
+
Prism.languages.javascript = Prism.languages.extend("clike", {
|
|
1331
|
+
"class-name": [Prism.languages.clike["class-name"], {
|
|
1332
|
+
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
|
|
1333
|
+
lookbehind: !0
|
|
1334
|
+
}],
|
|
1335
|
+
keyword: [{
|
|
1336
|
+
pattern: /((?:^|\})\s*)catch\b/,
|
|
1337
|
+
lookbehind: !0
|
|
1338
|
+
}, {
|
|
1339
|
+
pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
|
|
1340
|
+
lookbehind: !0
|
|
1341
|
+
}],
|
|
1342
|
+
function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
|
|
1343
|
+
number: {
|
|
1344
|
+
pattern: RegExp("(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])"),
|
|
1345
|
+
lookbehind: !0
|
|
1346
|
+
},
|
|
1347
|
+
operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
|
|
1348
|
+
}), Prism.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, Prism.languages.insertBefore("javascript", "keyword", {
|
|
1349
|
+
regex: {
|
|
1350
|
+
pattern: RegExp("((?:^|[^$\\w\\xA0-\\uFFFF.\"'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))"),
|
|
1351
|
+
lookbehind: !0,
|
|
1352
|
+
greedy: !0,
|
|
1353
|
+
inside: {
|
|
1354
|
+
"regex-source": {
|
|
1355
|
+
pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
|
|
1356
|
+
lookbehind: !0,
|
|
1357
|
+
alias: "language-regex",
|
|
1358
|
+
inside: Prism.languages.regex
|
|
1359
|
+
},
|
|
1360
|
+
"regex-delimiter": /^\/|\/$/,
|
|
1361
|
+
"regex-flags": /^[a-z]+$/
|
|
1362
|
+
}
|
|
1363
|
+
},
|
|
1364
|
+
"function-variable": {
|
|
1365
|
+
pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
|
|
1366
|
+
alias: "function"
|
|
1367
|
+
},
|
|
1368
|
+
parameter: [
|
|
1369
|
+
{
|
|
1370
|
+
pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
|
|
1371
|
+
lookbehind: !0,
|
|
1372
|
+
inside: Prism.languages.javascript
|
|
1373
|
+
},
|
|
1374
|
+
{
|
|
1375
|
+
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
|
|
1376
|
+
lookbehind: !0,
|
|
1377
|
+
inside: Prism.languages.javascript
|
|
1378
|
+
},
|
|
1379
|
+
{
|
|
1380
|
+
pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
|
|
1381
|
+
lookbehind: !0,
|
|
1382
|
+
inside: Prism.languages.javascript
|
|
1383
|
+
},
|
|
1384
|
+
{
|
|
1385
|
+
pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
|
|
1386
|
+
lookbehind: !0,
|
|
1387
|
+
inside: Prism.languages.javascript
|
|
1388
|
+
}
|
|
1389
|
+
],
|
|
1390
|
+
constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
|
|
1391
|
+
}), Prism.languages.insertBefore("javascript", "string", {
|
|
1392
|
+
hashbang: {
|
|
1393
|
+
pattern: /^#!.*/,
|
|
1394
|
+
greedy: !0,
|
|
1395
|
+
alias: "comment"
|
|
1396
|
+
},
|
|
1397
|
+
"template-string": {
|
|
1398
|
+
pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
|
|
1399
|
+
greedy: !0,
|
|
1400
|
+
inside: {
|
|
1401
|
+
"template-punctuation": {
|
|
1402
|
+
pattern: /^`|`$/,
|
|
1403
|
+
alias: "string"
|
|
1404
|
+
},
|
|
1405
|
+
interpolation: {
|
|
1406
|
+
pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
|
|
1407
|
+
lookbehind: !0,
|
|
1408
|
+
inside: {
|
|
1409
|
+
"interpolation-punctuation": {
|
|
1410
|
+
pattern: /^\$\{|\}$/,
|
|
1411
|
+
alias: "punctuation"
|
|
1412
|
+
},
|
|
1413
|
+
rest: Prism.languages.javascript
|
|
1414
|
+
}
|
|
1415
|
+
},
|
|
1416
|
+
string: /[\s\S]+/
|
|
1417
|
+
}
|
|
1418
|
+
},
|
|
1419
|
+
"string-property": {
|
|
1420
|
+
pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
|
|
1421
|
+
lookbehind: !0,
|
|
1422
|
+
greedy: !0,
|
|
1423
|
+
alias: "property"
|
|
1424
|
+
}
|
|
1425
|
+
}), Prism.languages.insertBefore("javascript", "operator", { "literal-property": {
|
|
1426
|
+
pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
|
|
1427
|
+
lookbehind: !0,
|
|
1428
|
+
alias: "property"
|
|
1429
|
+
} }), Prism.languages.markup && (Prism.languages.markup.tag.addInlined("script", "javascript"), Prism.languages.markup.tag.addAttribute("on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)", "javascript")), Prism.languages.js = Prism.languages.javascript, Prism.languages.json = {
|
|
1430
|
+
property: {
|
|
1431
|
+
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
|
|
1432
|
+
lookbehind: !0,
|
|
1433
|
+
greedy: !0
|
|
1434
|
+
},
|
|
1435
|
+
string: {
|
|
1436
|
+
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
|
|
1437
|
+
lookbehind: !0,
|
|
1438
|
+
greedy: !0
|
|
1439
|
+
},
|
|
1440
|
+
comment: {
|
|
1441
|
+
pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
|
|
1442
|
+
greedy: !0
|
|
1443
|
+
},
|
|
1444
|
+
number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
|
|
1445
|
+
punctuation: /[{}[\],]/,
|
|
1446
|
+
operator: /:/,
|
|
1447
|
+
boolean: /\b(?:false|true)\b/,
|
|
1448
|
+
null: {
|
|
1449
|
+
pattern: /\bnull\b/,
|
|
1450
|
+
alias: "keyword"
|
|
1451
|
+
}
|
|
1452
|
+
}, Prism.languages.webmanifest = Prism.languages.json;
|
|
1453
|
+
//#endregion
|
|
1454
|
+
//#region src/reinspect/syntaxHighlight.ts
|
|
1455
|
+
function St(e) {
|
|
1456
|
+
return e.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
1457
|
+
}
|
|
1458
|
+
function Ct(e) {
|
|
1459
|
+
return xt.languages[e] ?? null;
|
|
1460
|
+
}
|
|
1461
|
+
function wt(e, t) {
|
|
1462
|
+
let n = Ct(t);
|
|
1463
|
+
if (!n) return St(e);
|
|
1464
|
+
try {
|
|
1465
|
+
return xt.highlight(e, n, t);
|
|
1466
|
+
} catch {
|
|
1467
|
+
return St(e);
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
//#endregion
|
|
1471
|
+
//#region src/reinspect/react/overlay.tsx
|
|
1472
|
+
function Tt({ value: e }) {
|
|
1473
|
+
if (e.kind === "function" && e.functionMeta) {
|
|
1474
|
+
let t = e.functionMeta;
|
|
1475
|
+
return /* @__PURE__ */ d("div", {
|
|
1476
|
+
className: "reinspect-prop-function",
|
|
1477
|
+
children: [/* @__PURE__ */ u("code", { children: e.summary }), /* @__PURE__ */ u("pre", { children: /* @__PURE__ */ u("code", {
|
|
1478
|
+
className: "language-javascript reinspect-code-block",
|
|
1479
|
+
dangerouslySetInnerHTML: { __html: wt(t.preview, "javascript") }
|
|
1480
|
+
}) })]
|
|
1481
|
+
});
|
|
1482
|
+
}
|
|
1483
|
+
return /* @__PURE__ */ u("div", {
|
|
1484
|
+
className: "reinspect-prop-scalar",
|
|
1485
|
+
children: /* @__PURE__ */ u("code", { children: e.summary })
|
|
1486
|
+
});
|
|
1487
|
+
}
|
|
1488
|
+
function Et({ instanceId: e, counterMode: t }) {
|
|
1489
|
+
return /* @__PURE__ */ u(l, { children: bt(yt(e), t) });
|
|
1490
|
+
}
|
|
1491
|
+
//#endregion
|
|
1492
|
+
//#region src/reinspect/react/wrap.tsx
|
|
1493
|
+
var Dt = {
|
|
1494
|
+
enabled: !1,
|
|
1495
|
+
startActive: !1,
|
|
1496
|
+
showFloatingToggle: !1,
|
|
1497
|
+
inspectMode: "wrapped",
|
|
1498
|
+
inspectWhitelist: {
|
|
1499
|
+
patterns: [],
|
|
1500
|
+
regex: !1,
|
|
1501
|
+
wholeWord: !1,
|
|
1502
|
+
matchCase: !1
|
|
1503
|
+
},
|
|
1504
|
+
inspectBlacklist: {
|
|
1505
|
+
patterns: [],
|
|
1506
|
+
regex: !1,
|
|
1507
|
+
wholeWord: !1,
|
|
1508
|
+
matchCase: !1
|
|
1509
|
+
},
|
|
1510
|
+
editableProps: [],
|
|
1511
|
+
zIndexBase: 0,
|
|
1512
|
+
renderCounters: "off",
|
|
1513
|
+
countRendersForComponents: [],
|
|
1514
|
+
propsSerializationMode: "distilled",
|
|
1515
|
+
menuTheme: "light",
|
|
1516
|
+
menuOpenGesture: {
|
|
1517
|
+
mode: "right-click",
|
|
1518
|
+
modifiers: {
|
|
1519
|
+
ctrl: !1,
|
|
1520
|
+
alt: !1,
|
|
1521
|
+
shift: !0,
|
|
1522
|
+
meta: !1
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
}, Ot = 0, kt = 12, At = 560, jt = 620;
|
|
1526
|
+
function Mt(e) {
|
|
1527
|
+
return Ot += 1, `${e}-${Ot.toString(36)}`;
|
|
1528
|
+
}
|
|
1529
|
+
function Nt(e) {
|
|
1530
|
+
let t = e.replace(/([A-Z])/g, " $1").trim(), n = t.slice(0, 1);
|
|
1531
|
+
return t.length > 0 ? n.toUpperCase() + t.slice(1) : e;
|
|
1532
|
+
}
|
|
1533
|
+
function Pt(e) {
|
|
1534
|
+
return e.trim().toLowerCase().replace(/[\s_-]+/g, "");
|
|
1535
|
+
}
|
|
1536
|
+
function Ft(e) {
|
|
1537
|
+
return e != null && e !== "";
|
|
1538
|
+
}
|
|
1539
|
+
function It(e) {
|
|
1540
|
+
return e.replace(/[^a-zA-Z0-9_-]/g, "-");
|
|
1541
|
+
}
|
|
1542
|
+
function Lt(e) {
|
|
1543
|
+
return e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
1544
|
+
}
|
|
1545
|
+
function Rt(e) {
|
|
1546
|
+
if (!e) return !0;
|
|
1547
|
+
let t = e.trim().toLowerCase();
|
|
1548
|
+
if (t === "transparent") return !0;
|
|
1549
|
+
let n = t.match(/^rgba?\((.+)\)$/i);
|
|
1550
|
+
if (!n) return !1;
|
|
1551
|
+
let [, r = ""] = n, i = r.replace(/\//g, " ").split(/[,\s]+/).filter((e) => e.length > 0);
|
|
1552
|
+
if (i.length < 4) return !1;
|
|
1553
|
+
let a = i[3];
|
|
1554
|
+
if (!a) return !1;
|
|
1555
|
+
let o = a.endsWith("%") ? Number(a.slice(0, -1)) / 100 : Number(a);
|
|
1556
|
+
return Number.isFinite(o) && o <= 0;
|
|
1557
|
+
}
|
|
1558
|
+
function zt(e, t, n) {
|
|
1559
|
+
if (typeof window > "u") return e;
|
|
1560
|
+
let r = kt, i = kt, a = Math.max(r, window.innerWidth - t - kt), o = Math.max(i, window.innerHeight - n - kt);
|
|
1561
|
+
return {
|
|
1562
|
+
x: Math.min(Math.max(e.x, r), a),
|
|
1563
|
+
y: Math.min(Math.max(e.y, i), o)
|
|
1564
|
+
};
|
|
1565
|
+
}
|
|
1566
|
+
function Bt(e, t) {
|
|
1567
|
+
return e.includes(t) ? [...e] : [...e, t];
|
|
1568
|
+
}
|
|
1569
|
+
function Vt(e, t) {
|
|
1570
|
+
return e.includes(t) ? e.filter((e) => e !== t) : Bt(e, t);
|
|
1571
|
+
}
|
|
1572
|
+
function Ht(e, t) {
|
|
1573
|
+
if (t.mode === "right-click") return !0;
|
|
1574
|
+
let n = t.modifiers;
|
|
1575
|
+
return !(n.ctrl && !e.ctrlKey || n.alt && !e.altKey || n.shift && !e.shiftKey || n.meta && !e.metaKey);
|
|
1576
|
+
}
|
|
1577
|
+
function Ut() {
|
|
1578
|
+
return /* @__PURE__ */ u("svg", {
|
|
1579
|
+
viewBox: "0 0 16 16",
|
|
1580
|
+
"aria-hidden": "true",
|
|
1581
|
+
focusable: "false",
|
|
1582
|
+
children: /* @__PURE__ */ u("path", {
|
|
1583
|
+
d: "M5.5 1.75A1.75 1.75 0 0 0 3.75 3.5v7c0 .966.784 1.75 1.75 1.75h7a1.75 1.75 0 0 0 1.75-1.75v-7a1.75 1.75 0 0 0-1.75-1.75h-7Zm-.25 1.75c0-.138.112-.25.25-.25h7c.138 0 .25.112.25.25v7a.25.25 0 0 1-.25.25h-7a.25.25 0 0 1-.25-.25v-7ZM1.75 6.5a.75.75 0 0 1 1.5 0v6c0 .966.784 1.75 1.75 1.75h6a.75.75 0 0 1 0 1.5h-6A3.25 3.25 0 0 1 1.75 12.5v-6Z",
|
|
1584
|
+
fill: "currentColor"
|
|
1585
|
+
})
|
|
1586
|
+
});
|
|
1587
|
+
}
|
|
1588
|
+
function Wt() {
|
|
1589
|
+
return /* @__PURE__ */ u("svg", {
|
|
1590
|
+
viewBox: "0 0 16 16",
|
|
1591
|
+
"aria-hidden": "true",
|
|
1592
|
+
focusable: "false",
|
|
1593
|
+
children: /* @__PURE__ */ u("path", {
|
|
1594
|
+
d: "M11.86 1.52a1.8 1.8 0 0 1 2.55 2.55l-7.12 7.12a.75.75 0 0 1-.35.2l-3 0a.75.75 0 0 1-.75-.75l0-3a.75.75 0 0 1 .2-.35l7.12-7.12Zm1.49 1.06a.3.3 0 0 0-.43 0L6.1 9.4l-.16.5.5-.16 6.82-6.82a.3.3 0 0 0 0-.43l.09.09Z",
|
|
1595
|
+
fill: "currentColor"
|
|
1596
|
+
})
|
|
1597
|
+
});
|
|
1598
|
+
}
|
|
1599
|
+
function Gt(e) {
|
|
1600
|
+
return Array.isArray(e) || typeof e == "object" && !!e;
|
|
1601
|
+
}
|
|
1602
|
+
async function Kt(e) {
|
|
1603
|
+
if (typeof navigator > "u" || !navigator.clipboard?.writeText) return !1;
|
|
1604
|
+
try {
|
|
1605
|
+
return await navigator.clipboard.writeText(e), !0;
|
|
1606
|
+
} catch {
|
|
1607
|
+
return !1;
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
function qt(e, t) {
|
|
1611
|
+
return t?.componentName?.trim() || e.displayName?.trim() || e.name?.trim() || t?.fallbackName?.trim() || "Component";
|
|
1612
|
+
}
|
|
1613
|
+
function Jt(e, t, n) {
|
|
1614
|
+
return e === "manual" || n === "all" || n === "first-party" && t === "first-party";
|
|
1615
|
+
}
|
|
1616
|
+
function Yt(t, n) {
|
|
1617
|
+
let c = n?.source ?? "manual", p = n?.scope ?? "first-party", m = lt(t);
|
|
1618
|
+
if (m && c === "auto") return t;
|
|
1619
|
+
let h = m && c === "manual" ? m.original : t, g = qt(h, n);
|
|
1620
|
+
function _(t) {
|
|
1621
|
+
let n = o(null), m = o(null), _ = o(null), v = o(null), ee = o(null), te = o(!1), [y, x] = s(null), [S, C] = s("css"), [T, E] = s("detected"), [O, k] = s(""), [ie, A] = s({}), [j, M] = s("{}"), [ae, N] = s(null), [oe, P] = s(null), [se, F] = s({}), [ce, le] = s({}), [ue, I] = s({}), [L, R] = s(null), [de, z] = s(""), [fe, B] = s(null), [V, H] = s(null), [U, pe] = s({}), W = r(b), me = !!W, G = W?.config ?? Dt, he = W?.getColor ?? (() => "var(--reinspect-brand-500)"), ge = W?.menuTheme ?? "light", _e = W?.menuOpenGesture ?? Dt.menuOpenGesture, ve = W?.isActive ?? !1, ye = W?.inspectMode ?? "wrapped", be = W?.renderCounterMode ?? Dt.renderCounters, K = W?.propsSerializationMode ?? Dt.propsSerializationMode, xe = W?.overrides ?? {}, q = W?.updateOverride ?? (() => void 0), Se = W?.renderCountComponents ?? {}, Ce = W?.setRenderCountingForComponent ?? (() => void 0), we = W?.setInspectWhitelist ?? (() => void 0), Te = W?.inspectWhitelist ?? Dt.inspectWhitelist, Ee = W?.setInspectBlacklist ?? (() => void 0), De = W?.isRenderCountingEnabledFor ?? (() => !1);
|
|
1622
|
+
n.current ||= Mt(g);
|
|
1623
|
+
let J = n.current, Oe = he(g), ke = Jt(c, p, ye), Ae = W?.isComponentInspectableByFilters(g) ?? !0, Y = G.enabled && ve && ke && Ae, Me = Y && De(g), Ne = !!Se[g], X = be !== "off", Pe = be === "off" ? "attempts" : be, Le = Me, Re = xe[J], ze = Y ? je(Re, G.editableProps) : {}, Be = {
|
|
1624
|
+
...t,
|
|
1625
|
+
...ie
|
|
1626
|
+
}, Ve = Be, Z = y !== null, Q = Pt(O), He = Q.length === 0 ? G.editableProps : G.editableProps.filter((e) => Pt(e).includes(Q)), Ue = Z && S === "props" && T === "detected" ? nt(Ve) : [], We = o(Le);
|
|
1627
|
+
i(() => {
|
|
1628
|
+
We.current = Le;
|
|
1629
|
+
}, [Le]);
|
|
1630
|
+
let Ge = a(() => (e, t) => {
|
|
1631
|
+
t === "mount" || !We.current || ht(J);
|
|
1632
|
+
}, [J]);
|
|
1633
|
+
i(() => () => {
|
|
1634
|
+
_t(J);
|
|
1635
|
+
}, [J]), i(() => {
|
|
1636
|
+
if (!Z) return;
|
|
1637
|
+
let e = (e) => {
|
|
1638
|
+
let t = e.target;
|
|
1639
|
+
_.current?.contains(t) || v.current?.contains(t) || (x(null), R(null), z(""), B(null));
|
|
1640
|
+
}, t = (e) => {
|
|
1641
|
+
if (e.key === "Escape") {
|
|
1642
|
+
if (L) {
|
|
1643
|
+
R(null), z(""), B(null);
|
|
1644
|
+
return;
|
|
1645
|
+
}
|
|
1646
|
+
x(null);
|
|
1647
|
+
}
|
|
1648
|
+
};
|
|
1649
|
+
return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
|
|
1650
|
+
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
|
|
1651
|
+
};
|
|
1652
|
+
}, [L, Z]), i(() => {
|
|
1653
|
+
Z && (G.enabled && ve && ke || (x(null), R(null), z(""), B(null)));
|
|
1654
|
+
}, [
|
|
1655
|
+
G.enabled,
|
|
1656
|
+
ke,
|
|
1657
|
+
ve,
|
|
1658
|
+
Z
|
|
1659
|
+
]), i(() => {
|
|
1660
|
+
if (!oe) return;
|
|
1661
|
+
let e = globalThis.setTimeout(() => {
|
|
1662
|
+
P(null);
|
|
1663
|
+
}, 1400);
|
|
1664
|
+
return () => {
|
|
1665
|
+
globalThis.clearTimeout(e);
|
|
1666
|
+
};
|
|
1667
|
+
}, [oe]), i(() => {
|
|
1668
|
+
if (!V) return;
|
|
1669
|
+
let e = globalThis.setTimeout(() => {
|
|
1670
|
+
H(null);
|
|
1671
|
+
}, 5e3);
|
|
1672
|
+
return () => {
|
|
1673
|
+
globalThis.clearTimeout(e);
|
|
1674
|
+
};
|
|
1675
|
+
}, [V]), i(() => {
|
|
1676
|
+
if (!Z || !y || !_.current) return;
|
|
1677
|
+
let e = _.current.getBoundingClientRect(), t = zt(y, e.width, e.height);
|
|
1678
|
+
(t.x !== y.x || t.y !== y.y) && x(t);
|
|
1679
|
+
}, [Z, y]), i(() => {
|
|
1680
|
+
if (!Z || L || !_.current) return;
|
|
1681
|
+
let e = _.current;
|
|
1682
|
+
w(e);
|
|
1683
|
+
let t = (t) => {
|
|
1684
|
+
ne(t, e);
|
|
1685
|
+
};
|
|
1686
|
+
return document.addEventListener("keydown", t), () => {
|
|
1687
|
+
document.removeEventListener("keydown", t);
|
|
1688
|
+
};
|
|
1689
|
+
}, [Z, L]), i(() => {
|
|
1690
|
+
if (!L || !v.current) return;
|
|
1691
|
+
let e = v.current;
|
|
1692
|
+
w(e);
|
|
1693
|
+
let t = (t) => {
|
|
1694
|
+
ne(t, e);
|
|
1695
|
+
};
|
|
1696
|
+
return document.addEventListener("keydown", t), () => {
|
|
1697
|
+
document.removeEventListener("keydown", t), _.current?.focus();
|
|
1698
|
+
};
|
|
1699
|
+
}, [L]), i(() => {
|
|
1700
|
+
te.current && !Z && m.current?.focus(), te.current = Z;
|
|
1701
|
+
}, [Z]);
|
|
1702
|
+
let Ke = {
|
|
1703
|
+
"--reinspect-color": Oe,
|
|
1704
|
+
"--reinspect-z-base": G.zIndexBase
|
|
1705
|
+
}, qe = (e) => {
|
|
1706
|
+
if (typeof window > "u") return {};
|
|
1707
|
+
let t = e.currentTarget.querySelector("[data-reinspect-content=\"true\"]"), n = e.target, r = null;
|
|
1708
|
+
if (n instanceof HTMLElement && t?.contains(n) && (r = n), !r && t?.firstElementChild instanceof HTMLElement && (r = t.firstElementChild), !r && t instanceof HTMLElement && (r = t), !r) return {};
|
|
1709
|
+
let i = window.getComputedStyle(r), a = {}, o = () => {
|
|
1710
|
+
let e = r;
|
|
1711
|
+
for (; e;) {
|
|
1712
|
+
let t = window.getComputedStyle(e).backgroundColor.trim();
|
|
1713
|
+
if (!Rt(t)) return t;
|
|
1714
|
+
e = e.parentElement;
|
|
1715
|
+
}
|
|
1716
|
+
let t = window.getComputedStyle(document.documentElement).backgroundColor.trim();
|
|
1717
|
+
return Rt(t) ? "rgb(255 255 255)" : t;
|
|
1718
|
+
};
|
|
1719
|
+
for (let e of G.editableProps) {
|
|
1720
|
+
let t = Lt(e), n = e === "backgroundColor" ? o() : i.getPropertyValue(t).trim();
|
|
1721
|
+
n.length > 0 && (a[e] = n);
|
|
1722
|
+
}
|
|
1723
|
+
return a;
|
|
1724
|
+
}, Je = (e) => {
|
|
1725
|
+
if (!e) return;
|
|
1726
|
+
let t = e.trim().match(/-?\d*\.?\d+/);
|
|
1727
|
+
if (t?.[0]) return Ie(t[0]);
|
|
1728
|
+
}, Ye = (e) => {
|
|
1729
|
+
Y && Ht(e, _e) && (e.preventDefault(), C("general"), E("detected"), k(""), N(null), P(null), F({}), le({}), I({}), R(null), z(""), B(null), M("{}"), pe(qe(e)), x(zt({
|
|
1730
|
+
x: e.clientX,
|
|
1731
|
+
y: e.clientY
|
|
1732
|
+
}, At, jt)));
|
|
1733
|
+
}, Xe = () => {
|
|
1734
|
+
let { parsed: e, error: t } = st(j);
|
|
1735
|
+
if (t || !e) {
|
|
1736
|
+
N(t);
|
|
1737
|
+
return;
|
|
1738
|
+
}
|
|
1739
|
+
A(e), F({}), le({}), I({}), N(null);
|
|
1740
|
+
}, Ze = () => {
|
|
1741
|
+
A({}), T === "raw" && M(rt(t, { mode: K })), N(null);
|
|
1742
|
+
}, Qe = (e, t) => {
|
|
1743
|
+
Kt(e).then((e) => {
|
|
1744
|
+
P(e ? `${t} copied.` : "Clipboard access is unavailable.");
|
|
1745
|
+
});
|
|
1746
|
+
}, $e = (e, t) => {
|
|
1747
|
+
let n = se[e], r = n ?? it(t, { mode: K });
|
|
1748
|
+
if (!r) {
|
|
1749
|
+
P("JSON preview is unavailable for this value.");
|
|
1750
|
+
return;
|
|
1751
|
+
}
|
|
1752
|
+
n || F((t) => ({
|
|
1753
|
+
...t,
|
|
1754
|
+
[e]: r
|
|
1755
|
+
})), Qe(r, "JSON value");
|
|
1756
|
+
}, et = (e, t) => {
|
|
1757
|
+
if (ue[e]) {
|
|
1758
|
+
I((t) => ({
|
|
1759
|
+
...t,
|
|
1760
|
+
[e]: !1
|
|
1761
|
+
}));
|
|
1762
|
+
return;
|
|
1763
|
+
}
|
|
1764
|
+
if (!(e in se) && !(e in ce)) {
|
|
1765
|
+
let n = it(t, { mode: K });
|
|
1766
|
+
n === null ? le((t) => ({
|
|
1767
|
+
...t,
|
|
1768
|
+
[e]: "JSON preview is unavailable for this value."
|
|
1769
|
+
})) : F((t) => ({
|
|
1770
|
+
...t,
|
|
1771
|
+
[e]: n
|
|
1772
|
+
}));
|
|
1773
|
+
}
|
|
1774
|
+
I((t) => ({
|
|
1775
|
+
...t,
|
|
1776
|
+
[e]: !0
|
|
1777
|
+
}));
|
|
1778
|
+
}, tt = (e, t) => {
|
|
1779
|
+
if (!at(t)) return;
|
|
1780
|
+
let n = it(t, { mode: K });
|
|
1781
|
+
if (n === null) {
|
|
1782
|
+
P("Unable to open editor for this value.");
|
|
1783
|
+
return;
|
|
1784
|
+
}
|
|
1785
|
+
R(e), z(n), B(null);
|
|
1786
|
+
}, ct = () => {
|
|
1787
|
+
if (!L) return;
|
|
1788
|
+
let e = L, { parsed: t, error: n } = ot(de);
|
|
1789
|
+
if (n || t === null) {
|
|
1790
|
+
B(n);
|
|
1791
|
+
return;
|
|
1792
|
+
}
|
|
1793
|
+
let r = Gt(t), i = r ? it(t, { mode: K }) : null;
|
|
1794
|
+
A((n) => ({
|
|
1795
|
+
...n,
|
|
1796
|
+
[e]: t
|
|
1797
|
+
})), F((t) => {
|
|
1798
|
+
if (i === null) {
|
|
1799
|
+
if (!(e in t)) return t;
|
|
1800
|
+
let n = { ...t };
|
|
1801
|
+
return delete n[e], n;
|
|
1802
|
+
}
|
|
1803
|
+
return t[e] === i ? t : {
|
|
1804
|
+
...t,
|
|
1805
|
+
[e]: i
|
|
1806
|
+
};
|
|
1807
|
+
}), le((t) => {
|
|
1808
|
+
let n = "JSON preview is unavailable for this value.";
|
|
1809
|
+
if (r && i === null) return t[e] === n ? t : {
|
|
1810
|
+
...t,
|
|
1811
|
+
[e]: n
|
|
1812
|
+
};
|
|
1813
|
+
if (!(e in t)) return t;
|
|
1814
|
+
let a = { ...t };
|
|
1815
|
+
return delete a[e], a;
|
|
1816
|
+
}), I((t) => r || !t[e] ? t : {
|
|
1817
|
+
...t,
|
|
1818
|
+
[e]: !1
|
|
1819
|
+
}), R(null), z(""), B(null);
|
|
1820
|
+
}, lt = () => {
|
|
1821
|
+
we((e) => ({
|
|
1822
|
+
...e,
|
|
1823
|
+
patterns: Vt(e.patterns, g)
|
|
1824
|
+
}));
|
|
1825
|
+
}, ut = Te.patterns.includes(g), dt = () => {
|
|
1826
|
+
Ee((e) => ({
|
|
1827
|
+
...e,
|
|
1828
|
+
patterns: Bt(e.patterns, g)
|
|
1829
|
+
})), x(null), H({ componentName: g });
|
|
1830
|
+
}, ft = () => {
|
|
1831
|
+
V && (Ee((e) => ({
|
|
1832
|
+
...e,
|
|
1833
|
+
patterns: e.patterns.filter((e) => e !== V.componentName)
|
|
1834
|
+
})), H(null));
|
|
1835
|
+
}, $ = Z ? /* @__PURE__ */ d("div", {
|
|
1836
|
+
ref: _,
|
|
1837
|
+
className: "reinspect-menu",
|
|
1838
|
+
"data-reinspect-theme": ge,
|
|
1839
|
+
role: "dialog",
|
|
1840
|
+
"aria-modal": "true",
|
|
1841
|
+
"aria-label": `${g} controls`,
|
|
1842
|
+
tabIndex: -1,
|
|
1843
|
+
onMouseDown: (e) => {
|
|
1844
|
+
e.stopPropagation();
|
|
1845
|
+
},
|
|
1846
|
+
onClick: (e) => {
|
|
1847
|
+
e.stopPropagation();
|
|
1848
|
+
},
|
|
1849
|
+
onContextMenu: (e) => {
|
|
1850
|
+
e.preventDefault(), e.stopPropagation();
|
|
1851
|
+
},
|
|
1852
|
+
style: {
|
|
1853
|
+
top: `${y.y}px`,
|
|
1854
|
+
left: `${y.x}px`,
|
|
1855
|
+
"--reinspect-color": Oe
|
|
1856
|
+
},
|
|
1857
|
+
children: [
|
|
1858
|
+
/* @__PURE__ */ d("div", {
|
|
1859
|
+
className: "reinspect-menu-header",
|
|
1860
|
+
children: [/* @__PURE__ */ d("div", {
|
|
1861
|
+
className: "reinspect-menu-title-wrap",
|
|
1862
|
+
children: [/* @__PURE__ */ d("div", {
|
|
1863
|
+
className: "reinspect-menu-title-row",
|
|
1864
|
+
children: [/* @__PURE__ */ u("p", {
|
|
1865
|
+
className: "reinspect-menu-title",
|
|
1866
|
+
children: g
|
|
1867
|
+
}), /* @__PURE__ */ u("span", {
|
|
1868
|
+
className: "reinspect-menu-title-color-chip",
|
|
1869
|
+
"aria-hidden": "true",
|
|
1870
|
+
title: `${g} color`
|
|
1871
|
+
})]
|
|
1872
|
+
}), /* @__PURE__ */ u("p", {
|
|
1873
|
+
className: "reinspect-menu-subtitle",
|
|
1874
|
+
children: "Component controls"
|
|
1875
|
+
})]
|
|
1876
|
+
}), /* @__PURE__ */ u("button", {
|
|
1877
|
+
type: "button",
|
|
1878
|
+
className: "reinspect-menu-close",
|
|
1879
|
+
"aria-label": `Close ${g} controls`,
|
|
1880
|
+
"data-testid": `reinspect-menu-close-${g}`,
|
|
1881
|
+
onClick: () => x(null),
|
|
1882
|
+
children: "×"
|
|
1883
|
+
})]
|
|
1884
|
+
}),
|
|
1885
|
+
/* @__PURE__ */ d("div", {
|
|
1886
|
+
className: "reinspect-submenu",
|
|
1887
|
+
"aria-label": `${g} menu panels`,
|
|
1888
|
+
children: [
|
|
1889
|
+
/* @__PURE__ */ u("button", {
|
|
1890
|
+
type: "button",
|
|
1891
|
+
"data-state": S === "general" ? "active" : "idle",
|
|
1892
|
+
onClick: () => C("general"),
|
|
1893
|
+
children: "General"
|
|
1894
|
+
}),
|
|
1895
|
+
/* @__PURE__ */ u("button", {
|
|
1896
|
+
type: "button",
|
|
1897
|
+
"data-state": S === "css" ? "active" : "idle",
|
|
1898
|
+
onClick: () => C("css"),
|
|
1899
|
+
children: "CSS"
|
|
1900
|
+
}),
|
|
1901
|
+
/* @__PURE__ */ u("button", {
|
|
1902
|
+
type: "button",
|
|
1903
|
+
"data-state": S === "props" ? "active" : "idle",
|
|
1904
|
+
onClick: () => C("props"),
|
|
1905
|
+
children: "Props"
|
|
1906
|
+
})
|
|
1907
|
+
]
|
|
1908
|
+
}),
|
|
1909
|
+
S === "general" ? /* @__PURE__ */ u("div", {
|
|
1910
|
+
className: "reinspect-general-panel",
|
|
1911
|
+
children: /* @__PURE__ */ d("section", {
|
|
1912
|
+
className: "reinspect-menu-section",
|
|
1913
|
+
children: [
|
|
1914
|
+
/* @__PURE__ */ d("div", {
|
|
1915
|
+
className: "reinspect-menu-section-header",
|
|
1916
|
+
children: [/* @__PURE__ */ u("p", {
|
|
1917
|
+
className: "reinspect-menu-section-title",
|
|
1918
|
+
children: "Quick filters"
|
|
1919
|
+
}), /* @__PURE__ */ u("p", {
|
|
1920
|
+
className: "reinspect-menu-section-caption",
|
|
1921
|
+
children: g
|
|
1922
|
+
})]
|
|
1923
|
+
}),
|
|
1924
|
+
/* @__PURE__ */ u("p", {
|
|
1925
|
+
className: "reinspect-menu-section-description",
|
|
1926
|
+
children: "Focus inspection on this component type, or hide this type from inspection."
|
|
1927
|
+
}),
|
|
1928
|
+
/* @__PURE__ */ d("div", {
|
|
1929
|
+
className: "reinspect-menu-shortcuts",
|
|
1930
|
+
children: [/* @__PURE__ */ d("button", {
|
|
1931
|
+
type: "button",
|
|
1932
|
+
className: "reinspect-menu-action-card",
|
|
1933
|
+
onClick: lt,
|
|
1934
|
+
"data-testid": `reinspect-include-component-${g}`,
|
|
1935
|
+
"data-state": ut ? "active" : "idle",
|
|
1936
|
+
"aria-label": `Only inspect ${g} components`,
|
|
1937
|
+
children: [
|
|
1938
|
+
/* @__PURE__ */ u("span", {
|
|
1939
|
+
className: "reinspect-menu-action-title",
|
|
1940
|
+
children: "Show only this component type"
|
|
1941
|
+
}),
|
|
1942
|
+
/* @__PURE__ */ u("span", {
|
|
1943
|
+
className: "reinspect-menu-action-description",
|
|
1944
|
+
children: "Keeps all matching instances inspectable and hides other types."
|
|
1945
|
+
}),
|
|
1946
|
+
/* @__PURE__ */ u("code", {
|
|
1947
|
+
className: "reinspect-menu-action-target",
|
|
1948
|
+
children: g
|
|
1949
|
+
})
|
|
1950
|
+
]
|
|
1951
|
+
}), /* @__PURE__ */ d("button", {
|
|
1952
|
+
type: "button",
|
|
1953
|
+
className: "reinspect-menu-action-card",
|
|
1954
|
+
onClick: dt,
|
|
1955
|
+
"data-testid": `reinspect-exclude-component-${g}`,
|
|
1956
|
+
"aria-label": `Hide ${g} components from inspection`,
|
|
1957
|
+
children: [
|
|
1958
|
+
/* @__PURE__ */ u("span", {
|
|
1959
|
+
className: "reinspect-menu-action-title",
|
|
1960
|
+
children: "Hide this component type"
|
|
1961
|
+
}),
|
|
1962
|
+
/* @__PURE__ */ u("span", {
|
|
1963
|
+
className: "reinspect-menu-action-description",
|
|
1964
|
+
children: "Removes matching instances from inspection overlays."
|
|
1965
|
+
}),
|
|
1966
|
+
/* @__PURE__ */ u("code", {
|
|
1967
|
+
className: "reinspect-menu-action-target",
|
|
1968
|
+
children: g
|
|
1969
|
+
})
|
|
1970
|
+
]
|
|
1971
|
+
})]
|
|
1972
|
+
}),
|
|
1973
|
+
/* @__PURE__ */ u("div", { className: "reinspect-menu-divider" }),
|
|
1974
|
+
/* @__PURE__ */ d("div", {
|
|
1975
|
+
className: "reinspect-menu-inline-setting",
|
|
1976
|
+
children: [/* @__PURE__ */ d("div", {
|
|
1977
|
+
className: "reinspect-menu-inline-copy",
|
|
1978
|
+
children: [/* @__PURE__ */ u("p", {
|
|
1979
|
+
className: "reinspect-menu-inline-title",
|
|
1980
|
+
children: "Capture renders"
|
|
1981
|
+
}), /* @__PURE__ */ u("p", {
|
|
1982
|
+
className: "reinspect-menu-inline-description",
|
|
1983
|
+
children: "Track rerender attempts and commits for this component."
|
|
1984
|
+
})]
|
|
1985
|
+
}), /* @__PURE__ */ u("button", {
|
|
1986
|
+
type: "button",
|
|
1987
|
+
role: "switch",
|
|
1988
|
+
"aria-checked": X ? !0 : Ne,
|
|
1989
|
+
onClick: () => Ce(g, !Ne),
|
|
1990
|
+
disabled: X,
|
|
1991
|
+
"aria-label": `Capture renders for ${g}`,
|
|
1992
|
+
"data-testid": `reinspect-component-render-toggle-${g}`,
|
|
1993
|
+
className: "reinspect-switch-button reinspect-menu-switch",
|
|
1994
|
+
"data-state": X || Ne ? "on" : "off"
|
|
1995
|
+
})]
|
|
1996
|
+
}),
|
|
1997
|
+
X ? /* @__PURE__ */ u("p", {
|
|
1998
|
+
className: "reinspect-setting-note",
|
|
1999
|
+
children: "Global render capture is enabled in settings."
|
|
2000
|
+
}) : null
|
|
2001
|
+
]
|
|
2002
|
+
})
|
|
2003
|
+
}) : null,
|
|
2004
|
+
S === "css" ? /* @__PURE__ */ d("div", {
|
|
2005
|
+
className: "reinspect-css-panel",
|
|
2006
|
+
children: [
|
|
2007
|
+
/* @__PURE__ */ d("div", {
|
|
2008
|
+
className: "reinspect-menu-panel-header",
|
|
2009
|
+
children: [/* @__PURE__ */ u("p", {
|
|
2010
|
+
className: "reinspect-menu-section-title",
|
|
2011
|
+
children: "Editable styles"
|
|
2012
|
+
}), /* @__PURE__ */ d("p", {
|
|
2013
|
+
className: "reinspect-menu-section-caption",
|
|
2014
|
+
children: [
|
|
2015
|
+
He.length,
|
|
2016
|
+
"/",
|
|
2017
|
+
G.editableProps.length
|
|
2018
|
+
]
|
|
2019
|
+
})]
|
|
2020
|
+
}),
|
|
2021
|
+
/* @__PURE__ */ d("div", {
|
|
2022
|
+
className: "reinspect-menu-filter",
|
|
2023
|
+
children: [
|
|
2024
|
+
/* @__PURE__ */ u("span", {
|
|
2025
|
+
className: "reinspect-menu-filter-icon",
|
|
2026
|
+
"aria-hidden": "true",
|
|
2027
|
+
children: /* @__PURE__ */ u("svg", {
|
|
2028
|
+
viewBox: "0 0 24 24",
|
|
2029
|
+
focusable: "false",
|
|
2030
|
+
children: /* @__PURE__ */ u("path", {
|
|
2031
|
+
d: "M10.5 3a7.5 7.5 0 015.92 12.1l4.24 4.23a1 1 0 01-1.42 1.42l-4.23-4.24A7.5 7.5 0 1110.5 3zm0 2a5.5 5.5 0 100 11 5.5 5.5 0 000-11z",
|
|
2032
|
+
fill: "currentColor"
|
|
2033
|
+
})
|
|
2034
|
+
})
|
|
2035
|
+
}),
|
|
2036
|
+
/* @__PURE__ */ u("input", {
|
|
2037
|
+
id: `${J}-css-filter`,
|
|
2038
|
+
"data-testid": "reinspect-css-filter-input",
|
|
2039
|
+
type: "search",
|
|
2040
|
+
value: O,
|
|
2041
|
+
placeholder: "Filter",
|
|
2042
|
+
"aria-label": "Filter CSS properties",
|
|
2043
|
+
onChange: (e) => k(e.currentTarget.value)
|
|
2044
|
+
}),
|
|
2045
|
+
O.trim().length > 0 ? /* @__PURE__ */ u("button", {
|
|
2046
|
+
type: "button",
|
|
2047
|
+
className: "reinspect-menu-filter-clear",
|
|
2048
|
+
onClick: () => k(""),
|
|
2049
|
+
"aria-label": "Clear CSS filter",
|
|
2050
|
+
children: "Clear"
|
|
2051
|
+
}) : null
|
|
2052
|
+
]
|
|
2053
|
+
}),
|
|
2054
|
+
/* @__PURE__ */ u("div", {
|
|
2055
|
+
className: "reinspect-menu-grid",
|
|
2056
|
+
children: He.map((e) => {
|
|
2057
|
+
let t = Re?.[e], n = `${J}-${e}`;
|
|
2058
|
+
if (D.has(e)) {
|
|
2059
|
+
let r = Fe(typeof t == "string" ? t : U[e]);
|
|
2060
|
+
return /* @__PURE__ */ d("div", {
|
|
2061
|
+
className: "reinspect-field",
|
|
2062
|
+
children: [/* @__PURE__ */ u("label", {
|
|
2063
|
+
htmlFor: n,
|
|
2064
|
+
children: Nt(e)
|
|
2065
|
+
}), /* @__PURE__ */ d("div", {
|
|
2066
|
+
className: "reinspect-inline-controls",
|
|
2067
|
+
children: [/* @__PURE__ */ u("input", {
|
|
2068
|
+
id: n,
|
|
2069
|
+
type: "color",
|
|
2070
|
+
value: r,
|
|
2071
|
+
onChange: (t) => q(J, e, t.currentTarget.value)
|
|
2072
|
+
}), /* @__PURE__ */ u("button", {
|
|
2073
|
+
type: "button",
|
|
2074
|
+
onClick: () => q(J, e, void 0),
|
|
2075
|
+
disabled: !Ft(t),
|
|
2076
|
+
children: "reset"
|
|
2077
|
+
})]
|
|
2078
|
+
})]
|
|
2079
|
+
}, e);
|
|
2080
|
+
}
|
|
2081
|
+
if (e === "opacity") {
|
|
2082
|
+
let r = typeof t == "number" ? t : Je(U[e]) ?? 1;
|
|
2083
|
+
return /* @__PURE__ */ d("div", {
|
|
2084
|
+
className: "reinspect-field",
|
|
2085
|
+
children: [/* @__PURE__ */ u("label", {
|
|
2086
|
+
htmlFor: n,
|
|
2087
|
+
children: "Opacity"
|
|
2088
|
+
}), /* @__PURE__ */ d("div", {
|
|
2089
|
+
className: "reinspect-inline-controls reinspect-opacity-controls",
|
|
2090
|
+
children: [
|
|
2091
|
+
/* @__PURE__ */ u("input", {
|
|
2092
|
+
id: n,
|
|
2093
|
+
type: "range",
|
|
2094
|
+
min: "0",
|
|
2095
|
+
max: "1",
|
|
2096
|
+
step: "0.05",
|
|
2097
|
+
value: r,
|
|
2098
|
+
onChange: (t) => {
|
|
2099
|
+
let n = Ie(t.currentTarget.value);
|
|
2100
|
+
n !== void 0 && q(J, e, n);
|
|
2101
|
+
}
|
|
2102
|
+
}),
|
|
2103
|
+
/* @__PURE__ */ u("output", { children: r.toFixed(2) }),
|
|
2104
|
+
/* @__PURE__ */ u("button", {
|
|
2105
|
+
type: "button",
|
|
2106
|
+
onClick: () => q(J, e, void 0),
|
|
2107
|
+
disabled: !Ft(t),
|
|
2108
|
+
children: "reset"
|
|
2109
|
+
})
|
|
2110
|
+
]
|
|
2111
|
+
})]
|
|
2112
|
+
}, e);
|
|
2113
|
+
}
|
|
2114
|
+
if (re.has(e)) {
|
|
2115
|
+
let r = typeof t == "number" ? t : Je(U[e]) ?? "";
|
|
2116
|
+
return /* @__PURE__ */ d("div", {
|
|
2117
|
+
className: "reinspect-field",
|
|
2118
|
+
children: [/* @__PURE__ */ d("label", {
|
|
2119
|
+
htmlFor: n,
|
|
2120
|
+
children: [Nt(e), " (px)"]
|
|
2121
|
+
}), /* @__PURE__ */ d("div", {
|
|
2122
|
+
className: "reinspect-inline-controls",
|
|
2123
|
+
children: [/* @__PURE__ */ u("input", {
|
|
2124
|
+
id: n,
|
|
2125
|
+
type: "number",
|
|
2126
|
+
step: "1",
|
|
2127
|
+
value: r,
|
|
2128
|
+
onChange: (t) => {
|
|
2129
|
+
if (t.currentTarget.value === "") {
|
|
2130
|
+
q(J, e, void 0);
|
|
2131
|
+
return;
|
|
2132
|
+
}
|
|
2133
|
+
let n = Ie(t.currentTarget.value);
|
|
2134
|
+
n !== void 0 && q(J, e, n);
|
|
2135
|
+
}
|
|
2136
|
+
}), /* @__PURE__ */ u("button", {
|
|
2137
|
+
type: "button",
|
|
2138
|
+
onClick: () => q(J, e, void 0),
|
|
2139
|
+
disabled: !Ft(t),
|
|
2140
|
+
children: "reset"
|
|
2141
|
+
})]
|
|
2142
|
+
})]
|
|
2143
|
+
}, e);
|
|
2144
|
+
}
|
|
2145
|
+
return /* @__PURE__ */ d("div", {
|
|
2146
|
+
className: "reinspect-field",
|
|
2147
|
+
children: [/* @__PURE__ */ u("label", {
|
|
2148
|
+
htmlFor: n,
|
|
2149
|
+
children: Nt(e)
|
|
2150
|
+
}), /* @__PURE__ */ d("div", {
|
|
2151
|
+
className: "reinspect-inline-controls",
|
|
2152
|
+
children: [/* @__PURE__ */ u("input", {
|
|
2153
|
+
id: n,
|
|
2154
|
+
type: "text",
|
|
2155
|
+
value: typeof t == "string" ? t : U[e] ?? "",
|
|
2156
|
+
onChange: (t) => q(J, e, t.currentTarget.value || void 0)
|
|
2157
|
+
}), /* @__PURE__ */ u("button", {
|
|
2158
|
+
type: "button",
|
|
2159
|
+
onClick: () => q(J, e, void 0),
|
|
2160
|
+
disabled: !Ft(t),
|
|
2161
|
+
children: "reset"
|
|
2162
|
+
})]
|
|
2163
|
+
})]
|
|
2164
|
+
}, e);
|
|
2165
|
+
})
|
|
2166
|
+
}),
|
|
2167
|
+
He.length === 0 ? /* @__PURE__ */ d("p", {
|
|
2168
|
+
className: "reinspect-menu-empty-state",
|
|
2169
|
+
children: [
|
|
2170
|
+
"No CSS properties match \"",
|
|
2171
|
+
O.trim(),
|
|
2172
|
+
"\"."
|
|
2173
|
+
]
|
|
2174
|
+
}) : null
|
|
2175
|
+
]
|
|
2176
|
+
}) : null,
|
|
2177
|
+
S === "props" ? /* @__PURE__ */ d("div", {
|
|
2178
|
+
className: "reinspect-props-panel",
|
|
2179
|
+
children: [
|
|
2180
|
+
/* @__PURE__ */ d("div", {
|
|
2181
|
+
className: "reinspect-props-submenu",
|
|
2182
|
+
children: [/* @__PURE__ */ u("button", {
|
|
2183
|
+
type: "button",
|
|
2184
|
+
"data-state": T === "detected" ? "active" : "idle",
|
|
2185
|
+
onClick: () => E("detected"),
|
|
2186
|
+
children: "Detected"
|
|
2187
|
+
}), /* @__PURE__ */ u("button", {
|
|
2188
|
+
type: "button",
|
|
2189
|
+
"data-state": T === "raw" ? "active" : "idle",
|
|
2190
|
+
onClick: () => {
|
|
2191
|
+
E("raw"), N(null), M(rt(Ve, { mode: K }));
|
|
2192
|
+
},
|
|
2193
|
+
children: "Raw"
|
|
2194
|
+
})]
|
|
2195
|
+
}),
|
|
2196
|
+
T === "detected" ? Ue.length > 0 ? /* @__PURE__ */ u("div", {
|
|
2197
|
+
className: "reinspect-props-table",
|
|
2198
|
+
children: Ue.map((e) => {
|
|
2199
|
+
let t = It(e.key), n = Ve[e.key], r = e.value.kind === "object" || e.value.kind === "array", i = !!ue[e.key], a = se[e.key], o = ce[e.key], s = at(n);
|
|
2200
|
+
return /* @__PURE__ */ d("div", {
|
|
2201
|
+
className: "reinspect-props-row",
|
|
2202
|
+
"data-testid": `reinspect-prop-row-${t}`,
|
|
2203
|
+
children: [/* @__PURE__ */ u("code", {
|
|
2204
|
+
className: "reinspect-prop-key",
|
|
2205
|
+
children: e.key
|
|
2206
|
+
}), /* @__PURE__ */ d("div", {
|
|
2207
|
+
className: "reinspect-prop-cell",
|
|
2208
|
+
"data-testid": `reinspect-prop-value-${t}`,
|
|
2209
|
+
children: [/* @__PURE__ */ d("div", {
|
|
2210
|
+
className: "reinspect-prop-main",
|
|
2211
|
+
children: [/* @__PURE__ */ u("div", {
|
|
2212
|
+
className: "reinspect-prop-value-render",
|
|
2213
|
+
children: Tt({ value: e.value })
|
|
2214
|
+
}), r || s || e.value.copyText ? /* @__PURE__ */ d("div", {
|
|
2215
|
+
className: "reinspect-prop-actions",
|
|
2216
|
+
children: [
|
|
2217
|
+
r ? /* @__PURE__ */ u("button", {
|
|
2218
|
+
type: "button",
|
|
2219
|
+
"data-testid": `reinspect-prop-show-json-${t}`,
|
|
2220
|
+
onClick: () => et(e.key, n),
|
|
2221
|
+
className: "reinspect-prop-action-text-button",
|
|
2222
|
+
title: i ? "Collapse JSON preview" : "Expand JSON preview",
|
|
2223
|
+
"aria-label": i ? `Collapse JSON preview for ${e.key}` : `Expand JSON preview for ${e.key}`,
|
|
2224
|
+
children: i ? "Collapse JSON" : "Expand JSON"
|
|
2225
|
+
}) : null,
|
|
2226
|
+
s ? /* @__PURE__ */ u("button", {
|
|
2227
|
+
type: "button",
|
|
2228
|
+
"data-testid": `reinspect-prop-edit-${t}`,
|
|
2229
|
+
onClick: () => tt(e.key, n),
|
|
2230
|
+
className: "reinspect-icon-button",
|
|
2231
|
+
title: "Edit value",
|
|
2232
|
+
"aria-label": `Edit ${e.key}`,
|
|
2233
|
+
children: Wt()
|
|
2234
|
+
}) : null,
|
|
2235
|
+
r || e.value.copyText ? /* @__PURE__ */ u("button", {
|
|
2236
|
+
type: "button",
|
|
2237
|
+
className: "reinspect-icon-button",
|
|
2238
|
+
title: e.value.kind === "function" ? "Copy function source" : r ? "Copy JSON" : "Copy value",
|
|
2239
|
+
"aria-label": e.value.kind === "function" ? "Copy function source" : r ? `Copy JSON for ${e.key}` : `Copy value for ${e.key}`,
|
|
2240
|
+
onClick: () => {
|
|
2241
|
+
if (r) {
|
|
2242
|
+
$e(e.key, n);
|
|
2243
|
+
return;
|
|
2244
|
+
}
|
|
2245
|
+
e.value.copyText && Qe(e.value.copyText, e.value.kind === "function" ? "Function source" : "Value");
|
|
2246
|
+
},
|
|
2247
|
+
children: Ut()
|
|
2248
|
+
}) : null
|
|
2249
|
+
]
|
|
2250
|
+
}) : null]
|
|
2251
|
+
}), i ? /* @__PURE__ */ u("div", {
|
|
2252
|
+
className: "reinspect-prop-json-preview",
|
|
2253
|
+
"data-testid": `reinspect-prop-json-preview-${t}`,
|
|
2254
|
+
children: o ? /* @__PURE__ */ u("p", {
|
|
2255
|
+
className: "reinspect-error",
|
|
2256
|
+
children: o
|
|
2257
|
+
}) : /* @__PURE__ */ u("pre", { children: /* @__PURE__ */ u("code", {
|
|
2258
|
+
className: "language-json reinspect-code-block",
|
|
2259
|
+
dangerouslySetInnerHTML: { __html: wt(a ?? "", "json") }
|
|
2260
|
+
}) })
|
|
2261
|
+
}) : null]
|
|
2262
|
+
})]
|
|
2263
|
+
}, e.key);
|
|
2264
|
+
})
|
|
2265
|
+
}) : /* @__PURE__ */ u("p", {
|
|
2266
|
+
className: "reinspect-menu-empty-state",
|
|
2267
|
+
children: "No props detected."
|
|
2268
|
+
}) : /* @__PURE__ */ d(l, { children: [
|
|
2269
|
+
/* @__PURE__ */ u("label", {
|
|
2270
|
+
htmlFor: `${J}-props-json`,
|
|
2271
|
+
children: "Props JSON"
|
|
2272
|
+
}),
|
|
2273
|
+
/* @__PURE__ */ d("div", {
|
|
2274
|
+
className: "reinspect-json-editor",
|
|
2275
|
+
children: [/* @__PURE__ */ u("pre", {
|
|
2276
|
+
"aria-hidden": "true",
|
|
2277
|
+
ref: ee,
|
|
2278
|
+
children: /* @__PURE__ */ u("code", {
|
|
2279
|
+
className: "language-json reinspect-code-block",
|
|
2280
|
+
dangerouslySetInnerHTML: { __html: wt(j, "json") }
|
|
2281
|
+
})
|
|
2282
|
+
}), /* @__PURE__ */ u("textarea", {
|
|
2283
|
+
id: `${J}-props-json`,
|
|
2284
|
+
value: j,
|
|
2285
|
+
onChange: (e) => {
|
|
2286
|
+
M(e.currentTarget.value), N(null);
|
|
2287
|
+
},
|
|
2288
|
+
onScroll: (e) => {
|
|
2289
|
+
let t = ee.current;
|
|
2290
|
+
t && (t.scrollTop = e.currentTarget.scrollTop, t.scrollLeft = e.currentTarget.scrollLeft);
|
|
2291
|
+
},
|
|
2292
|
+
rows: 9,
|
|
2293
|
+
spellCheck: !1,
|
|
2294
|
+
className: "reinspect-json-editor-textarea",
|
|
2295
|
+
"data-testid": "reinspect-raw-props-textarea"
|
|
2296
|
+
})]
|
|
2297
|
+
}),
|
|
2298
|
+
ae ? /* @__PURE__ */ u("p", {
|
|
2299
|
+
className: "reinspect-error",
|
|
2300
|
+
children: ae
|
|
2301
|
+
}) : null,
|
|
2302
|
+
/* @__PURE__ */ d("div", {
|
|
2303
|
+
className: "reinspect-inline-controls",
|
|
2304
|
+
children: [/* @__PURE__ */ u("button", {
|
|
2305
|
+
type: "button",
|
|
2306
|
+
onClick: Xe,
|
|
2307
|
+
children: "apply"
|
|
2308
|
+
}), /* @__PURE__ */ u("button", {
|
|
2309
|
+
type: "button",
|
|
2310
|
+
onClick: Ze,
|
|
2311
|
+
children: "reset"
|
|
2312
|
+
})]
|
|
2313
|
+
})
|
|
2314
|
+
] }),
|
|
2315
|
+
oe ? /* @__PURE__ */ u("p", {
|
|
2316
|
+
className: "reinspect-setting-note",
|
|
2317
|
+
"data-testid": "reinspect-props-copy-status",
|
|
2318
|
+
children: oe
|
|
2319
|
+
}) : null
|
|
2320
|
+
]
|
|
2321
|
+
}) : null
|
|
2322
|
+
]
|
|
2323
|
+
}) : null, pt = L ? f(/* @__PURE__ */ u("div", {
|
|
2324
|
+
className: "reinspect-modal-backdrop",
|
|
2325
|
+
"data-reinspect-theme": ge,
|
|
2326
|
+
role: "dialog",
|
|
2327
|
+
"aria-modal": "true",
|
|
2328
|
+
"aria-label": `Edit ${L} prop`,
|
|
2329
|
+
"data-testid": "reinspect-prop-edit-modal",
|
|
2330
|
+
children: /* @__PURE__ */ d("div", {
|
|
2331
|
+
className: "reinspect-modal",
|
|
2332
|
+
"data-reinspect-theme": ge,
|
|
2333
|
+
ref: v,
|
|
2334
|
+
tabIndex: -1,
|
|
2335
|
+
children: [
|
|
2336
|
+
/* @__PURE__ */ d("p", {
|
|
2337
|
+
className: "reinspect-menu-title",
|
|
2338
|
+
children: ["Edit prop: ", L]
|
|
2339
|
+
}),
|
|
2340
|
+
/* @__PURE__ */ u("label", {
|
|
2341
|
+
htmlFor: `${J}-prop-edit-json`,
|
|
2342
|
+
children: "JSON value"
|
|
2343
|
+
}),
|
|
2344
|
+
/* @__PURE__ */ u("textarea", {
|
|
2345
|
+
id: `${J}-prop-edit-json`,
|
|
2346
|
+
"data-testid": "reinspect-prop-edit-textarea",
|
|
2347
|
+
value: de,
|
|
2348
|
+
onChange: (e) => {
|
|
2349
|
+
z(e.currentTarget.value), B(null);
|
|
2350
|
+
},
|
|
2351
|
+
rows: 10
|
|
2352
|
+
}),
|
|
2353
|
+
fe ? /* @__PURE__ */ u("p", {
|
|
2354
|
+
className: "reinspect-error",
|
|
2355
|
+
"data-testid": "reinspect-prop-edit-error",
|
|
2356
|
+
children: fe
|
|
2357
|
+
}) : null,
|
|
2358
|
+
/* @__PURE__ */ d("div", {
|
|
2359
|
+
className: "reinspect-inline-controls",
|
|
2360
|
+
children: [/* @__PURE__ */ u("button", {
|
|
2361
|
+
type: "button",
|
|
2362
|
+
onClick: ct,
|
|
2363
|
+
children: "apply"
|
|
2364
|
+
}), /* @__PURE__ */ u("button", {
|
|
2365
|
+
type: "button",
|
|
2366
|
+
onClick: () => {
|
|
2367
|
+
R(null), z(""), B(null);
|
|
2368
|
+
},
|
|
2369
|
+
children: "cancel"
|
|
2370
|
+
})]
|
|
2371
|
+
})
|
|
2372
|
+
]
|
|
2373
|
+
})
|
|
2374
|
+
}), document.body) : null, mt = V ? f(/* @__PURE__ */ d("div", {
|
|
2375
|
+
className: "reinspect-toast",
|
|
2376
|
+
"data-reinspect-theme": ge,
|
|
2377
|
+
role: "status",
|
|
2378
|
+
"aria-live": "polite",
|
|
2379
|
+
"data-testid": "reinspect-hide-component-toast",
|
|
2380
|
+
children: [
|
|
2381
|
+
/* @__PURE__ */ d("div", {
|
|
2382
|
+
className: "reinspect-toast-copy",
|
|
2383
|
+
children: [/* @__PURE__ */ d("p", {
|
|
2384
|
+
className: "reinspect-toast-title",
|
|
2385
|
+
children: ["Hidden ", V.componentName]
|
|
2386
|
+
}), /* @__PURE__ */ u("p", {
|
|
2387
|
+
className: "reinspect-toast-description",
|
|
2388
|
+
children: "This component type was excluded from inspection."
|
|
2389
|
+
})]
|
|
2390
|
+
}),
|
|
2391
|
+
/* @__PURE__ */ u("button", {
|
|
2392
|
+
type: "button",
|
|
2393
|
+
className: "reinspect-toast-undo",
|
|
2394
|
+
"data-testid": "reinspect-hide-component-undo",
|
|
2395
|
+
onClick: ft,
|
|
2396
|
+
children: "Undo"
|
|
2397
|
+
}),
|
|
2398
|
+
/* @__PURE__ */ u("button", {
|
|
2399
|
+
type: "button",
|
|
2400
|
+
className: "reinspect-toast-dismiss",
|
|
2401
|
+
"aria-label": "Dismiss notification",
|
|
2402
|
+
onClick: () => H(null),
|
|
2403
|
+
children: "×"
|
|
2404
|
+
})
|
|
2405
|
+
]
|
|
2406
|
+
}), document.body) : null;
|
|
2407
|
+
if (!me) {
|
|
2408
|
+
if (c === "manual") throw Error("useReinspect must be used within ReinspectProvider");
|
|
2409
|
+
return /* @__PURE__ */ u(h, { ...Be });
|
|
2410
|
+
}
|
|
2411
|
+
let gt = Le ? /* @__PURE__ */ u(e, {
|
|
2412
|
+
id: J,
|
|
2413
|
+
onRender: Ge,
|
|
2414
|
+
children: /* @__PURE__ */ u(h, { ...Be })
|
|
2415
|
+
}) : /* @__PURE__ */ u(h, { ...Be });
|
|
2416
|
+
return !Y && !Z ? /* @__PURE__ */ d(l, { children: [gt, mt] }) : /* @__PURE__ */ d("div", {
|
|
2417
|
+
ref: m,
|
|
2418
|
+
className: "reinspect-shell",
|
|
2419
|
+
"data-reinspect-component": g,
|
|
2420
|
+
"data-reinspect-active": Y,
|
|
2421
|
+
"data-testid": `reinspect-shell-${g}`,
|
|
2422
|
+
style: Ke,
|
|
2423
|
+
tabIndex: -1,
|
|
2424
|
+
onContextMenu: Ye,
|
|
2425
|
+
children: [
|
|
2426
|
+
Y ? /* @__PURE__ */ d("span", {
|
|
2427
|
+
className: "reinspect-name-badge",
|
|
2428
|
+
children: [
|
|
2429
|
+
g,
|
|
2430
|
+
Me ? " | " : "",
|
|
2431
|
+
Me ? /* @__PURE__ */ u(Et, {
|
|
2432
|
+
instanceId: J,
|
|
2433
|
+
counterMode: Pe
|
|
2434
|
+
}) : null
|
|
2435
|
+
]
|
|
2436
|
+
}) : null,
|
|
2437
|
+
$ ? f($, document.body) : null,
|
|
2438
|
+
pt,
|
|
2439
|
+
mt,
|
|
2440
|
+
/* @__PURE__ */ u("div", {
|
|
2441
|
+
className: "reinspect-content",
|
|
2442
|
+
"data-reinspect-content": "true",
|
|
2443
|
+
style: ze,
|
|
2444
|
+
children: gt
|
|
2445
|
+
})
|
|
2446
|
+
]
|
|
2447
|
+
});
|
|
2448
|
+
}
|
|
2449
|
+
return _.displayName = `withReinspect(${g})`, ut(_, {
|
|
2450
|
+
source: c,
|
|
2451
|
+
scope: p,
|
|
2452
|
+
original: h
|
|
2453
|
+
}), _;
|
|
2454
|
+
}
|
|
2455
|
+
//#endregion
|
|
2456
|
+
export { q as _, Ae as a, ne as b, fe as c, U as d, be as f, we as g, De as h, ke as i, z as l, ye as m, lt as n, R as o, me as p, N as r, B as s, Yt as t, de as u, Y as v, b as x, w as y };
|