hfs 0.57.7 → 0.57.9-beta1
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/admin/assets/index-Byv1_NxP.css +1 -0
- package/admin/assets/{index-CohfvC-z.js → index-DR1ogCDr.js} +123 -123
- package/admin/assets/{sha512-EIVFH4U6.js → sha512-Bj-WmKyX.js} +1 -1
- package/admin/index.html +2 -2
- package/frontend/assets/{index-legacy-BGyJbdtp.js → index-legacy-D9GCbsuY.js} +6 -6
- package/frontend/assets/{sha512-legacy-BDEvLuzM.js → sha512-legacy-BnntGLFG.js} +1 -1
- package/frontend/index.html +1 -1
- package/package.json +4 -8
- package/src/api.net.js +1 -1
- package/src/api.vfs.js +3 -2
- package/src/const.js +1 -1
- package/src/cross-const.js +3 -4
- package/src/fileAttr.js +2 -2
- package/src/listen.js +3 -1
- package/src/serveGuiAndSharedFiles.js +22 -2
- package/src/update.js +7 -5
- package/src/upload.js +38 -102
- package/admin/assets/index-B0njt6Ql.css +0 -1
package/src/upload.js
CHANGED
|
@@ -5,13 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.dontOverwriteUploading = exports.minAvailableMb = exports.deleteUnfinishedUploadsAfter = void 0;
|
|
7
7
|
exports.getUploadMeta = getUploadMeta;
|
|
8
|
+
exports.getUploadTempFor = getUploadTempFor;
|
|
8
9
|
exports.uploadWriter = uploadWriter;
|
|
9
10
|
const vfs_1 = require("./vfs");
|
|
10
11
|
const const_1 = require("./const");
|
|
11
12
|
const path_1 = require("path");
|
|
12
13
|
const fs_1 = __importDefault(require("fs"));
|
|
13
14
|
const misc_1 = require("./misc");
|
|
14
|
-
const frontEndApis_1 = require("./frontEndApis");
|
|
15
15
|
const config_1 = require("./config");
|
|
16
16
|
const util_os_1 = require("./util-os");
|
|
17
17
|
const connections_1 = require("./connections");
|
|
@@ -23,9 +23,6 @@ const events_1 = __importDefault(require("./events"));
|
|
|
23
23
|
const promises_1 = require("fs/promises");
|
|
24
24
|
const expiringCache_1 = require("./expiringCache");
|
|
25
25
|
const first_1 = require("./first");
|
|
26
|
-
const stream_1 = require("stream");
|
|
27
|
-
const promises_2 = require("node:fs/promises");
|
|
28
|
-
const xxhashjs_1 = __importDefault(require("xxhashjs"));
|
|
29
26
|
exports.deleteUnfinishedUploadsAfter = (0, config_1.defineConfig)('delete_unfinished_uploads_after', 86400);
|
|
30
27
|
exports.minAvailableMb = (0, config_1.defineConfig)('min_available_mb', 100);
|
|
31
28
|
exports.dontOverwriteUploading = (0, config_1.defineConfig)('dont_overwrite_uploading', true);
|
|
@@ -50,19 +47,8 @@ function setUploadMeta(path, ctx) {
|
|
|
50
47
|
ip: ctx.ip,
|
|
51
48
|
});
|
|
52
49
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const stream = new stream_1.Transform({
|
|
56
|
-
transform(chunk, enc, done) {
|
|
57
|
-
hash.update(chunk);
|
|
58
|
-
done();
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
fs_1.default.createReadStream(fn, { end: limit - 1 }).pipe(stream);
|
|
62
|
-
console.debug('hashing', fn);
|
|
63
|
-
await (0, stream_1.once)(stream, 'finish');
|
|
64
|
-
console.debug('hashed', fn);
|
|
65
|
-
return hash.digest().toString(16);
|
|
50
|
+
function getUploadTempFor(fullPath) {
|
|
51
|
+
return (0, path_1.join)((0, path_1.dirname)(fullPath), 'hfs$upload-' + (0, path_1.basename)(fullPath).slice(-200));
|
|
66
52
|
}
|
|
67
53
|
const diskSpaceCache = (0, expiringCache_1.expiringCache)(3000); // invalidate shortly
|
|
68
54
|
const uploadingFiles = new Map();
|
|
@@ -70,20 +56,14 @@ const uploadingFiles = new Map();
|
|
|
70
56
|
function uploadWriter(base, baseUri, path, ctx) {
|
|
71
57
|
if ((0, misc_1.dirTraversal)(path))
|
|
72
58
|
return fail(const_1.HTTP_FOOL);
|
|
73
|
-
if ((0, vfs_1.statusCodeForMissingPerm)(base, 'can_upload', ctx))
|
|
74
|
-
if (!ctx.get('x-hfs-wait')) { // you can disable the following behavior
|
|
75
|
-
// avoid waiting hours for just an error
|
|
76
|
-
const t = setTimeout(() => (0, connections_1.disconnect)(ctx), 30000);
|
|
77
|
-
ctx.res.on('finish', () => clearTimeout(t));
|
|
78
|
-
}
|
|
59
|
+
if ((0, vfs_1.statusCodeForMissingPerm)(base, 'can_upload', ctx))
|
|
79
60
|
return fail();
|
|
80
|
-
}
|
|
81
|
-
// enforce minAvailableMb
|
|
82
61
|
const fullPath = (0, path_1.join)(base.source, path);
|
|
83
62
|
const already = uploadingFiles.get(fullPath); // this can be checked so early because this function is sync
|
|
84
63
|
if (already) // if it's the same client, we tell to retry later
|
|
85
|
-
return fail(ctx.query.
|
|
64
|
+
return fail(const_1.HTTP_CONFLICT, ctx.query.id && ctx.query.id === already.ctx.query.id ? 'retry' : 'already uploading');
|
|
86
65
|
const dir = (0, path_1.dirname)(fullPath);
|
|
66
|
+
// enforce minAvailableMb
|
|
87
67
|
const min = exports.minAvailableMb.get() * (1 << 20);
|
|
88
68
|
const contentLength = Number(ctx.headers["content-length"]);
|
|
89
69
|
const isPartial = ctx.query.partial !== undefined; // while the presence of "partial" conveys the upload is split...
|
|
@@ -98,13 +78,13 @@ function uploadWriter(base, baseUri, path, ctx) {
|
|
|
98
78
|
let closestVfsNode = base; // if base=root, there's no parent and no original
|
|
99
79
|
while ((closestVfsNode === null || closestVfsNode === void 0 ? void 0 : closestVfsNode.parent) && !closestVfsNode.original)
|
|
100
80
|
closestVfsNode = closestVfsNode.parent; // if it's not original, it surely has a parent
|
|
101
|
-
const
|
|
102
|
-
const res = diskSpaceCache.try(
|
|
81
|
+
const dirToCheck = closestVfsNode.source;
|
|
82
|
+
const res = diskSpaceCache.try(dirToCheck, () => (0, util_os_1.getDiskSpaceSync)(dirToCheck));
|
|
103
83
|
if (!res)
|
|
104
84
|
throw 'miss';
|
|
105
85
|
const { free } = res;
|
|
106
86
|
if (typeof free !== 'number' || isNaN(free))
|
|
107
|
-
throw
|
|
87
|
+
throw JSON.stringify(res);
|
|
108
88
|
const reservedSpace = lodash_1.default.sumBy(Array.from(uploadingFiles.values()), x => x.size - x.got);
|
|
109
89
|
if (stillToWrite > free - (min || 0) - reservedSpace)
|
|
110
90
|
return fail(const_1.HTTP_INSUFFICIENT_STORAGE);
|
|
@@ -116,53 +96,33 @@ function uploadWriter(base, baseUri, path, ctx) {
|
|
|
116
96
|
if (ctx.query.existing === 'skip' && fs_1.default.existsSync(fullPath))
|
|
117
97
|
return fail(const_1.HTTP_CONFLICT, 'exists');
|
|
118
98
|
let overwriteRequestedButForbidden = false;
|
|
99
|
+
const mtime = Number(ctx.query.mtime) || 0;
|
|
119
100
|
try {
|
|
120
|
-
const sendCurrentSize = lodash_1.default.debounce(() => (0, frontEndApis_1.notifyClient)(ctx, const_1.UPLOAD_RESUMABLE, { path, written: getCurrentSize() }), 1000, { maxWait: 1000 });
|
|
121
101
|
// if upload creates a folder, then add meta to it too
|
|
122
102
|
if (!dir.endsWith(':\\') && fs_1.default.mkdirSync(dir, { recursive: true }))
|
|
123
103
|
setUploadMeta(dir, ctx);
|
|
124
104
|
// use temporary name while uploading
|
|
125
|
-
const
|
|
126
|
-
const firstTempName = (0, path_1.join)(dir, 'hfs$upload-' + keepName);
|
|
127
|
-
const altTempName = (0, path_1.join)(dir, 'hfs$upload2-' + keepName); // this file makes sense only while smaller than firstTempName
|
|
128
|
-
const splitAndPreserving = ctx.query.preserveTempFile; // frontend knows about existing temp that can be resumed, but it is not resuming that, but instead it is continuing split-uploading on alternative temp file
|
|
129
|
-
let tempName = splitAndPreserving ? altTempName : firstTempName;
|
|
105
|
+
const tempName = getUploadTempFor(fullPath);
|
|
130
106
|
const stats = (0, misc_1.try_)(() => fs_1.default.statSync(tempName));
|
|
131
|
-
const resumableSize = (stats === null || stats === void 0 ? void 0 : stats.size) || 0;
|
|
132
|
-
const firstResumableStats = tempName === firstTempName ? stats : (0, misc_1.try_)(() => fs_1.default.statSync(firstTempName));
|
|
133
|
-
let resumableTempName = resumableSize > 0 ? tempName : undefined;
|
|
134
|
-
if (resumableTempName)
|
|
135
|
-
tempName = altTempName;
|
|
107
|
+
const resumableSize = (stats === null || stats === void 0 ? void 0 : stats.size) || 0;
|
|
136
108
|
// checks for resume feature
|
|
137
|
-
|
|
138
|
-
|
|
109
|
+
const par = String(ctx.query.resume || '');
|
|
110
|
+
const resume = parseInt(par) || 0;
|
|
111
|
+
const strictResume = par.at(-1) === '!';
|
|
112
|
+
if (resume > resumableSize || resume < 0)
|
|
139
113
|
return fail(const_1.HTTP_RANGE_NOT_SATISFIABLE);
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
size: resumableSize,
|
|
149
|
-
// a resumable file exists without a record? then we record it (delayedDelete), plus we provide a hash ASAP, since there's no previous giveBack to compare with
|
|
150
|
-
...resumeInfo || lodash_1.default.omit(delayedDelete(path, exports.deleteUnfinishedUploadsAfter.get() || 0), 'giveBack'), // giveBack makes sense only if coming from resumeObject
|
|
151
|
-
timeout: undefined // this entry is here to remove the property copied in the previous line
|
|
152
|
-
});
|
|
153
|
-
if (x && !resumeInfo)
|
|
154
|
-
(0, frontEndApis_1.notifyClient)(ctx, const_1.UPLOAD_RESUMABLE_HASH, { path, hash: await (0, misc_1.parseFile)(x, calcHash) }); // negligible memory leak
|
|
155
|
-
});
|
|
114
|
+
const resumeInfo = resumableSize && waitingToBeDeleted[tempName];
|
|
115
|
+
if (strictResume) // frontend asked to be notified about resumable uploads
|
|
116
|
+
if (resumableSize > resume && (!resumeInfo || resumeInfo.mtime === mtime)) {
|
|
117
|
+
ctx.set('x-size', String(resumableSize));
|
|
118
|
+
if (!resumeInfo) // if unavailable, the client can request hashing
|
|
119
|
+
ctx.set(const_1.MTIME_CHECK, 'not-available');
|
|
120
|
+
return fail(const_1.HTTP_PRECONDITION_FAILED);
|
|
121
|
+
}
|
|
156
122
|
// append if resuming
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
resume = 0;
|
|
123
|
+
if (!resume && stats)
|
|
124
|
+
fs_1.default.unlinkSync(tempName);
|
|
160
125
|
const writeStream = (0, misc_1.createStreamLimiter)(contentLength !== null && contentLength !== void 0 ? contentLength : Infinity);
|
|
161
|
-
if (resume && resumableTempName && !splitAndPreserving) { // we want to resume the firstTempName, actually
|
|
162
|
-
fs_1.default.rm(altTempName, () => { });
|
|
163
|
-
tempName = resumableTempName;
|
|
164
|
-
}
|
|
165
|
-
let isWritingSecondFile = tempName === altTempName;
|
|
166
126
|
const fullSize = stillToWrite + resume;
|
|
167
127
|
ctx.state.uploadDestinationPath = tempName;
|
|
168
128
|
// allow plugins to mess with the write-stream, because the read-stream can be complicated in case of multipart
|
|
@@ -170,8 +130,7 @@ function uploadWriter(base, baseUri, path, ctx) {
|
|
|
170
130
|
const resEvent = events_1.default.emit('uploadStart', obj);
|
|
171
131
|
if (resEvent === null || resEvent === void 0 ? void 0 : resEvent.isDefaultPrevented())
|
|
172
132
|
return;
|
|
173
|
-
const fileStream =
|
|
174
|
-
: fs_1.default.createWriteStream(tempName);
|
|
133
|
+
const fileStream = fs_1.default.createWriteStream(tempName, resume ? { flags: 'r+', start: resume } : undefined);
|
|
175
134
|
writeStream.on('error', e => {
|
|
176
135
|
releaseFile();
|
|
177
136
|
console.debug(e);
|
|
@@ -184,26 +143,24 @@ function uploadWriter(base, baseUri, path, ctx) {
|
|
|
184
143
|
uploadingFiles.set(fullPath, tracked);
|
|
185
144
|
console.debug('upload started');
|
|
186
145
|
// the file stream doesn't have an event for data being written, so we use 'data' of its feeder, which happens before, so we postpone a bit, trying to have a fresher number
|
|
187
|
-
writeStream.on('data', () => setTimeout(
|
|
188
|
-
const lockMiddleware = (0, misc_1.pendingPromise)(); // expose when all operations stopped
|
|
146
|
+
writeStream.on('data', () => setTimeout(() => tracked.got = bytesGot()));
|
|
147
|
+
const lockMiddleware = (0, misc_1.pendingPromise)(); // expose outside, to let know when all operations stopped
|
|
189
148
|
writeStream.once('close', async () => {
|
|
190
149
|
try {
|
|
191
150
|
ctx.state.uploadSize = bytesGot(); // in case content-length is not specified
|
|
192
151
|
await new Promise(res => fileStream.close(res)); // this only seems necessary on Windows
|
|
193
152
|
if (ctx.isAborted()) { // in the very unlikely case the connection is interrupted between last-byte and here, we still consider it unfinished, as the client had no way to know, and will resume, but it would get an error if we finish the process
|
|
194
|
-
if (isWritingSecondFile) // we don't want to be left with 2 temp files
|
|
195
|
-
return (0, promises_1.rm)(altTempName).catch(console.warn);
|
|
196
153
|
const sec = exports.deleteUnfinishedUploadsAfter.get();
|
|
197
154
|
return lodash_1.default.isNumber(sec) && delayedDelete(tempName, sec);
|
|
198
155
|
}
|
|
199
|
-
if (isPartial) // we are supposed to leave the upload as
|
|
156
|
+
if (isPartial) // we are supposed to leave the unfinished upload as it is, with its temp name
|
|
200
157
|
return ctx.status = const_1.HTTP_NO_CONTENT; // lockMiddleware contains an empty string, so we must take care of the status
|
|
201
|
-
let dest = fullPath;
|
|
158
|
+
let dest = fullPath; // final destination, considering numbering if necessary
|
|
202
159
|
if (exports.dontOverwriteUploading.get() && !await overwriteAnyway() && fs_1.default.existsSync(dest)) {
|
|
203
160
|
if (overwriteRequestedButForbidden) {
|
|
204
161
|
await (0, promises_1.rm)(tempName).catch(console.warn);
|
|
205
162
|
releaseFile();
|
|
206
|
-
return fail();
|
|
163
|
+
return fail(); // status code set by overwriteAnyway
|
|
207
164
|
}
|
|
208
165
|
const ext = (0, path_1.extname)(dest);
|
|
209
166
|
const base = dest.slice(0, -ext.length || Infinity);
|
|
@@ -214,15 +171,9 @@ function uploadWriter(base, baseUri, path, ctx) {
|
|
|
214
171
|
}
|
|
215
172
|
try {
|
|
216
173
|
await (0, promises_1.rename)(tempName, dest);
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
await (0, promises_2.utimes)(dest, Date.now() / 1000, t / 1000);
|
|
174
|
+
if (mtime) // so we use it to touch the file
|
|
175
|
+
await (0, promises_1.utimes)(dest, Date.now() / 1000, mtime / 1000);
|
|
220
176
|
cancelDeletion(tempName); // not necessary, as deletion's failure is silent, but still
|
|
221
|
-
if (isWritingSecondFile) { // we've been using altTempName, but now we're done, so we can delete firstTempName
|
|
222
|
-
cancelDeletion(firstTempName);
|
|
223
|
-
await (0, promises_1.rm)(firstTempName); // wait, so the client can count on the temp-file being gone
|
|
224
|
-
}
|
|
225
|
-
releaseFile();
|
|
226
177
|
ctx.state.uploadDestinationPath = dest;
|
|
227
178
|
void setUploadMeta(dest, ctx);
|
|
228
179
|
if (ctx.query.comment)
|
|
@@ -263,25 +214,9 @@ function uploadWriter(base, baseUri, path, ctx) {
|
|
|
263
214
|
}, 1000);
|
|
264
215
|
writeStream.once('close', () => clearInterval(h));
|
|
265
216
|
}
|
|
266
|
-
function getCurrentSize() {
|
|
267
|
-
return bytesGot() + resume;
|
|
268
|
-
}
|
|
269
217
|
function bytesGot() {
|
|
270
218
|
return fileStream.bytesWritten + fileStream.writableLength;
|
|
271
219
|
}
|
|
272
|
-
function checkIfNewUploadBecameLargerThanResumable() {
|
|
273
|
-
tracked.got = bytesGot();
|
|
274
|
-
sendCurrentSize(); // keep the client updated in case it needs to resume on disconnection
|
|
275
|
-
if (isWritingSecondFile && getCurrentSize() > (firstResumableStats === null || firstResumableStats === void 0 ? void 0 : firstResumableStats.size))
|
|
276
|
-
try { // better be sync here, as we don't want the upload to finish in the middle of the rename
|
|
277
|
-
fs_1.default.renameSync(tempName, firstTempName); // try to rename $upload2 to $upload, overwriting
|
|
278
|
-
tempName = firstTempName;
|
|
279
|
-
isWritingSecondFile = false;
|
|
280
|
-
resumableTempName = undefined;
|
|
281
|
-
(0, frontEndApis_1.notifyClient)(ctx, const_1.UPLOAD_RESUMABLE, { path }); // no longer resumable
|
|
282
|
-
}
|
|
283
|
-
catch (_a) { }
|
|
284
|
-
}
|
|
285
220
|
}
|
|
286
221
|
catch (e) {
|
|
287
222
|
releaseFile();
|
|
@@ -300,8 +235,7 @@ function uploadWriter(base, baseUri, path, ctx) {
|
|
|
300
235
|
var _a;
|
|
301
236
|
clearTimeout((_a = waitingToBeDeleted[path]) === null || _a === void 0 ? void 0 : _a.timeout);
|
|
302
237
|
return waitingToBeDeleted[path] = {
|
|
303
|
-
|
|
304
|
-
mtimeMs: (0, misc_1.try_)(() => fs_1.default.statSync(path).mtimeMs),
|
|
238
|
+
mtime,
|
|
305
239
|
expires: Date.now() + secs * 1000,
|
|
306
240
|
timeout: setTimeout(() => {
|
|
307
241
|
delete waitingToBeDeleted[path];
|
|
@@ -322,6 +256,8 @@ function uploadWriter(base, baseUri, path, ctx) {
|
|
|
322
256
|
ctx.status = status;
|
|
323
257
|
if (msg)
|
|
324
258
|
ctx.body = msg;
|
|
325
|
-
|
|
259
|
+
if (status >= 400 // with other codes Chrome will report ERR_CONNECTION_RESET
|
|
260
|
+
&& !ctx.get('x-hfs-wait')) // you can disable the following behavior
|
|
261
|
+
setTimeout(() => (0, connections_1.disconnect)(ctx), 200); // don't wait, if the upload is still in progress
|
|
326
262
|
}
|
|
327
263
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.ariaOnly{position:absolute;clip-path:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}.icon{font-size:1.2em;height:1.2em;width:1.4em;display:inline-block;text-align:center}@keyframes blink{0%{opacity:1}50%{opacity:.3}}:root{height:100dvh;--success: #5c5}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;height:100vh;background:#000}#root{min-height:100%;display:flex}main{word-break:break-word}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}img.flag{width:1.5em;height:1em;vertical-align:text-top;margin-top:1px}.icon-w-text{margin-right:.5em}form{max-width:100%}.MuiSvgIcon-root{vertical-align:bottom}div.MuiTreeItem-content{padding:0}.MuiDataGrid-columnHeaders{background-color:#8882}.MuiDataGrid-cell{line-height:1.1em}.MuiDataGrid-filterForm{flex-wrap:wrap;justify-content:space-evenly;row-gap:1em}.wrap[role=cell]{white-space:normal!important}ol,ul{margin-top:.2em;margin-bottom:.2em;padding-left:1.5em}h2.MuiDialogTitle-root{padding-top:2px;padding-bottom:2px}.dialog-alert .MuiDialogContent-root{max-width:45em;padding:.5em 1em}.release code{font-size:95%;background-color:#8883;padding:0 .2em;border-radius:.2em}.animated-dashed-line{width:100%;height:2px;background-image:linear-gradient(to right,currentColor 50%,transparent 50%);background-size:10px 100%;animation:animate-dash 1s alternate linear infinite}@keyframes animate-dash{to{background-position:20px 0}}@keyframes success{50%{transform:scale(1.3);color:var(--success)}to{transform:inherit;color:inherit}}::-webkit-scrollbar{width:4px}::-webkit-scrollbar-thumb{background:#8888}::-webkit-scrollbar-track{background:#8882}.token.operator{background:unset!important}.dialog-backdrop{position:fixed;inset:0;background:#8886;backdrop-filter:blur(2px);display:flex;justify-content:center;align-items:center;z-index:1000}.dialog{background:#fff;background:var(--bg);padding:.5em;padding:max(.5em,1vw,2vh);padding-top:0;border-radius:1em;position:relative;margin:0 3vw;overflow:hidden;max-height:calc(100vh - 2em);display:flex;flex-direction:column;justify-content:center}.dialog-icon{color:#fff;background-color:var(--color);position:absolute;top:0;width:2em;height:1.8em;text-align:center;border-radius:.8em 0}.dialog-icon-text{display:flex;align-items:center;justify-content:center}.dialog-title{font-size:120%;font-weight:400;margin:.3em 0;padding:0 .5em;min-height:1.2em}.dialog-closer~.dialog-title{margin-right:2em}.dialog-type~.dialog-title{margin-left:2em}.dialog-icon~.dialog-title{text-align:center}.dialog-closer{border-radius:0 .8em;right:0;padding:0;background-color:#c88}.dialog-icon~.dialog-content{margin-top:1em}.dialog-type{left:0;top:0;overflow:hidden;opacity:.7}.dialog-content{overflow:auto;max-height:calc(100vh - 4.5em)}.dialog-content p{white-space:pre-wrap;margin:.5em 0}.dialog-confirm .dialog-content button{margin-top:1em}.dialog-alert-info{--color: #282 }.dialog-alert-warning{--color: #c91 }.dialog-alert-error{--color: #822}@media (max-width: 42em){.dialog-icon{font-size:120%}.dialog-icon~.dialog-content{margin-top:1.5em}}.dialog-prompt label{display:block;margin:.5em .1em}.toasts{position:fixed;right:0;display:flex;flex-direction:column;margin-top:.5em;gap:.5em;z-index:1001}.toast{background:var(--faint-contrast);color:var(--text-high-contrast);transition:all .5s ease-in;position:relative;left:-.5em;overflow:hidden;display:flex;align-items:center;padding:.3em .6em;border-radius:.5em;box-shadow:0 0 .3em .3em #8883;box-sizing:border-box}.toast .toast-icon{margin-right:.3em;animation:zoomRotating 1.5s}.toast.toast-success{background-color:var(--success)}.toast.toast-warning{background-color:var(--warning)}.toast.toast-error{background-color:var(--error)}.toast.before{left:100%;transform:scale(.1);padding-top:0;padding-bottom:0}.toast.after{height:0!important;padding-top:0;padding-bottom:0;transition-duration:.2s;transform:scale(0)}@keyframes zoomRotating{0%{transform:scale(0)}to{transform:scale(1) rotate(360deg)}}code[class*=language-],pre[class*=language-]{color:#657b83;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,code[class*=language-] ::-moz-selection{background:#073642}pre[class*=language-]::selection,pre[class*=language-] ::selection,code[class*=language-]::selection,code[class*=language-] ::selection{background:#073642}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto;border-radius:.3em}:not(pre)>code[class*=language-],pre[class*=language-]{background-color:#fdf6e3}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:#93a1a1}.token.punctuation{color:#586e75}.token.namespace{opacity:.7}.token.property,.token.tag,.token.boolean,.token.number,.token.constant,.token.symbol,.token.deleted{color:#268bd2}.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.url,.token.inserted{color:#2aa198}.token.entity{color:#657b83;background:#eee8d5}.token.atrule,.token.attr-value,.token.keyword{color:#859900}.token.function,.token.class-name{color:#b58900}.token.regex,.token.important,.token.variable{color:#cb4b16}.token.important,.token.bold{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}
|