@wp-playground/components 3.1.55 → 3.1.57
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/FilePickerTree/index.d.ts +22 -0
- package/MountGitDirectoryModal/index.d.ts +20 -0
- package/PlaygroundFileEditor/file-explorer-sidebar.d.ts +14 -1
- package/PlaygroundFileEditor/index.d.ts +2 -2
- package/PlaygroundFileEditor/playground-file-editor.d.ts +14 -1
- package/iframe-messages.d.ts +1 -0
- package/index.cjs +10 -10
- package/index.cjs.map +1 -1
- package/index.d.ts +2 -0
- package/index.js +1867 -1606
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/style.css +1 -1
package/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import r, { forwardRef as
|
|
2
|
-
import { joinPaths as
|
|
3
|
-
import { __experimentalTreeGrid as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
const
|
|
1
|
+
import r, { forwardRef as bt, useMemo as ft, useState as K, useRef as O, useEffect as W, useImperativeHandle as xt, useLayoutEffect as tr, useCallback as ze } from "react";
|
|
2
|
+
import { joinPaths as Me, dirname as Ne, normalizePath as rr, basename as tt, isParentOf as nr, concatUint8Arrays as ar } from "@php-wasm/util";
|
|
3
|
+
import { __experimentalTreeGrid as or, Popover as ir, NavigableMenu as lr, MenuItem as Qe, __experimentalTreeGridRow as sr, __experimentalTreeGridCell as cr, Button as He, Modal as zt, Icon as At, Tooltip as Gt, VisuallyHidden as ur, Notice as fr, TextControl as Nt, Flex as dr } from "@wordpress/components";
|
|
4
|
+
import Fe from "classnames";
|
|
5
|
+
import { createPortal as Yt } from "react-dom";
|
|
6
|
+
import { logger as Ye } from "@php-wasm/logger";
|
|
7
|
+
import { forwardRef as Zt, cloneElement as mr, createElement as pr } from "@wordpress/element";
|
|
8
|
+
import hr from "clsx";
|
|
9
|
+
import { Compartment as Ft, EditorSelection as yt, EditorState as wr } from "@codemirror/state";
|
|
10
|
+
import { ViewPlugin as vr, lineNumbers as gr, highlightActiveLineGutter as Er, highlightActiveLine as _r, dropCursor as yr, rectangularSelection as br, crosshairCursor as xr, EditorView as dt, keymap as Cr } from "@codemirror/view";
|
|
11
|
+
import { history as Rr, historyKeymap as Pr, defaultKeymap as kr, indentWithTab as Tr } from "@codemirror/commands";
|
|
12
|
+
import { highlightSelectionMatches as Sr, searchKeymap as Dr } from "@codemirror/search";
|
|
13
|
+
import { closeBrackets as Ar, autocompletion as Nr, closeBracketsKeymap as Fr, completionKeymap as Lr } from "@codemirror/autocomplete";
|
|
14
|
+
import { foldGutter as Ir, syntaxHighlighting as Mr, defaultHighlightStyle as Or, indentOnInput as jr, bracketMatching as Br, foldKeymap as Vr } from "@codemirror/language";
|
|
15
|
+
import { php as mt } from "@codemirror/lang-php";
|
|
16
|
+
import { FilePickerTree as $r, BinaryFilePreview as Hr } from "@wp-playground/components";
|
|
17
|
+
import jt from "@php-wasm/universal/mime-types";
|
|
18
|
+
const Za = (i) => /* @__PURE__ */ r.createElement(
|
|
19
19
|
"svg",
|
|
20
20
|
{
|
|
21
21
|
width: "32",
|
|
@@ -23,7 +23,7 @@ const ja = (n) => /* @__PURE__ */ r.createElement(
|
|
|
23
23
|
viewBox: "0 0 32 32",
|
|
24
24
|
fill: "none",
|
|
25
25
|
xmlns: "http://www.w3.org/2000/svg",
|
|
26
|
-
...
|
|
26
|
+
...i
|
|
27
27
|
},
|
|
28
28
|
/* @__PURE__ */ r.createElement(
|
|
29
29
|
"rect",
|
|
@@ -58,7 +58,7 @@ const ja = (n) => /* @__PURE__ */ r.createElement(
|
|
|
58
58
|
strokeWidth: "1.93129"
|
|
59
59
|
}
|
|
60
60
|
)
|
|
61
|
-
),
|
|
61
|
+
), Ka = (i) => /* @__PURE__ */ r.createElement(
|
|
62
62
|
"svg",
|
|
63
63
|
{
|
|
64
64
|
width: "16",
|
|
@@ -66,7 +66,7 @@ const ja = (n) => /* @__PURE__ */ r.createElement(
|
|
|
66
66
|
viewBox: "0 0 16 17",
|
|
67
67
|
fill: "none",
|
|
68
68
|
xmlns: "http://www.w3.org/2000/svg",
|
|
69
|
-
...
|
|
69
|
+
...i
|
|
70
70
|
},
|
|
71
71
|
/* @__PURE__ */ r.createElement(
|
|
72
72
|
"path",
|
|
@@ -77,7 +77,7 @@ const ja = (n) => /* @__PURE__ */ r.createElement(
|
|
|
77
77
|
fill: "#949494"
|
|
78
78
|
}
|
|
79
79
|
)
|
|
80
|
-
),
|
|
80
|
+
), qa = (i) => /* @__PURE__ */ r.createElement(
|
|
81
81
|
"svg",
|
|
82
82
|
{
|
|
83
83
|
width: "20",
|
|
@@ -85,7 +85,7 @@ const ja = (n) => /* @__PURE__ */ r.createElement(
|
|
|
85
85
|
viewBox: "0 0 20 21",
|
|
86
86
|
fill: "none",
|
|
87
87
|
xmlns: "http://www.w3.org/2000/svg",
|
|
88
|
-
...
|
|
88
|
+
...i
|
|
89
89
|
},
|
|
90
90
|
/* @__PURE__ */ r.createElement(
|
|
91
91
|
"path",
|
|
@@ -94,7 +94,7 @@ const ja = (n) => /* @__PURE__ */ r.createElement(
|
|
|
94
94
|
fill: "#ffffff"
|
|
95
95
|
}
|
|
96
96
|
)
|
|
97
|
-
),
|
|
97
|
+
), Wr = /* @__PURE__ */ r.createElement(
|
|
98
98
|
"svg",
|
|
99
99
|
{
|
|
100
100
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -111,7 +111,7 @@ const ja = (n) => /* @__PURE__ */ r.createElement(
|
|
|
111
111
|
d: "M7.59196 3.59524L6.77745 1.96623C6.70755 1.82641 6.56464 1.7381 6.40832 1.7381H1.65079C1.42287 1.7381 1.2381 1.92287 1.2381 2.15079V11.8492C1.2381 12.0771 1.42287 12.2619 1.65079 12.2619H13.2063C13.4343 12.2619 13.619 12.0771 13.619 11.8492V4.00794C13.619 3.78001 13.4343 3.59524 13.2063 3.59524H7.59196ZM8.35714 2.35714L7.88484 1.41254C7.60521 0.853274 7.0336 0.5 6.40832 0.5H1.65079C0.739085 0.5 0 1.23909 0 2.15079V11.8492C0 12.7609 0.739085 13.5 1.65079 13.5H13.2063C14.1181 13.5 14.8571 12.7609 14.8571 11.8492V4.00794C14.8571 3.09623 14.1181 2.35714 13.2063 2.35714H8.35714Z"
|
|
112
112
|
}
|
|
113
113
|
)
|
|
114
|
-
),
|
|
114
|
+
), Ur = /* @__PURE__ */ r.createElement(
|
|
115
115
|
"svg",
|
|
116
116
|
{
|
|
117
117
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -122,7 +122,7 @@ const ja = (n) => /* @__PURE__ */ r.createElement(
|
|
|
122
122
|
viewBox: "0 0 16 16"
|
|
123
123
|
},
|
|
124
124
|
/* @__PURE__ */ r.createElement("path", { d: "M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5z" })
|
|
125
|
-
),
|
|
125
|
+
), Ja = (i) => /* @__PURE__ */ r.createElement(
|
|
126
126
|
"svg",
|
|
127
127
|
{
|
|
128
128
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -130,7 +130,7 @@ const ja = (n) => /* @__PURE__ */ r.createElement(
|
|
|
130
130
|
height: "18",
|
|
131
131
|
viewBox: "0 0 14 14",
|
|
132
132
|
fill: "none",
|
|
133
|
-
...
|
|
133
|
+
...i
|
|
134
134
|
},
|
|
135
135
|
/* @__PURE__ */ r.createElement(
|
|
136
136
|
"path",
|
|
@@ -141,7 +141,7 @@ const ja = (n) => /* @__PURE__ */ r.createElement(
|
|
|
141
141
|
fill: "#949494"
|
|
142
142
|
}
|
|
143
143
|
)
|
|
144
|
-
),
|
|
144
|
+
), Xa = /* @__PURE__ */ r.createElement(
|
|
145
145
|
"svg",
|
|
146
146
|
{
|
|
147
147
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -160,18 +160,18 @@ const ja = (n) => /* @__PURE__ */ r.createElement(
|
|
|
160
160
|
}
|
|
161
161
|
)
|
|
162
162
|
);
|
|
163
|
-
function
|
|
164
|
-
return `data:${
|
|
163
|
+
function Qa(i) {
|
|
164
|
+
return `data:${i.mime};base64,${i.data}`;
|
|
165
165
|
}
|
|
166
|
-
function
|
|
167
|
-
size:
|
|
168
|
-
sidebarActive:
|
|
166
|
+
function eo({
|
|
167
|
+
size: i = 24,
|
|
168
|
+
sidebarActive: l = !1
|
|
169
169
|
}) {
|
|
170
170
|
return /* @__PURE__ */ r.createElement(
|
|
171
171
|
"svg",
|
|
172
172
|
{
|
|
173
|
-
width:
|
|
174
|
-
height:
|
|
173
|
+
width: i,
|
|
174
|
+
height: i,
|
|
175
175
|
viewBox: "0 0 24 24",
|
|
176
176
|
xmlns: "http://www.w3.org/2000/svg",
|
|
177
177
|
fill: "none",
|
|
@@ -181,7 +181,7 @@ function za({
|
|
|
181
181
|
strokeLinejoin: "round"
|
|
182
182
|
},
|
|
183
183
|
/* @__PURE__ */ r.createElement("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
184
|
-
|
|
184
|
+
l ? /* @__PURE__ */ r.createElement(
|
|
185
185
|
"rect",
|
|
186
186
|
{
|
|
187
187
|
x: "3",
|
|
@@ -208,17 +208,31 @@ function za({
|
|
|
208
208
|
)
|
|
209
209
|
);
|
|
210
210
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
211
|
+
function to(i, l) {
|
|
212
|
+
return !(l != null && l.contentWindow) || !i.source ? !1 : i.source === l.contentWindow ? !0 : Kt(l.contentWindow, i.source);
|
|
213
|
+
}
|
|
214
|
+
function Kt(i, l) {
|
|
215
|
+
try {
|
|
216
|
+
for (let f = 0; f < i.frames.length; f++) {
|
|
217
|
+
const u = i.frames[f];
|
|
218
|
+
if (u === l || Kt(u, l))
|
|
219
|
+
return !0;
|
|
220
|
+
}
|
|
221
|
+
} catch {
|
|
222
|
+
}
|
|
223
|
+
return !1;
|
|
224
|
+
}
|
|
225
|
+
const Bt = Zt(({
|
|
226
|
+
icon: i,
|
|
227
|
+
size: l = 24,
|
|
214
228
|
...f
|
|
215
|
-
},
|
|
216
|
-
width:
|
|
217
|
-
height:
|
|
229
|
+
}, u) => mr(i, {
|
|
230
|
+
width: l,
|
|
231
|
+
height: l,
|
|
218
232
|
...f,
|
|
219
|
-
ref:
|
|
233
|
+
ref: u
|
|
220
234
|
}));
|
|
221
|
-
var
|
|
235
|
+
var Ot = { exports: {} }, ct = {};
|
|
222
236
|
/**
|
|
223
237
|
* @license React
|
|
224
238
|
* react-jsx-runtime.production.min.js
|
|
@@ -228,21 +242,21 @@ var It = { exports: {} }, lt = {};
|
|
|
228
242
|
* This source code is licensed under the MIT license found in the
|
|
229
243
|
* LICENSE file in the root directory of this source tree.
|
|
230
244
|
*/
|
|
231
|
-
var
|
|
232
|
-
function
|
|
233
|
-
if (
|
|
234
|
-
|
|
235
|
-
var
|
|
236
|
-
function
|
|
237
|
-
var D,
|
|
238
|
-
|
|
239
|
-
for (D in
|
|
240
|
-
if (
|
|
241
|
-
return { $$typeof:
|
|
245
|
+
var Vt;
|
|
246
|
+
function zr() {
|
|
247
|
+
if (Vt) return ct;
|
|
248
|
+
Vt = 1;
|
|
249
|
+
var i = r, l = Symbol.for("react.element"), f = Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, w = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, h = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
250
|
+
function x(E, R, b) {
|
|
251
|
+
var D, k = {}, F = null, Q = null;
|
|
252
|
+
b !== void 0 && (F = "" + b), R.key !== void 0 && (F = "" + R.key), R.ref !== void 0 && (Q = R.ref);
|
|
253
|
+
for (D in R) u.call(R, D) && !h.hasOwnProperty(D) && (k[D] = R[D]);
|
|
254
|
+
if (E && E.defaultProps) for (D in R = E.defaultProps, R) k[D] === void 0 && (k[D] = R[D]);
|
|
255
|
+
return { $$typeof: l, type: E, key: F, ref: Q, props: k, _owner: w.current };
|
|
242
256
|
}
|
|
243
|
-
return
|
|
257
|
+
return ct.Fragment = f, ct.jsx = x, ct.jsxs = x, ct;
|
|
244
258
|
}
|
|
245
|
-
var
|
|
259
|
+
var ut = {};
|
|
246
260
|
/**
|
|
247
261
|
* @license React
|
|
248
262
|
* react-jsx-runtime.development.js
|
|
@@ -252,54 +266,54 @@ var st = {};
|
|
|
252
266
|
* This source code is licensed under the MIT license found in the
|
|
253
267
|
* LICENSE file in the root directory of this source tree.
|
|
254
268
|
*/
|
|
255
|
-
var
|
|
256
|
-
function
|
|
257
|
-
return
|
|
258
|
-
var
|
|
259
|
-
function
|
|
269
|
+
var $t;
|
|
270
|
+
function Gr() {
|
|
271
|
+
return $t || ($t = 1, process.env.NODE_ENV !== "production" && function() {
|
|
272
|
+
var i = r, l = Symbol.for("react.element"), f = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), w = Symbol.for("react.strict_mode"), h = Symbol.for("react.profiler"), x = Symbol.for("react.provider"), E = Symbol.for("react.context"), R = Symbol.for("react.forward_ref"), b = Symbol.for("react.suspense"), D = Symbol.for("react.suspense_list"), k = Symbol.for("react.memo"), F = Symbol.for("react.lazy"), Q = Symbol.for("react.offscreen"), J = Symbol.iterator, v = "@@iterator";
|
|
273
|
+
function Z(e) {
|
|
260
274
|
if (e === null || typeof e != "object")
|
|
261
275
|
return null;
|
|
262
|
-
var
|
|
263
|
-
return typeof
|
|
276
|
+
var n = J && e[J] || e[v];
|
|
277
|
+
return typeof n == "function" ? n : null;
|
|
264
278
|
}
|
|
265
|
-
var
|
|
279
|
+
var T = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
266
280
|
function m(e) {
|
|
267
281
|
{
|
|
268
|
-
for (var
|
|
269
|
-
p
|
|
270
|
-
|
|
282
|
+
for (var n = arguments.length, s = new Array(n > 1 ? n - 1 : 0), p = 1; p < n; p++)
|
|
283
|
+
s[p - 1] = arguments[p];
|
|
284
|
+
N("error", e, s);
|
|
271
285
|
}
|
|
272
286
|
}
|
|
273
|
-
function
|
|
287
|
+
function N(e, n, s) {
|
|
274
288
|
{
|
|
275
|
-
var
|
|
276
|
-
|
|
277
|
-
var
|
|
278
|
-
return String(
|
|
289
|
+
var p = T.ReactDebugCurrentFrame, S = p.getStackAddendum();
|
|
290
|
+
S !== "" && (n += "%s", s = s.concat([S]));
|
|
291
|
+
var I = s.map(function(A) {
|
|
292
|
+
return String(A);
|
|
279
293
|
});
|
|
280
|
-
|
|
294
|
+
I.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, I);
|
|
281
295
|
}
|
|
282
296
|
}
|
|
283
|
-
var
|
|
284
|
-
|
|
285
|
-
function
|
|
286
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
297
|
+
var j = !1, L = !1, U = !1, re = !1, ne = !1, X;
|
|
298
|
+
X = Symbol.for("react.module.reference");
|
|
299
|
+
function ae(e) {
|
|
300
|
+
return !!(typeof e == "string" || typeof e == "function" || e === u || e === h || ne || e === w || e === b || e === D || re || e === Q || j || L || U || typeof e == "object" && e !== null && (e.$$typeof === F || e.$$typeof === k || e.$$typeof === x || e.$$typeof === E || e.$$typeof === R || // This needs to include all possible module reference object
|
|
287
301
|
// types supported by any Flight configuration anywhere since
|
|
288
302
|
// we don't know which Flight build this will end up being used
|
|
289
303
|
// with.
|
|
290
|
-
e.$$typeof ===
|
|
304
|
+
e.$$typeof === X || e.getModuleId !== void 0));
|
|
291
305
|
}
|
|
292
|
-
function
|
|
293
|
-
var
|
|
294
|
-
if (
|
|
295
|
-
return
|
|
296
|
-
var
|
|
297
|
-
return
|
|
306
|
+
function _(e, n, s) {
|
|
307
|
+
var p = e.displayName;
|
|
308
|
+
if (p)
|
|
309
|
+
return p;
|
|
310
|
+
var S = n.displayName || n.name || "";
|
|
311
|
+
return S !== "" ? s + "(" + S + ")" : s;
|
|
298
312
|
}
|
|
299
|
-
function
|
|
313
|
+
function d(e) {
|
|
300
314
|
return e.displayName || "Context";
|
|
301
315
|
}
|
|
302
|
-
function
|
|
316
|
+
function P(e) {
|
|
303
317
|
if (e == null)
|
|
304
318
|
return null;
|
|
305
319
|
if (typeof e.tag == "number" && m("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
@@ -307,36 +321,36 @@ function Wr() {
|
|
|
307
321
|
if (typeof e == "string")
|
|
308
322
|
return e;
|
|
309
323
|
switch (e) {
|
|
310
|
-
case
|
|
324
|
+
case u:
|
|
311
325
|
return "Fragment";
|
|
312
326
|
case f:
|
|
313
327
|
return "Portal";
|
|
314
|
-
case
|
|
328
|
+
case h:
|
|
315
329
|
return "Profiler";
|
|
316
|
-
case
|
|
330
|
+
case w:
|
|
317
331
|
return "StrictMode";
|
|
318
|
-
case
|
|
332
|
+
case b:
|
|
319
333
|
return "Suspense";
|
|
320
334
|
case D:
|
|
321
335
|
return "SuspenseList";
|
|
322
336
|
}
|
|
323
337
|
if (typeof e == "object")
|
|
324
338
|
switch (e.$$typeof) {
|
|
325
|
-
case
|
|
339
|
+
case E:
|
|
340
|
+
var n = e;
|
|
341
|
+
return d(n) + ".Consumer";
|
|
342
|
+
case x:
|
|
326
343
|
var s = e;
|
|
327
|
-
return
|
|
328
|
-
case
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
return
|
|
333
|
-
case
|
|
334
|
-
var
|
|
335
|
-
return C !== null ? C : re(e.type) || "Memo";
|
|
336
|
-
case k: {
|
|
337
|
-
var z = e, Y = z._payload, B = z._init;
|
|
344
|
+
return d(s._context) + ".Provider";
|
|
345
|
+
case R:
|
|
346
|
+
return _(e, e.render, "ForwardRef");
|
|
347
|
+
case k:
|
|
348
|
+
var p = e.displayName || null;
|
|
349
|
+
return p !== null ? p : P(e.type) || "Memo";
|
|
350
|
+
case F: {
|
|
351
|
+
var S = e, I = S._payload, A = S._init;
|
|
338
352
|
try {
|
|
339
|
-
return
|
|
353
|
+
return P(A(I));
|
|
340
354
|
} catch {
|
|
341
355
|
return null;
|
|
342
356
|
}
|
|
@@ -344,18 +358,18 @@ function Wr() {
|
|
|
344
358
|
}
|
|
345
359
|
return null;
|
|
346
360
|
}
|
|
347
|
-
var
|
|
348
|
-
function
|
|
361
|
+
var V = Object.assign, z = 0, $, G, ce, me, Y, ee, ue;
|
|
362
|
+
function Pe() {
|
|
349
363
|
}
|
|
350
|
-
|
|
351
|
-
function
|
|
364
|
+
Pe.__reactDisabledLog = !0;
|
|
365
|
+
function oe() {
|
|
352
366
|
{
|
|
353
|
-
if (
|
|
354
|
-
|
|
367
|
+
if (z === 0) {
|
|
368
|
+
$ = console.log, G = console.info, ce = console.warn, me = console.error, Y = console.group, ee = console.groupCollapsed, ue = console.groupEnd;
|
|
355
369
|
var e = {
|
|
356
370
|
configurable: !0,
|
|
357
371
|
enumerable: !0,
|
|
358
|
-
value:
|
|
372
|
+
value: Pe,
|
|
359
373
|
writable: !0
|
|
360
374
|
};
|
|
361
375
|
Object.defineProperties(console, {
|
|
@@ -368,332 +382,332 @@ function Wr() {
|
|
|
368
382
|
groupEnd: e
|
|
369
383
|
});
|
|
370
384
|
}
|
|
371
|
-
|
|
385
|
+
z++;
|
|
372
386
|
}
|
|
373
387
|
}
|
|
374
|
-
function
|
|
388
|
+
function Te() {
|
|
375
389
|
{
|
|
376
|
-
if (
|
|
390
|
+
if (z--, z === 0) {
|
|
377
391
|
var e = {
|
|
378
392
|
configurable: !0,
|
|
379
393
|
enumerable: !0,
|
|
380
394
|
writable: !0
|
|
381
395
|
};
|
|
382
396
|
Object.defineProperties(console, {
|
|
383
|
-
log:
|
|
384
|
-
value:
|
|
397
|
+
log: V({}, e, {
|
|
398
|
+
value: $
|
|
385
399
|
}),
|
|
386
|
-
info:
|
|
387
|
-
value:
|
|
400
|
+
info: V({}, e, {
|
|
401
|
+
value: G
|
|
388
402
|
}),
|
|
389
|
-
warn:
|
|
390
|
-
value:
|
|
403
|
+
warn: V({}, e, {
|
|
404
|
+
value: ce
|
|
391
405
|
}),
|
|
392
|
-
error:
|
|
393
|
-
value:
|
|
406
|
+
error: V({}, e, {
|
|
407
|
+
value: me
|
|
394
408
|
}),
|
|
395
|
-
group:
|
|
396
|
-
value:
|
|
409
|
+
group: V({}, e, {
|
|
410
|
+
value: Y
|
|
397
411
|
}),
|
|
398
|
-
groupCollapsed:
|
|
399
|
-
value:
|
|
412
|
+
groupCollapsed: V({}, e, {
|
|
413
|
+
value: ee
|
|
400
414
|
}),
|
|
401
|
-
groupEnd:
|
|
402
|
-
value:
|
|
415
|
+
groupEnd: V({}, e, {
|
|
416
|
+
value: ue
|
|
403
417
|
})
|
|
404
418
|
});
|
|
405
419
|
}
|
|
406
|
-
|
|
420
|
+
z < 0 && m("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
407
421
|
}
|
|
408
422
|
}
|
|
409
|
-
var
|
|
410
|
-
function
|
|
423
|
+
var ve = T.ReactCurrentDispatcher, Ce;
|
|
424
|
+
function ie(e, n, s) {
|
|
411
425
|
{
|
|
412
|
-
if (
|
|
426
|
+
if (Ce === void 0)
|
|
413
427
|
try {
|
|
414
428
|
throw Error();
|
|
415
|
-
} catch (
|
|
416
|
-
var
|
|
417
|
-
|
|
429
|
+
} catch (S) {
|
|
430
|
+
var p = S.stack.trim().match(/\n( *(at )?)/);
|
|
431
|
+
Ce = p && p[1] || "";
|
|
418
432
|
}
|
|
419
433
|
return `
|
|
420
|
-
` +
|
|
434
|
+
` + Ce + e;
|
|
421
435
|
}
|
|
422
436
|
}
|
|
423
|
-
var
|
|
437
|
+
var Be = !1, ge;
|
|
424
438
|
{
|
|
425
|
-
var
|
|
426
|
-
|
|
439
|
+
var Se = typeof WeakMap == "function" ? WeakMap : Map;
|
|
440
|
+
ge = new Se();
|
|
427
441
|
}
|
|
428
|
-
function
|
|
429
|
-
if (!e ||
|
|
442
|
+
function g(e, n) {
|
|
443
|
+
if (!e || Be)
|
|
430
444
|
return "";
|
|
431
445
|
{
|
|
432
|
-
var
|
|
433
|
-
if (
|
|
434
|
-
return
|
|
446
|
+
var s = ge.get(e);
|
|
447
|
+
if (s !== void 0)
|
|
448
|
+
return s;
|
|
435
449
|
}
|
|
436
|
-
var
|
|
437
|
-
|
|
438
|
-
var
|
|
450
|
+
var p;
|
|
451
|
+
Be = !0;
|
|
452
|
+
var S = Error.prepareStackTrace;
|
|
439
453
|
Error.prepareStackTrace = void 0;
|
|
440
|
-
var
|
|
441
|
-
|
|
454
|
+
var I;
|
|
455
|
+
I = ve.current, ve.current = null, oe();
|
|
442
456
|
try {
|
|
443
|
-
if (
|
|
444
|
-
var
|
|
457
|
+
if (n) {
|
|
458
|
+
var A = function() {
|
|
445
459
|
throw Error();
|
|
446
460
|
};
|
|
447
|
-
if (Object.defineProperty(
|
|
461
|
+
if (Object.defineProperty(A.prototype, "props", {
|
|
448
462
|
set: function() {
|
|
449
463
|
throw Error();
|
|
450
464
|
}
|
|
451
465
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
452
466
|
try {
|
|
453
|
-
Reflect.construct(
|
|
454
|
-
} catch (
|
|
455
|
-
|
|
467
|
+
Reflect.construct(A, []);
|
|
468
|
+
} catch (Re) {
|
|
469
|
+
p = Re;
|
|
456
470
|
}
|
|
457
|
-
Reflect.construct(e, [],
|
|
471
|
+
Reflect.construct(e, [], A);
|
|
458
472
|
} else {
|
|
459
473
|
try {
|
|
460
|
-
|
|
461
|
-
} catch (
|
|
462
|
-
|
|
474
|
+
A.call();
|
|
475
|
+
} catch (Re) {
|
|
476
|
+
p = Re;
|
|
463
477
|
}
|
|
464
|
-
e.call(
|
|
478
|
+
e.call(A.prototype);
|
|
465
479
|
}
|
|
466
480
|
} else {
|
|
467
481
|
try {
|
|
468
482
|
throw Error();
|
|
469
|
-
} catch (
|
|
470
|
-
|
|
483
|
+
} catch (Re) {
|
|
484
|
+
p = Re;
|
|
471
485
|
}
|
|
472
486
|
e();
|
|
473
487
|
}
|
|
474
|
-
} catch (
|
|
475
|
-
if (
|
|
476
|
-
for (var
|
|
477
|
-
`),
|
|
478
|
-
`),
|
|
479
|
-
|
|
480
|
-
for (;
|
|
481
|
-
if (
|
|
482
|
-
if (
|
|
488
|
+
} catch (Re) {
|
|
489
|
+
if (Re && p && typeof Re.stack == "string") {
|
|
490
|
+
for (var M = Re.stack.split(`
|
|
491
|
+
`), be = p.stack.split(`
|
|
492
|
+
`), te = M.length - 1, se = be.length - 1; te >= 1 && se >= 0 && M[te] !== be[se]; )
|
|
493
|
+
se--;
|
|
494
|
+
for (; te >= 1 && se >= 0; te--, se--)
|
|
495
|
+
if (M[te] !== be[se]) {
|
|
496
|
+
if (te !== 1 || se !== 1)
|
|
483
497
|
do
|
|
484
|
-
if (
|
|
485
|
-
var
|
|
486
|
-
` +
|
|
487
|
-
return e.displayName &&
|
|
498
|
+
if (te--, se--, se < 0 || M[te] !== be[se]) {
|
|
499
|
+
var Ae = `
|
|
500
|
+
` + M[te].replace(" at new ", " at ");
|
|
501
|
+
return e.displayName && Ae.includes("<anonymous>") && (Ae = Ae.replace("<anonymous>", e.displayName)), typeof e == "function" && ge.set(e, Ae), Ae;
|
|
488
502
|
}
|
|
489
|
-
while (
|
|
503
|
+
while (te >= 1 && se >= 0);
|
|
490
504
|
break;
|
|
491
505
|
}
|
|
492
506
|
}
|
|
493
507
|
} finally {
|
|
494
|
-
|
|
508
|
+
Be = !1, ve.current = I, Te(), Error.prepareStackTrace = S;
|
|
495
509
|
}
|
|
496
|
-
var
|
|
497
|
-
return typeof e == "function" &&
|
|
510
|
+
var Xe = e ? e.displayName || e.name : "", Ue = Xe ? ie(Xe) : "";
|
|
511
|
+
return typeof e == "function" && ge.set(e, Ue), Ue;
|
|
498
512
|
}
|
|
499
|
-
function
|
|
500
|
-
return
|
|
513
|
+
function Ee(e, n, s) {
|
|
514
|
+
return g(e, !1);
|
|
501
515
|
}
|
|
502
|
-
function
|
|
503
|
-
var
|
|
504
|
-
return !!(
|
|
516
|
+
function he(e) {
|
|
517
|
+
var n = e.prototype;
|
|
518
|
+
return !!(n && n.isReactComponent);
|
|
505
519
|
}
|
|
506
|
-
function
|
|
520
|
+
function H(e, n, s) {
|
|
507
521
|
if (e == null)
|
|
508
522
|
return "";
|
|
509
523
|
if (typeof e == "function")
|
|
510
|
-
return
|
|
524
|
+
return g(e, he(e));
|
|
511
525
|
if (typeof e == "string")
|
|
512
|
-
return
|
|
526
|
+
return ie(e);
|
|
513
527
|
switch (e) {
|
|
514
|
-
case
|
|
515
|
-
return
|
|
528
|
+
case b:
|
|
529
|
+
return ie("Suspense");
|
|
516
530
|
case D:
|
|
517
|
-
return
|
|
531
|
+
return ie("SuspenseList");
|
|
518
532
|
}
|
|
519
533
|
if (typeof e == "object")
|
|
520
534
|
switch (e.$$typeof) {
|
|
521
|
-
case
|
|
522
|
-
return
|
|
523
|
-
case
|
|
524
|
-
return
|
|
525
|
-
case
|
|
526
|
-
var
|
|
535
|
+
case R:
|
|
536
|
+
return Ee(e.render);
|
|
537
|
+
case k:
|
|
538
|
+
return H(e.type, n, s);
|
|
539
|
+
case F: {
|
|
540
|
+
var p = e, S = p._payload, I = p._init;
|
|
527
541
|
try {
|
|
528
|
-
return
|
|
542
|
+
return H(I(S), n, s);
|
|
529
543
|
} catch {
|
|
530
544
|
}
|
|
531
545
|
}
|
|
532
546
|
}
|
|
533
547
|
return "";
|
|
534
548
|
}
|
|
535
|
-
var
|
|
536
|
-
function
|
|
549
|
+
var fe = Object.prototype.hasOwnProperty, We = {}, we = T.ReactDebugCurrentFrame;
|
|
550
|
+
function _e(e) {
|
|
537
551
|
if (e) {
|
|
538
|
-
var
|
|
539
|
-
|
|
552
|
+
var n = e._owner, s = H(e.type, e._source, n ? n.type : null);
|
|
553
|
+
we.setExtraStackFrame(s);
|
|
540
554
|
} else
|
|
541
|
-
|
|
555
|
+
we.setExtraStackFrame(null);
|
|
542
556
|
}
|
|
543
|
-
function
|
|
557
|
+
function Ve(e, n, s, p, S) {
|
|
544
558
|
{
|
|
545
|
-
var
|
|
546
|
-
for (var
|
|
547
|
-
if (
|
|
548
|
-
var
|
|
559
|
+
var I = Function.call.bind(fe);
|
|
560
|
+
for (var A in e)
|
|
561
|
+
if (I(e, A)) {
|
|
562
|
+
var M = void 0;
|
|
549
563
|
try {
|
|
550
|
-
if (typeof e[
|
|
551
|
-
var
|
|
552
|
-
throw
|
|
564
|
+
if (typeof e[A] != "function") {
|
|
565
|
+
var be = Error((p || "React class") + ": " + s + " type `" + A + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[A] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
566
|
+
throw be.name = "Invariant Violation", be;
|
|
553
567
|
}
|
|
554
|
-
|
|
555
|
-
} catch (
|
|
556
|
-
|
|
568
|
+
M = e[A](n, A, p, s, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
569
|
+
} catch (te) {
|
|
570
|
+
M = te;
|
|
557
571
|
}
|
|
558
|
-
|
|
572
|
+
M && !(M instanceof Error) && (_e(S), m("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", p || "React class", s, A, typeof M), _e(null)), M instanceof Error && !(M.message in We) && (We[M.message] = !0, _e(S), m("Failed %s type: %s", s, M.message), _e(null));
|
|
559
573
|
}
|
|
560
574
|
}
|
|
561
575
|
}
|
|
562
|
-
var
|
|
563
|
-
function
|
|
564
|
-
return
|
|
576
|
+
var C = Array.isArray;
|
|
577
|
+
function y(e) {
|
|
578
|
+
return C(e);
|
|
565
579
|
}
|
|
566
|
-
function
|
|
580
|
+
function pe(e) {
|
|
567
581
|
{
|
|
568
|
-
var
|
|
569
|
-
return
|
|
582
|
+
var n = typeof Symbol == "function" && Symbol.toStringTag, s = n && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
583
|
+
return s;
|
|
570
584
|
}
|
|
571
585
|
}
|
|
572
|
-
function
|
|
586
|
+
function de(e) {
|
|
573
587
|
try {
|
|
574
|
-
return
|
|
588
|
+
return le(e), !1;
|
|
575
589
|
} catch {
|
|
576
590
|
return !0;
|
|
577
591
|
}
|
|
578
592
|
}
|
|
579
|
-
function
|
|
593
|
+
function le(e) {
|
|
580
594
|
return "" + e;
|
|
581
595
|
}
|
|
582
|
-
function
|
|
583
|
-
if (
|
|
584
|
-
return m("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
|
596
|
+
function ke(e) {
|
|
597
|
+
if (de(e))
|
|
598
|
+
return m("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", pe(e)), le(e);
|
|
585
599
|
}
|
|
586
|
-
var
|
|
600
|
+
var Oe = T.ReactCurrentOwner, Ie = {
|
|
587
601
|
key: !0,
|
|
588
602
|
ref: !0,
|
|
589
603
|
__self: !0,
|
|
590
604
|
__source: !0
|
|
591
|
-
},
|
|
592
|
-
function
|
|
593
|
-
if (
|
|
594
|
-
var
|
|
595
|
-
if (
|
|
605
|
+
}, De, Ze;
|
|
606
|
+
function at(e) {
|
|
607
|
+
if (fe.call(e, "ref")) {
|
|
608
|
+
var n = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
609
|
+
if (n && n.isReactWarning)
|
|
596
610
|
return !1;
|
|
597
611
|
}
|
|
598
612
|
return e.ref !== void 0;
|
|
599
613
|
}
|
|
600
|
-
function
|
|
601
|
-
if (
|
|
602
|
-
var
|
|
603
|
-
if (
|
|
614
|
+
function Ct(e) {
|
|
615
|
+
if (fe.call(e, "key")) {
|
|
616
|
+
var n = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
617
|
+
if (n && n.isReactWarning)
|
|
604
618
|
return !1;
|
|
605
619
|
}
|
|
606
620
|
return e.key !== void 0;
|
|
607
621
|
}
|
|
608
|
-
function
|
|
609
|
-
typeof e.ref == "string" &&
|
|
622
|
+
function Rt(e, n) {
|
|
623
|
+
typeof e.ref == "string" && Oe.current;
|
|
610
624
|
}
|
|
611
|
-
function
|
|
625
|
+
function Pt(e, n) {
|
|
612
626
|
{
|
|
613
|
-
var
|
|
614
|
-
|
|
627
|
+
var s = function() {
|
|
628
|
+
De || (De = !0, m("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
|
|
615
629
|
};
|
|
616
|
-
|
|
617
|
-
get:
|
|
630
|
+
s.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
631
|
+
get: s,
|
|
618
632
|
configurable: !0
|
|
619
633
|
});
|
|
620
634
|
}
|
|
621
635
|
}
|
|
622
|
-
function
|
|
636
|
+
function Ke(e, n) {
|
|
623
637
|
{
|
|
624
|
-
var
|
|
625
|
-
|
|
638
|
+
var s = function() {
|
|
639
|
+
Ze || (Ze = !0, m("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
|
|
626
640
|
};
|
|
627
|
-
|
|
628
|
-
get:
|
|
641
|
+
s.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
642
|
+
get: s,
|
|
629
643
|
configurable: !0
|
|
630
644
|
});
|
|
631
645
|
}
|
|
632
646
|
}
|
|
633
|
-
var
|
|
634
|
-
var
|
|
647
|
+
var qe = function(e, n, s, p, S, I, A) {
|
|
648
|
+
var M = {
|
|
635
649
|
// This tag allows us to uniquely identify this as a React Element
|
|
636
|
-
$$typeof:
|
|
650
|
+
$$typeof: l,
|
|
637
651
|
// Built-in properties that belong on the element
|
|
638
652
|
type: e,
|
|
639
|
-
key:
|
|
640
|
-
ref:
|
|
641
|
-
props:
|
|
653
|
+
key: n,
|
|
654
|
+
ref: s,
|
|
655
|
+
props: A,
|
|
642
656
|
// Record the component responsible for creating this element.
|
|
643
|
-
_owner:
|
|
657
|
+
_owner: I
|
|
644
658
|
};
|
|
645
|
-
return
|
|
659
|
+
return M._store = {}, Object.defineProperty(M._store, "validated", {
|
|
646
660
|
configurable: !1,
|
|
647
661
|
enumerable: !1,
|
|
648
662
|
writable: !0,
|
|
649
663
|
value: !1
|
|
650
|
-
}), Object.defineProperty(
|
|
664
|
+
}), Object.defineProperty(M, "_self", {
|
|
651
665
|
configurable: !1,
|
|
652
666
|
enumerable: !1,
|
|
653
667
|
writable: !1,
|
|
654
|
-
value:
|
|
655
|
-
}), Object.defineProperty(
|
|
668
|
+
value: p
|
|
669
|
+
}), Object.defineProperty(M, "_source", {
|
|
656
670
|
configurable: !1,
|
|
657
671
|
enumerable: !1,
|
|
658
672
|
writable: !1,
|
|
659
|
-
value:
|
|
660
|
-
}), Object.freeze && (Object.freeze(
|
|
673
|
+
value: S
|
|
674
|
+
}), Object.freeze && (Object.freeze(M.props), Object.freeze(M)), M;
|
|
661
675
|
};
|
|
662
|
-
function
|
|
676
|
+
function kt(e, n, s, p, S) {
|
|
663
677
|
{
|
|
664
|
-
var
|
|
665
|
-
|
|
666
|
-
for (
|
|
667
|
-
|
|
678
|
+
var I, A = {}, M = null, be = null;
|
|
679
|
+
s !== void 0 && (ke(s), M = "" + s), Ct(n) && (ke(n.key), M = "" + n.key), at(n) && (be = n.ref, Rt(n, S));
|
|
680
|
+
for (I in n)
|
|
681
|
+
fe.call(n, I) && !Ie.hasOwnProperty(I) && (A[I] = n[I]);
|
|
668
682
|
if (e && e.defaultProps) {
|
|
669
|
-
var
|
|
670
|
-
for (
|
|
671
|
-
|
|
683
|
+
var te = e.defaultProps;
|
|
684
|
+
for (I in te)
|
|
685
|
+
A[I] === void 0 && (A[I] = te[I]);
|
|
672
686
|
}
|
|
673
|
-
if (
|
|
674
|
-
var
|
|
675
|
-
|
|
687
|
+
if (M || be) {
|
|
688
|
+
var se = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
689
|
+
M && Pt(A, se), be && Ke(A, se);
|
|
676
690
|
}
|
|
677
|
-
return
|
|
691
|
+
return qe(e, M, be, S, p, Oe.current, A);
|
|
678
692
|
}
|
|
679
693
|
}
|
|
680
|
-
var
|
|
681
|
-
function
|
|
694
|
+
var ot = T.ReactCurrentOwner, pt = T.ReactDebugCurrentFrame;
|
|
695
|
+
function $e(e) {
|
|
682
696
|
if (e) {
|
|
683
|
-
var
|
|
684
|
-
|
|
697
|
+
var n = e._owner, s = H(e.type, e._source, n ? n.type : null);
|
|
698
|
+
pt.setExtraStackFrame(s);
|
|
685
699
|
} else
|
|
686
|
-
|
|
700
|
+
pt.setExtraStackFrame(null);
|
|
687
701
|
}
|
|
688
|
-
var
|
|
689
|
-
|
|
690
|
-
function
|
|
691
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
702
|
+
var it;
|
|
703
|
+
it = !1;
|
|
704
|
+
function Je(e) {
|
|
705
|
+
return typeof e == "object" && e !== null && e.$$typeof === l;
|
|
692
706
|
}
|
|
693
|
-
function
|
|
707
|
+
function lt() {
|
|
694
708
|
{
|
|
695
|
-
if (
|
|
696
|
-
var e =
|
|
709
|
+
if (ot.current) {
|
|
710
|
+
var e = P(ot.current.type);
|
|
697
711
|
if (e)
|
|
698
712
|
return `
|
|
699
713
|
|
|
@@ -702,148 +716,148 @@ Check the render method of \`` + e + "`.";
|
|
|
702
716
|
return "";
|
|
703
717
|
}
|
|
704
718
|
}
|
|
705
|
-
function
|
|
719
|
+
function ht(e) {
|
|
706
720
|
return "";
|
|
707
721
|
}
|
|
708
|
-
var
|
|
709
|
-
function
|
|
722
|
+
var wt = {};
|
|
723
|
+
function vt(e) {
|
|
710
724
|
{
|
|
711
|
-
var
|
|
712
|
-
if (!
|
|
713
|
-
var
|
|
714
|
-
|
|
725
|
+
var n = lt();
|
|
726
|
+
if (!n) {
|
|
727
|
+
var s = typeof e == "string" ? e : e.displayName || e.name;
|
|
728
|
+
s && (n = `
|
|
715
729
|
|
|
716
|
-
Check the top-level render call using <` +
|
|
730
|
+
Check the top-level render call using <` + s + ">.");
|
|
717
731
|
}
|
|
718
|
-
return
|
|
732
|
+
return n;
|
|
719
733
|
}
|
|
720
734
|
}
|
|
721
|
-
function
|
|
735
|
+
function st(e, n) {
|
|
722
736
|
{
|
|
723
737
|
if (!e._store || e._store.validated || e.key != null)
|
|
724
738
|
return;
|
|
725
739
|
e._store.validated = !0;
|
|
726
|
-
var
|
|
727
|
-
if (
|
|
740
|
+
var s = vt(n);
|
|
741
|
+
if (wt[s])
|
|
728
742
|
return;
|
|
729
|
-
|
|
730
|
-
var
|
|
731
|
-
e && e._owner && e._owner !==
|
|
743
|
+
wt[s] = !0;
|
|
744
|
+
var p = "";
|
|
745
|
+
e && e._owner && e._owner !== ot.current && (p = " It was passed a child from " + P(e._owner.type) + "."), $e(e), m('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', s, p), $e(null);
|
|
732
746
|
}
|
|
733
747
|
}
|
|
734
|
-
function
|
|
748
|
+
function gt(e, n) {
|
|
735
749
|
{
|
|
736
750
|
if (typeof e != "object")
|
|
737
751
|
return;
|
|
738
|
-
if (
|
|
739
|
-
for (var
|
|
740
|
-
var
|
|
741
|
-
|
|
752
|
+
if (y(e))
|
|
753
|
+
for (var s = 0; s < e.length; s++) {
|
|
754
|
+
var p = e[s];
|
|
755
|
+
Je(p) && st(p, n);
|
|
742
756
|
}
|
|
743
|
-
else if (
|
|
757
|
+
else if (Je(e))
|
|
744
758
|
e._store && (e._store.validated = !0);
|
|
745
759
|
else if (e) {
|
|
746
|
-
var
|
|
747
|
-
if (typeof
|
|
748
|
-
for (var
|
|
749
|
-
|
|
760
|
+
var S = Z(e);
|
|
761
|
+
if (typeof S == "function" && S !== e.entries)
|
|
762
|
+
for (var I = S.call(e), A; !(A = I.next()).done; )
|
|
763
|
+
Je(A.value) && st(A.value, n);
|
|
750
764
|
}
|
|
751
765
|
}
|
|
752
766
|
}
|
|
753
|
-
function
|
|
767
|
+
function Tt(e) {
|
|
754
768
|
{
|
|
755
|
-
var
|
|
756
|
-
if (
|
|
769
|
+
var n = e.type;
|
|
770
|
+
if (n == null || typeof n == "string")
|
|
757
771
|
return;
|
|
758
|
-
var
|
|
759
|
-
if (typeof
|
|
760
|
-
|
|
761
|
-
else if (typeof
|
|
772
|
+
var s;
|
|
773
|
+
if (typeof n == "function")
|
|
774
|
+
s = n.propTypes;
|
|
775
|
+
else if (typeof n == "object" && (n.$$typeof === R || // Note: Memo only checks outer props here.
|
|
762
776
|
// Inner props are checked in the reconciler.
|
|
763
|
-
|
|
764
|
-
|
|
777
|
+
n.$$typeof === k))
|
|
778
|
+
s = n.propTypes;
|
|
765
779
|
else
|
|
766
780
|
return;
|
|
767
|
-
if (
|
|
768
|
-
var
|
|
769
|
-
|
|
770
|
-
} else if (
|
|
771
|
-
|
|
772
|
-
var
|
|
773
|
-
m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",
|
|
781
|
+
if (s) {
|
|
782
|
+
var p = P(n);
|
|
783
|
+
Ve(s, e.props, "prop", p, e);
|
|
784
|
+
} else if (n.PropTypes !== void 0 && !it) {
|
|
785
|
+
it = !0;
|
|
786
|
+
var S = P(n);
|
|
787
|
+
m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", S || "Unknown");
|
|
774
788
|
}
|
|
775
|
-
typeof
|
|
789
|
+
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
776
790
|
}
|
|
777
791
|
}
|
|
778
|
-
function
|
|
792
|
+
function St(e) {
|
|
779
793
|
{
|
|
780
|
-
for (var
|
|
781
|
-
var
|
|
782
|
-
if (
|
|
783
|
-
|
|
794
|
+
for (var n = Object.keys(e.props), s = 0; s < n.length; s++) {
|
|
795
|
+
var p = n[s];
|
|
796
|
+
if (p !== "children" && p !== "key") {
|
|
797
|
+
$e(e), m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", p), $e(null);
|
|
784
798
|
break;
|
|
785
799
|
}
|
|
786
800
|
}
|
|
787
|
-
e.ref !== null && (
|
|
801
|
+
e.ref !== null && ($e(e), m("Invalid attribute `ref` supplied to `React.Fragment`."), $e(null));
|
|
788
802
|
}
|
|
789
803
|
}
|
|
790
|
-
var
|
|
791
|
-
function
|
|
804
|
+
var Et = {};
|
|
805
|
+
function _t(e, n, s, p, S, I) {
|
|
792
806
|
{
|
|
793
|
-
var
|
|
794
|
-
if (!
|
|
795
|
-
var
|
|
796
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
797
|
-
var
|
|
798
|
-
|
|
799
|
-
var
|
|
800
|
-
e === null ?
|
|
807
|
+
var A = ae(e);
|
|
808
|
+
if (!A) {
|
|
809
|
+
var M = "";
|
|
810
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (M += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
811
|
+
var be = ht();
|
|
812
|
+
be ? M += be : M += lt();
|
|
813
|
+
var te;
|
|
814
|
+
e === null ? te = "null" : y(e) ? te = "array" : e !== void 0 && e.$$typeof === l ? (te = "<" + (P(e.type) || "Unknown") + " />", M = " Did you accidentally export a JSX literal instead of a component?") : te = typeof e, m("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", te, M);
|
|
801
815
|
}
|
|
802
|
-
var
|
|
803
|
-
if (
|
|
804
|
-
return
|
|
805
|
-
if (
|
|
806
|
-
var
|
|
807
|
-
if (
|
|
808
|
-
if (
|
|
809
|
-
if (
|
|
810
|
-
for (var
|
|
811
|
-
|
|
812
|
-
Object.freeze && Object.freeze(
|
|
816
|
+
var se = kt(e, n, s, S, I);
|
|
817
|
+
if (se == null)
|
|
818
|
+
return se;
|
|
819
|
+
if (A) {
|
|
820
|
+
var Ae = n.children;
|
|
821
|
+
if (Ae !== void 0)
|
|
822
|
+
if (p)
|
|
823
|
+
if (y(Ae)) {
|
|
824
|
+
for (var Xe = 0; Xe < Ae.length; Xe++)
|
|
825
|
+
gt(Ae[Xe], e);
|
|
826
|
+
Object.freeze && Object.freeze(Ae);
|
|
813
827
|
} else
|
|
814
828
|
m("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
815
829
|
else
|
|
816
|
-
|
|
830
|
+
gt(Ae, e);
|
|
817
831
|
}
|
|
818
|
-
if (
|
|
819
|
-
var
|
|
820
|
-
return
|
|
821
|
-
}),
|
|
822
|
-
if (!
|
|
823
|
-
var
|
|
832
|
+
if (fe.call(n, "key")) {
|
|
833
|
+
var Ue = P(e), Re = Object.keys(n).filter(function(er) {
|
|
834
|
+
return er !== "key";
|
|
835
|
+
}), Dt = Re.length > 0 ? "{key: someKey, " + Re.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
836
|
+
if (!Et[Ue + Dt]) {
|
|
837
|
+
var Qt = Re.length > 0 ? "{" + Re.join(": ..., ") + ": ...}" : "{}";
|
|
824
838
|
m(`A props object containing a "key" prop is being spread into JSX:
|
|
825
839
|
let props = %s;
|
|
826
840
|
<%s {...props} />
|
|
827
841
|
React keys must be passed directly to JSX without using spread:
|
|
828
842
|
let props = %s;
|
|
829
|
-
<%s key={someKey} {...props} />`,
|
|
843
|
+
<%s key={someKey} {...props} />`, Dt, Ue, Qt, Ue), Et[Ue + Dt] = !0;
|
|
830
844
|
}
|
|
831
845
|
}
|
|
832
|
-
return e ===
|
|
846
|
+
return e === u ? St(se) : Tt(se), se;
|
|
833
847
|
}
|
|
834
848
|
}
|
|
835
|
-
function
|
|
836
|
-
return
|
|
849
|
+
function t(e, n, s) {
|
|
850
|
+
return _t(e, n, s, !0);
|
|
837
851
|
}
|
|
838
|
-
function
|
|
839
|
-
return
|
|
852
|
+
function a(e, n, s) {
|
|
853
|
+
return _t(e, n, s, !1);
|
|
840
854
|
}
|
|
841
|
-
var
|
|
842
|
-
|
|
843
|
-
}()),
|
|
855
|
+
var o = a, c = t;
|
|
856
|
+
ut.Fragment = u, ut.jsx = o, ut.jsxs = c;
|
|
857
|
+
}()), ut;
|
|
844
858
|
}
|
|
845
|
-
process.env.NODE_ENV === "production" ?
|
|
846
|
-
var
|
|
859
|
+
process.env.NODE_ENV === "production" ? Ot.exports = zr() : Ot.exports = Gr();
|
|
860
|
+
var Le = Ot.exports, rt = (i) => pr("path", i), nt = Zt(
|
|
847
861
|
/**
|
|
848
862
|
* @param {SVGProps} props isPressed indicates whether the SVG should appear as pressed.
|
|
849
863
|
* Other props will be passed through to svg component.
|
|
@@ -851,650 +865,675 @@ var Ae = It.exports, rt = (n) => cr("path", n), nt = Ut(
|
|
|
851
865
|
*
|
|
852
866
|
* @return {React.JSX.Element} Stop component
|
|
853
867
|
*/
|
|
854
|
-
({ className:
|
|
855
|
-
const
|
|
868
|
+
({ className: i, isPressed: l, ...f }, u) => {
|
|
869
|
+
const w = {
|
|
856
870
|
...f,
|
|
857
|
-
className:
|
|
871
|
+
className: hr(i, { "is-pressed": l }) || void 0,
|
|
858
872
|
"aria-hidden": !0,
|
|
859
873
|
focusable: !1
|
|
860
874
|
};
|
|
861
|
-
return /* @__PURE__ */
|
|
875
|
+
return /* @__PURE__ */ Le.jsx("svg", { ...w, ref: u });
|
|
862
876
|
}
|
|
863
877
|
);
|
|
864
878
|
nt.displayName = "SVG";
|
|
865
|
-
const
|
|
879
|
+
const Yr = /* @__PURE__ */ Le.jsx(nt, {
|
|
866
880
|
viewBox: "0 0 24 24",
|
|
867
881
|
xmlns: "http://www.w3.org/2000/svg",
|
|
868
|
-
children: /* @__PURE__ */
|
|
882
|
+
children: /* @__PURE__ */ Le.jsx(rt, {
|
|
869
883
|
d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"
|
|
870
884
|
})
|
|
871
|
-
}),
|
|
885
|
+
}), Zr = /* @__PURE__ */ Le.jsx(nt, {
|
|
872
886
|
xmlns: "http://www.w3.org/2000/svg",
|
|
873
887
|
viewBox: "0 0 24 24",
|
|
874
|
-
children: /* @__PURE__ */
|
|
888
|
+
children: /* @__PURE__ */ Le.jsx(rt, {
|
|
875
889
|
d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
|
|
876
890
|
})
|
|
877
|
-
}),
|
|
891
|
+
}), Kr = /* @__PURE__ */ Le.jsx(nt, {
|
|
878
892
|
viewBox: "0 0 24 24",
|
|
879
893
|
xmlns: "http://www.w3.org/2000/svg",
|
|
880
|
-
children: /* @__PURE__ */
|
|
894
|
+
children: /* @__PURE__ */ Le.jsx(rt, {
|
|
881
895
|
fillRule: "evenodd",
|
|
882
896
|
clipRule: "evenodd",
|
|
883
897
|
d: "M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z"
|
|
884
898
|
})
|
|
885
|
-
}),
|
|
899
|
+
}), qr = /* @__PURE__ */ Le.jsxs(nt, {
|
|
886
900
|
xmlns: "http://www.w3.org/2000/svg",
|
|
887
901
|
viewBox: "0 0 24 24",
|
|
888
|
-
children: [/* @__PURE__ */
|
|
902
|
+
children: [/* @__PURE__ */ Le.jsx(rt, {
|
|
889
903
|
d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"
|
|
890
|
-
}), /* @__PURE__ */
|
|
904
|
+
}), /* @__PURE__ */ Le.jsx(rt, {
|
|
891
905
|
d: "M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"
|
|
892
906
|
})]
|
|
893
|
-
}),
|
|
907
|
+
}), Jr = /* @__PURE__ */ Le.jsx(nt, {
|
|
894
908
|
xmlns: "http://www.w3.org/2000/svg",
|
|
895
909
|
viewBox: "0 0 24 24",
|
|
896
|
-
children: /* @__PURE__ */
|
|
910
|
+
children: /* @__PURE__ */ Le.jsx(rt, {
|
|
897
911
|
d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"
|
|
898
912
|
})
|
|
899
|
-
}),
|
|
900
|
-
filePickerTree:
|
|
901
|
-
fileNodeButton:
|
|
902
|
-
selected:
|
|
903
|
-
focused:
|
|
904
|
-
dropTarget:
|
|
905
|
-
dropTargetInvalid:
|
|
906
|
-
renaming:
|
|
907
|
-
renameInput:
|
|
908
|
-
fileName:
|
|
913
|
+
}), Xr = "_file-picker-tree_12ffp_1", Qr = "_file-node-button_12ffp_17", en = "_selected_12ffp_56", tn = "_focused_12ffp_75", rn = "_dropTarget_12ffp_83", nn = "_dropTargetInvalid_12ffp_95", an = "_renaming_12ffp_104", on = "_renameInput_12ffp_109", ln = "_file-name_12ffp_124", sn = "_path-badge_12ffp_128", cn = "_path-badge-tooltip_12ffp_140", ye = {
|
|
914
|
+
filePickerTree: Xr,
|
|
915
|
+
fileNodeButton: Qr,
|
|
916
|
+
selected: en,
|
|
917
|
+
focused: tn,
|
|
918
|
+
dropTarget: rn,
|
|
919
|
+
dropTargetInvalid: nn,
|
|
920
|
+
renaming: an,
|
|
921
|
+
renameInput: on,
|
|
922
|
+
fileName: ln,
|
|
923
|
+
pathBadge: sn,
|
|
924
|
+
pathBadgeTooltip: cn
|
|
909
925
|
};
|
|
910
|
-
function
|
|
911
|
-
if (!
|
|
912
|
-
const
|
|
913
|
-
let
|
|
914
|
-
f &&
|
|
915
|
-
for (const
|
|
916
|
-
!
|
|
917
|
-
return
|
|
926
|
+
function Lt(i) {
|
|
927
|
+
if (!i) return [];
|
|
928
|
+
const l = rr(i), f = l.startsWith("/"), u = l.split("/").filter(Boolean), w = [];
|
|
929
|
+
let h = f ? "/" : "";
|
|
930
|
+
f && w.push("/");
|
|
931
|
+
for (const x of u)
|
|
932
|
+
!h || h === "/" ? h = h === "/" ? `/${x}` : x : h = `${h}/${x}`, w.push(h);
|
|
933
|
+
return w;
|
|
918
934
|
}
|
|
919
|
-
function
|
|
920
|
-
return
|
|
935
|
+
function Ge(i, l, f) {
|
|
936
|
+
return i && (i === l ? f : i.startsWith(l === "/" ? "/" : `${l}/`) ? f + i.slice(l.length) : i);
|
|
921
937
|
}
|
|
922
|
-
const
|
|
923
|
-
withContextMenu:
|
|
938
|
+
const un = bt(function({
|
|
939
|
+
withContextMenu: l = !0,
|
|
924
940
|
readOnly: f = !1,
|
|
925
|
-
filesystem:
|
|
926
|
-
root:
|
|
927
|
-
initialSelectedPath:
|
|
928
|
-
onSelect:
|
|
941
|
+
filesystem: u,
|
|
942
|
+
root: w = "/wordpress",
|
|
943
|
+
initialSelectedPath: h,
|
|
944
|
+
onSelect: x = () => {
|
|
929
945
|
},
|
|
930
|
-
onDoubleClickFile:
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
946
|
+
onDoubleClickFile: E,
|
|
947
|
+
pathBadges: R,
|
|
948
|
+
onMountFromGit: b,
|
|
949
|
+
onPathRenamed: D
|
|
950
|
+
}, k) {
|
|
951
|
+
const F = ft(() => Me("/", w || "/"), [w]), Q = ft(
|
|
952
|
+
() => Me(F, "wp-content", "plugins"),
|
|
953
|
+
[F]
|
|
954
|
+
), J = ft(
|
|
955
|
+
() => Me(F, "wp-content", "themes"),
|
|
956
|
+
[F]
|
|
957
|
+
), [v, Z] = K(() => {
|
|
958
|
+
if (!h)
|
|
934
959
|
return {};
|
|
935
960
|
const t = {};
|
|
936
|
-
for (const a of
|
|
961
|
+
for (const a of Lt(h))
|
|
937
962
|
t[a] = !0;
|
|
938
963
|
return t;
|
|
939
|
-
}), [
|
|
940
|
-
() =>
|
|
941
|
-
), [
|
|
942
|
-
() =>
|
|
943
|
-
), [
|
|
964
|
+
}), [T, m] = K(
|
|
965
|
+
() => h ?? null
|
|
966
|
+
), [N, j] = K(
|
|
967
|
+
() => h ?? null
|
|
968
|
+
), [L, U] = K({}), [re, ne] = K(
|
|
944
969
|
{}
|
|
945
|
-
), [
|
|
970
|
+
), [X, ae] = K(null), [_, d] = K(
|
|
946
971
|
null
|
|
947
|
-
),
|
|
948
|
-
for (const t of Object.keys(
|
|
949
|
-
clearTimeout(
|
|
950
|
-
},
|
|
951
|
-
const a =
|
|
952
|
-
a && (clearTimeout(a), delete
|
|
972
|
+
), P = O({}), V = O(!1), z = O(null), $ = O(null), G = O(re), ce = O(L), me = () => {
|
|
973
|
+
for (const t of Object.keys(P.current))
|
|
974
|
+
clearTimeout(P.current[t]), delete P.current[t];
|
|
975
|
+
}, Y = (t) => {
|
|
976
|
+
const a = P.current[t];
|
|
977
|
+
a && (clearTimeout(a), delete P.current[t]);
|
|
953
978
|
};
|
|
954
|
-
|
|
955
|
-
G.current =
|
|
956
|
-
}, [
|
|
957
|
-
|
|
958
|
-
}, [
|
|
959
|
-
const
|
|
979
|
+
W(() => {
|
|
980
|
+
G.current = re;
|
|
981
|
+
}, [re]), W(() => {
|
|
982
|
+
ce.current = L;
|
|
983
|
+
}, [L]);
|
|
984
|
+
const ee = (t) => {
|
|
960
985
|
var o;
|
|
961
|
-
const a = (o =
|
|
986
|
+
const a = (o = z.current) == null ? void 0 : o.querySelector(
|
|
962
987
|
`[data-path="${CSS.escape(t)}"]`
|
|
963
988
|
);
|
|
964
989
|
a && typeof a.focus == "function" && (a.focus(), a.scrollIntoView({
|
|
965
990
|
behavior: "smooth",
|
|
966
991
|
block: "nearest"
|
|
967
992
|
}));
|
|
968
|
-
},
|
|
969
|
-
const o = await t.listFiles(a),
|
|
970
|
-
for (const
|
|
971
|
-
const
|
|
972
|
-
|
|
973
|
-
}
|
|
974
|
-
return
|
|
975
|
-
var
|
|
976
|
-
if (
|
|
977
|
-
const
|
|
978
|
-
if (
|
|
979
|
-
if (
|
|
980
|
-
if (
|
|
993
|
+
}, ue = (t, a = "") => a ? Me(a, t.name) : Me("/", t.name), Pe = (t, a) => t.children ? t.children : L[a], oe = async (t, a) => {
|
|
994
|
+
const o = await t.listFiles(a), c = [];
|
|
995
|
+
for (const e of o) {
|
|
996
|
+
const n = a === "/" ? `/${e}` : `${a}/${e}`, s = await t.isDir(n);
|
|
997
|
+
c.push({ name: e, type: s ? "folder" : "file" });
|
|
998
|
+
}
|
|
999
|
+
return c.sort((e, n) => {
|
|
1000
|
+
var I;
|
|
1001
|
+
if (e.type !== n.type) return e.type === "folder" ? -1 : 1;
|
|
1002
|
+
const s = a === "/" ? `/${e.name}` : `${a}/${e.name}`, p = a === "/" ? `/${n.name}` : `${a}/${n.name}`, S = (I = _e.current) == null ? void 0 : I.tempPath;
|
|
1003
|
+
if (S) {
|
|
1004
|
+
if (s === S) return -1;
|
|
1005
|
+
if (p === S) return 1;
|
|
981
1006
|
}
|
|
982
|
-
return
|
|
983
|
-
}),
|
|
984
|
-
},
|
|
1007
|
+
return e.name.localeCompare(n.name);
|
|
1008
|
+
}), c;
|
|
1009
|
+
}, Te = async (t) => await oe(u, t), ve = (t, a) => {
|
|
985
1010
|
if (a.type !== "folder")
|
|
986
1011
|
return a.children;
|
|
987
|
-
const o = a.children ??
|
|
988
|
-
return o || G.current[t] ? o : (
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
...
|
|
992
|
-
[t]:
|
|
993
|
-
})),
|
|
1012
|
+
const o = a.children ?? ce.current[t];
|
|
1013
|
+
return o || G.current[t] ? o : (ne((c) => ({ ...c, [t]: !0 })), new Promise((c) => {
|
|
1014
|
+
Te(t).then((e) => {
|
|
1015
|
+
U((n) => ({
|
|
1016
|
+
...n,
|
|
1017
|
+
[t]: e ?? []
|
|
1018
|
+
})), c(e ?? []);
|
|
994
1019
|
}).catch(() => {
|
|
995
|
-
|
|
1020
|
+
c([]);
|
|
996
1021
|
}).finally(() => {
|
|
997
|
-
|
|
998
|
-
const
|
|
999
|
-
return delete
|
|
1022
|
+
ne((e) => {
|
|
1023
|
+
const n = { ...e };
|
|
1024
|
+
return delete n[t], n;
|
|
1000
1025
|
});
|
|
1001
1026
|
});
|
|
1002
1027
|
}));
|
|
1003
|
-
},
|
|
1004
|
-
a.type === "folder" && (typeof window > "u" ||
|
|
1005
|
-
|
|
1028
|
+
}, Ce = (t, a) => {
|
|
1029
|
+
a.type === "folder" && (typeof window > "u" || P.current[t] || (P.current[t] = window.setTimeout(() => {
|
|
1030
|
+
Z((o) => o[t] ? o : { ...o, [t]: !0 }), ve(t, a), delete P.current[t];
|
|
1006
1031
|
}, 600)));
|
|
1007
|
-
},
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
...
|
|
1032
|
+
}, ie = (t) => (ne((a) => ({ ...a, [t]: !0 })), new Promise((a) => {
|
|
1033
|
+
Te(t).then((o) => {
|
|
1034
|
+
U((c) => ({
|
|
1035
|
+
...c,
|
|
1011
1036
|
[t]: o ?? []
|
|
1012
1037
|
})), a(o ?? []);
|
|
1013
1038
|
}).catch(() => {
|
|
1014
1039
|
a([]);
|
|
1015
1040
|
}).finally(() => {
|
|
1016
|
-
|
|
1017
|
-
const
|
|
1018
|
-
return delete
|
|
1041
|
+
ne((o) => {
|
|
1042
|
+
const c = { ...o };
|
|
1043
|
+
return delete c[t], c;
|
|
1019
1044
|
});
|
|
1020
1045
|
});
|
|
1021
|
-
})),
|
|
1022
|
-
|
|
1023
|
-
...
|
|
1046
|
+
})), Be = (t, a, o) => {
|
|
1047
|
+
Z((c) => ({
|
|
1048
|
+
...c,
|
|
1024
1049
|
[t]: o
|
|
1025
|
-
})), o ?
|
|
1026
|
-
if (
|
|
1027
|
-
return
|
|
1028
|
-
const
|
|
1029
|
-
return delete
|
|
1050
|
+
})), o ? ve(t, a) : U((c) => {
|
|
1051
|
+
if (c[t] === void 0)
|
|
1052
|
+
return c;
|
|
1053
|
+
const e = { ...c };
|
|
1054
|
+
return delete e[t], e;
|
|
1030
1055
|
});
|
|
1031
|
-
},
|
|
1056
|
+
}, ge = async (t) => {
|
|
1032
1057
|
if (!t) return;
|
|
1033
|
-
const a =
|
|
1058
|
+
const a = Lt(t);
|
|
1034
1059
|
if (a.length === 0) return;
|
|
1035
|
-
|
|
1036
|
-
const
|
|
1037
|
-
for (const
|
|
1038
|
-
|
|
1039
|
-
return
|
|
1060
|
+
Z((e) => {
|
|
1061
|
+
const n = { ...e };
|
|
1062
|
+
for (const s of a)
|
|
1063
|
+
n[s] = !0;
|
|
1064
|
+
return n;
|
|
1040
1065
|
});
|
|
1041
1066
|
let o = [
|
|
1042
|
-
{ name:
|
|
1043
|
-
],
|
|
1044
|
-
for (const
|
|
1045
|
-
const
|
|
1046
|
-
if (!
|
|
1047
|
-
|
|
1067
|
+
{ name: F, type: "folder" }
|
|
1068
|
+
], c = "";
|
|
1069
|
+
for (const e of a) {
|
|
1070
|
+
const n = o == null ? void 0 : o.find((p) => ue(p, c) === e);
|
|
1071
|
+
if (!n || n.type !== "folder") {
|
|
1072
|
+
c = e, o = [];
|
|
1048
1073
|
continue;
|
|
1049
1074
|
}
|
|
1050
|
-
o = await
|
|
1051
|
-
}
|
|
1052
|
-
},
|
|
1053
|
-
!t || !a || t === a || (
|
|
1054
|
-
let
|
|
1055
|
-
const
|
|
1056
|
-
for (const
|
|
1057
|
-
const
|
|
1058
|
-
|
|
1075
|
+
o = await ve(e, n) ?? ce.current[e], c = e;
|
|
1076
|
+
}
|
|
1077
|
+
}, Se = (t, a) => {
|
|
1078
|
+
!t || !a || t === a || (Z((o) => {
|
|
1079
|
+
let c = !1;
|
|
1080
|
+
const e = { ...o };
|
|
1081
|
+
for (const n of Object.keys(o)) {
|
|
1082
|
+
const s = Ge(n, t, a);
|
|
1083
|
+
s && s !== n && (e[s] = o[n], delete e[n], c = !0);
|
|
1059
1084
|
}
|
|
1060
|
-
return
|
|
1061
|
-
}),
|
|
1062
|
-
let
|
|
1063
|
-
const
|
|
1064
|
-
for (const
|
|
1065
|
-
const
|
|
1066
|
-
|
|
1085
|
+
return c ? e : o;
|
|
1086
|
+
}), U((o) => {
|
|
1087
|
+
let c = !1;
|
|
1088
|
+
const e = { ...o };
|
|
1089
|
+
for (const n of Object.keys(o)) {
|
|
1090
|
+
const s = Ge(n, t, a);
|
|
1091
|
+
s && s !== n && (e[s] = o[n], delete e[n], c = !0);
|
|
1067
1092
|
}
|
|
1068
|
-
return
|
|
1069
|
-
}),
|
|
1070
|
-
},
|
|
1071
|
-
|
|
1072
|
-
},
|
|
1073
|
-
|
|
1074
|
-
},
|
|
1075
|
-
|
|
1076
|
-
|
|
1093
|
+
return c ? e : o;
|
|
1094
|
+
}), m((o) => Ge(o, t, a)), j((o) => Ge(o, t, a)));
|
|
1095
|
+
}, g = () => {
|
|
1096
|
+
ae(null), d(null), me();
|
|
1097
|
+
}, Ee = (t, a = !0) => {
|
|
1098
|
+
m(t), a && x(t);
|
|
1099
|
+
}, he = ft(() => [{ name: F, type: "folder" }], [F]), [H, fe] = K(null), [We, we] = K(null), _e = O(null), Ve = f ? null : We;
|
|
1100
|
+
xt(
|
|
1101
|
+
k,
|
|
1077
1102
|
() => ({
|
|
1078
1103
|
focusPath: (t, a = {}) => {
|
|
1079
1104
|
if (!t) return;
|
|
1080
1105
|
const {
|
|
1081
1106
|
select: o = !0,
|
|
1082
|
-
domFocus:
|
|
1083
|
-
notify:
|
|
1107
|
+
domFocus: c = !0,
|
|
1108
|
+
notify: e = !1
|
|
1084
1109
|
} = a;
|
|
1085
|
-
o &&
|
|
1110
|
+
o && Ee(t, e), j(t), c && ee(t);
|
|
1086
1111
|
},
|
|
1087
1112
|
selectPath: (t) => {
|
|
1088
|
-
t && (
|
|
1113
|
+
t && (Ee(t), j(t), ee(t));
|
|
1114
|
+
},
|
|
1115
|
+
getSelectedPath: () => T,
|
|
1116
|
+
expandToPath: async (t) => await ge(t),
|
|
1117
|
+
refresh: async (t) => await ie(t),
|
|
1118
|
+
revealPath: async (t) => {
|
|
1119
|
+
const a = Ne(t);
|
|
1120
|
+
await ie(a), await ge(a), await ie(t), Z((o) => ({ ...o, [t]: !0 })), Ee(t, !1), j(t), setTimeout(() => ee(t), 0);
|
|
1089
1121
|
},
|
|
1090
|
-
|
|
1091
|
-
expandToPath: async (t) => await _e(t),
|
|
1092
|
-
refresh: async (t) => await ae(t),
|
|
1093
|
-
remapPath: ke,
|
|
1122
|
+
remapPath: Se,
|
|
1094
1123
|
createFile: async (t) => {
|
|
1095
|
-
f || await
|
|
1124
|
+
f || await qe(t, "file", "untitled.php");
|
|
1096
1125
|
},
|
|
1097
1126
|
createFolder: async (t) => {
|
|
1098
|
-
f || await
|
|
1127
|
+
f || await qe(t, "folder", "New Folder");
|
|
1099
1128
|
},
|
|
1100
1129
|
importFiles: async (t, a) => {
|
|
1101
|
-
f || await
|
|
1130
|
+
f || await wt(t, a);
|
|
1102
1131
|
},
|
|
1103
1132
|
importDataTransfer: async (t, a) => {
|
|
1104
|
-
f || await
|
|
1133
|
+
f || await vt(t, a);
|
|
1105
1134
|
}
|
|
1106
1135
|
}),
|
|
1107
|
-
[
|
|
1136
|
+
[T, ie, Se, ge, f]
|
|
1108
1137
|
);
|
|
1109
|
-
const
|
|
1110
|
-
|
|
1111
|
-
),
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
}, [
|
|
1115
|
-
|
|
1116
|
-
}, [
|
|
1117
|
-
if (!
|
|
1138
|
+
const C = O(!1), y = O(
|
|
1139
|
+
h ?? null
|
|
1140
|
+
), pe = O(h);
|
|
1141
|
+
W(() => {
|
|
1142
|
+
V.current = !1;
|
|
1143
|
+
}, [F]), W(() => {
|
|
1144
|
+
h && h !== pe.current ? y.current = h : h || (y.current = null), pe.current = h;
|
|
1145
|
+
}, [h]), W(() => {
|
|
1146
|
+
if (!h || C.current)
|
|
1118
1147
|
return;
|
|
1119
|
-
|
|
1120
|
-
const t =
|
|
1121
|
-
|
|
1122
|
-
const
|
|
1123
|
-
for (const
|
|
1124
|
-
|
|
1125
|
-
return
|
|
1148
|
+
C.current = !0;
|
|
1149
|
+
const t = Lt(h);
|
|
1150
|
+
Z((o) => {
|
|
1151
|
+
const c = { ...o };
|
|
1152
|
+
for (const e of t)
|
|
1153
|
+
c[e] = !0;
|
|
1154
|
+
return c;
|
|
1126
1155
|
});
|
|
1127
|
-
const a = t[t.length - 1] ||
|
|
1128
|
-
|
|
1129
|
-
}, [
|
|
1130
|
-
const t =
|
|
1131
|
-
!t ||
|
|
1132
|
-
}, [
|
|
1133
|
-
if (!
|
|
1134
|
-
if (
|
|
1135
|
-
const t =
|
|
1136
|
-
|
|
1156
|
+
const a = t[t.length - 1] || h;
|
|
1157
|
+
j(a), m(a), ge(h);
|
|
1158
|
+
}, [h, ge]), W(() => {
|
|
1159
|
+
const t = y.current;
|
|
1160
|
+
!t || he.length === 0 || (y.current = null, ge(t));
|
|
1161
|
+
}, [he, ge]), W(() => {
|
|
1162
|
+
if (!N) {
|
|
1163
|
+
if (he.length > 0) {
|
|
1164
|
+
const t = ue(he[0]);
|
|
1165
|
+
j(t);
|
|
1137
1166
|
}
|
|
1138
1167
|
return;
|
|
1139
1168
|
}
|
|
1140
|
-
|
|
1141
|
-
}, [
|
|
1142
|
-
if (
|
|
1169
|
+
Ve && Ve === N || ee(N);
|
|
1170
|
+
}, [he, N, Ve]), W(() => {
|
|
1171
|
+
if (he.length === 0)
|
|
1143
1172
|
return;
|
|
1144
|
-
const t =
|
|
1145
|
-
if ((t == null ? void 0 : t.type) !== "folder" ||
|
|
1173
|
+
const t = he[0];
|
|
1174
|
+
if ((t == null ? void 0 : t.type) !== "folder" || V.current)
|
|
1146
1175
|
return;
|
|
1147
1176
|
const a = t.name;
|
|
1148
|
-
|
|
1177
|
+
V.current = !0, Z(
|
|
1149
1178
|
(o) => o[a] ? o : { ...o, [a]: !0 }
|
|
1150
|
-
), !
|
|
1151
|
-
}, [
|
|
1152
|
-
|
|
1153
|
-
}, []),
|
|
1154
|
-
|
|
1179
|
+
), !ce.current[a] && !G.current[a] && ve(a, t);
|
|
1180
|
+
}, [he, ve, F]), W(() => () => {
|
|
1181
|
+
$.current && clearTimeout($.current), me();
|
|
1182
|
+
}, []), W(() => {
|
|
1183
|
+
H && setTimeout(() => {
|
|
1155
1184
|
const t = document.querySelector(
|
|
1156
1185
|
'[role="menu"] [role="menuitem"]'
|
|
1157
1186
|
);
|
|
1158
1187
|
t && typeof t.focus == "function" && t.focus();
|
|
1159
1188
|
}, 0);
|
|
1160
|
-
}, [
|
|
1161
|
-
const [
|
|
1189
|
+
}, [H]);
|
|
1190
|
+
const [de, le] = K(""), ke = (t, a) => {
|
|
1162
1191
|
if (t.type === "folder")
|
|
1163
1192
|
return a;
|
|
1164
|
-
const o =
|
|
1193
|
+
const o = Ne(a);
|
|
1165
1194
|
return o && o || "/";
|
|
1166
|
-
},
|
|
1167
|
-
const
|
|
1168
|
-
return
|
|
1195
|
+
}, Oe = (t, a, o) => {
|
|
1196
|
+
const c = ke(t, a);
|
|
1197
|
+
return c ? o && nr(o, c) ? { allowed: !1, state: "invalid", destination: null } : { allowed: !0, state: "valid", destination: c } : { allowed: !1, state: "invalid", destination: null };
|
|
1169
1198
|
}, Ie = (t, a, o) => {
|
|
1170
|
-
a.type !== "folder" && a.type !== "file" || (
|
|
1199
|
+
a.type !== "folder" && a.type !== "file" || (ae(o), d(null), t.dataTransfer && (t.dataTransfer.effectAllowed = "move", t.dataTransfer.setData(
|
|
1171
1200
|
"application/x-wp-playground-path",
|
|
1172
1201
|
o
|
|
1173
1202
|
), t.dataTransfer.setData("text/plain", o)));
|
|
1174
|
-
},
|
|
1175
|
-
|
|
1176
|
-
},
|
|
1177
|
-
const
|
|
1178
|
-
|
|
1179
|
-
},
|
|
1180
|
-
const
|
|
1181
|
-
|
|
1182
|
-
},
|
|
1183
|
-
|
|
1184
|
-
const
|
|
1185
|
-
|
|
1186
|
-
},
|
|
1187
|
-
const
|
|
1188
|
-
if (!
|
|
1189
|
-
|
|
1203
|
+
}, De = () => {
|
|
1204
|
+
g();
|
|
1205
|
+
}, Ze = (t, a, o) => {
|
|
1206
|
+
const c = Oe(a, o, X);
|
|
1207
|
+
c.allowed && a.type === "folder" && Ce(o, a), d((e) => (e == null ? void 0 : e.path) === o && e.state === c.state ? e : { path: o, state: c.state });
|
|
1208
|
+
}, at = (t, a, o) => {
|
|
1209
|
+
const c = Oe(a, o, X);
|
|
1210
|
+
c.allowed && c.destination ? (t.preventDefault(), t.dataTransfer && (t.dataTransfer.dropEffect = X ? "move" : "copy"), a.type === "folder" && Ce(o, a), d((e) => (e == null ? void 0 : e.path) === o && e.state === c.state ? e : { path: o, state: c.state })) : (t.dataTransfer && (t.dataTransfer.dropEffect = "none"), Y(o), d((e) => (e == null ? void 0 : e.path) === o && e.state === "invalid" ? e : { path: o, state: "invalid" }));
|
|
1211
|
+
}, Ct = (t, a, o) => {
|
|
1212
|
+
Y(o);
|
|
1213
|
+
const c = t.relatedTarget;
|
|
1214
|
+
c && t.currentTarget.contains(c) || d((e) => (e == null ? void 0 : e.path) === o ? null : e);
|
|
1215
|
+
}, Rt = async (t, a, o) => {
|
|
1216
|
+
const c = X, e = Oe(a, o, c);
|
|
1217
|
+
if (!e.allowed || !e.destination) {
|
|
1218
|
+
g();
|
|
1190
1219
|
return;
|
|
1191
1220
|
}
|
|
1192
|
-
t.preventDefault(), t.stopPropagation(),
|
|
1221
|
+
t.preventDefault(), t.stopPropagation(), Y(o), d(null);
|
|
1193
1222
|
try {
|
|
1194
|
-
|
|
1223
|
+
c ? await pt(c, e.destination) : await vt(
|
|
1195
1224
|
t.dataTransfer,
|
|
1196
|
-
|
|
1225
|
+
e.destination
|
|
1197
1226
|
);
|
|
1198
1227
|
} finally {
|
|
1199
|
-
|
|
1228
|
+
g();
|
|
1200
1229
|
}
|
|
1201
|
-
},
|
|
1202
|
-
|
|
1230
|
+
}, Pt = (t, a, o) => {
|
|
1231
|
+
l && (t.preventDefault(), t.stopPropagation(), we(null), fe({
|
|
1203
1232
|
absPath: o,
|
|
1204
1233
|
type: a.type,
|
|
1205
1234
|
x: t.clientX,
|
|
1206
1235
|
y: t.clientY
|
|
1207
1236
|
}));
|
|
1208
|
-
},
|
|
1209
|
-
let o = a,
|
|
1210
|
-
const
|
|
1211
|
-
const
|
|
1212
|
-
return
|
|
1213
|
-
},
|
|
1214
|
-
for (; await (
|
|
1215
|
-
|
|
1216
|
-
const { stem:
|
|
1217
|
-
o = `${
|
|
1237
|
+
}, Ke = async (t, a) => {
|
|
1238
|
+
let o = a, c = 0;
|
|
1239
|
+
const e = (s) => {
|
|
1240
|
+
const p = s.lastIndexOf(".");
|
|
1241
|
+
return p > 0 ? { stem: s.slice(0, p), ext: s.slice(p) } : { stem: s, ext: "" };
|
|
1242
|
+
}, n = t === "/" ? "" : t;
|
|
1243
|
+
for (; await (u == null ? void 0 : u.fileExists(`${n}/${o}`)) || await (u == null ? void 0 : u.isDir(`${n}/${o}`)); ) {
|
|
1244
|
+
c += 1;
|
|
1245
|
+
const { stem: s, ext: p } = e(a);
|
|
1246
|
+
o = `${s} (${c})${p}`;
|
|
1218
1247
|
}
|
|
1219
1248
|
return o;
|
|
1220
|
-
},
|
|
1221
|
-
if (!
|
|
1222
|
-
let
|
|
1249
|
+
}, qe = async (t, a, o) => {
|
|
1250
|
+
if (!u) return;
|
|
1251
|
+
let c = t || T || F;
|
|
1223
1252
|
try {
|
|
1224
|
-
await
|
|
1253
|
+
await u.isDir(c) || (c = Ne(c));
|
|
1225
1254
|
} catch {
|
|
1226
|
-
|
|
1255
|
+
c = Ne(c);
|
|
1227
1256
|
}
|
|
1228
|
-
const
|
|
1229
|
-
a === "folder" ? await
|
|
1230
|
-
|
|
1257
|
+
const e = c, n = await Ke(e, o), s = Me(e, n);
|
|
1258
|
+
a === "folder" ? await u.mkdir(s) : await u.writeFile(s, ""), _e.current = { type: a, tempPath: s }, we(s), await ie(e), setTimeout(() => {
|
|
1259
|
+
j(s), ee(s);
|
|
1231
1260
|
}, 0);
|
|
1232
|
-
},
|
|
1233
|
-
if (!
|
|
1261
|
+
}, kt = async (t) => {
|
|
1262
|
+
if (!u) return !1;
|
|
1234
1263
|
try {
|
|
1235
|
-
if (await
|
|
1264
|
+
if (await u.fileExists(t))
|
|
1236
1265
|
return !0;
|
|
1237
1266
|
} catch {
|
|
1238
1267
|
}
|
|
1239
1268
|
try {
|
|
1240
|
-
if (await
|
|
1269
|
+
if (await u.isDir(t))
|
|
1241
1270
|
return !0;
|
|
1242
1271
|
} catch {
|
|
1243
1272
|
}
|
|
1244
1273
|
return !1;
|
|
1245
|
-
},
|
|
1246
|
-
if (
|
|
1274
|
+
}, ot = async (t) => {
|
|
1275
|
+
if (u)
|
|
1247
1276
|
try {
|
|
1248
|
-
await
|
|
1277
|
+
await u.mkdir(t);
|
|
1249
1278
|
} catch (a) {
|
|
1250
|
-
if (!await
|
|
1279
|
+
if (!await u.isDir(t).catch(() => !1))
|
|
1251
1280
|
throw a;
|
|
1252
1281
|
}
|
|
1253
|
-
},
|
|
1254
|
-
if (!
|
|
1255
|
-
const o =
|
|
1256
|
-
if (
|
|
1282
|
+
}, pt = async (t, a) => {
|
|
1283
|
+
if (!u) return;
|
|
1284
|
+
const o = tt(t), c = Me(a, o);
|
|
1285
|
+
if (c === t || await kt(c))
|
|
1257
1286
|
return;
|
|
1258
|
-
const
|
|
1287
|
+
const e = Ne(t);
|
|
1259
1288
|
try {
|
|
1260
|
-
await
|
|
1261
|
-
const
|
|
1262
|
-
|
|
1289
|
+
await u.mv(t, c), Se(t, c);
|
|
1290
|
+
const n = Ge(
|
|
1291
|
+
T,
|
|
1263
1292
|
t,
|
|
1264
|
-
|
|
1293
|
+
c
|
|
1265
1294
|
);
|
|
1266
|
-
|
|
1267
|
-
(
|
|
1268
|
-
),
|
|
1269
|
-
...
|
|
1295
|
+
T && (T === t || T.startsWith(`${t}/`)) && x(n), j(
|
|
1296
|
+
(s) => Ge(s, t, c)
|
|
1297
|
+
), Z((s) => ({
|
|
1298
|
+
...s,
|
|
1270
1299
|
[a]: !0
|
|
1271
1300
|
})), await Promise.all([
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
]),
|
|
1275
|
-
(
|
|
1276
|
-
),
|
|
1301
|
+
ie(e),
|
|
1302
|
+
ie(a)
|
|
1303
|
+
]), m(
|
|
1304
|
+
(s) => Ge(s, t, c)
|
|
1305
|
+
), ee(c);
|
|
1277
1306
|
} catch {
|
|
1278
1307
|
}
|
|
1279
|
-
},
|
|
1308
|
+
}, $e = (t) => {
|
|
1280
1309
|
const a = t;
|
|
1281
1310
|
return a.webkitGetAsEntry ? a.webkitGetAsEntry() : null;
|
|
1282
|
-
},
|
|
1311
|
+
}, it = (t) => new Promise((a, o) => {
|
|
1283
1312
|
t.file(a, o);
|
|
1284
|
-
}),
|
|
1285
|
-
if (!
|
|
1286
|
-
const o = t.name || "untitled",
|
|
1287
|
-
await
|
|
1288
|
-
},
|
|
1289
|
-
const o = await
|
|
1290
|
-
await
|
|
1291
|
-
},
|
|
1292
|
-
const o = await
|
|
1313
|
+
}), Je = async (t, a) => {
|
|
1314
|
+
if (!u) return;
|
|
1315
|
+
const o = t.name || "untitled", c = await Ke(a, o), e = Me(a, c), n = new Uint8Array(await t.arrayBuffer());
|
|
1316
|
+
await u.writeFile(e, n);
|
|
1317
|
+
}, lt = async (t, a) => {
|
|
1318
|
+
const o = await it(t);
|
|
1319
|
+
await Je(o, a);
|
|
1320
|
+
}, ht = async (t, a) => {
|
|
1321
|
+
const o = await Ke(
|
|
1293
1322
|
a,
|
|
1294
1323
|
t.name || "New Folder"
|
|
1295
|
-
),
|
|
1296
|
-
await
|
|
1297
|
-
const
|
|
1298
|
-
|
|
1299
|
-
(
|
|
1300
|
-
|
|
1324
|
+
), c = Me(a, o);
|
|
1325
|
+
await ot(c);
|
|
1326
|
+
const e = t.createReader(), n = () => new Promise((s, p) => {
|
|
1327
|
+
e.readEntries(
|
|
1328
|
+
(S) => s(Array.from(S)),
|
|
1329
|
+
p
|
|
1301
1330
|
);
|
|
1302
1331
|
});
|
|
1303
1332
|
for (; ; ) {
|
|
1304
|
-
const
|
|
1305
|
-
if (!
|
|
1333
|
+
const s = await n();
|
|
1334
|
+
if (!s.length)
|
|
1306
1335
|
break;
|
|
1307
|
-
for (const
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
) :
|
|
1312
|
-
|
|
1313
|
-
|
|
1336
|
+
for (const p of s)
|
|
1337
|
+
p.isFile ? await lt(
|
|
1338
|
+
p,
|
|
1339
|
+
c
|
|
1340
|
+
) : p.isDirectory && await ht(
|
|
1341
|
+
p,
|
|
1342
|
+
c
|
|
1314
1343
|
);
|
|
1315
1344
|
}
|
|
1316
|
-
},
|
|
1317
|
-
const
|
|
1318
|
-
return
|
|
1319
|
-
},
|
|
1320
|
-
if (
|
|
1345
|
+
}, wt = (t, a) => st([], t, a), vt = (t, a) => {
|
|
1346
|
+
const c = Array.from(t.items).filter((n) => n.kind === "file").map((n) => $e(n)).filter((n) => !!n), e = Array.from(t.files);
|
|
1347
|
+
return st(c, e, a);
|
|
1348
|
+
}, st = async (t, a, o) => {
|
|
1349
|
+
if (u) {
|
|
1321
1350
|
if (t.length > 0)
|
|
1322
|
-
for (const
|
|
1323
|
-
|
|
1324
|
-
|
|
1351
|
+
for (const c of t)
|
|
1352
|
+
c.isFile ? await lt(
|
|
1353
|
+
c,
|
|
1325
1354
|
o
|
|
1326
|
-
) :
|
|
1327
|
-
|
|
1355
|
+
) : c.isDirectory && await ht(
|
|
1356
|
+
c,
|
|
1328
1357
|
o
|
|
1329
1358
|
);
|
|
1330
1359
|
else
|
|
1331
|
-
for (const
|
|
1332
|
-
await
|
|
1333
|
-
await
|
|
1334
|
-
...
|
|
1360
|
+
for (const c of a)
|
|
1361
|
+
await Je(c, o);
|
|
1362
|
+
await ie(o), Z((c) => ({
|
|
1363
|
+
...c,
|
|
1335
1364
|
[o]: !0
|
|
1336
1365
|
}));
|
|
1337
1366
|
}
|
|
1338
|
-
},
|
|
1339
|
-
if (!
|
|
1367
|
+
}, gt = async (t, a) => {
|
|
1368
|
+
if (!u) return;
|
|
1340
1369
|
const o = t;
|
|
1341
|
-
|
|
1370
|
+
fe(null);
|
|
1342
1371
|
try {
|
|
1343
|
-
a === "folder" ? await
|
|
1372
|
+
a === "folder" ? await u.rmdir(o, { recursive: !0 }) : await u.unlink(o);
|
|
1344
1373
|
} catch {
|
|
1345
1374
|
} finally {
|
|
1346
|
-
|
|
1347
|
-
const
|
|
1348
|
-
await
|
|
1375
|
+
we(null);
|
|
1376
|
+
const c = Ne(o);
|
|
1377
|
+
await ie(c), T && (T === o || T.startsWith(`${o}/`)) && x(null);
|
|
1349
1378
|
}
|
|
1350
|
-
},
|
|
1351
|
-
if (
|
|
1379
|
+
}, Tt = async (t) => {
|
|
1380
|
+
if (u)
|
|
1352
1381
|
try {
|
|
1353
|
-
const o = await (await
|
|
1354
|
-
|
|
1382
|
+
const o = await (await u.read(t)).arrayBuffer(), c = new Blob([o]), e = URL.createObjectURL(c), n = document.createElement("a");
|
|
1383
|
+
n.href = e, n.download = tt(t) || "download", document.body.appendChild(n), n.click(), document.body.removeChild(n), setTimeout(() => URL.revokeObjectURL(e), 6e4);
|
|
1355
1384
|
} catch (a) {
|
|
1356
1385
|
console.error("Failed to download file", a);
|
|
1357
1386
|
}
|
|
1358
|
-
},
|
|
1387
|
+
}, St = (t) => {
|
|
1359
1388
|
var a;
|
|
1360
|
-
if (!
|
|
1389
|
+
if (!We)
|
|
1361
1390
|
if (t.key.length === 1 && t.key.match(/\S/)) {
|
|
1362
|
-
const o =
|
|
1363
|
-
if (
|
|
1364
|
-
|
|
1365
|
-
}, 1e3), !
|
|
1391
|
+
const o = de + t.key.toLowerCase();
|
|
1392
|
+
if (le(o), $.current && clearTimeout($.current), $.current = setTimeout(() => {
|
|
1393
|
+
le("");
|
|
1394
|
+
}, 1e3), !z.current)
|
|
1366
1395
|
return;
|
|
1367
|
-
const
|
|
1368
|
-
|
|
1369
|
-
),
|
|
1370
|
-
let
|
|
1371
|
-
|
|
1372
|
-
|
|
1396
|
+
const c = Array.from(
|
|
1397
|
+
z.current.querySelectorAll(".file-node-button")
|
|
1398
|
+
), e = document.activeElement;
|
|
1399
|
+
let n = 0;
|
|
1400
|
+
e && c.includes(e) && (n = c.indexOf(
|
|
1401
|
+
e
|
|
1373
1402
|
));
|
|
1374
|
-
for (let
|
|
1375
|
-
const
|
|
1376
|
-
if ((a =
|
|
1377
|
-
|
|
1378
|
-
const
|
|
1379
|
-
|
|
1403
|
+
for (let s = 0; s < c.length; s++) {
|
|
1404
|
+
const p = (n + s) % c.length, S = c[p];
|
|
1405
|
+
if ((a = S.textContent) != null && a.toLowerCase().trim().startsWith(o)) {
|
|
1406
|
+
S.focus();
|
|
1407
|
+
const I = S.getAttribute("data-path");
|
|
1408
|
+
I && j(I);
|
|
1380
1409
|
break;
|
|
1381
1410
|
}
|
|
1382
1411
|
}
|
|
1383
1412
|
} else
|
|
1384
|
-
|
|
1385
|
-
},
|
|
1413
|
+
le(""), $.current && clearTimeout($.current);
|
|
1414
|
+
}, Et = async (t, a) => {
|
|
1386
1415
|
if (f) return;
|
|
1387
|
-
const o =
|
|
1388
|
-
if (!a || a === "." || a === ".." ||
|
|
1389
|
-
if (
|
|
1416
|
+
const o = _e.current, c = (o == null ? void 0 : o.tempPath) === t, e = Ne(t);
|
|
1417
|
+
if (!a || a === "." || a === ".." || tt(a) !== a) {
|
|
1418
|
+
if (c) {
|
|
1390
1419
|
try {
|
|
1391
|
-
o.type === "folder" ? await
|
|
1420
|
+
o.type === "folder" ? await u.rmdir(t, {
|
|
1392
1421
|
recursive: !0
|
|
1393
|
-
}) : await
|
|
1422
|
+
}) : await u.unlink(t);
|
|
1394
1423
|
} catch {
|
|
1395
1424
|
}
|
|
1396
|
-
|
|
1425
|
+
_e.current = null;
|
|
1397
1426
|
}
|
|
1398
|
-
|
|
1427
|
+
we(c ? null : t);
|
|
1399
1428
|
return;
|
|
1400
1429
|
}
|
|
1401
|
-
let
|
|
1402
|
-
if (
|
|
1403
|
-
|
|
1404
|
-
const
|
|
1405
|
-
|
|
1406
|
-
|
|
1430
|
+
let n = Me(e, a), s = n;
|
|
1431
|
+
if (s === t) {
|
|
1432
|
+
we(null);
|
|
1433
|
+
const A = c && (o == null ? void 0 : o.type) === "file";
|
|
1434
|
+
c && (_e.current = null), setTimeout(() => {
|
|
1435
|
+
j(s), ee(s), A && E && E(s);
|
|
1407
1436
|
}, 0);
|
|
1408
1437
|
return;
|
|
1409
1438
|
}
|
|
1410
|
-
const
|
|
1411
|
-
if ((
|
|
1412
|
-
if (
|
|
1439
|
+
const p = await u.fileExists(s), S = await u.isDir(s);
|
|
1440
|
+
if ((p || S) && s !== t)
|
|
1441
|
+
if (c)
|
|
1413
1442
|
try {
|
|
1414
|
-
const
|
|
1415
|
-
|
|
1443
|
+
const A = await Ke(
|
|
1444
|
+
e === "/" ? "/" : e,
|
|
1416
1445
|
a
|
|
1417
1446
|
);
|
|
1418
|
-
|
|
1447
|
+
n = Me(e, A), s = n;
|
|
1419
1448
|
} catch {
|
|
1420
1449
|
}
|
|
1421
1450
|
else {
|
|
1422
|
-
|
|
1451
|
+
we(t);
|
|
1423
1452
|
return;
|
|
1424
1453
|
}
|
|
1425
|
-
let
|
|
1454
|
+
let I = (o == null ? void 0 : o.type) === "folder";
|
|
1426
1455
|
try {
|
|
1427
|
-
await
|
|
1456
|
+
if (await u.mv(t, n), o || (I = await u.isDir(n)), I && (Se(t, s), !c))
|
|
1457
|
+
try {
|
|
1458
|
+
await (D == null ? void 0 : D(t, s));
|
|
1459
|
+
} catch (A) {
|
|
1460
|
+
Ye.error(
|
|
1461
|
+
"Failed to update metadata after renaming a path",
|
|
1462
|
+
A
|
|
1463
|
+
);
|
|
1464
|
+
}
|
|
1465
|
+
T === t && x(s), await ie(e), j(s), ee(s), c && !I && E && E(s);
|
|
1428
1466
|
} catch {
|
|
1429
|
-
if (
|
|
1467
|
+
if (c)
|
|
1430
1468
|
try {
|
|
1431
|
-
(o == null ? void 0 : o.type) === "folder" ? await
|
|
1469
|
+
(o == null ? void 0 : o.type) === "folder" ? await u.rmdir(t, {
|
|
1432
1470
|
recursive: !0
|
|
1433
|
-
}) : await
|
|
1471
|
+
}) : await u.unlink(t);
|
|
1434
1472
|
} catch {
|
|
1435
1473
|
}
|
|
1436
1474
|
} finally {
|
|
1437
|
-
|
|
1475
|
+
_e.current = null, we(null);
|
|
1438
1476
|
}
|
|
1439
|
-
},
|
|
1440
|
-
const a =
|
|
1441
|
-
if (!
|
|
1442
|
-
|
|
1477
|
+
}, _t = async (t) => {
|
|
1478
|
+
const a = _e.current;
|
|
1479
|
+
if (!u || (a == null ? void 0 : a.tempPath) !== t) {
|
|
1480
|
+
we((c) => c === t ? null : c);
|
|
1443
1481
|
return;
|
|
1444
1482
|
}
|
|
1445
1483
|
try {
|
|
1446
|
-
a.type === "folder" ? await
|
|
1484
|
+
a.type === "folder" ? await u.rmdir(t, { recursive: !0 }) : await u.unlink(t);
|
|
1447
1485
|
} catch {
|
|
1448
1486
|
}
|
|
1449
|
-
|
|
1450
|
-
const o =
|
|
1451
|
-
await
|
|
1487
|
+
_e.current = null, we(null);
|
|
1488
|
+
const o = Ne(t);
|
|
1489
|
+
await ie(o), j(o), ee(o);
|
|
1452
1490
|
};
|
|
1453
|
-
return /* @__PURE__ */ r.createElement("div", { onKeyDown:
|
|
1454
|
-
|
|
1491
|
+
return /* @__PURE__ */ r.createElement("div", { onKeyDown: St, ref: z }, /* @__PURE__ */ r.createElement(or, { className: ye.filePickerTree }, he.map((t, a) => /* @__PURE__ */ r.createElement(
|
|
1492
|
+
qt,
|
|
1455
1493
|
{
|
|
1456
1494
|
key: t.name,
|
|
1457
1495
|
node: t,
|
|
1458
1496
|
level: 0,
|
|
1459
1497
|
position: a + 1,
|
|
1460
|
-
setSize:
|
|
1461
|
-
expandedNodePaths:
|
|
1462
|
-
onToggle:
|
|
1463
|
-
selectedNode:
|
|
1464
|
-
focusPath: (o) =>
|
|
1465
|
-
focusedNode:
|
|
1466
|
-
selectPath:
|
|
1467
|
-
generatePath:
|
|
1468
|
-
getChildren:
|
|
1469
|
-
onContextMenu: f ? void 0 :
|
|
1470
|
-
renamingPath:
|
|
1471
|
-
onRename:
|
|
1472
|
-
onRenameCancel:
|
|
1473
|
-
dropIndicator:
|
|
1498
|
+
setSize: he.length,
|
|
1499
|
+
expandedNodePaths: v,
|
|
1500
|
+
onToggle: Be,
|
|
1501
|
+
selectedNode: T,
|
|
1502
|
+
focusPath: (o) => j(o),
|
|
1503
|
+
focusedNode: N,
|
|
1504
|
+
selectPath: Ee,
|
|
1505
|
+
generatePath: ue,
|
|
1506
|
+
getChildren: Pe,
|
|
1507
|
+
onContextMenu: f ? void 0 : Pt,
|
|
1508
|
+
renamingPath: Ve,
|
|
1509
|
+
onRename: Et,
|
|
1510
|
+
onRenameCancel: _t,
|
|
1511
|
+
dropIndicator: _,
|
|
1474
1512
|
onDragStart: f ? void 0 : Ie,
|
|
1475
|
-
onDragEnd: f ? void 0 :
|
|
1476
|
-
onDragEnter: f ? void 0 :
|
|
1477
|
-
onDragOver: f ? void 0 :
|
|
1478
|
-
onDragLeave: f ? void 0 :
|
|
1479
|
-
onDrop: f ? void 0 :
|
|
1480
|
-
rootPath:
|
|
1481
|
-
onDoubleClickFile:
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1513
|
+
onDragEnd: f ? void 0 : De,
|
|
1514
|
+
onDragEnter: f ? void 0 : Ze,
|
|
1515
|
+
onDragOver: f ? void 0 : at,
|
|
1516
|
+
onDragLeave: f ? void 0 : Ct,
|
|
1517
|
+
onDrop: f ? void 0 : Rt,
|
|
1518
|
+
rootPath: F,
|
|
1519
|
+
onDoubleClickFile: E,
|
|
1520
|
+
pathBadges: R
|
|
1521
|
+
}
|
|
1522
|
+
))), !f && H && /* @__PURE__ */ r.createElement(
|
|
1523
|
+
ir,
|
|
1485
1524
|
{
|
|
1486
1525
|
placement: "bottom-start",
|
|
1487
|
-
onClose: () =>
|
|
1526
|
+
onClose: () => fe(null),
|
|
1488
1527
|
anchor: {
|
|
1489
1528
|
getBoundingClientRect: () => ({
|
|
1490
|
-
x:
|
|
1491
|
-
y:
|
|
1529
|
+
x: H.x,
|
|
1530
|
+
y: H.y,
|
|
1492
1531
|
width: 0,
|
|
1493
1532
|
height: 0,
|
|
1494
|
-
top:
|
|
1495
|
-
left:
|
|
1496
|
-
right:
|
|
1497
|
-
bottom:
|
|
1533
|
+
top: H.y,
|
|
1534
|
+
left: H.x,
|
|
1535
|
+
right: H.x,
|
|
1536
|
+
bottom: H.y,
|
|
1498
1537
|
toJSON: () => ({})
|
|
1499
1538
|
}),
|
|
1500
1539
|
ownerDocument: document
|
|
@@ -1503,950 +1542,1036 @@ const nn = $t(function({
|
|
|
1503
1542
|
resize: !1,
|
|
1504
1543
|
focusOnMount: "firstElement"
|
|
1505
1544
|
},
|
|
1506
|
-
/* @__PURE__ */ r.createElement(
|
|
1507
|
-
|
|
1545
|
+
/* @__PURE__ */ r.createElement(lr, { role: "menu" }, H.type === "folder" && /* @__PURE__ */ r.createElement(
|
|
1546
|
+
Qe,
|
|
1508
1547
|
{
|
|
1509
1548
|
role: "menuitem",
|
|
1510
1549
|
onClick: async () => {
|
|
1511
|
-
|
|
1512
|
-
|
|
1550
|
+
fe(null), await qe(
|
|
1551
|
+
H.absPath,
|
|
1513
1552
|
"file",
|
|
1514
1553
|
"untitled.php"
|
|
1515
1554
|
);
|
|
1516
1555
|
}
|
|
1517
1556
|
},
|
|
1518
1557
|
"Create file"
|
|
1519
|
-
),
|
|
1520
|
-
|
|
1558
|
+
), H.type === "folder" && /* @__PURE__ */ r.createElement(
|
|
1559
|
+
Qe,
|
|
1521
1560
|
{
|
|
1522
1561
|
role: "menuitem",
|
|
1523
1562
|
onClick: async () => {
|
|
1524
|
-
|
|
1525
|
-
|
|
1563
|
+
fe(null), await qe(
|
|
1564
|
+
H.absPath,
|
|
1526
1565
|
"folder",
|
|
1527
1566
|
"New Folder"
|
|
1528
1567
|
);
|
|
1529
1568
|
}
|
|
1530
1569
|
},
|
|
1531
1570
|
"Create directory"
|
|
1571
|
+
), b && H.type === "folder" && (H.absPath === Q || H.absPath === J) && /* @__PURE__ */ r.createElement(
|
|
1572
|
+
Qe,
|
|
1573
|
+
{
|
|
1574
|
+
role: "menuitem",
|
|
1575
|
+
onClick: () => {
|
|
1576
|
+
fe(null), b(
|
|
1577
|
+
H.absPath === Q ? "plugin" : "theme",
|
|
1578
|
+
H.absPath
|
|
1579
|
+
);
|
|
1580
|
+
}
|
|
1581
|
+
},
|
|
1582
|
+
"Mount via git…"
|
|
1532
1583
|
), /* @__PURE__ */ r.createElement(
|
|
1533
|
-
|
|
1584
|
+
Qe,
|
|
1534
1585
|
{
|
|
1535
1586
|
role: "menuitem",
|
|
1536
1587
|
onClick: () => {
|
|
1537
|
-
|
|
1588
|
+
fe(null), we(H.absPath);
|
|
1538
1589
|
}
|
|
1539
1590
|
},
|
|
1540
1591
|
"Rename"
|
|
1541
|
-
),
|
|
1542
|
-
|
|
1592
|
+
), H.type === "file" && /* @__PURE__ */ r.createElement(
|
|
1593
|
+
Qe,
|
|
1543
1594
|
{
|
|
1544
1595
|
role: "menuitem",
|
|
1545
1596
|
onClick: async () => {
|
|
1546
|
-
|
|
1547
|
-
|
|
1597
|
+
fe(null), await Tt(
|
|
1598
|
+
H.absPath
|
|
1548
1599
|
);
|
|
1549
1600
|
}
|
|
1550
1601
|
},
|
|
1551
1602
|
"Download"
|
|
1552
1603
|
), /* @__PURE__ */ r.createElement(
|
|
1553
|
-
|
|
1604
|
+
Qe,
|
|
1554
1605
|
{
|
|
1555
1606
|
role: "menuitem",
|
|
1556
|
-
onClick: () =>
|
|
1557
|
-
|
|
1558
|
-
|
|
1607
|
+
onClick: () => gt(
|
|
1608
|
+
H.absPath,
|
|
1609
|
+
H.type
|
|
1559
1610
|
)
|
|
1560
1611
|
},
|
|
1561
1612
|
"Delete"
|
|
1562
1613
|
))
|
|
1563
1614
|
));
|
|
1564
|
-
}),
|
|
1565
|
-
node:
|
|
1566
|
-
level:
|
|
1615
|
+
}), qt = ({
|
|
1616
|
+
node: i,
|
|
1617
|
+
level: l,
|
|
1567
1618
|
position: f,
|
|
1568
|
-
setSize:
|
|
1569
|
-
expandedNodePaths:
|
|
1570
|
-
onToggle:
|
|
1571
|
-
selectedNode:
|
|
1572
|
-
focusPath:
|
|
1573
|
-
focusedNode:
|
|
1574
|
-
selectPath:
|
|
1619
|
+
setSize: u,
|
|
1620
|
+
expandedNodePaths: w,
|
|
1621
|
+
onToggle: h,
|
|
1622
|
+
selectedNode: x,
|
|
1623
|
+
focusPath: E,
|
|
1624
|
+
focusedNode: R,
|
|
1625
|
+
selectPath: b,
|
|
1575
1626
|
generatePath: D,
|
|
1576
|
-
getChildren:
|
|
1577
|
-
onContextMenu:
|
|
1578
|
-
renamingPath:
|
|
1579
|
-
onRename:
|
|
1580
|
-
onRenameCancel:
|
|
1581
|
-
parentPath:
|
|
1582
|
-
dropIndicator:
|
|
1627
|
+
getChildren: k,
|
|
1628
|
+
onContextMenu: F,
|
|
1629
|
+
renamingPath: Q,
|
|
1630
|
+
onRename: J,
|
|
1631
|
+
onRenameCancel: v,
|
|
1632
|
+
parentPath: Z = "",
|
|
1633
|
+
dropIndicator: T,
|
|
1583
1634
|
onDragStart: m,
|
|
1584
|
-
onDragEnd:
|
|
1585
|
-
onDragEnter:
|
|
1586
|
-
onDragOver:
|
|
1587
|
-
onDragLeave:
|
|
1588
|
-
onDrop:
|
|
1589
|
-
rootPath:
|
|
1590
|
-
onDoubleClickFile:
|
|
1635
|
+
onDragEnd: N,
|
|
1636
|
+
onDragEnter: j,
|
|
1637
|
+
onDragOver: L,
|
|
1638
|
+
onDragLeave: U,
|
|
1639
|
+
onDrop: re,
|
|
1640
|
+
rootPath: ne,
|
|
1641
|
+
onDoubleClickFile: X,
|
|
1642
|
+
pathBadges: ae
|
|
1591
1643
|
}) => {
|
|
1592
|
-
const
|
|
1593
|
-
onDragEnter: (
|
|
1594
|
-
onDragOver: (
|
|
1595
|
-
onDragLeave: (
|
|
1596
|
-
onDrop: (
|
|
1597
|
-
},
|
|
1598
|
-
|
|
1599
|
-
var
|
|
1600
|
-
|
|
1601
|
-
var
|
|
1602
|
-
(
|
|
1603
|
-
}) : (
|
|
1604
|
-
}, [
|
|
1605
|
-
const
|
|
1606
|
-
|
|
1607
|
-
},
|
|
1608
|
-
var
|
|
1609
|
-
if (
|
|
1610
|
-
|
|
1611
|
-
`[data-path="${CSS.escape(
|
|
1612
|
-
)) == null ||
|
|
1613
|
-
else if (
|
|
1614
|
-
if (
|
|
1615
|
-
if (
|
|
1616
|
-
const
|
|
1617
|
-
|
|
1618
|
-
|
|
1644
|
+
const _ = D(i, Z), d = w[_], P = Q === _, V = O(null), [z, $] = K(i.name), G = O(!1), ce = (T == null ? void 0 : T.path) === _, me = ce && (T == null ? void 0 : T.state) === "valid", Y = ce && (T == null ? void 0 : T.state) === "invalid", ee = !!m && !P && _ !== ne, ue = O(null), Pe = {
|
|
1645
|
+
onDragEnter: (g) => j == null ? void 0 : j(g, i, _),
|
|
1646
|
+
onDragOver: (g) => L == null ? void 0 : L(g, i, _),
|
|
1647
|
+
onDragLeave: (g) => U == null ? void 0 : U(g, i, _),
|
|
1648
|
+
onDrop: (g) => re == null ? void 0 : re(g, i, _)
|
|
1649
|
+
}, oe = k(i, _) ?? [];
|
|
1650
|
+
W(() => {
|
|
1651
|
+
var g;
|
|
1652
|
+
P ? ($(i.name), G.current = !1, typeof window < "u" && requestAnimationFrame ? requestAnimationFrame(() => {
|
|
1653
|
+
var Ee;
|
|
1654
|
+
(Ee = V.current) == null || Ee.select();
|
|
1655
|
+
}) : (g = V.current) == null || g.select()) : G.current = !1;
|
|
1656
|
+
}, [P, i.name]);
|
|
1657
|
+
const Te = () => {
|
|
1658
|
+
i.type === "folder" && h(_, i, !d);
|
|
1659
|
+
}, ve = (g) => {
|
|
1660
|
+
var Ee, he;
|
|
1661
|
+
if (g.key === "ArrowLeft")
|
|
1662
|
+
d ? Te() : (Ee = document.querySelector(
|
|
1663
|
+
`[data-path="${CSS.escape(Z)}"]`
|
|
1664
|
+
)) == null || Ee.focus(), g.preventDefault(), g.stopPropagation();
|
|
1665
|
+
else if (g.key === "ArrowRight") {
|
|
1666
|
+
if (d) {
|
|
1667
|
+
if (oe != null && oe.length) {
|
|
1668
|
+
const H = D(
|
|
1669
|
+
oe[0],
|
|
1670
|
+
_
|
|
1619
1671
|
);
|
|
1620
|
-
(
|
|
1621
|
-
`[data-path="${CSS.escape(
|
|
1622
|
-
)) == null ||
|
|
1672
|
+
(he = document.querySelector(
|
|
1673
|
+
`[data-path="${CSS.escape(H)}"]`
|
|
1674
|
+
)) == null || he.focus();
|
|
1623
1675
|
}
|
|
1624
1676
|
} else
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
} else
|
|
1628
|
-
},
|
|
1629
|
-
|
|
1630
|
-
},
|
|
1631
|
-
|
|
1632
|
-
},
|
|
1633
|
-
if (
|
|
1634
|
-
|
|
1677
|
+
Te();
|
|
1678
|
+
g.preventDefault(), g.stopPropagation();
|
|
1679
|
+
} else g.key === " " || g.key === "Space" || g.key === "Spacebar" ? (i.type === "folder" && h(_, i, !d), g.preventDefault()) : g.key === "Enter" && (i.type === "folder" ? h(_, i, !d) : (b(_, !1), E(_), X ? X(_) : b(_, !0)), g.preventDefault());
|
|
1680
|
+
}, Ce = (g) => {
|
|
1681
|
+
F == null || F(g, i, _);
|
|
1682
|
+
}, ie = (g) => {
|
|
1683
|
+
g.preventDefault(), G.current = !0, J == null || J(_, z);
|
|
1684
|
+
}, Be = (g) => {
|
|
1685
|
+
if (g.key === "Escape") {
|
|
1686
|
+
g.preventDefault(), g.stopPropagation(), G.current = !0, v == null || v(_);
|
|
1635
1687
|
return;
|
|
1636
1688
|
}
|
|
1637
|
-
(
|
|
1638
|
-
},
|
|
1639
|
-
|
|
1640
|
-
},
|
|
1641
|
-
if (
|
|
1642
|
-
|
|
1689
|
+
(g.key === "ArrowLeft" || g.key === "ArrowRight" || g.key === "ArrowUp" || g.key === "ArrowDown") && g.stopPropagation();
|
|
1690
|
+
}, ge = () => {
|
|
1691
|
+
G.current || v == null || v(_), G.current = !1;
|
|
1692
|
+
}, Se = () => {
|
|
1693
|
+
if (i.type === "folder") {
|
|
1694
|
+
Te(), b(_), E(_);
|
|
1643
1695
|
return;
|
|
1644
1696
|
}
|
|
1645
|
-
const
|
|
1646
|
-
if (
|
|
1647
|
-
|
|
1697
|
+
const g = ue.current !== null;
|
|
1698
|
+
if (g && ue.current && clearTimeout(ue.current), ue.current = null, g) {
|
|
1699
|
+
X ? X(_) : b(_, !0);
|
|
1648
1700
|
return;
|
|
1649
1701
|
}
|
|
1650
|
-
|
|
1651
|
-
|
|
1702
|
+
b(_, !1), E(_), b(_, !0), ue.current = window.setTimeout(() => {
|
|
1703
|
+
ue.current = null;
|
|
1652
1704
|
}, 300);
|
|
1653
1705
|
};
|
|
1654
|
-
return
|
|
1655
|
-
|
|
1706
|
+
return W(() => () => {
|
|
1707
|
+
ue.current !== null && typeof window < "u" && clearTimeout(ue.current);
|
|
1656
1708
|
}, []), /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
|
|
1657
|
-
|
|
1709
|
+
sr,
|
|
1658
1710
|
{
|
|
1659
|
-
level:
|
|
1711
|
+
level: l,
|
|
1660
1712
|
positionInSet: f,
|
|
1661
|
-
setSize:
|
|
1713
|
+
setSize: u
|
|
1662
1714
|
},
|
|
1663
|
-
/* @__PURE__ */ r.createElement(
|
|
1715
|
+
/* @__PURE__ */ r.createElement(cr, null, () => /* @__PURE__ */ r.createElement(r.Fragment, null, P ? /* @__PURE__ */ r.createElement(
|
|
1664
1716
|
"form",
|
|
1665
1717
|
{
|
|
1666
|
-
onSubmit:
|
|
1667
|
-
className:
|
|
1668
|
-
|
|
1669
|
-
|
|
1718
|
+
onSubmit: ie,
|
|
1719
|
+
className: Fe(
|
|
1720
|
+
ye.fileNodeButton,
|
|
1721
|
+
ye.renaming,
|
|
1670
1722
|
"file-node-button",
|
|
1671
1723
|
{
|
|
1672
|
-
[
|
|
1673
|
-
[
|
|
1674
|
-
[
|
|
1675
|
-
[
|
|
1724
|
+
[ye.selected]: x === _,
|
|
1725
|
+
[ye.focused]: R === _,
|
|
1726
|
+
[ye.dropTarget]: me,
|
|
1727
|
+
[ye.dropTargetInvalid]: Y
|
|
1676
1728
|
}
|
|
1677
1729
|
),
|
|
1678
|
-
"data-path":
|
|
1679
|
-
onContextMenu:
|
|
1680
|
-
...
|
|
1730
|
+
"data-path": _,
|
|
1731
|
+
onContextMenu: Ce,
|
|
1732
|
+
...Pe
|
|
1681
1733
|
},
|
|
1682
1734
|
/* @__PURE__ */ r.createElement(
|
|
1683
|
-
|
|
1735
|
+
Ht,
|
|
1684
1736
|
{
|
|
1685
|
-
node:
|
|
1686
|
-
isOpen:
|
|
1687
|
-
level:
|
|
1688
|
-
hideName: !0
|
|
1737
|
+
node: i,
|
|
1738
|
+
isOpen: i.type === "folder" && d,
|
|
1739
|
+
level: l,
|
|
1740
|
+
hideName: !0,
|
|
1741
|
+
badge: ae == null ? void 0 : ae[_]
|
|
1689
1742
|
}
|
|
1690
1743
|
),
|
|
1691
1744
|
/* @__PURE__ */ r.createElement(
|
|
1692
1745
|
"input",
|
|
1693
1746
|
{
|
|
1694
|
-
ref:
|
|
1695
|
-
className:
|
|
1696
|
-
value:
|
|
1697
|
-
onChange: (
|
|
1698
|
-
onBlur:
|
|
1699
|
-
onFocus: () =>
|
|
1700
|
-
onKeyDown:
|
|
1747
|
+
ref: V,
|
|
1748
|
+
className: ye.renameInput,
|
|
1749
|
+
value: z,
|
|
1750
|
+
onChange: (g) => $(g.target.value),
|
|
1751
|
+
onBlur: ge,
|
|
1752
|
+
onFocus: () => E(_),
|
|
1753
|
+
onKeyDown: Be
|
|
1701
1754
|
}
|
|
1702
1755
|
)
|
|
1703
1756
|
) : /* @__PURE__ */ r.createElement(
|
|
1704
|
-
|
|
1757
|
+
He,
|
|
1705
1758
|
{
|
|
1706
|
-
...
|
|
1707
|
-
draggable:
|
|
1708
|
-
onDragStart: (
|
|
1709
|
-
onDragEnd: (
|
|
1710
|
-
onClick:
|
|
1711
|
-
onKeyDown:
|
|
1759
|
+
...Pe,
|
|
1760
|
+
draggable: ee,
|
|
1761
|
+
onDragStart: (g) => m == null ? void 0 : m(g, i, _),
|
|
1762
|
+
onDragEnd: (g) => N == null ? void 0 : N(g, i, _),
|
|
1763
|
+
onClick: Se,
|
|
1764
|
+
onKeyDown: ve,
|
|
1712
1765
|
onFocus: () => {
|
|
1713
|
-
|
|
1766
|
+
E(_);
|
|
1714
1767
|
},
|
|
1715
|
-
onContextMenu:
|
|
1716
|
-
className:
|
|
1717
|
-
|
|
1768
|
+
onContextMenu: Ce,
|
|
1769
|
+
className: Fe(
|
|
1770
|
+
ye.fileNodeButton,
|
|
1718
1771
|
"file-node-button",
|
|
1719
1772
|
{
|
|
1720
|
-
[
|
|
1721
|
-
[
|
|
1722
|
-
[
|
|
1723
|
-
[
|
|
1773
|
+
[ye.selected]: x === _,
|
|
1774
|
+
[ye.focused]: R === _,
|
|
1775
|
+
[ye.dropTarget]: me,
|
|
1776
|
+
[ye.dropTargetInvalid]: Y
|
|
1724
1777
|
}
|
|
1725
1778
|
),
|
|
1726
|
-
"data-path":
|
|
1727
|
-
"data-expanded":
|
|
1779
|
+
"data-path": _,
|
|
1780
|
+
"data-expanded": d ? "true" : "false"
|
|
1728
1781
|
},
|
|
1729
1782
|
/* @__PURE__ */ r.createElement(
|
|
1730
|
-
|
|
1783
|
+
Ht,
|
|
1731
1784
|
{
|
|
1732
|
-
node:
|
|
1733
|
-
isOpen:
|
|
1734
|
-
level:
|
|
1785
|
+
node: i,
|
|
1786
|
+
isOpen: i.type === "folder" && d,
|
|
1787
|
+
level: l,
|
|
1788
|
+
badge: ae == null ? void 0 : ae[_]
|
|
1735
1789
|
}
|
|
1736
1790
|
)
|
|
1737
1791
|
)))
|
|
1738
|
-
),
|
|
1739
|
-
|
|
1792
|
+
), d && oe && oe.map((g, Ee) => /* @__PURE__ */ r.createElement(
|
|
1793
|
+
qt,
|
|
1740
1794
|
{
|
|
1741
|
-
key:
|
|
1742
|
-
node:
|
|
1743
|
-
level:
|
|
1744
|
-
position:
|
|
1745
|
-
setSize:
|
|
1746
|
-
expandedNodePaths:
|
|
1747
|
-
onToggle:
|
|
1748
|
-
selectedNode:
|
|
1749
|
-
focusPath:
|
|
1750
|
-
focusedNode:
|
|
1751
|
-
selectPath:
|
|
1795
|
+
key: g.name,
|
|
1796
|
+
node: g,
|
|
1797
|
+
level: l + 1,
|
|
1798
|
+
position: Ee + 1,
|
|
1799
|
+
setSize: oe.length,
|
|
1800
|
+
expandedNodePaths: w,
|
|
1801
|
+
onToggle: h,
|
|
1802
|
+
selectedNode: x,
|
|
1803
|
+
focusPath: E,
|
|
1804
|
+
focusedNode: R,
|
|
1805
|
+
selectPath: b,
|
|
1752
1806
|
generatePath: D,
|
|
1753
|
-
getChildren:
|
|
1754
|
-
onContextMenu:
|
|
1755
|
-
renamingPath:
|
|
1756
|
-
onRename:
|
|
1757
|
-
onRenameCancel:
|
|
1758
|
-
parentPath:
|
|
1759
|
-
dropIndicator:
|
|
1807
|
+
getChildren: k,
|
|
1808
|
+
onContextMenu: F,
|
|
1809
|
+
renamingPath: Q,
|
|
1810
|
+
onRename: J,
|
|
1811
|
+
onRenameCancel: v,
|
|
1812
|
+
parentPath: _,
|
|
1813
|
+
dropIndicator: T,
|
|
1760
1814
|
onDragStart: m,
|
|
1761
|
-
onDragEnd:
|
|
1762
|
-
onDragEnter:
|
|
1763
|
-
onDragOver:
|
|
1764
|
-
onDragLeave:
|
|
1765
|
-
onDrop:
|
|
1766
|
-
rootPath:
|
|
1767
|
-
onDoubleClickFile:
|
|
1815
|
+
onDragEnd: N,
|
|
1816
|
+
onDragEnter: j,
|
|
1817
|
+
onDragOver: L,
|
|
1818
|
+
onDragLeave: U,
|
|
1819
|
+
onDrop: re,
|
|
1820
|
+
rootPath: ne,
|
|
1821
|
+
onDoubleClickFile: X,
|
|
1822
|
+
pathBadges: ae
|
|
1768
1823
|
}
|
|
1769
1824
|
)));
|
|
1770
|
-
},
|
|
1771
|
-
const
|
|
1772
|
-
for (let
|
|
1773
|
-
|
|
1774
|
-
|
|
1825
|
+
}, Ht = ({ node: i, level: l, isOpen: f, hideName: u = !1, badge: w }) => {
|
|
1826
|
+
const h = [];
|
|
1827
|
+
for (let b = 0; b < l; b++)
|
|
1828
|
+
h.push(" ");
|
|
1829
|
+
const x = O(null), [E, R] = K(null);
|
|
1830
|
+
return W(() => {
|
|
1831
|
+
if (!E)
|
|
1832
|
+
return;
|
|
1833
|
+
const b = () => R(null);
|
|
1834
|
+
return window.addEventListener("scroll", b, !0), window.addEventListener("resize", b), () => {
|
|
1835
|
+
window.removeEventListener("scroll", b, !0), window.removeEventListener("resize", b);
|
|
1836
|
+
};
|
|
1837
|
+
}, [E]), /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
|
|
1775
1838
|
"span",
|
|
1776
1839
|
{
|
|
1777
1840
|
"aria-hidden": "true",
|
|
1778
|
-
dangerouslySetInnerHTML: { __html:
|
|
1779
|
-
}
|
|
1780
|
-
),
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1841
|
+
dangerouslySetInnerHTML: { __html: h.join("") }
|
|
1842
|
+
}
|
|
1843
|
+
), i.type === "folder" ? /* @__PURE__ */ r.createElement(Bt, { width: 16, icon: f ? Yr : Zr }) : /* @__PURE__ */ r.createElement("div", { style: { width: 16 } }, " "), /* @__PURE__ */ r.createElement(Bt, { width: 16, icon: i.type === "folder" ? Wr : Ur }), !u && /* @__PURE__ */ r.createElement("span", { className: ye.fileName }, i.name), w ? (
|
|
1844
|
+
// A plain hover-controlled DOM tooltip is used here instead of
|
|
1845
|
+
// the WordPress `Tooltip` component: this badge is nested
|
|
1846
|
+
// inside the row's own clickable Button, and Ariakit's hover
|
|
1847
|
+
// handling (which Tooltip is built on) does not reliably
|
|
1848
|
+
// trigger for an element nested inside another interactive
|
|
1849
|
+
// element. The tooltip itself is portaled to `document.body`
|
|
1850
|
+
// and positioned from the badge's screen coordinates so it
|
|
1851
|
+
// escapes the file tree sidebar's clipping/scroll container.
|
|
1852
|
+
/* @__PURE__ */ r.createElement(
|
|
1853
|
+
"span",
|
|
1854
|
+
{
|
|
1855
|
+
ref: x,
|
|
1856
|
+
className: ye.pathBadge,
|
|
1857
|
+
"aria-label": w.tooltip,
|
|
1858
|
+
onMouseEnter: () => {
|
|
1859
|
+
var D;
|
|
1860
|
+
const b = (D = x.current) == null ? void 0 : D.getBoundingClientRect();
|
|
1861
|
+
b && R({
|
|
1862
|
+
top: b.top,
|
|
1863
|
+
left: b.left
|
|
1864
|
+
});
|
|
1865
|
+
},
|
|
1866
|
+
onMouseLeave: () => R(null)
|
|
1867
|
+
},
|
|
1868
|
+
w.icon,
|
|
1869
|
+
E ? Yt(
|
|
1870
|
+
/* @__PURE__ */ r.createElement(
|
|
1871
|
+
"span",
|
|
1872
|
+
{
|
|
1873
|
+
className: ye.pathBadgeTooltip,
|
|
1874
|
+
role: "tooltip",
|
|
1875
|
+
style: {
|
|
1876
|
+
top: E.top,
|
|
1877
|
+
left: E.left
|
|
1878
|
+
}
|
|
1879
|
+
},
|
|
1880
|
+
w.tooltip
|
|
1881
|
+
),
|
|
1882
|
+
document.body
|
|
1883
|
+
) : null
|
|
1884
|
+
)
|
|
1885
|
+
) : null);
|
|
1886
|
+
}, fn = "_control_kp9d9_1", dn = "_browse-label_kp9d9_11", mn = "_path-preview_kp9d9_37", pn = "_modal_kp9d9_43", hn = "_modal-footer_kp9d9_48", et = {
|
|
1887
|
+
control: fn,
|
|
1888
|
+
browseLabel: dn,
|
|
1889
|
+
pathPreview: mn,
|
|
1890
|
+
modal: pn,
|
|
1891
|
+
modalFooter: hn
|
|
1787
1892
|
};
|
|
1788
|
-
function
|
|
1789
|
-
if (!
|
|
1790
|
-
return /* @__PURE__ */ r.createElement("div", { className:
|
|
1791
|
-
const
|
|
1792
|
-
let f = (
|
|
1893
|
+
function wn({ path: i }) {
|
|
1894
|
+
if (!i)
|
|
1895
|
+
return /* @__PURE__ */ r.createElement("div", { className: et.pathPreview }, /* @__PURE__ */ r.createElement("i", null, "Select a path"));
|
|
1896
|
+
const l = i.split("/");
|
|
1897
|
+
let f = (l.length > 2 ? "/" : "") + l.pop();
|
|
1793
1898
|
f.length > 10 && (f = f.substring(f.length - 10));
|
|
1794
|
-
const
|
|
1899
|
+
const u = i.substring(
|
|
1795
1900
|
0,
|
|
1796
|
-
|
|
1901
|
+
i.length - f.length
|
|
1797
1902
|
);
|
|
1798
1903
|
return /* @__PURE__ */ r.createElement(
|
|
1799
1904
|
"div",
|
|
1800
1905
|
{
|
|
1801
|
-
className:
|
|
1802
|
-
"data-content-start":
|
|
1906
|
+
className: et.pathPreview,
|
|
1907
|
+
"data-content-start": u,
|
|
1803
1908
|
"data-content-end": f
|
|
1804
1909
|
}
|
|
1805
1910
|
);
|
|
1806
1911
|
}
|
|
1807
|
-
function
|
|
1808
|
-
value:
|
|
1809
|
-
onChange:
|
|
1912
|
+
function ro({
|
|
1913
|
+
value: i = "",
|
|
1914
|
+
onChange: l,
|
|
1810
1915
|
filesystem: f
|
|
1811
1916
|
}) {
|
|
1812
|
-
const [
|
|
1813
|
-
|
|
1917
|
+
const [u, w] = K(!1), h = () => w(!0), x = () => w(!1), [E, R] = K(
|
|
1918
|
+
i || null
|
|
1814
1919
|
);
|
|
1815
|
-
function
|
|
1816
|
-
D == null || D.preventDefault(),
|
|
1920
|
+
function b(D) {
|
|
1921
|
+
D == null || D.preventDefault(), l(E || ""), x();
|
|
1817
1922
|
}
|
|
1818
1923
|
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
|
|
1819
|
-
|
|
1924
|
+
He,
|
|
1820
1925
|
{
|
|
1821
1926
|
variant: "tertiary",
|
|
1822
|
-
className:
|
|
1823
|
-
onClick:
|
|
1927
|
+
className: et.control,
|
|
1928
|
+
onClick: h
|
|
1824
1929
|
},
|
|
1825
|
-
/* @__PURE__ */ r.createElement("span", { className:
|
|
1826
|
-
/* @__PURE__ */ r.createElement(
|
|
1827
|
-
),
|
|
1828
|
-
|
|
1930
|
+
/* @__PURE__ */ r.createElement("span", { className: et.browseLabel }, "Browse"),
|
|
1931
|
+
/* @__PURE__ */ r.createElement(wn, { path: i || "" })
|
|
1932
|
+
), u && /* @__PURE__ */ r.createElement(
|
|
1933
|
+
zt,
|
|
1829
1934
|
{
|
|
1830
1935
|
title: "Select a path ",
|
|
1831
|
-
onRequestClose:
|
|
1832
|
-
className:
|
|
1936
|
+
onRequestClose: x,
|
|
1937
|
+
className: et.modal
|
|
1833
1938
|
},
|
|
1834
|
-
/* @__PURE__ */ r.createElement("form", { onSubmit:
|
|
1835
|
-
|
|
1939
|
+
/* @__PURE__ */ r.createElement("form", { onSubmit: b }, /* @__PURE__ */ r.createElement(
|
|
1940
|
+
un,
|
|
1836
1941
|
{
|
|
1837
1942
|
filesystem: f,
|
|
1838
|
-
initialSelectedPath:
|
|
1839
|
-
onSelect:
|
|
1943
|
+
initialSelectedPath: i,
|
|
1944
|
+
onSelect: R
|
|
1840
1945
|
}
|
|
1841
|
-
), /* @__PURE__ */ r.createElement("div", { className:
|
|
1946
|
+
), /* @__PURE__ */ r.createElement("div", { className: et.modalFooter }, /* @__PURE__ */ r.createElement(He, { type: "submit", variant: "primary" }, "Select Path")))
|
|
1842
1947
|
));
|
|
1843
1948
|
}
|
|
1844
|
-
const
|
|
1845
|
-
container:
|
|
1846
|
-
header:
|
|
1847
|
-
filename:
|
|
1848
|
-
downloadLink:
|
|
1849
|
-
previewArea:
|
|
1850
|
-
imagePreview:
|
|
1851
|
-
videoPreview:
|
|
1852
|
-
audioPreview:
|
|
1853
|
-
unsupportedMessage:
|
|
1854
|
-
actions:
|
|
1855
|
-
},
|
|
1856
|
-
if (!
|
|
1949
|
+
const vn = "_container_1h0az_1", gn = "_header_1h0az_9", En = "_filename_1h0az_18", _n = "_downloadLink_1h0az_26", yn = "_previewArea_1h0az_38", bn = "_imagePreview_1h0az_51", xn = "_videoPreview_1h0az_57", Cn = "_audioPreview_1h0az_64", Rn = "_unsupportedMessage_1h0az_68", Pn = "_actions_1h0az_74", je = {
|
|
1950
|
+
container: vn,
|
|
1951
|
+
header: gn,
|
|
1952
|
+
filename: En,
|
|
1953
|
+
downloadLink: _n,
|
|
1954
|
+
previewArea: yn,
|
|
1955
|
+
imagePreview: bn,
|
|
1956
|
+
videoPreview: xn,
|
|
1957
|
+
audioPreview: Cn,
|
|
1958
|
+
unsupportedMessage: Rn,
|
|
1959
|
+
actions: Pn
|
|
1960
|
+
}, kn = (i) => {
|
|
1961
|
+
if (!i)
|
|
1857
1962
|
return {
|
|
1858
1963
|
isImage: !1,
|
|
1859
1964
|
isVideo: !1,
|
|
1860
1965
|
isAudio: !1
|
|
1861
1966
|
};
|
|
1862
|
-
const
|
|
1967
|
+
const l = i.toLowerCase();
|
|
1863
1968
|
return {
|
|
1864
|
-
isImage:
|
|
1865
|
-
isVideo:
|
|
1866
|
-
isAudio:
|
|
1969
|
+
isImage: l.startsWith("image/"),
|
|
1970
|
+
isVideo: l.startsWith("video/"),
|
|
1971
|
+
isAudio: l.startsWith("audio/")
|
|
1867
1972
|
};
|
|
1868
1973
|
};
|
|
1869
|
-
function
|
|
1870
|
-
filename:
|
|
1871
|
-
mimeType:
|
|
1974
|
+
function no({
|
|
1975
|
+
filename: i,
|
|
1976
|
+
mimeType: l,
|
|
1872
1977
|
dataUrl: f,
|
|
1873
|
-
downloadUrl:
|
|
1874
|
-
showHeader:
|
|
1978
|
+
downloadUrl: u,
|
|
1979
|
+
showHeader: w = !0
|
|
1875
1980
|
}) {
|
|
1876
|
-
const { isImage:
|
|
1981
|
+
const { isImage: h, isVideo: x, isAudio: E } = kn(l), R = w !== !1, b = !!(u && i), D = () => b ? /* @__PURE__ */ r.createElement(
|
|
1877
1982
|
"a",
|
|
1878
1983
|
{
|
|
1879
|
-
className:
|
|
1880
|
-
href:
|
|
1881
|
-
download:
|
|
1984
|
+
className: je.downloadLink,
|
|
1985
|
+
href: u,
|
|
1986
|
+
download: i
|
|
1882
1987
|
},
|
|
1883
1988
|
"Download"
|
|
1884
|
-
) : null,
|
|
1989
|
+
) : null, k = () => h ? /* @__PURE__ */ r.createElement(
|
|
1885
1990
|
"img",
|
|
1886
1991
|
{
|
|
1887
|
-
className:
|
|
1992
|
+
className: je.imagePreview,
|
|
1888
1993
|
src: f,
|
|
1889
|
-
alt:
|
|
1994
|
+
alt: i || "Preview"
|
|
1890
1995
|
}
|
|
1891
|
-
) :
|
|
1996
|
+
) : x ? /* @__PURE__ */ r.createElement(
|
|
1892
1997
|
"video",
|
|
1893
1998
|
{
|
|
1894
|
-
className:
|
|
1999
|
+
className: je.videoPreview,
|
|
1895
2000
|
controls: !0,
|
|
1896
2001
|
preload: "metadata"
|
|
1897
2002
|
},
|
|
1898
|
-
/* @__PURE__ */ r.createElement("source", { src: f, type:
|
|
2003
|
+
/* @__PURE__ */ r.createElement("source", { src: f, type: l }),
|
|
1899
2004
|
"Your browser does not support the video tag."
|
|
1900
|
-
) :
|
|
1901
|
-
return /* @__PURE__ */ r.createElement("div", { className:
|
|
2005
|
+
) : E ? /* @__PURE__ */ r.createElement("audio", { className: je.audioPreview, controls: !0 }, /* @__PURE__ */ r.createElement("source", { src: f, type: l }), "Your browser does not support the audio tag.") : /* @__PURE__ */ r.createElement("div", { className: je.unsupportedMessage }, /* @__PURE__ */ r.createElement("p", null, "Preview unavailable for this file type."), b ? /* @__PURE__ */ r.createElement("p", null, D()) : /* @__PURE__ */ r.createElement("p", null, "Download the file to inspect its contents."));
|
|
2006
|
+
return /* @__PURE__ */ r.createElement("div", { className: je.container }, R && /* @__PURE__ */ r.createElement("div", { className: je.header }, /* @__PURE__ */ r.createElement("span", { className: je.filename, title: i }, i), D()), /* @__PURE__ */ r.createElement("div", { className: je.previewArea }, k()), !R && b && /* @__PURE__ */ r.createElement("div", { className: je.actions }, D()));
|
|
1902
2007
|
}
|
|
1903
|
-
const
|
|
1904
|
-
var
|
|
1905
|
-
if (!
|
|
1906
|
-
return
|
|
1907
|
-
const
|
|
1908
|
-
if (!
|
|
1909
|
-
return
|
|
1910
|
-
const f =
|
|
1911
|
-
if (
|
|
1912
|
-
return
|
|
1913
|
-
let
|
|
1914
|
-
switch (
|
|
2008
|
+
const It = /* @__PURE__ */ new Map(), Tn = async (i) => {
|
|
2009
|
+
var w;
|
|
2010
|
+
if (!i)
|
|
2011
|
+
return mt();
|
|
2012
|
+
const l = (w = i.split(".").pop()) == null ? void 0 : w.toLowerCase();
|
|
2013
|
+
if (!l || l === "php")
|
|
2014
|
+
return mt();
|
|
2015
|
+
const f = i;
|
|
2016
|
+
if (It.has(f))
|
|
2017
|
+
return It.get(f);
|
|
2018
|
+
let u;
|
|
2019
|
+
switch (l) {
|
|
1915
2020
|
case "css":
|
|
1916
|
-
|
|
1917
|
-
(
|
|
2021
|
+
u = await import("@codemirror/lang-css").then(
|
|
2022
|
+
(h) => h.css()
|
|
1918
2023
|
);
|
|
1919
2024
|
break;
|
|
1920
2025
|
case "js":
|
|
1921
2026
|
case "jsx":
|
|
1922
2027
|
case "ts":
|
|
1923
2028
|
case "tsx":
|
|
1924
|
-
|
|
1925
|
-
(
|
|
1926
|
-
jsx:
|
|
1927
|
-
typescript:
|
|
2029
|
+
u = await import("@codemirror/lang-javascript").then(
|
|
2030
|
+
(h) => h.javascript({
|
|
2031
|
+
jsx: l === "jsx" || l === "tsx",
|
|
2032
|
+
typescript: l === "ts" || l === "tsx"
|
|
1928
2033
|
})
|
|
1929
2034
|
);
|
|
1930
2035
|
break;
|
|
1931
2036
|
case "json":
|
|
1932
|
-
|
|
1933
|
-
(
|
|
2037
|
+
u = await import("@codemirror/lang-json").then(
|
|
2038
|
+
(h) => h.json()
|
|
1934
2039
|
);
|
|
1935
2040
|
break;
|
|
1936
2041
|
case "html":
|
|
1937
2042
|
case "htm":
|
|
1938
|
-
|
|
1939
|
-
(
|
|
2043
|
+
u = await import("@codemirror/lang-html").then(
|
|
2044
|
+
(h) => h.html()
|
|
1940
2045
|
);
|
|
1941
2046
|
break;
|
|
1942
2047
|
case "md":
|
|
1943
2048
|
case "markdown":
|
|
1944
|
-
|
|
1945
|
-
(
|
|
2049
|
+
u = await import("@codemirror/lang-markdown").then(
|
|
2050
|
+
(h) => h.markdown()
|
|
1946
2051
|
);
|
|
1947
2052
|
break;
|
|
1948
2053
|
default:
|
|
1949
|
-
|
|
2054
|
+
u = mt();
|
|
1950
2055
|
}
|
|
1951
|
-
return
|
|
2056
|
+
return It.set(f, u), u;
|
|
1952
2057
|
};
|
|
1953
|
-
class
|
|
1954
|
-
constructor(
|
|
1955
|
-
this.view =
|
|
2058
|
+
class Sn {
|
|
2059
|
+
constructor(l) {
|
|
2060
|
+
this.view = l, this.handleClick = this.handleClick.bind(this), this.view.dom.addEventListener("mousedown", this.handleClick);
|
|
1956
2061
|
}
|
|
1957
|
-
handleClick(
|
|
1958
|
-
const f =
|
|
2062
|
+
handleClick(l) {
|
|
2063
|
+
const f = l.target;
|
|
1959
2064
|
if ((f.classList.contains("cm-scroller") || f.classList.contains("cm-content")) && this.view.posAtCoords({
|
|
1960
|
-
x:
|
|
1961
|
-
y:
|
|
2065
|
+
x: l.clientX,
|
|
2066
|
+
y: l.clientY
|
|
1962
2067
|
}) === null) {
|
|
1963
|
-
const
|
|
1964
|
-
|
|
2068
|
+
const w = this.view.state.doc.length, h = yt.create([
|
|
2069
|
+
yt.range(w, w)
|
|
1965
2070
|
]);
|
|
1966
2071
|
this.view.dispatch({
|
|
1967
|
-
selection:
|
|
1968
|
-
effects:
|
|
2072
|
+
selection: h,
|
|
2073
|
+
effects: dt.scrollIntoView(w, {
|
|
1969
2074
|
y: "center"
|
|
1970
2075
|
})
|
|
1971
|
-
}), this.view.focus(),
|
|
2076
|
+
}), this.view.focus(), l.preventDefault();
|
|
1972
2077
|
}
|
|
1973
2078
|
}
|
|
1974
2079
|
destroy() {
|
|
1975
2080
|
this.view.dom.removeEventListener("mousedown", this.handleClick);
|
|
1976
2081
|
}
|
|
1977
2082
|
}
|
|
1978
|
-
const
|
|
1979
|
-
(
|
|
1980
|
-
),
|
|
2083
|
+
const Dn = vr.define(
|
|
2084
|
+
(i) => new Sn(i)
|
|
2085
|
+
), Jt = bt(
|
|
1981
2086
|
function({
|
|
1982
|
-
code:
|
|
2087
|
+
code: l,
|
|
1983
2088
|
onChange: f,
|
|
1984
|
-
currentPath:
|
|
1985
|
-
language:
|
|
1986
|
-
className:
|
|
1987
|
-
onSaveShortcut:
|
|
1988
|
-
readOnly:
|
|
1989
|
-
additionalExtensions:
|
|
1990
|
-
},
|
|
1991
|
-
const D =
|
|
2089
|
+
currentPath: u,
|
|
2090
|
+
language: w,
|
|
2091
|
+
className: h,
|
|
2092
|
+
onSaveShortcut: x,
|
|
2093
|
+
readOnly: E = !1,
|
|
2094
|
+
additionalExtensions: R
|
|
2095
|
+
}, b) {
|
|
2096
|
+
const D = O(
|
|
1992
2097
|
null
|
|
1993
|
-
),
|
|
1994
|
-
return
|
|
2098
|
+
), k = O(null), F = O(new Ft()), Q = O(new Ft()), J = O(new Ft()), v = O(l), Z = O(f), T = O(!1);
|
|
2099
|
+
return xt(b, () => ({
|
|
1995
2100
|
focus: () => {
|
|
1996
2101
|
var m;
|
|
1997
|
-
(m =
|
|
2102
|
+
(m = k.current) == null || m.focus();
|
|
1998
2103
|
},
|
|
1999
2104
|
blur: () => {
|
|
2000
|
-
const m =
|
|
2105
|
+
const m = k.current;
|
|
2001
2106
|
m && m.contentDOM.blur();
|
|
2002
2107
|
},
|
|
2003
|
-
getCursorPosition: () =>
|
|
2108
|
+
getCursorPosition: () => k.current ? k.current.state.selection.main.anchor : null,
|
|
2004
2109
|
setCursorPosition: (m) => {
|
|
2005
|
-
if (!
|
|
2110
|
+
if (!k.current)
|
|
2006
2111
|
return;
|
|
2007
|
-
const
|
|
2112
|
+
const N = Math.min(
|
|
2008
2113
|
m,
|
|
2009
|
-
|
|
2010
|
-
),
|
|
2011
|
-
|
|
2114
|
+
k.current.state.doc.length
|
|
2115
|
+
), j = yt.create([
|
|
2116
|
+
yt.range(N, N)
|
|
2012
2117
|
]);
|
|
2013
|
-
|
|
2014
|
-
selection:
|
|
2118
|
+
k.current.dispatch({
|
|
2119
|
+
selection: j,
|
|
2015
2120
|
scrollIntoView: !0
|
|
2016
2121
|
});
|
|
2017
2122
|
}
|
|
2018
|
-
})),
|
|
2019
|
-
|
|
2020
|
-
}, [
|
|
2021
|
-
|
|
2022
|
-
}, [f]),
|
|
2023
|
-
if (
|
|
2123
|
+
})), W(() => {
|
|
2124
|
+
v.current = l;
|
|
2125
|
+
}, [l]), W(() => {
|
|
2126
|
+
Z.current = f;
|
|
2127
|
+
}, [f]), W(() => {
|
|
2128
|
+
if (k.current)
|
|
2024
2129
|
return;
|
|
2025
2130
|
const m = D.current;
|
|
2026
2131
|
if (!m)
|
|
2027
2132
|
return;
|
|
2028
|
-
const
|
|
2029
|
-
doc:
|
|
2133
|
+
const N = wr.create({
|
|
2134
|
+
doc: l,
|
|
2030
2135
|
extensions: [
|
|
2031
|
-
|
|
2032
|
-
mr(),
|
|
2033
|
-
pr(),
|
|
2034
|
-
hr(),
|
|
2035
|
-
Dr(),
|
|
2036
|
-
vr(),
|
|
2037
|
-
wr(),
|
|
2136
|
+
J.current.of(R ?? []),
|
|
2038
2137
|
gr(),
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
Z.current.of(
|
|
2042
|
-
ct.editable.of(!A)
|
|
2043
|
-
),
|
|
2044
|
-
Ar(Nr),
|
|
2045
|
-
Fr(),
|
|
2138
|
+
Er(),
|
|
2139
|
+
_r(),
|
|
2046
2140
|
Ir(),
|
|
2047
|
-
kr(),
|
|
2048
2141
|
yr(),
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2142
|
+
br(),
|
|
2143
|
+
xr(),
|
|
2144
|
+
Dn,
|
|
2145
|
+
F.current.of(w ?? mt()),
|
|
2146
|
+
Q.current.of(
|
|
2147
|
+
dt.editable.of(!E)
|
|
2148
|
+
),
|
|
2149
|
+
Mr(Or),
|
|
2150
|
+
jr(),
|
|
2151
|
+
Br(),
|
|
2152
|
+
Ar(),
|
|
2153
|
+
Rr(),
|
|
2154
|
+
Sr(),
|
|
2155
|
+
Nr(),
|
|
2156
|
+
dt.updateListener.of((L) => {
|
|
2157
|
+
if (!L.docChanged)
|
|
2053
2158
|
return;
|
|
2054
|
-
const
|
|
2055
|
-
|
|
2159
|
+
const U = L.state.doc.toString();
|
|
2160
|
+
U !== v.current && (v.current = U, Z.current(U));
|
|
2056
2161
|
}),
|
|
2057
|
-
|
|
2162
|
+
Cr.of([
|
|
2058
2163
|
{
|
|
2059
2164
|
key: "Mod-s",
|
|
2060
2165
|
preventDefault: !0,
|
|
2061
|
-
run: () => (
|
|
2166
|
+
run: () => (x == null || x(), !0)
|
|
2062
2167
|
},
|
|
2063
|
-
...
|
|
2064
|
-
...Tr,
|
|
2168
|
+
...Fr,
|
|
2065
2169
|
...Lr,
|
|
2066
|
-
...
|
|
2067
|
-
...
|
|
2068
|
-
...
|
|
2069
|
-
|
|
2170
|
+
...Vr,
|
|
2171
|
+
...Dr,
|
|
2172
|
+
...Pr,
|
|
2173
|
+
...kr,
|
|
2174
|
+
Tr
|
|
2070
2175
|
])
|
|
2071
2176
|
]
|
|
2072
|
-
}),
|
|
2073
|
-
return
|
|
2074
|
-
|
|
2177
|
+
}), j = new dt({ state: N, parent: m });
|
|
2178
|
+
return k.current = j, () => {
|
|
2179
|
+
j.destroy(), k.current = null;
|
|
2075
2180
|
};
|
|
2076
|
-
}, []),
|
|
2077
|
-
const m =
|
|
2181
|
+
}, []), W(() => {
|
|
2182
|
+
const m = k.current;
|
|
2078
2183
|
m && m.dispatch({
|
|
2079
|
-
effects:
|
|
2080
|
-
|
|
2184
|
+
effects: J.current.reconfigure(
|
|
2185
|
+
R ?? []
|
|
2081
2186
|
)
|
|
2082
2187
|
});
|
|
2083
|
-
}, [
|
|
2084
|
-
const m =
|
|
2188
|
+
}, [R]), W(() => {
|
|
2189
|
+
const m = k.current;
|
|
2085
2190
|
if (!m)
|
|
2086
2191
|
return;
|
|
2087
|
-
const
|
|
2088
|
-
|
|
2089
|
-
changes: { from: 0, to: m.state.doc.length, insert:
|
|
2192
|
+
const N = m.state.doc.toString();
|
|
2193
|
+
l !== N && m.dispatch({
|
|
2194
|
+
changes: { from: 0, to: m.state.doc.length, insert: l }
|
|
2090
2195
|
});
|
|
2091
|
-
}, [
|
|
2092
|
-
var
|
|
2093
|
-
const m =
|
|
2196
|
+
}, [l]), W(() => {
|
|
2197
|
+
var U;
|
|
2198
|
+
const m = k.current;
|
|
2094
2199
|
if (!m)
|
|
2095
2200
|
return;
|
|
2096
|
-
if (
|
|
2201
|
+
if (w) {
|
|
2097
2202
|
m.dispatch({
|
|
2098
|
-
effects:
|
|
2203
|
+
effects: F.current.reconfigure(w)
|
|
2099
2204
|
});
|
|
2100
2205
|
return;
|
|
2101
2206
|
}
|
|
2102
|
-
const
|
|
2103
|
-
(!
|
|
2104
|
-
effects:
|
|
2207
|
+
const N = (U = u == null ? void 0 : u.split(".").pop()) == null ? void 0 : U.toLowerCase();
|
|
2208
|
+
(!N || N === "php") && m.dispatch({
|
|
2209
|
+
effects: F.current.reconfigure(mt())
|
|
2105
2210
|
});
|
|
2106
|
-
let
|
|
2107
|
-
return
|
|
2108
|
-
|
|
2109
|
-
effects:
|
|
2211
|
+
let L = !1;
|
|
2212
|
+
return Tn(u).then((re) => {
|
|
2213
|
+
L || !k.current || k.current.dispatch({
|
|
2214
|
+
effects: F.current.reconfigure(re)
|
|
2110
2215
|
});
|
|
2111
2216
|
}), () => {
|
|
2112
|
-
|
|
2217
|
+
L = !0;
|
|
2113
2218
|
};
|
|
2114
|
-
}, [
|
|
2115
|
-
const m =
|
|
2116
|
-
m && (m.hasFocus && (
|
|
2117
|
-
effects:
|
|
2118
|
-
|
|
2219
|
+
}, [u, w]), W(() => {
|
|
2220
|
+
const m = k.current;
|
|
2221
|
+
m && (m.hasFocus && (T.current = !0), m.dispatch({
|
|
2222
|
+
effects: Q.current.reconfigure(
|
|
2223
|
+
dt.editable.of(!E)
|
|
2119
2224
|
)
|
|
2120
2225
|
}));
|
|
2121
|
-
}, [
|
|
2122
|
-
const m =
|
|
2123
|
-
m &&
|
|
2124
|
-
}, [
|
|
2226
|
+
}, [E]), tr(() => {
|
|
2227
|
+
const m = k.current;
|
|
2228
|
+
m && T.current && !m.hasFocus && (m.focus(), T.current = !1);
|
|
2229
|
+
}, [u, E]), /* @__PURE__ */ r.createElement("div", { ref: D, className: h });
|
|
2125
2230
|
}
|
|
2126
2231
|
);
|
|
2127
|
-
|
|
2128
|
-
const
|
|
2129
|
-
fileExplorerContainer:
|
|
2130
|
-
dropActive:
|
|
2131
|
-
fileExplorerHeader:
|
|
2132
|
-
fileExplorerTitle:
|
|
2133
|
-
fileExplorerSubsectionTitle:
|
|
2134
|
-
fileExplorerActions:
|
|
2135
|
-
fileExplorerButton:
|
|
2136
|
-
fileExplorerIconButton:
|
|
2137
|
-
fileExplorerTree:
|
|
2138
|
-
dockPresentation:
|
|
2139
|
-
fileExplorerUploadButton:
|
|
2140
|
-
},
|
|
2141
|
-
const
|
|
2142
|
-
for (let f = 0; f < Math.min(
|
|
2143
|
-
if (
|
|
2232
|
+
Jt.displayName = "CodeEditor";
|
|
2233
|
+
const An = "_fileExplorerContainer_rb5rx_1", Nn = "_dropActive_rb5rx_9", Fn = "_fileExplorerHeader_rb5rx_14", Ln = "_fileExplorerTitle_rb5rx_23", In = "_fileExplorerSubsectionTitle_rb5rx_31", Mn = "_fileExplorerActions_rb5rx_35", On = "_fileExplorerButton_rb5rx_41", jn = "_fileExplorerIconButton_rb5rx_71", Bn = "_fileExplorerTree_rb5rx_83", Vn = "_dockPresentation_rb5rx_92", $n = "_fileExplorerUploadButton_rb5rx_152", xe = {
|
|
2234
|
+
fileExplorerContainer: An,
|
|
2235
|
+
dropActive: Nn,
|
|
2236
|
+
fileExplorerHeader: Fn,
|
|
2237
|
+
fileExplorerTitle: Ln,
|
|
2238
|
+
fileExplorerSubsectionTitle: In,
|
|
2239
|
+
fileExplorerActions: Mn,
|
|
2240
|
+
fileExplorerButton: On,
|
|
2241
|
+
fileExplorerIconButton: jn,
|
|
2242
|
+
fileExplorerTree: Bn,
|
|
2243
|
+
dockPresentation: Vn,
|
|
2244
|
+
fileExplorerUploadButton: $n
|
|
2245
|
+
}, Xt = 1024 * 1024, Hn = (i) => {
|
|
2246
|
+
const l = i.byteLength;
|
|
2247
|
+
for (let f = 0; f < Math.min(l, 4096); f++)
|
|
2248
|
+
if (i[f] === 0)
|
|
2144
2249
|
return !0;
|
|
2145
2250
|
try {
|
|
2146
|
-
return new TextDecoder("utf-8", { fatal: !0 }).decode(
|
|
2251
|
+
return new TextDecoder("utf-8", { fatal: !0 }).decode(i), !1;
|
|
2147
2252
|
} catch {
|
|
2148
2253
|
return !0;
|
|
2149
2254
|
}
|
|
2150
|
-
},
|
|
2151
|
-
const f = new Blob([
|
|
2152
|
-
return setTimeout(() => URL.revokeObjectURL(
|
|
2255
|
+
}, Wt = (i, l) => {
|
|
2256
|
+
const f = new Blob([i]), u = URL.createObjectURL(f);
|
|
2257
|
+
return setTimeout(() => URL.revokeObjectURL(u), 6e4), { url: u, filename: l };
|
|
2153
2258
|
};
|
|
2154
|
-
async function
|
|
2155
|
-
const f =
|
|
2156
|
-
if (f !== void 0 && f >
|
|
2259
|
+
async function Wn(i, l = Xt) {
|
|
2260
|
+
const f = Un(i);
|
|
2261
|
+
if (f !== void 0 && f > l)
|
|
2157
2262
|
return { type: "too-large" };
|
|
2158
|
-
if (typeof
|
|
2159
|
-
return
|
|
2160
|
-
const
|
|
2161
|
-
return
|
|
2263
|
+
if (typeof i.stream == "function")
|
|
2264
|
+
return zn(i, l);
|
|
2265
|
+
const u = new Uint8Array(await i.arrayBuffer());
|
|
2266
|
+
return u.byteLength > l ? { type: "too-large" } : { type: "inline", data: u };
|
|
2162
2267
|
}
|
|
2163
|
-
function
|
|
2164
|
-
if (typeof
|
|
2165
|
-
return
|
|
2166
|
-
if (typeof
|
|
2167
|
-
return
|
|
2268
|
+
function Un(i) {
|
|
2269
|
+
if (typeof i.filesize == "number")
|
|
2270
|
+
return i.filesize;
|
|
2271
|
+
if (typeof i.size == "number")
|
|
2272
|
+
return i.size;
|
|
2168
2273
|
}
|
|
2169
|
-
async function
|
|
2170
|
-
const f =
|
|
2171
|
-
let
|
|
2274
|
+
async function zn(i, l) {
|
|
2275
|
+
const f = i.stream().getReader(), u = [];
|
|
2276
|
+
let w = 0;
|
|
2172
2277
|
try {
|
|
2173
2278
|
for (; ; ) {
|
|
2174
|
-
const { done:
|
|
2175
|
-
if (
|
|
2279
|
+
const { done: h, value: x } = await f.read();
|
|
2280
|
+
if (h)
|
|
2176
2281
|
return {
|
|
2177
2282
|
type: "inline",
|
|
2178
|
-
data:
|
|
2283
|
+
data: ar(u)
|
|
2179
2284
|
};
|
|
2180
|
-
if (
|
|
2181
|
-
if (
|
|
2285
|
+
if (x) {
|
|
2286
|
+
if (w += x.byteLength, w > l)
|
|
2182
2287
|
return await f.cancel().catch(() => {
|
|
2183
2288
|
}), { type: "too-large" };
|
|
2184
|
-
|
|
2289
|
+
u.push(x);
|
|
2185
2290
|
}
|
|
2186
2291
|
}
|
|
2187
2292
|
} finally {
|
|
2188
2293
|
f.releaseLock();
|
|
2189
2294
|
}
|
|
2190
2295
|
}
|
|
2191
|
-
const
|
|
2192
|
-
const
|
|
2193
|
-
return
|
|
2194
|
-
},
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2296
|
+
const Gn = (i) => {
|
|
2297
|
+
const l = i.split(".").pop();
|
|
2298
|
+
return jt[l] || jt._default;
|
|
2299
|
+
}, Yn = (i) => i.startsWith("image/") || i.startsWith("video/") || i.startsWith("audio/"), Zn = bt(function({
|
|
2300
|
+
filesystem: l,
|
|
2301
|
+
currentPath: f,
|
|
2302
|
+
selectedDirPath: u,
|
|
2303
|
+
setSelectedDirPath: w,
|
|
2304
|
+
onFileOpened: h,
|
|
2305
|
+
onSelectionCleared: x,
|
|
2306
|
+
onShowMessage: E,
|
|
2307
|
+
documentRoot: R,
|
|
2308
|
+
readOnly: b = !1,
|
|
2309
|
+
title: D = "Files",
|
|
2310
|
+
mobileSubsectionTitle: k,
|
|
2311
|
+
showBinaryPreviewHeader: F = !0,
|
|
2312
|
+
dockPresentation: Q = !1,
|
|
2313
|
+
useWordPressTooltips: J = !1,
|
|
2314
|
+
pathBadges: v,
|
|
2315
|
+
onMountFromGit: Z,
|
|
2316
|
+
onPathRenamed: T
|
|
2317
|
+
}, m) {
|
|
2318
|
+
const N = O(null), j = O(null);
|
|
2319
|
+
xt(
|
|
2320
|
+
m,
|
|
2321
|
+
() => ({
|
|
2322
|
+
refreshPath: async (d) => {
|
|
2323
|
+
var P;
|
|
2324
|
+
await ((P = N.current) == null ? void 0 : P.refresh(d));
|
|
2325
|
+
},
|
|
2326
|
+
revealPath: async (d) => {
|
|
2327
|
+
var P;
|
|
2328
|
+
await ((P = N.current) == null ? void 0 : P.revealPath(d));
|
|
2329
|
+
}
|
|
2330
|
+
}),
|
|
2331
|
+
[]
|
|
2332
|
+
);
|
|
2333
|
+
const L = ft(() => f ? Ne(f) : u ?? R, [f, R]), [U, re] = K(!1);
|
|
2334
|
+
W(() => {
|
|
2335
|
+
!f || !N.current || (w(Ne(f)), N.current.focusPath(f, {
|
|
2214
2336
|
select: !0,
|
|
2215
2337
|
domFocus: !1,
|
|
2216
2338
|
notify: !1
|
|
2217
|
-
}),
|
|
2218
|
-
}, [
|
|
2219
|
-
const
|
|
2339
|
+
}), N.current.expandToPath(f));
|
|
2340
|
+
}, [f, w]);
|
|
2341
|
+
const ne = async (d, P) => {
|
|
2220
2342
|
try {
|
|
2221
|
-
const
|
|
2222
|
-
if (
|
|
2223
|
-
const
|
|
2224
|
-
if (!
|
|
2225
|
-
await
|
|
2226
|
-
|
|
2227
|
-
/* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("p", null, `File too large to open (>${
|
|
2343
|
+
const V = await l.read(d), z = await Wn(V);
|
|
2344
|
+
if (z.type === "too-large") {
|
|
2345
|
+
const me = Xt / 1024 / 1024;
|
|
2346
|
+
if (!Q) {
|
|
2347
|
+
await E(
|
|
2348
|
+
d,
|
|
2349
|
+
/* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("p", null, `File too large to open (>${me}MB).`), /* @__PURE__ */ r.createElement("p", null, "Open or download it outside the in-browser editor."))
|
|
2228
2350
|
);
|
|
2229
2351
|
return;
|
|
2230
2352
|
}
|
|
2231
|
-
const
|
|
2232
|
-
await
|
|
2233
|
-
|
|
2234
|
-
/* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("p", null, `File too large to open (>${
|
|
2235
|
-
|
|
2353
|
+
const Y = tt(d) || "download";
|
|
2354
|
+
await E(
|
|
2355
|
+
d,
|
|
2356
|
+
/* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("p", null, `File too large to open (>${me}MB).`), /* @__PURE__ */ r.createElement("p", null, /* @__PURE__ */ r.createElement(
|
|
2357
|
+
He,
|
|
2236
2358
|
{
|
|
2237
2359
|
type: "button",
|
|
2238
2360
|
variant: "link",
|
|
2239
2361
|
onClick: () => {
|
|
2240
|
-
|
|
2362
|
+
X(d, Y);
|
|
2241
2363
|
}
|
|
2242
2364
|
},
|
|
2243
2365
|
"Download ",
|
|
2244
|
-
|
|
2366
|
+
Y
|
|
2245
2367
|
)))
|
|
2246
2368
|
);
|
|
2247
2369
|
return;
|
|
2248
2370
|
}
|
|
2249
|
-
const
|
|
2250
|
-
if (
|
|
2251
|
-
const
|
|
2252
|
-
|
|
2371
|
+
const $ = z.data, G = tt(d) || "download";
|
|
2372
|
+
if (Hn($)) {
|
|
2373
|
+
const me = Gn(G), { url: Y, filename: ee } = Wt(
|
|
2374
|
+
$,
|
|
2253
2375
|
G
|
|
2254
2376
|
);
|
|
2255
|
-
if (
|
|
2256
|
-
const
|
|
2257
|
-
await
|
|
2258
|
-
|
|
2377
|
+
if (Yn(me)) {
|
|
2378
|
+
const ue = new Blob([$], { type: me }), Pe = URL.createObjectURL(ue);
|
|
2379
|
+
await E(
|
|
2380
|
+
d,
|
|
2259
2381
|
/* @__PURE__ */ r.createElement(
|
|
2260
|
-
|
|
2382
|
+
Hr,
|
|
2261
2383
|
{
|
|
2262
|
-
filename:
|
|
2263
|
-
mimeType:
|
|
2264
|
-
dataUrl:
|
|
2265
|
-
downloadUrl:
|
|
2266
|
-
showHeader:
|
|
2384
|
+
filename: ee,
|
|
2385
|
+
mimeType: me,
|
|
2386
|
+
dataUrl: Pe,
|
|
2387
|
+
downloadUrl: Y,
|
|
2388
|
+
showHeader: F
|
|
2267
2389
|
}
|
|
2268
2390
|
)
|
|
2269
2391
|
);
|
|
2270
2392
|
return;
|
|
2271
2393
|
}
|
|
2272
|
-
await
|
|
2273
|
-
|
|
2274
|
-
/* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("p", null, "Binary file. Cannot be edited."), /* @__PURE__ */ r.createElement("p", null, /* @__PURE__ */ r.createElement("a", { href:
|
|
2394
|
+
await E(
|
|
2395
|
+
d,
|
|
2396
|
+
/* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("p", null, "Binary file. Cannot be edited."), /* @__PURE__ */ r.createElement("p", null, /* @__PURE__ */ r.createElement("a", { href: Y, download: ee }, "Download ", ee)))
|
|
2275
2397
|
);
|
|
2276
2398
|
return;
|
|
2277
2399
|
}
|
|
2278
|
-
const
|
|
2279
|
-
await
|
|
2280
|
-
} catch (
|
|
2281
|
-
|
|
2400
|
+
const ce = new TextDecoder("utf-8").decode($);
|
|
2401
|
+
await h(d, ce, P);
|
|
2402
|
+
} catch (V) {
|
|
2403
|
+
Ye.error("Could not open file", V), await E(null, "Could not open file.");
|
|
2282
2404
|
}
|
|
2283
|
-
},
|
|
2405
|
+
}, X = async (d, P) => {
|
|
2284
2406
|
try {
|
|
2285
|
-
const
|
|
2286
|
-
G.href =
|
|
2287
|
-
} catch (
|
|
2288
|
-
|
|
2289
|
-
}
|
|
2290
|
-
},
|
|
2291
|
-
var
|
|
2292
|
-
const
|
|
2293
|
-
|
|
2294
|
-
},
|
|
2295
|
-
var
|
|
2296
|
-
|
|
2407
|
+
const V = await l.read(d), z = new Uint8Array(await V.arrayBuffer()), { url: $ } = Wt(z, P), G = document.createElement("a");
|
|
2408
|
+
G.href = $, G.download = P, document.body.appendChild(G), G.click(), document.body.removeChild(G);
|
|
2409
|
+
} catch (V) {
|
|
2410
|
+
Ye.error("Could not download file", V), await E(d, "Could not download file.");
|
|
2411
|
+
}
|
|
2412
|
+
}, ae = (d) => {
|
|
2413
|
+
var V;
|
|
2414
|
+
const P = Array.from(d.target.files ?? []);
|
|
2415
|
+
d.target.value = "", P.length !== 0 && ((V = N.current) == null || V.importFiles(P, u ?? R).catch((z) => Ye.error("Failed to import files", z)));
|
|
2416
|
+
}, _ = (d) => {
|
|
2417
|
+
var P;
|
|
2418
|
+
d.dataTransfer.types.includes(
|
|
2297
2419
|
"application/x-wp-playground-path"
|
|
2298
|
-
) || (
|
|
2299
|
-
|
|
2300
|
-
|
|
2420
|
+
) || (d.preventDefault(), !b && ((P = N.current) == null || P.importDataTransfer(
|
|
2421
|
+
d.dataTransfer,
|
|
2422
|
+
u ?? R
|
|
2301
2423
|
).catch(
|
|
2302
|
-
(
|
|
2424
|
+
(V) => Ye.error("Failed to import dropped files", V)
|
|
2303
2425
|
)));
|
|
2304
2426
|
};
|
|
2305
2427
|
return /* @__PURE__ */ r.createElement(
|
|
2306
2428
|
"div",
|
|
2307
2429
|
{
|
|
2308
|
-
className:
|
|
2309
|
-
[
|
|
2310
|
-
[
|
|
2430
|
+
className: Fe(xe.fileExplorerContainer, {
|
|
2431
|
+
[xe.dropActive]: U,
|
|
2432
|
+
[xe.dockPresentation]: Q
|
|
2311
2433
|
}),
|
|
2312
|
-
onDragEnter: (
|
|
2313
|
-
|
|
2434
|
+
onDragEnter: (d) => {
|
|
2435
|
+
d.dataTransfer.types.includes(
|
|
2314
2436
|
"application/x-wp-playground-path"
|
|
2315
|
-
) || (
|
|
2437
|
+
) || (d.preventDefault(), b || re(!0));
|
|
2316
2438
|
},
|
|
2317
|
-
onDragOver: (
|
|
2318
|
-
|
|
2439
|
+
onDragOver: (d) => {
|
|
2440
|
+
d.dataTransfer.types.includes(
|
|
2319
2441
|
"application/x-wp-playground-path"
|
|
2320
|
-
) || (
|
|
2442
|
+
) || (d.preventDefault(), d.dataTransfer.dropEffect = b ? "none" : "copy");
|
|
2321
2443
|
},
|
|
2322
|
-
onDragLeave: (
|
|
2323
|
-
const
|
|
2324
|
-
(
|
|
2444
|
+
onDragLeave: (d) => {
|
|
2445
|
+
const P = d.relatedTarget;
|
|
2446
|
+
(!P || !d.currentTarget.contains(P)) && re(!1);
|
|
2325
2447
|
},
|
|
2326
|
-
onDropCapture: () =>
|
|
2327
|
-
onDrop:
|
|
2448
|
+
onDropCapture: () => re(!1),
|
|
2449
|
+
onDrop: _
|
|
2328
2450
|
},
|
|
2329
|
-
/* @__PURE__ */ r.createElement("div", { className:
|
|
2330
|
-
|
|
2451
|
+
/* @__PURE__ */ r.createElement("div", { className: xe.fileExplorerHeader }, /* @__PURE__ */ r.createElement("span", { className: xe.fileExplorerTitle }, D), k ? /* @__PURE__ */ r.createElement("span", { className: xe.fileExplorerSubsectionTitle }, k) : null, b ? null : /* @__PURE__ */ r.createElement("div", { className: xe.fileExplorerActions }, /* @__PURE__ */ r.createElement(
|
|
2452
|
+
Mt,
|
|
2331
2453
|
{
|
|
2332
2454
|
label: "Create new file",
|
|
2333
|
-
useWordPressTooltip:
|
|
2455
|
+
useWordPressTooltip: J
|
|
2334
2456
|
},
|
|
2335
2457
|
/* @__PURE__ */ r.createElement(
|
|
2336
2458
|
"button",
|
|
2337
2459
|
{
|
|
2338
|
-
className:
|
|
2339
|
-
|
|
2340
|
-
|
|
2460
|
+
className: Fe(
|
|
2461
|
+
xe.fileExplorerButton,
|
|
2462
|
+
xe.fileExplorerIconButton
|
|
2341
2463
|
),
|
|
2342
2464
|
type: "button",
|
|
2343
2465
|
onClick: () => {
|
|
2344
|
-
|
|
2466
|
+
N.current && N.current.createFile();
|
|
2345
2467
|
},
|
|
2346
2468
|
"aria-label": "Create new file",
|
|
2347
|
-
title:
|
|
2469
|
+
title: J ? void 0 : "Create new file"
|
|
2348
2470
|
},
|
|
2349
|
-
|
|
2471
|
+
Q ? /* @__PURE__ */ r.createElement(Kn, null) : /* @__PURE__ */ r.createElement(At, { icon: qr, size: 20 })
|
|
2350
2472
|
)
|
|
2351
2473
|
), /* @__PURE__ */ r.createElement(
|
|
2352
|
-
|
|
2474
|
+
Mt,
|
|
2353
2475
|
{
|
|
2354
2476
|
label: "Create new folder",
|
|
2355
|
-
useWordPressTooltip:
|
|
2477
|
+
useWordPressTooltip: J
|
|
2356
2478
|
},
|
|
2357
2479
|
/* @__PURE__ */ r.createElement(
|
|
2358
2480
|
"button",
|
|
2359
2481
|
{
|
|
2360
|
-
className:
|
|
2361
|
-
|
|
2362
|
-
|
|
2482
|
+
className: Fe(
|
|
2483
|
+
xe.fileExplorerButton,
|
|
2484
|
+
xe.fileExplorerIconButton
|
|
2363
2485
|
),
|
|
2364
2486
|
type: "button",
|
|
2365
2487
|
onClick: () => {
|
|
2366
|
-
|
|
2488
|
+
N.current && N.current.createFolder();
|
|
2367
2489
|
},
|
|
2368
2490
|
"aria-label": "Create new folder",
|
|
2369
|
-
title:
|
|
2491
|
+
title: J ? void 0 : "Create new folder"
|
|
2370
2492
|
},
|
|
2371
|
-
|
|
2493
|
+
Q ? /* @__PURE__ */ r.createElement(qn, null) : /* @__PURE__ */ r.createElement(At, { icon: Kr, size: 20 })
|
|
2372
2494
|
)
|
|
2373
2495
|
), /* @__PURE__ */ r.createElement(
|
|
2374
|
-
|
|
2496
|
+
Mt,
|
|
2375
2497
|
{
|
|
2376
2498
|
label: "Upload files",
|
|
2377
|
-
useWordPressTooltip:
|
|
2499
|
+
useWordPressTooltip: J
|
|
2378
2500
|
},
|
|
2379
2501
|
/* @__PURE__ */ r.createElement(
|
|
2380
2502
|
"button",
|
|
2381
2503
|
{
|
|
2382
|
-
className:
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2504
|
+
className: Fe(
|
|
2505
|
+
xe.fileExplorerButton,
|
|
2506
|
+
xe.fileExplorerIconButton,
|
|
2507
|
+
xe.fileExplorerUploadButton
|
|
2386
2508
|
),
|
|
2387
2509
|
type: "button",
|
|
2388
2510
|
onClick: () => {
|
|
2389
|
-
var
|
|
2390
|
-
return (
|
|
2511
|
+
var d;
|
|
2512
|
+
return (d = j.current) == null ? void 0 : d.click();
|
|
2391
2513
|
},
|
|
2392
2514
|
"aria-label": "Upload files",
|
|
2393
|
-
title:
|
|
2515
|
+
title: J ? void 0 : "Upload files"
|
|
2394
2516
|
},
|
|
2395
2517
|
/* @__PURE__ */ r.createElement(
|
|
2396
|
-
|
|
2518
|
+
At,
|
|
2397
2519
|
{
|
|
2398
|
-
icon:
|
|
2399
|
-
size:
|
|
2520
|
+
icon: Jr,
|
|
2521
|
+
size: Q ? 16 : 20
|
|
2400
2522
|
}
|
|
2401
2523
|
)
|
|
2402
2524
|
)
|
|
2403
2525
|
), /* @__PURE__ */ r.createElement(
|
|
2404
2526
|
"input",
|
|
2405
2527
|
{
|
|
2406
|
-
ref:
|
|
2528
|
+
ref: j,
|
|
2407
2529
|
type: "file",
|
|
2408
2530
|
multiple: !0,
|
|
2409
2531
|
style: { display: "none" },
|
|
2410
|
-
onChange:
|
|
2532
|
+
onChange: ae
|
|
2411
2533
|
}
|
|
2412
2534
|
))),
|
|
2413
|
-
/* @__PURE__ */ r.createElement("div", { className:
|
|
2414
|
-
|
|
2535
|
+
/* @__PURE__ */ r.createElement("div", { className: xe.fileExplorerTree }, /* @__PURE__ */ r.createElement(
|
|
2536
|
+
$r,
|
|
2415
2537
|
{
|
|
2416
|
-
ref:
|
|
2417
|
-
readOnly:
|
|
2418
|
-
filesystem:
|
|
2419
|
-
root:
|
|
2420
|
-
initialSelectedPath:
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2538
|
+
ref: N,
|
|
2539
|
+
readOnly: b,
|
|
2540
|
+
filesystem: l,
|
|
2541
|
+
root: R,
|
|
2542
|
+
initialSelectedPath: L,
|
|
2543
|
+
pathBadges: v,
|
|
2544
|
+
onMountFromGit: Z,
|
|
2545
|
+
onPathRenamed: T,
|
|
2546
|
+
onSelect: async (d) => {
|
|
2547
|
+
if (!d) {
|
|
2548
|
+
w(R), await x();
|
|
2424
2549
|
return;
|
|
2425
2550
|
}
|
|
2426
2551
|
try {
|
|
2427
|
-
if (await
|
|
2428
|
-
|
|
2552
|
+
if (await l.isDir(d)) {
|
|
2553
|
+
w(d);
|
|
2429
2554
|
return;
|
|
2430
2555
|
}
|
|
2431
2556
|
} catch {
|
|
2432
2557
|
}
|
|
2433
|
-
|
|
2558
|
+
w(Ne(d)), await ne(d, !1);
|
|
2434
2559
|
},
|
|
2435
|
-
onDoubleClickFile: async (
|
|
2436
|
-
await
|
|
2560
|
+
onDoubleClickFile: async (d) => {
|
|
2561
|
+
await ne(d, !0);
|
|
2437
2562
|
}
|
|
2438
2563
|
}
|
|
2439
2564
|
))
|
|
2440
2565
|
);
|
|
2441
|
-
}
|
|
2442
|
-
function
|
|
2443
|
-
label:
|
|
2444
|
-
useWordPressTooltip:
|
|
2566
|
+
});
|
|
2567
|
+
function Mt({
|
|
2568
|
+
label: i,
|
|
2569
|
+
useWordPressTooltip: l,
|
|
2445
2570
|
children: f
|
|
2446
2571
|
}) {
|
|
2447
|
-
return
|
|
2572
|
+
return l ? /* @__PURE__ */ r.createElement(Gt, { text: i, delay: 0, placement: "top" }, f) : f;
|
|
2448
2573
|
}
|
|
2449
|
-
const
|
|
2574
|
+
const Kn = () => /* @__PURE__ */ r.createElement("svg", { viewBox: "0 0 32 32", width: "24", height: "24", "aria-hidden": "true" }, /* @__PURE__ */ r.createElement(
|
|
2450
2575
|
"path",
|
|
2451
2576
|
{
|
|
2452
2577
|
d: "M11 6h7l5 5v12a2 2 0 0 1-2 2H11a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",
|
|
@@ -2473,7 +2598,7 @@ const Hn = () => /* @__PURE__ */ r.createElement("svg", { viewBox: "0 0 32 32",
|
|
|
2473
2598
|
strokeWidth: "2",
|
|
2474
2599
|
strokeLinecap: "round"
|
|
2475
2600
|
}
|
|
2476
|
-
))),
|
|
2601
|
+
))), qn = () => /* @__PURE__ */ r.createElement("svg", { viewBox: "0 0 32 32", width: "24", height: "24", "aria-hidden": "true" }, /* @__PURE__ */ r.createElement(
|
|
2477
2602
|
"path",
|
|
2478
2603
|
{
|
|
2479
2604
|
d: "M6 9h7l3 3h10v11a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V9z",
|
|
@@ -2500,391 +2625,527 @@ const Hn = () => /* @__PURE__ */ r.createElement("svg", { viewBox: "0 0 32 32",
|
|
|
2500
2625
|
strokeWidth: "2",
|
|
2501
2626
|
strokeLinecap: "round"
|
|
2502
2627
|
}
|
|
2503
|
-
))),
|
|
2504
|
-
container:
|
|
2505
|
-
content:
|
|
2506
|
-
sidebarWrapper:
|
|
2507
|
-
editorWrapper:
|
|
2508
|
-
editorHeader:
|
|
2509
|
-
editorPath:
|
|
2510
|
-
editorPathDirectory:
|
|
2511
|
-
editorPathFilename:
|
|
2512
|
-
editorPathPlaceholder:
|
|
2513
|
-
editorPathPortaled:
|
|
2514
|
-
editorHeaderActions:
|
|
2515
|
-
saveStatus:
|
|
2516
|
-
saveStatusSaving:
|
|
2517
|
-
saveStatusPending:
|
|
2518
|
-
saveStatusError:
|
|
2519
|
-
editor:
|
|
2520
|
-
placeholder:
|
|
2521
|
-
messageArea:
|
|
2522
|
-
mobileToggle:
|
|
2523
|
-
mobileOverlay:
|
|
2524
|
-
dockPresentation:
|
|
2525
|
-
dockDirtyIndicator:
|
|
2526
|
-
dockSaveButton:
|
|
2527
|
-
sidebarOpen:
|
|
2528
|
-
editorHeaderPathPortaled:
|
|
2529
|
-
},
|
|
2628
|
+
))), Jn = "_container_a36e6_1", Xn = "_content_a36e6_9", Qn = "_sidebarWrapper_a36e6_17", ea = "_editorWrapper_a36e6_28", ta = "_editorHeader_a36e6_37", ra = "_editorPath_a36e6_49", na = "_editorPathDirectory_a36e6_61", aa = "_editorPathFilename_a36e6_68", oa = "_editorPathPlaceholder_a36e6_73", ia = "_editorPathPortaled_a36e6_77", la = "_editorHeaderActions_a36e6_83", sa = "_saveStatus_a36e6_90", ca = "_saveStatusSaving_a36e6_97", ua = "_saveStatusPending_a36e6_98", fa = "_saveStatusError_a36e6_102", da = "_editor_a36e6_28", ma = "_placeholder_a36e6_124", pa = "_messageArea_a36e6_135", ha = "_mobileToggle_a36e6_171", wa = "_mobileOverlay_a36e6_175", va = "_dockPresentation_a36e6_181", ga = "_dockDirtyIndicator_a36e6_205", Ea = "_dockSaveButton_a36e6_214", _a = "_sidebarOpen_a36e6_269", ya = "_editorHeaderPathPortaled_a36e6_367", q = {
|
|
2629
|
+
container: Jn,
|
|
2630
|
+
content: Xn,
|
|
2631
|
+
sidebarWrapper: Qn,
|
|
2632
|
+
editorWrapper: ea,
|
|
2633
|
+
editorHeader: ta,
|
|
2634
|
+
editorPath: ra,
|
|
2635
|
+
editorPathDirectory: na,
|
|
2636
|
+
editorPathFilename: aa,
|
|
2637
|
+
editorPathPlaceholder: oa,
|
|
2638
|
+
editorPathPortaled: ia,
|
|
2639
|
+
editorHeaderActions: la,
|
|
2640
|
+
saveStatus: sa,
|
|
2641
|
+
saveStatusSaving: ca,
|
|
2642
|
+
saveStatusPending: ua,
|
|
2643
|
+
saveStatusError: fa,
|
|
2644
|
+
editor: da,
|
|
2645
|
+
placeholder: ma,
|
|
2646
|
+
messageArea: pa,
|
|
2647
|
+
mobileToggle: ha,
|
|
2648
|
+
mobileOverlay: wa,
|
|
2649
|
+
dockPresentation: va,
|
|
2650
|
+
dockDirtyIndicator: ga,
|
|
2651
|
+
dockSaveButton: Ea,
|
|
2652
|
+
sidebarOpen: _a,
|
|
2653
|
+
editorHeaderPathPortaled: ya
|
|
2654
|
+
}, ba = 1500, xa = 700, Ca = 1e3, B = {
|
|
2530
2655
|
IDLE: "idle",
|
|
2531
2656
|
PENDING: "pending",
|
|
2532
2657
|
SAVING: "saving",
|
|
2533
2658
|
SAVED: "saved",
|
|
2534
2659
|
ERROR: "error"
|
|
2535
|
-
}
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2660
|
+
}, ao = bt(function({
|
|
2661
|
+
filesystem: l,
|
|
2662
|
+
isVisible: f = !0,
|
|
2663
|
+
documentRoot: u,
|
|
2664
|
+
initialPath: w = null,
|
|
2665
|
+
placeholderText: h = "Select a file to view or edit its contents.",
|
|
2666
|
+
dockPresentation: x = !1,
|
|
2667
|
+
mobileHeaderTarget: E = null,
|
|
2668
|
+
pathBadges: R,
|
|
2669
|
+
onMountFromGit: b,
|
|
2670
|
+
onPathRenamed: D
|
|
2671
|
+
}, k) {
|
|
2672
|
+
const F = O(null);
|
|
2673
|
+
xt(
|
|
2674
|
+
k,
|
|
2675
|
+
() => ({
|
|
2676
|
+
refreshPath: async (C) => {
|
|
2677
|
+
var y;
|
|
2678
|
+
await ((y = F.current) == null ? void 0 : y.refreshPath(C));
|
|
2679
|
+
},
|
|
2680
|
+
revealPath: async (C) => {
|
|
2681
|
+
var y;
|
|
2682
|
+
await ((y = F.current) == null ? void 0 : y.revealPath(C));
|
|
2683
|
+
}
|
|
2684
|
+
}),
|
|
2685
|
+
[]
|
|
2686
|
+
);
|
|
2687
|
+
const [Q, J] = K(
|
|
2688
|
+
u
|
|
2689
|
+
), [v, Z] = K(null), [T, m] = K(""), [N, j] = K(!0), [L, U] = K(B.IDLE), [re, ne] = K(null), [X, ae] = K("idle"), [_, d] = K(!1), [P, V] = K(null), z = O(null), $ = O(null), G = O(!1), ce = O(v), me = O(
|
|
2690
|
+
l
|
|
2691
|
+
), Y = O(null), ee = O(null), ue = O(
|
|
2550
2692
|
/* @__PURE__ */ new WeakMap()
|
|
2551
|
-
),
|
|
2552
|
-
|
|
2553
|
-
|
|
2693
|
+
), Pe = O(!0), oe = O(/* @__PURE__ */ new Map()), Te = O(!1);
|
|
2694
|
+
me.current = l, W(() => {
|
|
2695
|
+
ce.current = v;
|
|
2554
2696
|
}, [v]);
|
|
2555
|
-
const
|
|
2556
|
-
const { filesystem:
|
|
2557
|
-
}).then(() =>
|
|
2558
|
-
|
|
2559
|
-
let
|
|
2697
|
+
const ve = ze(async (C) => {
|
|
2698
|
+
const { filesystem: y, path: pe, content: de } = C, le = ee.current === C, ke = ue.current, Ie = (ke.get(y) ?? Promise.resolve()).catch(() => {
|
|
2699
|
+
}).then(() => y.writeFile(pe, de));
|
|
2700
|
+
ke.set(y, Ie);
|
|
2701
|
+
let De = !1;
|
|
2560
2702
|
try {
|
|
2561
|
-
await
|
|
2562
|
-
} catch (
|
|
2563
|
-
|
|
2564
|
-
}
|
|
2565
|
-
const
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
),
|
|
2569
|
-
}, []),
|
|
2570
|
-
const
|
|
2571
|
-
|
|
2572
|
-
}, [
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
}), []),
|
|
2576
|
-
var
|
|
2577
|
-
((
|
|
2578
|
-
}, [
|
|
2579
|
-
|
|
2580
|
-
}, [
|
|
2581
|
-
if (!
|
|
2703
|
+
await Ie;
|
|
2704
|
+
} catch (at) {
|
|
2705
|
+
De = !0, Ye.error("Failed to save file", at);
|
|
2706
|
+
}
|
|
2707
|
+
const Ze = Pe.current && ke.get(y) === Ie && me.current === y && ce.current === pe && Y.current === null;
|
|
2708
|
+
ke.get(y) === Ie && ke.delete(y), ee.current === C && (ee.current = null), Ze && (U(De ? B.ERROR : B.SAVED), ne(
|
|
2709
|
+
De ? "Could not save changes. Try again." : null
|
|
2710
|
+
), le && ae(De ? "idle" : "saved"));
|
|
2711
|
+
}, []), Ce = ze(() => {
|
|
2712
|
+
const C = Y.current;
|
|
2713
|
+
C && ($.current !== null && (window.clearTimeout($.current), $.current = null), Y.current = null, ve(C));
|
|
2714
|
+
}, [ve]);
|
|
2715
|
+
W(() => (Pe.current = !0, () => {
|
|
2716
|
+
Pe.current = !1;
|
|
2717
|
+
}), []), W(() => () => {
|
|
2718
|
+
var C;
|
|
2719
|
+
((C = Y.current) == null ? void 0 : C.filesystem) === l && Ce();
|
|
2720
|
+
}, [u, l, Ce]), W(() => {
|
|
2721
|
+
G.current = !0, J(u), m(""), Z(null), j(!0), U(B.IDLE), ne(null), d(!1), V(null), oe.current.clear(), Te.current = !1;
|
|
2722
|
+
}, [u, l]), W(() => {
|
|
2723
|
+
if (!l || !w || Te.current)
|
|
2582
2724
|
return;
|
|
2583
|
-
let
|
|
2725
|
+
let C = !1;
|
|
2584
2726
|
return (async () => {
|
|
2585
2727
|
try {
|
|
2586
|
-
if (await
|
|
2587
|
-
const
|
|
2588
|
-
if (
|
|
2728
|
+
if (await l.fileExists(w) && !C) {
|
|
2729
|
+
const de = await l.readFileAsText(w);
|
|
2730
|
+
if (C)
|
|
2589
2731
|
return;
|
|
2590
|
-
|
|
2591
|
-
var
|
|
2592
|
-
(
|
|
2732
|
+
G.current = !0, Z(w), m(de), j(!1), U(B.IDLE), ne(null), setTimeout(() => {
|
|
2733
|
+
var le;
|
|
2734
|
+
(le = z.current) == null || le.focus();
|
|
2593
2735
|
}, 100);
|
|
2594
2736
|
}
|
|
2595
|
-
} catch (
|
|
2596
|
-
|
|
2737
|
+
} catch (pe) {
|
|
2738
|
+
Ye.debug("Could not auto-open initial path:", pe);
|
|
2597
2739
|
} finally {
|
|
2598
|
-
|
|
2740
|
+
C || (Te.current = !0);
|
|
2599
2741
|
}
|
|
2600
2742
|
})(), () => {
|
|
2601
|
-
|
|
2743
|
+
C = !0;
|
|
2602
2744
|
};
|
|
2603
|
-
}, [
|
|
2604
|
-
if (!
|
|
2605
|
-
|
|
2745
|
+
}, [l, w]), W(() => {
|
|
2746
|
+
if (!l || !v) {
|
|
2747
|
+
$.current !== null && (window.clearTimeout($.current), $.current = null), Y.current = null, v || U(B.IDLE);
|
|
2606
2748
|
return;
|
|
2607
2749
|
}
|
|
2608
|
-
if (
|
|
2609
|
-
|
|
2750
|
+
if (G.current) {
|
|
2751
|
+
G.current = !1, Y.current = null;
|
|
2610
2752
|
return;
|
|
2611
2753
|
}
|
|
2612
|
-
|
|
2613
|
-
const
|
|
2614
|
-
filesystem:
|
|
2754
|
+
$.current !== null && (window.clearTimeout($.current), $.current = null), U(B.PENDING);
|
|
2755
|
+
const C = {
|
|
2756
|
+
filesystem: l,
|
|
2615
2757
|
path: v,
|
|
2616
|
-
content:
|
|
2758
|
+
content: T
|
|
2617
2759
|
};
|
|
2618
|
-
|
|
2619
|
-
const
|
|
2620
|
-
|
|
2621
|
-
},
|
|
2622
|
-
return
|
|
2623
|
-
|
|
2760
|
+
Y.current = C;
|
|
2761
|
+
const y = window.setTimeout(() => {
|
|
2762
|
+
Y.current === C && ($.current = null, Y.current = null, U(B.SAVING), ve(C));
|
|
2763
|
+
}, ba);
|
|
2764
|
+
return $.current = y, () => {
|
|
2765
|
+
$.current === y && (window.clearTimeout(y), $.current = null);
|
|
2624
2766
|
};
|
|
2625
|
-
}, [
|
|
2626
|
-
if (
|
|
2767
|
+
}, [T, v, l, ve]), W(() => {
|
|
2768
|
+
if (L !== B.SAVED)
|
|
2627
2769
|
return;
|
|
2628
|
-
const
|
|
2629
|
-
|
|
2630
|
-
(
|
|
2770
|
+
const C = window.setTimeout(() => {
|
|
2771
|
+
U(
|
|
2772
|
+
(y) => y === B.SAVED ? B.IDLE : y
|
|
2631
2773
|
);
|
|
2632
2774
|
}, 2e3);
|
|
2633
|
-
return () => window.clearTimeout(
|
|
2634
|
-
}, [
|
|
2635
|
-
|
|
2636
|
-
}, [
|
|
2637
|
-
if (
|
|
2775
|
+
return () => window.clearTimeout(C);
|
|
2776
|
+
}, [L]), W(() => {
|
|
2777
|
+
X === "idle" || L === B.SAVING || L === B.SAVED || ae("idle");
|
|
2778
|
+
}, [X, L]), W(() => {
|
|
2779
|
+
if (X !== "saved")
|
|
2638
2780
|
return;
|
|
2639
|
-
const
|
|
2640
|
-
() =>
|
|
2641
|
-
|
|
2781
|
+
const C = window.setTimeout(
|
|
2782
|
+
() => ae("idle"),
|
|
2783
|
+
Ca
|
|
2642
2784
|
);
|
|
2643
|
-
return () => window.clearTimeout(
|
|
2644
|
-
}, [
|
|
2645
|
-
if (
|
|
2785
|
+
return () => window.clearTimeout(C);
|
|
2786
|
+
}, [X]), W(() => {
|
|
2787
|
+
if (X !== "waiting")
|
|
2646
2788
|
return;
|
|
2647
|
-
const
|
|
2648
|
-
() =>
|
|
2649
|
-
(
|
|
2789
|
+
const C = window.setTimeout(
|
|
2790
|
+
() => ae(
|
|
2791
|
+
(y) => y === "waiting" ? "saving" : y
|
|
2650
2792
|
),
|
|
2651
|
-
|
|
2793
|
+
xa
|
|
2652
2794
|
);
|
|
2653
|
-
return () => window.clearTimeout(
|
|
2654
|
-
}, [
|
|
2655
|
-
const
|
|
2656
|
-
async (
|
|
2657
|
-
var
|
|
2658
|
-
const
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
),
|
|
2663
|
-
var
|
|
2664
|
-
const
|
|
2665
|
-
|
|
2795
|
+
return () => window.clearTimeout(C);
|
|
2796
|
+
}, [X]);
|
|
2797
|
+
const ie = ze(
|
|
2798
|
+
async (C, y, pe = !0) => {
|
|
2799
|
+
var le;
|
|
2800
|
+
const de = (le = z.current) == null ? void 0 : le.getCursorPosition();
|
|
2801
|
+
de != null && ce.current && oe.current.set(
|
|
2802
|
+
ce.current,
|
|
2803
|
+
de
|
|
2804
|
+
), G.current = !0, Z(C), m(y), V(null), j(!1), U(B.IDLE), ne(null), d(!1), setTimeout(() => {
|
|
2805
|
+
var Oe, Ie, De;
|
|
2806
|
+
const ke = oe.current.get(C);
|
|
2807
|
+
ke !== void 0 && ((Oe = z.current) == null || Oe.setCursorPosition(ke)), pe ? (Ie = z.current) == null || Ie.focus() : (De = z.current) == null || De.blur();
|
|
2666
2808
|
}, 50);
|
|
2667
2809
|
},
|
|
2668
2810
|
[]
|
|
2669
2811
|
);
|
|
2670
|
-
|
|
2671
|
-
var
|
|
2812
|
+
W(() => {
|
|
2813
|
+
var pe;
|
|
2672
2814
|
if (!v)
|
|
2673
2815
|
return;
|
|
2674
|
-
const
|
|
2675
|
-
var
|
|
2676
|
-
const
|
|
2677
|
-
|
|
2678
|
-
}, 1e3),
|
|
2679
|
-
return
|
|
2680
|
-
var
|
|
2681
|
-
clearInterval(
|
|
2682
|
-
const
|
|
2683
|
-
|
|
2816
|
+
const C = setInterval(() => {
|
|
2817
|
+
var le;
|
|
2818
|
+
const de = (le = z.current) == null ? void 0 : le.getCursorPosition();
|
|
2819
|
+
de != null && oe.current.set(v, de);
|
|
2820
|
+
}, 1e3), y = (pe = z.current) == null ? void 0 : pe.getCursorPosition();
|
|
2821
|
+
return y != null && oe.current.set(v, y), () => {
|
|
2822
|
+
var le;
|
|
2823
|
+
clearInterval(C);
|
|
2824
|
+
const de = (le = z.current) == null ? void 0 : le.getCursorPosition();
|
|
2825
|
+
de != null && oe.current.set(v, de);
|
|
2684
2826
|
};
|
|
2685
|
-
}, [v]),
|
|
2686
|
-
if (!
|
|
2827
|
+
}, [v]), W(() => {
|
|
2828
|
+
if (!f || !v)
|
|
2687
2829
|
return;
|
|
2688
|
-
const
|
|
2689
|
-
var
|
|
2690
|
-
const
|
|
2691
|
-
|
|
2830
|
+
const C = setTimeout(() => {
|
|
2831
|
+
var pe;
|
|
2832
|
+
const y = oe.current.get(v);
|
|
2833
|
+
y !== void 0 && ((pe = z.current) == null || pe.setCursorPosition(y));
|
|
2692
2834
|
}, 100);
|
|
2693
|
-
return () => clearTimeout(
|
|
2694
|
-
}, [
|
|
2695
|
-
const
|
|
2696
|
-
var
|
|
2697
|
-
const
|
|
2698
|
-
|
|
2699
|
-
}, []),
|
|
2700
|
-
async (
|
|
2701
|
-
|
|
2835
|
+
return () => clearTimeout(C);
|
|
2836
|
+
}, [f, v]);
|
|
2837
|
+
const Be = ze(async () => {
|
|
2838
|
+
var y;
|
|
2839
|
+
const C = (y = z.current) == null ? void 0 : y.getCursorPosition();
|
|
2840
|
+
C != null && ce.current && oe.current.set(ce.current, C), G.current = !0, Z(null), m(""), V(null), j(!0), U(B.IDLE), ne(null);
|
|
2841
|
+
}, []), ge = ze(
|
|
2842
|
+
async (C, y) => {
|
|
2843
|
+
G.current = !0, Z(null), typeof y == "string" ? (m(y), V(null)) : (m(""), V(y)), j(!0), U(B.IDLE), ne(null), d(!1);
|
|
2702
2844
|
},
|
|
2703
2845
|
[]
|
|
2704
|
-
),
|
|
2705
|
-
|
|
2706
|
-
}, [
|
|
2707
|
-
!
|
|
2708
|
-
filesystem:
|
|
2846
|
+
), Se = ze(() => {
|
|
2847
|
+
Y.current && (ee.current = Y.current, ae("waiting"), U(B.SAVING), Ce());
|
|
2848
|
+
}, [Ce]), g = ze(() => {
|
|
2849
|
+
!Y.current && L === B.ERROR && l && v && (Y.current = {
|
|
2850
|
+
filesystem: l,
|
|
2709
2851
|
path: v,
|
|
2710
|
-
content:
|
|
2711
|
-
}),
|
|
2712
|
-
}, [
|
|
2713
|
-
let
|
|
2714
|
-
|
|
2715
|
-
const
|
|
2716
|
-
if (!
|
|
2852
|
+
content: T
|
|
2853
|
+
}), Y.current && (ne(null), Se());
|
|
2854
|
+
}, [T, v, l, Se, L]), Ee = Ra(L, re), he = Pa(L, q), H = ka(L);
|
|
2855
|
+
let fe = "Save";
|
|
2856
|
+
L === B.ERROR ? fe = "Retry" : L === B.SAVED && X === "saved" ? fe = "Saved" : L === B.SAVING && X === "saving" && (fe = "Saving…");
|
|
2857
|
+
const We = L === B.PENDING || L === B.SAVING || L === B.ERROR;
|
|
2858
|
+
if (!l)
|
|
2717
2859
|
return /* @__PURE__ */ r.createElement(
|
|
2718
2860
|
"div",
|
|
2719
2861
|
{
|
|
2720
|
-
className:
|
|
2721
|
-
[q.dockPresentation]:
|
|
2862
|
+
className: Fe(q.container, {
|
|
2863
|
+
[q.dockPresentation]: x
|
|
2722
2864
|
})
|
|
2723
2865
|
},
|
|
2724
|
-
/* @__PURE__ */ r.createElement("div", { className: q.placeholder },
|
|
2866
|
+
/* @__PURE__ */ r.createElement("div", { className: q.placeholder }, h)
|
|
2725
2867
|
);
|
|
2726
|
-
const
|
|
2868
|
+
const we = v ? Ne(v) : null, _e = v ? tt(v) : null, Ve = /* @__PURE__ */ r.createElement(
|
|
2727
2869
|
"div",
|
|
2728
2870
|
{
|
|
2729
|
-
className:
|
|
2871
|
+
className: Fe(q.editorPath, {
|
|
2730
2872
|
[q.editorPathPlaceholder]: !(v != null && v.length),
|
|
2731
|
-
[q.editorPathPortaled]:
|
|
2873
|
+
[q.editorPathPortaled]: E
|
|
2732
2874
|
}),
|
|
2733
2875
|
title: v ?? void 0
|
|
2734
2876
|
},
|
|
2735
|
-
|
|
2877
|
+
we && _e ? /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("span", { className: q.editorPathDirectory }, we === "/" ? "" : we), /* @__PURE__ */ r.createElement("span", { className: q.editorPathFilename }, "/", _e)) : `Browse files under ${u}`
|
|
2736
2878
|
);
|
|
2737
2879
|
return /* @__PURE__ */ r.createElement(
|
|
2738
2880
|
"div",
|
|
2739
2881
|
{
|
|
2740
|
-
className:
|
|
2741
|
-
[q.dockPresentation]:
|
|
2882
|
+
className: Fe(q.container, {
|
|
2883
|
+
[q.dockPresentation]: x
|
|
2742
2884
|
})
|
|
2743
2885
|
},
|
|
2744
2886
|
/* @__PURE__ */ r.createElement(
|
|
2745
2887
|
"div",
|
|
2746
2888
|
{
|
|
2747
|
-
className:
|
|
2748
|
-
[q.sidebarOpen]:
|
|
2889
|
+
className: Fe(q.content, {
|
|
2890
|
+
[q.sidebarOpen]: _
|
|
2749
2891
|
})
|
|
2750
2892
|
},
|
|
2751
2893
|
/* @__PURE__ */ r.createElement(
|
|
2752
2894
|
"div",
|
|
2753
2895
|
{
|
|
2754
2896
|
className: q.mobileOverlay,
|
|
2755
|
-
onClick: () =>
|
|
2897
|
+
onClick: () => d(!1)
|
|
2756
2898
|
}
|
|
2757
2899
|
),
|
|
2758
2900
|
/* @__PURE__ */ r.createElement("aside", { className: q.sidebarWrapper }, /* @__PURE__ */ r.createElement(
|
|
2759
|
-
|
|
2901
|
+
Zn,
|
|
2760
2902
|
{
|
|
2761
|
-
|
|
2903
|
+
ref: F,
|
|
2904
|
+
filesystem: l,
|
|
2762
2905
|
currentPath: v,
|
|
2763
|
-
selectedDirPath:
|
|
2764
|
-
setSelectedDirPath:
|
|
2765
|
-
onFileOpened:
|
|
2766
|
-
onSelectionCleared:
|
|
2767
|
-
onShowMessage:
|
|
2768
|
-
documentRoot:
|
|
2769
|
-
dockPresentation:
|
|
2770
|
-
useWordPressTooltips:
|
|
2906
|
+
selectedDirPath: Q,
|
|
2907
|
+
setSelectedDirPath: J,
|
|
2908
|
+
onFileOpened: ie,
|
|
2909
|
+
onSelectionCleared: Be,
|
|
2910
|
+
onShowMessage: ge,
|
|
2911
|
+
documentRoot: u,
|
|
2912
|
+
dockPresentation: x,
|
|
2913
|
+
useWordPressTooltips: x,
|
|
2914
|
+
pathBadges: R,
|
|
2915
|
+
onMountFromGit: b,
|
|
2916
|
+
onPathRenamed: D
|
|
2771
2917
|
}
|
|
2772
2918
|
)),
|
|
2773
2919
|
/* @__PURE__ */ r.createElement("section", { className: q.editorWrapper }, /* @__PURE__ */ r.createElement(
|
|
2774
2920
|
"div",
|
|
2775
2921
|
{
|
|
2776
|
-
className:
|
|
2777
|
-
[q.editorHeaderPathPortaled]:
|
|
2922
|
+
className: Fe(q.editorHeader, {
|
|
2923
|
+
[q.editorHeaderPathPortaled]: E
|
|
2778
2924
|
})
|
|
2779
2925
|
},
|
|
2780
2926
|
/* @__PURE__ */ r.createElement(
|
|
2781
|
-
|
|
2927
|
+
He,
|
|
2782
2928
|
{
|
|
2783
2929
|
className: q.mobileToggle,
|
|
2784
2930
|
variant: "secondary",
|
|
2785
|
-
onClick: () =>
|
|
2931
|
+
onClick: () => d((C) => !C)
|
|
2786
2932
|
},
|
|
2787
|
-
|
|
2933
|
+
_ ? "Hide files" : "Browse files"
|
|
2788
2934
|
),
|
|
2789
|
-
|
|
2790
|
-
|
|
2935
|
+
E ? Yt(Ve, E) : Ve,
|
|
2936
|
+
x && !N && v ? /* @__PURE__ */ r.createElement("div", { className: q.editorHeaderActions }, We ? /* @__PURE__ */ r.createElement(
|
|
2791
2937
|
"span",
|
|
2792
2938
|
{
|
|
2793
2939
|
className: q.dockDirtyIndicator,
|
|
2794
2940
|
"aria-hidden": "true"
|
|
2795
2941
|
}
|
|
2796
|
-
) : null, /* @__PURE__ */ r.createElement(
|
|
2797
|
-
|
|
2942
|
+
) : null, /* @__PURE__ */ r.createElement(Gt, { text: H, placement: "top" }, /* @__PURE__ */ r.createElement(
|
|
2943
|
+
He,
|
|
2798
2944
|
{
|
|
2799
2945
|
variant: "secondary",
|
|
2800
2946
|
className: q.dockSaveButton,
|
|
2801
|
-
isDestructive:
|
|
2802
|
-
onClick:
|
|
2947
|
+
isDestructive: L === B.ERROR,
|
|
2948
|
+
onClick: g
|
|
2803
2949
|
},
|
|
2804
|
-
|
|
2805
|
-
))) :
|
|
2950
|
+
fe
|
|
2951
|
+
))) : x ? null : /* @__PURE__ */ r.createElement(
|
|
2806
2952
|
"div",
|
|
2807
2953
|
{
|
|
2808
|
-
className:
|
|
2954
|
+
className: Fe(
|
|
2809
2955
|
q.saveStatus,
|
|
2810
|
-
|
|
2956
|
+
he
|
|
2811
2957
|
)
|
|
2812
2958
|
},
|
|
2813
|
-
|
|
2959
|
+
Ee
|
|
2814
2960
|
),
|
|
2815
|
-
|
|
2816
|
-
),
|
|
2817
|
-
|
|
2961
|
+
x && !N && v ? /* @__PURE__ */ r.createElement(ur, { role: "status", "aria-live": "polite" }, H) : null
|
|
2962
|
+
), re ? /* @__PURE__ */ r.createElement("div", { style: { padding: "8px 16px" } }, /* @__PURE__ */ r.createElement(fr, { status: "error", isDismissible: !1 }, re)) : null, v || T || P ? P ? /* @__PURE__ */ r.createElement("div", { className: q.messageArea }, P) : /* @__PURE__ */ r.createElement(
|
|
2963
|
+
Jt,
|
|
2818
2964
|
{
|
|
2819
|
-
ref:
|
|
2820
|
-
code:
|
|
2821
|
-
onChange:
|
|
2965
|
+
ref: z,
|
|
2966
|
+
code: T,
|
|
2967
|
+
onChange: m,
|
|
2822
2968
|
currentPath: v,
|
|
2823
2969
|
className: q.editor,
|
|
2824
|
-
onSaveShortcut:
|
|
2825
|
-
readOnly:
|
|
2970
|
+
onSaveShortcut: Se,
|
|
2971
|
+
readOnly: N
|
|
2826
2972
|
}
|
|
2827
|
-
) : /* @__PURE__ */ r.createElement("div", { className: q.placeholder },
|
|
2973
|
+
) : /* @__PURE__ */ r.createElement("div", { className: q.placeholder }, h))
|
|
2828
2974
|
)
|
|
2829
2975
|
);
|
|
2830
|
-
}
|
|
2831
|
-
function
|
|
2832
|
-
switch (
|
|
2833
|
-
case
|
|
2834
|
-
case
|
|
2976
|
+
});
|
|
2977
|
+
function Ra(i, l) {
|
|
2978
|
+
switch (i) {
|
|
2979
|
+
case B.PENDING:
|
|
2980
|
+
case B.SAVING:
|
|
2835
2981
|
return "Saving…";
|
|
2836
|
-
case
|
|
2982
|
+
case B.SAVED:
|
|
2837
2983
|
return "Saved";
|
|
2838
|
-
case
|
|
2839
|
-
return
|
|
2984
|
+
case B.ERROR:
|
|
2985
|
+
return l ?? "Save failed";
|
|
2840
2986
|
default:
|
|
2841
2987
|
return "";
|
|
2842
2988
|
}
|
|
2843
2989
|
}
|
|
2844
|
-
function
|
|
2845
|
-
switch (
|
|
2846
|
-
case
|
|
2847
|
-
return
|
|
2848
|
-
case
|
|
2849
|
-
return
|
|
2850
|
-
case
|
|
2851
|
-
return
|
|
2990
|
+
function Pa(i, l) {
|
|
2991
|
+
switch (i) {
|
|
2992
|
+
case B.PENDING:
|
|
2993
|
+
return l.saveStatusPending;
|
|
2994
|
+
case B.SAVING:
|
|
2995
|
+
return l.saveStatusSaving;
|
|
2996
|
+
case B.ERROR:
|
|
2997
|
+
return l.saveStatusError;
|
|
2852
2998
|
default:
|
|
2853
2999
|
return;
|
|
2854
3000
|
}
|
|
2855
3001
|
}
|
|
2856
|
-
function
|
|
2857
|
-
switch (
|
|
2858
|
-
case
|
|
3002
|
+
function ka(i) {
|
|
3003
|
+
switch (i) {
|
|
3004
|
+
case B.PENDING:
|
|
2859
3005
|
return "Unsaved changes. Click to save now.";
|
|
2860
|
-
case
|
|
3006
|
+
case B.SAVING:
|
|
2861
3007
|
return "Saving changes…";
|
|
2862
|
-
case
|
|
3008
|
+
case B.ERROR:
|
|
2863
3009
|
return "Saving failed. Click to retry.";
|
|
2864
3010
|
default:
|
|
2865
3011
|
return "All changes saved.";
|
|
2866
3012
|
}
|
|
2867
3013
|
}
|
|
3014
|
+
const Ta = "_modal_1i30f_1", Sa = "_actions_1i30f_5", Ut = {
|
|
3015
|
+
modal: Ta,
|
|
3016
|
+
actions: Sa
|
|
3017
|
+
};
|
|
3018
|
+
function oo({
|
|
3019
|
+
kind: i,
|
|
3020
|
+
isBusy: l,
|
|
3021
|
+
error: f,
|
|
3022
|
+
onSubmit: u,
|
|
3023
|
+
onCancel: w
|
|
3024
|
+
}) {
|
|
3025
|
+
const [h, x] = K(""), [E, R] = K(""), [b, D] = K(""), k = h.trim(), F = (v) => {
|
|
3026
|
+
const Z = Da(v);
|
|
3027
|
+
if (Z) {
|
|
3028
|
+
x(Z.url), R(Z.ref);
|
|
3029
|
+
return;
|
|
3030
|
+
}
|
|
3031
|
+
x(v);
|
|
3032
|
+
}, Q = () => {
|
|
3033
|
+
!k || l || u({
|
|
3034
|
+
url: k,
|
|
3035
|
+
ref: E.trim() || "HEAD",
|
|
3036
|
+
path: b.trim() || void 0
|
|
3037
|
+
});
|
|
3038
|
+
}, J = () => {
|
|
3039
|
+
l || w();
|
|
3040
|
+
};
|
|
3041
|
+
return /* @__PURE__ */ r.createElement(
|
|
3042
|
+
zt,
|
|
3043
|
+
{
|
|
3044
|
+
title: `Mount ${i} via git`,
|
|
3045
|
+
onRequestClose: J,
|
|
3046
|
+
isDismissible: !l,
|
|
3047
|
+
className: Ut.modal
|
|
3048
|
+
},
|
|
3049
|
+
/* @__PURE__ */ r.createElement(
|
|
3050
|
+
"form",
|
|
3051
|
+
{
|
|
3052
|
+
onSubmit: (v) => {
|
|
3053
|
+
v.preventDefault(), Q();
|
|
3054
|
+
},
|
|
3055
|
+
style: { display: "flex", flexDirection: "column", gap: 12 }
|
|
3056
|
+
},
|
|
3057
|
+
/* @__PURE__ */ r.createElement(
|
|
3058
|
+
Nt,
|
|
3059
|
+
{
|
|
3060
|
+
__nextHasNoMarginBottom: !0,
|
|
3061
|
+
label: "Repository URL",
|
|
3062
|
+
value: h,
|
|
3063
|
+
onChange: F,
|
|
3064
|
+
placeholder: "github.com/owner/repo",
|
|
3065
|
+
autoFocus: !0,
|
|
3066
|
+
disabled: l
|
|
3067
|
+
}
|
|
3068
|
+
),
|
|
3069
|
+
/* @__PURE__ */ r.createElement(
|
|
3070
|
+
Nt,
|
|
3071
|
+
{
|
|
3072
|
+
__nextHasNoMarginBottom: !0,
|
|
3073
|
+
label: "Branch, tag, or commit",
|
|
3074
|
+
value: E,
|
|
3075
|
+
onChange: (v) => R(v),
|
|
3076
|
+
placeholder: "HEAD",
|
|
3077
|
+
disabled: l
|
|
3078
|
+
}
|
|
3079
|
+
),
|
|
3080
|
+
/* @__PURE__ */ r.createElement(
|
|
3081
|
+
Nt,
|
|
3082
|
+
{
|
|
3083
|
+
__nextHasNoMarginBottom: !0,
|
|
3084
|
+
label: "Path within the repository (optional)",
|
|
3085
|
+
value: b,
|
|
3086
|
+
onChange: (v) => D(v),
|
|
3087
|
+
placeholder: "Leave empty to use the repository root",
|
|
3088
|
+
disabled: l
|
|
3089
|
+
}
|
|
3090
|
+
),
|
|
3091
|
+
f ? /* @__PURE__ */ r.createElement("p", { role: "alert" }, f) : null,
|
|
3092
|
+
/* @__PURE__ */ r.createElement(dr, { justify: "end", className: Ut.actions }, /* @__PURE__ */ r.createElement(
|
|
3093
|
+
He,
|
|
3094
|
+
{
|
|
3095
|
+
type: "button",
|
|
3096
|
+
variant: "link",
|
|
3097
|
+
disabled: l,
|
|
3098
|
+
onClick: w
|
|
3099
|
+
},
|
|
3100
|
+
"Cancel"
|
|
3101
|
+
), /* @__PURE__ */ r.createElement(
|
|
3102
|
+
He,
|
|
3103
|
+
{
|
|
3104
|
+
type: "submit",
|
|
3105
|
+
variant: "primary",
|
|
3106
|
+
isBusy: l,
|
|
3107
|
+
disabled: !k || l
|
|
3108
|
+
},
|
|
3109
|
+
"Mount ",
|
|
3110
|
+
i
|
|
3111
|
+
))
|
|
3112
|
+
)
|
|
3113
|
+
);
|
|
3114
|
+
}
|
|
3115
|
+
function Da(i) {
|
|
3116
|
+
const l = i.trim().match(
|
|
3117
|
+
/^(?:https?:\/\/)?(?:www\.)?github\.com\/([^/]+)\/([^/]+)\/tree\/(.+)$/i
|
|
3118
|
+
);
|
|
3119
|
+
if (!l)
|
|
3120
|
+
return null;
|
|
3121
|
+
const [, f, u, w] = l;
|
|
3122
|
+
return {
|
|
3123
|
+
url: `https://github.com/${f}/${u.replace(/\.git$/i, "")}`,
|
|
3124
|
+
ref: w
|
|
3125
|
+
};
|
|
3126
|
+
}
|
|
2868
3127
|
export {
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
3128
|
+
no as BinaryFilePreview,
|
|
3129
|
+
Ja as ClockIcon,
|
|
3130
|
+
Jt as CodeEditor,
|
|
3131
|
+
Zn as FileExplorerSidebar,
|
|
3132
|
+
ro as FilePickerControl,
|
|
3133
|
+
un as FilePickerTree,
|
|
3134
|
+
Xt as MAX_INLINE_FILE_BYTES,
|
|
3135
|
+
oo as MountGitDirectoryModal,
|
|
3136
|
+
ao as PlaygroundFileEditor,
|
|
3137
|
+
eo as SiteManagerIcon,
|
|
3138
|
+
qa as WordPressIcon,
|
|
3139
|
+
Wt as createDownloadUrl,
|
|
3140
|
+
Ur as file,
|
|
3141
|
+
Wr as folder,
|
|
3142
|
+
Qa as getLogoDataURL,
|
|
3143
|
+
Gn as getMimeType,
|
|
3144
|
+
to as isMessageFromIframeTree,
|
|
3145
|
+
Yn as isPreviewableBinary,
|
|
3146
|
+
Xa as layout,
|
|
3147
|
+
Za as playgroundLogo,
|
|
3148
|
+
Hn as seemsLikeBinary,
|
|
3149
|
+
Ka as temporaryStorage
|
|
2889
3150
|
};
|
|
2890
3151
|
//# sourceMappingURL=index.js.map
|