@prozilla-os/terminal 1.1.17 → 1.1.20
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/LICENSE +20 -20
- package/README.md +85 -85
- package/dist/chunks/cat-DGK7wWrK.js +16 -0
- package/dist/chunks/{cat-F1pnUhWr.js.map → cat-DGK7wWrK.js.map} +1 -1
- package/dist/chunks/{cd-SY_-kgyu.js → cd-DvjkW_6o.js} +5 -6
- package/dist/chunks/{cd-SY_-kgyu.js.map → cd-DvjkW_6o.js.map} +1 -1
- package/dist/chunks/{clear-DtYBxmDr.js → clear-BF9eb1Dq.js} +2 -2
- package/dist/chunks/{clear-DtYBxmDr.js.map → clear-BF9eb1Dq.js.map} +1 -1
- package/dist/chunks/{cmatrix-BI2_Y5OW.js → cmatrix-VYovsHQW.js} +4 -5
- package/dist/chunks/{cmatrix-BI2_Y5OW.js.map → cmatrix-VYovsHQW.js.map} +1 -1
- package/dist/chunks/compgen-3TwdgHm_.js +13 -0
- package/dist/chunks/{compgen-7prOo2oi.js.map → compgen-3TwdgHm_.js.map} +1 -1
- package/dist/chunks/{cowsay-B6TRoqbg.js → cowsay-IfArfPSJ.js} +4 -5
- package/dist/chunks/{cowsay-B6TRoqbg.js.map → cowsay-IfArfPSJ.js.map} +1 -1
- package/dist/chunks/{dir-BlrznBqV.js → dir-B_Ipo5xb.js} +2 -2
- package/dist/chunks/{dir-BlrznBqV.js.map → dir-B_Ipo5xb.js.map} +1 -1
- package/dist/chunks/{echo-PyZ6XYF6.js → echo-DX-Ar2Ut.js} +2 -2
- package/dist/chunks/{echo-PyZ6XYF6.js.map → echo-DX-Ar2Ut.js.map} +1 -1
- package/dist/chunks/{eval-CnKC-mrj.js → eval-C7InkmFY.js} +2 -2
- package/dist/chunks/eval-C7InkmFY.js.map +1 -0
- package/dist/chunks/{exit-CizX3N_u.js → exit-D7PPqtiE.js} +2 -2
- package/dist/chunks/{exit-CizX3N_u.js.map → exit-D7PPqtiE.js.map} +1 -1
- package/dist/chunks/{fortune-Cs0PtMgs.js → fortune-zyxpnYNP.js} +2 -2
- package/dist/chunks/{fortune-Cs0PtMgs.js.map → fortune-zyxpnYNP.js.map} +1 -1
- package/dist/chunks/{help-BUCTSaeJ.js → help-BEgNbwLL.js} +8 -9
- package/dist/chunks/help-BEgNbwLL.js.map +1 -0
- package/dist/chunks/{hostname-BBOQWx6L.js → hostname-DU1lQde2.js} +2 -2
- package/dist/chunks/{hostname-BBOQWx6L.js.map → hostname-DU1lQde2.js.map} +1 -1
- package/dist/chunks/lolcat-5-mBWD9l.js +35 -0
- package/dist/chunks/{lolcat-DiLqxxCO.js.map → lolcat-5-mBWD9l.js.map} +1 -1
- package/dist/chunks/{ls-DScdmJPT.js → ls-DnkSPHVM.js} +4 -5
- package/dist/chunks/{ls-DScdmJPT.js.map → ls-DnkSPHVM.js.map} +1 -1
- package/dist/chunks/{main-CkpVfeUg.js → main-CXiltWT-.js} +382 -332
- package/dist/chunks/main-CXiltWT-.js.map +1 -0
- package/dist/chunks/{make-D_hXz4-L.js → make-DqVQDThH.js} +2 -3
- package/dist/chunks/make-DqVQDThH.js.map +1 -0
- package/dist/chunks/{man-C2UviS5N.js → man-D_hBUTDt.js} +4 -5
- package/dist/chunks/{man-C2UviS5N.js.map → man-D_hBUTDt.js.map} +1 -1
- package/dist/chunks/{mkdir-BTSAC1PK.js → mkdir-BCvMrPTX.js} +2 -2
- package/dist/chunks/{mkdir-BTSAC1PK.js.map → mkdir-BCvMrPTX.js.map} +1 -1
- package/dist/chunks/{neofetch-Bq355NBE.js → neofetch-BFHOITJj.js} +10 -11
- package/dist/chunks/neofetch-BFHOITJj.js.map +1 -0
- package/dist/chunks/{pwd-CSapfDtw.js → pwd-C21tQanw.js} +2 -2
- package/dist/chunks/{pwd-CSapfDtw.js.map → pwd-C21tQanw.js.map} +1 -1
- package/dist/chunks/{reboot-Bwxhoa8q.js → reboot-C2t7a3Av.js} +2 -2
- package/dist/chunks/{reboot-Bwxhoa8q.js.map → reboot-C2t7a3Av.js.map} +1 -1
- package/dist/chunks/reload-C9o_dGZw.js +10 -0
- package/dist/chunks/reload-C9o_dGZw.js.map +1 -0
- package/dist/chunks/{rev-C8qQIyj_.js → rev-CBibYebM.js} +2 -2
- package/dist/chunks/{rev-C8qQIyj_.js.map → rev-CBibYebM.js.map} +1 -1
- package/dist/chunks/rm-ChTrwld4.js +12 -0
- package/dist/chunks/{rm-BwOe-Kq2.js.map → rm-ChTrwld4.js.map} +1 -1
- package/dist/chunks/rmdir-CUM4xt2w.js +11 -0
- package/dist/chunks/{rmdir-B9pGhEAU.js.map → rmdir-CUM4xt2w.js.map} +1 -1
- package/dist/chunks/{sl-DaCRRvuh.js → sl-DrATMkz6.js} +4 -5
- package/dist/chunks/{sl-DaCRRvuh.js.map → sl-DrATMkz6.js.map} +1 -1
- package/dist/chunks/touch-CqBIAjMe.js +19 -0
- package/dist/chunks/{touch-x95bWUyt.js.map → touch-CqBIAjMe.js.map} +1 -1
- package/dist/chunks/{uptime-BYmCcOUM.js → uptime-xM-0FRzA.js} +2 -2
- package/dist/chunks/{uptime-BYmCcOUM.js.map → uptime-xM-0FRzA.js.map} +1 -1
- package/dist/chunks/whatis-vXemLo9m.js +13 -0
- package/dist/chunks/{whatis-DL62XQIi.js.map → whatis-vXemLo9m.js.map} +1 -1
- package/dist/chunks/{whoami-CQNGmqxL.js → whoami-CnUR69yX.js} +2 -2
- package/dist/chunks/{whoami-CQNGmqxL.js.map → whoami-CnUR69yX.js.map} +1 -1
- package/dist/main.d.ts +101 -1
- package/dist/main.js +6 -3
- package/dist/main.js.map +1 -1
- package/package.json +4 -4
- package/dist/chunks/cat-F1pnUhWr.js +0 -17
- package/dist/chunks/command-nBL1aO7T.js +0 -43
- package/dist/chunks/command-nBL1aO7T.js.map +0 -1
- package/dist/chunks/compgen-7prOo2oi.js +0 -14
- package/dist/chunks/eval-CnKC-mrj.js.map +0 -1
- package/dist/chunks/help-BUCTSaeJ.js.map +0 -1
- package/dist/chunks/lolcat-DiLqxxCO.js +0 -36
- package/dist/chunks/main-CkpVfeUg.js.map +0 -1
- package/dist/chunks/make-D_hXz4-L.js.map +0 -1
- package/dist/chunks/neofetch-Bq355NBE.js.map +0 -1
- package/dist/chunks/reload-CnQb5yj-.js +0 -11
- package/dist/chunks/reload-CnQb5yj-.js.map +0 -1
- package/dist/chunks/rm-BwOe-Kq2.js +0 -13
- package/dist/chunks/rmdir-B9pGhEAU.js +0 -12
- package/dist/chunks/touch-x95bWUyt.js +0 -20
- package/dist/chunks/whatis-DL62XQIi.js +0 -14
|
@@ -1,64 +1,68 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
import { useSystemManager as De, useVirtualRoot as Re, useSettingsManager as He, App as xe, AppsConfig as je } from "@prozilla-os/core";
|
|
5
|
-
import { jsx as L, jsxs as Y } from "react/jsx-runtime";
|
|
6
|
-
import * as q from "react";
|
|
7
|
-
import { forwardRef as Fe, useState as S, useRef as pe, useEffect as z } from "react";
|
|
8
|
-
import { ANSI as b, EventEmitter as Je, clamp as Ve, removeFromArray as de } from "@prozilla-os/shared";
|
|
9
|
-
const We = "_Terminal_1l267_1", ze = "_Prefix_1l267_51", qe = "_Input_1l267_63", Ge = "_Output_1l267_63", Be = "_blink_1l267_1", N = {
|
|
10
|
-
Terminal: We,
|
|
11
|
-
Prefix: ze,
|
|
12
|
-
Input: qe,
|
|
13
|
-
Output: Ge,
|
|
14
|
-
"Input-container": "_Input-container_1l267_93",
|
|
15
|
-
blink: Be,
|
|
16
|
-
"ansi-black-fg": "_ansi-black-fg_1l267_197",
|
|
17
|
-
"ansi-red-fg": "_ansi-red-fg_1l267_199",
|
|
18
|
-
"ansi-green-fg": "_ansi-green-fg_1l267_201",
|
|
19
|
-
"ansi-yellow-fg": "_ansi-yellow-fg_1l267_203",
|
|
20
|
-
"ansi-blue-fg": "_ansi-blue-fg_1l267_205",
|
|
21
|
-
"ansi-magenta-fg": "_ansi-magenta-fg_1l267_207",
|
|
22
|
-
"ansi-cyan-fg": "_ansi-cyan-fg_1l267_209",
|
|
23
|
-
"ansi-white-fg": "_ansi-white-fg_1l267_211",
|
|
24
|
-
"ansi-bright-black-fg": "_ansi-bright-black-fg_1l267_215",
|
|
25
|
-
"ansi-bright-red-fg": "_ansi-bright-red-fg_1l267_217",
|
|
26
|
-
"ansi-bright-green-fg": "_ansi-bright-green-fg_1l267_219",
|
|
27
|
-
"ansi-bright-yellow-fg": "_ansi-bright-yellow-fg_1l267_221",
|
|
28
|
-
"ansi-bright-blue-fg": "_ansi-bright-blue-fg_1l267_223",
|
|
29
|
-
"ansi-bright-magenta-fg": "_ansi-bright-magenta-fg_1l267_225",
|
|
30
|
-
"ansi-bright-cyan-fg": "_ansi-bright-cyan-fg_1l267_227",
|
|
31
|
-
"ansi-bright-white-fg": "_ansi-bright-white-fg_1l267_229",
|
|
32
|
-
"ansi-black-bg": "_ansi-black-bg_1l267_233",
|
|
33
|
-
"ansi-red-bg": "_ansi-red-bg_1l267_235",
|
|
34
|
-
"ansi-green-bg": "_ansi-green-bg_1l267_237",
|
|
35
|
-
"ansi-yellow-bg": "_ansi-yellow-bg_1l267_239",
|
|
36
|
-
"ansi-blue-bg": "_ansi-blue-bg_1l267_241",
|
|
37
|
-
"ansi-magenta-bg": "_ansi-magenta-bg_1l267_243",
|
|
38
|
-
"ansi-cyan-bg": "_ansi-cyan-bg_1l267_245",
|
|
39
|
-
"ansi-white-bg": "_ansi-white-bg_1l267_247",
|
|
40
|
-
"ansi-dim": "_ansi-dim_1l267_251"
|
|
1
|
+
var He = Object.defineProperty;
|
|
2
|
+
var pe = (t) => {
|
|
3
|
+
throw TypeError(t);
|
|
41
4
|
};
|
|
42
|
-
|
|
43
|
-
|
|
5
|
+
var je = (t, e, s) => e in t ? He(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
6
|
+
var S = (t, e, s) => je(t, typeof e != "symbol" ? e + "" : e, s), de = (t, e, s) => e.has(t) || pe("Cannot " + s);
|
|
7
|
+
var _e = (t, e, s) => (de(t, e, "read from private field"), s ? s.call(t) : e.get(t)), ve = (t, e, s) => e.has(t) ? pe("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), be = (t, e, s, n) => (de(t, e, "write to private field"), n ? n.call(t, s) : e.set(t, s), s);
|
|
8
|
+
import { useSystemManager as Fe, useVirtualRoot as qe, useSettingsManager as Je, App as Ve, AppsConfig as We } from "@prozilla-os/core";
|
|
9
|
+
import { jsx as N, jsxs as Y } from "react/jsx-runtime";
|
|
10
|
+
import * as G from "react";
|
|
11
|
+
import { forwardRef as ze, useState as T, useRef as ye, useEffect as z } from "react";
|
|
12
|
+
import { ANSI as v, EventEmitter as Ge, clamp as Be, removeFromArray as we } from "@prozilla-os/shared";
|
|
13
|
+
const Ke = "_Terminal_1n5va_1", Ue = "_Prefix_1n5va_26", Xe = "_Input_1n5va_32", Ze = "_Output_1n5va_32", Qe = "_blink_1n5va_1", M = {
|
|
14
|
+
Terminal: Ke,
|
|
15
|
+
Prefix: Ue,
|
|
16
|
+
Input: Xe,
|
|
17
|
+
Output: Ze,
|
|
18
|
+
"Input-container": "_Input-container_1n5va_47",
|
|
19
|
+
blink: Qe,
|
|
20
|
+
"ansi-black-fg": "_ansi-black-fg_1n5va_99",
|
|
21
|
+
"ansi-red-fg": "_ansi-red-fg_1n5va_100",
|
|
22
|
+
"ansi-green-fg": "_ansi-green-fg_1n5va_101",
|
|
23
|
+
"ansi-yellow-fg": "_ansi-yellow-fg_1n5va_102",
|
|
24
|
+
"ansi-blue-fg": "_ansi-blue-fg_1n5va_103",
|
|
25
|
+
"ansi-magenta-fg": "_ansi-magenta-fg_1n5va_104",
|
|
26
|
+
"ansi-cyan-fg": "_ansi-cyan-fg_1n5va_105",
|
|
27
|
+
"ansi-white-fg": "_ansi-white-fg_1n5va_106",
|
|
28
|
+
"ansi-bright-black-fg": "_ansi-bright-black-fg_1n5va_108",
|
|
29
|
+
"ansi-bright-red-fg": "_ansi-bright-red-fg_1n5va_109",
|
|
30
|
+
"ansi-bright-green-fg": "_ansi-bright-green-fg_1n5va_110",
|
|
31
|
+
"ansi-bright-yellow-fg": "_ansi-bright-yellow-fg_1n5va_111",
|
|
32
|
+
"ansi-bright-blue-fg": "_ansi-bright-blue-fg_1n5va_112",
|
|
33
|
+
"ansi-bright-magenta-fg": "_ansi-bright-magenta-fg_1n5va_113",
|
|
34
|
+
"ansi-bright-cyan-fg": "_ansi-bright-cyan-fg_1n5va_114",
|
|
35
|
+
"ansi-bright-white-fg": "_ansi-bright-white-fg_1n5va_115",
|
|
36
|
+
"ansi-black-bg": "_ansi-black-bg_1n5va_117",
|
|
37
|
+
"ansi-red-bg": "_ansi-red-bg_1n5va_118",
|
|
38
|
+
"ansi-green-bg": "_ansi-green-bg_1n5va_119",
|
|
39
|
+
"ansi-yellow-bg": "_ansi-yellow-bg_1n5va_120",
|
|
40
|
+
"ansi-blue-bg": "_ansi-blue-bg_1n5va_121",
|
|
41
|
+
"ansi-magenta-bg": "_ansi-magenta-bg_1n5va_122",
|
|
42
|
+
"ansi-cyan-bg": "_ansi-cyan-bg_1n5va_123",
|
|
43
|
+
"ansi-white-bg": "_ansi-white-bg_1n5va_124",
|
|
44
|
+
"ansi-dim": "_ansi-dim_1n5va_126"
|
|
45
|
+
};
|
|
46
|
+
function Ye(t) {
|
|
47
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
44
48
|
}
|
|
45
|
-
var
|
|
46
|
-
function e
|
|
47
|
-
for (var
|
|
48
|
-
var f = n
|
|
49
|
-
f.enumerable = f.enumerable || !1, f.configurable = !0, "value" in f && (f.writable = !0), Object.defineProperty(
|
|
49
|
+
var ke = /* @__PURE__ */ function() {
|
|
50
|
+
function t(e, s) {
|
|
51
|
+
for (var n = 0; n < s.length; n++) {
|
|
52
|
+
var f = s[n];
|
|
53
|
+
f.enumerable = f.enumerable || !1, f.configurable = !0, "value" in f && (f.writable = !0), Object.defineProperty(e, f.key, f);
|
|
50
54
|
}
|
|
51
55
|
}
|
|
52
|
-
return function(s, n
|
|
53
|
-
return
|
|
56
|
+
return function(e, s, n) {
|
|
57
|
+
return s && t(e.prototype, s), n && t(e, n), e;
|
|
54
58
|
};
|
|
55
59
|
}();
|
|
56
|
-
function
|
|
57
|
-
if (!(
|
|
60
|
+
function et(t, e) {
|
|
61
|
+
if (!(t instanceof e))
|
|
58
62
|
throw new TypeError("Cannot call a class as a function");
|
|
59
63
|
}
|
|
60
|
-
var
|
|
61
|
-
|
|
64
|
+
var L = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class: "ansi-red" }, { color: "0, 187, 0", class: "ansi-green" }, { color: "187, 187, 0", class: "ansi-yellow" }, { color: "0, 0, 187", class: "ansi-blue" }, { color: "187, 0, 187", class: "ansi-magenta" }, { color: "0, 187, 187", class: "ansi-cyan" }, { color: "255,255,255", class: "ansi-white" }], [{ color: "85, 85, 85", class: "ansi-bright-black" }, { color: "255, 85, 85", class: "ansi-bright-red" }, { color: "0, 255, 0", class: "ansi-bright-green" }, { color: "255, 255, 85", class: "ansi-bright-yellow" }, { color: "85, 85, 255", class: "ansi-bright-blue" }, { color: "255, 85, 255", class: "ansi-bright-magenta" }, { color: "85, 255, 255", class: "ansi-bright-cyan" }, { color: "255, 255, 255", class: "ansi-bright-white" }]], tt = /(https?:\/\/(?:[A-Za-z0-9#;/?:@=+$',_.!~*()[\]-]|&|%[A-Fa-f0-9]{2})+)/gm, st = function() {
|
|
65
|
+
ke(t, null, [{
|
|
62
66
|
key: "escapeForHtml",
|
|
63
67
|
/**
|
|
64
68
|
* Anser.escapeForHtml
|
|
@@ -73,8 +77,8 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
73
77
|
* @param {String} txt The input text (containing the ANSI snippets).
|
|
74
78
|
* @returns {String} The escaped html.
|
|
75
79
|
*/
|
|
76
|
-
value: function(
|
|
77
|
-
return new
|
|
80
|
+
value: function(s) {
|
|
81
|
+
return new t().escapeForHtml(s);
|
|
78
82
|
}
|
|
79
83
|
/**
|
|
80
84
|
* Anser.linkify
|
|
@@ -90,8 +94,8 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
90
94
|
*/
|
|
91
95
|
}, {
|
|
92
96
|
key: "linkify",
|
|
93
|
-
value: function(
|
|
94
|
-
return new
|
|
97
|
+
value: function(s) {
|
|
98
|
+
return new t().linkify(s);
|
|
95
99
|
}
|
|
96
100
|
/**
|
|
97
101
|
* Anser.ansiToHtml
|
|
@@ -119,8 +123,8 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
119
123
|
*/
|
|
120
124
|
}, {
|
|
121
125
|
key: "ansiToHtml",
|
|
122
|
-
value: function(
|
|
123
|
-
return new
|
|
126
|
+
value: function(s, n) {
|
|
127
|
+
return new t().ansiToHtml(s, n);
|
|
124
128
|
}
|
|
125
129
|
/**
|
|
126
130
|
* Anser.ansiToJson
|
|
@@ -134,8 +138,8 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
134
138
|
*/
|
|
135
139
|
}, {
|
|
136
140
|
key: "ansiToJson",
|
|
137
|
-
value: function(
|
|
138
|
-
return new
|
|
141
|
+
value: function(s, n) {
|
|
142
|
+
return new t().ansiToJson(s, n);
|
|
139
143
|
}
|
|
140
144
|
/**
|
|
141
145
|
* Anser.ansiToText
|
|
@@ -148,8 +152,8 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
148
152
|
*/
|
|
149
153
|
}, {
|
|
150
154
|
key: "ansiToText",
|
|
151
|
-
value: function(
|
|
152
|
-
return new
|
|
155
|
+
value: function(s) {
|
|
156
|
+
return new t().ansiToText(s);
|
|
153
157
|
}
|
|
154
158
|
/**
|
|
155
159
|
* Anser
|
|
@@ -160,18 +164,18 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
160
164
|
* @returns {Anser}
|
|
161
165
|
*/
|
|
162
166
|
}]);
|
|
163
|
-
function
|
|
164
|
-
|
|
167
|
+
function t() {
|
|
168
|
+
et(this, t), this.fg = this.bg = this.fg_truecolor = this.bg_truecolor = null, this.bright = 0, this.decorations = [];
|
|
165
169
|
}
|
|
166
|
-
return
|
|
170
|
+
return ke(t, [{
|
|
167
171
|
key: "setupPalette",
|
|
168
172
|
value: function() {
|
|
169
173
|
this.PALETTE_COLORS = [];
|
|
170
|
-
for (var
|
|
171
|
-
for (var
|
|
172
|
-
this.PALETTE_COLORS.push(
|
|
173
|
-
for (var f = [0, 95, 135, 175, 215, 255], y = function(a,
|
|
174
|
-
return f[a] + ", " + f[
|
|
174
|
+
for (var s = 0; s < 2; ++s)
|
|
175
|
+
for (var n = 0; n < 8; ++n)
|
|
176
|
+
this.PALETTE_COLORS.push(L[s][n].color);
|
|
177
|
+
for (var f = [0, 95, 135, 175, 215, 255], y = function(a, b, k) {
|
|
178
|
+
return f[a] + ", " + f[b] + ", " + f[k];
|
|
175
179
|
}, i = 0; i < 6; ++i)
|
|
176
180
|
for (var u = 0; u < 6; ++u)
|
|
177
181
|
for (var c = 0; c < 6; ++c)
|
|
@@ -190,9 +194,9 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
190
194
|
*/
|
|
191
195
|
}, {
|
|
192
196
|
key: "escapeForHtml",
|
|
193
|
-
value: function(
|
|
194
|
-
return
|
|
195
|
-
return
|
|
197
|
+
value: function(s) {
|
|
198
|
+
return s.replace(/[&<>\"]/gm, function(n) {
|
|
199
|
+
return n == "&" ? "&" : n == '"' ? """ : n == "<" ? "<" : n == ">" ? ">" : "";
|
|
196
200
|
});
|
|
197
201
|
}
|
|
198
202
|
/**
|
|
@@ -206,9 +210,9 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
206
210
|
*/
|
|
207
211
|
}, {
|
|
208
212
|
key: "linkify",
|
|
209
|
-
value: function(
|
|
210
|
-
return
|
|
211
|
-
return '<a href="' +
|
|
213
|
+
value: function(s) {
|
|
214
|
+
return s.replace(tt, function(n) {
|
|
215
|
+
return '<a href="' + n + '">' + n + "</a>";
|
|
212
216
|
});
|
|
213
217
|
}
|
|
214
218
|
/**
|
|
@@ -223,8 +227,8 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
223
227
|
*/
|
|
224
228
|
}, {
|
|
225
229
|
key: "ansiToHtml",
|
|
226
|
-
value: function(
|
|
227
|
-
return this.process(
|
|
230
|
+
value: function(s, n) {
|
|
231
|
+
return this.process(s, n, !0);
|
|
228
232
|
}
|
|
229
233
|
/**
|
|
230
234
|
* ansiToJson
|
|
@@ -238,8 +242,8 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
238
242
|
*/
|
|
239
243
|
}, {
|
|
240
244
|
key: "ansiToJson",
|
|
241
|
-
value: function(
|
|
242
|
-
return
|
|
245
|
+
value: function(s, n) {
|
|
246
|
+
return n = n || {}, n.json = !0, n.clearLine = !1, this.process(s, n, !0);
|
|
243
247
|
}
|
|
244
248
|
/**
|
|
245
249
|
* ansiToText
|
|
@@ -252,8 +256,8 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
252
256
|
*/
|
|
253
257
|
}, {
|
|
254
258
|
key: "ansiToText",
|
|
255
|
-
value: function(
|
|
256
|
-
return this.process(
|
|
259
|
+
value: function(s) {
|
|
260
|
+
return this.process(s, {}, !1);
|
|
257
261
|
}
|
|
258
262
|
/**
|
|
259
263
|
* process
|
|
@@ -271,15 +275,15 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
271
275
|
*/
|
|
272
276
|
}, {
|
|
273
277
|
key: "process",
|
|
274
|
-
value: function(
|
|
275
|
-
var y = this, i = this, u =
|
|
276
|
-
|
|
278
|
+
value: function(s, n, f) {
|
|
279
|
+
var y = this, i = this, u = s.split(/\033\[/), c = u.shift();
|
|
280
|
+
n == null && (n = {}), n.clearLine = /\r/.test(s);
|
|
277
281
|
var o = u.map(function(_) {
|
|
278
|
-
return y.processChunk(_,
|
|
282
|
+
return y.processChunk(_, n, f);
|
|
279
283
|
});
|
|
280
|
-
if (
|
|
284
|
+
if (n && n.json) {
|
|
281
285
|
var r = i.processChunkJson("");
|
|
282
|
-
return r.content = c, r.clearLine =
|
|
286
|
+
return r.content = c, r.clearLine = n.clearLine, o.unshift(r), n.remove_empty && (o = o.filter(function(_) {
|
|
283
287
|
return !_.isEmpty();
|
|
284
288
|
})), o;
|
|
285
289
|
} else
|
|
@@ -313,23 +317,23 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
313
317
|
*/
|
|
314
318
|
}, {
|
|
315
319
|
key: "processChunkJson",
|
|
316
|
-
value: function(
|
|
317
|
-
|
|
318
|
-
var y =
|
|
319
|
-
content:
|
|
320
|
+
value: function(s, n, f) {
|
|
321
|
+
n = typeof n > "u" ? {} : n;
|
|
322
|
+
var y = n.use_classes = typeof n.use_classes < "u" && n.use_classes, i = n.key = y ? "class" : "color", u = {
|
|
323
|
+
content: s,
|
|
320
324
|
fg: null,
|
|
321
325
|
bg: null,
|
|
322
326
|
fg_truecolor: null,
|
|
323
327
|
bg_truecolor: null,
|
|
324
328
|
isInverted: !1,
|
|
325
|
-
clearLine:
|
|
329
|
+
clearLine: n.clearLine,
|
|
326
330
|
decoration: null,
|
|
327
331
|
decorations: [],
|
|
328
332
|
was_processed: !1,
|
|
329
333
|
isEmpty: function() {
|
|
330
334
|
return !u.content;
|
|
331
335
|
}
|
|
332
|
-
}, c =
|
|
336
|
+
}, c = s.match(/^([!\x3c-\x3f]*)([\d;]*)([\x20-\x2c]*[\x40-\x7e])([\s\S]*)/m);
|
|
333
337
|
if (!c) return u;
|
|
334
338
|
u.content = c[4];
|
|
335
339
|
var o = c[2].split(";");
|
|
@@ -376,31 +380,31 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
376
380
|
else if (a === 49)
|
|
377
381
|
r.bg = null;
|
|
378
382
|
else if (a >= 30 && a < 38)
|
|
379
|
-
r.fg =
|
|
383
|
+
r.fg = L[0][a % 10][i];
|
|
380
384
|
else if (a >= 90 && a < 98)
|
|
381
|
-
r.fg =
|
|
385
|
+
r.fg = L[1][a % 10][i];
|
|
382
386
|
else if (a >= 40 && a < 48)
|
|
383
|
-
r.bg =
|
|
387
|
+
r.bg = L[0][a % 10][i];
|
|
384
388
|
else if (a >= 100 && a < 108)
|
|
385
|
-
r.bg =
|
|
389
|
+
r.bg = L[1][a % 10][i];
|
|
386
390
|
else if (a === 38 || a === 48) {
|
|
387
|
-
var
|
|
391
|
+
var b = a === 38;
|
|
388
392
|
if (o.length >= 1) {
|
|
389
393
|
var k = o.shift();
|
|
390
394
|
if (k === "5" && o.length >= 1) {
|
|
391
395
|
var h = parseInt(o.shift());
|
|
392
396
|
if (h >= 0 && h <= 255)
|
|
393
397
|
if (!y)
|
|
394
|
-
this.PALETTE_COLORS || r.setupPalette(),
|
|
398
|
+
this.PALETTE_COLORS || r.setupPalette(), b ? r.fg = this.PALETTE_COLORS[h] : r.bg = this.PALETTE_COLORS[h];
|
|
395
399
|
else {
|
|
396
|
-
var
|
|
397
|
-
|
|
400
|
+
var E = h >= 16 ? "ansi-palette-" + h : L[h > 7 ? 1 : 0][h % 8].class;
|
|
401
|
+
b ? r.fg = E : r.bg = E;
|
|
398
402
|
}
|
|
399
403
|
} else if (k === "2" && o.length >= 3) {
|
|
400
|
-
var
|
|
401
|
-
if (
|
|
402
|
-
var
|
|
403
|
-
y ?
|
|
404
|
+
var $ = parseInt(o.shift()), R = parseInt(o.shift()), D = parseInt(o.shift());
|
|
405
|
+
if ($ >= 0 && $ <= 255 && R >= 0 && R <= 255 && D >= 0 && D <= 255) {
|
|
406
|
+
var A = $ + ", " + R + ", " + D;
|
|
407
|
+
y ? b ? (r.fg = "ansi-truecolor", r.fg_truecolor = A) : (r.bg = "ansi-truecolor", r.bg_truecolor = A) : b ? r.fg = A : r.bg = A;
|
|
404
408
|
}
|
|
405
409
|
}
|
|
406
410
|
}
|
|
@@ -425,201 +429,201 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
425
429
|
*/
|
|
426
430
|
}, {
|
|
427
431
|
key: "processChunk",
|
|
428
|
-
value: function(
|
|
432
|
+
value: function(s, n, f) {
|
|
429
433
|
var y = this;
|
|
430
|
-
|
|
431
|
-
var i = this.processChunkJson(
|
|
432
|
-
if (i.decorations = i.decorations.filter(function(
|
|
433
|
-
if (
|
|
434
|
-
i.fg || (i.fg =
|
|
434
|
+
n = n || {};
|
|
435
|
+
var i = this.processChunkJson(s, n, f), u = n.use_classes;
|
|
436
|
+
if (i.decorations = i.decorations.filter(function(b) {
|
|
437
|
+
if (b === "reverse") {
|
|
438
|
+
i.fg || (i.fg = L[0][7][u ? "class" : "color"]), i.bg || (i.bg = L[0][0][u ? "class" : "color"]);
|
|
435
439
|
var k = i.fg;
|
|
436
440
|
i.fg = i.bg, i.bg = k;
|
|
437
441
|
var h = i.fg_truecolor;
|
|
438
442
|
return i.fg_truecolor = i.bg_truecolor, i.bg_truecolor = h, i.isInverted = !0, !1;
|
|
439
443
|
}
|
|
440
444
|
return !0;
|
|
441
|
-
}),
|
|
445
|
+
}), n.json)
|
|
442
446
|
return i;
|
|
443
447
|
if (i.isEmpty())
|
|
444
448
|
return "";
|
|
445
449
|
if (!i.was_processed)
|
|
446
450
|
return i.content;
|
|
447
451
|
var c = [], o = [], r = [], _ = {}, a = function(k) {
|
|
448
|
-
var h = [],
|
|
449
|
-
for (
|
|
450
|
-
k.hasOwnProperty(
|
|
452
|
+
var h = [], E = void 0;
|
|
453
|
+
for (E in k)
|
|
454
|
+
k.hasOwnProperty(E) && h.push("data-" + E + '="' + y.escapeForHtml(k[E]) + '"');
|
|
451
455
|
return h.length > 0 ? " " + h.join(" ") : "";
|
|
452
456
|
};
|
|
453
|
-
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(
|
|
457
|
+
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(b) {
|
|
454
458
|
if (u) {
|
|
455
|
-
o.push("ansi-" +
|
|
459
|
+
o.push("ansi-" + b);
|
|
456
460
|
return;
|
|
457
461
|
}
|
|
458
|
-
|
|
462
|
+
b === "bold" ? o.push("font-weight:bold") : b === "dim" ? o.push("opacity:0.5") : b === "italic" ? o.push("font-style:italic") : b === "hidden" ? o.push("visibility:hidden") : b === "strikethrough" ? r.push("line-through") : r.push(b);
|
|
459
463
|
}), 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>";
|
|
460
464
|
}
|
|
461
465
|
}, {
|
|
462
466
|
key: "removeDecoration",
|
|
463
|
-
value: function(
|
|
464
|
-
var
|
|
465
|
-
|
|
467
|
+
value: function(s) {
|
|
468
|
+
var n = this.decorations.indexOf(s);
|
|
469
|
+
n >= 0 && this.decorations.splice(n, 1);
|
|
466
470
|
}
|
|
467
|
-
}]),
|
|
468
|
-
}(),
|
|
469
|
-
const
|
|
470
|
-
var
|
|
471
|
-
function
|
|
472
|
-
if (!
|
|
473
|
-
if (!/\r/.test(
|
|
474
|
-
for (
|
|
475
|
-
`); /\r./.test(
|
|
476
|
-
|
|
477
|
-
return
|
|
471
|
+
}]), t;
|
|
472
|
+
}(), nt = st;
|
|
473
|
+
const rt = /* @__PURE__ */ Ye(nt);
|
|
474
|
+
var ee = { exports: {} };
|
|
475
|
+
function te(t) {
|
|
476
|
+
if (!t) return "";
|
|
477
|
+
if (!/\r/.test(t)) return t;
|
|
478
|
+
for (t = t.replace(/\r+\n/gm, `
|
|
479
|
+
`); /\r./.test(t); )
|
|
480
|
+
t = t.replace(/^([^\r\n]*)\r+([^\r\n]+)/gm, function(e, s, n) {
|
|
481
|
+
return n + s.slice(n.length);
|
|
478
482
|
});
|
|
479
|
-
return
|
|
483
|
+
return t;
|
|
480
484
|
}
|
|
481
|
-
function
|
|
482
|
-
for (var
|
|
483
|
-
e
|
|
484
|
-
return
|
|
485
|
+
function it(t) {
|
|
486
|
+
for (var e = 0, s = 0; s < t.length; s++)
|
|
487
|
+
t[e].length <= t[s].length && (e = s);
|
|
488
|
+
return e;
|
|
485
489
|
}
|
|
486
|
-
function
|
|
487
|
-
if (!/\r/.test(
|
|
488
|
-
for (var
|
|
489
|
-
var
|
|
490
|
-
|
|
490
|
+
function Ce(t) {
|
|
491
|
+
if (!/\r/.test(t)) return t;
|
|
492
|
+
for (var e = t.split("\r"), s = []; e.length > 0; ) {
|
|
493
|
+
var n = it(e);
|
|
494
|
+
s.push(e[n]), e = e.slice(n + 1);
|
|
491
495
|
}
|
|
492
|
-
return
|
|
496
|
+
return s.join("\r");
|
|
493
497
|
}
|
|
494
|
-
function
|
|
495
|
-
if (!
|
|
496
|
-
if (!/\r/.test(
|
|
497
|
-
if (!/\n/.test(
|
|
498
|
-
|
|
498
|
+
function at(t) {
|
|
499
|
+
if (!t) return "";
|
|
500
|
+
if (!/\r/.test(t)) return t;
|
|
501
|
+
if (!/\n/.test(t)) return Ce(t);
|
|
502
|
+
t = t.replace(/\r+\n/gm, `
|
|
499
503
|
`);
|
|
500
|
-
var
|
|
504
|
+
var e = t.lastIndexOf(`
|
|
501
505
|
`);
|
|
502
|
-
return
|
|
503
|
-
` +
|
|
506
|
+
return te(t.slice(0, e)) + `
|
|
507
|
+
` + Ce(t.slice(e + 1));
|
|
504
508
|
}
|
|
505
|
-
|
|
506
|
-
var
|
|
507
|
-
|
|
508
|
-
function
|
|
509
|
-
return
|
|
509
|
+
ee.exports = te;
|
|
510
|
+
var ot = ee.exports.escapeCarriageReturn = te;
|
|
511
|
+
ee.exports.escapeCarriageReturnSafe = at;
|
|
512
|
+
function lt(t, e) {
|
|
513
|
+
return t = ot(ht(t)), rt.ansiToJson(t, {
|
|
510
514
|
json: !0,
|
|
511
515
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
512
516
|
remove_empty: !0,
|
|
513
517
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
514
|
-
use_classes:
|
|
518
|
+
use_classes: e
|
|
515
519
|
});
|
|
516
520
|
}
|
|
517
|
-
function
|
|
518
|
-
const
|
|
519
|
-
return
|
|
521
|
+
function ct(t) {
|
|
522
|
+
const e = [];
|
|
523
|
+
return t.bg && e.push(M[`${t.bg}-bg`]), t.fg && e.push(M[`${t.fg}-fg`]), t.decoration && e.push(M[`ansi-${t.decoration}`]), e.length === 0 ? null : e.join(" ");
|
|
520
524
|
}
|
|
521
|
-
function
|
|
522
|
-
const
|
|
523
|
-
switch (
|
|
525
|
+
function ut(t) {
|
|
526
|
+
const e = {};
|
|
527
|
+
switch (t.bg && (e.backgroundColor = `rgb(${t.bg})`), t.fg && (e.color = `rgb(${t.fg})`), t.decoration) {
|
|
524
528
|
case "bold":
|
|
525
|
-
|
|
529
|
+
e.fontWeight = "bold";
|
|
526
530
|
break;
|
|
527
531
|
case "dim":
|
|
528
|
-
|
|
532
|
+
e.opacity = "0.5";
|
|
529
533
|
break;
|
|
530
534
|
case "italic":
|
|
531
|
-
|
|
535
|
+
e.fontStyle = "italic";
|
|
532
536
|
break;
|
|
533
537
|
case "hidden":
|
|
534
|
-
|
|
538
|
+
e.visibility = "hidden";
|
|
535
539
|
break;
|
|
536
540
|
case "strikethrough":
|
|
537
|
-
|
|
541
|
+
e.textDecoration = "line-through";
|
|
538
542
|
break;
|
|
539
543
|
case "underline":
|
|
540
|
-
|
|
544
|
+
e.textDecoration = "underline";
|
|
541
545
|
break;
|
|
542
546
|
case "blink":
|
|
543
|
-
|
|
547
|
+
e.textDecoration = "blink";
|
|
544
548
|
break;
|
|
545
549
|
}
|
|
546
|
-
return
|
|
550
|
+
return e;
|
|
547
551
|
}
|
|
548
|
-
function
|
|
549
|
-
const f =
|
|
550
|
-
if (!
|
|
551
|
-
return
|
|
552
|
+
function ft(t, e, s, n) {
|
|
553
|
+
const f = e ? null : ut(s), y = e ? ct(s) : null;
|
|
554
|
+
if (!t)
|
|
555
|
+
return G.createElement(
|
|
552
556
|
"pre",
|
|
553
|
-
{ style: f, key:
|
|
554
|
-
|
|
557
|
+
{ style: f, key: n, className: y },
|
|
558
|
+
s.content
|
|
555
559
|
);
|
|
556
560
|
const i = [], u = /(\s|^)(https?:\/\/(?:www\.|(?!www))[^\s.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/g;
|
|
557
561
|
let c = 0, o;
|
|
558
|
-
for (; (o = u.exec(
|
|
562
|
+
for (; (o = u.exec(s.content)) !== null; ) {
|
|
559
563
|
const [, r, _] = o, a = o.index + r.length;
|
|
560
|
-
a > c && i.push(
|
|
561
|
-
const
|
|
564
|
+
a > c && i.push(s.content.substring(c, a));
|
|
565
|
+
const b = _.startsWith("www.") ? `http://${_}` : _;
|
|
562
566
|
i.push(
|
|
563
|
-
|
|
567
|
+
G.createElement(
|
|
564
568
|
"a",
|
|
565
569
|
{
|
|
566
570
|
key: c,
|
|
567
|
-
href:
|
|
571
|
+
href: b,
|
|
568
572
|
target: "_blank"
|
|
569
573
|
},
|
|
570
574
|
`${_}`
|
|
571
575
|
)
|
|
572
576
|
), c = u.lastIndex;
|
|
573
577
|
}
|
|
574
|
-
return c <
|
|
578
|
+
return c < s.content.length && i.push(s.content.substring(c)), G.createElement("span", { style: f, key: n, className: y }, i);
|
|
575
579
|
}
|
|
576
|
-
function
|
|
577
|
-
const { className:
|
|
578
|
-
return
|
|
580
|
+
function Se(t) {
|
|
581
|
+
const { className: e, useClasses: s, children: n, linkify: f } = t;
|
|
582
|
+
return G.createElement(
|
|
579
583
|
"code",
|
|
580
|
-
{ className:
|
|
581
|
-
|
|
584
|
+
{ className: e },
|
|
585
|
+
lt(n ?? "", s ?? !1).map(
|
|
582
586
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
583
|
-
|
|
587
|
+
ft.bind(null, f ?? !1, s ?? !1)
|
|
584
588
|
)
|
|
585
589
|
);
|
|
586
590
|
}
|
|
587
|
-
function
|
|
588
|
-
let
|
|
591
|
+
function ht(t) {
|
|
592
|
+
let e = t;
|
|
589
593
|
do
|
|
590
|
-
|
|
591
|
-
while (
|
|
592
|
-
return
|
|
594
|
+
t = e, e = t.replace(/[^\n]\x08/gm, "");
|
|
595
|
+
while (e.length < t.length);
|
|
596
|
+
return t;
|
|
593
597
|
}
|
|
594
|
-
const
|
|
595
|
-
const
|
|
598
|
+
const Oe = ze(({ text: t }, e) => {
|
|
599
|
+
const s = t == null ? void 0 : t.split(`
|
|
596
600
|
`);
|
|
597
|
-
return /* @__PURE__ */
|
|
598
|
-
(
|
|
601
|
+
return /* @__PURE__ */ N("div", { ref: e, children: s == null ? void 0 : s.map(
|
|
602
|
+
(n, f) => /* @__PURE__ */ N(Se, { className: M.Output, useClasses: !0, children: n === "" ? " " : n }, f)
|
|
599
603
|
) });
|
|
600
604
|
});
|
|
601
|
-
function
|
|
602
|
-
const [i, u] =
|
|
605
|
+
function gt({ value: t, prefix: e, onChange: s, onKeyUp: n, onKeyDown: f, inputRef: y }) {
|
|
606
|
+
const [i, u] = T(0), c = () => {
|
|
603
607
|
var r;
|
|
604
608
|
const o = (r = y.current) == null ? void 0 : r.selectionStart;
|
|
605
609
|
o != null && u(o);
|
|
606
610
|
};
|
|
607
|
-
return /* @__PURE__ */ Y("span", { className:
|
|
608
|
-
|
|
609
|
-
/* @__PURE__ */ Y("span", { className:
|
|
610
|
-
/* @__PURE__ */
|
|
611
|
-
/* @__PURE__ */
|
|
611
|
+
return /* @__PURE__ */ Y("span", { className: M.Input, children: [
|
|
612
|
+
e && /* @__PURE__ */ N(Se, { className: M.Prefix, useClasses: !0, children: e }),
|
|
613
|
+
/* @__PURE__ */ Y("span", { className: M["Input-container"], style: { "--cursor-offset": i }, children: [
|
|
614
|
+
/* @__PURE__ */ N("span", { "aria-hidden": "true", children: t }),
|
|
615
|
+
/* @__PURE__ */ N(
|
|
612
616
|
"input",
|
|
613
617
|
{
|
|
614
618
|
id: "input",
|
|
615
|
-
value:
|
|
619
|
+
value: t,
|
|
616
620
|
"aria-label": "Command input",
|
|
617
621
|
onChange: (o) => {
|
|
618
|
-
|
|
622
|
+
s(o), c();
|
|
619
623
|
},
|
|
620
624
|
ref: y,
|
|
621
625
|
onKeyUp: (o) => {
|
|
622
|
-
|
|
626
|
+
n == null || n(o);
|
|
623
627
|
},
|
|
624
628
|
onKeyDown: (o) => {
|
|
625
629
|
f == null || f(o), c();
|
|
@@ -638,9 +642,9 @@ function lt({ value: e, prefix: s, onChange: n, onKeyUp: t, onKeyDown: f, inputR
|
|
|
638
642
|
] })
|
|
639
643
|
] });
|
|
640
644
|
}
|
|
641
|
-
const Z = "user", Q = "prozilla-os",
|
|
642
|
-
${
|
|
643
|
-
`,
|
|
645
|
+
const Z = "user", Q = "prozilla-os", kt = 50, Ee = `${v.fg.cyan + v.decoration.dim}$APP_NAME - Made by Prozilla${v.reset}
|
|
646
|
+
${v.decoration.dim}Type 'help' for a list of commands.${v.reset}
|
|
647
|
+
`, O = v.fg.cyan, Ct = `
|
|
644
648
|
:.
|
|
645
649
|
-==.
|
|
646
650
|
.=====:
|
|
@@ -648,98 +652,91 @@ ${b.decoration.dim}Type 'help' for a list of commands.${b.reset}
|
|
|
648
652
|
:===+=----------::..
|
|
649
653
|
=+=---------------:..
|
|
650
654
|
--------------------:.
|
|
651
|
-
.:-+=----${
|
|
652
|
-
:==+----${
|
|
653
|
-
.=----${
|
|
654
|
-
==----${
|
|
655
|
+
.:-+=----${v.fg.white}*###*${O}--${v.fg.white}*####=${O}---.
|
|
656
|
+
:==+----${v.fg.white}#%+${O}-${v.fg.white}+%#${O}-${v.fg.white}##%*+${O}----:.
|
|
657
|
+
.=----${v.fg.white}#%+${O}-${v.fg.white}+%#${O}-${v.fg.white}*+${O}-${v.fg.white}%#+${O}---:.
|
|
658
|
+
==----${v.fg.white}*###*${O}--${v.fg.white}*###*${O}----.
|
|
655
659
|
==+-------------------:.
|
|
656
660
|
...::---------------:.
|
|
657
661
|
.::---------::..
|
|
658
|
-
....::... `,
|
|
662
|
+
....::... `, mt = {
|
|
659
663
|
new: "new",
|
|
660
664
|
start: "start",
|
|
661
665
|
stop: "stop"
|
|
662
666
|
};
|
|
663
|
-
class P extends
|
|
667
|
+
class P extends Ge {
|
|
664
668
|
constructor() {
|
|
665
669
|
super(...arguments);
|
|
666
|
-
|
|
670
|
+
S(this, "enabled", !1);
|
|
667
671
|
}
|
|
668
|
-
start(
|
|
669
|
-
return this.enabled ? this : (
|
|
672
|
+
start(s) {
|
|
673
|
+
return this.enabled ? this : (s == null || s(this), this.enabled = !0, this.emit("start"), this);
|
|
670
674
|
}
|
|
671
675
|
stop() {
|
|
672
676
|
return this.enabled ? (this.enabled = !1, this.emit("stop"), this) : this;
|
|
673
677
|
}
|
|
674
|
-
send(
|
|
675
|
-
return this.enabled && this.emit("new",
|
|
678
|
+
send(s) {
|
|
679
|
+
return this.enabled && this.emit("new", s), this;
|
|
676
680
|
}
|
|
677
681
|
}
|
|
678
|
-
|
|
679
|
-
function
|
|
680
|
-
return `${
|
|
682
|
+
S(P, "EVENT_NAMES", mt);
|
|
683
|
+
function q(t, e) {
|
|
684
|
+
return `${v.fg.red}${t}: ${e}${v.reset}`;
|
|
681
685
|
}
|
|
682
|
-
function
|
|
683
|
-
return
|
|
686
|
+
function Ot(t) {
|
|
687
|
+
return t.replace(/\u001b\[([0-9]+)m/gm, "");
|
|
684
688
|
}
|
|
685
|
-
let
|
|
686
|
-
const
|
|
687
|
-
|
|
688
|
-
for (const
|
|
689
|
-
|
|
690
|
-
const
|
|
691
|
-
|
|
689
|
+
let B = [];
|
|
690
|
+
const $e = /* @__PURE__ */ Object.assign({ "./commands/cat.ts": () => import("./cat-DGK7wWrK.js"), "./commands/cd.ts": () => import("./cd-DvjkW_6o.js"), "./commands/clear.ts": () => import("./clear-BF9eb1Dq.js"), "./commands/cmatrix.ts": () => import("./cmatrix-VYovsHQW.js"), "./commands/compgen.ts": () => import("./compgen-3TwdgHm_.js"), "./commands/cowsay.ts": () => import("./cowsay-IfArfPSJ.js"), "./commands/dir.ts": () => import("./dir-B_Ipo5xb.js"), "./commands/echo.ts": () => import("./echo-DX-Ar2Ut.js"), "./commands/eval.ts": () => import("./eval-C7InkmFY.js"), "./commands/exit.ts": () => import("./exit-D7PPqtiE.js"), "./commands/fortune.ts": () => import("./fortune-zyxpnYNP.js"), "./commands/help.ts": () => import("./help-BEgNbwLL.js"), "./commands/history.ts": () => import("./history-l0sNRNKZ.js"), "./commands/hostname.ts": () => import("./hostname-DU1lQde2.js"), "./commands/lolcat.ts": () => import("./lolcat-5-mBWD9l.js"), "./commands/ls.ts": () => import("./ls-DnkSPHVM.js"), "./commands/make.ts": () => import("./make-DqVQDThH.js"), "./commands/man.ts": () => import("./man-D_hBUTDt.js"), "./commands/mkdir.ts": () => import("./mkdir-BCvMrPTX.js"), "./commands/neofetch.ts": () => import("./neofetch-BFHOITJj.js"), "./commands/pwd.ts": () => import("./pwd-C21tQanw.js"), "./commands/reboot.ts": () => import("./reboot-C2t7a3Av.js"), "./commands/reload.ts": () => import("./reload-C9o_dGZw.js"), "./commands/rev.ts": () => import("./rev-CBibYebM.js"), "./commands/rm.ts": () => import("./rm-ChTrwld4.js"), "./commands/rmdir.ts": () => import("./rmdir-CUM4xt2w.js"), "./commands/sl.ts": () => import("./sl-DrATMkz6.js"), "./commands/touch.ts": () => import("./touch-CqBIAjMe.js"), "./commands/uptime.ts": () => import("./uptime-xM-0FRzA.js"), "./commands/whatis.ts": () => import("./whatis-vXemLo9m.js"), "./commands/whoami.ts": () => import("./whoami-CnUR69yX.js") }), Te = () => {
|
|
691
|
+
B = [];
|
|
692
|
+
for (const t in $e)
|
|
693
|
+
$e[t]().then((e) => {
|
|
694
|
+
const s = Object.keys(e)[0], n = e[s];
|
|
695
|
+
n != null && (n.name || n.setName(s.toLowerCase()), B.push(n));
|
|
692
696
|
});
|
|
693
697
|
};
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
static
|
|
697
|
-
|
|
698
|
-
return this.COMMANDS.forEach((t) => {
|
|
699
|
-
if (t.name === s) {
|
|
700
|
-
n = t;
|
|
701
|
-
return;
|
|
702
|
-
}
|
|
703
|
-
}), n;
|
|
698
|
+
Te();
|
|
699
|
+
class se {
|
|
700
|
+
static addCommand(e) {
|
|
701
|
+
this.COMMANDS.push(e);
|
|
704
702
|
}
|
|
705
|
-
static
|
|
706
|
-
return this.COMMANDS.
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
703
|
+
static find(e) {
|
|
704
|
+
return this.COMMANDS.find((s) => s.name == e);
|
|
705
|
+
}
|
|
706
|
+
static search(e) {
|
|
707
|
+
return this.COMMANDS.filter((s) => s.name.match(e));
|
|
710
708
|
}
|
|
711
709
|
static reload() {
|
|
712
|
-
|
|
710
|
+
Te(), this.COMMANDS = B;
|
|
713
711
|
}
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
text: e ? ye.replace("$APP_NAME", e.name) : ye,
|
|
712
|
+
}
|
|
713
|
+
S(se, "COMMANDS", B);
|
|
714
|
+
function pt({ app: t, path: e, input: s, setTitle: n, close: f, active: y, focus: i }) {
|
|
715
|
+
const u = Fe(), [c, o] = T(0), [r, _] = T(s ?? ""), [a, b] = T([{
|
|
716
|
+
text: t ? Ee.replace("$APP_NAME", t.name) : Ee,
|
|
720
717
|
isInput: !1
|
|
721
|
-
}]), k =
|
|
718
|
+
}]), k = qe(), [h, E] = T(k == null ? void 0 : k.navigate(e ?? "~")), $ = ye(null), [R, D] = T(0), [A, K] = T(null), [U, ne] = T(null), x = ye(null), [re, ie] = T(!1), Ae = Je();
|
|
722
719
|
z(() => {
|
|
723
|
-
h != null && (
|
|
724
|
-
}, [h == null ? void 0 : h.path, h == null ? void 0 : h.root,
|
|
725
|
-
|
|
726
|
-
}, [
|
|
720
|
+
h != null && (n == null || n(`${Z}@${Q}: ${h.root ? "/" : h.path}`));
|
|
721
|
+
}, [h == null ? void 0 : h.path, h == null ? void 0 : h.root, n]), z(() => {
|
|
722
|
+
!$.current || !y || $.current.focus();
|
|
723
|
+
}, [$, y]);
|
|
727
724
|
const ae = () => {
|
|
728
|
-
|
|
725
|
+
x.current.scrollTop = x.current.scrollHeight;
|
|
729
726
|
};
|
|
730
727
|
z(() => {
|
|
731
|
-
re ||
|
|
732
|
-
}, [re, U,
|
|
733
|
-
|
|
728
|
+
re || x.current == null || U == null || (ae(), ie(!0));
|
|
729
|
+
}, [re, U, x]), z(() => {
|
|
730
|
+
x.current == null || A != null || ae();
|
|
734
731
|
}, [r]);
|
|
735
|
-
const oe = `${
|
|
736
|
-
le.push(l),
|
|
737
|
-
},
|
|
732
|
+
const oe = `${v.fg.cyan + Z}@${Q + v.reset}:${v.fg.blue + (h != null && h.root || h == null ? "/" : h == null ? void 0 : h.path) + v.reset}$ `, le = a, X = (l) => {
|
|
733
|
+
le.push(l), b(le);
|
|
734
|
+
}, V = (l) => {
|
|
738
735
|
X({
|
|
739
736
|
text: l,
|
|
740
737
|
isInput: !1
|
|
741
738
|
});
|
|
742
|
-
},
|
|
739
|
+
}, Ie = (l, p) => {
|
|
743
740
|
K(l), ie(!1);
|
|
744
741
|
const g = (d) => {
|
|
745
742
|
y && (d.ctrlKey || d.metaKey) && d.key === "c" && l.stop();
|
|
@@ -751,13 +748,13 @@ function ut({ app: e, path: s, input: n, setTitle: t, close: f, active: y, focus
|
|
|
751
748
|
for (const I of p)
|
|
752
749
|
w instanceof P || (w = await ce(w ? `${I} ${w}` : I));
|
|
753
750
|
if (w instanceof P) {
|
|
754
|
-
l.stop(),
|
|
751
|
+
l.stop(), V(v.fg.red + "Stream failed");
|
|
755
752
|
return;
|
|
756
753
|
}
|
|
757
754
|
m = w, ne(w);
|
|
758
755
|
})();
|
|
759
756
|
}), l.on(P.EVENT_NAMES.stop, () => {
|
|
760
|
-
document.removeEventListener("keydown", g),
|
|
757
|
+
document.removeEventListener("keydown", g), V(m), K(null), ne(null);
|
|
761
758
|
}), document.addEventListener("keydown", g);
|
|
762
759
|
}, ce = async (l) => {
|
|
763
760
|
var he;
|
|
@@ -768,41 +765,41 @@ function ut({ app: e, path: s, input: n, setTitle: t, close: f, active: y, focus
|
|
|
768
765
|
d[0].toLowerCase() === "sudo" && d.length >= 2 && d.shift();
|
|
769
766
|
const w = (he = d.shift()) == null ? void 0 : he.toLowerCase();
|
|
770
767
|
if (w == null) return;
|
|
771
|
-
const I =
|
|
772
|
-
if (!I) return
|
|
768
|
+
const I = se.find(w);
|
|
769
|
+
if (!I) return q(w, "Command not found");
|
|
773
770
|
d = d.map((C) => C.startsWith('"') && C.endsWith('"') ? C.slice(1, -1) : C);
|
|
774
771
|
const H = [], fe = {};
|
|
775
772
|
if (d.filter((C) => C.startsWith("-")).forEach((C) => {
|
|
776
|
-
const ge = (
|
|
777
|
-
if (H.includes(
|
|
773
|
+
const ge = (F) => {
|
|
774
|
+
if (H.includes(F))
|
|
778
775
|
return;
|
|
779
|
-
H.push(
|
|
780
|
-
const
|
|
781
|
-
if (
|
|
776
|
+
H.push(F);
|
|
777
|
+
const j = I.getOption(H[H.length - 1]);
|
|
778
|
+
if (j != null && j.isInput) {
|
|
782
779
|
const me = d[d.indexOf(C) + 1];
|
|
783
|
-
fe[
|
|
780
|
+
fe[j.short] = me, we(me, d);
|
|
784
781
|
}
|
|
785
782
|
};
|
|
786
783
|
if (C.startsWith("--")) {
|
|
787
|
-
const
|
|
788
|
-
ge(
|
|
784
|
+
const F = C.substring(2).toLowerCase();
|
|
785
|
+
ge(F);
|
|
789
786
|
} else
|
|
790
|
-
C.substring(1).split("").forEach((
|
|
791
|
-
ge(
|
|
787
|
+
C.substring(1).split("").forEach((j) => {
|
|
788
|
+
ge(j);
|
|
792
789
|
});
|
|
793
|
-
|
|
790
|
+
we(C, d);
|
|
794
791
|
}), I.requireArgs && d.length === 0)
|
|
795
|
-
return
|
|
792
|
+
return q(w, `Incorrect usage: ${w} requires at least 1 argument`);
|
|
796
793
|
if (I.requireOptions && H.length === 0)
|
|
797
|
-
return
|
|
798
|
-
let
|
|
794
|
+
return q(w, `Incorrect usage: ${w} requires at least 1 option`);
|
|
795
|
+
let W = null;
|
|
799
796
|
try {
|
|
800
|
-
if (
|
|
801
|
-
promptOutput:
|
|
797
|
+
if (W = await I.execute(d, {
|
|
798
|
+
promptOutput: V,
|
|
802
799
|
pushHistory: X,
|
|
803
800
|
virtualRoot: k,
|
|
804
801
|
currentDirectory: h,
|
|
805
|
-
setCurrentDirectory:
|
|
802
|
+
setCurrentDirectory: E,
|
|
806
803
|
username: Z,
|
|
807
804
|
hostname: Q,
|
|
808
805
|
rawInputValue: g,
|
|
@@ -810,19 +807,19 @@ function ut({ app: e, path: s, input: n, setTitle: t, close: f, active: y, focus
|
|
|
810
807
|
exit: f,
|
|
811
808
|
inputs: fe,
|
|
812
809
|
timestamp: m,
|
|
813
|
-
settingsManager:
|
|
810
|
+
settingsManager: Ae,
|
|
814
811
|
systemManager: u,
|
|
815
|
-
app:
|
|
816
|
-
}),
|
|
817
|
-
return
|
|
818
|
-
if (!
|
|
819
|
-
return
|
|
812
|
+
app: t
|
|
813
|
+
}), W == null)
|
|
814
|
+
return q(w, "Command failed");
|
|
815
|
+
if (!W.blank)
|
|
816
|
+
return W;
|
|
820
817
|
} catch (C) {
|
|
821
|
-
return console.error(C),
|
|
818
|
+
return console.error(C), q(w, "Command failed");
|
|
822
819
|
}
|
|
823
|
-
},
|
|
820
|
+
}, Le = () => {
|
|
824
821
|
_(""), D(0);
|
|
825
|
-
},
|
|
822
|
+
}, Ne = async (l) => {
|
|
826
823
|
X({
|
|
827
824
|
text: oe + l,
|
|
828
825
|
isInput: !0,
|
|
@@ -833,58 +830,58 @@ function ut({ app: e, path: s, input: n, setTitle: t, close: f, active: y, focus
|
|
|
833
830
|
let m = null;
|
|
834
831
|
for (const d of p)
|
|
835
832
|
m instanceof P || (m = await ce(m ? `${d} ${m}` : d), g.push(d));
|
|
836
|
-
|
|
833
|
+
Le(), p = p.filter((d) => !g.includes(d)), m && (m instanceof P ? Ie(m, p) : V(`${m}
|
|
837
834
|
`));
|
|
838
835
|
}, ue = (l) => {
|
|
839
|
-
const p = a.filter(({ isInput: m }) => m), g =
|
|
840
|
-
if (g ===
|
|
836
|
+
const p = a.filter(({ isInput: m }) => m), g = Be(R + l, 0, p.length);
|
|
837
|
+
if (g === R) {
|
|
841
838
|
l < 0 && _("");
|
|
842
839
|
return;
|
|
843
840
|
}
|
|
844
841
|
_(g === 0 ? "" : p[p.length - g].value ?? ""), D(g);
|
|
845
|
-
},
|
|
842
|
+
}, Me = (l) => {
|
|
846
843
|
const p = l.target.value, { key: g } = l;
|
|
847
|
-
g === "Enter" ? (
|
|
848
|
-
},
|
|
844
|
+
g === "Enter" ? (Ne(p), o((m) => m + 1)) : g === "ArrowUp" ? (l.preventDefault(), ue(1)) : g === "ArrowDown" ? (l.preventDefault(), ue(-1)) : !A && (l.ctrlKey || l.metaKey) && g === "c" && _((m) => m + "^C");
|
|
845
|
+
}, Pe = (l) => {
|
|
849
846
|
const p = l.target.value;
|
|
850
847
|
return _(p);
|
|
851
|
-
},
|
|
848
|
+
}, Re = () => {
|
|
852
849
|
const l = a.slice(-16);
|
|
853
850
|
let p = 0;
|
|
854
851
|
return l.forEach((g, m) => {
|
|
855
852
|
g.clear && (p = m + 1);
|
|
856
|
-
}), l.slice(p).map(({ text: g }, m) => /* @__PURE__ */
|
|
857
|
-
},
|
|
853
|
+
}), l.slice(p).map(({ text: g }, m) => /* @__PURE__ */ N(Oe, { text: g }, m));
|
|
854
|
+
}, De = (l) => {
|
|
858
855
|
var p, g;
|
|
859
856
|
i == null || i(l), l.button === 2 && (l.preventDefault(), (g = (p = navigator.clipboard).readText) == null || g.call(p).then((m) => {
|
|
860
857
|
_(r + m);
|
|
861
858
|
}).catch((m) => {
|
|
862
859
|
console.error(m);
|
|
863
860
|
}));
|
|
864
|
-
},
|
|
861
|
+
}, xe = (l) => {
|
|
865
862
|
l.preventDefault();
|
|
866
863
|
};
|
|
867
864
|
return /* @__PURE__ */ Y(
|
|
868
865
|
"div",
|
|
869
866
|
{
|
|
870
|
-
ref:
|
|
871
|
-
className:
|
|
872
|
-
onMouseDown:
|
|
873
|
-
onContextMenu:
|
|
867
|
+
ref: x,
|
|
868
|
+
className: M.Terminal,
|
|
869
|
+
onMouseDown: De,
|
|
870
|
+
onContextMenu: xe,
|
|
874
871
|
onClick: (l) => {
|
|
875
872
|
var p, g;
|
|
876
|
-
((p = window.getSelection()) == null ? void 0 : p.toString()) === "" && (l.preventDefault(), (g =
|
|
873
|
+
((p = window.getSelection()) == null ? void 0 : p.toString()) === "" && (l.preventDefault(), (g = $.current) == null || g.focus());
|
|
877
874
|
},
|
|
878
875
|
children: [
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
876
|
+
Re(),
|
|
877
|
+
A ? /* @__PURE__ */ N(Oe, { text: U ?? "" }) : /* @__PURE__ */ N(
|
|
878
|
+
gt,
|
|
882
879
|
{
|
|
883
880
|
value: r,
|
|
884
881
|
prefix: oe,
|
|
885
|
-
onKeyDown:
|
|
886
|
-
onChange:
|
|
887
|
-
inputRef:
|
|
882
|
+
onKeyDown: Me,
|
|
883
|
+
onChange: Pe,
|
|
884
|
+
inputRef: $
|
|
888
885
|
},
|
|
889
886
|
c
|
|
890
887
|
)
|
|
@@ -892,16 +889,69 @@ function ut({ app: e, path: s, input: n, setTitle: t, close: f, active: y, focus
|
|
|
892
889
|
}
|
|
893
890
|
);
|
|
894
891
|
}
|
|
895
|
-
|
|
896
|
-
|
|
892
|
+
class dt extends Ve {
|
|
893
|
+
constructor() {
|
|
894
|
+
super("Terminal", "terminal", pt), this.setIconUrl("https://os.prozilla.dev/assets/apps/icons/terminal.svg"), this.setRole(We.APP_ROLES.terminal), this.setCategory("Utilities & tools");
|
|
895
|
+
}
|
|
896
|
+
addCommands(e) {
|
|
897
|
+
return e.forEach((s) => this.addCommand(s)), this;
|
|
898
|
+
}
|
|
899
|
+
addCommand(e) {
|
|
900
|
+
return se.addCommand(e), this;
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
var J;
|
|
904
|
+
class Et {
|
|
905
|
+
constructor() {
|
|
906
|
+
ve(this, J);
|
|
907
|
+
S(this, "options", []);
|
|
908
|
+
S(this, "manual");
|
|
909
|
+
S(this, "requireArgs");
|
|
910
|
+
S(this, "requireOptions");
|
|
911
|
+
S(this, "execute", () => {
|
|
912
|
+
});
|
|
913
|
+
}
|
|
914
|
+
setName(e) {
|
|
915
|
+
var s;
|
|
916
|
+
return be(this, J, e), e && !((s = this.manual) != null && s.usage) && (this.manual || (this.manual = {}), this.manual.usage = e), this;
|
|
917
|
+
}
|
|
918
|
+
get name() {
|
|
919
|
+
return _e(this, J) ?? "";
|
|
920
|
+
}
|
|
921
|
+
setExecute(e) {
|
|
922
|
+
return this.execute = e, this;
|
|
923
|
+
}
|
|
924
|
+
setRequireArgs(e) {
|
|
925
|
+
return this.requireArgs = e, this;
|
|
926
|
+
}
|
|
927
|
+
setRequireOptions(e) {
|
|
928
|
+
return this.requireOptions = e, this;
|
|
929
|
+
}
|
|
930
|
+
setManual({ purpose: e, usage: s, description: n, options: f }) {
|
|
931
|
+
return this.manual = { purpose: e, usage: s, description: n, options: f }, this;
|
|
932
|
+
}
|
|
933
|
+
addOption({ short: e, long: s, isInput: n }) {
|
|
934
|
+
return this.options.push({ short: e, long: s, isInput: n }), this;
|
|
935
|
+
}
|
|
936
|
+
getOption(e) {
|
|
937
|
+
let s = null;
|
|
938
|
+
return this.options.forEach((n) => {
|
|
939
|
+
(n.short === e || n.long === e) && (s = n);
|
|
940
|
+
}), s;
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
J = new WeakMap();
|
|
944
|
+
const $t = new dt();
|
|
897
945
|
export {
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
946
|
+
O as A,
|
|
947
|
+
Et as C,
|
|
948
|
+
kt as M,
|
|
901
949
|
P as S,
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
950
|
+
dt as T,
|
|
951
|
+
se as a,
|
|
952
|
+
Ct as b,
|
|
953
|
+
q as f,
|
|
954
|
+
Ot as r,
|
|
955
|
+
$t as t
|
|
906
956
|
};
|
|
907
|
-
//# sourceMappingURL=main-
|
|
957
|
+
//# sourceMappingURL=main-CXiltWT-.js.map
|