@wp-playground/components 3.1.56 → 3.1.58

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