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
|
@@ -2,15 +2,22 @@ import { Host, h } from "@stencil/core";
|
|
|
2
2
|
import init, { Channel as PhirepassChannel } from "phirepass-channel";
|
|
3
3
|
import svg from "./phirepass-sftp-client.logo.svg";
|
|
4
4
|
import max from "./phirepass-sftp-client.max.svg";
|
|
5
|
-
import
|
|
5
|
+
import chevron from "./phirepass-sftp-client.chevron.svg";
|
|
6
|
+
import folder from "./phirepass-sftp-client.folder.svg";
|
|
7
|
+
import file from "./phirepass-sftp-client.file.svg";
|
|
8
|
+
import go_up from "./phirepass-sftp-client.go_up.svg";
|
|
9
|
+
import refresh from "./phirepass-sftp-client.refresh.svg";
|
|
10
|
+
import upload from "./phirepass-sftp-client.upload.svg";
|
|
11
|
+
import { ConnectionState, ProtocolMessageError, ProtocolMessageType } from "../../common/protocol";
|
|
6
12
|
// https://sweet-sftp-view.lovable.app/
|
|
7
13
|
export class PhirepassSftpClient {
|
|
8
14
|
channel;
|
|
9
15
|
domReady = false;
|
|
10
16
|
runtimeReady = false;
|
|
11
17
|
connected = false;
|
|
18
|
+
uploadInputEl;
|
|
12
19
|
// private inputMode: InputMode = InputMode.Default;
|
|
13
|
-
|
|
20
|
+
session_id;
|
|
14
21
|
// private usernameBuffer = "";
|
|
15
22
|
// private passwordBuffer = "";
|
|
16
23
|
name = 'SFTP';
|
|
@@ -36,6 +43,7 @@ export class PhirepassSftpClient {
|
|
|
36
43
|
if (newValue) {
|
|
37
44
|
this.open_comms();
|
|
38
45
|
this.channel.connect();
|
|
46
|
+
this.status = 'Connecting...';
|
|
39
47
|
}
|
|
40
48
|
}
|
|
41
49
|
serverId;
|
|
@@ -53,7 +61,18 @@ export class PhirepassSftpClient {
|
|
|
53
61
|
max = false;
|
|
54
62
|
show_login_screen = false;
|
|
55
63
|
show_login_screen_username = false;
|
|
64
|
+
show_error = false;
|
|
65
|
+
error_message = '';
|
|
56
66
|
show_login_screen_password = false;
|
|
67
|
+
show_navigation = false;
|
|
68
|
+
breadcrumbs = [];
|
|
69
|
+
current_dir = '.';
|
|
70
|
+
listing = [];
|
|
71
|
+
show_content = false;
|
|
72
|
+
show_loader = false;
|
|
73
|
+
version = '';
|
|
74
|
+
status = 'Disconnected';
|
|
75
|
+
selected_item = null;
|
|
57
76
|
toggle_max() {
|
|
58
77
|
this.maximizeEvent?.emit(!this.max);
|
|
59
78
|
}
|
|
@@ -90,6 +109,7 @@ export class PhirepassSftpClient {
|
|
|
90
109
|
connect() {
|
|
91
110
|
this.connected = true;
|
|
92
111
|
this.channel.connect();
|
|
112
|
+
this.status = 'Connecting...';
|
|
93
113
|
// const container = this.containerEl;
|
|
94
114
|
// console.log('Attempting to connect terminal to container:', container);
|
|
95
115
|
// if (container) {
|
|
@@ -123,22 +143,63 @@ export class PhirepassSftpClient {
|
|
|
123
143
|
}
|
|
124
144
|
return `${protocol}://${this.serverHost}:${this.serverPort}`;
|
|
125
145
|
}
|
|
126
|
-
handle_error(
|
|
127
|
-
|
|
146
|
+
handle_error(error) {
|
|
147
|
+
switch (error.kind) {
|
|
148
|
+
case ProtocolMessageError.Generic:
|
|
149
|
+
case ProtocolMessageError.Authentication:
|
|
150
|
+
this.error_message = error.message || 'An unknown error occurred.';
|
|
151
|
+
break;
|
|
152
|
+
case ProtocolMessageError.RequiresUsername:
|
|
153
|
+
this.show_login_screen_username = true;
|
|
154
|
+
this.show_login_screen_password = false;
|
|
155
|
+
this.show_login_screen = true;
|
|
156
|
+
break;
|
|
157
|
+
case ProtocolMessageError.RequiresPassword:
|
|
158
|
+
this.show_login_screen_username = false;
|
|
159
|
+
this.show_login_screen_password = true;
|
|
160
|
+
this.show_login_screen = true;
|
|
161
|
+
break;
|
|
162
|
+
case ProtocolMessageError.RequiresUsernamePassword:
|
|
163
|
+
this.show_login_screen_username = true;
|
|
164
|
+
this.show_login_screen_password = true;
|
|
165
|
+
this.show_login_screen = true;
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
setTimeout(() => {
|
|
169
|
+
this.show_loader = false;
|
|
170
|
+
}, 1_000);
|
|
128
171
|
}
|
|
129
|
-
handle_auth_success(
|
|
172
|
+
handle_auth_success(auth) {
|
|
130
173
|
this.clear_creds_buffer();
|
|
174
|
+
this.version = auth.version;
|
|
131
175
|
this.channel.start_heartbeat(this.heartbeatInterval <= 15_000 ? 30_000 : this.heartbeatInterval);
|
|
132
176
|
this.channel.open_sftp_tunnel(this.nodeId);
|
|
177
|
+
this.status = 'Connected';
|
|
133
178
|
}
|
|
134
|
-
handle_tunnel_opened(
|
|
135
|
-
|
|
179
|
+
handle_tunnel_opened(web) {
|
|
180
|
+
this.session_id = web.sid;
|
|
136
181
|
// this.terminal.reset();
|
|
137
182
|
// this.fit_terminal_safely();
|
|
138
183
|
// this.send_ssh_terminal_resize();
|
|
184
|
+
this.channel.send_sftp_list_data(this.nodeId, this.session_id, this.current_dir);
|
|
185
|
+
}
|
|
186
|
+
handle_sftp_list_items(web) {
|
|
187
|
+
setTimeout(() => {
|
|
188
|
+
this.show_loader = false;
|
|
189
|
+
}, 500);
|
|
190
|
+
this.listing = web.dir.items;
|
|
191
|
+
this.current_dir = web.path;
|
|
192
|
+
this.breadcrumbs = web.path.split('/').map((path, index, arr) => {
|
|
193
|
+
if (path === '' && index === 0) {
|
|
194
|
+
return { label: '/', path: '/' };
|
|
195
|
+
}
|
|
196
|
+
return { label: path, path: arr.slice(0, index + 1).join('/') };
|
|
197
|
+
});
|
|
198
|
+
this.show_content = true;
|
|
199
|
+
this.show_navigation = true;
|
|
139
200
|
}
|
|
140
|
-
handle_tunnel_data(
|
|
141
|
-
|
|
201
|
+
handle_tunnel_data(web) {
|
|
202
|
+
console.log('received tunnel data:', web);
|
|
142
203
|
}
|
|
143
204
|
handle_tunnel_closed(_web_) {
|
|
144
205
|
// this.session_id = undefined;
|
|
@@ -158,16 +219,18 @@ export class PhirepassSftpClient {
|
|
|
158
219
|
this.channel.on_connection_open(() => {
|
|
159
220
|
this.connectionStateChanged.emit([ConnectionState.Connected]);
|
|
160
221
|
this.channel.authenticate(this.token, this.nodeId);
|
|
222
|
+
this.status = 'Authenticating...';
|
|
161
223
|
});
|
|
162
224
|
this.channel.on_connection_close(() => {
|
|
163
225
|
this.connectionStateChanged.emit([ConnectionState.Disconnected]);
|
|
164
|
-
|
|
226
|
+
this.status = 'Disconnected';
|
|
165
227
|
});
|
|
166
228
|
this.channel.on_connection_error((err) => {
|
|
167
229
|
this.connectionStateChanged.emit([ConnectionState.Error, err]);
|
|
230
|
+
this.status = 'Error ' + err.message;
|
|
168
231
|
});
|
|
169
232
|
this.channel.on_connection_message((_raw_) => {
|
|
170
|
-
//
|
|
233
|
+
//
|
|
171
234
|
});
|
|
172
235
|
this.channel.on_protocol_message((msg) => {
|
|
173
236
|
const { web } = msg.data;
|
|
@@ -187,8 +250,11 @@ export class PhirepassSftpClient {
|
|
|
187
250
|
case ProtocolMessageType.TunnelData:
|
|
188
251
|
this.handle_tunnel_data(web);
|
|
189
252
|
break;
|
|
253
|
+
case ProtocolMessageType.SFTPListItems:
|
|
254
|
+
this.handle_sftp_list_items(web);
|
|
255
|
+
break;
|
|
190
256
|
default:
|
|
191
|
-
console.warn('
|
|
257
|
+
console.warn('Unhandled protocol message type:', web);
|
|
192
258
|
}
|
|
193
259
|
});
|
|
194
260
|
}
|
|
@@ -205,15 +271,109 @@ export class PhirepassSftpClient {
|
|
|
205
271
|
// this.inputMode = InputMode.Default;
|
|
206
272
|
this.clear_creds_buffer();
|
|
207
273
|
}
|
|
274
|
+
list_breadcrumb(path) {
|
|
275
|
+
this.show_loader = true;
|
|
276
|
+
this.selected_item = null;
|
|
277
|
+
this.channel.send_sftp_list_data(this.nodeId, this.session_id, path);
|
|
278
|
+
}
|
|
279
|
+
go_to_parent_directory() {
|
|
280
|
+
if (!this.session_id) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
if (this.current_dir === '/') {
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
const parent = this.breadcrumbs[this.breadcrumbs.length - 2]?.path || '/';
|
|
287
|
+
this.list_breadcrumb(parent);
|
|
288
|
+
}
|
|
289
|
+
refresh_directory() {
|
|
290
|
+
if (!this.session_id) {
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
this.list_breadcrumb(this.current_dir);
|
|
294
|
+
}
|
|
295
|
+
disconnect_session() {
|
|
296
|
+
this.close_comms();
|
|
297
|
+
this.session_id = undefined;
|
|
298
|
+
this.status = 'Disconnected';
|
|
299
|
+
this.show_loader = false;
|
|
300
|
+
}
|
|
301
|
+
open_upload_picker() {
|
|
302
|
+
this.uploadInputEl?.click();
|
|
303
|
+
}
|
|
304
|
+
on_upload_selected(event) {
|
|
305
|
+
const input = event.target;
|
|
306
|
+
const file = input.files?.[0];
|
|
307
|
+
if (!file) {
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
this.show_error = true;
|
|
311
|
+
this.error_message = 'Upload is not available yet in this widget.';
|
|
312
|
+
setTimeout(() => {
|
|
313
|
+
this.show_error = false;
|
|
314
|
+
}, 2_000);
|
|
315
|
+
input.value = '';
|
|
316
|
+
}
|
|
317
|
+
is_selected(item) {
|
|
318
|
+
if (!this.selected_item) {
|
|
319
|
+
return false;
|
|
320
|
+
}
|
|
321
|
+
return this.selected_item.path === item.path &&
|
|
322
|
+
this.selected_item.name === item.name;
|
|
323
|
+
}
|
|
324
|
+
list_directory(entry) {
|
|
325
|
+
if (!this.session_id) {
|
|
326
|
+
console.warn('No active session. Cannot list directory.');
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
if (entry.kind === 'File') {
|
|
330
|
+
console.warn('Cannot list directory of a file. Ignoring click.');
|
|
331
|
+
this.selected_item = entry;
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
const path = [entry.path, entry.name].join('/');
|
|
335
|
+
if (path === this.current_dir) {
|
|
336
|
+
console.warn('Already in this directory. Ignoring click.');
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
this.show_loader = true;
|
|
340
|
+
this.selected_item = null;
|
|
341
|
+
this.channel.send_sftp_list_data(this.nodeId, this.session_id, path);
|
|
342
|
+
}
|
|
343
|
+
get_full_path(item) {
|
|
344
|
+
return [item.path, item.name].join('/');
|
|
345
|
+
}
|
|
208
346
|
render() {
|
|
209
|
-
return (h(Host, { key: '
|
|
347
|
+
return (h(Host, { key: 'c19b87e943347cc55424450e7e4f10bc3447e828', class: {
|
|
210
348
|
'default': !this.max,
|
|
211
349
|
'max': this.max,
|
|
212
|
-
} }, h("section", { key: '
|
|
213
|
-
h("header", { key: '
|
|
214
|
-
'
|
|
215
|
-
|
|
216
|
-
|
|
350
|
+
} }, h("section", { key: '88ecbc0d1a1460dd262150706216f7f758fb7981', class: "listing" }, !this.hideHeader &&
|
|
351
|
+
h("header", { key: 'dd28677d023aeaf431cb3b99449751f6385c767d' }, h("section", { key: 'ad56b31550d096cb59e92bc6167be11b76a9c368', class: "title" }, h("img", { key: '00ce4e832edfb672b0eadb0462a5a132cfa67e09', src: svg, 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: max, 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: chevron }))))), 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: go_up, 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: refresh, 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: upload, 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: {
|
|
352
|
+
'selected': this.is_selected(item),
|
|
353
|
+
}, onClick: () => this.list_directory(item) }, h("td", null, item.kind === 'Folder' ? h("img", { class: "kind", src: folder, alt: "Folder" }) : h("img", { class: "kind", src: file, 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 &&
|
|
354
|
+
h("section", { key: '1840f9bae95e8906c38dade1e15f6c52f360829b', class: {
|
|
355
|
+
'creds': true,
|
|
356
|
+
'blurred': this.show_login_screen,
|
|
357
|
+
} }, h("form", { key: 'b7b7c3494329a93aafc6c948c879ba8ecd8bd42a', class: "auth", onSubmit: (event) => {
|
|
358
|
+
const formData = new FormData(event.target);
|
|
359
|
+
let username = undefined;
|
|
360
|
+
if (this.show_login_screen_username) {
|
|
361
|
+
username = formData.get('username');
|
|
362
|
+
}
|
|
363
|
+
let password = undefined;
|
|
364
|
+
if (this.show_login_screen_password) {
|
|
365
|
+
password = formData.get('password');
|
|
366
|
+
}
|
|
367
|
+
this.channel.open_sftp_tunnel(this.nodeId, username, password);
|
|
368
|
+
this.show_login_screen_username = false;
|
|
369
|
+
this.show_login_screen_password = false;
|
|
370
|
+
this.show_login_screen = false;
|
|
371
|
+
this.show_loader = true;
|
|
372
|
+
event.stopPropagation();
|
|
373
|
+
event.preventDefault();
|
|
374
|
+
} }, h("div", { key: '25a15115fb41d65d59750a176d46a7e844286e00', class: "title" }, "SFTP Connection"), this.show_login_screen_username &&
|
|
375
|
+
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 &&
|
|
376
|
+
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"))))));
|
|
217
377
|
}
|
|
218
378
|
static get is() { return "phirepass-sftp-client"; }
|
|
219
379
|
static get encapsulation() { return "shadow"; }
|
|
@@ -433,7 +593,18 @@ export class PhirepassSftpClient {
|
|
|
433
593
|
"max": {},
|
|
434
594
|
"show_login_screen": {},
|
|
435
595
|
"show_login_screen_username": {},
|
|
436
|
-
"
|
|
596
|
+
"show_error": {},
|
|
597
|
+
"error_message": {},
|
|
598
|
+
"show_login_screen_password": {},
|
|
599
|
+
"show_navigation": {},
|
|
600
|
+
"breadcrumbs": {},
|
|
601
|
+
"current_dir": {},
|
|
602
|
+
"listing": {},
|
|
603
|
+
"show_content": {},
|
|
604
|
+
"show_loader": {},
|
|
605
|
+
"version": {},
|
|
606
|
+
"status": {},
|
|
607
|
+
"selected_item": {}
|
|
437
608
|
};
|
|
438
609
|
}
|
|
439
610
|
static get events() {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
|
2
|
+
stroke="rgb(189, 219, 209)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
|
3
|
+
class="lucide lucide-refresh-cw w-3.5 h-3.5">
|
|
4
|
+
<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"></path>
|
|
5
|
+
<path d="M21 3v5h-5"></path>
|
|
6
|
+
<path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"></path>
|
|
7
|
+
<path d="M8 16H3v5"></path>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
|
|
2
|
+
stroke="rgb(189, 219, 209)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
|
3
|
+
class="lucide lucide-upload w-3.5 h-3.5">
|
|
4
|
+
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
|
|
5
|
+
<polyline points="17 8 12 3 7 8"></polyline>
|
|
6
|
+
<line x1="12" x2="12" y1="3" y2="15"></line>
|
|
7
|
+
</svg>
|
|
@@ -482,7 +482,7 @@ export class PhirepassTerminal {
|
|
|
482
482
|
this.usernameBuffer = "";
|
|
483
483
|
}
|
|
484
484
|
render() {
|
|
485
|
-
return (h(Host, { key: '
|
|
485
|
+
return (h(Host, { key: '13831d1794d5739dcd61460571dbdd86eb3b7368' }, h("div", { key: '1a68fbc0c601df5525e278627567fa1c62c59992', id: "ccc", ref: el => (this.containerEl = el) })));
|
|
486
486
|
}
|
|
487
487
|
static get is() { return "phirepass-terminal"; }
|
|
488
488
|
static get encapsulation() { return "shadow"; }
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t,e,n){const l="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==l;){const l=Object.getOwnPropertyDescriptor(t,e);if(l&&(!n||l.get))return l;t=Object.getPrototypeOf(t)}}var e,n=(e,n)=>{var l;Object.entries(null!=(l=n.l.t)?l:{}).map((([l,[o]])=>{if(31&o||32&o){const o=e[l],s=t(Object.getPrototypeOf(e),l,!0)||Object.getOwnPropertyDescriptor(e,l);s&&Object.defineProperty(e,l,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:!0,enumerable:!0}),n.o.has(l)?e[l]=n.o.get(l):void 0!==o&&(e[l]=o)}}))},l=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},o=(t,e)=>e in t,s=(t,e)=>(0,console.error)(t,e),i=new Map,r="undefined"!=typeof window?window:{},c=r.HTMLElement||class{},f={i:0,u:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,l)=>t.addEventListener(e,n,l),rel:(t,e,n,l)=>t.removeEventListener(e,n,l),ce:(t,e)=>new CustomEvent(t,e)},u=(()=>{try{return!!r.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),a=!!u&&(()=>!!r.document&&Object.getOwnPropertyDescriptor(r.document.adoptedStyleSheets,"length").writable)(),p=!1,d=[],h=[],m=(t,e)=>n=>{t.push(n),p||(p=!0,e&&4&f.i?$(y):f.raf(y))},b=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){s(t)}t.length=0},y=()=>{b(d),b(h),(p=d.length>0)&&f.raf(y)},$=t=>Promise.resolve(void 0).then(t),v=m(h,!0),w=t=>{const e=new URL(t,f.u);return e.origin!==r.location.origin?e.href:e.pathname},g=t=>f.u=t;function j(){const t=this.attachShadow({mode:"open"});void 0===e&&(e=null),e&&(a?t.adoptedStyleSheets.push(e):t.adoptedStyleSheets=[...t.adoptedStyleSheets,e])}var O,S=new WeakMap,k=t=>"sc-"+t.p,M=t=>"object"==(t=typeof t)||"function"===t,E=(t,e,...n)=>{let l=null,o=null,s=!1,i=!1;const r=[],c=e=>{for(let n=0;n<e.length;n++)l=e[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof t&&!M(l))&&(l+=""),s&&i?r[r.length-1].h+=l:r.push(s?C(null,l):l),i=s)};if(c(n),e){e.key&&(o=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}const f=C(t,null);return f.m=e,r.length>0&&(f.$=r),f.v=o,f},C=(t,e)=>({i:0,j:t,h:null!=e?e:null,O:null,$:null,m:null,v:null}),x={},A=t=>{if(!t)return;const e=Object.keys(t);if(0===e.length)return;let n=!1;for(const l of e){if(n)break;for(const e of t[l])if("string"==typeof e){n=!0;break}}if(!n)return t;const l={};for(const n of e)l[n]=t[n].map((t=>"string"==typeof t?{[t]:0}:t));return l},L=(t,e)=>null==t||M(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?"string"==typeof t?parseFloat(t):"number"==typeof t?t:NaN:1&e?t+"":t,N=(t,e)=>{const n=t;return{emit:t=>_(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},_=(t,e,n)=>{const l=f.ce(e,n);return t.dispatchEvent(l),l},D=(t,e,n,s,i,c)=>{if(n===s)return;let u=o(t,e),a=e.toLowerCase();if("class"===e){const e=t.classList,l=P(n);let o=P(s);e.remove(...l.filter((t=>t&&!o.includes(t)))),e.add(...o.filter((t=>t&&!l.includes(t))))}else if("key"===e);else if("ref"===e)s&&J(s,t);else if(t.__lookupSetter__(e)||"o"!==e[0]||"n"!==e[1]){if("a"===e[0]&&e.startsWith("attr:")){const n=e.slice(5);let o;{const e=l(t);if(e&&e.l&&e.l.t){const t=e.l.t[n];t&&t[1]&&(o=t[1])}}return o||(o=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==s||!1===s?!1===s&&""!==t.getAttribute(o)||t.removeAttribute(o):t.setAttribute(o,!0===s?"":s))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=s}catch(t){}return}{const l=M(s);if((u||l&&null!==s)&&!i)try{if(t.tagName.includes("-"))t[e]!==s&&(t[e]=s);else{const l=null==s?"":s;"list"===e?u=!1:null!=n&&t[e]===l||("function"==typeof t.__lookupSetter__(e)?t[e]=l:t.setAttribute(e,l))}}catch(t){}null==s||!1===s?!1===s&&""!==t.getAttribute(e)||t.removeAttribute(e):(!u||4&c||i)&&!l&&1===t.nodeType&&t.setAttribute(e,s=!0===s?"":s)}}else if(e="-"===e[2]?e.slice(3):o(r,a)?a.slice(2):a[2]+e.slice(3),n||s){const l=e.endsWith(R);e=e.replace(U,""),n&&f.rel(t,e,n,l),s&&f.ael(t,e,s,l)}},H=/\s/,P=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(H):[]),R="Capture",U=RegExp(R+"$"),W=(t,e,n)=>{const l=11===e.O.nodeType&&e.O.host?e.O.host:e.O,o=t&&t.m||{},s=e.m||{};for(const t of F(Object.keys(o)))t in s||D(l,t,o[t],void 0,n,e.i);for(const t of F(Object.keys(s)))D(l,t,o[t],s[t],n,e.i)};function F(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var V=!1,q=[],z=[],T=(t,e,n)=>{const l=e.$[n];let o,s,i=0;if(null!=l.h)o=l.O=r.document.createTextNode(l.h);else{if(!r.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(o=l.O=r.document.createElement(l.j),W(null,l,V),l.$){const e="template"===l.j?o.content:o;for(i=0;i<l.$.length;++i)s=T(t,l,i),s&&e.appendChild(s)}}return o["s-hn"]=O,o},Y=(t,e,n,l,o,s)=>{let i,r=t;for(r.shadowRoot&&r.tagName===O&&(r=r.shadowRoot),"template"===n.j&&(r=r.content);o<=s;++o)l[o]&&(i=T(null,n,o),i&&(l[o].O=i,K(r,i,e)))},Z=(t,e,n)=>{for(let l=e;l<=n;++l){const e=t[l];if(e){const t=e.O;I(e),t&&t.remove()}}},B=(t,e,n=!1)=>t.j===e.j&&(n?(n&&!t.v&&e.v&&(t.v=e.v),!0):t.v===e.v),G=(t,e,n=!1)=>{const l=e.O=t.O,o=t.$,s=e.$,i=e.h;null==i?(W(t,e,V),null!==o&&null!==s?((t,e,n,l,o=!1)=>{let s,i,r=0,c=0,f=0,u=0,a=e.length-1,p=e[0],d=e[a],h=l.length-1,m=l[0],b=l[h];const y="template"===n.j?t.content:t;for(;r<=a&&c<=h;)if(null==p)p=e[++r];else if(null==d)d=e[--a];else if(null==m)m=l[++c];else if(null==b)b=l[--h];else if(B(p,m,o))G(p,m,o),p=e[++r],m=l[++c];else if(B(d,b,o))G(d,b,o),d=e[--a],b=l[--h];else if(B(p,b,o))G(p,b,o),K(y,p.O,d.O.nextSibling),p=e[++r],b=l[--h];else if(B(d,m,o))G(d,m,o),K(y,d.O,p.O),d=e[--a],m=l[++c];else{for(f=-1,u=r;u<=a;++u)if(e[u]&&null!==e[u].v&&e[u].v===m.v){f=u;break}f>=0?(i=e[f],i.j!==m.j?s=T(e&&e[c],n,f):(G(i,m,o),e[f]=void 0,s=i.O),m=l[++c]):(s=T(e&&e[c],n,c),m=l[++c]),s&&K(p.O.parentNode,s,p.O)}r>a?Y(t,null==l[h+1]?null:l[h+1].O,n,l,c,h):c>h&&Z(e,r,a)})(l,o,e,s,n):null!==s?(null!==t.h&&(l.textContent=""),Y(l,null,e,s,0,s.length-1)):!n&&null!==o&&Z(o,0,o.length-1)):t.h!==i&&(l.data=i)},I=t=>{t.m&&t.m.ref&&q.push((()=>t.m.ref(null))),t.$&&t.$.map(I)},J=(t,e)=>{z.push((()=>t(e)))},K=(t,e,n)=>t.__insertBefore?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n),Q=(t,e,n=!1)=>{const l=t.$hostElement$,o=t.S||C(null,null),s=(t=>t&&t.j===x)(e)?e:E(null,null,e);if(O=l.tagName,n&&s.m)for(const t of Object.keys(s.m))l.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(s.m[t]=l[t]);s.j=null,s.i|=4,t.S=s,s.O=o.O=l.shadowRoot||l,G(o,s,n),q.forEach((t=>t())),q.length=0,z.forEach((t=>t())),z.length=0},X=(t,e)=>{if(e&&!t.k&&e["s-p"]){const n=e["s-p"].push(new Promise((l=>t.k=()=>{e["s-p"].splice(n-1,1),l()})))}},tt=(t,e)=>{if(t.i|=16,4&t.i)return void(t.i|=512);X(t,t.M);const n=()=>et(t,e);if(!e)return v(n);queueMicrotask((()=>{n()}))},et=(t,e)=>{const n=t.$hostElement$,l=n;if(!l)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let o;return o=ct(l,e?"componentWillLoad":"componentWillUpdate",void 0,n),o=nt(o,(()=>ct(l,"componentWillRender",void 0,n))),nt(o,(()=>ot(t,l,e)))},nt=(t,e)=>lt(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),lt=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,ot=async(t,e,n)=>{var l;const o=t.$hostElement$,s=o["s-rc"];n&&(t=>{const e=t.l,n=t.$hostElement$,l=e.i,o=((t,e)=>{var n,l,o;const s=k(e),c=i.get(s);if(!r.document)return s;if(t=11===t.nodeType?t:r.document,c)if("string"==typeof c){let o,i=S.get(t=t.head||t);if(i||S.set(t,i=new Set),!i.has(s)){o=r.document.createElement("style"),o.textContent=c;const p=null!=(n=f.C)?n:function(){var t,e,n;return null!=(n=null==(e=null==(t=r.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:e.getAttribute("content"))?n:void 0}();if(null!=p&&o.setAttribute("nonce",p),!(1&e.i))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(o,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(u){const e=new(null!=(l=t.defaultView)?l:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(c),a?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=c+e.textContent:t.prepend(o)}else t.append(o);1&e.i&&t.insertBefore(o,null),4&e.i&&(o.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),i&&i.add(s)}}else{let e=S.get(t);if(e||S.set(t,e=new Set),!e.has(s)){const n=null!=(o=t.defaultView)?o:t.ownerDocument.defaultView;let l;if(c.constructor===n.CSSStyleSheet)l=c;else{l=new n.CSSStyleSheet;for(let t=0;t<c.cssRules.length;t++)l.insertRule(c.cssRules[t].cssText,t)}a?t.adoptedStyleSheets.push(l):t.adoptedStyleSheets=[...t.adoptedStyleSheets,l],e.add(s)}}return s})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(t);st(t,e,o,n),s&&(s.map((t=>t())),o["s-rc"]=void 0);{const e=null!=(l=o["s-p"])?l:[],n=()=>it(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.i|=4,e.length=0)}},st=(t,e,n,l)=>{try{e=e.render(),t.i&=-17,t.i|=2,Q(t,e,l)}catch(e){s(e,t.$hostElement$)}return null},it=t=>{const e=t.$hostElement$,n=e,l=t.M;ct(n,"componentDidRender",void 0,e),64&t.i?ct(n,"componentDidUpdate",void 0,e):(t.i|=64,ft(e),ct(n,"componentDidLoad",void 0,e),t.A(e),l||rt()),t.k&&(t.k(),t.k=void 0),512&t.i&&$((()=>tt(t,!1))),t.i&=-517},rt=()=>{$((()=>_(r,"appload",{detail:{namespace:"phirepass-widgets"}})))},ct=(t,e,n,l)=>{if(t&&t[e])try{return t[e](n)}catch(t){s(t,l)}},ft=t=>t.classList.add("hydrated"),ut=(t,e,n,o)=>{const i=l(t);if(!i)return;const r=t,c=i.o.get(e),f=i.i,u=r;if(!((n=L(n,o.t[e][0]))===c||Number.isNaN(c)&&Number.isNaN(n))){if(i.o.set(e,n),o.L){const t=o.L[e];t&&t.map((t=>{try{const[[l,o]]=Object.entries(t);(128&f||1&o)&&(u?u[l](n,c,e):i.N.push((()=>{i._[l](n,c,e)})))}catch(t){s(t,r)}}))}if(2&f){if(u.componentShouldUpdate&&!1===u.componentShouldUpdate(n,c,e)&&!(16&f))return;16&f||tt(i,!1)}}},at=(e,n)=>{var o,s;const i=e.prototype;{e.watchers&&!n.L&&(n.L=A(e.watchers)),e.deserializers&&!n.D&&(n.D=e.deserializers),e.serializers&&!n.H&&(n.H=e.serializers);const r=Object.entries(null!=(o=n.t)?o:{});r.map((([e,[o]])=>{if(31&o||32&o){const{get:s,set:r}=t(i,e)||{};s&&(n.t[e][0]|=2048),r&&(n.t[e][0]|=4096),Object.defineProperty(i,e,{get(){return s?s.apply(this):((t,e)=>l(this).o.get(e))(0,e)},configurable:!0,enumerable:!0}),Object.defineProperty(i,e,{set(t){const s=l(this);if(s){if(r)return void 0===(32&o?this[e]:s.$hostElement$[e])&&s.o.get(e)&&(t=s.o.get(e)),r.call(this,L(t,o)),void ut(this,e,t=32&o?this[e]:s.$hostElement$[e],n);ut(this,e,t,n)}}})}}));{const t=new Map;i.attributeChangedCallback=function(e,o,s){f.jmp((()=>{var c;const f=t.get(e),u=l(this);if(this.hasOwnProperty(f),i.hasOwnProperty(f)&&"number"==typeof this[f]&&this[f]==s)return;if(null==f){const t=null==u?void 0:u.i;if(u&&t&&!(8&t)&&s!==o){const l=this,i=null==(c=n.L)?void 0:c[e];null==i||i.forEach((n=>{const[[i,r]]=Object.entries(n);null!=l[i]&&(128&t||1&r)&&l[i].call(l,s,o,e)}))}return}const a=r.find((([t])=>t===f)),p=a&&4&a[1][0],d=p&&null===s&&void 0===this[f];p&&(s=null!==s&&"false"!==s);const h=Object.getOwnPropertyDescriptor(i,f);d||s==this[f]||h.get&&!h.set||(this[f]=s)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=n.L)?s:{}),...r.filter((([t,e])=>31&e[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))]))}}return e},pt=(t,e)=>{const o={i:e[0],p:e[1]};try{o.t=e[2],o.L=A(t.L),o.D=t.D,o.H=t.H;const r=t.prototype.connectedCallback,c=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){((t,e)=>{const l={i:0,$hostElement$:t,l:e,o:new Map,P:new Map};l.R=new Promise((t=>l.A=t)),t["s-p"]=[],t["s-rc"]=[];const o=l;t.__stencil__getHostRef=()=>o,512&e.i&&n(t,l)})(this,o)},connectedCallback(){if(!this.__hasHostListenerAttached){if(!l(this))return;this.__hasHostListenerAttached=!0}(t=>{if(!(1&f.i)){const e=l(t);if(!e)return;const n=e.l,o=()=>{};if(1&e.i)(null==e?void 0:e._)||(null==e?void 0:e.R)&&e.R.then((()=>{}));else{e.i|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){X(e,e.M=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let l;try{if(!(32&e.i)&&(e.i|=32,l=t.constructor,customElements.whenDefined(t.localName).then((()=>e.i|=128)),l&&l.style)){let t;"string"==typeof l.style&&(t=l.style);const e=k(n);if(!i.has(e)){const l=()=>{};((t,e,n)=>{let l=i.get(t);u&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=e:l.replaceSync(e)):l=e,i.set(t,l)})(e,t,!!(1&n.i)),l()}}const o=e.M,s=()=>tt(e,!0);o&&o["s-rc"]?o["s-rc"].push(s):s()}catch(n){s(n,t),e.k&&(e.k(),e.k=void 0),e.A&&e.A(t)}})(t,e,n)}o()}})(this),r&&r.call(this)},disconnectedCallback(){(async t=>{S.has(t)&&S.delete(t),t.shadowRoot&&S.has(t.shadowRoot)&&S.delete(t.shadowRoot)})(this),c&&c.call(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${o.p}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else j.call(this,o)}}),Object.defineProperty(t,"is",{value:o.p,configurable:!0}),at(t,o)}catch(e){return s(e),t}},dt=t=>f.C=t,ht=t=>Object.assign(f,t),mt=new WeakMap;function bt(t,e){let n=mt.get(e);n||(n={i:0,l:{i:0,p:e.tagName},$hostElement$:e},mt.set(e,n)),Q(n,t)}function yt(t){return t}export{c as H,x as a,N as c,w as getAssetPath,E as h,pt as p,bt as render,g as setAssetPath,dt as setNonce,ht as setPlatformOptions,yt as t}
|
|
1
|
+
function t(t,e,n){const o="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==o;){const o=Object.getOwnPropertyDescriptor(t,e);if(o&&(!n||o.get))return o;t=Object.getPrototypeOf(t)}}var e,n=(e,n)=>{var o;Object.entries(null!=(o=n.o.t)?o:{}).map((([o,[l]])=>{if(31&l||32&l){const l=e[o],s=t(Object.getPrototypeOf(e),o,!0)||Object.getOwnPropertyDescriptor(e,o);s&&Object.defineProperty(e,o,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:!0,enumerable:!0}),n.l.has(o)?e[o]=n.l.get(o):void 0!==l&&(e[o]=l)}}))},o=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},l=(t,e)=>e in t,s=(t,e)=>(0,console.error)(t,e),i=new Map,r="undefined"!=typeof window?window:{},c=r.HTMLElement||class{},f={i:0,u:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},u=(()=>{try{return!!r.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),a=!!u&&(()=>!!r.document&&Object.getOwnPropertyDescriptor(r.document.adoptedStyleSheets,"length").writable)(),p=!1,d=[],h=[],m=(t,e)=>n=>{t.push(n),p||(p=!0,e&&4&f.i?$(y):f.raf(y))},b=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){s(t)}t.length=0},y=()=>{b(d),b(h),(p=d.length>0)&&f.raf(y)},$=t=>Promise.resolve(void 0).then(t),v=m(h,!0),g=t=>{const e=new URL(t,f.u);return e.origin!==r.location.origin?e.href:e.pathname},w=t=>f.u=t;function j(){const t=this.attachShadow({mode:"open"});void 0===e&&(e=null),e&&(a?t.adoptedStyleSheets.push(e):t.adoptedStyleSheets=[...t.adoptedStyleSheets,e])}var O,S=new WeakMap,k=t=>"sc-"+t.p,M=t=>"object"==(t=typeof t)||"function"===t,E=(t,e,...n)=>{let o=null,l=null,s=!1,i=!1;const r=[],c=e=>{for(let n=0;n<e.length;n++)o=e[n],Array.isArray(o)?c(o):null!=o&&"boolean"!=typeof o&&((s="function"!=typeof t&&!M(o))&&(o+=""),s&&i?r[r.length-1].h+=o:r.push(s?C(null,o):o),i=s)};if(c(n),e){e.key&&(l=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}if("function"==typeof t)return t(null===e?{}:e,r,A);const f=C(t,null);return f.m=e,r.length>0&&(f.$=r),f.v=l,f},C=(t,e)=>({i:0,j:t,h:null!=e?e:null,O:null,$:null,m:null,v:null}),x={},A={forEach:(t,e)=>t.map(L).forEach(e),map:(t,e)=>t.map(L).map(e).map(N)},L=t=>({vattrs:t.m,vchildren:t.$,vkey:t.v,vname:t.S,vtag:t.j,vtext:t.h}),N=t=>{if("function"==typeof t.vtag){const e={...t.vattrs};return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),E(t.vtag,e,...t.vchildren||[])}const e=C(t.vtag,t.vtext);return e.m=t.vattrs,e.$=t.vchildren,e.v=t.vkey,e.S=t.vname,e},_=t=>{if(!t)return;const e=Object.keys(t);if(0===e.length)return;let n=!1;for(const o of e){if(n)break;for(const e of t[o])if("string"==typeof e){n=!0;break}}if(!n)return t;const o={};for(const n of e)o[n]=t[n].map((t=>"string"==typeof t?{[t]:0}:t));return o},D=(t,e)=>null==t||M(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?"string"==typeof t?parseFloat(t):"number"==typeof t?t:NaN:1&e?t+"":t,H=(t,e)=>{const n=t;return{emit:t=>P(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},P=(t,e,n)=>{const o=f.ce(e,n);return t.dispatchEvent(o),o},R=(t,e,n,s,i,c)=>{if(n===s)return;let u=l(t,e),a=e.toLowerCase();if("class"===e){const e=t.classList,o=W(n);let l=W(s);e.remove(...o.filter((t=>t&&!l.includes(t)))),e.add(...l.filter((t=>t&&!o.includes(t))))}else if("style"===e){for(const e in n)s&&null!=s[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in s)n&&s[e]===n[e]||(e.includes("-")?t.style.setProperty(e,s[e]):t.style[e]=s[e])}else if("key"===e);else if("ref"===e)s&&X(s,t);else if(t.__lookupSetter__(e)||"o"!==e[0]||"n"!==e[1]){if("a"===e[0]&&e.startsWith("attr:")){const n=e.slice(5);let l;{const e=o(t);if(e&&e.o&&e.o.t){const t=e.o.t[n];t&&t[1]&&(l=t[1])}}return l||(l=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==s||!1===s?!1===s&&""!==t.getAttribute(l)||t.removeAttribute(l):t.setAttribute(l,!0===s?"":s))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=s}catch(t){}return}{const o=M(s);if((u||o&&null!==s)&&!i)try{if(t.tagName.includes("-"))t[e]!==s&&(t[e]=s);else{const o=null==s?"":s;"list"===e?u=!1:null!=n&&t[e]===o||("function"==typeof t.__lookupSetter__(e)?t[e]=o:t.setAttribute(e,o))}}catch(t){}null==s||!1===s?!1===s&&""!==t.getAttribute(e)||t.removeAttribute(e):(!u||4&c||i)&&!o&&1===t.nodeType&&t.setAttribute(e,s=!0===s?"":s)}}else if(e="-"===e[2]?e.slice(3):l(r,a)?a.slice(2):a[2]+e.slice(3),n||s){const o=e.endsWith(F);e=e.replace(V,""),n&&f.rel(t,e,n,o),s&&f.ael(t,e,s,o)}},U=/\s/,W=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(U):[]),F="Capture",V=RegExp(F+"$"),q=(t,e,n)=>{const o=11===e.O.nodeType&&e.O.host?e.O.host:e.O,l=t&&t.m||{},s=e.m||{};for(const t of z(Object.keys(l)))t in s||R(o,t,l[t],void 0,n,e.i);for(const t of z(Object.keys(s)))R(o,t,l[t],s[t],n,e.i)};function z(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var T=!1,Y=[],Z=[],B=(t,e,n)=>{const o=e.$[n];let l,s,i=0;if(null!=o.h)l=o.O=r.document.createTextNode(o.h);else{if(!r.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(l=o.O=r.document.createElement(o.j),q(null,o,T),o.$){const e="template"===o.j?l.content:l;for(i=0;i<o.$.length;++i)s=B(t,o,i),s&&e.appendChild(s)}}return l["s-hn"]=O,l},G=(t,e,n,o,l,s)=>{let i,r=t;for(r.shadowRoot&&r.tagName===O&&(r=r.shadowRoot),"template"===n.j&&(r=r.content);l<=s;++l)o[l]&&(i=B(null,n,l),i&&(o[l].O=i,tt(r,i,e)))},I=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.O;Q(e),t&&t.remove()}}},J=(t,e,n=!1)=>t.j===e.j&&(n?(n&&!t.v&&e.v&&(t.v=e.v),!0):t.v===e.v),K=(t,e,n=!1)=>{const o=e.O=t.O,l=t.$,s=e.$,i=e.h;null==i?(q(t,e,T),null!==l&&null!==s?((t,e,n,o,l=!1)=>{let s,i,r=0,c=0,f=0,u=0,a=e.length-1,p=e[0],d=e[a],h=o.length-1,m=o[0],b=o[h];const y="template"===n.j?t.content:t;for(;r<=a&&c<=h;)if(null==p)p=e[++r];else if(null==d)d=e[--a];else if(null==m)m=o[++c];else if(null==b)b=o[--h];else if(J(p,m,l))K(p,m,l),p=e[++r],m=o[++c];else if(J(d,b,l))K(d,b,l),d=e[--a],b=o[--h];else if(J(p,b,l))K(p,b,l),tt(y,p.O,d.O.nextSibling),p=e[++r],b=o[--h];else if(J(d,m,l))K(d,m,l),tt(y,d.O,p.O),d=e[--a],m=o[++c];else{for(f=-1,u=r;u<=a;++u)if(e[u]&&null!==e[u].v&&e[u].v===m.v){f=u;break}f>=0?(i=e[f],i.j!==m.j?s=B(e&&e[c],n,f):(K(i,m,l),e[f]=void 0,s=i.O),m=o[++c]):(s=B(e&&e[c],n,c),m=o[++c]),s&&tt(p.O.parentNode,s,p.O)}r>a?G(t,null==o[h+1]?null:o[h+1].O,n,o,c,h):c>h&&I(e,r,a)})(o,l,e,s,n):null!==s?(null!==t.h&&(o.textContent=""),G(o,null,e,s,0,s.length-1)):!n&&null!==l&&I(l,0,l.length-1)):t.h!==i&&(o.data=i)},Q=t=>{t.m&&t.m.ref&&Y.push((()=>t.m.ref(null))),t.$&&t.$.map(Q)},X=(t,e)=>{Z.push((()=>t(e)))},tt=(t,e,n)=>t.__insertBefore?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n),et=(t,e,n=!1)=>{const o=t.$hostElement$,l=t.k||C(null,null),s=(t=>t&&t.j===x)(e)?e:E(null,null,e);if(O=o.tagName,n&&s.m)for(const t of Object.keys(s.m))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(s.m[t]=o[t]);s.j=null,s.i|=4,t.k=s,s.O=l.O=o.shadowRoot||o,K(l,s,n),Y.forEach((t=>t())),Y.length=0,Z.forEach((t=>t())),Z.length=0},nt=(t,e)=>{if(e&&!t.M&&e["s-p"]){const n=e["s-p"].push(new Promise((o=>t.M=()=>{e["s-p"].splice(n-1,1),o()})))}},ot=(t,e)=>{if(t.i|=16,4&t.i)return void(t.i|=512);nt(t,t.C);const n=()=>lt(t,e);if(!e)return v(n);queueMicrotask((()=>{n()}))},lt=(t,e)=>{const n=t.$hostElement$,o=n;if(!o)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return l=at(o,e?"componentWillLoad":"componentWillUpdate",void 0,n),l=st(l,(()=>at(o,"componentWillRender",void 0,n))),st(l,(()=>rt(t,o,e)))},st=(t,e)=>it(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),it=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,rt=async(t,e,n)=>{var o;const l=t.$hostElement$,s=l["s-rc"];n&&(t=>{const e=t.o,n=t.$hostElement$,o=e.i,l=((t,e)=>{var n,o,l;const s=k(e),c=i.get(s);if(!r.document)return s;if(t=11===t.nodeType?t:r.document,c)if("string"==typeof c){let l,i=S.get(t=t.head||t);if(i||S.set(t,i=new Set),!i.has(s)){l=r.document.createElement("style"),l.textContent=c;const p=null!=(n=f.A)?n:function(){var t,e,n;return null!=(n=null==(e=null==(t=r.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:e.getAttribute("content"))?n:void 0}();if(null!=p&&l.setAttribute("nonce",p),!(1&e.i))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(l,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(u){const e=new(null!=(o=t.defaultView)?o:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(c),a?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=c+e.textContent:t.prepend(l)}else t.append(l);1&e.i&&t.insertBefore(l,null),4&e.i&&(l.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),i&&i.add(s)}}else{let e=S.get(t);if(e||S.set(t,e=new Set),!e.has(s)){const n=null!=(l=t.defaultView)?l:t.ownerDocument.defaultView;let o;if(c.constructor===n.CSSStyleSheet)o=c;else{o=new n.CSSStyleSheet;for(let t=0;t<c.cssRules.length;t++)o.insertRule(c.cssRules[t].cssText,t)}a?t.adoptedStyleSheets.push(o):t.adoptedStyleSheets=[...t.adoptedStyleSheets,o],e.add(s)}}return s})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);ct(t,e,l,n),s&&(s.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>ft(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.i|=4,e.length=0)}},ct=(t,e,n,o)=>{try{e=e.render(),t.i&=-17,t.i|=2,et(t,e,o)}catch(e){s(e,t.$hostElement$)}return null},ft=t=>{const e=t.$hostElement$,n=e,o=t.C;at(n,"componentDidRender",void 0,e),64&t.i?at(n,"componentDidUpdate",void 0,e):(t.i|=64,pt(e),at(n,"componentDidLoad",void 0,e),t.L(e),o||ut()),t.M&&(t.M(),t.M=void 0),512&t.i&&$((()=>ot(t,!1))),t.i&=-517},ut=()=>{$((()=>P(r,"appload",{detail:{namespace:"phirepass-widgets"}})))},at=(t,e,n,o)=>{if(t&&t[e])try{return t[e](n)}catch(t){s(t,o)}},pt=t=>t.classList.add("hydrated"),dt=(t,e,n,l)=>{const i=o(t);if(!i)return;const r=t,c=i.l.get(e),f=i.i,u=r;if(!((n=D(n,l.t[e][0]))===c||Number.isNaN(c)&&Number.isNaN(n))){if(i.l.set(e,n),l.N){const t=l.N[e];t&&t.map((t=>{try{const[[o,l]]=Object.entries(t);(128&f||1&l)&&(u?u[o](n,c,e):i._.push((()=>{i.D[o](n,c,e)})))}catch(t){s(t,r)}}))}if(2&f){if(u.componentShouldUpdate&&!1===u.componentShouldUpdate(n,c,e)&&!(16&f))return;16&f||ot(i,!1)}}},ht=(e,n)=>{var l,s;const i=e.prototype;{e.watchers&&!n.N&&(n.N=_(e.watchers)),e.deserializers&&!n.H&&(n.H=e.deserializers),e.serializers&&!n.P&&(n.P=e.serializers);const r=Object.entries(null!=(l=n.t)?l:{});r.map((([e,[l]])=>{if(31&l||32&l){const{get:s,set:r}=t(i,e)||{};s&&(n.t[e][0]|=2048),r&&(n.t[e][0]|=4096),Object.defineProperty(i,e,{get(){return s?s.apply(this):((t,e)=>o(this).l.get(e))(0,e)},configurable:!0,enumerable:!0}),Object.defineProperty(i,e,{set(t){const s=o(this);if(s){if(r)return void 0===(32&l?this[e]:s.$hostElement$[e])&&s.l.get(e)&&(t=s.l.get(e)),r.call(this,D(t,l)),void dt(this,e,t=32&l?this[e]:s.$hostElement$[e],n);dt(this,e,t,n)}}})}}));{const t=new Map;i.attributeChangedCallback=function(e,l,s){f.jmp((()=>{var c;const f=t.get(e),u=o(this);if(this.hasOwnProperty(f),i.hasOwnProperty(f)&&"number"==typeof this[f]&&this[f]==s)return;if(null==f){const t=null==u?void 0:u.i;if(u&&t&&!(8&t)&&s!==l){const o=this,i=null==(c=n.N)?void 0:c[e];null==i||i.forEach((n=>{const[[i,r]]=Object.entries(n);null!=o[i]&&(128&t||1&r)&&o[i].call(o,s,l,e)}))}return}const a=r.find((([t])=>t===f)),p=a&&4&a[1][0],d=p&&null===s&&void 0===this[f];p&&(s=null!==s&&"false"!==s);const h=Object.getOwnPropertyDescriptor(i,f);d||s==this[f]||h.get&&!h.set||(this[f]=s)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=n.N)?s:{}),...r.filter((([t,e])=>31&e[0])).map((([e,n])=>{const o=n[1]||e;return t.set(o,e),o}))]))}}return e},mt=(t,e)=>{const l={i:e[0],p:e[1]};try{l.t=e[2],l.N=_(t.N),l.H=t.H,l.P=t.P;const r=t.prototype.connectedCallback,c=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){((t,e)=>{const o={i:0,$hostElement$:t,o:e,l:new Map,R:new Map};o.U=new Promise((t=>o.L=t)),t["s-p"]=[],t["s-rc"]=[];const l=o;t.__stencil__getHostRef=()=>l,512&e.i&&n(t,o)})(this,l)},connectedCallback(){if(!this.__hasHostListenerAttached){if(!o(this))return;this.__hasHostListenerAttached=!0}(t=>{if(!(1&f.i)){const e=o(t);if(!e)return;const n=e.o,l=()=>{};if(1&e.i)(null==e?void 0:e.D)||(null==e?void 0:e.U)&&e.U.then((()=>{}));else{e.i|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){nt(e,e.C=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let o;try{if(!(32&e.i)&&(e.i|=32,o=t.constructor,customElements.whenDefined(t.localName).then((()=>e.i|=128)),o&&o.style)){let t;"string"==typeof o.style&&(t=o.style);const e=k(n);if(!i.has(e)){const o=()=>{};((t,e,n)=>{let o=i.get(t);u&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,i.set(t,o)})(e,t,!!(1&n.i)),o()}}const l=e.C,s=()=>ot(e,!0);l&&l["s-rc"]?l["s-rc"].push(s):s()}catch(n){s(n,t),e.M&&(e.M(),e.M=void 0),e.L&&e.L(t)}})(t,e,n)}l()}})(this),r&&r.call(this)},disconnectedCallback(){(async t=>{S.has(t)&&S.delete(t),t.shadowRoot&&S.has(t.shadowRoot)&&S.delete(t.shadowRoot)})(this),c&&c.call(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${l.p}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else j.call(this,l)}}),Object.defineProperty(t,"is",{value:l.p,configurable:!0}),ht(t,l)}catch(e){return s(e),t}},bt=t=>f.A=t,yt=t=>Object.assign(f,t),$t=new WeakMap;function vt(t,e){let n=$t.get(e);n||(n={i:0,o:{i:0,p:e.tagName},$hostElement$:e},$t.set(e,n)),et(n,t)}function gt(t){return t}export{c as H,x as a,H as c,g as getAssetPath,E as h,mt as p,vt as render,w as setAssetPath,bt as setNonce,yt as setPlatformOptions,gt as t}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
class n{__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,_.unregister(this),n}free(){const n=this.__destroy_into_raw();E.__wbg_channel_free(n,0)}authenticate(n,t,e){const r=S(n,E.__wbindgen_export,E.__wbindgen_export2),o=I,c=S(t,E.__wbindgen_export,E.__wbindgen_export2);E.channel_authenticate(this.__wbg_ptr,r,o,c,I,A(e)?4294967297:e>>>0)}connect(){E.channel_connect(this.__wbg_ptr)}disconnect(){E.channel_disconnect(this.__wbg_ptr)}is_connected(){return 0!==E.channel_is_connected(this.__wbg_ptr)}is_disconnected(){return 0!==E.channel_is_disconnected(this.__wbg_ptr)}constructor(n,t,e){const r=S(n,E.__wbindgen_export,E.__wbindgen_export2),o=I,c=S(t,E.__wbindgen_export,E.__wbindgen_export2),i=I;var s=A(e)?0:S(e,E.__wbindgen_export,E.__wbindgen_export2);const u=E.channel_new(r,o,c,i,s,I);return this.__wbg_ptr=u>>>0,_.register(this,this.__wbg_ptr,this),this}on_connection_close(n){E.channel_on_connection_close(this.__wbg_ptr,A(n)?0:u(n))}on_connection_error(n){E.channel_on_connection_error(this.__wbg_ptr,A(n)?0:u(n))}on_connection_message(n){E.channel_on_connection_message(this.__wbg_ptr,A(n)?0:u(n))}on_connection_open(n){E.channel_on_connection_open(this.__wbg_ptr,A(n)?0:u(n))}on_protocol_message(n){E.channel_on_protocol_message(this.__wbg_ptr,A(n)?0:u(n))}open_sftp_tunnel(n,t,e,r){const o=S(n,E.__wbindgen_export,E.__wbindgen_export2),c=I;var i=A(t)?0:S(t,E.__wbindgen_export,E.__wbindgen_export2),s=I,_=A(e)?0:S(e,E.__wbindgen_export,E.__wbindgen_export2);E.channel_open_sftp_tunnel(this.__wbg_ptr,o,c,i,s,_,I,A(r)?4294967297:r>>>0)}open_ssh_tunnel(n,t,e,r){const o=S(n,E.__wbindgen_export,E.__wbindgen_export2),c=I;var i=A(t)?0:S(t,E.__wbindgen_export,E.__wbindgen_export2),s=I,_=A(e)?0:S(e,E.__wbindgen_export,E.__wbindgen_export2);E.channel_open_ssh_tunnel(this.__wbg_ptr,o,c,i,s,_,I,A(r)?4294967297:r>>>0)}send_sftp_delete(n,t,e,r,o){const c=S(n,E.__wbindgen_export,E.__wbindgen_export2),i=I,s=S(e,E.__wbindgen_export,E.__wbindgen_export2),_=I,u=S(r,E.__wbindgen_export,E.__wbindgen_export2);E.channel_send_sftp_delete(this.__wbg_ptr,c,i,t,s,_,u,I,A(o)?4294967297:o>>>0)}send_sftp_download_chunk(n,t,e,r,o){const c=S(n,E.__wbindgen_export,E.__wbindgen_export2);E.channel_send_sftp_download_chunk(this.__wbg_ptr,c,I,t,e,r,A(o)?4294967297:o>>>0)}send_sftp_download_start(n,t,e,r,o){const c=S(n,E.__wbindgen_export,E.__wbindgen_export2),i=I,s=S(e,E.__wbindgen_export,E.__wbindgen_export2),_=I,u=S(r,E.__wbindgen_export,E.__wbindgen_export2);E.channel_send_sftp_download_start(this.__wbg_ptr,c,i,t,s,_,u,I,A(o)?4294967297:o>>>0)}send_sftp_list_data(n,t,e,r){const o=S(n,E.__wbindgen_export,E.__wbindgen_export2),c=I,i=S(e,E.__wbindgen_export,E.__wbindgen_export2);E.channel_send_sftp_list_data(this.__wbg_ptr,o,c,t,i,I,A(r)?4294967297:r>>>0)}send_sftp_upload_chunk(n,t,e,r,o,c,i){const s=S(n,E.__wbindgen_export,E.__wbindgen_export2),_=I,u=function(n){const t=(0,E.__wbindgen_export)(1*n.length,1)>>>0;return h().set(n,t/1),I=n.length,t}(c);E.channel_send_sftp_upload_chunk(this.__wbg_ptr,s,_,t,e,r,o,u,I,A(i)?4294967297:i>>>0)}send_sftp_upload_start(n,t,e,r,o,c,i){const s=S(n,E.__wbindgen_export,E.__wbindgen_export2),_=I,u=S(e,E.__wbindgen_export,E.__wbindgen_export2),a=I,f=S(r,E.__wbindgen_export,E.__wbindgen_export2);E.channel_send_sftp_upload_start(this.__wbg_ptr,s,_,t,u,a,f,I,o,c,A(i)?4294967297:i>>>0)}send_ssh_terminal_resize(n,t,e,r,o,c){const i=S(n,E.__wbindgen_export,E.__wbindgen_export2);E.channel_send_ssh_terminal_resize(this.__wbg_ptr,i,I,t,e,r,o,c)}send_ssh_tunnel_data(n,t,e){const r=S(n,E.__wbindgen_export,E.__wbindgen_export2),o=I,c=S(e,E.__wbindgen_export,E.__wbindgen_export2);E.channel_send_ssh_tunnel_data(this.__wbg_ptr,r,o,t,c,I)}start_heartbeat(n){E.channel_start_heartbeat(this.__wbg_ptr,n)}stop_heartbeat(){E.channel_stop_heartbeat(this.__wbg_ptr)}}Symbol.dispose&&(n.prototype[Symbol.dispose]=n.prototype.free);const t=Object.freeze({Generic:0,0:"Generic",Authentication:10,10:"Authentication",RequiresUsername:100,100:"RequiresUsername",RequiresPassword:110,110:"RequiresPassword",RequiresUsernamePassword:120,120:"RequiresUsernamePassword"});function e(){const n={__proto__:null,__wbg_Error_960c155d3d49e4c2:function(n,t){return u(Error(w(n,t)))},__wbg_String_8564e559799eccda:function(n,t){const e=S(String(y(t)),E.__wbindgen_export,E.__wbindgen_export2),r=I;d().setInt32(n+4,r,!0),d().setInt32(n+0,e,!0)},__wbg___wbindgen_debug_string_ab4b34d23d6778bd:function(n,t){const e=S(f(y(t)),E.__wbindgen_export,E.__wbindgen_export2),r=I;d().setInt32(n+4,r,!0),d().setInt32(n+0,e,!0)},__wbg___wbindgen_string_get_7ed5322991caaec5:function(n,t){const e=y(t),r="string"==typeof e?e:void 0;var o=A(r)?0:S(r,E.__wbindgen_export,E.__wbindgen_export2),c=I;d().setInt32(n+4,c,!0),d().setInt32(n+0,o,!0)},__wbg___wbindgen_throw_6b64449b9b9ed33c:function(n,t){throw new Error(w(n,t))},__wbg__wbg_cb_unref_b46c9b5a9f08ec37:function(n){y(n)._wbg_cb_unref()},__wbg_call_14b169f759b26747:function(){return p((function(n,t){return u(y(n).call(y(t)))}),arguments)},__wbg_call_a24592a6f349a97e:function(){return p((function(n,t,e){return u(y(n).call(y(t),y(e)))}),arguments)},__wbg_clearInterval_26ba580547547579:function(n){return u(clearInterval(j(n)))},__wbg_close_88106990eea7f544:function(){return p((function(n){y(n).close()}),arguments)},__wbg_data_bb9dffdd1e99cf2d:function(n){return u(y(n).data)},__wbg_from_0dbf29f09e7fb200:function(n){return u(Array.from(y(n)))},__wbg_info_4f09735f023f7fae:function(n,t){console.info(w(n,t))},__wbg_instanceof_ArrayBuffer_7c8433c6ed14ffe3:function(n){let t;try{t=y(n)instanceof ArrayBuffer}catch(n){t=!1}return t},__wbg_length_9f1775224cf1d815:function(n){return y(n).length},__wbg_new_0c7403db6e782f19:function(n){return u(new Uint8Array(y(n)))},__wbg_new_682678e2f47e32bc:function(){return u(new Array)},__wbg_new_aa8d0fa9762c29bd:function(){return u(new Object)},__wbg_new_with_str_sequence_6453b755acdcc2e7:function(){return p((function(n,t,e){return u(new WebSocket(w(n,t),y(e)))}),arguments)},__wbg_prototypesetcall_a6b02eb00b0f4ce2:function(n,t,e){Uint8Array.prototype.set.call(b(n,t),y(e))},__wbg_push_471a5b068a5295f6:function(n,t){return y(n).push(y(t))},__wbg_readyState_c78e609c7de3b381:function(n){return y(n).readyState},__wbg_send_186c85704c7f2d00:function(){return p((function(n,t,e){y(n).send(b(t,e))}),arguments)},__wbg_setInterval_cbf1c35c6a692d37:function(){return p((function(n,t){return u(setInterval(y(n),t))}),arguments)},__wbg_set_3bf1de9fab0cd644:function(n,t,e){y(n)[t>>>0]=j(e)},__wbg_set_6be42768c690e380:function(n,t,e){y(n)[j(t)]=j(e)},__wbg_set_binaryType_770e68648ca5e83d:function(n,t){y(n).binaryType=s[t]},__wbg_set_onclose_17fa3bbcc4ba3541:function(n,t){y(n).onclose=y(t)},__wbg_set_onerror_da99c4232662a084:function(n,t){y(n).onerror=y(t)},__wbg_set_onmessage_c1db358b9c38e3f1:function(n,t){y(n).onmessage=y(t)},__wbg_set_onopen_cd47b8fb1d92dee9:function(n,t){y(n).onopen=y(t)},__wbg_warn_938671953d9be936:function(n,t){console.warn(w(n,t))},__wbindgen_cast_0000000000000001:function(n,t){return u(R(n,t,o))},__wbindgen_cast_0000000000000002:function(n,t){return u(R(n,t,c))},__wbindgen_cast_0000000000000003:function(n,t){return u(R(n,t,i))},__wbindgen_cast_0000000000000004:function(n,t){return u(R(n,t,r))},__wbindgen_cast_0000000000000005:function(n){return u(n)},__wbindgen_cast_0000000000000006:function(n,t){return u(b(n,t))},__wbindgen_cast_0000000000000007:function(n,t){return u(w(n,t))},__wbindgen_cast_0000000000000008:function(n){return u(BigInt.asUintN(64,n))},__wbindgen_object_clone_ref:function(n){return u(y(n))},__wbindgen_object_drop_ref:function(n){j(n)}};return{__proto__:null,"./phirepass-channel_bg.js":n}}function r(n,t){E.__wasm_bindgen_func_elem_39(n,t)}function o(n,t,e){E.__wasm_bindgen_func_elem_41(n,t,u(e))}function c(n,t,e){E.__wasm_bindgen_func_elem_41_1(n,t,u(e))}function i(n,t,e){E.__wasm_bindgen_func_elem_41_2(n,t,u(e))}const s=["blob","arraybuffer"],_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((n=>E.__wbg_channel_free(n>>>0,1)));function u(n){v===m.length&&m.push(m.length+1);const t=v;return v=m[t],m[t]=n,t}const a="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((n=>E.__wbindgen_export4(n.a,n.b)));function f(n){const t=typeof n;if("number"==t||"boolean"==t||null==n)return`${n}`;if("string"==t)return`"${n}"`;if("symbol"==t){const t=n.description;return null==t?"Symbol":`Symbol(${t})`}if("function"==t){const t=n.name;return"string"==typeof t&&t.length>0?`Function(${t})`:"Function"}if(Array.isArray(n)){const t=n.length;let e="[";t>0&&(e+=f(n[0]));for(let r=1;r<t;r++)e+=", "+f(n[r]);return e+="]",e}const e=/\[object ([^\]]+)\]/.exec(toString.call(n));let r;if(!(e&&e.length>1))return toString.call(n);if(r=e[1],"Object"==r)try{return"Object("+JSON.stringify(n)+")"}catch(n){return"Object"}return n instanceof Error?`${n.name}: ${n.message}\n${n.stack}`:r}function b(n,t){return n>>>=0,h().subarray(n/1,n/1+t)}let l=null;function d(){return(null===l||!0===l.buffer.detached||void 0===l.buffer.detached&&l.buffer!==E.memory.buffer)&&(l=new DataView(E.memory.buffer)),l}function w(n,t){return function(n,t){return q+=t,q>=U&&(O=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),O.decode(),q=t),O.decode(h().subarray(n,n+t))}(n>>>=0,t)}let g=null;function h(){return null!==g&&0!==g.byteLength||(g=new Uint8Array(E.memory.buffer)),g}function y(n){return m[n]}function p(n,t){try{return n.apply(this,t)}catch(n){E.__wbindgen_export3(u(n))}}let m=new Array(1024).fill(void 0);m.push(void 0,null,!0,!1);let v=m.length;function A(n){return null==n}function R(n,t,e){const r={a:n,b:t,cnt:1},o=(...n)=>{r.cnt++;const t=r.a;r.a=0;try{return e(t,r.b,...n)}finally{r.a=t,o._wbg_cb_unref()}};return o._wbg_cb_unref=()=>{0==--r.cnt&&(E.__wbindgen_export4(r.a,r.b),r.a=0,a.unregister(r))},a.register(o,r,r),o}function S(n,t,e){if(void 0===e){const e=W.encode(n),r=t(e.length,1)>>>0;return h().subarray(r,r+e.length).set(e),I=e.length,r}let r=n.length,o=t(r,1)>>>0;const c=h();let i=0;for(;i<r;i++){const t=n.charCodeAt(i);if(t>127)break;c[o+i]=t}if(i!==r){0!==i&&(n=n.slice(i)),o=e(o,r,r=i+3*n.length,1)>>>0;const t=h().subarray(o+i,o+r);i+=W.encodeInto(n,t).written,o=e(o,r,i,1)>>>0}return I=i,o}function j(n){const t=y(n);return function(n){n<1028||(m[n]=v,v=n)}(n),t}let O=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});O.decode();const U=2146435072;let q=0;const W=new TextEncoder;"encodeInto"in W||(W.encodeInto=function(n,t){const e=W.encode(n);return t.set(e),{read:n.length,written:e.length}});let E,I=0;async function T(n){if(void 0!==E)return E;void 0!==n&&(Object.getPrototypeOf(n)===Object.prototype?({module_or_path:n}=n):console.warn("using deprecated parameters for the initialization function; pass a single object instead")),void 0===n&&(n=new URL("phirepass-channel_bg.wasm",import.meta.url));const t=e();("string"==typeof n||"function"==typeof Request&&n instanceof Request||"function"==typeof URL&&n instanceof URL)&&(n=fetch(n));const{instance:r}=await async function(n,t){if("function"==typeof Response&&n instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(n,t)}catch(t){if(!n.ok||!function(n){switch(n){case"basic":case"cors":case"default":return!0}return!1}(n.type)||"application/wasm"===n.headers.get("Content-Type"))throw t;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t)}const e=await n.arrayBuffer();return await WebAssembly.instantiate(e,t)}{const e=await WebAssembly.instantiate(n,t);return e instanceof WebAssembly.Instance?{instance:e,module:n}:e}}(await n,t);return function(n){return E=n.exports,l=null,g=null,E}(r)}var F,$,z;!function(n){n.Error="Error",n.AuthSuccess="AuthSuccess",n.TunnelOpened="TunnelOpened",n.TunnelClosed="TunnelClosed",n.TunnelData="TunnelData"}(F||(F={})),function(n){n[n.Username=0]="Username",n[n.Password=1]="Password",n[n.Default=2]="Default"}($||($={})),function(n){n.Disconnected="disconnected",n.Connected="connected",n.Error="error"}(z||(z={}));export{n as C,t as E,$ as I,F as P,T as _,z as a}
|
|
1
|
+
class n{__destroy_into_raw(){const n=this.__wbg_ptr;return this.__wbg_ptr=0,_.unregister(this),n}free(){const n=this.__destroy_into_raw();T.__wbg_channel_free(n,0)}authenticate(n,t,e){const r=S(n,T.__wbindgen_export,T.__wbindgen_export2),o=W,c=S(t,T.__wbindgen_export,T.__wbindgen_export2);T.channel_authenticate(this.__wbg_ptr,r,o,c,W,A(e)?4294967297:e>>>0)}connect(){T.channel_connect(this.__wbg_ptr)}disconnect(){T.channel_disconnect(this.__wbg_ptr)}is_connected(){return 0!==T.channel_is_connected(this.__wbg_ptr)}is_disconnected(){return 0!==T.channel_is_disconnected(this.__wbg_ptr)}constructor(n,t,e){const r=S(n,T.__wbindgen_export,T.__wbindgen_export2),o=W,c=S(t,T.__wbindgen_export,T.__wbindgen_export2),i=W;var s=A(e)?0:S(e,T.__wbindgen_export,T.__wbindgen_export2);const u=T.channel_new(r,o,c,i,s,W);return this.__wbg_ptr=u>>>0,_.register(this,this.__wbg_ptr,this),this}on_connection_close(n){T.channel_on_connection_close(this.__wbg_ptr,A(n)?0:u(n))}on_connection_error(n){T.channel_on_connection_error(this.__wbg_ptr,A(n)?0:u(n))}on_connection_message(n){T.channel_on_connection_message(this.__wbg_ptr,A(n)?0:u(n))}on_connection_open(n){T.channel_on_connection_open(this.__wbg_ptr,A(n)?0:u(n))}on_protocol_message(n){T.channel_on_protocol_message(this.__wbg_ptr,A(n)?0:u(n))}open_sftp_tunnel(n,t,e,r){const o=S(n,T.__wbindgen_export,T.__wbindgen_export2),c=W;var i=A(t)?0:S(t,T.__wbindgen_export,T.__wbindgen_export2),s=W,_=A(e)?0:S(e,T.__wbindgen_export,T.__wbindgen_export2);T.channel_open_sftp_tunnel(this.__wbg_ptr,o,c,i,s,_,W,A(r)?4294967297:r>>>0)}open_ssh_tunnel(n,t,e,r){const o=S(n,T.__wbindgen_export,T.__wbindgen_export2),c=W;var i=A(t)?0:S(t,T.__wbindgen_export,T.__wbindgen_export2),s=W,_=A(e)?0:S(e,T.__wbindgen_export,T.__wbindgen_export2);T.channel_open_ssh_tunnel(this.__wbg_ptr,o,c,i,s,_,W,A(r)?4294967297:r>>>0)}send_sftp_delete(n,t,e,r,o){const c=S(n,T.__wbindgen_export,T.__wbindgen_export2),i=W,s=S(e,T.__wbindgen_export,T.__wbindgen_export2),_=W,u=S(r,T.__wbindgen_export,T.__wbindgen_export2);T.channel_send_sftp_delete(this.__wbg_ptr,c,i,t,s,_,u,W,A(o)?4294967297:o>>>0)}send_sftp_download_chunk(n,t,e,r,o){const c=S(n,T.__wbindgen_export,T.__wbindgen_export2);T.channel_send_sftp_download_chunk(this.__wbg_ptr,c,W,t,e,r,A(o)?4294967297:o>>>0)}send_sftp_download_start(n,t,e,r,o){const c=S(n,T.__wbindgen_export,T.__wbindgen_export2),i=W,s=S(e,T.__wbindgen_export,T.__wbindgen_export2),_=W,u=S(r,T.__wbindgen_export,T.__wbindgen_export2);T.channel_send_sftp_download_start(this.__wbg_ptr,c,i,t,s,_,u,W,A(o)?4294967297:o>>>0)}send_sftp_list_data(n,t,e,r){const o=S(n,T.__wbindgen_export,T.__wbindgen_export2),c=W,i=S(e,T.__wbindgen_export,T.__wbindgen_export2);T.channel_send_sftp_list_data(this.__wbg_ptr,o,c,t,i,W,A(r)?4294967297:r>>>0)}send_sftp_upload_chunk(n,t,e,r,o,c,i){const s=S(n,T.__wbindgen_export,T.__wbindgen_export2),_=W,u=function(n){const t=(0,T.__wbindgen_export)(1*n.length,1)>>>0;return h().set(n,t/1),W=n.length,t}(c);T.channel_send_sftp_upload_chunk(this.__wbg_ptr,s,_,t,e,r,o,u,W,A(i)?4294967297:i>>>0)}send_sftp_upload_start(n,t,e,r,o,c,i){const s=S(n,T.__wbindgen_export,T.__wbindgen_export2),_=W,u=S(e,T.__wbindgen_export,T.__wbindgen_export2),a=W,f=S(r,T.__wbindgen_export,T.__wbindgen_export2);T.channel_send_sftp_upload_start(this.__wbg_ptr,s,_,t,u,a,f,W,o,c,A(i)?4294967297:i>>>0)}send_ssh_terminal_resize(n,t,e,r,o,c){const i=S(n,T.__wbindgen_export,T.__wbindgen_export2);T.channel_send_ssh_terminal_resize(this.__wbg_ptr,i,W,t,e,r,o,c)}send_ssh_tunnel_data(n,t,e){const r=S(n,T.__wbindgen_export,T.__wbindgen_export2),o=W,c=S(e,T.__wbindgen_export,T.__wbindgen_export2);T.channel_send_ssh_tunnel_data(this.__wbg_ptr,r,o,t,c,W)}start_heartbeat(n){T.channel_start_heartbeat(this.__wbg_ptr,n)}stop_heartbeat(){T.channel_stop_heartbeat(this.__wbg_ptr)}}Symbol.dispose&&(n.prototype[Symbol.dispose]=n.prototype.free);const t=Object.freeze({Generic:0,0:"Generic",Authentication:10,10:"Authentication",RequiresUsername:100,100:"RequiresUsername",RequiresPassword:110,110:"RequiresPassword",RequiresUsernamePassword:120,120:"RequiresUsernamePassword"});function e(){const n={__proto__:null,__wbg_Error_960c155d3d49e4c2:function(n,t){return u(Error(w(n,t)))},__wbg_String_8564e559799eccda:function(n,t){const e=S(String(y(t)),T.__wbindgen_export,T.__wbindgen_export2),r=W;d().setInt32(n+4,r,!0),d().setInt32(n+0,e,!0)},__wbg___wbindgen_debug_string_ab4b34d23d6778bd:function(n,t){const e=S(f(y(t)),T.__wbindgen_export,T.__wbindgen_export2),r=W;d().setInt32(n+4,r,!0),d().setInt32(n+0,e,!0)},__wbg___wbindgen_string_get_7ed5322991caaec5:function(n,t){const e=y(t),r="string"==typeof e?e:void 0;var o=A(r)?0:S(r,T.__wbindgen_export,T.__wbindgen_export2),c=W;d().setInt32(n+4,c,!0),d().setInt32(n+0,o,!0)},__wbg___wbindgen_throw_6b64449b9b9ed33c:function(n,t){throw new Error(w(n,t))},__wbg__wbg_cb_unref_b46c9b5a9f08ec37:function(n){y(n)._wbg_cb_unref()},__wbg_call_14b169f759b26747:function(){return p((function(n,t){return u(y(n).call(y(t)))}),arguments)},__wbg_call_a24592a6f349a97e:function(){return p((function(n,t,e){return u(y(n).call(y(t),y(e)))}),arguments)},__wbg_clearInterval_26ba580547547579:function(n){return u(clearInterval(j(n)))},__wbg_close_88106990eea7f544:function(){return p((function(n){y(n).close()}),arguments)},__wbg_data_bb9dffdd1e99cf2d:function(n){return u(y(n).data)},__wbg_from_0dbf29f09e7fb200:function(n){return u(Array.from(y(n)))},__wbg_info_4f09735f023f7fae:function(n,t){console.info(w(n,t))},__wbg_instanceof_ArrayBuffer_7c8433c6ed14ffe3:function(n){let t;try{t=y(n)instanceof ArrayBuffer}catch(n){t=!1}return t},__wbg_length_9f1775224cf1d815:function(n){return y(n).length},__wbg_new_0c7403db6e782f19:function(n){return u(new Uint8Array(y(n)))},__wbg_new_682678e2f47e32bc:function(){return u(new Array)},__wbg_new_aa8d0fa9762c29bd:function(){return u(new Object)},__wbg_new_with_str_sequence_6453b755acdcc2e7:function(){return p((function(n,t,e){return u(new WebSocket(w(n,t),y(e)))}),arguments)},__wbg_prototypesetcall_a6b02eb00b0f4ce2:function(n,t,e){Uint8Array.prototype.set.call(b(n,t),y(e))},__wbg_push_471a5b068a5295f6:function(n,t){return y(n).push(y(t))},__wbg_readyState_c78e609c7de3b381:function(n){return y(n).readyState},__wbg_send_186c85704c7f2d00:function(){return p((function(n,t,e){y(n).send(b(t,e))}),arguments)},__wbg_setInterval_cbf1c35c6a692d37:function(){return p((function(n,t){return u(setInterval(y(n),t))}),arguments)},__wbg_set_3bf1de9fab0cd644:function(n,t,e){y(n)[t>>>0]=j(e)},__wbg_set_6be42768c690e380:function(n,t,e){y(n)[j(t)]=j(e)},__wbg_set_binaryType_770e68648ca5e83d:function(n,t){y(n).binaryType=s[t]},__wbg_set_onclose_17fa3bbcc4ba3541:function(n,t){y(n).onclose=y(t)},__wbg_set_onerror_da99c4232662a084:function(n,t){y(n).onerror=y(t)},__wbg_set_onmessage_c1db358b9c38e3f1:function(n,t){y(n).onmessage=y(t)},__wbg_set_onopen_cd47b8fb1d92dee9:function(n,t){y(n).onopen=y(t)},__wbg_warn_938671953d9be936:function(n,t){console.warn(w(n,t))},__wbindgen_cast_0000000000000001:function(n,t){return u(R(n,t,o))},__wbindgen_cast_0000000000000002:function(n,t){return u(R(n,t,c))},__wbindgen_cast_0000000000000003:function(n,t){return u(R(n,t,i))},__wbindgen_cast_0000000000000004:function(n,t){return u(R(n,t,r))},__wbindgen_cast_0000000000000005:function(n){return u(n)},__wbindgen_cast_0000000000000006:function(n,t){return u(b(n,t))},__wbindgen_cast_0000000000000007:function(n,t){return u(w(n,t))},__wbindgen_cast_0000000000000008:function(n){return u(BigInt.asUintN(64,n))},__wbindgen_object_clone_ref:function(n){return u(y(n))},__wbindgen_object_drop_ref:function(n){j(n)}};return{__proto__:null,"./phirepass-channel_bg.js":n}}function r(n,t){T.__wasm_bindgen_func_elem_39(n,t)}function o(n,t,e){T.__wasm_bindgen_func_elem_41(n,t,u(e))}function c(n,t,e){T.__wasm_bindgen_func_elem_41_1(n,t,u(e))}function i(n,t,e){T.__wasm_bindgen_func_elem_41_2(n,t,u(e))}const s=["blob","arraybuffer"],_="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((n=>T.__wbg_channel_free(n>>>0,1)));function u(n){v===m.length&&m.push(m.length+1);const t=v;return v=m[t],m[t]=n,t}const a="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((n=>T.__wbindgen_export4(n.a,n.b)));function f(n){const t=typeof n;if("number"==t||"boolean"==t||null==n)return`${n}`;if("string"==t)return`"${n}"`;if("symbol"==t){const t=n.description;return null==t?"Symbol":`Symbol(${t})`}if("function"==t){const t=n.name;return"string"==typeof t&&t.length>0?`Function(${t})`:"Function"}if(Array.isArray(n)){const t=n.length;let e="[";t>0&&(e+=f(n[0]));for(let r=1;r<t;r++)e+=", "+f(n[r]);return e+="]",e}const e=/\[object ([^\]]+)\]/.exec(toString.call(n));let r;if(!(e&&e.length>1))return toString.call(n);if(r=e[1],"Object"==r)try{return"Object("+JSON.stringify(n)+")"}catch(n){return"Object"}return n instanceof Error?`${n.name}: ${n.message}\n${n.stack}`:r}function b(n,t){return n>>>=0,h().subarray(n/1,n/1+t)}let l=null;function d(){return(null===l||!0===l.buffer.detached||void 0===l.buffer.detached&&l.buffer!==T.memory.buffer)&&(l=new DataView(T.memory.buffer)),l}function w(n,t){return function(n,t){return q+=t,q>=U&&(O=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),O.decode(),q=t),O.decode(h().subarray(n,n+t))}(n>>>=0,t)}let g=null;function h(){return null!==g&&0!==g.byteLength||(g=new Uint8Array(T.memory.buffer)),g}function y(n){return m[n]}function p(n,t){try{return n.apply(this,t)}catch(n){T.__wbindgen_export3(u(n))}}let m=new Array(1024).fill(void 0);m.push(void 0,null,!0,!1);let v=m.length;function A(n){return null==n}function R(n,t,e){const r={a:n,b:t,cnt:1},o=(...n)=>{r.cnt++;const t=r.a;r.a=0;try{return e(t,r.b,...n)}finally{r.a=t,o._wbg_cb_unref()}};return o._wbg_cb_unref=()=>{0==--r.cnt&&(T.__wbindgen_export4(r.a,r.b),r.a=0,a.unregister(r))},a.register(o,r,r),o}function S(n,t,e){if(void 0===e){const e=I.encode(n),r=t(e.length,1)>>>0;return h().subarray(r,r+e.length).set(e),W=e.length,r}let r=n.length,o=t(r,1)>>>0;const c=h();let i=0;for(;i<r;i++){const t=n.charCodeAt(i);if(t>127)break;c[o+i]=t}if(i!==r){0!==i&&(n=n.slice(i)),o=e(o,r,r=i+3*n.length,1)>>>0;const t=h().subarray(o+i,o+r);i+=I.encodeInto(n,t).written,o=e(o,r,i,1)>>>0}return W=i,o}function j(n){const t=y(n);return function(n){n<1028||(m[n]=v,v=n)}(n),t}let O=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});O.decode();const U=2146435072;let q=0;const I=new TextEncoder;"encodeInto"in I||(I.encodeInto=function(n,t){const e=I.encode(n);return t.set(e),{read:n.length,written:e.length}});let T,W=0;async function E(n){if(void 0!==T)return T;void 0!==n&&(Object.getPrototypeOf(n)===Object.prototype?({module_or_path:n}=n):console.warn("using deprecated parameters for the initialization function; pass a single object instead")),void 0===n&&(n=new URL("phirepass-channel_bg.wasm",import.meta.url));const t=e();("string"==typeof n||"function"==typeof Request&&n instanceof Request||"function"==typeof URL&&n instanceof URL)&&(n=fetch(n));const{instance:r}=await async function(n,t){if("function"==typeof Response&&n instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(n,t)}catch(t){if(!n.ok||!function(n){switch(n){case"basic":case"cors":case"default":return!0}return!1}(n.type)||"application/wasm"===n.headers.get("Content-Type"))throw t;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t)}const e=await n.arrayBuffer();return await WebAssembly.instantiate(e,t)}{const e=await WebAssembly.instantiate(n,t);return e instanceof WebAssembly.Instance?{instance:e,module:n}:e}}(await n,t);return function(n){return T=n.exports,l=null,g=null,T}(r)}var F,P,$;!function(n){n.Error="Error",n.AuthSuccess="AuthSuccess",n.TunnelOpened="TunnelOpened",n.TunnelClosed="TunnelClosed",n.TunnelData="TunnelData",n.SFTPListItems="SFTPListItems"}(F||(F={})),function(n){n[n.Username=0]="Username",n[n.Password=1]="Password",n[n.Default=2]="Default"}(P||(P={})),function(n){n.Disconnected="disconnected",n.Connected="connected",n.Error="error"}($||($={}));export{n as C,t as E,P as I,F as P,E as _,$ as a}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e,p as i,H as s,c as t,h as a,a as c}from"./index.js";import{_ as o,C as d,a as r,P as n}from"./p-rdgKcesn.js";const h=i(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.maximizeEvent=t(this,"maximize"),this.connectionStateChanged=t(this,"connectionStateChanged")}channel;domReady=!1;runtimeReady=!1;connected=!1;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())}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_login_screen_password=!1;toggle_max(){this.maximizeEvent?.emit(!this.max)}async connectedCallback(){await o(),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()}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){}handle_auth_success(e){this.clear_creds_buffer(),this.channel.start_heartbeat(this.heartbeatInterval<=15e3?3e4:this.heartbeatInterval),this.channel.open_sftp_tunnel(this.nodeId)}handle_tunnel_opened(e){}handle_tunnel_data(e){}handle_tunnel_closed(e){this.clear_creds_buffer(),this.close_comms()}open_comms(){this.channel=this.serverId?new d(this.create_web_socket_endpoint()+"/api/web/ws",this.nodeId,this.serverId):new d(this.create_web_socket_endpoint()+"/api/web/ws",this.nodeId),this.channel.on_connection_open((()=>{this.connectionStateChanged.emit([r.Connected]),this.channel.authenticate(this.token,this.nodeId)})),this.channel.on_connection_close((()=>{this.connectionStateChanged.emit([r.Disconnected])})),this.channel.on_connection_error((e=>{this.connectionStateChanged.emit([r.Error,e])})),this.channel.on_connection_message((()=>{})),this.channel.on_protocol_message((e=>{const{web:i}=e.data;switch(i.type){case n.Error:this.handle_error(i);break;case n.AuthSuccess:this.handle_auth_success(i);break;case n.TunnelOpened:this.handle_tunnel_opened(i);break;case n.TunnelClosed:this.handle_tunnel_closed(i);break;case n.TunnelData:this.handle_tunnel_data(i);break;default:console.warn("Unknown protocol message type:",i)}}))}close_comms(){this.channel.stop_heartbeat(),this.channel.disconnect()}clear_creds_buffer(){}reset_session_state(){this.clear_creds_buffer()}render(){return a(c,{key:"ac63e2c701cd09a605d0aaa7396eaec16ff9c3bc",class:{default:!this.max,max:this.max}},a("section",{key:"253dfc510c62ee57a96d574af993e8017475a0c2",class:"listing"},!this.hideHeader&&a("header",{key:"215ddf76ba55641892fc9a758077ba8d1f3a6671"},a("section",{key:"49541a8d31d8c61e2df84c60348f7426fddec67c",class:"title"},a("img",{key:"1a86ba6b3de92b35cbd5b1bacfdfee2da6fa6766",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS10ZXJtaW5hbCB3LTMuNSBoLTMuNSB0ZXh0LXByaW1hcnkiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iNCAxNyAxMCAxMSA0IDUiPjwvcG9seWxpbmU+CiAgICA8bGluZSB4MT0iMTIiIHgyPSIyMCIgeTE9IjE5IiB5Mj0iMTkiPjwvbGluZT4KPC9zdmc+Cg==",alt:"SFTP Client"}),a("div",{key:"38d90384978acc8b323ca4c396db7bda54320059",class:"text"},a("div",{key:"a94b3fd21025000b620b2bb85aec87198e575bfa",class:"name"},this.name),a("div",{key:"072c41dc8d05faf77929f8c128bb97b64d8835bf",class:"description"},this.description))),a("section",{key:"46e575f4ce5f2da0913d2f3aebe025540f1f3688",class:"actions"},a("div",{key:"f92d66ab7ab5e9c25a29037c60709c54623194be",class:"action",onClick:()=>this.toggle_max()},a("img",{key:"e115204a83336fc4b49a30551208b727c3f33be9",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTE1LCAxMjMsIDE0MCkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtbWF4aW1pemUyIHctMyBoLTMiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iMTUgMyAyMSAzIDIxIDkiPjwvcG9seWxpbmU+CiAgICA8cG9seWxpbmUgcG9pbnRzPSI5IDIxIDMgMjEgMyAxNSI+PC9wb2x5bGluZT4KICAgIDxsaW5lIHgxPSIyMSIgeDI9IjE0IiB5MT0iMyIgeTI9IjEwIj48L2xpbmU+CiAgICA8bGluZSB4MT0iMyIgeDI9IjEwIiB5MT0iMjEiIHkyPSIxNCI+PC9saW5lPgo8L3N2Zz4K",alt:"Maximize"})))),a("main",{key:"c6bf5ab4e5aa46dcba8e50ec1a9c2feb1f55ea02"}),a("footer",{key:"ac67a3e0966e3f04bee019162f8174aae58cbf1a"})),a("section",{key:"07e83117470f7f226328703b18f836bd4358cfe9",class:{creds:!0,blurred:this.show_login_screen}},this.show_login_screen&&a("form",{key:"808209eaba50f10a8ef96163972ad36ea9e3d3e2",class:"form"},a("div",{key:"9e26efeac2f17d6b4168e1a77da6ef61d325f6e3"},"SFTP Connection"),a("div",{key:"f9badb92d4434a16916429a2bedb6e38d2ae647c"},a("div",{key:"9fb267ba7828cd950b327a17e0ee803dc399c80b"},"Username"),a("input",{key:"65b34c14292b0bde408861e791f3baa99c4c9a02",type:"text",placeholder:""})),a("div",{key:"f1f9def8290dfcde9beff0f61092f6020580b72c"},a("div",{key:"1c89b71c4126299b7e8e421b05761d2b0424d4ed"},"Password"),a("input",{key:"17364976158ddaacbb55ed17ee09ec242bcbdce7",type:"password",placeholder:""})),a("div",{key:"9362acdf153ceeba3c8e8cee0518cf2baeec27e0"},a("button",{key:"ebf6c205276a7c3ff34c13e148978be61044ff7a"},"Connect")))))}static get watchers(){return{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}}static get style(){return":host{--radius:0.375rem;--card:220 18% 10%;--border:220 15% 18%;--primary:160 60% 45%;--muted-foreground:220 10% 50%;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;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))}}}}footer{height:25px;background:rgba(28, 31, 38, 0.6);border-top:1px solid hsl(var(--border))}}.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)}.form{display:flex;flex-direction:column;background:hsl(var(--card));width:200px;position:relative;background-color:rgba(21, 24, 30, 0.95);border:1px solid hsl(var(--border));padding:20px;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}}}:host(.max){height:100vh;width:100vw;position:fixed;top:0;left:0;z-index:9999}"}},[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]},void 0,{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}]);function l(){"undefined"!=typeof customElements&&["phirepass-sftp-client"].forEach((i=>{"phirepass-sftp-client"===i&&(customElements.get(e(i))||customElements.define(e(i),h))}))}l();const b=h,p=l;export{b as PhirepassSftpClient,p as defineCustomElement}
|
|
1
|
+
import{t as e,p as i,H as t,c as a,h as s,a as r}from"./index.js";import{_ as o,E as c,C as d,a as n,P as l}from"./p-BcIhGXR0.js";const h=i(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.maximizeEvent=a(this,"maximize"),this.connectionStateChanged=a(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 o(),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 c.Generic:case c.Authentication:this.error_message=e.message||"An unknown error occurred.";break;case c.RequiresUsername:this.show_login_screen_username=!0,this.show_login_screen_password=!1,this.show_login_screen=!0;break;case c.RequiresPassword:this.show_login_screen_username=!1,this.show_login_screen_password=!0,this.show_login_screen=!0;break;case c.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 d(this.create_web_socket_endpoint()+"/api/web/ws",this.nodeId,this.serverId):new d(this.create_web_socket_endpoint()+"/api/web/ws",this.nodeId),this.channel.on_connection_open((()=>{this.connectionStateChanged.emit([n.Connected]),this.channel.authenticate(this.token,this.nodeId),this.status="Authenticating..."})),this.channel.on_connection_close((()=>{this.connectionStateChanged.emit([n.Disconnected]),this.status="Disconnected"})),this.channel.on_connection_error((e=>{this.connectionStateChanged.emit([n.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 l.Error:this.handle_error(i);break;case l.AuthSuccess:this.handle_auth_success(i);break;case l.TunnelOpened:this.handle_tunnel_opened(i);break;case l.TunnelClosed:this.handle_tunnel_closed(i);break;case l.TunnelData:this.handle_tunnel_data(i);break;case l.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 s(r,{key:"c19b87e943347cc55424450e7e4f10bc3447e828",class:{default:!this.max,max:this.max}},s("section",{key:"88ecbc0d1a1460dd262150706216f7f758fb7981",class:"listing"},!this.hideHeader&&s("header",{key:"dd28677d023aeaf431cb3b99449751f6385c767d"},s("section",{key:"ad56b31550d096cb59e92bc6167be11b76a9c368",class:"title"},s("img",{key:"00ce4e832edfb672b0eadb0462a5a132cfa67e09",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoNDYsIDE4NCwgMTM4KSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiCiAgICBjbGFzcz0ibHVjaWRlIGx1Y2lkZS10ZXJtaW5hbCB3LTMuNSBoLTMuNSB0ZXh0LXByaW1hcnkiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iNCAxNyAxMCAxMSA0IDUiPjwvcG9seWxpbmU+CiAgICA8bGluZSB4MT0iMTIiIHgyPSIyMCIgeTE9IjE5IiB5Mj0iMTkiPjwvbGluZT4KPC9zdmc+Cg==",alt:"SFTP Client"}),s("div",{key:"ee186cc2c643afefa425bb6ce862686dce5ba6ab",class:"text"},s("div",{key:"29c5922bf9826930ac33fe6c200bf47fce1e183e",class:"name"},this.name),s("div",{key:"76d6bba6cb51b9907db533395c258ee7458cf5ce",class:"description"},this.description))),s("section",{key:"d3bfbf402aed51cba973830b14b9d4f276011535",class:"actions"},s("div",{key:"87eb4484d8552a582c35e4960a82003f7570bf26",class:"action",onClick:()=>this.toggle_max()},s("img",{key:"3ff40a471fc54a1d97a4aa5c4746dc837082307d",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTE1LCAxMjMsIDE0MCkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtbWF4aW1pemUyIHctMyBoLTMiPgogICAgPHBvbHlsaW5lIHBvaW50cz0iMTUgMyAyMSAzIDIxIDkiPjwvcG9seWxpbmU+CiAgICA8cG9seWxpbmUgcG9pbnRzPSI5IDIxIDMgMjEgMyAxNSI+PC9wb2x5bGluZT4KICAgIDxsaW5lIHgxPSIyMSIgeDI9IjE0IiB5MT0iMyIgeTI9IjEwIj48L2xpbmU+CiAgICA8bGluZSB4MT0iMyIgeDI9IjEwIiB5MT0iMjEiIHkyPSIxNCI+PC9saW5lPgo8L3N2Zz4K",alt:"Maximize"})))),s("main",{key:"a441806676df938682df422acce7b640e452eece"},this.show_navigation&&s("nav",{key:"d7fe91b30ecd998985301c2f0ac5064ee4bfc9fa",class:"navigation"},s("div",{key:"17bd0d958fb55b8a89b6af7becbeb1cd892066a5",class:"breadcrumbs"},this.breadcrumbs.map(((e,i,t)=>s(s.Fragment,null,s("span",{key:i,onClick:()=>this.list_breadcrumb(e.path),class:"breadcrumb"},e.label),i<t.length-1&&s("img",{class:"arrow",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogICAgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIKICAgIGNsYXNzPSJsdWNpZGUgbHVjaWRlLWNoZXZyb24tcmlnaHQgdy0zIGgtMyB0ZXh0LW11dGVkLWZvcmVncm91bmQvNTAgc2hyaW5rLTAiPgogICAgPHBhdGggZD0ibTkgMTggNi02LTYtNiI+PC9wYXRoPgo8L3N2Zz4K"}))))),s("section",{key:"0f65ff3c51a3aeba3bf046445fc858b05e1e5106",class:"actions","aria-label":"SFTP actions"},s("button",{key:"5184ea48385f5b1f235e7fe0a01eed0171782e76",type:"button",class:"action",onClick:()=>this.go_to_parent_directory(),title:"Go to parent directory","aria-label":"Go to parent directory"},s("img",{key:"345aa00fe17569c8d9037e9304b381868effe862",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtYXJyb3ctdXAgdy0zLjUgaC0zLjUiPgogICAgPHBhdGggZD0ibTUgMTIgNy03IDcgNyI+PC9wYXRoPgogICAgPHBhdGggZD0iTTEyIDE5VjUiPjwvcGF0aD4KPC9zdmc+Cg==",alt:"Go up"})),s("button",{key:"eec7a682ed944746eabf939dfff1073bb85dfae6",type:"button",class:"action",onClick:()=>this.refresh_directory(),title:"Refresh","aria-label":"Refresh"},s("img",{key:"ab1faf4dc27ca0a85b152c559b2f4953c7fddb15",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtcmVmcmVzaC1jdyB3LTMuNSBoLTMuNSI+CiAgICA8cGF0aCBkPSJNMyAxMmE5IDkgMCAwIDEgOS05IDkuNzUgOS43NSAwIDAgMSA2Ljc0IDIuNzRMMjEgOCI+PC9wYXRoPgogICAgPHBhdGggZD0iTTIxIDN2NWgtNSI+PC9wYXRoPgogICAgPHBhdGggZD0iTTIxIDEyYTkgOSAwIDAgMS05IDkgOS43NSA5Ljc1IDAgMCAxLTYuNzQtMi43NEwzIDE2Ij48L3BhdGg+CiAgICA8cGF0aCBkPSJNOCAxNkgzdjUiPjwvcGF0aD4KPC9zdmc+Cg==",alt:"Refresh"})),s("button",{key:"529ad0cd6e000978294be16aedb9ec8f2b6d699e",type:"button",class:"action",onClick:()=>this.open_upload_picker(),title:"Upload","aria-label":"Upload"},s("img",{key:"669ceed59555391014ea531e4398517a1c4bc77a",src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIgogICAgc3Ryb2tlPSJyZ2IoMTg5LCAyMTksIDIwOSkiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIgogICAgY2xhc3M9Imx1Y2lkZSBsdWNpZGUtdXBsb2FkIHctMy41IGgtMy41Ij4KICAgIDxwYXRoIGQ9Ik0yMSAxNXY0YTIgMiAwIDAgMS0yIDJINWEyIDIgMCAwIDEtMi0ydi00Ij48L3BhdGg+CiAgICA8cG9seWxpbmUgcG9pbnRzPSIxNyA4IDEyIDMgNyA4Ij48L3BvbHlsaW5lPgogICAgPGxpbmUgeDE9IjEyIiB4Mj0iMTIiIHkxPSIzIiB5Mj0iMTUiPjwvbGluZT4KPC9zdmc+Cg==",alt:"Upload"})),s("button",{key:"3b0602bd52a1ed066e76f136ba18e67a2e923f05",type:"button",class:"action disconnect",onClick:()=>this.disconnect_session(),title:"Disconnect","aria-label":"Disconnect"},"DISCONNECT"))),s("input",{key:"272d2fe2f2d61b02c4d2e5c8624f2c0ccc7daa92",type:"file",ref:e=>this.uploadInputEl=e,onChange:e=>this.on_upload_selected(e),style:{display:"none"}}),this.show_content&&s("div",{key:"2f080688bfa4c95663c278d875eceebbda78094a",class:"content"},s("table",{key:"3c10b9615ba21dce3aaa47850d03f083d0ef0107"},s("thead",{key:"366af5b1b875d394450b78b6490c813ac930f0fa"},s("tr",{key:"d3116485a0f02953c96e309f1c44d5e47cea9dcd"},s("th",{key:"6af47d08c0bac5dd887ceda7b3f75101caeaebc3"},"Name"),s("th",{key:"3c8c72711429b988e24118810ef3ea30eb779bb7"},"Size"),s("th",{key:"8dd16c387287e4dd3bf29dbea304f6dd8871686a"},"Permissions"),s("th",{key:"7b2c6ca49d8dd4150895307a4499d3e083cc8900"},"Owner"),s("th",{key:"1723d32cf185dbaeea6d3bd9dbe3f72fc055c5a2"},"Modified"))),s("tbody",{key:"685d9eae4f0ac61e07b44710be235bafaaefa7df"},this.listing.map(((e,i)=>s("tr",{key:i,class:{selected:this.is_selected(e)},onClick:()=>this.list_directory(e)},s("td",null,s("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"}),s("span",{class:"name "+e.kind.toLowerCase()},e.name)),s("td",null,e.attributes.size),s("td",null,e.attributes.permissions??"-"),s("td",null,e.attributes.user??"-"),s("td",null,new Date(1e3*e.attributes.mtime).toLocaleString()))))))),this.show_loader&&s("div",{key:"8337354a4cd9ca456d7845ff4934ceebb36f7dc6",class:"loader"},"Loading..."),this.show_error&&s("div",{key:"c547ad1c0f24de427a77129f77402830910e98b4",class:"error"},this.error_message)),s("footer",{key:"e452f0e2f7982049df57498ef9ed1cf63c70e9eb"},s("section",{key:"00111d90943b2bfb21392dede79af5e009d43524",class:"status"},s("span",{key:"1c10ae5cb21118059fe61625f9fc4d0aa18be448"},this.status),this.selected_item&&s("span",{key:"82939fb59d72ca3823e8c580578a6f13ce4079b0",class:"selected-item"},this.get_full_path(this.selected_item))),s("section",{key:"38380847cf818eb024ec5743ffd92e3369b2cc40",class:"version"},"Version: ",this.version))),this.show_login_screen&&s("section",{key:"1840f9bae95e8906c38dade1e15f6c52f360829b",class:{creds:!0,blurred:this.show_login_screen}},s("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()}},s("div",{key:"25a15115fb41d65d59750a176d46a7e844286e00",class:"title"},"SFTP Connection"),this.show_login_screen_username&&s("div",{key:"13f5053dbf65445220551f554df5ab03fb7fb7c0"},s("label",{key:"5016afe8eb38c54800697fbe2d4602269966edc9",htmlFor:"username"},"Username"),s("input",{key:"48e7e3029b0369e06f5d1bafcf4bc9bc3fccfb1a",id:"username",autoComplete:"off",name:"username",type:"text",placeholder:""})),this.show_login_screen_password&&s("div",{key:"cd06fc73813094a57899c3be077f3dba0a5ca133"},s("label",{key:"f64e3145d4df56d4654dedb0188c2a33db09634b",htmlFor:"password"},"Password"),s("input",{key:"6e22d7cfbf40b8d2e77a23730d55df2e900d5da7",id:"password",autoComplete:"off",name:"password",type:"password",placeholder:""})),s("div",{key:"9405dbf23cb588db9b2368c3155a9230ab046438"},s("button",{key:"b8087e7b9a828db3d6b36f8fe06d564c76d01402",type:"submit"},"Connect")))))}static get watchers(){return{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}}static get style(){return":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}"}},[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]},void 0,{nodeId:[{onNodeIdChange:0}],serverId:[{onServerIdChange:0}]}]);function b(){"undefined"!=typeof customElements&&["phirepass-sftp-client"].forEach((i=>{"phirepass-sftp-client"===i&&(customElements.get(e(i))||customElements.define(e(i),h))}))}b();const g=h,I=b;export{g as PhirepassSftpClient,I as defineCustomElement}
|