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