@prozilla-os/terminal 1.1.0 → 1.1.1

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.
Files changed (81) hide show
  1. package/dist/{cat-Dp7MxLJO.js → cat-FW5-WCC9.js} +2 -2
  2. package/dist/{cat-Dp7MxLJO.js.map → cat-FW5-WCC9.js.map} +1 -1
  3. package/dist/{cd-zk1UnOo7.js → cd-CJ_-Ao6a.js} +2 -2
  4. package/dist/{cd-zk1UnOo7.js.map → cd-CJ_-Ao6a.js.map} +1 -1
  5. package/dist/{cmatrix-O49Zkqb8.js → cmatrix-Dp2xw_1D.js} +2 -2
  6. package/dist/{cmatrix-O49Zkqb8.js.map → cmatrix-Dp2xw_1D.js.map} +1 -1
  7. package/dist/{compgen-CA_GMRpy.js → compgen-yV_rUCTl.js} +2 -2
  8. package/dist/{compgen-CA_GMRpy.js.map → compgen-yV_rUCTl.js.map} +1 -1
  9. package/dist/{cowsay-BAYsU72K.js → cowsay-DhGebg2w.js} +2 -2
  10. package/dist/{cowsay-BAYsU72K.js.map → cowsay-DhGebg2w.js.map} +1 -1
  11. package/dist/eval-CnKC-mrj.js +14 -0
  12. package/dist/eval-CnKC-mrj.js.map +1 -0
  13. package/dist/{help-CYIno6WY.js → help-K3OSEH-4.js} +2 -2
  14. package/dist/{help-CYIno6WY.js.map → help-K3OSEH-4.js.map} +1 -1
  15. package/dist/{lolcat-LdzLGQur.js → lolcat-e6AdhtPY.js} +2 -2
  16. package/dist/{lolcat-LdzLGQur.js.map → lolcat-e6AdhtPY.js.map} +1 -1
  17. package/dist/{ls-Csd6ypmW.js → ls-Cv8zACh_.js} +2 -2
  18. package/dist/{ls-Csd6ypmW.js.map → ls-Cv8zACh_.js.map} +1 -1
  19. package/dist/{main-tAp_mbfZ.js → main-BY8DgnTe.js} +91 -90
  20. package/dist/{main-tAp_mbfZ.js.map → main-BY8DgnTe.js.map} +1 -1
  21. package/dist/main.js +1 -1
  22. package/dist/{make-DOc--PtL.js → make-Cr6zPi10.js} +2 -2
  23. package/dist/{make-DOc--PtL.js.map → make-Cr6zPi10.js.map} +1 -1
  24. package/dist/{man-CZoHwxyo.js → man-B0gSJec-.js} +2 -2
  25. package/dist/{man-CZoHwxyo.js.map → man-B0gSJec-.js.map} +1 -1
  26. package/dist/{neofetch-KcdwHJSJ.js → neofetch-Cq2qUtOn.js} +2 -2
  27. package/dist/{neofetch-KcdwHJSJ.js.map → neofetch-Cq2qUtOn.js.map} +1 -1
  28. package/dist/{reload-zi8L0xNG.js → reload-BMeeiK59.js} +2 -2
  29. package/dist/{reload-zi8L0xNG.js.map → reload-BMeeiK59.js.map} +1 -1
  30. package/dist/{rm-KQ9gM6fT.js → rm-DrsNwyIE.js} +2 -2
  31. package/dist/{rm-KQ9gM6fT.js.map → rm-DrsNwyIE.js.map} +1 -1
  32. package/dist/{rmdir-UqUqHZTI.js → rmdir-BZAP4H6B.js} +2 -2
  33. package/dist/{rmdir-UqUqHZTI.js.map → rmdir-BZAP4H6B.js.map} +1 -1
  34. package/dist/{sl-BOyfa7Iu.js → sl-iFJMGBu9.js} +2 -2
  35. package/dist/{sl-BOyfa7Iu.js.map → sl-iFJMGBu9.js.map} +1 -1
  36. package/dist/{touch-D_kKTiUQ.js → touch-4AvKZiqp.js} +2 -2
  37. package/dist/{touch-D_kKTiUQ.js.map → touch-4AvKZiqp.js.map} +1 -1
  38. package/dist/{whatis-CYD52uq2.js → whatis-iNlzdd4F.js} +2 -2
  39. package/dist/{whatis-CYD52uq2.js.map → whatis-iNlzdd4F.js.map} +1 -1
  40. package/package.json +1 -1
  41. package/dist/src/components/Ansi.d.ts +0 -9
  42. package/dist/src/components/InputLine.d.ts +0 -11
  43. package/dist/src/components/OutputLine.d.ts +0 -6
  44. package/dist/src/components/Terminal.d.ts +0 -6
  45. package/dist/src/constants/terminal.const.d.ts +0 -7
  46. package/dist/src/core/_utils/terminal.utils.d.ts +0 -2
  47. package/dist/src/core/command.d.ts +0 -50
  48. package/dist/src/core/commands/cat.d.ts +0 -2
  49. package/dist/src/core/commands/cd.d.ts +0 -2
  50. package/dist/src/core/commands/clear.d.ts +0 -2
  51. package/dist/src/core/commands/cmatrix.d.ts +0 -2
  52. package/dist/src/core/commands/compgen.d.ts +0 -2
  53. package/dist/src/core/commands/cowsay.d.ts +0 -2
  54. package/dist/src/core/commands/dir.d.ts +0 -2
  55. package/dist/src/core/commands/echo.d.ts +0 -2
  56. package/dist/src/core/commands/exit.d.ts +0 -2
  57. package/dist/src/core/commands/fortune.d.ts +0 -2
  58. package/dist/src/core/commands/help.d.ts +0 -2
  59. package/dist/src/core/commands/hostname.d.ts +0 -2
  60. package/dist/src/core/commands/lolcat.d.ts +0 -2
  61. package/dist/src/core/commands/ls.d.ts +0 -2
  62. package/dist/src/core/commands/make.d.ts +0 -2
  63. package/dist/src/core/commands/man.d.ts +0 -2
  64. package/dist/src/core/commands/mkdir.d.ts +0 -2
  65. package/dist/src/core/commands/neofetch.d.ts +0 -2
  66. package/dist/src/core/commands/pwd.d.ts +0 -2
  67. package/dist/src/core/commands/reboot.d.ts +0 -2
  68. package/dist/src/core/commands/reload.d.ts +0 -2
  69. package/dist/src/core/commands/rev.d.ts +0 -2
  70. package/dist/src/core/commands/rm.d.ts +0 -2
  71. package/dist/src/core/commands/rmdir.d.ts +0 -2
  72. package/dist/src/core/commands/sl.d.ts +0 -2
  73. package/dist/src/core/commands/touch.d.ts +0 -2
  74. package/dist/src/core/commands/uptime.d.ts +0 -2
  75. package/dist/src/core/commands/whatis.d.ts +0 -2
  76. package/dist/src/core/commands/whoami.d.ts +0 -2
  77. package/dist/src/core/commands.d.ts +0 -7
  78. package/dist/src/core/stream.d.ts +0 -18
  79. package/dist/src/main.d.ts +0 -4
  80. package/dist/tsconfig.tsbuildinfo +0 -1
  81. package/dist/vite.config.d.ts +0 -2
@@ -275,13 +275,13 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
275
275
  value: function(n, s, f) {
276
276
  var y = this, i = this, u = n.split(/\033\[/), c = u.shift();
277
277
  s == null && (s = {}), s.clearLine = /\r/.test(n);
278
- var o = u.map(function(d) {
279
- return y.processChunk(d, s, f);
278
+ var o = u.map(function(_) {
279
+ return y.processChunk(_, s, f);
280
280
  });
281
281
  if (s && s.json) {
282
282
  var r = i.processChunkJson("");
283
- return r.content = c, r.clearLine = s.clearLine, o.unshift(r), s.remove_empty && (o = o.filter(function(d) {
284
- return !d.isEmpty();
283
+ return r.content = c, r.clearLine = s.clearLine, o.unshift(r), s.remove_empty && (o = o.filter(function(_) {
284
+ return !_.isEmpty();
285
285
  })), o;
286
286
  } else
287
287
  o.unshift(c);
@@ -337,7 +337,7 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
337
337
  if (c[1] !== "" || c[3] !== "m" || !f)
338
338
  return u;
339
339
  for (var r = this; o.length > 0; ) {
340
- var d = o.shift(), a = parseInt(d);
340
+ var _ = o.shift(), a = parseInt(_);
341
341
  if (isNaN(a) || a === 0)
342
342
  r.fg = r.bg = null, r.decorations = [];
343
343
  else if (a === 1)
@@ -389,18 +389,18 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
389
389
  if (o.length >= 1) {
390
390
  var k = o.shift();
391
391
  if (k === "5" && o.length >= 1) {
392
- var g = parseInt(o.shift());
393
- if (g >= 0 && g <= 255)
392
+ var h = parseInt(o.shift());
393
+ if (h >= 0 && h <= 255)
394
394
  if (!y)
395
- this.PALETTE_COLORS || r.setupPalette(), v ? r.fg = this.PALETTE_COLORS[g] : r.bg = this.PALETTE_COLORS[g];
395
+ this.PALETTE_COLORS || r.setupPalette(), v ? r.fg = this.PALETTE_COLORS[h] : r.bg = this.PALETTE_COLORS[h];
396
396
  else {
397
- var E = g >= 16 ? "ansi-palette-" + g : A[g > 7 ? 1 : 0][g % 8].class;
398
- v ? r.fg = E : r.bg = E;
397
+ var $ = h >= 16 ? "ansi-palette-" + h : A[h > 7 ? 1 : 0][h % 8].class;
398
+ v ? r.fg = $ : r.bg = $;
399
399
  }
400
400
  } else if (k === "2" && o.length >= 3) {
401
- var $ = parseInt(o.shift()), M = parseInt(o.shift()), D = parseInt(o.shift());
402
- if ($ >= 0 && $ <= 255 && M >= 0 && M <= 255 && D >= 0 && D <= 255) {
403
- var T = $ + ", " + M + ", " + D;
401
+ var O = parseInt(o.shift()), M = parseInt(o.shift()), D = parseInt(o.shift());
402
+ if (O >= 0 && O <= 255 && M >= 0 && M <= 255 && D >= 0 && D <= 255) {
403
+ var T = O + ", " + M + ", " + D;
404
404
  y ? v ? (r.fg = "ansi-truecolor", r.fg_truecolor = T) : (r.bg = "ansi-truecolor", r.bg_truecolor = T) : v ? r.fg = T : r.bg = T;
405
405
  }
406
406
  }
@@ -435,8 +435,8 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
435
435
  i.fg || (i.fg = A[0][7][u ? "class" : "color"]), i.bg || (i.bg = A[0][0][u ? "class" : "color"]);
436
436
  var k = i.fg;
437
437
  i.fg = i.bg, i.bg = k;
438
- var g = i.fg_truecolor;
439
- return i.fg_truecolor = i.bg_truecolor, i.bg_truecolor = g, i.isInverted = !0, !1;
438
+ var h = i.fg_truecolor;
439
+ return i.fg_truecolor = i.bg_truecolor, i.bg_truecolor = h, i.isInverted = !0, !1;
440
440
  }
441
441
  return !0;
442
442
  }), s.json)
@@ -445,19 +445,19 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
445
445
  return "";
446
446
  if (!i.was_processed)
447
447
  return i.content;
448
- var c = [], o = [], r = [], d = {}, a = function(k) {
449
- var g = [], E = void 0;
450
- for (E in k)
451
- k.hasOwnProperty(E) && g.push("data-" + E + '="' + y.escapeForHtml(k[E]) + '"');
452
- return g.length > 0 ? " " + g.join(" ") : "";
448
+ var c = [], o = [], r = [], _ = {}, a = function(k) {
449
+ var h = [], $ = void 0;
450
+ for ($ in k)
451
+ k.hasOwnProperty($) && h.push("data-" + $ + '="' + y.escapeForHtml(k[$]) + '"');
452
+ return h.length > 0 ? " " + h.join(" ") : "";
453
453
  };
454
- return i.isInverted && (d["ansi-is-inverted"] = "true"), i.fg && (u ? (c.push(i.fg + "-fg"), i.fg_truecolor !== null && (d["ansi-truecolor-fg"] = i.fg_truecolor, i.fg_truecolor = null)) : c.push("color:rgb(" + i.fg + ")")), i.bg && (u ? (c.push(i.bg + "-bg"), i.bg_truecolor !== null && (d["ansi-truecolor-bg"] = i.bg_truecolor, i.bg_truecolor = null)) : c.push("background-color:rgb(" + i.bg + ")")), i.decorations.forEach(function(v) {
454
+ return i.isInverted && (_["ansi-is-inverted"] = "true"), i.fg && (u ? (c.push(i.fg + "-fg"), i.fg_truecolor !== null && (_["ansi-truecolor-fg"] = i.fg_truecolor, i.fg_truecolor = null)) : c.push("color:rgb(" + i.fg + ")")), i.bg && (u ? (c.push(i.bg + "-bg"), i.bg_truecolor !== null && (_["ansi-truecolor-bg"] = i.bg_truecolor, i.bg_truecolor = null)) : c.push("background-color:rgb(" + i.bg + ")")), i.decorations.forEach(function(v) {
455
455
  if (u) {
456
456
  o.push("ansi-" + v);
457
457
  return;
458
458
  }
459
459
  v === "bold" ? o.push("font-weight:bold") : v === "dim" ? o.push("opacity:0.5") : v === "italic" ? o.push("font-style:italic") : v === "hidden" ? o.push("visibility:hidden") : v === "strikethrough" ? r.push("line-through") : r.push(v);
460
- }), r.length && o.push("text-decoration:" + r.join(" ")), u ? '<span class="' + c.concat(o).join(" ") + '"' + a(d) + ">" + i.content + "</span>" : '<span style="' + c.concat(o).join(";") + '"' + a(d) + ">" + i.content + "</span>";
460
+ }), r.length && o.push("text-decoration:" + r.join(" ")), u ? '<span class="' + c.concat(o).join(" ") + '"' + a(_) + ">" + i.content + "</span>" : '<span style="' + c.concat(o).join(";") + '"' + a(_) + ">" + i.content + "</span>";
461
461
  }
462
462
  }, {
463
463
  key: "removeDecoration",
@@ -555,9 +555,9 @@ function it(e, t, n, s) {
555
555
  const i = [], u = /(\s|^)(https?:\/\/(?:www\.|(?!www))[^\s.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/g;
556
556
  let c = 0, o;
557
557
  for (; (o = u.exec(n.content)) !== null; ) {
558
- const [, r, d] = o, a = o.index + r.length;
558
+ const [, r, _] = o, a = o.index + r.length;
559
559
  a > c && i.push(n.content.substring(c, a));
560
- const v = d.startsWith("www.") ? `http://${d}` : d;
560
+ const v = _.startsWith("www.") ? `http://${_}` : _;
561
561
  i.push(
562
562
  z.createElement(
563
563
  "a",
@@ -566,7 +566,7 @@ function it(e, t, n, s) {
566
566
  href: v,
567
567
  target: "_blank"
568
568
  },
569
- `${d}`
569
+ `${_}`
570
570
  )
571
571
  ), c = u.lastIndex;
572
572
  }
@@ -639,7 +639,7 @@ function ot({ value: e, prefix: t, onChange: n, onKeyUp: s, onKeyDown: f, inputR
639
639
  }
640
640
  const U = "user", Y = "prozilla-os", mt = 50, ye = `${b.fg.cyan + b.decoration.dim}$APP_NAME - Made by Prozilla${b.reset}
641
641
  ${b.decoration.dim}Type 'help' for a list of commands.${b.reset}
642
- `, C = b.fg.cyan, pt = `
642
+ `, E = b.fg.cyan, pt = `
643
643
  :.
644
644
  -==.
645
645
  .=====:
@@ -647,10 +647,10 @@ ${b.decoration.dim}Type 'help' for a list of commands.${b.reset}
647
647
  :===+=----------::..
648
648
  =+=---------------:..
649
649
  --------------------:.
650
- .:-+=----${b.fg.white}*###*${C}--${b.fg.white}*####=${C}---.
651
- :==+----${b.fg.white}#%+${C}-${b.fg.white}+%#${C}-${b.fg.white}##%*+${C}----:.
652
- .=----${b.fg.white}#%+${C}-${b.fg.white}+%#${C}-${b.fg.white}*+${C}-${b.fg.white}%#+${C}---:.
653
- ==----${b.fg.white}*###*${C}--${b.fg.white}*###*${C}----.
650
+ .:-+=----${b.fg.white}*###*${E}--${b.fg.white}*####=${E}---.
651
+ :==+----${b.fg.white}#%+${E}-${b.fg.white}+%#${E}-${b.fg.white}##%*+${E}----:.
652
+ .=----${b.fg.white}#%+${E}-${b.fg.white}+%#${E}-${b.fg.white}*+${E}-${b.fg.white}%#+${E}---:.
653
+ ==----${b.fg.white}*###*${E}--${b.fg.white}*###*${E}----.
654
654
  ==+-------------------:.
655
655
  ...::---------------:.
656
656
  .::---------::..
@@ -682,7 +682,7 @@ function dt(e) {
682
682
  return e.replace(/\u001b\[([0-9]+)m/gm, "");
683
683
  }
684
684
  let G = [];
685
- const we = /* @__PURE__ */ Object.assign({ "./commands/cat.ts": () => import("./cat-Dp7MxLJO.js"), "./commands/cd.ts": () => import("./cd-zk1UnOo7.js"), "./commands/clear.ts": () => import("./clear-DtYBxmDr.js"), "./commands/cmatrix.ts": () => import("./cmatrix-O49Zkqb8.js"), "./commands/compgen.ts": () => import("./compgen-CA_GMRpy.js"), "./commands/cowsay.ts": () => import("./cowsay-BAYsU72K.js"), "./commands/dir.ts": () => import("./dir-BlrznBqV.js"), "./commands/echo.ts": () => import("./echo-PyZ6XYF6.js"), "./commands/exit.ts": () => import("./exit-CizX3N_u.js"), "./commands/fortune.ts": () => import("./fortune-DNnPar5a.js"), "./commands/help.ts": () => import("./help-CYIno6WY.js"), "./commands/hostname.ts": () => import("./hostname-BBOQWx6L.js"), "./commands/lolcat.ts": () => import("./lolcat-LdzLGQur.js"), "./commands/ls.ts": () => import("./ls-Csd6ypmW.js"), "./commands/make.ts": () => import("./make-DOc--PtL.js"), "./commands/man.ts": () => import("./man-CZoHwxyo.js"), "./commands/mkdir.ts": () => import("./mkdir-BTSAC1PK.js"), "./commands/neofetch.ts": () => import("./neofetch-KcdwHJSJ.js"), "./commands/pwd.ts": () => import("./pwd-CSapfDtw.js"), "./commands/reboot.ts": () => import("./reboot-Bwxhoa8q.js"), "./commands/reload.ts": () => import("./reload-zi8L0xNG.js"), "./commands/rev.ts": () => import("./rev-C8qQIyj_.js"), "./commands/rm.ts": () => import("./rm-KQ9gM6fT.js"), "./commands/rmdir.ts": () => import("./rmdir-UqUqHZTI.js"), "./commands/sl.ts": () => import("./sl-BOyfa7Iu.js"), "./commands/touch.ts": () => import("./touch-D_kKTiUQ.js"), "./commands/uptime.ts": () => import("./uptime-BYmCcOUM.js"), "./commands/whatis.ts": () => import("./whatis-CYD52uq2.js"), "./commands/whoami.ts": () => import("./whoami-CQNGmqxL.js") }), Ce = () => {
685
+ const we = /* @__PURE__ */ Object.assign({ "./commands/cat.ts": () => import("./cat-FW5-WCC9.js"), "./commands/cd.ts": () => import("./cd-CJ_-Ao6a.js"), "./commands/clear.ts": () => import("./clear-DtYBxmDr.js"), "./commands/cmatrix.ts": () => import("./cmatrix-Dp2xw_1D.js"), "./commands/compgen.ts": () => import("./compgen-yV_rUCTl.js"), "./commands/cowsay.ts": () => import("./cowsay-DhGebg2w.js"), "./commands/dir.ts": () => import("./dir-BlrznBqV.js"), "./commands/echo.ts": () => import("./echo-PyZ6XYF6.js"), "./commands/eval.ts": () => import("./eval-CnKC-mrj.js"), "./commands/exit.ts": () => import("./exit-CizX3N_u.js"), "./commands/fortune.ts": () => import("./fortune-DNnPar5a.js"), "./commands/help.ts": () => import("./help-K3OSEH-4.js"), "./commands/hostname.ts": () => import("./hostname-BBOQWx6L.js"), "./commands/lolcat.ts": () => import("./lolcat-e6AdhtPY.js"), "./commands/ls.ts": () => import("./ls-Cv8zACh_.js"), "./commands/make.ts": () => import("./make-Cr6zPi10.js"), "./commands/man.ts": () => import("./man-B0gSJec-.js"), "./commands/mkdir.ts": () => import("./mkdir-BTSAC1PK.js"), "./commands/neofetch.ts": () => import("./neofetch-Cq2qUtOn.js"), "./commands/pwd.ts": () => import("./pwd-CSapfDtw.js"), "./commands/reboot.ts": () => import("./reboot-Bwxhoa8q.js"), "./commands/reload.ts": () => import("./reload-BMeeiK59.js"), "./commands/rev.ts": () => import("./rev-C8qQIyj_.js"), "./commands/rm.ts": () => import("./rm-DrsNwyIE.js"), "./commands/rmdir.ts": () => import("./rmdir-BZAP4H6B.js"), "./commands/sl.ts": () => import("./sl-iFJMGBu9.js"), "./commands/touch.ts": () => import("./touch-4AvKZiqp.js"), "./commands/uptime.ts": () => import("./uptime-BYmCcOUM.js"), "./commands/whatis.ts": () => import("./whatis-iNlzdd4F.js"), "./commands/whoami.ts": () => import("./whoami-CQNGmqxL.js") }), Ce = () => {
686
686
  G = [];
687
687
  for (const e in we)
688
688
  we[e]().then((t) => {
@@ -714,15 +714,15 @@ const B = class B {
714
714
  W(B, "COMMANDS", G);
715
715
  let ee = B;
716
716
  function ct({ app: e, path: t, input: n, setTitle: s, close: f, active: y, focus: i }) {
717
- const u = He(), [c, o] = S(0), [r, d] = S(n ?? ""), [a, v] = S([{
717
+ const u = He(), [c, o] = S(0), [r, _] = S(n ?? ""), [a, v] = S([{
718
718
  text: e ? ye.replace("$APP_NAME", e.name) : ye,
719
719
  isInput: !1
720
- }]), k = Re(), [g, E] = S(k == null ? void 0 : k.navigate(t ?? "~")), $ = de(null), [M, D] = S(0), [T, K] = S(null), [X, ne] = S(null), H = de(null), [re, ie] = S(!1), Ee = je();
720
+ }]), k = Re(), [h, $] = S(k == null ? void 0 : k.navigate(t ?? "~")), O = de(null), [M, D] = S(0), [T, K] = S(null), [X, ne] = S(null), H = de(null), [re, ie] = S(!1), Ee = je();
721
721
  q(() => {
722
- g != null && (s == null || s(`${U}@${Y}: ${g.root ? "/" : g.path}`));
723
- }, [g == null ? void 0 : g.path, g == null ? void 0 : g.root, s]), q(() => {
724
- !$.current || !y || $.current.focus();
725
- }, [$, y]);
722
+ h != null && (s == null || s(`${U}@${Y}: ${h.root ? "/" : h.path}`));
723
+ }, [h == null ? void 0 : h.path, h == null ? void 0 : h.root, s]), q(() => {
724
+ !O.current || !y || O.current.focus();
725
+ }, [O, y]);
726
726
  const ae = () => {
727
727
  H.current.scrollTop = H.current.scrollHeight;
728
728
  };
@@ -731,7 +731,7 @@ function ct({ app: e, path: t, input: n, setTitle: s, close: f, active: y, focus
731
731
  }, [re, X, H]), q(() => {
732
732
  H.current == null || T != null || ae();
733
733
  }, [r]);
734
- const oe = `${b.fg.cyan + U}@${Y + b.reset}:${b.fg.blue + (g != null && g.root || g == null ? "/" : g == null ? void 0 : g.path) + b.reset}$ `, le = a, Q = (l) => {
734
+ const oe = `${b.fg.cyan + U}@${Y + b.reset}:${b.fg.blue + (h != null && h.root || h == null ? "/" : h == null ? void 0 : h.path) + b.reset}$ `, le = a, Q = (l) => {
735
735
  le.push(l), v(le);
736
736
  }, J = (l) => {
737
737
  Q({
@@ -740,13 +740,13 @@ function ct({ app: e, path: t, input: n, setTitle: s, close: f, active: y, focus
740
740
  });
741
741
  }, $e = (l, p) => {
742
742
  K(l), ie(!1);
743
- const h = (_) => {
744
- y && (_.ctrlKey || _.metaKey) && _.key === "c" && l.stop();
743
+ const g = (d) => {
744
+ y && (d.ctrlKey || d.metaKey) && d.key === "c" && l.stop();
745
745
  };
746
746
  let m = null;
747
- l.on(P.EVENT_NAMES.new, (_) => {
747
+ l.on(P.EVENT_NAMES.new, (d) => {
748
748
  (async () => {
749
- let w = _;
749
+ let w = d;
750
750
  for (const I of p)
751
751
  w instanceof P || (w = await ce(w ? `${I} ${w}` : I));
752
752
  if (w instanceof P) {
@@ -756,54 +756,55 @@ function ct({ app: e, path: t, input: n, setTitle: s, close: f, active: y, focus
756
756
  m = w, ne(w);
757
757
  })();
758
758
  }), l.on(P.EVENT_NAMES.stop, () => {
759
- document.removeEventListener("keydown", h), J(m), K(null), ne(null);
760
- }), document.addEventListener("keydown", h);
759
+ document.removeEventListener("keydown", g), J(m), K(null), ne(null);
760
+ }), document.addEventListener("keydown", g);
761
761
  }, ce = async (l) => {
762
- var ge;
763
- const p = l.indexOf(" ") + 1, h = p <= 0 ? "" : l.substr(p), m = Date.now();
762
+ var he;
763
+ const p = l.indexOf(" ") + 1, g = p <= 0 ? "" : l.substr(p), m = Date.now();
764
764
  if (l = l.trim(), l === "") return;
765
- const _ = l.match(/(?:[^\s"]+|"[^"]*")+/g);
766
- if (_ == null) return;
767
- _[0].toLowerCase() === "sudo" && _.length >= 2 && _.shift();
768
- const w = (ge = _.shift()) == null ? void 0 : ge.toLowerCase();
765
+ let d = l.match(/(?:[^\s"]+|"[^"]*")+/g);
766
+ if (d == null) return;
767
+ d[0].toLowerCase() === "sudo" && d.length >= 2 && d.shift();
768
+ const w = (he = d.shift()) == null ? void 0 : he.toLowerCase();
769
769
  if (w == null) return;
770
770
  const I = ee.find(w);
771
771
  if (!I) return F(w, "Command not found");
772
+ d = d.map((C) => C.startsWith('"') && C.endsWith('"') ? C.slice(1, -1) : C);
772
773
  const R = [], fe = {};
773
- if (_.filter((O) => O.startsWith("-")).forEach((O) => {
774
- const he = (x) => {
774
+ if (d.filter((C) => C.startsWith("-")).forEach((C) => {
775
+ const ge = (x) => {
775
776
  if (R.includes(x))
776
777
  return;
777
778
  R.push(x);
778
779
  const j = I.getOption(R[R.length - 1]);
779
780
  if (j != null && j.isInput) {
780
- const me = _[_.indexOf(O) + 1];
781
- fe[j.short] = me, pe(me, _);
781
+ const me = d[d.indexOf(C) + 1];
782
+ fe[j.short] = me, pe(me, d);
782
783
  }
783
784
  };
784
- if (O.startsWith("--")) {
785
- const x = O.substring(2).toLowerCase();
786
- he(x);
785
+ if (C.startsWith("--")) {
786
+ const x = C.substring(2).toLowerCase();
787
+ ge(x);
787
788
  } else
788
- O.substring(1).split("").forEach((j) => {
789
- he(j);
789
+ C.substring(1).split("").forEach((j) => {
790
+ ge(j);
790
791
  });
791
- pe(O, _);
792
- }), I.requireArgs && _.length === 0)
792
+ pe(C, d);
793
+ }), I.requireArgs && d.length === 0)
793
794
  return F(w, `Incorrect usage: ${w} requires at least 1 argument`);
794
795
  if (I.requireOptions && R.length === 0)
795
796
  return F(w, `Incorrect usage: ${w} requires at least 1 option`);
796
797
  let V = null;
797
798
  try {
798
- if (V = await I.execute(_, {
799
+ if (V = await I.execute(d, {
799
800
  promptOutput: J,
800
801
  pushHistory: Q,
801
802
  virtualRoot: k,
802
- currentDirectory: g,
803
- setCurrentDirectory: E,
803
+ currentDirectory: h,
804
+ setCurrentDirectory: $,
804
805
  username: U,
805
806
  hostname: Y,
806
- rawInputValue: h,
807
+ rawInputValue: g,
807
808
  options: R,
808
809
  exit: f,
809
810
  inputs: fe,
@@ -815,11 +816,11 @@ function ct({ app: e, path: t, input: n, setTitle: s, close: f, active: y, focus
815
816
  return F(w, "Command failed");
816
817
  if (!V.blank)
817
818
  return V;
818
- } catch (O) {
819
- return console.error(O), F(w, "Command failed");
819
+ } catch (C) {
820
+ return console.error(C), F(w, "Command failed");
820
821
  }
821
822
  }, Oe = () => {
822
- d(""), D(0);
823
+ _(""), D(0);
823
824
  }, Se = async (l) => {
824
825
  Q({
825
826
  text: oe + l,
@@ -827,35 +828,35 @@ function ct({ app: e, path: t, input: n, setTitle: s, close: f, active: y, focus
827
828
  value: l
828
829
  });
829
830
  let p = l.split(" | ");
830
- const h = [];
831
+ const g = [];
831
832
  let m = null;
832
- for (const _ of p)
833
- m instanceof P || (m = await ce(m ? `${_} ${m}` : _), h.push(_));
834
- Oe(), p = p.filter((_) => !h.includes(_)), m && (m instanceof P ? $e(m, p) : J(`${m}
833
+ for (const d of p)
834
+ m instanceof P || (m = await ce(m ? `${d} ${m}` : d), g.push(d));
835
+ Oe(), p = p.filter((d) => !g.includes(d)), m && (m instanceof P ? $e(m, p) : J(`${m}
835
836
  `));
836
837
  }, ue = (l) => {
837
- const p = a.filter(({ isInput: m }) => m), h = xe(M + l, 0, p.length);
838
- if (h === M) {
839
- l < 0 && d("");
838
+ const p = a.filter(({ isInput: m }) => m), g = xe(M + l, 0, p.length);
839
+ if (g === M) {
840
+ l < 0 && _("");
840
841
  return;
841
842
  }
842
- d(h === 0 ? "" : p[p.length - h].value ?? ""), D(h);
843
+ _(g === 0 ? "" : p[p.length - g].value ?? ""), D(g);
843
844
  }, Te = (l) => {
844
- const p = l.target.value, { key: h } = l;
845
- h === "Enter" ? (Se(p), o((m) => m + 1)) : h === "ArrowUp" ? (l.preventDefault(), ue(1)) : h === "ArrowDown" ? (l.preventDefault(), ue(-1)) : !T && (l.ctrlKey || l.metaKey) && h === "c" && d((m) => m + "^C");
845
+ const p = l.target.value, { key: g } = l;
846
+ g === "Enter" ? (Se(p), o((m) => m + 1)) : g === "ArrowUp" ? (l.preventDefault(), ue(1)) : g === "ArrowDown" ? (l.preventDefault(), ue(-1)) : !T && (l.ctrlKey || l.metaKey) && g === "c" && _((m) => m + "^C");
846
847
  }, Ie = (l) => {
847
848
  const p = l.target.value;
848
- return d(p);
849
+ return _(p);
849
850
  }, Ae = () => {
850
851
  const l = a.slice(-16);
851
852
  let p = 0;
852
- return l.forEach((h, m) => {
853
- h.clear && (p = m + 1);
854
- }), l.slice(p).map(({ text: h }, m) => /* @__PURE__ */ L(ve, { text: h }, m));
853
+ return l.forEach((g, m) => {
854
+ g.clear && (p = m + 1);
855
+ }), l.slice(p).map(({ text: g }, m) => /* @__PURE__ */ L(ve, { text: g }, m));
855
856
  }, Le = (l) => {
856
- var p, h;
857
- i == null || i(l), l.button === 2 && (l.preventDefault(), (h = (p = navigator.clipboard).readText) == null || h.call(p).then((m) => {
858
- d(r + m);
857
+ var p, g;
858
+ i == null || i(l), l.button === 2 && (l.preventDefault(), (g = (p = navigator.clipboard).readText) == null || g.call(p).then((m) => {
859
+ _(r + m);
859
860
  }).catch((m) => {
860
861
  console.error(m);
861
862
  }));
@@ -870,8 +871,8 @@ function ct({ app: e, path: t, input: n, setTitle: s, close: f, active: y, focus
870
871
  onMouseDown: Le,
871
872
  onContextMenu: Ne,
872
873
  onClick: (l) => {
873
- var p, h;
874
- ((p = window.getSelection()) == null ? void 0 : p.toString()) === "" && (l.preventDefault(), (h = $.current) == null || h.focus());
874
+ var p, g;
875
+ ((p = window.getSelection()) == null ? void 0 : p.toString()) === "" && (l.preventDefault(), (g = O.current) == null || g.focus());
875
876
  },
876
877
  children: [
877
878
  Ae(),
@@ -882,7 +883,7 @@ function ct({ app: e, path: t, input: n, setTitle: s, close: f, active: y, focus
882
883
  prefix: oe,
883
884
  onKeyDown: Te,
884
885
  onChange: Ie,
885
- inputRef: $
886
+ inputRef: O
886
887
  },
887
888
  c
888
889
  )
@@ -892,7 +893,7 @@ function ct({ app: e, path: t, input: n, setTitle: s, close: f, active: y, focus
892
893
  }
893
894
  const _t = new Fe("Terminal", "terminal", ct).setIconUrl("https://os.prozilla.dev/assets/apps/icons/terminal.svg").setRole(Je.APP_ROLES.Terminal);
894
895
  export {
895
- C as A,
896
+ E as A,
896
897
  ee as C,
897
898
  mt as M,
898
899
  P as S,
@@ -901,4 +902,4 @@ export {
901
902
  dt as r,
902
903
  _t as t
903
904
  };
904
- //# sourceMappingURL=main-tAp_mbfZ.js.map
905
+ //# sourceMappingURL=main-BY8DgnTe.js.map