phirepass-widgets 0.0.46 → 0.0.47
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/dist/cjs/{index-DTAHGGCM.js → index-BiurVooY.js} +58 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/phirepass-sftp-client.cjs.entry.js +186 -20
- package/dist/cjs/phirepass-terminal.cjs.entry.js +3 -3
- package/dist/cjs/phirepass-widgets.cjs.js +2 -2
- package/dist/cjs/{protocol-C0YjPrve.js → protocol-BDROfN76.js} +2 -1
- package/dist/collection/common/protocol.js +1 -0
- package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.chevron.svg +6 -0
- package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.css +421 -119
- package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.file.svg +6 -0
- package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.folder.svg +6 -0
- package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.go_up.svg +6 -0
- package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.js +190 -19
- package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.refresh.svg +8 -0
- package/dist/collection/components/phirepass-sftp-client/phirepass-sftp-client.upload.svg +7 -0
- package/dist/collection/components/phirepass-terminal/phirepass-terminal.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{phirepass-widgets/p-rdgKcesn.js → components/p-BcIhGXR0.js} +1 -1
- package/dist/components/phirepass-sftp-client.js +1 -1
- package/dist/components/phirepass-terminal.js +2 -2
- package/dist/esm/{index-D6RLmr6w.js → index-zZMsduaU.js} +58 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/phirepass-sftp-client.entry.js +186 -20
- package/dist/esm/phirepass-terminal.entry.js +3 -3
- package/dist/esm/phirepass-widgets.js +3 -3
- package/dist/esm/{protocol-rdgKcesn.js → protocol-BcIhGXR0.js} +1 -0
- package/dist/phirepass-widgets/p-32ca8ca5.entry.js +1 -0
- package/dist/phirepass-widgets/{p-f8e6ba02.entry.js → p-5b21bc31.entry.js} +5 -5
- package/dist/{components/p-rdgKcesn.js → phirepass-widgets/p-BcIhGXR0.js} +1 -1
- package/dist/phirepass-widgets/p-zZMsduaU.js +2 -0
- package/dist/phirepass-widgets/phirepass-widgets.esm.js +1 -1
- package/dist/types/common/protocol.d.ts +37 -13
- package/dist/types/components/phirepass-sftp-client/phirepass-sftp-client.d.ts +27 -1
- package/package.json +1 -1
- package/dist/phirepass-widgets/p-5e9ce2ac.entry.js +0 -1
- package/dist/phirepass-widgets/p-D6RLmr6w.js +0 -2
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-
|
|
2
|
-
import { _ as __wbg_init, C as Channel, a as ConnectionState, P as ProtocolMessageType } from './protocol-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-zZMsduaU.js';
|
|
2
|
+
import { _ as __wbg_init, E as ErrorType, C as Channel, a as ConnectionState, P as ProtocolMessageType } from './protocol-BcIhGXR0.js';
|
|
3
3
|
|
|
4
4
|
const phirepassSftpClientLogoSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS10ZXJtaW5hbCB3LTMuNSBoLTMuNSB0ZXh0LXByaW1hcnkiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iNCAxNyAxMCAxMSA0IDUiPjwvcG9seWxpbmU+CiAgICA8bGluZSB4MT0iMTIiIHgyPSIyMCIgeTE9IjE5IiB5Mj0iMTkiPjwvbGluZT4KPC9zdmc+Cg==';
|
|
5
5
|
|
|
6
6
|
const phirepassSftpClientMaxSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTE1LCAxMjMsIDE0MCkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtbWF4aW1pemUyIHctMyBoLTMiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iMTUgMyAyMSAzIDIxIDkiPjwvcG9seWxpbmU+CiAgICA8cG9seWxpbmUgcG9pbnRzPSI5IDIxIDMgMjEgMyAxNSI+PC9wb2x5bGluZT4KICAgIDxsaW5lIHgxPSIyMSIgeDI9IjE0IiB5MT0iMyIgeTI9IjEwIj48L2xpbmU+CiAgICA8bGluZSB4MT0iMyIgeDI9IjEwIiB5MT0iMjEiIHkyPSIxNCI+PC9saW5lPgo8L3N2Zz4K';
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const phirepassSftpClientChevronSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogICAgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIKICAgIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tcmlnaHQgdy0zIGgtMyB0ZXh0LW11dGVkLWZvcmVncm91bmQvNTAgc2hyaW5rLTAiPgogICAgPHBhdGggZD0ibTkgMTggNi02LTYtNiI+PC9wYXRoPgo8L3N2Zz4K';
|
|
9
|
+
|
|
10
|
+
const phirepassSftpClientFolderSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS1mb2xkZXIgdy0zLjUgaC0zLjUgdGV4dC1wcmltYXJ5IHNocmluay0wIj4KICAgIDxwYXRoCiAgICAgICAgZD0iTTIwIDIwYTIgMiAwIDAgMCAyLTJWOGEyIDIgMCAwIDAtMi0yaC03LjlhMiAyIDAgMCAxLTEuNjktLjlMOS42IDMuOUEyIDIgMCAwIDAgNy45MyAzSDRhMiAyIDAgMCAwLTIgMnYxM2EyIDIgMCAwIDAgMiAyWiI+PC9wYXRoPgo8L3N2Zz4K';
|
|
11
|
+
|
|
12
|
+
const phirepassSftpClientFileSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTE1LCAxMjMsIDE0MCkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtZmlsZSB3LTMuNSBoLTMuNSB0ZXh0LW11dGVkLWZvcmVncm91bmQgc2hyaW5rLTAiPgogICAgPHBhdGggZD0iTTE1IDJINmEyIDIgMCAwIDAtMiAydjE2YTIgMiAwIDAgMCAyIDJoMTJhMiAyIDAgMCAwIDItMlY3WiI+PC9wYXRoPgogICAgPHBhdGggZD0iTTE0IDJ2NGEyIDIgMCAwIDAgMiAyaDQiPjwvcGF0aD4KPC9zdmc+Cg==';
|
|
13
|
+
|
|
14
|
+
const phirepassSftpClientGoUpSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtYXJyb3ctdXAgdy0zLjUgaC0zLjUiPgogICAgPHBhdGggZD0ibTUgMTIgNy03IDcgNyI+PC9wYXRoPgogICAgPHBhdGggZD0iTTEyIDE5VjUiPjwvcGF0aD4KPC9zdmc+Cg==';
|
|
15
|
+
|
|
16
|
+
const phirepassSftpClientRefreshSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtcmVmcmVzaC1jdyB3LTMuNSBoLTMuNSI+CiAgICA8cGF0aCBkPSJNMyAxMmE5IDkgMCAwIDEgOS05IDkuNzUgOS43NSAwIDAgMSA2Ljc0IDIuNzRMMjEgOCI+PC9wYXRoPgogICAgPHBhdGggZD0iTTIxIDN2NWgtNSI+PC9wYXRoPgogICAgPHBhdGggZD0iTTIxIDEyYTkgOSAwIDAgMS05IDkgOS43NSA5Ljc1IDAgMCAxLTYuNzQtMi43NEwzIDE2Ij48L3BhdGg+CiAgICA8cGF0aCBkPSJNOCAxNkgzdjUiPjwvcGF0aD4KPC9zdmc+Cg==';
|
|
17
|
+
|
|
18
|
+
const phirepassSftpClientUploadSvg = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtdXBsb2FkIHctMy41IGgtMy41Ij4KICAgIDxwYXRoIGQ9Ik0yMSAxNXY0YTIgMiAwIDAgMS0yIDJINWEyIDIgMCAwIDEtMi0ydi00Ij48L3BhdGg+CiAgICA8cG9seWxpbmUgcG9pbnRzPSIxNyA4IDEyIDMgNyA4Ij48L3BvbHlsaW5lPgogICAgPGxpbmUgeDE9IjEyIiB4Mj0iMTIiIHkxPSIzIiB5Mj0iMTUiPjwvbGluZT4KPC9zdmc+Cg==';
|
|
19
|
+
|
|
20
|
+
const phirepassSftpClientCss = () => `:host{--radius:0.375rem;--card:220 18% 10%;--border:220 15% 18%;--primary:160 60% 45%;--radius:0.375rem;--destructive:0 70% 50%;--muted:220 15% 13%;--muted-foreground:220 10% 50%;--primary-foreground:220 20% 7%;--scroll-track:220 16% 12%;--scroll-thumb:220 12% 34%;--scroll-thumb-hover:160 45% 44%;font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;height:100%;width:100%;border:1px solid hsl(var(--border));background-color:hsl(var(--card));border-radius:var(--radius);overflow:hidden;display:flex;flex-direction:column;position:relative;.listing{flex:1;display:flex;flex-direction:column;justify-content:space-between;min-height:0;header{height:30px;background:rgba(28, 31, 38, 0.6);border-bottom:1px solid hsl(var(--border));display:flex;align-items:center;justify-content:space-between;.actions{display:flex;align-items:center;.action{cursor:pointer;padding:4px;display:flex;align-items:center;z-index:1;img{height:14px;padding:4px;border-radius:4px}&:hover{background-color:hsl(var(--border) / 0.6)}}}.title{color:hsl(var(--primary));height:14px;padding:0 12px;display:flex;align-items:center;font-size:0.75rem;line-height:1rem;img{height:14px;margin-right:5px}.text{display:flex;flex-direction:row;justify-content:center;margin-top:2px;.name{margin-right:10px}.description{color:hsl(var(--muted-foreground))}}}}main{flex:1;display:flex;flex-direction:column;position:relative;min-height:0;overflow:hidden;.loader{color:hsl(var(--muted-foreground));font-size:13px;animation:pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;text-align:center;display:flex;align-items:center;justify-content:center;position:absolute;height:100%;width:100%;background:rgba(28, 31, 38, 0);backdrop-filter:blur(4px)}.error{font-size:13px;text-align:center;color:hsl(var(--destructive));height:100%;display:flex;align-items:center;justify-content:center}.navigation{height:25px;padding:10px;font-size:0.75rem;line-height:1rem;background-color:hsl(var(--card));display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid hsl(var(--border));position:sticky;top:0;z-index:3;.breadcrumbs{display:flex;align-items:center;margin-right:10px;.breadcrumb{color:hsl(var(--primary));margin-right:4px;cursor:pointer;&:after{margin-left:4px}&:hover{color:rgb(189, 219, 209)}&:last-child{margin-right:0;color:rgb(189, 219, 209);cursor:default}}.arrow{height:12px;width:12px;opacity:0.6;top:2px;margin-right:4px;position:relative}}.actions{display:flex;align-items:center;gap:8px}.action{border:none;background:transparent;color:rgb(189, 219, 209);font-size:1.1rem;line-height:1;padding:2px 4px;border-radius:4px;cursor:pointer;&:hover{background-color:hsl(var(--border) / 0.6)}img{height:14px;width:14px;display:block}}.action.disconnect{color:#ff4d5f;font-size:0.65rem;letter-spacing:0.08em;padding:4px 8px;&:hover{color:#ff6b7a;background-color:hsl(var(--destructive) / 0.12)}}}.content{flex:1;min-height:0;overflow:auto;font-size:0.75rem;line-height:1rem;scrollbar-width:thin;scrollbar-color:hsl(var(--scroll-thumb)) hsl(var(--scroll-track));&::-webkit-scrollbar{width:10px;height:10px}&::-webkit-scrollbar-track{background:hsl(var(--scroll-track))}&::-webkit-scrollbar-thumb{background:hsl(var(--scroll-thumb));border-radius:999px;border:2px solid hsl(var(--scroll-track))}&::-webkit-scrollbar-thumb:hover{background:hsl(var(--scroll-thumb-hover))}table{width:100%;border-collapse:separate;border-spacing:0;thead{background-color:hsl(var(--muted));border-bottom:1px solid hsl(var(--border));th{padding:8px 10px;text-align:left;color:hsl(var(--muted-foreground));position:sticky;top:0;z-index:2;background-color:hsl(var(--muted));border-bottom:1px solid hsl(var(--border));line-height:0.95rem}}tbody{padding:10px 10px;tr{border-bottom:1px solid hsl(var(--border) / 0.4);td{padding:10px 10px 9px;color:hsl(var(--muted-foreground));.name{&.file{color:rgb(189, 219, 209)}&.folder{color:hsl(var(--primary))}}.kind{height:14px;width:14px;margin-right:5px;top:3px;position:relative}}&:hover{cursor:pointer;background-color:hsl(var(--muted) / 0.4)}&.selected{background-color:hsl(var(--primary) / 0.3);&:hover{background-color:hsl(var(--primary) / 0.4)}}}}}}}footer{height:25px;background:rgba(28, 31, 38, 0.6);border-top:1px solid hsl(var(--border));font-size:0.75rem;line-height:1rem;display:flex;align-items:center;justify-content:space-between;padding:0 10px;.status{font-size:0.65rem;color:hsl(var(--muted-foreground));.selected-item{margin-left:10px;color:hsl(var(--primary))}}.version{font-size:0.65rem;color:hsl(var(--muted-foreground))}}}.creds{position:absolute;top:0;left:0;height:100%;width:100%;display:flex;justify-content:center;align-items:center;;&.blurred{background:rgba(28, 31, 38, 0);backdrop-filter:blur(4px)}.auth{display:flex;flex-direction:column;background:hsl(var(--card));position:relative;background-color:rgba(21, 24, 30, 0.95);border:1px solid hsl(var(--border));padding:30px;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.5) 0px 25px 50px -12px;border-radius:var(--radius);.title{margin-bottom:12px;color:hsl(var(--primary))}label{font-size:0.75rem;line-height:1rem;margin-bottom:1rem;color:hsl(var(--muted-foreground))}input{font-size:0.875rem;line-height:1.25rem;padding-top:0.5rem;padding-bottom:0.5rem;padding-left:0.75rem;padding-right:0.75rem;background-color:rgb(28, 31, 38);border-color:rgb(39, 44, 53);border-width:1px;border-radius:calc(var(--radius) - 2px);width:100%;margin-bottom:12px;color:rgb(189, 219, 209);box-sizing:border-box;&:focus{outline:none;border-color:hsl(var(--primary));box-shadow:0 0 0 1px hsl(var(--primary))}}button[type='submit']{margin-top:12px;width:100%;background-color:hsl(var(--primary));color:hsl(var(--primary-foreground));letter-spacing:0.05em;font-size:13px;font-weight:500;padding:0.5rem 1rem;border-radius:calc(var(--radius) - 2px);height:2rem;cursor:pointer;border:none;&:hover{background-color:hsl(var(--primary) / 0.9)}}}}}:host(.max){height:100vh;width:100vw;position:fixed;top:0;left:0;z-index:9999}`;
|
|
9
21
|
|
|
10
22
|
const PhirepassSftpClient = class {
|
|
11
23
|
constructor(hostRef) {
|
|
@@ -17,8 +29,9 @@ const PhirepassSftpClient = class {
|
|
|
17
29
|
domReady = false;
|
|
18
30
|
runtimeReady = false;
|
|
19
31
|
connected = false;
|
|
32
|
+
uploadInputEl;
|
|
20
33
|
// private inputMode: InputMode = InputMode.Default;
|
|
21
|
-
|
|
34
|
+
session_id;
|
|
22
35
|
// private usernameBuffer = "";
|
|
23
36
|
// private passwordBuffer = "";
|
|
24
37
|
name = 'SFTP';
|
|
@@ -44,6 +57,7 @@ const PhirepassSftpClient = class {
|
|
|
44
57
|
if (newValue) {
|
|
45
58
|
this.open_comms();
|
|
46
59
|
this.channel.connect();
|
|
60
|
+
this.status = 'Connecting...';
|
|
47
61
|
}
|
|
48
62
|
}
|
|
49
63
|
serverId;
|
|
@@ -61,7 +75,18 @@ const PhirepassSftpClient = class {
|
|
|
61
75
|
max = false;
|
|
62
76
|
show_login_screen = false;
|
|
63
77
|
show_login_screen_username = false;
|
|
78
|
+
show_error = false;
|
|
79
|
+
error_message = '';
|
|
64
80
|
show_login_screen_password = false;
|
|
81
|
+
show_navigation = false;
|
|
82
|
+
breadcrumbs = [];
|
|
83
|
+
current_dir = '.';
|
|
84
|
+
listing = [];
|
|
85
|
+
show_content = false;
|
|
86
|
+
show_loader = false;
|
|
87
|
+
version = '';
|
|
88
|
+
status = 'Disconnected';
|
|
89
|
+
selected_item = null;
|
|
65
90
|
toggle_max() {
|
|
66
91
|
this.maximizeEvent?.emit(!this.max);
|
|
67
92
|
}
|
|
@@ -98,6 +123,7 @@ const PhirepassSftpClient = class {
|
|
|
98
123
|
connect() {
|
|
99
124
|
this.connected = true;
|
|
100
125
|
this.channel.connect();
|
|
126
|
+
this.status = 'Connecting...';
|
|
101
127
|
// const container = this.containerEl;
|
|
102
128
|
// console.log('Attempting to connect terminal to container:', container);
|
|
103
129
|
// if (container) {
|
|
@@ -131,22 +157,63 @@ const PhirepassSftpClient = class {
|
|
|
131
157
|
}
|
|
132
158
|
return `${protocol}://${this.serverHost}:${this.serverPort}`;
|
|
133
159
|
}
|
|
134
|
-
handle_error(
|
|
135
|
-
|
|
160
|
+
handle_error(error) {
|
|
161
|
+
switch (error.kind) {
|
|
162
|
+
case ErrorType.Generic:
|
|
163
|
+
case ErrorType.Authentication:
|
|
164
|
+
this.error_message = error.message || 'An unknown error occurred.';
|
|
165
|
+
break;
|
|
166
|
+
case ErrorType.RequiresUsername:
|
|
167
|
+
this.show_login_screen_username = true;
|
|
168
|
+
this.show_login_screen_password = false;
|
|
169
|
+
this.show_login_screen = true;
|
|
170
|
+
break;
|
|
171
|
+
case ErrorType.RequiresPassword:
|
|
172
|
+
this.show_login_screen_username = false;
|
|
173
|
+
this.show_login_screen_password = true;
|
|
174
|
+
this.show_login_screen = true;
|
|
175
|
+
break;
|
|
176
|
+
case ErrorType.RequiresUsernamePassword:
|
|
177
|
+
this.show_login_screen_username = true;
|
|
178
|
+
this.show_login_screen_password = true;
|
|
179
|
+
this.show_login_screen = true;
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
setTimeout(() => {
|
|
183
|
+
this.show_loader = false;
|
|
184
|
+
}, 1_000);
|
|
136
185
|
}
|
|
137
|
-
handle_auth_success(
|
|
186
|
+
handle_auth_success(auth) {
|
|
138
187
|
this.clear_creds_buffer();
|
|
188
|
+
this.version = auth.version;
|
|
139
189
|
this.channel.start_heartbeat(this.heartbeatInterval <= 15_000 ? 30_000 : this.heartbeatInterval);
|
|
140
190
|
this.channel.open_sftp_tunnel(this.nodeId);
|
|
191
|
+
this.status = 'Connected';
|
|
141
192
|
}
|
|
142
|
-
handle_tunnel_opened(
|
|
143
|
-
|
|
193
|
+
handle_tunnel_opened(web) {
|
|
194
|
+
this.session_id = web.sid;
|
|
144
195
|
// this.terminal.reset();
|
|
145
196
|
// this.fit_terminal_safely();
|
|
146
197
|
// this.send_ssh_terminal_resize();
|
|
198
|
+
this.channel.send_sftp_list_data(this.nodeId, this.session_id, this.current_dir);
|
|
147
199
|
}
|
|
148
|
-
|
|
149
|
-
|
|
200
|
+
handle_sftp_list_items(web) {
|
|
201
|
+
setTimeout(() => {
|
|
202
|
+
this.show_loader = false;
|
|
203
|
+
}, 500);
|
|
204
|
+
this.listing = web.dir.items;
|
|
205
|
+
this.current_dir = web.path;
|
|
206
|
+
this.breadcrumbs = web.path.split('/').map((path, index, arr) => {
|
|
207
|
+
if (path === '' && index === 0) {
|
|
208
|
+
return { label: '/', path: '/' };
|
|
209
|
+
}
|
|
210
|
+
return { label: path, path: arr.slice(0, index + 1).join('/') };
|
|
211
|
+
});
|
|
212
|
+
this.show_content = true;
|
|
213
|
+
this.show_navigation = true;
|
|
214
|
+
}
|
|
215
|
+
handle_tunnel_data(web) {
|
|
216
|
+
console.log('received tunnel data:', web);
|
|
150
217
|
}
|
|
151
218
|
handle_tunnel_closed(_web_) {
|
|
152
219
|
// this.session_id = undefined;
|
|
@@ -166,16 +233,18 @@ const PhirepassSftpClient = class {
|
|
|
166
233
|
this.channel.on_connection_open(() => {
|
|
167
234
|
this.connectionStateChanged.emit([ConnectionState.Connected]);
|
|
168
235
|
this.channel.authenticate(this.token, this.nodeId);
|
|
236
|
+
this.status = 'Authenticating...';
|
|
169
237
|
});
|
|
170
238
|
this.channel.on_connection_close(() => {
|
|
171
239
|
this.connectionStateChanged.emit([ConnectionState.Disconnected]);
|
|
172
|
-
|
|
240
|
+
this.status = 'Disconnected';
|
|
173
241
|
});
|
|
174
242
|
this.channel.on_connection_error((err) => {
|
|
175
243
|
this.connectionStateChanged.emit([ConnectionState.Error, err]);
|
|
244
|
+
this.status = 'Error ' + err.message;
|
|
176
245
|
});
|
|
177
246
|
this.channel.on_connection_message((_raw_) => {
|
|
178
|
-
//
|
|
247
|
+
//
|
|
179
248
|
});
|
|
180
249
|
this.channel.on_protocol_message((msg) => {
|
|
181
250
|
const { web } = msg.data;
|
|
@@ -195,8 +264,11 @@ const PhirepassSftpClient = class {
|
|
|
195
264
|
case ProtocolMessageType.TunnelData:
|
|
196
265
|
this.handle_tunnel_data(web);
|
|
197
266
|
break;
|
|
267
|
+
case ProtocolMessageType.SFTPListItems:
|
|
268
|
+
this.handle_sftp_list_items(web);
|
|
269
|
+
break;
|
|
198
270
|
default:
|
|
199
|
-
console.warn('
|
|
271
|
+
console.warn('Unhandled protocol message type:', web);
|
|
200
272
|
}
|
|
201
273
|
});
|
|
202
274
|
}
|
|
@@ -213,15 +285,109 @@ const PhirepassSftpClient = class {
|
|
|
213
285
|
// this.inputMode = InputMode.Default;
|
|
214
286
|
this.clear_creds_buffer();
|
|
215
287
|
}
|
|
288
|
+
list_breadcrumb(path) {
|
|
289
|
+
this.show_loader = true;
|
|
290
|
+
this.selected_item = null;
|
|
291
|
+
this.channel.send_sftp_list_data(this.nodeId, this.session_id, path);
|
|
292
|
+
}
|
|
293
|
+
go_to_parent_directory() {
|
|
294
|
+
if (!this.session_id) {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
if (this.current_dir === '/') {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
const parent = this.breadcrumbs[this.breadcrumbs.length - 2]?.path || '/';
|
|
301
|
+
this.list_breadcrumb(parent);
|
|
302
|
+
}
|
|
303
|
+
refresh_directory() {
|
|
304
|
+
if (!this.session_id) {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
this.list_breadcrumb(this.current_dir);
|
|
308
|
+
}
|
|
309
|
+
disconnect_session() {
|
|
310
|
+
this.close_comms();
|
|
311
|
+
this.session_id = undefined;
|
|
312
|
+
this.status = 'Disconnected';
|
|
313
|
+
this.show_loader = false;
|
|
314
|
+
}
|
|
315
|
+
open_upload_picker() {
|
|
316
|
+
this.uploadInputEl?.click();
|
|
317
|
+
}
|
|
318
|
+
on_upload_selected(event) {
|
|
319
|
+
const input = event.target;
|
|
320
|
+
const file = input.files?.[0];
|
|
321
|
+
if (!file) {
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
this.show_error = true;
|
|
325
|
+
this.error_message = 'Upload is not available yet in this widget.';
|
|
326
|
+
setTimeout(() => {
|
|
327
|
+
this.show_error = false;
|
|
328
|
+
}, 2_000);
|
|
329
|
+
input.value = '';
|
|
330
|
+
}
|
|
331
|
+
is_selected(item) {
|
|
332
|
+
if (!this.selected_item) {
|
|
333
|
+
return false;
|
|
334
|
+
}
|
|
335
|
+
return this.selected_item.path === item.path &&
|
|
336
|
+
this.selected_item.name === item.name;
|
|
337
|
+
}
|
|
338
|
+
list_directory(entry) {
|
|
339
|
+
if (!this.session_id) {
|
|
340
|
+
console.warn('No active session. Cannot list directory.');
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
if (entry.kind === 'File') {
|
|
344
|
+
console.warn('Cannot list directory of a file. Ignoring click.');
|
|
345
|
+
this.selected_item = entry;
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
const path = [entry.path, entry.name].join('/');
|
|
349
|
+
if (path === this.current_dir) {
|
|
350
|
+
console.warn('Already in this directory. Ignoring click.');
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
this.show_loader = true;
|
|
354
|
+
this.selected_item = null;
|
|
355
|
+
this.channel.send_sftp_list_data(this.nodeId, this.session_id, path);
|
|
356
|
+
}
|
|
357
|
+
get_full_path(item) {
|
|
358
|
+
return [item.path, item.name].join('/');
|
|
359
|
+
}
|
|
216
360
|
render() {
|
|
217
|
-
return (h(Host, { key: '
|
|
361
|
+
return (h(Host, { key: 'c19b87e943347cc55424450e7e4f10bc3447e828', class: {
|
|
218
362
|
'default': !this.max,
|
|
219
363
|
'max': this.max,
|
|
220
|
-
} }, h("section", { key: '
|
|
221
|
-
h("header", { key: '
|
|
222
|
-
'
|
|
223
|
-
|
|
224
|
-
|
|
364
|
+
} }, h("section", { key: '88ecbc0d1a1460dd262150706216f7f758fb7981', class: "listing" }, !this.hideHeader &&
|
|
365
|
+
h("header", { key: 'dd28677d023aeaf431cb3b99449751f6385c767d' }, h("section", { key: 'ad56b31550d096cb59e92bc6167be11b76a9c368', class: "title" }, h("img", { key: '00ce4e832edfb672b0eadb0462a5a132cfa67e09', src: phirepassSftpClientLogoSvg, alt: "SFTP Client" }), h("div", { key: 'ee186cc2c643afefa425bb6ce862686dce5ba6ab', class: "text" }, h("div", { key: '29c5922bf9826930ac33fe6c200bf47fce1e183e', class: "name" }, this.name), h("div", { key: '76d6bba6cb51b9907db533395c258ee7458cf5ce', class: "description" }, this.description))), h("section", { key: 'd3bfbf402aed51cba973830b14b9d4f276011535', class: "actions" }, h("div", { key: '87eb4484d8552a582c35e4960a82003f7570bf26', class: "action", onClick: () => this.toggle_max() }, h("img", { key: '3ff40a471fc54a1d97a4aa5c4746dc837082307d', src: phirepassSftpClientMaxSvg, alt: "Maximize" })))), h("main", { key: 'a441806676df938682df422acce7b640e452eece' }, this.show_navigation && h("nav", { key: 'd7fe91b30ecd998985301c2f0ac5064ee4bfc9fa', class: "navigation" }, h("div", { key: '17bd0d958fb55b8a89b6af7becbeb1cd892066a5', class: "breadcrumbs" }, this.breadcrumbs.map((crumb, index, breadcrumbs) => (h(h.Fragment, null, h("span", { key: index, onClick: () => this.list_breadcrumb(crumb.path), class: "breadcrumb" }, crumb.label), index < breadcrumbs.length - 1 && h("img", { class: "arrow", src: phirepassSftpClientChevronSvg }))))), h("section", { key: '0f65ff3c51a3aeba3bf046445fc858b05e1e5106', class: "actions", "aria-label": "SFTP actions" }, h("button", { key: '5184ea48385f5b1f235e7fe0a01eed0171782e76', type: "button", class: "action", onClick: () => this.go_to_parent_directory(), title: "Go to parent directory", "aria-label": "Go to parent directory" }, h("img", { key: '345aa00fe17569c8d9037e9304b381868effe862', src: phirepassSftpClientGoUpSvg, alt: "Go up" })), h("button", { key: 'eec7a682ed944746eabf939dfff1073bb85dfae6', type: "button", class: "action", onClick: () => this.refresh_directory(), title: "Refresh", "aria-label": "Refresh" }, h("img", { key: 'ab1faf4dc27ca0a85b152c559b2f4953c7fddb15', src: phirepassSftpClientRefreshSvg, alt: "Refresh" })), h("button", { key: '529ad0cd6e000978294be16aedb9ec8f2b6d699e', type: "button", class: "action", onClick: () => this.open_upload_picker(), title: "Upload", "aria-label": "Upload" }, h("img", { key: '669ceed59555391014ea531e4398517a1c4bc77a', src: phirepassSftpClientUploadSvg, alt: "Upload" })), h("button", { key: '3b0602bd52a1ed066e76f136ba18e67a2e923f05', type: "button", class: "action disconnect", onClick: () => this.disconnect_session(), title: "Disconnect", "aria-label": "Disconnect" }, "DISCONNECT"))), h("input", { key: '272d2fe2f2d61b02c4d2e5c8624f2c0ccc7daa92', type: "file", ref: (el) => this.uploadInputEl = el, onChange: (event) => this.on_upload_selected(event), style: { display: 'none' } }), this.show_content && h("div", { key: '2f080688bfa4c95663c278d875eceebbda78094a', class: "content" }, h("table", { key: '3c10b9615ba21dce3aaa47850d03f083d0ef0107' }, h("thead", { key: '366af5b1b875d394450b78b6490c813ac930f0fa' }, h("tr", { key: 'd3116485a0f02953c96e309f1c44d5e47cea9dcd' }, h("th", { key: '6af47d08c0bac5dd887ceda7b3f75101caeaebc3' }, "Name"), h("th", { key: '3c8c72711429b988e24118810ef3ea30eb779bb7' }, "Size"), h("th", { key: '8dd16c387287e4dd3bf29dbea304f6dd8871686a' }, "Permissions"), h("th", { key: '7b2c6ca49d8dd4150895307a4499d3e083cc8900' }, "Owner"), h("th", { key: '1723d32cf185dbaeea6d3bd9dbe3f72fc055c5a2' }, "Modified"))), h("tbody", { key: '685d9eae4f0ac61e07b44710be235bafaaefa7df' }, this.listing.map((item, index) => (h("tr", { key: index, class: {
|
|
366
|
+
'selected': this.is_selected(item),
|
|
367
|
+
}, onClick: () => this.list_directory(item) }, h("td", null, item.kind === 'Folder' ? h("img", { class: "kind", src: phirepassSftpClientFolderSvg, alt: "Folder" }) : h("img", { class: "kind", src: phirepassSftpClientFileSvg, alt: "File" }), h("span", { class: `name ${item.kind.toLowerCase()}` }, item.name)), h("td", null, item.attributes.size), h("td", null, item.attributes.permissions ?? '-'), h("td", null, item.attributes.user ?? '-'), h("td", null, new Date(item.attributes.mtime * 1000).toLocaleString()))))))), this.show_loader && h("div", { key: '8337354a4cd9ca456d7845ff4934ceebb36f7dc6', class: "loader" }, "Loading..."), this.show_error && h("div", { key: 'c547ad1c0f24de427a77129f77402830910e98b4', class: "error" }, this.error_message)), h("footer", { key: 'e452f0e2f7982049df57498ef9ed1cf63c70e9eb' }, h("section", { key: '00111d90943b2bfb21392dede79af5e009d43524', class: "status" }, h("span", { key: '1c10ae5cb21118059fe61625f9fc4d0aa18be448' }, this.status), this.selected_item && h("span", { key: '82939fb59d72ca3823e8c580578a6f13ce4079b0', class: "selected-item" }, this.get_full_path(this.selected_item))), h("section", { key: '38380847cf818eb024ec5743ffd92e3369b2cc40', class: "version" }, "Version: ", this.version))), this.show_login_screen &&
|
|
368
|
+
h("section", { key: '1840f9bae95e8906c38dade1e15f6c52f360829b', class: {
|
|
369
|
+
'creds': true,
|
|
370
|
+
'blurred': this.show_login_screen,
|
|
371
|
+
} }, h("form", { key: 'b7b7c3494329a93aafc6c948c879ba8ecd8bd42a', class: "auth", onSubmit: (event) => {
|
|
372
|
+
const formData = new FormData(event.target);
|
|
373
|
+
let username = undefined;
|
|
374
|
+
if (this.show_login_screen_username) {
|
|
375
|
+
username = formData.get('username');
|
|
376
|
+
}
|
|
377
|
+
let password = undefined;
|
|
378
|
+
if (this.show_login_screen_password) {
|
|
379
|
+
password = formData.get('password');
|
|
380
|
+
}
|
|
381
|
+
this.channel.open_sftp_tunnel(this.nodeId, username, password);
|
|
382
|
+
this.show_login_screen_username = false;
|
|
383
|
+
this.show_login_screen_password = false;
|
|
384
|
+
this.show_login_screen = false;
|
|
385
|
+
this.show_loader = true;
|
|
386
|
+
event.stopPropagation();
|
|
387
|
+
event.preventDefault();
|
|
388
|
+
} }, h("div", { key: '25a15115fb41d65d59750a176d46a7e844286e00', class: "title" }, "SFTP Connection"), this.show_login_screen_username &&
|
|
389
|
+
h("div", { key: '13f5053dbf65445220551f554df5ab03fb7fb7c0' }, h("label", { key: '5016afe8eb38c54800697fbe2d4602269966edc9', htmlFor: "username" }, "Username"), h("input", { key: '48e7e3029b0369e06f5d1bafcf4bc9bc3fccfb1a', id: "username", autoComplete: 'off', name: "username", type: "text", placeholder: "" })), this.show_login_screen_password &&
|
|
390
|
+
h("div", { key: 'cd06fc73813094a57899c3be077f3dba0a5ca133' }, h("label", { key: 'f64e3145d4df56d4654dedb0188c2a33db09634b', htmlFor: "password" }, "Password"), h("input", { key: '6e22d7cfbf40b8d2e77a23730d55df2e900d5da7', id: "password", autoComplete: 'off', name: "password", type: "password", placeholder: "" })), h("div", { key: '9405dbf23cb588db9b2368c3155a9230ab046438' }, h("button", { key: 'b8087e7b9a828db3d6b36f8fe06d564c76d01402', type: "submit" }, "Connect"))))));
|
|
225
391
|
}
|
|
226
392
|
static get watchers() { return {
|
|
227
393
|
"nodeId": [{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, g as getElement, h as h$1, H as Host } from './index-
|
|
2
|
-
import { I as InputMode, _ as __wbg_init, C as Channel, a as ConnectionState, P as ProtocolMessageType, E as ErrorType } from './protocol-
|
|
1
|
+
import { r as registerInstance, c as createEvent, g as getElement, h as h$1, H as Host } from './index-zZMsduaU.js';
|
|
2
|
+
import { I as InputMode, _ as __wbg_init, C as Channel, a as ConnectionState, P as ProtocolMessageType, E as ErrorType } from './protocol-BcIhGXR0.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
@@ -692,7 +692,7 @@ const PhirepassTerminal = class {
|
|
|
692
692
|
this.usernameBuffer = "";
|
|
693
693
|
}
|
|
694
694
|
render() {
|
|
695
|
-
return (h$1(Host, { key: '
|
|
695
|
+
return (h$1(Host, { key: '13831d1794d5739dcd61460571dbdd86eb3b7368' }, h$1("div", { key: '1a68fbc0c601df5525e278627567fa1c62c59992', id: "ccc", ref: el => (this.containerEl = el) })));
|
|
696
696
|
}
|
|
697
697
|
static get watchers() { return {
|
|
698
698
|
"nodeId": [{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-zZMsduaU.js';
|
|
2
|
+
export { s as setNonce } from './index-zZMsduaU.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-DQuL1Twl.js';
|
|
4
4
|
|
|
5
5
|
/*
|
|
@@ -17,5 +17,5 @@ var patchBrowser = () => {
|
|
|
17
17
|
|
|
18
18
|
patchBrowser().then(async (options) => {
|
|
19
19
|
await globalScripts();
|
|
20
|
-
return bootstrapLazy([["phirepass-sftp-client",[[513,"phirepass-sftp-client",{"name":[1],"description":[1],"hideHeader":[4,"hide-header"],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"token":[1],"serverId":[1,"server-id"],"max":[32],"show_login_screen":[32],"show_login_screen_username":[32],"show_login_screen_password":[32],"maximize":[64],"minimize":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-terminal",[[513,"phirepass-terminal",{"terminalOptions":[16],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"token":[1],"serverId":[1,"server-id"]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]]], options);
|
|
20
|
+
return bootstrapLazy([["phirepass-sftp-client",[[513,"phirepass-sftp-client",{"name":[1],"description":[1],"hideHeader":[4,"hide-header"],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"token":[1],"serverId":[1,"server-id"],"max":[32],"show_login_screen":[32],"show_login_screen_username":[32],"show_error":[32],"error_message":[32],"show_login_screen_password":[32],"show_navigation":[32],"breadcrumbs":[32],"current_dir":[32],"listing":[32],"show_content":[32],"show_loader":[32],"version":[32],"status":[32],"selected_item":[32],"maximize":[64],"minimize":[64]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]],["phirepass-terminal",[[513,"phirepass-terminal",{"terminalOptions":[16],"serverHost":[1,"server-host"],"serverPort":[2,"server-port"],"allowInsecure":[4,"allow-insecure"],"heartbeatInterval":[2,"heartbeat-interval"],"nodeId":[1,"node-id"],"token":[1],"serverId":[1,"server-id"]},null,{"nodeId":[{"onNodeIdChange":0}],"serverId":[{"onServerIdChange":0}]}]]]], options);
|
|
21
21
|
});
|
|
@@ -779,6 +779,7 @@ var ProtocolMessageType;
|
|
|
779
779
|
ProtocolMessageType["TunnelOpened"] = "TunnelOpened";
|
|
780
780
|
ProtocolMessageType["TunnelClosed"] = "TunnelClosed";
|
|
781
781
|
ProtocolMessageType["TunnelData"] = "TunnelData";
|
|
782
|
+
ProtocolMessageType["SFTPListItems"] = "SFTPListItems";
|
|
782
783
|
})(ProtocolMessageType || (ProtocolMessageType = {}));
|
|
783
784
|
var InputMode;
|
|
784
785
|
(function (InputMode) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as i,h as t,H as a}from"./p-zZMsduaU.js";import{_ as s,E as o,C as r,a as c,P as d}from"./p-BcIhGXR0.js";const l=class{constructor(t){e(this,t),this.maximizeEvent=i(this,"maximize"),this.connectionStateChanged=i(this,"connectionStateChanged")}channel;domReady=!1;runtimeReady=!1;connected=!1;uploadInputEl;session_id;name="SFTP";description="Client";hideHeader=!1;serverHost="phirepass.com";serverPort=443;allowInsecure=!1;heartbeatInterval=3e4;nodeId;token;onNodeIdChange(e,i){this.reset_session_state(),this.channel&&this.channel.is_connected()&&this.close_comms(),e&&(this.open_comms(),this.channel.connect(),this.status="Connecting...")}serverId;onServerIdChange(e,i){this.onNodeIdChange(this.nodeId,this.nodeId)}maximizeEvent;async maximize(){this.max=!this.max}async minimize(){this.max=!1}connectionStateChanged;max=!1;show_login_screen=!1;show_login_screen_username=!1;show_error=!1;error_message="";show_login_screen_password=!1;show_navigation=!1;breadcrumbs=[];current_dir=".";listing=[];show_content=!1;show_loader=!1;version="";status="Disconnected";selected_item=null;toggle_max(){this.maximizeEvent?.emit(!this.max)}async connectedCallback(){await s(),this.open_comms(),this.runtimeReady=!0,this.nodeId?this.try_connect():console.warn("Prop node_id is not set. Cannot connect to terminal.")}componentDidLoad(){this.domReady=!0,this.try_connect()}async disconnectedCallback(){this.connected=!1,this.domReady=!1,this.runtimeReady=!1,this.close_comms()}connect(){this.connected=!0,this.channel.connect(),this.status="Connecting..."}try_connect(){!this.connected&&this.domReady&&this.runtimeReady&&this.channel&&this.connect()}create_web_socket_endpoint(){const e=this.allowInsecure?"ws":"wss";return this.allowInsecure||443!==this.serverPort?this.allowInsecure&&80===this.serverPort?`${e}://${this.serverHost}`:`${e}://${this.serverHost}:${this.serverPort}`:`${e}://${this.serverHost}`}handle_error(e){switch(e.kind){case o.Generic:case o.Authentication:this.error_message=e.message||"An unknown error occurred.";break;case o.RequiresUsername:this.show_login_screen_username=!0,this.show_login_screen_password=!1,this.show_login_screen=!0;break;case o.RequiresPassword:this.show_login_screen_username=!1,this.show_login_screen_password=!0,this.show_login_screen=!0;break;case o.RequiresUsernamePassword:this.show_login_screen_username=!0,this.show_login_screen_password=!0,this.show_login_screen=!0}setTimeout((()=>{this.show_loader=!1}),1e3)}handle_auth_success(e){this.clear_creds_buffer(),this.version=e.version,this.channel.start_heartbeat(this.heartbeatInterval<=15e3?3e4:this.heartbeatInterval),this.channel.open_sftp_tunnel(this.nodeId),this.status="Connected"}handle_tunnel_opened(e){this.session_id=e.sid,this.channel.send_sftp_list_data(this.nodeId,this.session_id,this.current_dir)}handle_sftp_list_items(e){setTimeout((()=>{this.show_loader=!1}),500),this.listing=e.dir.items,this.current_dir=e.path,this.breadcrumbs=e.path.split("/").map(((e,i,t)=>""===e&&0===i?{label:"/",path:"/"}:{label:e,path:t.slice(0,i+1).join("/")})),this.show_content=!0,this.show_navigation=!0}handle_tunnel_data(e){console.log("received tunnel data:",e)}handle_tunnel_closed(e){this.clear_creds_buffer(),this.close_comms()}open_comms(){this.channel=this.serverId?new r(`${this.create_web_socket_endpoint()}/api/web/ws`,this.nodeId,this.serverId):new r(`${this.create_web_socket_endpoint()}/api/web/ws`,this.nodeId),this.channel.on_connection_open((()=>{this.connectionStateChanged.emit([c.Connected]),this.channel.authenticate(this.token,this.nodeId),this.status="Authenticating..."})),this.channel.on_connection_close((()=>{this.connectionStateChanged.emit([c.Disconnected]),this.status="Disconnected"})),this.channel.on_connection_error((e=>{this.connectionStateChanged.emit([c.Error,e]),this.status="Error "+e.message})),this.channel.on_connection_message((()=>{})),this.channel.on_protocol_message((e=>{const{web:i}=e.data;switch(i.type){case d.Error:this.handle_error(i);break;case d.AuthSuccess:this.handle_auth_success(i);break;case d.TunnelOpened:this.handle_tunnel_opened(i);break;case d.TunnelClosed:this.handle_tunnel_closed(i);break;case d.TunnelData:this.handle_tunnel_data(i);break;case d.SFTPListItems:this.handle_sftp_list_items(i);break;default:console.warn("Unhandled protocol message type:",i)}}))}close_comms(){this.channel.stop_heartbeat(),this.channel.disconnect()}clear_creds_buffer(){}reset_session_state(){this.clear_creds_buffer()}list_breadcrumb(e){this.show_loader=!0,this.selected_item=null,this.channel.send_sftp_list_data(this.nodeId,this.session_id,e)}go_to_parent_directory(){this.session_id&&"/"!==this.current_dir&&this.list_breadcrumb(this.breadcrumbs[this.breadcrumbs.length-2]?.path||"/")}refresh_directory(){this.session_id&&this.list_breadcrumb(this.current_dir)}disconnect_session(){this.close_comms(),this.session_id=void 0,this.status="Disconnected",this.show_loader=!1}open_upload_picker(){this.uploadInputEl?.click()}on_upload_selected(e){const i=e.target,t=i.files?.[0];t&&(this.show_error=!0,this.error_message="Upload is not available yet in this widget.",setTimeout((()=>{this.show_error=!1}),2e3),i.value="")}is_selected(e){return!!this.selected_item&&this.selected_item.path===e.path&&this.selected_item.name===e.name}list_directory(e){if(!this.session_id)return void console.warn("No active session. Cannot list directory.");if("File"===e.kind)return console.warn("Cannot list directory of a file. Ignoring click."),void(this.selected_item=e);const i=[e.path,e.name].join("/");i!==this.current_dir?(this.show_loader=!0,this.selected_item=null,this.channel.send_sftp_list_data(this.nodeId,this.session_id,i)):console.warn("Already in this directory. Ignoring click.")}get_full_path(e){return[e.path,e.name].join("/")}render(){return t(a,{key:"c19b87e943347cc55424450e7e4f10bc3447e828",class:{default:!this.max,max:this.max}},t("section",{key:"88ecbc0d1a1460dd262150706216f7f758fb7981",class:"listing"},!this.hideHeader&&t("header",{key:"dd28677d023aeaf431cb3b99449751f6385c767d"},t("section",{key:"ad56b31550d096cb59e92bc6167be11b76a9c368",class:"title"},t("img",{key:"00ce4e832edfb672b0eadb0462a5a132cfa67e09",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS10ZXJtaW5hbCB3LTMuNSBoLTMuNSB0ZXh0LXByaW1hcnkiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iNCAxNyAxMCAxMSA0IDUiPjwvcG9seWxpbmU+CiAgICA8bGluZSB4MT0iMTIiIHgyPSIyMCIgeTE9IjE5IiB5Mj0iMTkiPjwvbGluZT4KPC9zdmc+Cg==",alt:"SFTP Client"}),t("div",{key:"ee186cc2c643afefa425bb6ce862686dce5ba6ab",class:"text"},t("div",{key:"29c5922bf9826930ac33fe6c200bf47fce1e183e",class:"name"},this.name),t("div",{key:"76d6bba6cb51b9907db533395c258ee7458cf5ce",class:"description"},this.description))),t("section",{key:"d3bfbf402aed51cba973830b14b9d4f276011535",class:"actions"},t("div",{key:"87eb4484d8552a582c35e4960a82003f7570bf26",class:"action",onClick:()=>this.toggle_max()},t("img",{key:"3ff40a471fc54a1d97a4aa5c4746dc837082307d",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTE1LCAxMjMsIDE0MCkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtbWF4aW1pemUyIHctMyBoLTMiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iMTUgMyAyMSAzIDIxIDkiPjwvcG9seWxpbmU+CiAgICA8cG9seWxpbmUgcG9pbnRzPSI5IDIxIDMgMjEgMyAxNSI+PC9wb2x5bGluZT4KICAgIDxsaW5lIHgxPSIyMSIgeDI9IjE0IiB5MT0iMyIgeTI9IjEwIj48L2xpbmU+CiAgICA8bGluZSB4MT0iMyIgeDI9IjEwIiB5MT0iMjEiIHkyPSIxNCI+PC9saW5lPgo8L3N2Zz4K",alt:"Maximize"})))),t("main",{key:"a441806676df938682df422acce7b640e452eece"},this.show_navigation&&t("nav",{key:"d7fe91b30ecd998985301c2f0ac5064ee4bfc9fa",class:"navigation"},t("div",{key:"17bd0d958fb55b8a89b6af7becbeb1cd892066a5",class:"breadcrumbs"},this.breadcrumbs.map(((e,i,a)=>t(t.Fragment,null,t("span",{key:i,onClick:()=>this.list_breadcrumb(e.path),class:"breadcrumb"},e.label),i<a.length-1&&t("img",{class:"arrow",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogICAgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIKICAgIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tcmlnaHQgdy0zIGgtMyB0ZXh0LW11dGVkLWZvcmVncm91bmQvNTAgc2hyaW5rLTAiPgogICAgPHBhdGggZD0ibTkgMTggNi02LTYtNiI+PC9wYXRoPgo8L3N2Zz4K"}))))),t("section",{key:"0f65ff3c51a3aeba3bf046445fc858b05e1e5106",class:"actions","aria-label":"SFTP actions"},t("button",{key:"5184ea48385f5b1f235e7fe0a01eed0171782e76",type:"button",class:"action",onClick:()=>this.go_to_parent_directory(),title:"Go to parent directory","aria-label":"Go to parent directory"},t("img",{key:"345aa00fe17569c8d9037e9304b381868effe862",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtYXJyb3ctdXAgdy0zLjUgaC0zLjUiPgogICAgPHBhdGggZD0ibTUgMTIgNy03IDcgNyI+PC9wYXRoPgogICAgPHBhdGggZD0iTTEyIDE5VjUiPjwvcGF0aD4KPC9zdmc+Cg==",alt:"Go up"})),t("button",{key:"eec7a682ed944746eabf939dfff1073bb85dfae6",type:"button",class:"action",onClick:()=>this.refresh_directory(),title:"Refresh","aria-label":"Refresh"},t("img",{key:"ab1faf4dc27ca0a85b152c559b2f4953c7fddb15",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtcmVmcmVzaC1jdyB3LTMuNSBoLTMuNSI+CiAgICA8cGF0aCBkPSJNMyAxMmE5IDkgMCAwIDEgOS05IDkuNzUgOS43NSAwIDAgMSA2Ljc0IDIuNzRMMjEgOCI+PC9wYXRoPgogICAgPHBhdGggZD0iTTIxIDN2NWgtNSI+PC9wYXRoPgogICAgPHBhdGggZD0iTTIxIDEyYTkgOSAwIDAgMS05IDkgOS43NSA5Ljc1IDAgMCAxLTYuNzQtMi43NEwzIDE2Ij48L3BhdGg+CiAgICA8cGF0aCBkPSJNOCAxNkgzdjUiPjwvcGF0aD4KPC9zdmc+Cg==",alt:"Refresh"})),t("button",{key:"529ad0cd6e000978294be16aedb9ec8f2b6d699e",type:"button",class:"action",onClick:()=>this.open_upload_picker(),title:"Upload","aria-label":"Upload"},t("img",{key:"669ceed59555391014ea531e4398517a1c4bc77a",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtdXBsb2FkIHctMy41IGgtMy41Ij4KICAgIDxwYXRoIGQ9Ik0yMSAxNXY0YTIgMiAwIDAgMS0yIDJINWEyIDIgMCAwIDEtMi0ydi00Ij48L3BhdGg+CiAgICA8cG9seWxpbmUgcG9pbnRzPSIxNyA4IDEyIDMgNyA4Ij48L3BvbHlsaW5lPgogICAgPGxpbmUgeDE9IjEyIiB4Mj0iMTIiIHkxPSIzIiB5Mj0iMTUiPjwvbGluZT4KPC9zdmc+Cg==",alt:"Upload"})),t("button",{key:"3b0602bd52a1ed066e76f136ba18e67a2e923f05",type:"button",class:"action disconnect",onClick:()=>this.disconnect_session(),title:"Disconnect","aria-label":"Disconnect"},"DISCONNECT"))),t("input",{key:"272d2fe2f2d61b02c4d2e5c8624f2c0ccc7daa92",type:"file",ref:e=>this.uploadInputEl=e,onChange:e=>this.on_upload_selected(e),style:{display:"none"}}),this.show_content&&t("div",{key:"2f080688bfa4c95663c278d875eceebbda78094a",class:"content"},t("table",{key:"3c10b9615ba21dce3aaa47850d03f083d0ef0107"},t("thead",{key:"366af5b1b875d394450b78b6490c813ac930f0fa"},t("tr",{key:"d3116485a0f02953c96e309f1c44d5e47cea9dcd"},t("th",{key:"6af47d08c0bac5dd887ceda7b3f75101caeaebc3"},"Name"),t("th",{key:"3c8c72711429b988e24118810ef3ea30eb779bb7"},"Size"),t("th",{key:"8dd16c387287e4dd3bf29dbea304f6dd8871686a"},"Permissions"),t("th",{key:"7b2c6ca49d8dd4150895307a4499d3e083cc8900"},"Owner"),t("th",{key:"1723d32cf185dbaeea6d3bd9dbe3f72fc055c5a2"},"Modified"))),t("tbody",{key:"685d9eae4f0ac61e07b44710be235bafaaefa7df"},this.listing.map(((e,i)=>t("tr",{key:i,class:{selected:this.is_selected(e)},onClick:()=>this.list_directory(e)},t("td",null,t("img","Folder"===e.kind?{class:"kind",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS1mb2xkZXIgdy0zLjUgaC0zLjUgdGV4dC1wcmltYXJ5IHNocmluay0wIj4KICAgIDxwYXRoCiAgICAgICAgZD0iTTIwIDIwYTIgMiAwIDAgMCAyLTJWOGEyIDIgMCAwIDAtMi0yaC03LjlhMiAyIDAgMCAxLTEuNjktLjlMOS42IDMuOUEyIDIgMCAwIDAgNy45MyAzSDRhMiAyIDAgMCAwLTIgMnYxM2EyIDIgMCAwIDAgMiAyWiI+PC9wYXRoPgo8L3N2Zz4K",alt:"Folder"}:{class:"kind",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTE1LCAxMjMsIDE0MCkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtZmlsZSB3LTMuNSBoLTMuNSB0ZXh0LW11dGVkLWZvcmVncm91bmQgc2hyaW5rLTAiPgogICAgPHBhdGggZD0iTTE1IDJINmEyIDIgMCAwIDAtMiAydjE2YTIgMiAwIDAgMCAyIDJoMTJhMiAyIDAgMCAwIDItMlY3WiI+PC9wYXRoPgogICAgPHBhdGggZD0iTTE0IDJ2NGEyIDIgMCAwIDAgMiAyaDQiPjwvcGF0aD4KPC9zdmc+Cg==",alt:"File"}),t("span",{class:`name ${e.kind.toLowerCase()}`},e.name)),t("td",null,e.attributes.size),t("td",null,e.attributes.permissions??"-"),t("td",null,e.attributes.user??"-"),t("td",null,new Date(1e3*e.attributes.mtime).toLocaleString()))))))),this.show_loader&&t("div",{key:"8337354a4cd9ca456d7845ff4934ceebb36f7dc6",class:"loader"},"Loading..."),this.show_error&&t("div",{key:"c547ad1c0f24de427a77129f77402830910e98b4",class:"error"},this.error_message)),t("footer",{key:"e452f0e2f7982049df57498ef9ed1cf63c70e9eb"},t("section",{key:"00111d90943b2bfb21392dede79af5e009d43524",class:"status"},t("span",{key:"1c10ae5cb21118059fe61625f9fc4d0aa18be448"},this.status),this.selected_item&&t("span",{key:"82939fb59d72ca3823e8c580578a6f13ce4079b0",class:"selected-item"},this.get_full_path(this.selected_item))),t("section",{key:"38380847cf818eb024ec5743ffd92e3369b2cc40",class:"version"},"Version: ",this.version))),this.show_login_screen&&t("section",{key:"1840f9bae95e8906c38dade1e15f6c52f360829b",class:{creds:!0,blurred:this.show_login_screen}},t("form",{key:"b7b7c3494329a93aafc6c948c879ba8ecd8bd42a",class:"auth",onSubmit:e=>{const i=new FormData(e.target);let t,a;this.show_login_screen_username&&(t=i.get("username")),this.show_login_screen_password&&(a=i.get("password")),this.channel.open_sftp_tunnel(this.nodeId,t,a),this.show_login_screen_username=!1,this.show_login_screen_password=!1,this.show_login_screen=!1,this.show_loader=!0,e.stopPropagation(),e.preventDefault()}},t("div",{key:"25a15115fb41d65d59750a176d46a7e844286e00",class:"title"},"SFTP Connection"),this.show_login_screen_username&&t("div",{key:"13f5053dbf65445220551f554df5ab03fb7fb7c0"},t("label",{key:"5016afe8eb38c54800697fbe2d4602269966edc9",htmlFor:"username"},"Username"),t("input",{key:"48e7e3029b0369e06f5d1bafcf4bc9bc3fccfb1a",id:"username",autoComplete:"off",name:"username",type:"text",placeholder:""})),this.show_login_screen_password&&t("div",{key:"cd06fc73813094a57899c3be077f3dba0a5ca133"},t("label",{key:"f64e3145d4df56d4654dedb0188c2a33db09634b",htmlFor:"password"},"Password"),t("input",{key:"6e22d7cfbf40b8d2e77a23730d55df2e900d5da7",id:"password",autoComplete:"off",name:"password",type:"password",placeholder:""})),t("div",{key:"9405dbf23cb588db9b2368c3155a9230ab046438"},t("button",{key:"b8087e7b9a828db3d6b36f8fe06d564c76d01402",type:"submit"},"Connect")))))}static get watchers(){return{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}}};l.style=":host{--radius:0.375rem;--card:220 18% 10%;--border:220 15% 18%;--primary:160 60% 45%;--radius:0.375rem;--destructive:0 70% 50%;--muted:220 15% 13%;--muted-foreground:220 10% 50%;--primary-foreground:220 20% 7%;--scroll-track:220 16% 12%;--scroll-thumb:220 12% 34%;--scroll-thumb-hover:160 45% 44%;font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;height:100%;width:100%;border:1px solid hsl(var(--border));background-color:hsl(var(--card));border-radius:var(--radius);overflow:hidden;display:flex;flex-direction:column;position:relative;.listing{flex:1;display:flex;flex-direction:column;justify-content:space-between;min-height:0;header{height:30px;background:rgba(28, 31, 38, 0.6);border-bottom:1px solid hsl(var(--border));display:flex;align-items:center;justify-content:space-between;.actions{display:flex;align-items:center;.action{cursor:pointer;padding:4px;display:flex;align-items:center;z-index:1;img{height:14px;padding:4px;border-radius:4px}&:hover{background-color:hsl(var(--border) / 0.6)}}}.title{color:hsl(var(--primary));height:14px;padding:0 12px;display:flex;align-items:center;font-size:0.75rem;line-height:1rem;img{height:14px;margin-right:5px}.text{display:flex;flex-direction:row;justify-content:center;margin-top:2px;.name{margin-right:10px}.description{color:hsl(var(--muted-foreground))}}}}main{flex:1;display:flex;flex-direction:column;position:relative;min-height:0;overflow:hidden;.loader{color:hsl(var(--muted-foreground));font-size:13px;animation:pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;text-align:center;display:flex;align-items:center;justify-content:center;position:absolute;height:100%;width:100%;background:rgba(28, 31, 38, 0);backdrop-filter:blur(4px)}.error{font-size:13px;text-align:center;color:hsl(var(--destructive));height:100%;display:flex;align-items:center;justify-content:center}.navigation{height:25px;padding:10px;font-size:0.75rem;line-height:1rem;background-color:hsl(var(--card));display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid hsl(var(--border));position:sticky;top:0;z-index:3;.breadcrumbs{display:flex;align-items:center;margin-right:10px;.breadcrumb{color:hsl(var(--primary));margin-right:4px;cursor:pointer;&:after{margin-left:4px}&:hover{color:rgb(189, 219, 209)}&:last-child{margin-right:0;color:rgb(189, 219, 209);cursor:default}}.arrow{height:12px;width:12px;opacity:0.6;top:2px;margin-right:4px;position:relative}}.actions{display:flex;align-items:center;gap:8px}.action{border:none;background:transparent;color:rgb(189, 219, 209);font-size:1.1rem;line-height:1;padding:2px 4px;border-radius:4px;cursor:pointer;&:hover{background-color:hsl(var(--border) / 0.6)}img{height:14px;width:14px;display:block}}.action.disconnect{color:#ff4d5f;font-size:0.65rem;letter-spacing:0.08em;padding:4px 8px;&:hover{color:#ff6b7a;background-color:hsl(var(--destructive) / 0.12)}}}.content{flex:1;min-height:0;overflow:auto;font-size:0.75rem;line-height:1rem;scrollbar-width:thin;scrollbar-color:hsl(var(--scroll-thumb)) hsl(var(--scroll-track));&::-webkit-scrollbar{width:10px;height:10px}&::-webkit-scrollbar-track{background:hsl(var(--scroll-track))}&::-webkit-scrollbar-thumb{background:hsl(var(--scroll-thumb));border-radius:999px;border:2px solid hsl(var(--scroll-track))}&::-webkit-scrollbar-thumb:hover{background:hsl(var(--scroll-thumb-hover))}table{width:100%;border-collapse:separate;border-spacing:0;thead{background-color:hsl(var(--muted));border-bottom:1px solid hsl(var(--border));th{padding:8px 10px;text-align:left;color:hsl(var(--muted-foreground));position:sticky;top:0;z-index:2;background-color:hsl(var(--muted));border-bottom:1px solid hsl(var(--border));line-height:0.95rem}}tbody{padding:10px 10px;tr{border-bottom:1px solid hsl(var(--border) / 0.4);td{padding:10px 10px 9px;color:hsl(var(--muted-foreground));.name{&.file{color:rgb(189, 219, 209)}&.folder{color:hsl(var(--primary))}}.kind{height:14px;width:14px;margin-right:5px;top:3px;position:relative}}&:hover{cursor:pointer;background-color:hsl(var(--muted) / 0.4)}&.selected{background-color:hsl(var(--primary) / 0.3);&:hover{background-color:hsl(var(--primary) / 0.4)}}}}}}}footer{height:25px;background:rgba(28, 31, 38, 0.6);border-top:1px solid hsl(var(--border));font-size:0.75rem;line-height:1rem;display:flex;align-items:center;justify-content:space-between;padding:0 10px;.status{font-size:0.65rem;color:hsl(var(--muted-foreground));.selected-item{margin-left:10px;color:hsl(var(--primary))}}.version{font-size:0.65rem;color:hsl(var(--muted-foreground))}}}.creds{position:absolute;top:0;left:0;height:100%;width:100%;display:flex;justify-content:center;align-items:center;;&.blurred{background:rgba(28, 31, 38, 0);backdrop-filter:blur(4px)}.auth{display:flex;flex-direction:column;background:hsl(var(--card));position:relative;background-color:rgba(21, 24, 30, 0.95);border:1px solid hsl(var(--border));padding:30px;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.5) 0px 25px 50px -12px;border-radius:var(--radius);.title{margin-bottom:12px;color:hsl(var(--primary))}label{font-size:0.75rem;line-height:1rem;margin-bottom:1rem;color:hsl(var(--muted-foreground))}input{font-size:0.875rem;line-height:1.25rem;padding-top:0.5rem;padding-bottom:0.5rem;padding-left:0.75rem;padding-right:0.75rem;background-color:rgb(28, 31, 38);border-color:rgb(39, 44, 53);border-width:1px;border-radius:calc(var(--radius) - 2px);width:100%;margin-bottom:12px;color:rgb(189, 219, 209);box-sizing:border-box;&:focus{outline:none;border-color:hsl(var(--primary));box-shadow:0 0 0 1px hsl(var(--primary))}}button[type='submit']{margin-top:12px;width:100%;background-color:hsl(var(--primary));color:hsl(var(--primary-foreground));letter-spacing:0.05em;font-size:13px;font-weight:500;padding:0.5rem 1rem;border-radius:calc(var(--radius) - 2px);height:2rem;cursor:pointer;border:none;&:hover{background-color:hsl(var(--primary) / 0.9)}}}}}:host(.max){height:100vh;width:100vw;position:fixed;top:0;left:0;z-index:9999}";export{l as phirepass_sftp_client}
|