@wp-playground/components 3.0.5 → 3.0.8

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/index.js CHANGED
@@ -1,5 +1,10 @@
1
- import e from "react";
2
- const l = (t) => /* @__PURE__ */ e.createElement(
1
+ import d, { forwardRef as St, useMemo as wt, useState as Q, useRef as re, useEffect as le, useImperativeHandle as Ot } from "react";
2
+ import { __experimentalTreeGrid as Dt, Popover as Ft, NavigableMenu as jt, MenuItem as rt, __experimentalTreeGridRow as At, __experimentalTreeGridCell as Vt, Button as mt, Modal as Nt } from "@wordpress/components";
3
+ import gt from "classnames";
4
+ import { dirname as ke, joinPaths as Ae, basename as Mt } from "@php-wasm/util";
5
+ import { forwardRef as bt, cloneElement as $t, createElement as Ht } from "@wordpress/element";
6
+ import It from "clsx";
7
+ const wr = (l) => /* @__PURE__ */ d.createElement(
3
8
  "svg",
4
9
  {
5
10
  width: "32",
@@ -7,9 +12,9 @@ const l = (t) => /* @__PURE__ */ e.createElement(
7
12
  viewBox: "0 0 32 32",
8
13
  fill: "none",
9
14
  xmlns: "http://www.w3.org/2000/svg",
10
- ...t
15
+ ...l
11
16
  },
12
- /* @__PURE__ */ e.createElement(
17
+ /* @__PURE__ */ d.createElement(
13
18
  "rect",
14
19
  {
15
20
  width: "10.4176",
@@ -20,7 +25,7 @@ const l = (t) => /* @__PURE__ */ e.createElement(
20
25
  strokeWidth: "0.965644"
21
26
  }
22
27
  ),
23
- /* @__PURE__ */ e.createElement(
28
+ /* @__PURE__ */ d.createElement(
24
29
  "rect",
25
30
  {
26
31
  width: "13.2346",
@@ -31,7 +36,7 @@ const l = (t) => /* @__PURE__ */ e.createElement(
31
36
  strokeWidth: "1.44847"
32
37
  }
33
38
  ),
34
- /* @__PURE__ */ e.createElement(
39
+ /* @__PURE__ */ d.createElement(
35
40
  "rect",
36
41
  {
37
42
  width: "17.451",
@@ -42,7 +47,7 @@ const l = (t) => /* @__PURE__ */ e.createElement(
42
47
  strokeWidth: "1.93129"
43
48
  }
44
49
  )
45
- ), n = (t) => /* @__PURE__ */ e.createElement(
50
+ ), gr = (l) => /* @__PURE__ */ d.createElement(
46
51
  "svg",
47
52
  {
48
53
  width: "16",
@@ -50,9 +55,9 @@ const l = (t) => /* @__PURE__ */ e.createElement(
50
55
  viewBox: "0 0 16 17",
51
56
  fill: "none",
52
57
  xmlns: "http://www.w3.org/2000/svg",
53
- ...t
58
+ ...l
54
59
  },
55
- /* @__PURE__ */ e.createElement(
60
+ /* @__PURE__ */ d.createElement(
56
61
  "path",
57
62
  {
58
63
  fillRule: "evenodd",
@@ -61,7 +66,7 @@ const l = (t) => /* @__PURE__ */ e.createElement(
61
66
  fill: "#949494"
62
67
  }
63
68
  )
64
- ), r = (t) => /* @__PURE__ */ e.createElement(
69
+ ), vr = (l) => /* @__PURE__ */ d.createElement(
65
70
  "svg",
66
71
  {
67
72
  width: "20",
@@ -69,16 +74,16 @@ const l = (t) => /* @__PURE__ */ e.createElement(
69
74
  viewBox: "0 0 20 21",
70
75
  fill: "none",
71
76
  xmlns: "http://www.w3.org/2000/svg",
72
- ...t
77
+ ...l
73
78
  },
74
- /* @__PURE__ */ e.createElement(
79
+ /* @__PURE__ */ d.createElement(
75
80
  "path",
76
81
  {
77
82
  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",
78
83
  fill: "#ffffff"
79
84
  }
80
85
  )
81
- ), i = /* @__PURE__ */ e.createElement(
86
+ ), Lt = /* @__PURE__ */ d.createElement(
82
87
  "svg",
83
88
  {
84
89
  xmlns: "http://www.w3.org/2000/svg",
@@ -87,7 +92,7 @@ const l = (t) => /* @__PURE__ */ e.createElement(
87
92
  viewBox: "0 0 15 14",
88
93
  fill: "none"
89
94
  },
90
- /* @__PURE__ */ e.createElement(
95
+ /* @__PURE__ */ d.createElement(
91
96
  "path",
92
97
  {
93
98
  fillRule: "evenodd",
@@ -95,7 +100,7 @@ const l = (t) => /* @__PURE__ */ e.createElement(
95
100
  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"
96
101
  }
97
102
  )
98
- ), o = /* @__PURE__ */ e.createElement(
103
+ ), Bt = /* @__PURE__ */ d.createElement(
99
104
  "svg",
100
105
  {
101
106
  xmlns: "http://www.w3.org/2000/svg",
@@ -105,8 +110,8 @@ const l = (t) => /* @__PURE__ */ e.createElement(
105
110
  className: "bi bi-file-earmark",
106
111
  viewBox: "0 0 16 16"
107
112
  },
108
- /* @__PURE__ */ e.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" })
109
- ), h = (t) => /* @__PURE__ */ e.createElement(
113
+ /* @__PURE__ */ d.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" })
114
+ ), yr = (l) => /* @__PURE__ */ d.createElement(
110
115
  "svg",
111
116
  {
112
117
  xmlns: "http://www.w3.org/2000/svg",
@@ -114,9 +119,9 @@ const l = (t) => /* @__PURE__ */ e.createElement(
114
119
  height: "18",
115
120
  viewBox: "0 0 14 14",
116
121
  fill: "none",
117
- ...t
122
+ ...l
118
123
  },
119
- /* @__PURE__ */ e.createElement(
124
+ /* @__PURE__ */ d.createElement(
120
125
  "path",
121
126
  {
122
127
  fillRule: "evenodd",
@@ -125,7 +130,7 @@ const l = (t) => /* @__PURE__ */ e.createElement(
125
130
  fill: "#949494"
126
131
  }
127
132
  )
128
- ), a = /* @__PURE__ */ e.createElement(
133
+ ), Er = /* @__PURE__ */ d.createElement(
129
134
  "svg",
130
135
  {
131
136
  xmlns: "http://www.w3.org/2000/svg",
@@ -134,7 +139,7 @@ const l = (t) => /* @__PURE__ */ e.createElement(
134
139
  viewBox: "0 0 14 14",
135
140
  fill: "none"
136
141
  },
137
- /* @__PURE__ */ e.createElement(
142
+ /* @__PURE__ */ d.createElement(
138
143
  "path",
139
144
  {
140
145
  fillRule: "evenodd",
@@ -144,11 +149,11 @@ const l = (t) => /* @__PURE__ */ e.createElement(
144
149
  }
145
150
  )
146
151
  );
147
- function w(t) {
148
- return `data:${t.mime};base64,${t.data}`;
152
+ function Cr(l) {
153
+ return `data:${l.mime};base64,${l.data}`;
149
154
  }
150
- function d() {
151
- return /* @__PURE__ */ e.createElement(
155
+ function br() {
156
+ return /* @__PURE__ */ d.createElement(
152
157
  "svg",
153
158
  {
154
159
  width: "14",
@@ -157,7 +162,7 @@ function d() {
157
162
  fill: "none",
158
163
  xmlns: "http://www.w3.org/2000/svg"
159
164
  },
160
- /* @__PURE__ */ e.createElement(
165
+ /* @__PURE__ */ d.createElement(
161
166
  "path",
162
167
  {
163
168
  fillRule: "evenodd",
@@ -168,15 +173,1600 @@ function d() {
168
173
  )
169
174
  );
170
175
  }
176
+ const vt = bt(({
177
+ icon: l,
178
+ size: s = 24,
179
+ ...C
180
+ }, h) => $t(l, {
181
+ width: s,
182
+ height: s,
183
+ ...C,
184
+ ref: h
185
+ }));
186
+ var pt = { exports: {} }, Le = {};
187
+ /**
188
+ * @license React
189
+ * react-jsx-runtime.production.min.js
190
+ *
191
+ * Copyright (c) Facebook, Inc. and its affiliates.
192
+ *
193
+ * This source code is licensed under the MIT license found in the
194
+ * LICENSE file in the root directory of this source tree.
195
+ */
196
+ var yt;
197
+ function Wt() {
198
+ if (yt) return Le;
199
+ yt = 1;
200
+ var l = d, s = Symbol.for("react.element"), C = Symbol.for("react.fragment"), h = Object.prototype.hasOwnProperty, x = l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, P = { key: !0, ref: !0, __self: !0, __source: !0 };
201
+ function T(H, k, O) {
202
+ var y, I = {}, M = null, F = null;
203
+ O !== void 0 && (M = "" + O), k.key !== void 0 && (M = "" + k.key), k.ref !== void 0 && (F = k.ref);
204
+ for (y in k) h.call(k, y) && !P.hasOwnProperty(y) && (I[y] = k[y]);
205
+ if (H && H.defaultProps) for (y in k = H.defaultProps, k) I[y] === void 0 && (I[y] = k[y]);
206
+ return { $$typeof: s, type: H, key: M, ref: F, props: I, _owner: x.current };
207
+ }
208
+ return Le.Fragment = C, Le.jsx = T, Le.jsxs = T, Le;
209
+ }
210
+ var Be = {};
211
+ /**
212
+ * @license React
213
+ * react-jsx-runtime.development.js
214
+ *
215
+ * Copyright (c) Facebook, Inc. and its affiliates.
216
+ *
217
+ * This source code is licensed under the MIT license found in the
218
+ * LICENSE file in the root directory of this source tree.
219
+ */
220
+ var Et;
221
+ function Zt() {
222
+ return Et || (Et = 1, process.env.NODE_ENV !== "production" && function() {
223
+ var l = d, s = Symbol.for("react.element"), C = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), x = Symbol.for("react.strict_mode"), P = Symbol.for("react.profiler"), T = Symbol.for("react.provider"), H = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), I = Symbol.for("react.memo"), M = Symbol.for("react.lazy"), F = Symbol.for("react.offscreen"), ee = Symbol.iterator, q = "@@iterator";
224
+ function he(e) {
225
+ if (e === null || typeof e != "object")
226
+ return null;
227
+ var o = ee && e[ee] || e[q];
228
+ return typeof o == "function" ? o : null;
229
+ }
230
+ var S = l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
231
+ function R(e) {
232
+ {
233
+ for (var o = arguments.length, c = new Array(o > 1 ? o - 1 : 0), p = 1; p < o; p++)
234
+ c[p - 1] = arguments[p];
235
+ se("error", e, c);
236
+ }
237
+ }
238
+ function se(e, o, c) {
239
+ {
240
+ var p = S.ReactDebugCurrentFrame, b = p.getStackAddendum();
241
+ b !== "" && (o += "%s", c = c.concat([b]));
242
+ var _ = c.map(function(E) {
243
+ return String(E);
244
+ });
245
+ _.unshift("Warning: " + o), Function.prototype.apply.call(console[e], console, _);
246
+ }
247
+ }
248
+ var we = !1, K = !1, W = !1, ie = !1, ce = !1, w;
249
+ w = Symbol.for("react.module.reference");
250
+ function G(e) {
251
+ return !!(typeof e == "string" || typeof e == "function" || e === h || e === P || ce || e === x || e === O || e === y || ie || e === F || we || K || W || typeof e == "object" && e !== null && (e.$$typeof === M || e.$$typeof === I || e.$$typeof === T || e.$$typeof === H || e.$$typeof === k || // This needs to include all possible module reference object
252
+ // types supported by any Flight configuration anywhere since
253
+ // we don't know which Flight build this will end up being used
254
+ // with.
255
+ e.$$typeof === w || e.getModuleId !== void 0));
256
+ }
257
+ function ne(e, o, c) {
258
+ var p = e.displayName;
259
+ if (p)
260
+ return p;
261
+ var b = o.displayName || o.name || "";
262
+ return b !== "" ? c + "(" + b + ")" : c;
263
+ }
264
+ function ue(e) {
265
+ return e.displayName || "Context";
266
+ }
267
+ function Z(e) {
268
+ if (e == null)
269
+ return null;
270
+ if (typeof e.tag == "number" && R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
271
+ return e.displayName || e.name || null;
272
+ if (typeof e == "string")
273
+ return e;
274
+ switch (e) {
275
+ case h:
276
+ return "Fragment";
277
+ case C:
278
+ return "Portal";
279
+ case P:
280
+ return "Profiler";
281
+ case x:
282
+ return "StrictMode";
283
+ case O:
284
+ return "Suspense";
285
+ case y:
286
+ return "SuspenseList";
287
+ }
288
+ if (typeof e == "object")
289
+ switch (e.$$typeof) {
290
+ case H:
291
+ var o = e;
292
+ return ue(o) + ".Consumer";
293
+ case T:
294
+ var c = e;
295
+ return ue(c._context) + ".Provider";
296
+ case k:
297
+ return ne(e, e.render, "ForwardRef");
298
+ case I:
299
+ var p = e.displayName || null;
300
+ return p !== null ? p : Z(e.type) || "Memo";
301
+ case M: {
302
+ var b = e, _ = b._payload, E = b._init;
303
+ try {
304
+ return Z(E(_));
305
+ } catch {
306
+ return null;
307
+ }
308
+ }
309
+ }
310
+ return null;
311
+ }
312
+ var j = Object.assign, L = 0, be, _e, ge, oe, ve, A, ye;
313
+ function ae() {
314
+ }
315
+ ae.__reactDisabledLog = !0;
316
+ function fe() {
317
+ {
318
+ if (L === 0) {
319
+ be = console.log, _e = console.info, ge = console.warn, oe = console.error, ve = console.group, A = console.groupCollapsed, ye = console.groupEnd;
320
+ var e = {
321
+ configurable: !0,
322
+ enumerable: !0,
323
+ value: ae,
324
+ writable: !0
325
+ };
326
+ Object.defineProperties(console, {
327
+ info: e,
328
+ log: e,
329
+ warn: e,
330
+ error: e,
331
+ group: e,
332
+ groupCollapsed: e,
333
+ groupEnd: e
334
+ });
335
+ }
336
+ L++;
337
+ }
338
+ }
339
+ function Re() {
340
+ {
341
+ if (L--, L === 0) {
342
+ var e = {
343
+ configurable: !0,
344
+ enumerable: !0,
345
+ writable: !0
346
+ };
347
+ Object.defineProperties(console, {
348
+ log: j({}, e, {
349
+ value: be
350
+ }),
351
+ info: j({}, e, {
352
+ value: _e
353
+ }),
354
+ warn: j({}, e, {
355
+ value: ge
356
+ }),
357
+ error: j({}, e, {
358
+ value: oe
359
+ }),
360
+ group: j({}, e, {
361
+ value: ve
362
+ }),
363
+ groupCollapsed: j({}, e, {
364
+ value: A
365
+ }),
366
+ groupEnd: j({}, e, {
367
+ value: ye
368
+ })
369
+ });
370
+ }
371
+ L < 0 && R("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
372
+ }
373
+ }
374
+ var de = S.ReactCurrentDispatcher, B;
375
+ function u(e, o, c) {
376
+ {
377
+ if (B === void 0)
378
+ try {
379
+ throw Error();
380
+ } catch (b) {
381
+ var p = b.stack.trim().match(/\n( *(at )?)/);
382
+ B = p && p[1] || "";
383
+ }
384
+ return `
385
+ ` + B + e;
386
+ }
387
+ }
388
+ var $ = !1, me;
389
+ {
390
+ var Y = typeof WeakMap == "function" ? WeakMap : Map;
391
+ me = new Y();
392
+ }
393
+ function z(e, o) {
394
+ if (!e || $)
395
+ return "";
396
+ {
397
+ var c = me.get(e);
398
+ if (c !== void 0)
399
+ return c;
400
+ }
401
+ var p;
402
+ $ = !0;
403
+ var b = Error.prepareStackTrace;
404
+ Error.prepareStackTrace = void 0;
405
+ var _;
406
+ _ = de.current, de.current = null, fe();
407
+ try {
408
+ if (o) {
409
+ var E = function() {
410
+ throw Error();
411
+ };
412
+ if (Object.defineProperty(E.prototype, "props", {
413
+ set: function() {
414
+ throw Error();
415
+ }
416
+ }), typeof Reflect == "object" && Reflect.construct) {
417
+ try {
418
+ Reflect.construct(E, []);
419
+ } catch (J) {
420
+ p = J;
421
+ }
422
+ Reflect.construct(e, [], E);
423
+ } else {
424
+ try {
425
+ E.call();
426
+ } catch (J) {
427
+ p = J;
428
+ }
429
+ e.call(E.prototype);
430
+ }
431
+ } else {
432
+ try {
433
+ throw Error();
434
+ } catch (J) {
435
+ p = J;
436
+ }
437
+ e();
438
+ }
439
+ } catch (J) {
440
+ if (J && p && typeof J.stack == "string") {
441
+ for (var v = J.stack.split(`
442
+ `), U = p.stack.split(`
443
+ `), D = v.length - 1, V = U.length - 1; D >= 1 && V >= 0 && v[D] !== U[V]; )
444
+ V--;
445
+ for (; D >= 1 && V >= 0; D--, V--)
446
+ if (v[D] !== U[V]) {
447
+ if (D !== 1 || V !== 1)
448
+ do
449
+ if (D--, V--, V < 0 || v[D] !== U[V]) {
450
+ var te = `
451
+ ` + v[D].replace(" at new ", " at ");
452
+ return e.displayName && te.includes("<anonymous>") && (te = te.replace("<anonymous>", e.displayName)), typeof e == "function" && me.set(e, te), te;
453
+ }
454
+ while (D >= 1 && V >= 0);
455
+ break;
456
+ }
457
+ }
458
+ } finally {
459
+ $ = !1, de.current = _, Re(), Error.prepareStackTrace = b;
460
+ }
461
+ var je = e ? e.displayName || e.name : "", Pe = je ? u(je) : "";
462
+ return typeof e == "function" && me.set(e, Pe), Pe;
463
+ }
464
+ function Se(e, o, c) {
465
+ return z(e, !1);
466
+ }
467
+ function Ze(e) {
468
+ var o = e.prototype;
469
+ return !!(o && o.isReactComponent);
470
+ }
471
+ function pe(e, o, c) {
472
+ if (e == null)
473
+ return "";
474
+ if (typeof e == "function")
475
+ return z(e, Ze(e));
476
+ if (typeof e == "string")
477
+ return u(e);
478
+ switch (e) {
479
+ case O:
480
+ return u("Suspense");
481
+ case y:
482
+ return u("SuspenseList");
483
+ }
484
+ if (typeof e == "object")
485
+ switch (e.$$typeof) {
486
+ case k:
487
+ return Se(e.render);
488
+ case I:
489
+ return pe(e.type, o, c);
490
+ case M: {
491
+ var p = e, b = p._payload, _ = p._init;
492
+ try {
493
+ return pe(_(b), o, c);
494
+ } catch {
495
+ }
496
+ }
497
+ }
498
+ return "";
499
+ }
500
+ var Ee = Object.prototype.hasOwnProperty, Ye = {}, Oe = S.ReactDebugCurrentFrame;
501
+ function De(e) {
502
+ if (e) {
503
+ var o = e._owner, c = pe(e.type, e._source, o ? o.type : null);
504
+ Oe.setExtraStackFrame(c);
505
+ } else
506
+ Oe.setExtraStackFrame(null);
507
+ }
508
+ function Ne(e, o, c, p, b) {
509
+ {
510
+ var _ = Function.call.bind(Ee);
511
+ for (var E in e)
512
+ if (_(e, E)) {
513
+ var v = void 0;
514
+ try {
515
+ if (typeof e[E] != "function") {
516
+ var U = Error((p || "React class") + ": " + c + " type `" + E + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[E] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
517
+ throw U.name = "Invariant Violation", U;
518
+ }
519
+ v = e[E](o, E, p, c, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
520
+ } catch (D) {
521
+ v = D;
522
+ }
523
+ v && !(v instanceof Error) && (De(b), R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", p || "React class", c, E, typeof v), De(null)), v instanceof Error && !(v.message in Ye) && (Ye[v.message] = !0, De(b), R("Failed %s type: %s", c, v.message), De(null));
524
+ }
525
+ }
526
+ }
527
+ var nt = Array.isArray;
528
+ function Me(e) {
529
+ return nt(e);
530
+ }
531
+ function at(e) {
532
+ {
533
+ var o = typeof Symbol == "function" && Symbol.toStringTag, c = o && e[Symbol.toStringTag] || e.constructor.name || "Object";
534
+ return c;
535
+ }
536
+ }
537
+ function it(e) {
538
+ try {
539
+ return ze(e), !1;
540
+ } catch {
541
+ return !0;
542
+ }
543
+ }
544
+ function ze(e) {
545
+ return "" + e;
546
+ }
547
+ function Ue(e) {
548
+ if (it(e))
549
+ return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", at(e)), ze(e);
550
+ }
551
+ var qe = S.ReactCurrentOwner, Fe = {
552
+ key: !0,
553
+ ref: !0,
554
+ __self: !0,
555
+ __source: !0
556
+ }, xe, Ke;
557
+ function ot(e) {
558
+ if (Ee.call(e, "ref")) {
559
+ var o = Object.getOwnPropertyDescriptor(e, "ref").get;
560
+ if (o && o.isReactWarning)
561
+ return !1;
562
+ }
563
+ return e.ref !== void 0;
564
+ }
565
+ function lt(e) {
566
+ if (Ee.call(e, "key")) {
567
+ var o = Object.getOwnPropertyDescriptor(e, "key").get;
568
+ if (o && o.isReactWarning)
569
+ return !1;
570
+ }
571
+ return e.key !== void 0;
572
+ }
573
+ function st(e, o) {
574
+ typeof e.ref == "string" && qe.current;
575
+ }
576
+ function ct(e, o) {
577
+ {
578
+ var c = function() {
579
+ xe || (xe = !0, R("%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)", o));
580
+ };
581
+ c.isReactWarning = !0, Object.defineProperty(e, "key", {
582
+ get: c,
583
+ configurable: !0
584
+ });
585
+ }
586
+ }
587
+ function Ge(e, o) {
588
+ {
589
+ var c = function() {
590
+ Ke || (Ke = !0, R("%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)", o));
591
+ };
592
+ c.isReactWarning = !0, Object.defineProperty(e, "ref", {
593
+ get: c,
594
+ configurable: !0
595
+ });
596
+ }
597
+ }
598
+ var Je = function(e, o, c, p, b, _, E) {
599
+ var v = {
600
+ // This tag allows us to uniquely identify this as a React Element
601
+ $$typeof: s,
602
+ // Built-in properties that belong on the element
603
+ type: e,
604
+ key: o,
605
+ ref: c,
606
+ props: E,
607
+ // Record the component responsible for creating this element.
608
+ _owner: _
609
+ };
610
+ return v._store = {}, Object.defineProperty(v._store, "validated", {
611
+ configurable: !1,
612
+ enumerable: !1,
613
+ writable: !0,
614
+ value: !1
615
+ }), Object.defineProperty(v, "_self", {
616
+ configurable: !1,
617
+ enumerable: !1,
618
+ writable: !1,
619
+ value: p
620
+ }), Object.defineProperty(v, "_source", {
621
+ configurable: !1,
622
+ enumerable: !1,
623
+ writable: !1,
624
+ value: b
625
+ }), Object.freeze && (Object.freeze(v.props), Object.freeze(v)), v;
626
+ };
627
+ function Xe(e, o, c, p, b) {
628
+ {
629
+ var _, E = {}, v = null, U = null;
630
+ c !== void 0 && (Ue(c), v = "" + c), lt(o) && (Ue(o.key), v = "" + o.key), ot(o) && (U = o.ref, st(o, b));
631
+ for (_ in o)
632
+ Ee.call(o, _) && !Fe.hasOwnProperty(_) && (E[_] = o[_]);
633
+ if (e && e.defaultProps) {
634
+ var D = e.defaultProps;
635
+ for (_ in D)
636
+ E[_] === void 0 && (E[_] = D[_]);
637
+ }
638
+ if (v || U) {
639
+ var V = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
640
+ v && ct(E, V), U && Ge(E, V);
641
+ }
642
+ return Je(e, v, U, b, p, qe.current, E);
643
+ }
644
+ }
645
+ var $e = S.ReactCurrentOwner, Qe = S.ReactDebugCurrentFrame;
646
+ function Ce(e) {
647
+ if (e) {
648
+ var o = e._owner, c = pe(e.type, e._source, o ? o.type : null);
649
+ Qe.setExtraStackFrame(c);
650
+ } else
651
+ Qe.setExtraStackFrame(null);
652
+ }
653
+ var He;
654
+ He = !1;
655
+ function Ie(e) {
656
+ return typeof e == "object" && e !== null && e.$$typeof === s;
657
+ }
658
+ function t() {
659
+ {
660
+ if ($e.current) {
661
+ var e = Z($e.current.type);
662
+ if (e)
663
+ return `
664
+
665
+ Check the render method of \`` + e + "`.";
666
+ }
667
+ return "";
668
+ }
669
+ }
670
+ function r(e) {
671
+ return "";
672
+ }
673
+ var n = {};
674
+ function i(e) {
675
+ {
676
+ var o = t();
677
+ if (!o) {
678
+ var c = typeof e == "string" ? e : e.displayName || e.name;
679
+ c && (o = `
680
+
681
+ Check the top-level render call using <` + c + ">.");
682
+ }
683
+ return o;
684
+ }
685
+ }
686
+ function a(e, o) {
687
+ {
688
+ if (!e._store || e._store.validated || e.key != null)
689
+ return;
690
+ e._store.validated = !0;
691
+ var c = i(o);
692
+ if (n[c])
693
+ return;
694
+ n[c] = !0;
695
+ var p = "";
696
+ e && e._owner && e._owner !== $e.current && (p = " It was passed a child from " + Z(e._owner.type) + "."), Ce(e), R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', c, p), Ce(null);
697
+ }
698
+ }
699
+ function m(e, o) {
700
+ {
701
+ if (typeof e != "object")
702
+ return;
703
+ if (Me(e))
704
+ for (var c = 0; c < e.length; c++) {
705
+ var p = e[c];
706
+ Ie(p) && a(p, o);
707
+ }
708
+ else if (Ie(e))
709
+ e._store && (e._store.validated = !0);
710
+ else if (e) {
711
+ var b = he(e);
712
+ if (typeof b == "function" && b !== e.entries)
713
+ for (var _ = b.call(e), E; !(E = _.next()).done; )
714
+ Ie(E.value) && a(E.value, o);
715
+ }
716
+ }
717
+ }
718
+ function f(e) {
719
+ {
720
+ var o = e.type;
721
+ if (o == null || typeof o == "string")
722
+ return;
723
+ var c;
724
+ if (typeof o == "function")
725
+ c = o.propTypes;
726
+ else if (typeof o == "object" && (o.$$typeof === k || // Note: Memo only checks outer props here.
727
+ // Inner props are checked in the reconciler.
728
+ o.$$typeof === I))
729
+ c = o.propTypes;
730
+ else
731
+ return;
732
+ if (c) {
733
+ var p = Z(o);
734
+ Ne(c, e.props, "prop", p, e);
735
+ } else if (o.PropTypes !== void 0 && !He) {
736
+ He = !0;
737
+ var b = Z(o);
738
+ R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", b || "Unknown");
739
+ }
740
+ typeof o.getDefaultProps == "function" && !o.getDefaultProps.isReactClassApproved && R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
741
+ }
742
+ }
743
+ function g(e) {
744
+ {
745
+ for (var o = Object.keys(e.props), c = 0; c < o.length; c++) {
746
+ var p = o[c];
747
+ if (p !== "children" && p !== "key") {
748
+ Ce(e), R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", p), Ce(null);
749
+ break;
750
+ }
751
+ }
752
+ e.ref !== null && (Ce(e), R("Invalid attribute `ref` supplied to `React.Fragment`."), Ce(null));
753
+ }
754
+ }
755
+ var N = {};
756
+ function Te(e, o, c, p, b, _) {
757
+ {
758
+ var E = G(e);
759
+ if (!E) {
760
+ var v = "";
761
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (v += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
762
+ var U = r();
763
+ U ? v += U : v += t();
764
+ var D;
765
+ e === null ? D = "null" : Me(e) ? D = "array" : e !== void 0 && e.$$typeof === s ? (D = "<" + (Z(e.type) || "Unknown") + " />", v = " Did you accidentally export a JSX literal instead of a component?") : D = typeof e, R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", D, v);
766
+ }
767
+ var V = Xe(e, o, c, b, _);
768
+ if (V == null)
769
+ return V;
770
+ if (E) {
771
+ var te = o.children;
772
+ if (te !== void 0)
773
+ if (p)
774
+ if (Me(te)) {
775
+ for (var je = 0; je < te.length; je++)
776
+ m(te[je], e);
777
+ Object.freeze && Object.freeze(te);
778
+ } else
779
+ R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
780
+ else
781
+ m(te, e);
782
+ }
783
+ if (Ee.call(o, "key")) {
784
+ var Pe = Z(e), J = Object.keys(o).filter(function(kt) {
785
+ return kt !== "key";
786
+ }), ut = J.length > 0 ? "{key: someKey, " + J.join(": ..., ") + ": ...}" : "{key: someKey}";
787
+ if (!N[Pe + ut]) {
788
+ var Pt = J.length > 0 ? "{" + J.join(": ..., ") + ": ...}" : "{}";
789
+ R(`A props object containing a "key" prop is being spread into JSX:
790
+ let props = %s;
791
+ <%s {...props} />
792
+ React keys must be passed directly to JSX without using spread:
793
+ let props = %s;
794
+ <%s key={someKey} {...props} />`, ut, Pe, Pt, Pe), N[Pe + ut] = !0;
795
+ }
796
+ }
797
+ return e === h ? g(V) : f(V), V;
798
+ }
799
+ }
800
+ function et(e, o, c) {
801
+ return Te(e, o, c, !0);
802
+ }
803
+ function tt(e, o, c) {
804
+ return Te(e, o, c, !1);
805
+ }
806
+ var xt = tt, Tt = et;
807
+ Be.Fragment = h, Be.jsx = xt, Be.jsxs = Tt;
808
+ }()), Be;
809
+ }
810
+ process.env.NODE_ENV === "production" ? pt.exports = Wt() : pt.exports = Zt();
811
+ var We = pt.exports;
812
+ const _t = (l) => Ht("path", l), ht = bt(
813
+ /**
814
+ * @param {SVGProps} props isPressed indicates whether the SVG should appear as pressed.
815
+ * Other props will be passed through to svg component.
816
+ * @param {import('react').ForwardedRef<SVGSVGElement>} ref The forwarded ref to the SVG element.
817
+ *
818
+ * @return {JSX.Element} Stop component
819
+ */
820
+ ({
821
+ className: l,
822
+ isPressed: s,
823
+ ...C
824
+ }, h) => {
825
+ const x = {
826
+ ...C,
827
+ className: It(l, {
828
+ "is-pressed": s
829
+ }) || void 0,
830
+ "aria-hidden": !0,
831
+ focusable: !1
832
+ };
833
+ return /* @__PURE__ */ We.jsx("svg", {
834
+ ...x,
835
+ ref: h
836
+ });
837
+ }
838
+ );
839
+ ht.displayName = "SVG";
840
+ const Yt = /* @__PURE__ */ We.jsx(ht, {
841
+ viewBox: "0 0 24 24",
842
+ xmlns: "http://www.w3.org/2000/svg",
843
+ children: /* @__PURE__ */ We.jsx(_t, {
844
+ d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"
845
+ })
846
+ }), zt = /* @__PURE__ */ We.jsx(ht, {
847
+ xmlns: "http://www.w3.org/2000/svg",
848
+ viewBox: "0 0 24 24",
849
+ children: /* @__PURE__ */ We.jsx(_t, {
850
+ d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
851
+ })
852
+ }), Ut = "_file-picker-tree_3rwm2_1", qt = "_file-node-button_3rwm2_17", Kt = "_selected_3rwm2_53", Gt = "_focused_3rwm2_65", Jt = "_dropTarget_3rwm2_70", Xt = "_dropTargetInvalid_3rwm2_79", Qt = "_renaming_3rwm2_88", er = "_renameInput_3rwm2_93", tr = "_file-name_3rwm2_108", X = {
853
+ filePickerTree: Ut,
854
+ fileNodeButton: qt,
855
+ selected: Kt,
856
+ focused: Gt,
857
+ dropTarget: Jt,
858
+ dropTargetInvalid: Xt,
859
+ renaming: Qt,
860
+ renameInput: er,
861
+ fileName: tr
862
+ };
863
+ function ft(l) {
864
+ if (!l) return [];
865
+ const s = l.replaceAll(/\\+/g, "/").replace(/\/{2,}/g, "/").replace(/\/$/, "") || l, C = s.startsWith("/"), h = s.split("/").filter(Boolean), x = [];
866
+ let P = C ? "/" : "";
867
+ C && x.push("/");
868
+ for (const T of h)
869
+ !P || P === "/" ? P = P === "/" ? `/${T}` : T : P = `${P}/${T}`, x.push(P);
870
+ return x;
871
+ }
872
+ function rr(l, s) {
873
+ if (!l || !s || l === s) return !1;
874
+ const C = l === "/" ? "/" : l.replace(/\/{2,}/g, "/"), h = s.replace(/\/{2,}/g, "/");
875
+ return C === "/" ? h.startsWith("/") && h !== "/" : h.startsWith(`${C}/`);
876
+ }
877
+ function dt(l, s, C) {
878
+ return l && (l === s ? C : l.startsWith(s === "/" ? "/" : `${s}/`) ? C + l.slice(s.length) : l);
879
+ }
880
+ const nr = St(function({
881
+ filesystem: s,
882
+ root: C = "/wordpress",
883
+ initialSelectedPath: h,
884
+ onSelect: x = () => {
885
+ }
886
+ }, P) {
887
+ const T = wt(() => {
888
+ let t = (C || "/").replace(/\\+/g, "/");
889
+ return t.startsWith("/") || (t = `/${t}`), t = t.replace(/\/{2,}/g, "/"), t.length > 1 && t.endsWith("/") && (t = t.slice(0, -1)), t || "/";
890
+ }, [C]), H = (t) => !t || t === "." || t === ".." ? !1 : !/[\\/]/.test(t), [k, O] = Q(() => {
891
+ if (!h)
892
+ return {};
893
+ const t = {};
894
+ for (const r of ft(h))
895
+ t[r] = !0;
896
+ return t;
897
+ }), [y, I] = Q(
898
+ () => h ?? null
899
+ ), [M, F] = Q(
900
+ () => h ?? null
901
+ ), [ee, q] = Q({}), [he, S] = Q(
902
+ {}
903
+ ), [R, se] = Q(null), [we, K] = Q(
904
+ null
905
+ ), W = re({}), ie = re(!1), ce = re(null), w = re(null), G = re(he), ne = re(ee), ue = () => {
906
+ for (const t of Object.keys(W.current))
907
+ clearTimeout(W.current[t]), delete W.current[t];
908
+ }, Z = (t) => {
909
+ const r = W.current[t];
910
+ r && (clearTimeout(r), delete W.current[t]);
911
+ };
912
+ le(() => {
913
+ G.current = he;
914
+ }, [he]), le(() => {
915
+ ne.current = ee;
916
+ }, [ee]);
917
+ const j = (t) => {
918
+ var n;
919
+ const r = (n = ce.current) == null ? void 0 : n.querySelector(
920
+ `[data-path="${t}"]`
921
+ );
922
+ r && typeof r.focus == "function" && r.focus();
923
+ }, L = (t, r = "") => (r ? `${r}/${t.name}` : t.name).replaceAll(/\\+/g, "/").replace(/\/{2,}/g, "/"), be = (t, r) => t.children ? t.children : ee[r], _e = async (t, r) => {
924
+ const n = await t.listFiles(r), i = [];
925
+ for (const a of n) {
926
+ const m = r === "/" ? `/${a}` : `${r}/${a}`, f = await t.isDir(m);
927
+ i.push({ name: a, type: f ? "folder" : "file" });
928
+ }
929
+ return i.sort((a, m) => a.type !== m.type ? a.type === "folder" ? -1 : 1 : a.name.localeCompare(m.name)), i;
930
+ }, ge = async (t) => await _e(s, t), oe = (t, r) => {
931
+ if (r.type !== "folder")
932
+ return r.children;
933
+ const n = r.children ?? ne.current[t];
934
+ return n || G.current[t] ? n : (S((i) => ({ ...i, [t]: !0 })), new Promise((i) => {
935
+ ge(t).then((a) => {
936
+ q((m) => ({
937
+ ...m,
938
+ [t]: a ?? []
939
+ })), i(a ?? []);
940
+ }).catch(() => {
941
+ i([]);
942
+ }).finally(() => {
943
+ S((a) => {
944
+ const m = { ...a };
945
+ return delete m[t], m;
946
+ });
947
+ });
948
+ }));
949
+ }, ve = (t, r) => {
950
+ r.type === "folder" && (typeof window > "u" || W.current[t] || (W.current[t] = window.setTimeout(() => {
951
+ O((n) => n[t] ? n : { ...n, [t]: !0 }), oe(t, r), delete W.current[t];
952
+ }, 600)));
953
+ }, A = (t) => (S((r) => ({ ...r, [t]: !0 })), new Promise((r) => {
954
+ ge(t).then((n) => {
955
+ q((i) => ({
956
+ ...i,
957
+ [t]: n ?? []
958
+ })), r(n ?? []);
959
+ }).catch(() => {
960
+ r([]);
961
+ }).finally(() => {
962
+ S((n) => {
963
+ const i = { ...n };
964
+ return delete i[t], i;
965
+ });
966
+ });
967
+ })), ye = (t, r, n) => {
968
+ O((i) => ({
969
+ ...i,
970
+ [t]: n
971
+ })), n ? oe(t, r) : q((i) => {
972
+ if (i[t] === void 0)
973
+ return i;
974
+ const a = { ...i };
975
+ return delete a[t], a;
976
+ });
977
+ }, ae = async (t) => {
978
+ if (!t) return;
979
+ const r = ft(t);
980
+ if (r.length === 0) return;
981
+ O((a) => {
982
+ const m = { ...a };
983
+ for (const f of r)
984
+ m[f] = !0;
985
+ return m;
986
+ });
987
+ let n = [
988
+ { name: T, type: "folder" }
989
+ ], i = "";
990
+ for (const a of r) {
991
+ const m = n == null ? void 0 : n.find((g) => L(g, i) === a);
992
+ if (!m || m.type !== "folder") {
993
+ i = a, n = [];
994
+ continue;
995
+ }
996
+ n = await oe(a, m) ?? ne.current[a], i = a;
997
+ }
998
+ }, fe = (t, r) => {
999
+ if (!t || !r || t === r)
1000
+ return;
1001
+ const n = t === "/" ? "/" : `${t}/`, i = (a) => a === t ? r : a.startsWith(n) ? r + a.slice(t.length) : null;
1002
+ O((a) => {
1003
+ let m = !1;
1004
+ const f = { ...a };
1005
+ for (const g of Object.keys(a)) {
1006
+ const N = i(g);
1007
+ N && N !== g && (f[N] = a[g], delete f[g], m = !0);
1008
+ }
1009
+ return m ? f : a;
1010
+ }), q((a) => {
1011
+ let m = !1;
1012
+ const f = { ...a };
1013
+ for (const g of Object.keys(a)) {
1014
+ const N = i(g);
1015
+ N && N !== g && (f[N] = a[g], delete f[g], m = !0);
1016
+ }
1017
+ return m ? f : a;
1018
+ }), I((a) => a && (i(a) ?? a)), F((a) => a && (i(a) ?? a));
1019
+ }, Re = () => {
1020
+ se(null), K(null), ue();
1021
+ }, de = (t, r = !0) => {
1022
+ I(t), r && x(t);
1023
+ }, B = wt(() => [{ name: T, type: "folder" }], [T]), [u, $] = Q(null), [me, Y] = Q(null), z = re(null), Se = me;
1024
+ Ot(
1025
+ P,
1026
+ () => ({
1027
+ focusPath: (t, r = {}) => {
1028
+ if (!t) return;
1029
+ const {
1030
+ select: n = !0,
1031
+ domFocus: i = !0,
1032
+ notify: a = !1
1033
+ } = r;
1034
+ n && de(t, a), F(t), i && j(t);
1035
+ },
1036
+ selectPath: (t) => {
1037
+ t && (de(t), F(t), j(t));
1038
+ },
1039
+ getSelectedPath: () => y,
1040
+ expandToPath: async (t) => await ae(t),
1041
+ refresh: async (t) => await A(t),
1042
+ remapPath: fe,
1043
+ createFile: async (t) => {
1044
+ await xe(t, "file", "untitled.php");
1045
+ },
1046
+ createFolder: async (t) => {
1047
+ await xe(t, "folder", "New Folder");
1048
+ }
1049
+ }),
1050
+ [y, A, fe, ae]
1051
+ );
1052
+ const Ze = re(!1), pe = re(
1053
+ h ?? null
1054
+ ), Ee = re(h);
1055
+ le(() => {
1056
+ ie.current = !1;
1057
+ }, [T]), le(() => {
1058
+ h && h !== Ee.current ? pe.current = h : h || (pe.current = null), Ee.current = h;
1059
+ }, [h]), le(() => {
1060
+ if (!h || Ze.current)
1061
+ return;
1062
+ Ze.current = !0;
1063
+ const t = ft(h);
1064
+ O((n) => {
1065
+ const i = { ...n };
1066
+ for (const a of t)
1067
+ i[a] = !0;
1068
+ return i;
1069
+ });
1070
+ const r = t[t.length - 1] || h;
1071
+ F(r), I(r), ae(h);
1072
+ }, [h, ae]), le(() => {
1073
+ const t = pe.current;
1074
+ !t || B.length === 0 || (pe.current = null, ae(t));
1075
+ }, [B, ae]), le(() => {
1076
+ if (!M) {
1077
+ if (B.length > 0) {
1078
+ const t = L(B[0]);
1079
+ F(t);
1080
+ }
1081
+ return;
1082
+ }
1083
+ Se && Se === M || j(M);
1084
+ }, [
1085
+ B,
1086
+ M,
1087
+ L,
1088
+ Se,
1089
+ j
1090
+ ]), le(() => {
1091
+ if (B.length === 0)
1092
+ return;
1093
+ const t = B[0];
1094
+ if ((t == null ? void 0 : t.type) !== "folder" || ie.current)
1095
+ return;
1096
+ const r = t.name;
1097
+ ie.current = !0, O(
1098
+ (n) => n[r] ? n : { ...n, [r]: !0 }
1099
+ ), !ne.current[r] && !G.current[r] && oe(r, t);
1100
+ }, [B, oe, T]), le(() => () => {
1101
+ w.current && clearTimeout(w.current), ue();
1102
+ }, []);
1103
+ const [Ye, Oe] = Q(""), De = (t, r) => {
1104
+ if (t.type === "folder")
1105
+ return r;
1106
+ const n = ke(r);
1107
+ return n && n || "/";
1108
+ }, Ne = (t, r, n) => {
1109
+ const i = De(t, r);
1110
+ if (!i)
1111
+ return { allowed: !1, state: "invalid", destination: null };
1112
+ if (n) {
1113
+ if (i === n)
1114
+ return { allowed: !1, state: "invalid", destination: null };
1115
+ if (rr(n, i))
1116
+ return { allowed: !1, state: "invalid", destination: null };
1117
+ }
1118
+ return { allowed: !0, state: "valid", destination: i };
1119
+ }, nt = (t, r, n) => {
1120
+ r.type !== "folder" && r.type !== "file" || (se(n), K(null), t.dataTransfer && (t.dataTransfer.effectAllowed = "move", t.dataTransfer.setData(
1121
+ "application/x-wp-playground-path",
1122
+ n
1123
+ ), t.dataTransfer.setData("text/plain", n)));
1124
+ }, Me = () => {
1125
+ Re();
1126
+ }, at = (t, r, n) => {
1127
+ const i = Ne(r, n, R);
1128
+ i.allowed && r.type === "folder" && ve(n, r), K((a) => (a == null ? void 0 : a.path) === n && a.state === i.state ? a : { path: n, state: i.state });
1129
+ }, it = (t, r, n) => {
1130
+ const i = Ne(r, n, R);
1131
+ i.allowed && i.destination ? (t.preventDefault(), t.dataTransfer && (t.dataTransfer.dropEffect = R ? "move" : "copy"), r.type === "folder" && ve(n, r), K((a) => (a == null ? void 0 : a.path) === n && a.state === i.state ? a : { path: n, state: i.state })) : (t.dataTransfer && (t.dataTransfer.dropEffect = "none"), Z(n), K((a) => (a == null ? void 0 : a.path) === n && a.state === "invalid" ? a : { path: n, state: "invalid" }));
1132
+ }, ze = (t, r, n) => {
1133
+ Z(n);
1134
+ const i = t.relatedTarget;
1135
+ i && t.currentTarget.contains(i) || K((a) => (a == null ? void 0 : a.path) === n ? null : a);
1136
+ }, Ue = async (t, r, n) => {
1137
+ const i = R, a = Ne(r, n, i);
1138
+ if (!a.allowed || !a.destination) {
1139
+ Re();
1140
+ return;
1141
+ }
1142
+ t.preventDefault(), t.stopPropagation(), Z(n), K(null);
1143
+ try {
1144
+ i ? await lt(i, a.destination) : await $e(t, a.destination);
1145
+ } finally {
1146
+ Re();
1147
+ }
1148
+ }, qe = (t, r, n) => {
1149
+ t.preventDefault(), t.stopPropagation(), Y(null), $({
1150
+ absPath: n,
1151
+ type: r.type,
1152
+ x: t.clientX,
1153
+ y: t.clientY
1154
+ });
1155
+ }, Fe = async (t, r) => {
1156
+ let n = r, i = 0;
1157
+ const a = (f) => {
1158
+ const g = f.lastIndexOf(".");
1159
+ return g > 0 ? { stem: f.slice(0, g), ext: f.slice(g) } : { stem: f, ext: "" };
1160
+ }, m = t === "/" ? "" : t;
1161
+ for (; await (s == null ? void 0 : s.fileExists(`${m}/${n}`)) || await (s == null ? void 0 : s.isDir(`${m}/${n}`)); ) {
1162
+ i += 1;
1163
+ const { stem: f, ext: g } = a(r);
1164
+ n = `${f} (${i})${g}`;
1165
+ }
1166
+ return n;
1167
+ }, xe = async (t, r, n) => {
1168
+ if (!s) return;
1169
+ let i = t || y || T;
1170
+ try {
1171
+ await s.isDir(i) || (i = ke(i));
1172
+ } catch {
1173
+ i = ke(i);
1174
+ }
1175
+ const a = i, m = await Fe(a, n), f = Ae(a, m);
1176
+ r === "folder" ? await s.mkdir(f) : await s.writeFile(f, ""), z.current = { type: r, tempPath: f }, Y(f), await A(a), setTimeout(() => {
1177
+ F(f), j(f);
1178
+ }, 0);
1179
+ }, Ke = async (t) => {
1180
+ if (!s) return !1;
1181
+ try {
1182
+ if (await s.fileExists(t))
1183
+ return !0;
1184
+ } catch {
1185
+ }
1186
+ try {
1187
+ if (await s.isDir(t))
1188
+ return !0;
1189
+ } catch {
1190
+ }
1191
+ return !1;
1192
+ }, ot = async (t) => {
1193
+ if (s)
1194
+ try {
1195
+ await s.mkdir(t);
1196
+ } catch (r) {
1197
+ if (!await s.isDir(t).catch(() => !1))
1198
+ throw r;
1199
+ }
1200
+ }, lt = async (t, r) => {
1201
+ if (!s) return;
1202
+ const n = Mt(t), i = Ae(r, n);
1203
+ if (i === t || await Ke(i))
1204
+ return;
1205
+ const a = ke(t);
1206
+ try {
1207
+ await s.mv(t, i), fe(t, i);
1208
+ const m = dt(
1209
+ y,
1210
+ t,
1211
+ i
1212
+ );
1213
+ y && (y === t || y.startsWith(`${t}/`)) && x(m), F(
1214
+ (f) => dt(f, t, i)
1215
+ ), O((f) => ({
1216
+ ...f,
1217
+ [r]: !0
1218
+ })), await Promise.all([
1219
+ A(a),
1220
+ A(r)
1221
+ ]), I(
1222
+ (f) => dt(f, t, i)
1223
+ ), j(i);
1224
+ } catch {
1225
+ }
1226
+ }, st = (t) => {
1227
+ const r = t;
1228
+ return r.webkitGetAsEntry ? r.webkitGetAsEntry() : null;
1229
+ }, ct = (t) => new Promise((r, n) => {
1230
+ t.file(r, n);
1231
+ }), Ge = async (t, r) => {
1232
+ if (!s) return;
1233
+ const n = t.name || "untitled", i = await Fe(r, n), a = Ae(r, i), m = new Uint8Array(await t.arrayBuffer());
1234
+ await s.writeFile(a, m);
1235
+ }, Je = async (t, r) => {
1236
+ const n = await ct(t);
1237
+ await Ge(n, r);
1238
+ }, Xe = async (t, r) => {
1239
+ const n = await Fe(
1240
+ r,
1241
+ t.name || "New Folder"
1242
+ ), i = Ae(r, n);
1243
+ await ot(i);
1244
+ const a = t.createReader(), m = () => new Promise((f, g) => {
1245
+ a.readEntries(
1246
+ (N) => f(Array.from(N)),
1247
+ g
1248
+ );
1249
+ });
1250
+ for (; ; ) {
1251
+ const f = await m();
1252
+ if (!f.length)
1253
+ break;
1254
+ for (const g of f)
1255
+ g.isFile ? await Je(
1256
+ g,
1257
+ i
1258
+ ) : g.isDirectory && await Xe(
1259
+ g,
1260
+ i
1261
+ );
1262
+ }
1263
+ }, $e = async (t, r) => {
1264
+ var a, m;
1265
+ if (!s) return;
1266
+ const i = ((a = t.dataTransfer) != null && a.items ? Array.from(t.dataTransfer.items) : []).filter((f) => f.kind === "file").map((f) => st(f)).filter((f) => !!f);
1267
+ if (i.length > 0)
1268
+ for (const f of i)
1269
+ f.isFile ? await Je(
1270
+ f,
1271
+ r
1272
+ ) : f.isDirectory && await Xe(
1273
+ f,
1274
+ r
1275
+ );
1276
+ else {
1277
+ const f = (m = t.dataTransfer) != null && m.files ? Array.from(t.dataTransfer.files) : [];
1278
+ for (const g of f)
1279
+ await Ge(g, r);
1280
+ }
1281
+ await A(r), O((f) => ({
1282
+ ...f,
1283
+ [r]: !0
1284
+ }));
1285
+ }, Qe = async (t, r) => {
1286
+ if (!s) return;
1287
+ const n = t;
1288
+ $(null);
1289
+ try {
1290
+ r === "folder" ? await s.rmdir(n, { recursive: !0 }) : await s.unlink(n);
1291
+ } catch {
1292
+ } finally {
1293
+ Y(null);
1294
+ const i = ke(n);
1295
+ await A(i), y && (y === n || y.startsWith(`${n}/`)) && x(null);
1296
+ }
1297
+ }, Ce = (t) => {
1298
+ var r;
1299
+ if (t.key.length === 1 && t.key.match(/\S/)) {
1300
+ const n = Ye + t.key.toLowerCase();
1301
+ if (Oe(n), w.current && clearTimeout(w.current), w.current = setTimeout(() => {
1302
+ Oe("");
1303
+ }, 1e3), !ce.current)
1304
+ return;
1305
+ const i = Array.from(
1306
+ ce.current.querySelectorAll(".file-node-button")
1307
+ ), a = document.activeElement;
1308
+ let m = 0;
1309
+ a && i.includes(a) && (m = i.indexOf(
1310
+ a
1311
+ ));
1312
+ for (let f = 0; f < i.length; f++) {
1313
+ const g = (m + f) % i.length, N = i[g];
1314
+ if ((r = N.textContent) != null && r.toLowerCase().trim().startsWith(n)) {
1315
+ N.focus();
1316
+ const Te = N.getAttribute("data-path");
1317
+ Te && F(Te);
1318
+ break;
1319
+ }
1320
+ }
1321
+ } else
1322
+ Oe(""), w.current && clearTimeout(w.current);
1323
+ }, He = async (t, r) => {
1324
+ const n = z.current, i = (n == null ? void 0 : n.tempPath) === t, a = ke(t), m = (r || "").trim();
1325
+ if (!H(m)) {
1326
+ if (i) {
1327
+ try {
1328
+ n.type === "folder" ? await s.rmdir(t, {
1329
+ recursive: !0
1330
+ }) : await s.unlink(t);
1331
+ } catch {
1332
+ }
1333
+ z.current = null;
1334
+ }
1335
+ Y(i ? null : t);
1336
+ return;
1337
+ }
1338
+ let f = Ae(a, m), g = f;
1339
+ if (g === t) {
1340
+ Y(null), i && (z.current = null), setTimeout(() => {
1341
+ F(g), j(g);
1342
+ }, 0);
1343
+ return;
1344
+ }
1345
+ const N = await s.fileExists(g), Te = await s.isDir(g);
1346
+ if ((N || Te) && g !== t)
1347
+ if (i)
1348
+ try {
1349
+ const tt = await Fe(
1350
+ a === "/" ? "/" : a,
1351
+ m
1352
+ );
1353
+ f = Ae(a, tt), g = f;
1354
+ } catch {
1355
+ }
1356
+ else {
1357
+ Y(t);
1358
+ return;
1359
+ }
1360
+ let et = (n == null ? void 0 : n.type) === "folder";
1361
+ try {
1362
+ await s.mv(t, f), n || (et = await s.isDir(f)), et && fe(t, g), y === t && x(g), await A(a), F(g), j(g);
1363
+ } catch {
1364
+ if (i)
1365
+ try {
1366
+ (n == null ? void 0 : n.type) === "folder" ? await s.rmdir(t, {
1367
+ recursive: !0
1368
+ }) : await s.unlink(t);
1369
+ } catch {
1370
+ }
1371
+ } finally {
1372
+ z.current = null, Y(null);
1373
+ }
1374
+ }, Ie = async (t) => {
1375
+ const r = z.current;
1376
+ if (!s || (r == null ? void 0 : r.tempPath) !== t) {
1377
+ Y((i) => i === t ? null : i);
1378
+ return;
1379
+ }
1380
+ try {
1381
+ r.type === "folder" ? await s.rmdir(t, { recursive: !0 }) : await s.unlink(t);
1382
+ } catch {
1383
+ }
1384
+ z.current = null, Y(null);
1385
+ const n = ke(t);
1386
+ await A(n), F(n), j(n);
1387
+ };
1388
+ return /* @__PURE__ */ d.createElement("div", { onKeyDown: Ce, ref: ce }, /* @__PURE__ */ d.createElement(Dt, { className: X.filePickerTree }, B.map((t, r) => /* @__PURE__ */ d.createElement(
1389
+ Rt,
1390
+ {
1391
+ key: t.name,
1392
+ node: t,
1393
+ level: 0,
1394
+ position: r + 1,
1395
+ setSize: B.length,
1396
+ expandedNodePaths: k,
1397
+ onToggle: ye,
1398
+ selectedNode: y,
1399
+ focusPath: (n) => F(n),
1400
+ focusedNode: M,
1401
+ selectPath: de,
1402
+ generatePath: L,
1403
+ getChildren: be,
1404
+ onContextMenu: qe,
1405
+ renamingPath: Se,
1406
+ onRename: He,
1407
+ onRenameCancel: Ie,
1408
+ dropIndicator: we,
1409
+ onDragStart: nt,
1410
+ onDragEnd: Me,
1411
+ onDragEnter: at,
1412
+ onDragOver: it,
1413
+ onDragLeave: ze,
1414
+ onDrop: Ue,
1415
+ rootPath: T
1416
+ }
1417
+ ))), u && /* @__PURE__ */ d.createElement(
1418
+ Ft,
1419
+ {
1420
+ placement: "bottom-start",
1421
+ onClose: () => $(null),
1422
+ anchor: {
1423
+ getBoundingClientRect: () => ({
1424
+ x: u.x,
1425
+ y: u.y,
1426
+ width: 0,
1427
+ height: 0,
1428
+ top: u.y,
1429
+ left: u.x,
1430
+ right: u.x,
1431
+ bottom: u.y,
1432
+ toJSON: () => ({})
1433
+ }),
1434
+ ownerDocument: document
1435
+ },
1436
+ noArrow: !0,
1437
+ resize: !1,
1438
+ focusOnMount: "firstElement"
1439
+ },
1440
+ /* @__PURE__ */ d.createElement(jt, { role: "menu" }, u.type === "folder" && /* @__PURE__ */ d.createElement(
1441
+ rt,
1442
+ {
1443
+ role: "menuitem",
1444
+ onClick: async () => {
1445
+ $(null), await xe(
1446
+ u.absPath,
1447
+ "file",
1448
+ "untitled.php"
1449
+ );
1450
+ }
1451
+ },
1452
+ "Create file"
1453
+ ), u.type === "folder" && /* @__PURE__ */ d.createElement(
1454
+ rt,
1455
+ {
1456
+ role: "menuitem",
1457
+ onClick: async () => {
1458
+ $(null), await xe(
1459
+ u.absPath,
1460
+ "folder",
1461
+ "New Folder"
1462
+ );
1463
+ }
1464
+ },
1465
+ "Create directory"
1466
+ ), /* @__PURE__ */ d.createElement(
1467
+ rt,
1468
+ {
1469
+ role: "menuitem",
1470
+ onClick: () => {
1471
+ $(null), Y(u.absPath);
1472
+ }
1473
+ },
1474
+ "Rename"
1475
+ ), /* @__PURE__ */ d.createElement(
1476
+ rt,
1477
+ {
1478
+ role: "menuitem",
1479
+ onClick: () => Qe(
1480
+ u.absPath,
1481
+ u.type
1482
+ )
1483
+ },
1484
+ "Delete"
1485
+ ))
1486
+ ));
1487
+ }), Rt = ({
1488
+ node: l,
1489
+ level: s,
1490
+ position: C,
1491
+ setSize: h,
1492
+ expandedNodePaths: x,
1493
+ onToggle: P,
1494
+ selectedNode: T,
1495
+ focusPath: H,
1496
+ focusedNode: k,
1497
+ selectPath: O,
1498
+ generatePath: y,
1499
+ getChildren: I,
1500
+ onContextMenu: M,
1501
+ renamingPath: F,
1502
+ onRename: ee,
1503
+ onRenameCancel: q,
1504
+ parentPath: he = "",
1505
+ dropIndicator: S,
1506
+ onDragStart: R,
1507
+ onDragEnd: se,
1508
+ onDragEnter: we,
1509
+ onDragOver: K,
1510
+ onDragLeave: W,
1511
+ onDrop: ie,
1512
+ rootPath: ce
1513
+ }) => {
1514
+ const w = y(l, he), G = x[w], ne = F === w, ue = re(null), [Z, j] = Q(l.name), L = re(!1), be = (S == null ? void 0 : S.path) === w, _e = be && (S == null ? void 0 : S.state) === "valid", ge = be && (S == null ? void 0 : S.state) === "invalid", oe = !ne && w !== ce, ve = {
1515
+ onDragEnter: (u) => we == null ? void 0 : we(u, l, w),
1516
+ onDragOver: (u) => K == null ? void 0 : K(u, l, w),
1517
+ onDragLeave: (u) => W == null ? void 0 : W(u, l, w),
1518
+ onDrop: (u) => ie == null ? void 0 : ie(u, l, w)
1519
+ }, A = I(l, w) ?? [];
1520
+ le(() => {
1521
+ var u;
1522
+ ne ? (j(l.name), L.current = !1, typeof window < "u" && window.requestAnimationFrame ? window.requestAnimationFrame(() => {
1523
+ var $;
1524
+ ($ = ue.current) == null || $.select();
1525
+ }) : (u = ue.current) == null || u.select()) : L.current = !1;
1526
+ }, [ne, l.name]);
1527
+ const ye = () => {
1528
+ l.type === "folder" && P(w, l, !G);
1529
+ }, ae = (u) => {
1530
+ var $, me, Y;
1531
+ if (u.key === "ArrowLeft")
1532
+ G ? ye() : ($ = document.querySelector(
1533
+ `[data-path="${he}"]`
1534
+ )) == null || $.focus(), u.preventDefault(), u.stopPropagation();
1535
+ else if (u.key === "ArrowRight") {
1536
+ if (G) {
1537
+ if (A != null && A.length) {
1538
+ const z = y(
1539
+ A[0],
1540
+ w
1541
+ );
1542
+ (me = document.querySelector(
1543
+ `[data-path="${z}"]`
1544
+ )) == null || me.focus();
1545
+ }
1546
+ } else
1547
+ ye();
1548
+ u.preventDefault(), u.stopPropagation();
1549
+ } else if (u.key === " " || u.key === "Space" || u.key === "Spacebar")
1550
+ l.type === "folder" && P(w, l, !G), u.preventDefault();
1551
+ else if (u.key === "Enter") {
1552
+ O(w), H(w);
1553
+ const z = (Y = u.currentTarget) == null ? void 0 : Y.closest("form");
1554
+ z && setTimeout(() => {
1555
+ z.dispatchEvent(new Event("submit", { bubbles: !0 }));
1556
+ });
1557
+ }
1558
+ }, fe = (u) => {
1559
+ M == null || M(u, l, w);
1560
+ }, Re = (u) => {
1561
+ u.preventDefault(), L.current = !0, ee == null || ee(w, Z.trim());
1562
+ }, de = (u) => {
1563
+ if (u.key === "Escape") {
1564
+ u.preventDefault(), u.stopPropagation(), L.current = !0, q == null || q(w);
1565
+ return;
1566
+ }
1567
+ (u.key === "ArrowLeft" || u.key === "ArrowRight" || u.key === "ArrowUp" || u.key === "ArrowDown") && u.stopPropagation();
1568
+ }, B = () => {
1569
+ L.current || q == null || q(w), L.current = !1;
1570
+ };
1571
+ return /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement(
1572
+ At,
1573
+ {
1574
+ level: s,
1575
+ positionInSet: C,
1576
+ setSize: h
1577
+ },
1578
+ /* @__PURE__ */ d.createElement(Vt, null, () => /* @__PURE__ */ d.createElement(d.Fragment, null, ne ? /* @__PURE__ */ d.createElement(
1579
+ "form",
1580
+ {
1581
+ onSubmit: Re,
1582
+ className: gt(
1583
+ X.fileNodeButton,
1584
+ X.renaming,
1585
+ "file-node-button",
1586
+ {
1587
+ [X.selected]: T === w,
1588
+ [X.focused]: k === w,
1589
+ [X.dropTarget]: _e,
1590
+ [X.dropTargetInvalid]: ge
1591
+ }
1592
+ ),
1593
+ "data-path": w,
1594
+ onContextMenu: fe,
1595
+ ...ve
1596
+ },
1597
+ /* @__PURE__ */ d.createElement(
1598
+ Ct,
1599
+ {
1600
+ node: l,
1601
+ isOpen: l.type === "folder" && G,
1602
+ level: s,
1603
+ hideName: !0
1604
+ }
1605
+ ),
1606
+ /* @__PURE__ */ d.createElement(
1607
+ "input",
1608
+ {
1609
+ ref: ue,
1610
+ className: X.renameInput,
1611
+ value: Z,
1612
+ onChange: (u) => j(u.target.value),
1613
+ onBlur: B,
1614
+ onFocus: () => H(w),
1615
+ onKeyDown: de
1616
+ }
1617
+ )
1618
+ ) : /* @__PURE__ */ d.createElement(
1619
+ mt,
1620
+ {
1621
+ ...ve,
1622
+ draggable: oe,
1623
+ onDragStart: (u) => R == null ? void 0 : R(u, l, w),
1624
+ onDragEnd: (u) => se == null ? void 0 : se(u, l, w),
1625
+ onClick: () => {
1626
+ l.type === "folder" && ye(), O(w), H(w);
1627
+ },
1628
+ onKeyDown: ae,
1629
+ onFocus: () => {
1630
+ H(w);
1631
+ },
1632
+ onContextMenu: fe,
1633
+ className: gt(
1634
+ X.fileNodeButton,
1635
+ {
1636
+ [X.selected]: T === w,
1637
+ [X.focused]: k === w,
1638
+ [X.dropTarget]: _e,
1639
+ [X.dropTargetInvalid]: ge
1640
+ }
1641
+ ),
1642
+ "data-path": w,
1643
+ "data-expanded": G ? "true" : "false"
1644
+ },
1645
+ /* @__PURE__ */ d.createElement(
1646
+ Ct,
1647
+ {
1648
+ node: l,
1649
+ isOpen: l.type === "folder" && G,
1650
+ level: s
1651
+ }
1652
+ )
1653
+ )))
1654
+ ), G && A && A.map((u, $) => /* @__PURE__ */ d.createElement(
1655
+ Rt,
1656
+ {
1657
+ key: u.name,
1658
+ node: u,
1659
+ level: s + 1,
1660
+ position: $ + 1,
1661
+ setSize: A.length,
1662
+ expandedNodePaths: x,
1663
+ onToggle: P,
1664
+ selectedNode: T,
1665
+ focusPath: H,
1666
+ focusedNode: k,
1667
+ selectPath: O,
1668
+ generatePath: y,
1669
+ getChildren: I,
1670
+ onContextMenu: M,
1671
+ renamingPath: F,
1672
+ onRename: ee,
1673
+ onRenameCancel: q,
1674
+ parentPath: w,
1675
+ dropIndicator: S,
1676
+ onDragStart: R,
1677
+ onDragEnd: se,
1678
+ onDragEnter: we,
1679
+ onDragOver: K,
1680
+ onDragLeave: W,
1681
+ onDrop: ie,
1682
+ rootPath: ce
1683
+ }
1684
+ )));
1685
+ }, Ct = ({ node: l, level: s, isOpen: C, hideName: h = !1 }) => {
1686
+ const x = [];
1687
+ for (let P = 0; P < s; P++)
1688
+ x.push("&nbsp;&nbsp;&nbsp;&nbsp;");
1689
+ return /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement(
1690
+ "span",
1691
+ {
1692
+ "aria-hidden": "true",
1693
+ dangerouslySetInnerHTML: { __html: x.join("") }
1694
+ }
1695
+ ), l.type === "folder" ? /* @__PURE__ */ d.createElement(vt, { width: 16, icon: C ? Yt : zt }) : /* @__PURE__ */ d.createElement("div", { style: { width: 16 } }, " "), /* @__PURE__ */ d.createElement(vt, { width: 16, icon: l.type === "folder" ? Lt : Bt }), !h && /* @__PURE__ */ d.createElement("span", { className: X.fileName }, l.name));
1696
+ }, ar = "_control_kp9d9_1", ir = "_browse-label_kp9d9_11", or = "_path-preview_kp9d9_37", lr = "_modal_kp9d9_43", sr = "_modal-footer_kp9d9_48", Ve = {
1697
+ control: ar,
1698
+ browseLabel: ir,
1699
+ pathPreview: or,
1700
+ modal: lr,
1701
+ modalFooter: sr
1702
+ };
1703
+ function cr({ path: l }) {
1704
+ if (!l)
1705
+ return /* @__PURE__ */ d.createElement("div", { className: Ve.pathPreview }, /* @__PURE__ */ d.createElement("i", null, "Select a path"));
1706
+ const s = l.split("/");
1707
+ let C = (s.length > 2 ? "/" : "") + s.pop();
1708
+ C.length > 10 && (C = C.substring(C.length - 10));
1709
+ const h = l.substring(
1710
+ 0,
1711
+ l.length - C.length
1712
+ );
1713
+ return /* @__PURE__ */ d.createElement(
1714
+ "div",
1715
+ {
1716
+ className: Ve.pathPreview,
1717
+ "data-content-start": h,
1718
+ "data-content-end": C
1719
+ }
1720
+ );
1721
+ }
1722
+ function _r({
1723
+ value: l = "",
1724
+ onChange: s,
1725
+ filesystem: C
1726
+ }) {
1727
+ const [h, x] = Q(!1), P = () => x(!0), T = () => x(!1), [H, k] = Q(
1728
+ l || null
1729
+ );
1730
+ function O(y) {
1731
+ y == null || y.preventDefault(), s(H || ""), T();
1732
+ }
1733
+ return /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement(
1734
+ mt,
1735
+ {
1736
+ variant: "tertiary",
1737
+ className: Ve.control,
1738
+ onClick: P
1739
+ },
1740
+ /* @__PURE__ */ d.createElement("span", { className: Ve.browseLabel }, "Browse"),
1741
+ /* @__PURE__ */ d.createElement(cr, { path: l || "" })
1742
+ ), h && /* @__PURE__ */ d.createElement(
1743
+ Nt,
1744
+ {
1745
+ title: "Select a path ",
1746
+ onRequestClose: T,
1747
+ className: Ve.modal
1748
+ },
1749
+ /* @__PURE__ */ d.createElement("form", { onSubmit: O }, /* @__PURE__ */ d.createElement(
1750
+ nr,
1751
+ {
1752
+ filesystem: C,
1753
+ initialSelectedPath: l,
1754
+ onSelect: k
1755
+ }
1756
+ ), /* @__PURE__ */ d.createElement("div", { className: Ve.modalFooter }, /* @__PURE__ */ d.createElement(mt, { type: "submit", variant: "primary" }, "Select Path")))
1757
+ ));
1758
+ }
171
1759
  export {
172
- h as ClockIcon,
173
- d as SiteManagerIcon,
174
- r as WordPressIcon,
175
- o as file,
176
- i as folder,
177
- w as getLogoDataURL,
178
- a as layout,
179
- l as playgroundLogo,
180
- n as temporaryStorage
1760
+ yr as ClockIcon,
1761
+ _r as FilePickerControl,
1762
+ nr as FilePickerTree,
1763
+ br as SiteManagerIcon,
1764
+ vr as WordPressIcon,
1765
+ Bt as file,
1766
+ Lt as folder,
1767
+ Cr as getLogoDataURL,
1768
+ Er as layout,
1769
+ wr as playgroundLogo,
1770
+ gr as temporaryStorage
181
1771
  };
182
1772
  //# sourceMappingURL=index.js.map