@dpuse/dpuse-tool-file-previewer 0.0.58 → 0.0.60
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/README.md +51 -51
- package/dist/dpuse-tool-file-previewer.es.js +262 -240
- package/dist/dpuse-tool-file-previewer.es.js.map +1 -1
- package/dist/types/eslint.config.d.ts +1 -1
- package/package.json +27 -16
|
@@ -5839,7 +5839,7 @@ function de(e) {
|
|
|
5839
5839
|
continue;
|
|
5840
5840
|
}
|
|
5841
5841
|
let a = e[r + 1], o = e[r + 2];
|
|
5842
|
-
if (
|
|
5842
|
+
if ((a & 192) != 128 || (o & 192) != 128 || i === 224 && a < 160 || i === 237 && a >= 160) {
|
|
5843
5843
|
_(t, n, h), r++;
|
|
5844
5844
|
continue;
|
|
5845
5845
|
}
|
|
@@ -5851,7 +5851,7 @@ function de(e) {
|
|
|
5851
5851
|
continue;
|
|
5852
5852
|
}
|
|
5853
5853
|
let a = e[r + 1], o = e[r + 2], s = e[r + 3];
|
|
5854
|
-
if (
|
|
5854
|
+
if ((a & 192) != 128 || (o & 192) != 128 || (s & 192) != 128 || i === 240 && a < 144 || i === 244 && a > 143) {
|
|
5855
5855
|
_(t, n, h), r++;
|
|
5856
5856
|
continue;
|
|
5857
5857
|
}
|
|
@@ -5941,7 +5941,7 @@ var ge = {
|
|
|
5941
5941
|
put(e, t, n) {
|
|
5942
5942
|
return v(e).setUint32(t, n, !0), t + 4;
|
|
5943
5943
|
}
|
|
5944
|
-
},
|
|
5944
|
+
}, _e = {
|
|
5945
5945
|
len: 4,
|
|
5946
5946
|
get(e, t) {
|
|
5947
5947
|
return v(e).getUint32(t);
|
|
@@ -5949,7 +5949,7 @@ var ge = {
|
|
|
5949
5949
|
put(e, t, n) {
|
|
5950
5950
|
return v(e).setUint32(t, n), t + 4;
|
|
5951
5951
|
}
|
|
5952
|
-
},
|
|
5952
|
+
}, ve = {
|
|
5953
5953
|
len: 4,
|
|
5954
5954
|
get(e, t) {
|
|
5955
5955
|
return v(e).getInt32(t);
|
|
@@ -5957,7 +5957,7 @@ var ge = {
|
|
|
5957
5957
|
put(e, t, n) {
|
|
5958
5958
|
return v(e).setInt32(t, n), t + 4;
|
|
5959
5959
|
}
|
|
5960
|
-
},
|
|
5960
|
+
}, ye = {
|
|
5961
5961
|
len: 8,
|
|
5962
5962
|
get(e, t) {
|
|
5963
5963
|
return v(e).getBigUint64(t, !0);
|
|
@@ -5965,22 +5965,22 @@ var ge = {
|
|
|
5965
5965
|
put(e, t, n) {
|
|
5966
5966
|
return v(e).setBigUint64(t, n, !0), t + 8;
|
|
5967
5967
|
}
|
|
5968
|
-
},
|
|
5968
|
+
}, S = class {
|
|
5969
5969
|
constructor(e, t) {
|
|
5970
5970
|
this.len = e, this.encoding = t;
|
|
5971
5971
|
}
|
|
5972
5972
|
get(e, t = 0) {
|
|
5973
5973
|
return le(e.subarray(t, t + this.len), this.encoding);
|
|
5974
5974
|
}
|
|
5975
|
-
},
|
|
5975
|
+
}, be = "End-Of-Stream", C = class extends Error {
|
|
5976
5976
|
constructor() {
|
|
5977
|
-
super(
|
|
5977
|
+
super(be), this.name = "EndOfStreamError";
|
|
5978
5978
|
}
|
|
5979
|
-
},
|
|
5979
|
+
}, xe = class extends Error {
|
|
5980
5980
|
constructor(e = "The operation was aborted") {
|
|
5981
5981
|
super(e), this.name = "AbortError";
|
|
5982
5982
|
}
|
|
5983
|
-
},
|
|
5983
|
+
}, Se = class {
|
|
5984
5984
|
constructor() {
|
|
5985
5985
|
this.endOfStream = !1, this.interrupted = !1, this.peekQueue = [];
|
|
5986
5986
|
}
|
|
@@ -5991,7 +5991,7 @@ var ge = {
|
|
|
5991
5991
|
async read(e, t = !1) {
|
|
5992
5992
|
if (e.length === 0) return 0;
|
|
5993
5993
|
let n = this.readFromPeekBuffer(e);
|
|
5994
|
-
if (this.endOfStream || (n += await this.readRemainderFromStream(e.subarray(n), t)), n === 0 && !t) throw new
|
|
5994
|
+
if (this.endOfStream || (n += await this.readRemainderFromStream(e.subarray(n), t)), n === 0 && !t) throw new C();
|
|
5995
5995
|
return n;
|
|
5996
5996
|
}
|
|
5997
5997
|
readFromPeekBuffer(e) {
|
|
@@ -6007,15 +6007,15 @@ var ge = {
|
|
|
6007
6007
|
async readRemainderFromStream(e, t) {
|
|
6008
6008
|
let n = 0;
|
|
6009
6009
|
for (; n < e.length && !this.endOfStream;) {
|
|
6010
|
-
if (this.interrupted) throw new
|
|
6010
|
+
if (this.interrupted) throw new xe();
|
|
6011
6011
|
let r = await this.readFromStream(e.subarray(n), t);
|
|
6012
6012
|
if (r === 0) break;
|
|
6013
6013
|
n += r;
|
|
6014
6014
|
}
|
|
6015
|
-
if (!t && n < e.length) throw new
|
|
6015
|
+
if (!t && n < e.length) throw new C();
|
|
6016
6016
|
return n;
|
|
6017
6017
|
}
|
|
6018
|
-
},
|
|
6018
|
+
}, Ce = class extends Se {
|
|
6019
6019
|
constructor(e) {
|
|
6020
6020
|
super(), this.reader = e;
|
|
6021
6021
|
}
|
|
@@ -6025,13 +6025,13 @@ var ge = {
|
|
|
6025
6025
|
async close() {
|
|
6026
6026
|
this.reader.releaseLock();
|
|
6027
6027
|
}
|
|
6028
|
-
},
|
|
6028
|
+
}, we = class extends Ce {
|
|
6029
6029
|
async readFromStream(e, t) {
|
|
6030
6030
|
if (e.length === 0) return 0;
|
|
6031
6031
|
let n = await this.reader.read(new Uint8Array(e.length), { min: t ? void 0 : e.length });
|
|
6032
6032
|
return n.done && (this.endOfStream = n.done), n.value ? (e.set(n.value), n.value.length) : 0;
|
|
6033
6033
|
}
|
|
6034
|
-
},
|
|
6034
|
+
}, Te = class extends Se {
|
|
6035
6035
|
constructor(e) {
|
|
6036
6036
|
super(), this.reader = e, this.buffer = null;
|
|
6037
6037
|
}
|
|
@@ -6050,7 +6050,7 @@ var ge = {
|
|
|
6050
6050
|
}
|
|
6051
6051
|
t.value && (n += this.writeChunk(e.subarray(n), t.value));
|
|
6052
6052
|
}
|
|
6053
|
-
if (!t && n === 0 && this.endOfStream) throw new
|
|
6053
|
+
if (!t && n === 0 && this.endOfStream) throw new C();
|
|
6054
6054
|
return n;
|
|
6055
6055
|
}
|
|
6056
6056
|
abort() {
|
|
@@ -6062,18 +6062,18 @@ var ge = {
|
|
|
6062
6062
|
};
|
|
6063
6063
|
//#endregion
|
|
6064
6064
|
//#region node_modules/strtok3/lib/stream/WebStreamReaderFactory.js
|
|
6065
|
-
function
|
|
6065
|
+
function Ee(e) {
|
|
6066
6066
|
try {
|
|
6067
6067
|
let t = e.getReader({ mode: "byob" });
|
|
6068
|
-
return t instanceof ReadableStreamDefaultReader ? new
|
|
6068
|
+
return t instanceof ReadableStreamDefaultReader ? new Te(t) : new we(t);
|
|
6069
6069
|
} catch (t) {
|
|
6070
|
-
if (t instanceof TypeError) return new
|
|
6070
|
+
if (t instanceof TypeError) return new Te(e.getReader());
|
|
6071
6071
|
throw t;
|
|
6072
6072
|
}
|
|
6073
6073
|
}
|
|
6074
6074
|
//#endregion
|
|
6075
6075
|
//#region node_modules/strtok3/lib/AbstractTokenizer.js
|
|
6076
|
-
var
|
|
6076
|
+
var w = class {
|
|
6077
6077
|
constructor(e) {
|
|
6078
6078
|
this.numBuffer = /* @__PURE__ */ new Uint8Array(8), this.position = 0, this.onClose = e?.onClose, e?.abortSignal && e.abortSignal.addEventListener("abort", () => {
|
|
6079
6079
|
this.abort();
|
|
@@ -6081,20 +6081,20 @@ var T = class {
|
|
|
6081
6081
|
}
|
|
6082
6082
|
async readToken(e, t = this.position) {
|
|
6083
6083
|
let n = new Uint8Array(e.len);
|
|
6084
|
-
if (await this.readBuffer(n, { position: t }) < e.len) throw new
|
|
6084
|
+
if (await this.readBuffer(n, { position: t }) < e.len) throw new C();
|
|
6085
6085
|
return e.get(n, 0);
|
|
6086
6086
|
}
|
|
6087
6087
|
async peekToken(e, t = this.position) {
|
|
6088
6088
|
let n = new Uint8Array(e.len);
|
|
6089
|
-
if (await this.peekBuffer(n, { position: t }) < e.len) throw new
|
|
6089
|
+
if (await this.peekBuffer(n, { position: t }) < e.len) throw new C();
|
|
6090
6090
|
return e.get(n, 0);
|
|
6091
6091
|
}
|
|
6092
6092
|
async readNumber(e) {
|
|
6093
|
-
if (await this.readBuffer(this.numBuffer, { length: e.len }) < e.len) throw new
|
|
6093
|
+
if (await this.readBuffer(this.numBuffer, { length: e.len }) < e.len) throw new C();
|
|
6094
6094
|
return e.get(this.numBuffer, 0);
|
|
6095
6095
|
}
|
|
6096
6096
|
async peekNumber(e) {
|
|
6097
|
-
if (await this.peekBuffer(this.numBuffer, { length: e.len }) < e.len) throw new
|
|
6097
|
+
if (await this.peekBuffer(this.numBuffer, { length: e.len }) < e.len) throw new C();
|
|
6098
6098
|
return e.get(this.numBuffer, 0);
|
|
6099
6099
|
}
|
|
6100
6100
|
async ignore(e) {
|
|
@@ -6121,7 +6121,7 @@ var T = class {
|
|
|
6121
6121
|
abort() {
|
|
6122
6122
|
return Promise.resolve();
|
|
6123
6123
|
}
|
|
6124
|
-
},
|
|
6124
|
+
}, De = 256e3, Oe = class extends w {
|
|
6125
6125
|
constructor(e, t) {
|
|
6126
6126
|
super(t), this.streamReader = e, this.fileInfo = t?.fileInfo ?? {};
|
|
6127
6127
|
}
|
|
@@ -6131,7 +6131,7 @@ var T = class {
|
|
|
6131
6131
|
if (r < 0) throw Error("`options.position` must be equal or greater than `tokenizer.position`");
|
|
6132
6132
|
if (n.length === 0) return 0;
|
|
6133
6133
|
let i = await this.streamReader.read(e.subarray(0, n.length), n.mayBeLess);
|
|
6134
|
-
if (this.position += i, (!t || !t.mayBeLess) && i < n.length) throw new
|
|
6134
|
+
if (this.position += i, (!t || !t.mayBeLess) && i < n.length) throw new C();
|
|
6135
6135
|
return i;
|
|
6136
6136
|
}
|
|
6137
6137
|
async peekBuffer(e, t) {
|
|
@@ -6148,16 +6148,16 @@ var T = class {
|
|
|
6148
6148
|
try {
|
|
6149
6149
|
r = await this.streamReader.peek(e.subarray(0, n.length), n.mayBeLess);
|
|
6150
6150
|
} catch (e) {
|
|
6151
|
-
if (t?.mayBeLess && e instanceof
|
|
6151
|
+
if (t?.mayBeLess && e instanceof C) return 0;
|
|
6152
6152
|
throw e;
|
|
6153
6153
|
}
|
|
6154
|
-
if (!n.mayBeLess && r < n.length) throw new
|
|
6154
|
+
if (!n.mayBeLess && r < n.length) throw new C();
|
|
6155
6155
|
}
|
|
6156
6156
|
return r;
|
|
6157
6157
|
}
|
|
6158
6158
|
async ignore(e) {
|
|
6159
6159
|
if (e < 0) throw RangeError("ignore length must be ≥ 0 bytes");
|
|
6160
|
-
let t = Math.min(
|
|
6160
|
+
let t = Math.min(De, e), n = new Uint8Array(t), r = 0;
|
|
6161
6161
|
for (; r < e;) {
|
|
6162
6162
|
let i = e - r, a = await this.readBuffer(n, { length: Math.min(t, i) });
|
|
6163
6163
|
if (a < 0) return a;
|
|
@@ -6174,7 +6174,7 @@ var T = class {
|
|
|
6174
6174
|
supportsRandomAccess() {
|
|
6175
6175
|
return !1;
|
|
6176
6176
|
}
|
|
6177
|
-
},
|
|
6177
|
+
}, ke = class extends w {
|
|
6178
6178
|
constructor(e, t) {
|
|
6179
6179
|
super(t), this.uint8Array = e, this.fileInfo = {
|
|
6180
6180
|
...t?.fileInfo ?? {},
|
|
@@ -6188,7 +6188,7 @@ var T = class {
|
|
|
6188
6188
|
}
|
|
6189
6189
|
async peekBuffer(e, t) {
|
|
6190
6190
|
let n = this.normalizeOptions(e, t), r = Math.min(this.uint8Array.length - n.position, n.length);
|
|
6191
|
-
if (!n.mayBeLess && r < n.length) throw new
|
|
6191
|
+
if (!n.mayBeLess && r < n.length) throw new C();
|
|
6192
6192
|
return e.set(this.uint8Array.subarray(n.position, n.position + r)), r;
|
|
6193
6193
|
}
|
|
6194
6194
|
close() {
|
|
@@ -6200,7 +6200,7 @@ var T = class {
|
|
|
6200
6200
|
setPosition(e) {
|
|
6201
6201
|
this.position = e;
|
|
6202
6202
|
}
|
|
6203
|
-
},
|
|
6203
|
+
}, Ae = class extends w {
|
|
6204
6204
|
constructor(e, t) {
|
|
6205
6205
|
super(t), this.blob = e, this.fileInfo = {
|
|
6206
6206
|
...t?.fileInfo ?? {},
|
|
@@ -6215,7 +6215,7 @@ var T = class {
|
|
|
6215
6215
|
}
|
|
6216
6216
|
async peekBuffer(e, t) {
|
|
6217
6217
|
let n = this.normalizeOptions(e, t), r = Math.min(this.blob.size - n.position, n.length);
|
|
6218
|
-
if (!n.mayBeLess && r < n.length) throw new
|
|
6218
|
+
if (!n.mayBeLess && r < n.length) throw new C();
|
|
6219
6219
|
let i = await this.blob.slice(n.position, n.position + r).arrayBuffer();
|
|
6220
6220
|
return e.set(new Uint8Array(i)), r;
|
|
6221
6221
|
}
|
|
@@ -6231,21 +6231,21 @@ var T = class {
|
|
|
6231
6231
|
};
|
|
6232
6232
|
//#endregion
|
|
6233
6233
|
//#region node_modules/strtok3/lib/core.js
|
|
6234
|
-
function
|
|
6235
|
-
let n =
|
|
6234
|
+
function je(e, t) {
|
|
6235
|
+
let n = Ee(e), r = t ?? {}, i = r.onClose;
|
|
6236
6236
|
return r.onClose = async () => {
|
|
6237
6237
|
if (await n.close(), i) return i();
|
|
6238
|
-
}, new
|
|
6239
|
-
}
|
|
6240
|
-
function je(e, t) {
|
|
6241
|
-
return new Oe(e, t);
|
|
6238
|
+
}, new Oe(n, r);
|
|
6242
6239
|
}
|
|
6243
6240
|
function Me(e, t) {
|
|
6244
6241
|
return new ke(e, t);
|
|
6245
6242
|
}
|
|
6243
|
+
function Ne(e, t) {
|
|
6244
|
+
return new Ae(e, t);
|
|
6245
|
+
}
|
|
6246
6246
|
//#endregion
|
|
6247
6247
|
//#region node_modules/ms/index.js
|
|
6248
|
-
var
|
|
6248
|
+
var Pe = /* @__PURE__ */ o(((e, t) => {
|
|
6249
6249
|
var n = 1e3, r = n * 60, i = r * 60, a = i * 24, o = a * 7, s = a * 365.25;
|
|
6250
6250
|
t.exports = function(e, t) {
|
|
6251
6251
|
t ||= {};
|
|
@@ -6308,9 +6308,9 @@ var Ne = /* @__PURE__ */ o(((e, t) => {
|
|
|
6308
6308
|
var i = t >= n * 1.5;
|
|
6309
6309
|
return Math.round(e / n) + " " + r + (i ? "s" : "");
|
|
6310
6310
|
}
|
|
6311
|
-
})),
|
|
6311
|
+
})), Fe = /* @__PURE__ */ o(((e, t) => {
|
|
6312
6312
|
function n(e) {
|
|
6313
|
-
n.debug = n, n.default = n, n.coerce = c, n.disable = o, n.enable = i, n.enabled = s, n.humanize =
|
|
6313
|
+
n.debug = n, n.default = n, n.coerce = c, n.disable = o, n.enable = i, n.enabled = s, n.humanize = Pe(), n.destroy = l, Object.keys(e).forEach((t) => {
|
|
6314
6314
|
n[t] = e[t];
|
|
6315
6315
|
}), n.names = [], n.skips = [], n.formatters = {};
|
|
6316
6316
|
function t(e) {
|
|
@@ -6381,7 +6381,7 @@ var Ne = /* @__PURE__ */ o(((e, t) => {
|
|
|
6381
6381
|
return n.enable(n.load()), n;
|
|
6382
6382
|
}
|
|
6383
6383
|
t.exports = n;
|
|
6384
|
-
})),
|
|
6384
|
+
})), Ie = /* @__PURE__ */ c((/* @__PURE__ */ o(((e, t) => {
|
|
6385
6385
|
e.formatArgs = r, e.save = i, e.load = a, e.useColors = n, e.storage = o(), e.destroy = (() => {
|
|
6386
6386
|
let e = !1;
|
|
6387
6387
|
return () => {
|
|
@@ -6421,7 +6421,7 @@ var Ne = /* @__PURE__ */ o(((e, t) => {
|
|
|
6421
6421
|
return localStorage;
|
|
6422
6422
|
} catch {}
|
|
6423
6423
|
}
|
|
6424
|
-
t.exports =
|
|
6424
|
+
t.exports = Fe()(e);
|
|
6425
6425
|
var { formatters: s } = t.exports;
|
|
6426
6426
|
s.j = function(e) {
|
|
6427
6427
|
try {
|
|
@@ -6430,12 +6430,12 @@ var Ne = /* @__PURE__ */ o(((e, t) => {
|
|
|
6430
6430
|
return "[UnexpectedJSONParseError]: " + e.message;
|
|
6431
6431
|
}
|
|
6432
6432
|
};
|
|
6433
|
-
})))(), 1),
|
|
6433
|
+
})))(), 1), T = {
|
|
6434
6434
|
LocalFileHeader: 67324752,
|
|
6435
6435
|
DataDescriptor: 134695760,
|
|
6436
6436
|
CentralFileHeader: 33639248,
|
|
6437
6437
|
EndOfCentralDirectory: 101010256
|
|
6438
|
-
},
|
|
6438
|
+
}, E = {
|
|
6439
6439
|
get(e) {
|
|
6440
6440
|
return {
|
|
6441
6441
|
signature: x.get(e, 0),
|
|
@@ -6444,7 +6444,7 @@ var Ne = /* @__PURE__ */ o(((e, t) => {
|
|
|
6444
6444
|
};
|
|
6445
6445
|
},
|
|
6446
6446
|
len: 16
|
|
6447
|
-
},
|
|
6447
|
+
}, Le = {
|
|
6448
6448
|
get(e) {
|
|
6449
6449
|
let t = y.get(e, 6);
|
|
6450
6450
|
return {
|
|
@@ -6460,7 +6460,7 @@ var Ne = /* @__PURE__ */ o(((e, t) => {
|
|
|
6460
6460
|
};
|
|
6461
6461
|
},
|
|
6462
6462
|
len: 30
|
|
6463
|
-
},
|
|
6463
|
+
}, Re = {
|
|
6464
6464
|
get(e) {
|
|
6465
6465
|
return {
|
|
6466
6466
|
signature: x.get(e, 0),
|
|
@@ -6474,7 +6474,7 @@ var Ne = /* @__PURE__ */ o(((e, t) => {
|
|
|
6474
6474
|
};
|
|
6475
6475
|
},
|
|
6476
6476
|
len: 22
|
|
6477
|
-
},
|
|
6477
|
+
}, ze = {
|
|
6478
6478
|
get(e) {
|
|
6479
6479
|
let t = y.get(e, 8);
|
|
6480
6480
|
return {
|
|
@@ -6495,16 +6495,16 @@ var Ne = /* @__PURE__ */ o(((e, t) => {
|
|
|
6495
6495
|
};
|
|
6496
6496
|
//#endregion
|
|
6497
6497
|
//#region node_modules/@tokenizer/inflate/lib/ZipHandler.js
|
|
6498
|
-
function
|
|
6498
|
+
function D(e) {
|
|
6499
6499
|
let t = new Uint8Array(x.len);
|
|
6500
6500
|
return x.put(t, 0, e), t;
|
|
6501
6501
|
}
|
|
6502
|
-
var
|
|
6502
|
+
var O = (0, Ie.default)("tokenizer:inflate"), k = 262144, Be = D(T.DataDescriptor), A = D(T.EndOfCentralDirectory), j = class e {
|
|
6503
6503
|
constructor(e) {
|
|
6504
|
-
this.tokenizer = e, this.syncBuffer = new Uint8Array(
|
|
6504
|
+
this.tokenizer = e, this.syncBuffer = new Uint8Array(k);
|
|
6505
6505
|
}
|
|
6506
6506
|
async isZip() {
|
|
6507
|
-
return await this.peekSignature() ===
|
|
6507
|
+
return await this.peekSignature() === T.LocalFileHeader;
|
|
6508
6508
|
}
|
|
6509
6509
|
peekSignature() {
|
|
6510
6510
|
return this.tokenizer.peekToken(x);
|
|
@@ -6512,24 +6512,24 @@ var k = (0, Fe.default)("tokenizer:inflate"), A = 262144, ze = O(E.DataDescripto
|
|
|
6512
6512
|
async findEndOfCentralDirectoryLocator() {
|
|
6513
6513
|
let e = this.tokenizer, t = Math.min(16384, e.fileInfo.size), n = this.syncBuffer.subarray(0, t);
|
|
6514
6514
|
await this.tokenizer.readBuffer(n, { position: e.fileInfo.size - t });
|
|
6515
|
-
for (let r = n.length - 4; r >= 0; r--) if (n[r] ===
|
|
6515
|
+
for (let r = n.length - 4; r >= 0; r--) if (n[r] === A[0] && n[r + 1] === A[1] && n[r + 2] === A[2] && n[r + 3] === A[3]) return e.fileInfo.size - t + r;
|
|
6516
6516
|
return -1;
|
|
6517
6517
|
}
|
|
6518
6518
|
async readCentralDirectory() {
|
|
6519
6519
|
if (!this.tokenizer.supportsRandomAccess()) {
|
|
6520
|
-
|
|
6520
|
+
O("Cannot reading central-directory without random-read support");
|
|
6521
6521
|
return;
|
|
6522
6522
|
}
|
|
6523
|
-
|
|
6523
|
+
O("Reading central-directory...");
|
|
6524
6524
|
let e = this.tokenizer.position, t = await this.findEndOfCentralDirectoryLocator();
|
|
6525
6525
|
if (t > 0) {
|
|
6526
|
-
|
|
6527
|
-
let n = await this.tokenizer.readToken(
|
|
6526
|
+
O("Central-directory 32-bit signature found");
|
|
6527
|
+
let n = await this.tokenizer.readToken(Re, t), r = [];
|
|
6528
6528
|
this.tokenizer.setPosition(n.offsetOfStartOfCd);
|
|
6529
6529
|
for (let e = 0; e < n.nrOfEntriesOfSize; ++e) {
|
|
6530
|
-
let t = await this.tokenizer.readToken(
|
|
6531
|
-
if (t.signature !==
|
|
6532
|
-
t.filename = await this.tokenizer.readToken(new
|
|
6530
|
+
let t = await this.tokenizer.readToken(ze);
|
|
6531
|
+
if (t.signature !== T.CentralFileHeader) throw Error("Expected Central-File-Header signature");
|
|
6532
|
+
t.filename = await this.tokenizer.readToken(new S(t.filenameLength, "utf-8")), await this.tokenizer.ignore(t.extraFieldLength), await this.tokenizer.ignore(t.fileCommentLength), r.push(t), O(`Add central-directory file-entry: n=${e + 1}/${r.length}: filename=${r[e].filename}`);
|
|
6533
6533
|
}
|
|
6534
6534
|
return this.tokenizer.setPosition(e), r;
|
|
6535
6535
|
}
|
|
@@ -6546,20 +6546,20 @@ var k = (0, Fe.default)("tokenizer:inflate"), A = 262144, ze = O(E.DataDescripto
|
|
|
6546
6546
|
n = !!r.stop;
|
|
6547
6547
|
let i;
|
|
6548
6548
|
if (await this.tokenizer.ignore(t.extraFieldLength), t.dataDescriptor && t.compressedSize === 0) {
|
|
6549
|
-
let e = [], n =
|
|
6550
|
-
|
|
6549
|
+
let e = [], n = k;
|
|
6550
|
+
O("Compressed-file-size unknown, scanning for next data-descriptor-signature....");
|
|
6551
6551
|
let i = -1;
|
|
6552
|
-
for (; i < 0 && n ===
|
|
6553
|
-
n = await this.tokenizer.peekBuffer(this.syncBuffer, { mayBeLess: !0 }), i =
|
|
6552
|
+
for (; i < 0 && n === k;) {
|
|
6553
|
+
n = await this.tokenizer.peekBuffer(this.syncBuffer, { mayBeLess: !0 }), i = Ve(this.syncBuffer.subarray(0, n), Be);
|
|
6554
6554
|
let t = i >= 0 ? i : n;
|
|
6555
6555
|
if (r.handler) {
|
|
6556
6556
|
let n = new Uint8Array(t);
|
|
6557
6557
|
await this.tokenizer.readBuffer(n), e.push(n);
|
|
6558
6558
|
} else await this.tokenizer.ignore(t);
|
|
6559
6559
|
}
|
|
6560
|
-
|
|
6561
|
-
} else r.handler ? (
|
|
6562
|
-
if (
|
|
6560
|
+
O(`Found data-descriptor-signature at pos=${this.tokenizer.position}`), r.handler && await this.inflate(t, He(e), r.handler);
|
|
6561
|
+
} else r.handler ? (O(`Reading compressed-file-data: ${t.compressedSize} bytes`), i = new Uint8Array(t.compressedSize), await this.tokenizer.readBuffer(i), await this.inflate(t, i, r.handler)) : (O(`Ignoring compressed-file-data: ${t.compressedSize} bytes`), await this.tokenizer.ignore(t.compressedSize));
|
|
6562
|
+
if (O(`Reading data-descriptor at pos=${this.tokenizer.position}`), t.dataDescriptor && (await this.tokenizer.readToken(E)).signature !== 134695760) throw Error(`Expected data-descriptor-signature at position ${this.tokenizer.position - E.len}`);
|
|
6563
6563
|
} while (!n);
|
|
6564
6564
|
}
|
|
6565
6565
|
async iterateOverCentralDirectory(e, t) {
|
|
@@ -6580,7 +6580,7 @@ var k = (0, Fe.default)("tokenizer:inflate"), A = 262144, ze = O(E.DataDescripto
|
|
|
6580
6580
|
async inflate(t, n, r) {
|
|
6581
6581
|
if (t.compressedMethod === 0) return r(n);
|
|
6582
6582
|
if (t.compressedMethod !== 8) throw Error(`Unsupported ZIP compression method: ${t.compressedMethod}`);
|
|
6583
|
-
return
|
|
6583
|
+
return O(`Decompress filename=${t.filename}, compressed-size=${n.length}`), r(await e.decompressDeflateRaw(n));
|
|
6584
6584
|
}
|
|
6585
6585
|
static async decompressDeflateRaw(e) {
|
|
6586
6586
|
let t = new ReadableStream({ start(t) {
|
|
@@ -6596,15 +6596,15 @@ var k = (0, Fe.default)("tokenizer:inflate"), A = 262144, ze = O(E.DataDescripto
|
|
|
6596
6596
|
}
|
|
6597
6597
|
async readLocalFileHeader() {
|
|
6598
6598
|
let e = await this.tokenizer.peekToken(x);
|
|
6599
|
-
if (e ===
|
|
6600
|
-
let e = await this.tokenizer.readToken(
|
|
6601
|
-
return e.filename = await this.tokenizer.readToken(new
|
|
6599
|
+
if (e === T.LocalFileHeader) {
|
|
6600
|
+
let e = await this.tokenizer.readToken(Le);
|
|
6601
|
+
return e.filename = await this.tokenizer.readToken(new S(e.filenameLength, "utf-8")), e;
|
|
6602
6602
|
}
|
|
6603
|
-
if (e ===
|
|
6603
|
+
if (e === T.CentralFileHeader) return !1;
|
|
6604
6604
|
throw Error(e === 3759263696 ? "Encrypted ZIP" : "Unexpected signature");
|
|
6605
6605
|
}
|
|
6606
6606
|
};
|
|
6607
|
-
function
|
|
6607
|
+
function Ve(e, t) {
|
|
6608
6608
|
let n = e.length, r = t.length;
|
|
6609
6609
|
if (r > n) return -1;
|
|
6610
6610
|
for (let i = 0; i <= n - r; i++) {
|
|
@@ -6617,14 +6617,14 @@ function Be(e, t) {
|
|
|
6617
6617
|
}
|
|
6618
6618
|
return -1;
|
|
6619
6619
|
}
|
|
6620
|
-
function
|
|
6620
|
+
function He(e) {
|
|
6621
6621
|
let t = e.reduce((e, t) => e + t.length, 0), n = new Uint8Array(t), r = 0;
|
|
6622
6622
|
for (let t of e) n.set(t, r), r += t.length;
|
|
6623
6623
|
return n;
|
|
6624
6624
|
}
|
|
6625
6625
|
//#endregion
|
|
6626
6626
|
//#region node_modules/@tokenizer/inflate/lib/GzipHandler.js
|
|
6627
|
-
var
|
|
6627
|
+
var Ue = class {
|
|
6628
6628
|
constructor(e) {
|
|
6629
6629
|
this.tokenizer = e;
|
|
6630
6630
|
}
|
|
@@ -6639,25 +6639,25 @@ var He = class {
|
|
|
6639
6639
|
t.enqueue(n.subarray(0, r));
|
|
6640
6640
|
} }).pipeThrough(new DecompressionStream("gzip"));
|
|
6641
6641
|
}
|
|
6642
|
-
},
|
|
6643
|
-
function
|
|
6644
|
-
return e ? e.constructor === t ||
|
|
6645
|
-
}
|
|
6646
|
-
function Ke(e) {
|
|
6647
|
-
return Ge(e, Uint8Array, We);
|
|
6642
|
+
}, We = Object.prototype.toString, Ge = "[object Uint8Array]";
|
|
6643
|
+
function Ke(e, t, n) {
|
|
6644
|
+
return e ? e.constructor === t || We.call(e) === n : !1;
|
|
6648
6645
|
}
|
|
6649
6646
|
function qe(e) {
|
|
6650
|
-
|
|
6647
|
+
return Ke(e, Uint8Array, Ge);
|
|
6648
|
+
}
|
|
6649
|
+
function Je(e) {
|
|
6650
|
+
if (!qe(e)) throw TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``);
|
|
6651
6651
|
}
|
|
6652
|
-
function
|
|
6652
|
+
function Ye(e, t) {
|
|
6653
6653
|
if (e.length === 0) return /* @__PURE__ */ new Uint8Array();
|
|
6654
6654
|
t ??= e.reduce((e, t) => e + t.length, 0);
|
|
6655
6655
|
let n = new Uint8Array(t), r = 0;
|
|
6656
|
-
for (let t of e)
|
|
6656
|
+
for (let t of e) Je(t), n.set(t, r), r += t.length;
|
|
6657
6657
|
return n;
|
|
6658
6658
|
}
|
|
6659
6659
|
new globalThis.TextDecoder("utf8"), new globalThis.TextEncoder(), Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
|
|
6660
|
-
function
|
|
6660
|
+
function M(e) {
|
|
6661
6661
|
let { byteLength: t } = e;
|
|
6662
6662
|
if (t === 6) return e.getUint16(0) * 2 ** 32 + e.getUint32(2);
|
|
6663
6663
|
if (t === 5) return e.getUint8(0) * 2 ** 32 + e.getUint32(1);
|
|
@@ -6668,7 +6668,7 @@ function Ye(e) {
|
|
|
6668
6668
|
}
|
|
6669
6669
|
//#endregion
|
|
6670
6670
|
//#region node_modules/file-type/source/tokens.js
|
|
6671
|
-
function
|
|
6671
|
+
function N(e, t) {
|
|
6672
6672
|
if (t === "utf-16le") {
|
|
6673
6673
|
let t = [];
|
|
6674
6674
|
for (let n = 0; n < e.length; n++) {
|
|
@@ -6687,34 +6687,34 @@ function Xe(e, t) {
|
|
|
6687
6687
|
}
|
|
6688
6688
|
return [...e].map((e) => e.charCodeAt(0));
|
|
6689
6689
|
}
|
|
6690
|
-
function
|
|
6691
|
-
let n = Number.parseInt(new
|
|
6690
|
+
function Xe(e, t = 0) {
|
|
6691
|
+
let n = Number.parseInt(new S(6).get(e, 148).replace(/\0.*$/v, "").trim(), 8);
|
|
6692
6692
|
if (Number.isNaN(n)) return !1;
|
|
6693
6693
|
let r = 256;
|
|
6694
6694
|
for (let n = t; n < t + 148; n++) r += e[n];
|
|
6695
6695
|
for (let n = t + 156; n < t + 512; n++) r += e[n];
|
|
6696
6696
|
return n === r;
|
|
6697
6697
|
}
|
|
6698
|
-
var
|
|
6698
|
+
var Ze = {
|
|
6699
6699
|
get: (e, t) => e[t + 3] & 127 | (e[t + 2] & 127) << 7 | (e[t + 1] & 127) << 14 | (e[t] & 127) << 21,
|
|
6700
6700
|
len: 4
|
|
6701
|
-
},
|
|
6702
|
-
function
|
|
6703
|
-
if (!Number.isFinite(e) || e < 0 || e > t) throw new
|
|
6701
|
+
}, Qe = /* @__PURE__ */ "jpg,png,apng,gif,webp,flif,xcf,cr2,cr3,orf,arw,dng,nef,rw2,raf,tif,bmp,icns,jxr,psd,indd,zip,tar,rar,gz,bz2,7z,dmg,mp4,mid,mkv,webm,mov,avi,mpg,mp2,mp3,m4a,oga,ogg,ogv,opus,flac,wav,spx,amr,pdf,epub,elf,macho,exe,swf,rtf,wasm,woff,woff2,eot,ttf,otf,ttc,ico,flv,ps,xz,sqlite,nes,crx,xpi,cab,deb,ar,rpm,Z,lz,cfb,mxf,mts,blend,bpg,docx,pptx,xlsx,3gp,3g2,j2c,jp2,jpm,jpx,mj2,aif,qcp,odt,ods,odp,xml,mobi,heic,cur,ktx,ape,wv,dcm,ics,glb,pcap,dsf,lnk,alias,voc,ac3,m4v,m4p,m4b,f4v,f4p,f4b,f4a,mie,asf,ogm,ogx,mpc,arrow,shp,aac,mp1,it,s3m,xm,skp,avif,eps,lzh,pgp,asar,stl,chm,3mf,zst,jxl,vcf,jls,pst,dwg,parquet,class,arj,cpio,ace,avro,icc,fbx,vsdx,vtt,apk,drc,lz4,potx,xltx,dotx,xltm,ott,ots,otp,odg,otg,xlsm,docm,dotm,potm,pptm,jar,jmp,rm,sav,ppsm,ppsx,tar.gz,reg,dat,key,numbers,pages,iso".split(","), $e = /* @__PURE__ */ "image/jpeg,image/png,image/gif,image/webp,image/flif,image/x-xcf,image/x-canon-cr2,image/x-canon-cr3,image/tiff,image/bmp,image/vnd.ms-photo,image/vnd.adobe.photoshop,application/x-indesign,application/epub+zip,application/x-xpinstall,application/vnd.ms-powerpoint.slideshow.macroenabled.12,application/vnd.oasis.opendocument.text,application/vnd.oasis.opendocument.spreadsheet,application/vnd.oasis.opendocument.presentation,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.presentationml.slideshow,application/zip,application/x-tar,application/x-rar-compressed,application/gzip,application/x-bzip2,application/x-7z-compressed,application/x-apple-diskimage,application/vnd.apache.arrow.file,video/mp4,audio/midi,video/matroska,video/webm,video/quicktime,video/vnd.avi,audio/wav,audio/qcelp,audio/x-ms-asf,video/x-ms-asf,application/vnd.ms-asf,video/mpeg,video/3gpp,audio/mpeg,audio/mp4,video/ogg,audio/ogg,audio/ogg; codecs=opus,application/ogg,audio/flac,audio/ape,audio/wavpack,audio/amr,application/pdf,application/x-elf,application/x-mach-binary,application/x-msdownload,application/x-shockwave-flash,application/rtf,application/wasm,font/woff,font/woff2,application/vnd.ms-fontobject,font/ttf,font/otf,font/collection,image/x-icon,video/x-flv,application/postscript,application/eps,application/x-xz,application/x-sqlite3,application/x-nintendo-nes-rom,application/x-google-chrome-extension,application/vnd.ms-cab-compressed,application/x-deb,application/x-unix-archive,application/x-rpm,application/x-compress,application/lzip,application/x-cfb,application/x-mie,application/mxf,video/mp2t,application/x-blender,image/bpg,image/j2c,image/jp2,image/jpx,image/jpm,image/mj2,audio/aiff,application/xml,application/x-mobipocket-ebook,image/heif,image/heif-sequence,image/heic,image/heic-sequence,image/icns,image/ktx,application/dicom,audio/x-musepack,text/calendar,text/vcard,text/vtt,model/gltf-binary,application/vnd.tcpdump.pcap,audio/x-dsf,application/x-ms-shortcut,application/x-ft-apple.alias,audio/x-voc,audio/vnd.dolby.dd-raw,audio/x-m4a,image/apng,image/x-olympus-orf,image/x-sony-arw,image/x-adobe-dng,image/x-nikon-nef,image/x-panasonic-rw2,image/x-fujifilm-raf,video/x-m4v,video/3gpp2,application/x-esri-shape,audio/aac,audio/x-it,audio/x-s3m,audio/x-xm,video/MP1S,video/MP2P,application/vnd.sketchup.skp,image/avif,application/x-lzh-compressed,application/pgp-encrypted,application/x-asar,model/stl,application/vnd.ms-htmlhelp,model/3mf,image/jxl,application/zstd,image/jls,application/vnd.ms-outlook,image/vnd.dwg,application/vnd.apache.parquet,application/java-vm,application/x-arj,application/x-cpio,application/x-ace-compressed,application/avro,application/vnd.iccprofile,application/x-ft-fbx,application/vnd.visio,application/vnd.android.package-archive,application/x-ft-draco,application/x-lz4,application/vnd.openxmlformats-officedocument.presentationml.template,application/vnd.openxmlformats-officedocument.spreadsheetml.template,application/vnd.openxmlformats-officedocument.wordprocessingml.template,application/vnd.ms-excel.template.macroenabled.12,application/vnd.oasis.opendocument.text-template,application/vnd.oasis.opendocument.spreadsheet-template,application/vnd.oasis.opendocument.presentation-template,application/vnd.oasis.opendocument.graphics,application/vnd.oasis.opendocument.graphics-template,application/vnd.ms-excel.sheet.macroenabled.12,application/vnd.ms-word.document.macroenabled.12,application/vnd.ms-word.template.macroenabled.12,application/vnd.ms-powerpoint.template.macroenabled.12,application/vnd.ms-powerpoint.presentation.macroenabled.12,application/java-archive,application/vnd.rn-realmedia,application/x-spss-sav,application/x-ms-regedit,application/x-ft-windows-registry-hive,application/x-jmp-data,application/vnd.apple.keynote,application/vnd.apple.numbers,application/vnd.apple.pages,application/x-iso9660-image".split(","), P = 16777216, F = class extends Error {};
|
|
6702
|
+
function I(e, t, n) {
|
|
6703
|
+
if (!Number.isFinite(e) || e < 0 || e > t) throw new F(`${n} has invalid size ${e} (maximum ${t} bytes)`);
|
|
6704
6704
|
return e;
|
|
6705
6705
|
}
|
|
6706
|
-
async function
|
|
6707
|
-
let i =
|
|
6706
|
+
async function L(e, t, { maximumLength: n = P, reason: r = "skip" } = {}) {
|
|
6707
|
+
let i = I(t, n, r);
|
|
6708
6708
|
await e.ignore(i);
|
|
6709
6709
|
}
|
|
6710
|
-
async function
|
|
6711
|
-
let a =
|
|
6710
|
+
async function R(e, t, n, { maximumLength: r = t.length, reason: i = "read" } = {}) {
|
|
6711
|
+
let a = I(n?.length ?? t.length, r, i);
|
|
6712
6712
|
return e.readBuffer(t, {
|
|
6713
6713
|
...n,
|
|
6714
6714
|
length: a
|
|
6715
6715
|
});
|
|
6716
6716
|
}
|
|
6717
|
-
function
|
|
6717
|
+
function z(e, t, n) {
|
|
6718
6718
|
n = {
|
|
6719
6719
|
offset: 0,
|
|
6720
6720
|
...n
|
|
@@ -6724,31 +6724,31 @@ function R(e, t, n) {
|
|
|
6724
6724
|
} else if (i !== e[r + n.offset]) return !1;
|
|
6725
6725
|
return !0;
|
|
6726
6726
|
}
|
|
6727
|
-
function
|
|
6727
|
+
function B(e) {
|
|
6728
6728
|
let t = e.fileInfo.size;
|
|
6729
6729
|
return !Number.isFinite(t) || t === 2 ** 53 - 1;
|
|
6730
6730
|
}
|
|
6731
|
-
function
|
|
6732
|
-
return
|
|
6731
|
+
function V(e, t, n) {
|
|
6732
|
+
return B(e) && e.position - t > n;
|
|
6733
6733
|
}
|
|
6734
6734
|
//#endregion
|
|
6735
6735
|
//#region node_modules/file-type/source/detectors/zip.js
|
|
6736
|
-
var
|
|
6736
|
+
var H = 1048576, U = 1024, et = 2 ** 31 - 1, W = H, tt = /* @__PURE__ */ new Set([
|
|
6737
6737
|
"Unexpected signature",
|
|
6738
6738
|
"Encrypted ZIP",
|
|
6739
6739
|
"Expected Central-File-Header signature"
|
|
6740
|
-
]),
|
|
6740
|
+
]), nt = [
|
|
6741
6741
|
"ZIP entry count exceeds ",
|
|
6742
6742
|
"Unsupported ZIP compression method:",
|
|
6743
6743
|
"ZIP entry compressed data exceeds ",
|
|
6744
6744
|
"ZIP entry decompressed data exceeds ",
|
|
6745
6745
|
"Expected data-descriptor-signature at position "
|
|
6746
|
-
],
|
|
6746
|
+
], rt = /* @__PURE__ */ new Set([
|
|
6747
6747
|
"Z_BUF_ERROR",
|
|
6748
6748
|
"Z_DATA_ERROR",
|
|
6749
6749
|
"ERR_INVALID_STATE"
|
|
6750
6750
|
]);
|
|
6751
|
-
async function
|
|
6751
|
+
async function it(e, { maximumLength: t = H } = {}) {
|
|
6752
6752
|
let n = new ReadableStream({ start(t) {
|
|
6753
6753
|
t.enqueue(e), t.close();
|
|
6754
6754
|
} }).pipeThrough(new DecompressionStream("deflate-raw")).getReader(), r = [], i = 0;
|
|
@@ -6756,9 +6756,11 @@ async function at(e, { maximumLength: t = V } = {}) {
|
|
|
6756
6756
|
for (;;) {
|
|
6757
6757
|
let { done: e, value: a } = await n.read();
|
|
6758
6758
|
if (e) break;
|
|
6759
|
-
if (i += a.length, i > t) throw await n.cancel(), Error(`ZIP entry decompressed data exceeds ${t} bytes`);
|
|
6759
|
+
if (i += a.length, i > t) throw await n.cancel().catch(() => {}), Error(`ZIP entry decompressed data exceeds ${t} bytes`);
|
|
6760
6760
|
r.push(a);
|
|
6761
6761
|
}
|
|
6762
|
+
} catch (e) {
|
|
6763
|
+
if (e.code !== "ERR_TRAILING_JUNK_AFTER_STREAM_END") throw e;
|
|
6762
6764
|
} finally {
|
|
6763
6765
|
n.releaseLock();
|
|
6764
6766
|
}
|
|
@@ -6766,28 +6768,28 @@ async function at(e, { maximumLength: t = V } = {}) {
|
|
|
6766
6768
|
for (let e of r) a.set(e, o), o += e.length;
|
|
6767
6769
|
return a;
|
|
6768
6770
|
}
|
|
6769
|
-
function
|
|
6771
|
+
function at(e, t) {
|
|
6770
6772
|
let n = new Uint8Array(t), r = 0;
|
|
6771
6773
|
for (let t of e) n.set(t, r), r += t.length;
|
|
6772
6774
|
return n;
|
|
6773
6775
|
}
|
|
6774
|
-
function
|
|
6776
|
+
function ot(e) {
|
|
6775
6777
|
let t = e.fileInfo.size, n = Number.isFinite(t) ? Math.max(0, t - e.position) : 2 ** 53 - 1;
|
|
6776
|
-
return Math.min(n,
|
|
6778
|
+
return Math.min(n, et);
|
|
6777
6779
|
}
|
|
6778
|
-
function
|
|
6779
|
-
if (e instanceof
|
|
6780
|
+
function st(e) {
|
|
6781
|
+
if (e instanceof C || e instanceof F) return !0;
|
|
6780
6782
|
if (!(e instanceof Error)) return !1;
|
|
6781
|
-
if (
|
|
6782
|
-
for (let t of
|
|
6783
|
+
if (tt.has(e.message) || rt.has(e.code)) return !0;
|
|
6784
|
+
for (let t of nt) if (e.message.startsWith(t)) return !0;
|
|
6783
6785
|
return !1;
|
|
6784
6786
|
}
|
|
6785
|
-
function
|
|
6787
|
+
function G(e, t = H) {
|
|
6786
6788
|
let n = [e.compressedSize, e.uncompressedSize];
|
|
6787
6789
|
for (let e of n) if (!Number.isFinite(e) || e < 0 || e > t) return !1;
|
|
6788
6790
|
return !0;
|
|
6789
6791
|
}
|
|
6790
|
-
function
|
|
6792
|
+
function ct() {
|
|
6791
6793
|
return {
|
|
6792
6794
|
hasDocumentEntry: !1,
|
|
6793
6795
|
hasMasterSlideEntry: !1,
|
|
@@ -6795,10 +6797,10 @@ function lt() {
|
|
|
6795
6797
|
hasCalculationEngineEntry: !1
|
|
6796
6798
|
};
|
|
6797
6799
|
}
|
|
6798
|
-
function
|
|
6800
|
+
function lt(e, t) {
|
|
6799
6801
|
t === "Index/Document.iwa" && (e.hasDocumentEntry = !0), t.startsWith("Index/MasterSlide") && (e.hasMasterSlideEntry = !0), t.startsWith("Index/Tables/") && (e.hasTablesEntry = !0), t === "Index/CalculationEngine.iwa" && (e.hasCalculationEngineEntry = !0);
|
|
6800
6802
|
}
|
|
6801
|
-
function
|
|
6803
|
+
function K(e) {
|
|
6802
6804
|
if (e.hasDocumentEntry) return e.hasMasterSlideEntry ? {
|
|
6803
6805
|
ext: "key",
|
|
6804
6806
|
mime: "application/vnd.apple.keynote"
|
|
@@ -6810,7 +6812,7 @@ function G(e) {
|
|
|
6810
6812
|
mime: "application/vnd.apple.pages"
|
|
6811
6813
|
};
|
|
6812
6814
|
}
|
|
6813
|
-
function
|
|
6815
|
+
function q(e) {
|
|
6814
6816
|
switch (e = e.toLowerCase(), e) {
|
|
6815
6817
|
case "application/epub+zip": return {
|
|
6816
6818
|
ext: "epub",
|
|
@@ -6914,7 +6916,7 @@ function K(e) {
|
|
|
6914
6916
|
};
|
|
6915
6917
|
}
|
|
6916
6918
|
}
|
|
6917
|
-
function
|
|
6919
|
+
function ut() {
|
|
6918
6920
|
return {
|
|
6919
6921
|
hasContentTypesEntry: !1,
|
|
6920
6922
|
hasParsedContentTypesEntry: !1,
|
|
@@ -6926,10 +6928,10 @@ function dt() {
|
|
|
6926
6928
|
hasThreeDimensionalModelEntry: !1
|
|
6927
6929
|
};
|
|
6928
6930
|
}
|
|
6929
|
-
function
|
|
6931
|
+
function dt(e, t) {
|
|
6930
6932
|
t.startsWith("word/") && (e.hasWordDirectory = !0), t.startsWith("ppt/") && (e.hasPresentationDirectory = !0), t.startsWith("xl/") && (e.hasSpreadsheetDirectory = !0), t.startsWith("3D/") && t.endsWith(".model") && (e.hasThreeDimensionalModelEntry = !0);
|
|
6931
6933
|
}
|
|
6932
|
-
function
|
|
6934
|
+
function J(e) {
|
|
6933
6935
|
if (e.hasWordDirectory) return {
|
|
6934
6936
|
ext: "docx",
|
|
6935
6937
|
mime: "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
|
@@ -6947,10 +6949,10 @@ function q(e) {
|
|
|
6947
6949
|
mime: "model/3mf"
|
|
6948
6950
|
};
|
|
6949
6951
|
}
|
|
6950
|
-
function
|
|
6951
|
-
if (!(!e.hasContentTypesEntry || e.hasUnparseableContentTypes || e.isParsingContentTypes || e.hasParsedContentTypesEntry)) return
|
|
6952
|
+
function Y(e) {
|
|
6953
|
+
if (!(!e.hasContentTypesEntry || e.hasUnparseableContentTypes || e.isParsingContentTypes || e.hasParsedContentTypesEntry)) return J(e);
|
|
6952
6954
|
}
|
|
6953
|
-
function
|
|
6955
|
+
function ft(e) {
|
|
6954
6956
|
let t = e.indexOf(".main+xml\"");
|
|
6955
6957
|
if (t === -1) {
|
|
6956
6958
|
let t = "application/vnd.ms-package.3dmanufacturing-3dmodel+xml";
|
|
@@ -6959,78 +6961,78 @@ function pt(e) {
|
|
|
6959
6961
|
let n = e.slice(0, t), r = n.lastIndexOf("\"");
|
|
6960
6962
|
return n.slice(r + 1);
|
|
6961
6963
|
}
|
|
6962
|
-
var
|
|
6964
|
+
var pt = 134695760, X = 16, mt = 15;
|
|
6963
6965
|
function ht(e, t) {
|
|
6964
6966
|
if (e.length < X) return -1;
|
|
6965
6967
|
let n = e.length - X;
|
|
6966
|
-
for (let r = 0; r <= n; r++) if (x.get(e, r) ===
|
|
6968
|
+
for (let r = 0; r <= n; r++) if (x.get(e, r) === pt && x.get(e, r + 8) === t + r) return r;
|
|
6967
6969
|
return -1;
|
|
6968
6970
|
}
|
|
6969
|
-
async function gt(e, { shouldBuffer: t, maximumLength: n =
|
|
6971
|
+
async function gt(e, { shouldBuffer: t, maximumLength: n = H } = {}) {
|
|
6970
6972
|
let { syncBuffer: r } = e, { length: i } = r, a = [], o = 0;
|
|
6971
6973
|
for (;;) {
|
|
6972
6974
|
let s = await e.tokenizer.peekBuffer(r, { mayBeLess: !0 }), c = ht(r.subarray(0, s), o), l = c >= 0 ? 0 : s === i ? Math.min(mt, s - 1) : 0, u = c >= 0 ? c : s - l;
|
|
6973
6975
|
if (u === 0) break;
|
|
6974
|
-
if (o += u, o > n) throw
|
|
6976
|
+
if (o += u, o > n) throw new F(`ZIP entry data descriptor not found within ${n} bytes`);
|
|
6975
6977
|
if (t) {
|
|
6976
6978
|
let t = new Uint8Array(u);
|
|
6977
6979
|
await e.tokenizer.readBuffer(t), a.push(t);
|
|
6978
6980
|
} else await e.tokenizer.ignore(u);
|
|
6979
6981
|
if (c >= 0) break;
|
|
6980
6982
|
}
|
|
6981
|
-
if (
|
|
6983
|
+
if (B(e.tokenizer) || (e.knownSizeDescriptorScannedBytes += o), t) return at(a, o);
|
|
6982
6984
|
}
|
|
6983
6985
|
function _t(e, t) {
|
|
6984
|
-
return
|
|
6986
|
+
return B(e.tokenizer) ? Math.max(0, P - (e.tokenizer.position - t)) : Math.max(0, H - e.knownSizeDescriptorScannedBytes);
|
|
6985
6987
|
}
|
|
6986
|
-
async function vt(e, t, { shouldBuffer: n, maximumDescriptorLength: r =
|
|
6988
|
+
async function vt(e, t, { shouldBuffer: n, maximumDescriptorLength: r = H } = {}) {
|
|
6987
6989
|
if (t.dataDescriptor && t.compressedSize === 0) return gt(e, {
|
|
6988
6990
|
shouldBuffer: n,
|
|
6989
6991
|
maximumLength: r
|
|
6990
6992
|
});
|
|
6991
6993
|
if (!n) {
|
|
6992
|
-
await
|
|
6993
|
-
maximumLength:
|
|
6994
|
+
await L(e.tokenizer, t.compressedSize, {
|
|
6995
|
+
maximumLength: B(e.tokenizer) ? H : e.tokenizer.fileInfo.size,
|
|
6994
6996
|
reason: "ZIP entry compressed data"
|
|
6995
6997
|
});
|
|
6996
6998
|
return;
|
|
6997
6999
|
}
|
|
6998
|
-
let i =
|
|
7000
|
+
let i = ot(e.tokenizer);
|
|
6999
7001
|
if (!Number.isFinite(t.compressedSize) || t.compressedSize < 0 || t.compressedSize > i) throw Error(`ZIP entry compressed data exceeds ${i} bytes`);
|
|
7000
7002
|
let a = new Uint8Array(t.compressedSize);
|
|
7001
7003
|
return await e.tokenizer.readBuffer(a), a;
|
|
7002
7004
|
}
|
|
7003
|
-
|
|
7005
|
+
j.prototype.inflate = async function(e, t, n) {
|
|
7004
7006
|
if (e.compressedMethod === 0) return n(t);
|
|
7005
7007
|
if (e.compressedMethod !== 8) throw Error(`Unsupported ZIP compression method: ${e.compressedMethod}`);
|
|
7006
|
-
return n(await
|
|
7007
|
-
},
|
|
7008
|
+
return n(await it(t, { maximumLength: H }));
|
|
7009
|
+
}, j.prototype.unzip = async function(e) {
|
|
7008
7010
|
let t = !1, n = 0, r = this.tokenizer.position;
|
|
7009
7011
|
this.knownSizeDescriptorScannedBytes = 0;
|
|
7010
7012
|
do {
|
|
7011
|
-
if (
|
|
7013
|
+
if (V(this.tokenizer, r, 16777216)) throw new F(`ZIP stream probing exceeds ${P} bytes`);
|
|
7012
7014
|
let i = await this.readLocalFileHeader();
|
|
7013
7015
|
if (!i) break;
|
|
7014
|
-
if (n++, n >
|
|
7016
|
+
if (n++, n > U) throw Error(`ZIP entry count exceeds ${U}`);
|
|
7015
7017
|
let a = e(i);
|
|
7016
7018
|
t = !!a.stop, await this.tokenizer.ignore(i.extraFieldLength);
|
|
7017
7019
|
let o = await vt(this, i, {
|
|
7018
7020
|
shouldBuffer: !!a.handler,
|
|
7019
|
-
maximumDescriptorLength: Math.min(
|
|
7021
|
+
maximumDescriptorLength: Math.min(H, _t(this, r))
|
|
7020
7022
|
});
|
|
7021
7023
|
if (a.handler && await this.inflate(i, o, a.handler), i.dataDescriptor) {
|
|
7022
7024
|
let e = new Uint8Array(X);
|
|
7023
|
-
if (await this.tokenizer.readBuffer(e), x.get(e, 0) !==
|
|
7025
|
+
if (await this.tokenizer.readBuffer(e), x.get(e, 0) !== pt) throw Error(`Expected data-descriptor-signature at position ${this.tokenizer.position - e.length}`);
|
|
7024
7026
|
}
|
|
7025
|
-
if (
|
|
7027
|
+
if (V(this.tokenizer, r, 16777216)) throw new F(`ZIP stream probing exceeds ${P} bytes`);
|
|
7026
7028
|
} while (!t);
|
|
7027
7029
|
};
|
|
7028
7030
|
async function yt(e) {
|
|
7029
|
-
let t, n =
|
|
7031
|
+
let t, n = ut(), r = ct();
|
|
7030
7032
|
try {
|
|
7031
|
-
await new
|
|
7032
|
-
if (
|
|
7033
|
-
let i = e.filename === "[Content_Types].xml", a =
|
|
7033
|
+
await new j(e).unzip((e) => {
|
|
7034
|
+
if (dt(n, e.filename), lt(r, e.filename), r.hasDocumentEntry && (r.hasMasterSlideEntry || r.hasTablesEntry)) return t = K(r), { stop: !0 };
|
|
7035
|
+
let i = e.filename === "[Content_Types].xml", a = Y(n);
|
|
7034
7036
|
if (!i && a) return t = a, { stop: !0 };
|
|
7035
7037
|
switch (e.filename) {
|
|
7036
7038
|
case "META-INF/mozilla.rsa": return t = {
|
|
@@ -7041,16 +7043,16 @@ async function yt(e) {
|
|
|
7041
7043
|
ext: "jar",
|
|
7042
7044
|
mime: "application/java-archive"
|
|
7043
7045
|
}, { stop: !0 };
|
|
7044
|
-
case "mimetype": return
|
|
7046
|
+
case "mimetype": return G(e, W) ? {
|
|
7045
7047
|
async handler(e) {
|
|
7046
|
-
t =
|
|
7048
|
+
t = q(new TextDecoder("utf-8").decode(e).trim());
|
|
7047
7049
|
},
|
|
7048
7050
|
stop: !0
|
|
7049
7051
|
} : {};
|
|
7050
|
-
case "[Content_Types].xml": return n.hasContentTypesEntry = !0,
|
|
7052
|
+
case "[Content_Types].xml": return n.hasContentTypesEntry = !0, G(e, W) ? (n.isParsingContentTypes = !0, {
|
|
7051
7053
|
async handler(e) {
|
|
7052
|
-
let r =
|
|
7053
|
-
r && (t =
|
|
7054
|
+
let r = ft(new TextDecoder("utf-8").decode(e));
|
|
7055
|
+
r && (t = q(r)), n.hasParsedContentTypesEntry = !0, n.isParsingContentTypes = !1;
|
|
7054
7056
|
},
|
|
7055
7057
|
stop: !0
|
|
7056
7058
|
}) : (n.hasUnparseableContentTypes = !0, {});
|
|
@@ -7061,11 +7063,11 @@ async function yt(e) {
|
|
|
7061
7063
|
}
|
|
7062
7064
|
});
|
|
7063
7065
|
} catch (e) {
|
|
7064
|
-
if (!
|
|
7065
|
-
n.isParsingContentTypes && (n.isParsingContentTypes = !1, n.hasUnparseableContentTypes = !0), !t && e instanceof
|
|
7066
|
+
if (!st(e)) throw e;
|
|
7067
|
+
n.isParsingContentTypes && (n.isParsingContentTypes = !1, n.hasUnparseableContentTypes = !0), !t && (e instanceof C || e instanceof F) && !n.hasContentTypesEntry && (t = J(n));
|
|
7066
7068
|
}
|
|
7067
|
-
let i =
|
|
7068
|
-
return t ??
|
|
7069
|
+
let i = B(e) && r.hasDocumentEntry && !r.hasMasterSlideEntry && !r.hasTablesEntry && !r.hasCalculationEngineEntry ? void 0 : K(r);
|
|
7070
|
+
return t ?? Y(n) ?? i ?? {
|
|
7069
7071
|
ext: "zip",
|
|
7070
7072
|
mime: "application/zip"
|
|
7071
7073
|
};
|
|
@@ -7078,7 +7080,7 @@ async function Ct(e) {
|
|
|
7078
7080
|
let t = await e.peekNumber(ge), n = 128, r = 0;
|
|
7079
7081
|
for (; (t & n) === 0 && n !== 0;) ++r, n >>= 1;
|
|
7080
7082
|
let i = new Uint8Array(r + 1);
|
|
7081
|
-
return await
|
|
7083
|
+
return await R(e, i, void 0, {
|
|
7082
7084
|
maximumLength: i.length,
|
|
7083
7085
|
reason: "EBML field"
|
|
7084
7086
|
}), i;
|
|
@@ -7088,22 +7090,22 @@ async function Ct(e) {
|
|
|
7088
7090
|
n[0] ^= 128 >> n.length - 1;
|
|
7089
7091
|
let r = Math.min(6, n.length), i = new DataView(e.buffer), a = new DataView(n.buffer, n.length - r, r);
|
|
7090
7092
|
return {
|
|
7091
|
-
id:
|
|
7092
|
-
len:
|
|
7093
|
+
id: M(i),
|
|
7094
|
+
len: M(a)
|
|
7093
7095
|
};
|
|
7094
7096
|
}
|
|
7095
7097
|
async function r(t) {
|
|
7096
7098
|
let r = 0;
|
|
7097
7099
|
for (; t > 0;) {
|
|
7098
|
-
if (r++, r > St ||
|
|
7100
|
+
if (r++, r > St || V(e, a, 16777216)) return;
|
|
7099
7101
|
let i = e.position, o = await n();
|
|
7100
7102
|
if (o.id === 17026) {
|
|
7101
7103
|
if (o.len > bt) return;
|
|
7102
|
-
let t =
|
|
7103
|
-
return (await e.readToken(new
|
|
7104
|
+
let t = I(o.len, bt, "EBML DocType");
|
|
7105
|
+
return (await e.readToken(new S(t))).replaceAll(/\0.*$/gv, "");
|
|
7104
7106
|
}
|
|
7105
|
-
if (
|
|
7106
|
-
maximumLength:
|
|
7107
|
+
if (B(e) && (!Number.isFinite(o.len) || o.len < 0 || o.len > xt) || (await L(e, o.len, {
|
|
7108
|
+
maximumLength: B(e) ? xt : e.fileInfo.size,
|
|
7107
7109
|
reason: "EBML payload"
|
|
7108
7110
|
}), --t, e.position <= i)) return;
|
|
7109
7111
|
}
|
|
@@ -7137,13 +7139,13 @@ async function Ot(e) {
|
|
|
7137
7139
|
await e.ignore(8);
|
|
7138
7140
|
async function r() {
|
|
7139
7141
|
return {
|
|
7140
|
-
length: await e.readToken(
|
|
7141
|
-
type: await e.readToken(new
|
|
7142
|
+
length: await e.readToken(ve),
|
|
7143
|
+
type: await e.readToken(new S(4, "latin1"))
|
|
7142
7144
|
};
|
|
7143
7145
|
}
|
|
7144
|
-
let i =
|
|
7146
|
+
let i = B(e), a = e.position, o = 0, s = !1;
|
|
7145
7147
|
do {
|
|
7146
|
-
if (o++, o > wt ||
|
|
7148
|
+
if (o++, o > wt || V(e, a, Tt)) break;
|
|
7147
7149
|
let c = e.position, l = await r();
|
|
7148
7150
|
if (l.length < 0) return;
|
|
7149
7151
|
if (l.type === "IHDR") {
|
|
@@ -7157,12 +7159,12 @@ async function Ot(e) {
|
|
|
7157
7159
|
if (!s && l.type !== "CgBI") return;
|
|
7158
7160
|
if (i && l.length > Et) return s && Dt(l.type) ? t : void 0;
|
|
7159
7161
|
try {
|
|
7160
|
-
await
|
|
7162
|
+
await L(e, l.length + 4, {
|
|
7161
7163
|
maximumLength: i ? 1048580 : e.fileInfo.size,
|
|
7162
7164
|
reason: "PNG chunk payload"
|
|
7163
7165
|
});
|
|
7164
7166
|
} catch (e) {
|
|
7165
|
-
if (!i && (e instanceof
|
|
7167
|
+
if (!i && (e instanceof F || e instanceof C)) return t;
|
|
7166
7168
|
throw e;
|
|
7167
7169
|
}
|
|
7168
7170
|
}
|
|
@@ -7172,32 +7174,32 @@ async function Ot(e) {
|
|
|
7172
7174
|
}
|
|
7173
7175
|
//#endregion
|
|
7174
7176
|
//#region node_modules/file-type/source/detectors/asf.js
|
|
7175
|
-
var kt = 512,
|
|
7176
|
-
async function
|
|
7177
|
+
var kt = 512, Z = 1048576;
|
|
7178
|
+
async function At(e) {
|
|
7177
7179
|
let t = !1;
|
|
7178
7180
|
try {
|
|
7179
7181
|
async function n() {
|
|
7180
7182
|
let t = /* @__PURE__ */ new Uint8Array(16);
|
|
7181
|
-
return await
|
|
7183
|
+
return await R(e, t, void 0, {
|
|
7182
7184
|
maximumLength: t.length,
|
|
7183
7185
|
reason: "ASF header GUID"
|
|
7184
7186
|
}), {
|
|
7185
7187
|
id: t,
|
|
7186
|
-
size: Number(await e.readToken(
|
|
7188
|
+
size: Number(await e.readToken(ye))
|
|
7187
7189
|
};
|
|
7188
7190
|
}
|
|
7189
|
-
await
|
|
7191
|
+
await L(e, 30, {
|
|
7190
7192
|
maximumLength: 30,
|
|
7191
7193
|
reason: "ASF header prelude"
|
|
7192
7194
|
});
|
|
7193
|
-
let r =
|
|
7194
|
-
for (; e.position + 24 < e.fileInfo.size && (a++, !(a > kt ||
|
|
7195
|
+
let r = B(e), i = e.position, a = 0;
|
|
7196
|
+
for (; e.position + 24 < e.fileInfo.size && (a++, !(a > kt || V(e, i, 16777216)));) {
|
|
7195
7197
|
let i = e.position, a = await n(), o = a.size - 24;
|
|
7196
7198
|
if (!Number.isFinite(o) || o < 0) {
|
|
7197
7199
|
t = !0;
|
|
7198
7200
|
break;
|
|
7199
7201
|
}
|
|
7200
|
-
if (
|
|
7202
|
+
if (z(a.id, [
|
|
7201
7203
|
145,
|
|
7202
7204
|
7,
|
|
7203
7205
|
220,
|
|
@@ -7216,10 +7218,10 @@ async function jt(e) {
|
|
|
7216
7218
|
101
|
|
7217
7219
|
])) {
|
|
7218
7220
|
let t = /* @__PURE__ */ new Uint8Array(16);
|
|
7219
|
-
if (o -= await
|
|
7221
|
+
if (o -= await R(e, t, void 0, {
|
|
7220
7222
|
maximumLength: t.length,
|
|
7221
7223
|
reason: "ASF stream type GUID"
|
|
7222
|
-
}),
|
|
7224
|
+
}), z(t, [
|
|
7223
7225
|
64,
|
|
7224
7226
|
158,
|
|
7225
7227
|
105,
|
|
@@ -7240,7 +7242,7 @@ async function jt(e) {
|
|
|
7240
7242
|
ext: "asf",
|
|
7241
7243
|
mime: "audio/x-ms-asf"
|
|
7242
7244
|
};
|
|
7243
|
-
if (
|
|
7245
|
+
if (z(t, [
|
|
7244
7246
|
192,
|
|
7245
7247
|
239,
|
|
7246
7248
|
25,
|
|
@@ -7263,12 +7265,12 @@ async function jt(e) {
|
|
|
7263
7265
|
};
|
|
7264
7266
|
break;
|
|
7265
7267
|
}
|
|
7266
|
-
if (r && o >
|
|
7268
|
+
if (r && o > Z) {
|
|
7267
7269
|
t = !0;
|
|
7268
7270
|
break;
|
|
7269
7271
|
}
|
|
7270
|
-
if (await
|
|
7271
|
-
maximumLength: r ?
|
|
7272
|
+
if (await L(e, o, {
|
|
7273
|
+
maximumLength: r ? Z : e.fileInfo.size,
|
|
7272
7274
|
reason: "ASF header payload"
|
|
7273
7275
|
}), e.position <= i) {
|
|
7274
7276
|
t = !0;
|
|
@@ -7276,7 +7278,7 @@ async function jt(e) {
|
|
|
7276
7278
|
}
|
|
7277
7279
|
}
|
|
7278
7280
|
} catch (n) {
|
|
7279
|
-
if (n instanceof
|
|
7281
|
+
if (n instanceof C || n instanceof F) B(e) && (t = !0);
|
|
7280
7282
|
else throw n;
|
|
7281
7283
|
}
|
|
7282
7284
|
if (!t) return {
|
|
@@ -7286,18 +7288,22 @@ async function jt(e) {
|
|
|
7286
7288
|
}
|
|
7287
7289
|
//#endregion
|
|
7288
7290
|
//#region node_modules/file-type/source/index.js
|
|
7289
|
-
var
|
|
7291
|
+
var Q = 4100, jt = 4096, Mt = P, Nt = 1, Pt = 100, $ = P, Ft = 512, It = 256, Lt = 1048576, Rt = P;
|
|
7290
7292
|
function zt(e) {
|
|
7291
|
-
return Number.isFinite(e) ? Math.max(1, Math.trunc(e)) :
|
|
7293
|
+
return Number.isFinite(e) ? Math.max(1, Math.trunc(e)) : Q;
|
|
7292
7294
|
}
|
|
7293
7295
|
function Bt(e) {
|
|
7294
|
-
return Number.isFinite(e) ? Math.max(0, Math.min(
|
|
7296
|
+
return Number.isFinite(e) ? Math.max(0, Math.min(jt, Math.trunc(e))) : 0;
|
|
7295
7297
|
}
|
|
7296
7298
|
function Vt(e) {
|
|
7297
7299
|
return Number.isFinite(e) ? Math.max(0, e) : 2 ** 53 - 1;
|
|
7298
7300
|
}
|
|
7299
7301
|
function Ht(e) {
|
|
7300
|
-
return import(
|
|
7302
|
+
return import(
|
|
7303
|
+
/* @vite-ignore */
|
|
7304
|
+
/* webpackIgnore: true */
|
|
7305
|
+
e
|
|
7306
|
+
);
|
|
7301
7307
|
}
|
|
7302
7308
|
function Ut(e) {
|
|
7303
7309
|
return e.pipeThrough(new TransformStream());
|
|
@@ -7361,7 +7367,7 @@ var qt = class e {
|
|
|
7361
7367
|
return { ...this.tokenizerOptions };
|
|
7362
7368
|
}
|
|
7363
7369
|
createTokenizerFromWebStream(e) {
|
|
7364
|
-
return
|
|
7370
|
+
return je(Ut(e), this.getTokenizerOptions());
|
|
7365
7371
|
}
|
|
7366
7372
|
async parseTokenizer(e, t = 0) {
|
|
7367
7373
|
this.detectionReentryCount = t;
|
|
@@ -7371,7 +7377,7 @@ var qt = class e {
|
|
|
7371
7377
|
try {
|
|
7372
7378
|
r = await t.detect(e);
|
|
7373
7379
|
} catch (e) {
|
|
7374
|
-
if (e instanceof
|
|
7380
|
+
if (e instanceof C || e instanceof F) return;
|
|
7375
7381
|
throw e;
|
|
7376
7382
|
}
|
|
7377
7383
|
if (r) return r;
|
|
@@ -7388,11 +7394,11 @@ var qt = class e {
|
|
|
7388
7394
|
async fromBuffer(e) {
|
|
7389
7395
|
if (!(e instanceof Uint8Array || e instanceof ArrayBuffer)) throw TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);
|
|
7390
7396
|
let t = e instanceof Uint8Array ? e : new Uint8Array(e);
|
|
7391
|
-
if (t?.length > 1) return this.fromTokenizer(
|
|
7397
|
+
if (t?.length > 1) return this.fromTokenizer(Me(t, this.getTokenizerOptions()));
|
|
7392
7398
|
}
|
|
7393
7399
|
async fromBlob(e) {
|
|
7394
7400
|
this.options.signal?.throwIfAborted();
|
|
7395
|
-
let t =
|
|
7401
|
+
let t = Ne(e, this.getTokenizerOptions());
|
|
7396
7402
|
return this.fromTokenizer(t);
|
|
7397
7403
|
}
|
|
7398
7404
|
async fromStream(e) {
|
|
@@ -7436,11 +7442,11 @@ var qt = class e {
|
|
|
7436
7442
|
a.releaseLock();
|
|
7437
7443
|
}
|
|
7438
7444
|
if (s > 0) {
|
|
7439
|
-
let e = o.length === 1 ? o[0] :
|
|
7445
|
+
let e = o.length === 1 ? o[0] : Ye(o);
|
|
7440
7446
|
try {
|
|
7441
7447
|
r = await this.fromBuffer(e.subarray(0, n));
|
|
7442
7448
|
} catch (e) {
|
|
7443
|
-
if (!(e instanceof
|
|
7449
|
+
if (!(e instanceof C)) throw e;
|
|
7444
7450
|
r = void 0;
|
|
7445
7451
|
}
|
|
7446
7452
|
!i && r?.ext === "pages" && (r = {
|
|
@@ -7459,16 +7465,16 @@ var qt = class e {
|
|
|
7459
7465
|
return l.fileType = r, l;
|
|
7460
7466
|
}
|
|
7461
7467
|
async detectGzip(t) {
|
|
7462
|
-
if (this.gzipProbeDepth >=
|
|
7468
|
+
if (this.gzipProbeDepth >= Nt) return {
|
|
7463
7469
|
ext: "gz",
|
|
7464
7470
|
mime: "application/gzip"
|
|
7465
7471
|
};
|
|
7466
|
-
let n = Gt(new
|
|
7472
|
+
let n = Gt(new Ue(t).inflate(), Mt), r = B(t), i, a, o, s;
|
|
7467
7473
|
if (r) {
|
|
7468
7474
|
let t = new AbortController();
|
|
7469
7475
|
i = setTimeout(() => {
|
|
7470
|
-
t.abort(new DOMException(`Operation timed out after ${
|
|
7471
|
-
},
|
|
7476
|
+
t.abort(new DOMException(`Operation timed out after ${Pt} ms`, "TimeoutError"));
|
|
7477
|
+
}, Pt), a = this.options.signal === void 0 ? t.signal : AbortSignal.any([this.options.signal, t.signal]), o = new e({
|
|
7472
7478
|
...this.options,
|
|
7473
7479
|
signal: a
|
|
7474
7480
|
}), o.gzipProbeDepth = this.gzipProbeDepth + 1;
|
|
@@ -7489,13 +7495,13 @@ var qt = class e {
|
|
|
7489
7495
|
};
|
|
7490
7496
|
}
|
|
7491
7497
|
check(e, t) {
|
|
7492
|
-
return
|
|
7498
|
+
return z(this.buffer, e, t);
|
|
7493
7499
|
}
|
|
7494
7500
|
checkString(e, t) {
|
|
7495
|
-
return this.check(
|
|
7501
|
+
return this.check(N(e, t?.encoding), t);
|
|
7496
7502
|
}
|
|
7497
7503
|
detectConfident = async (e) => {
|
|
7498
|
-
if (this.buffer = new Uint8Array(
|
|
7504
|
+
if (this.buffer = new Uint8Array(Q), e.fileInfo.size === void 0 && (e.fileInfo.size = 2 ** 53 - 1), this.tokenizer = e, B(e) && (await e.peekBuffer(this.buffer, {
|
|
7499
7505
|
length: 3,
|
|
7500
7506
|
mayBeLess: !0
|
|
7501
7507
|
}), this.check([
|
|
@@ -7548,7 +7554,7 @@ var qt = class e {
|
|
|
7548
7554
|
239,
|
|
7549
7555
|
187,
|
|
7550
7556
|
191
|
|
7551
|
-
])) return this.detectionReentryCount >=
|
|
7557
|
+
])) return this.detectionReentryCount >= It ? void 0 : (this.detectionReentryCount++, await this.tokenizer.ignore(3), this.detectConfident(e));
|
|
7552
7558
|
if (this.check([
|
|
7553
7559
|
71,
|
|
7554
7560
|
73,
|
|
@@ -7579,26 +7585,26 @@ var qt = class e {
|
|
|
7579
7585
|
mime: "application/x-bzip2"
|
|
7580
7586
|
};
|
|
7581
7587
|
if (this.checkString("ID3")) {
|
|
7582
|
-
await
|
|
7588
|
+
await L(e, 6, {
|
|
7583
7589
|
maximumLength: 6,
|
|
7584
7590
|
reason: "ID3 header prefix"
|
|
7585
7591
|
});
|
|
7586
|
-
let t = await e.readToken(
|
|
7587
|
-
if (!Number.isFinite(t) || t < 0 || n && (t >
|
|
7592
|
+
let t = await e.readToken(Ze), n = B(e);
|
|
7593
|
+
if (!Number.isFinite(t) || t < 0 || n && (t > $ || e.position + t > $)) return;
|
|
7588
7594
|
if (e.position + t > e.fileInfo.size) return n ? void 0 : {
|
|
7589
7595
|
ext: "mp3",
|
|
7590
7596
|
mime: "audio/mpeg"
|
|
7591
7597
|
};
|
|
7592
7598
|
try {
|
|
7593
|
-
await
|
|
7594
|
-
maximumLength: n ?
|
|
7599
|
+
await L(e, t, {
|
|
7600
|
+
maximumLength: n ? $ : e.fileInfo.size,
|
|
7595
7601
|
reason: "ID3 payload"
|
|
7596
7602
|
});
|
|
7597
7603
|
} catch (e) {
|
|
7598
|
-
if (e instanceof
|
|
7604
|
+
if (e instanceof C) return;
|
|
7599
7605
|
throw e;
|
|
7600
7606
|
}
|
|
7601
|
-
return this.detectionReentryCount >=
|
|
7607
|
+
return this.detectionReentryCount >= It ? void 0 : (this.detectionReentryCount++, this.parseTokenizer(e, this.detectionReentryCount));
|
|
7602
7608
|
}
|
|
7603
7609
|
if (this.checkString("MP+")) return {
|
|
7604
7610
|
ext: "mpc",
|
|
@@ -7657,7 +7663,7 @@ var qt = class e {
|
|
|
7657
7663
|
if (this.checkString("OggS")) {
|
|
7658
7664
|
await e.ignore(28);
|
|
7659
7665
|
let t = /* @__PURE__ */ new Uint8Array(8);
|
|
7660
|
-
return await e.readBuffer(t),
|
|
7666
|
+
return await e.readBuffer(t), z(t, [
|
|
7661
7667
|
79,
|
|
7662
7668
|
112,
|
|
7663
7669
|
117,
|
|
@@ -7669,7 +7675,7 @@ var qt = class e {
|
|
|
7669
7675
|
]) ? {
|
|
7670
7676
|
ext: "opus",
|
|
7671
7677
|
mime: "audio/ogg; codecs=opus"
|
|
7672
|
-
} :
|
|
7678
|
+
} : z(t, [
|
|
7673
7679
|
128,
|
|
7674
7680
|
116,
|
|
7675
7681
|
104,
|
|
@@ -7680,7 +7686,7 @@ var qt = class e {
|
|
|
7680
7686
|
]) ? {
|
|
7681
7687
|
ext: "ogv",
|
|
7682
7688
|
mime: "video/ogg"
|
|
7683
|
-
} :
|
|
7689
|
+
} : z(t, [
|
|
7684
7690
|
1,
|
|
7685
7691
|
118,
|
|
7686
7692
|
105,
|
|
@@ -7691,7 +7697,7 @@ var qt = class e {
|
|
|
7691
7697
|
]) ? {
|
|
7692
7698
|
ext: "ogm",
|
|
7693
7699
|
mime: "video/ogg"
|
|
7694
|
-
} :
|
|
7700
|
+
} : z(t, [
|
|
7695
7701
|
127,
|
|
7696
7702
|
70,
|
|
7697
7703
|
76,
|
|
@@ -7700,7 +7706,7 @@ var qt = class e {
|
|
|
7700
7706
|
]) ? {
|
|
7701
7707
|
ext: "oga",
|
|
7702
7708
|
mime: "audio/ogg"
|
|
7703
|
-
} :
|
|
7709
|
+
} : z(t, [
|
|
7704
7710
|
83,
|
|
7705
7711
|
112,
|
|
7706
7712
|
101,
|
|
@@ -7711,7 +7717,7 @@ var qt = class e {
|
|
|
7711
7717
|
]) ? {
|
|
7712
7718
|
ext: "spx",
|
|
7713
7719
|
mime: "audio/ogg"
|
|
7714
|
-
} :
|
|
7720
|
+
} : z(t, [
|
|
7715
7721
|
1,
|
|
7716
7722
|
118,
|
|
7717
7723
|
111,
|
|
@@ -8004,7 +8010,7 @@ var qt = class e {
|
|
|
8004
8010
|
186,
|
|
8005
8011
|
190
|
|
8006
8012
|
])) {
|
|
8007
|
-
let e =
|
|
8013
|
+
let e = _e.get(this.buffer, 4), t = b.get(this.buffer, 6);
|
|
8008
8014
|
if (e > 0 && e <= 30) return {
|
|
8009
8015
|
ext: "macho",
|
|
8010
8016
|
mime: "application/x-mach-binary"
|
|
@@ -8064,7 +8070,7 @@ var qt = class e {
|
|
|
8064
8070
|
mime: "model/stl"
|
|
8065
8071
|
};
|
|
8066
8072
|
if (this.checkString("AC")) {
|
|
8067
|
-
let e = new
|
|
8073
|
+
let e = new S(4, "latin1").get(this.buffer, 2);
|
|
8068
8074
|
if (/^\d+$/v.test(e) && e >= 1e3 && e <= 1050) return {
|
|
8069
8075
|
ext: "dwg",
|
|
8070
8076
|
mime: "image/vnd.dwg"
|
|
@@ -8078,7 +8084,7 @@ var qt = class e {
|
|
|
8078
8084
|
ext: "blend",
|
|
8079
8085
|
mime: "application/x-blender"
|
|
8080
8086
|
};
|
|
8081
|
-
if (this.checkString("!<arch>")) return await e.ignore(8), await e.readToken(new
|
|
8087
|
+
if (this.checkString("!<arch>")) return await e.ignore(8), await e.readToken(new S(13, "ascii")) === "debian-binary" ? {
|
|
8082
8088
|
ext: "deb",
|
|
8083
8089
|
mime: "application/x-deb"
|
|
8084
8090
|
} : {
|
|
@@ -8174,7 +8180,7 @@ var qt = class e {
|
|
|
8174
8180
|
mime: "image/x-xcf"
|
|
8175
8181
|
};
|
|
8176
8182
|
if (this.checkString("ftyp", { offset: 4 }) && this.buffer[8] & 96) {
|
|
8177
|
-
let e = new
|
|
8183
|
+
let e = new S(4, "latin1").get(this.buffer, 8).replace("\0", " ").trim();
|
|
8178
8184
|
switch (e) {
|
|
8179
8185
|
case "avif":
|
|
8180
8186
|
case "avis": return {
|
|
@@ -8322,7 +8328,7 @@ var qt = class e {
|
|
|
8322
8328
|
17,
|
|
8323
8329
|
166,
|
|
8324
8330
|
217
|
|
8325
|
-
])) return
|
|
8331
|
+
])) return At(e);
|
|
8326
8332
|
if (this.check([
|
|
8327
8333
|
171,
|
|
8328
8334
|
75,
|
|
@@ -8396,7 +8402,7 @@ var qt = class e {
|
|
|
8396
8402
|
10,
|
|
8397
8403
|
135,
|
|
8398
8404
|
10
|
|
8399
|
-
])) switch (await e.ignore(20), await e.readToken(new
|
|
8405
|
+
])) switch (await e.ignore(20), await e.readToken(new S(4, "ascii"))) {
|
|
8400
8406
|
case "jp2 ": return {
|
|
8401
8407
|
ext: "jp2",
|
|
8402
8408
|
mime: "image/jp2"
|
|
@@ -8689,7 +8695,7 @@ var qt = class e {
|
|
|
8689
8695
|
0,
|
|
8690
8696
|
0,
|
|
8691
8697
|
0
|
|
8692
|
-
], { offset: 257 }) &&
|
|
8698
|
+
], { offset: 257 }) && Xe(this.buffer)) return {
|
|
8693
8699
|
ext: "tar",
|
|
8694
8700
|
mime: "application/x-tar"
|
|
8695
8701
|
};
|
|
@@ -8719,9 +8725,20 @@ var qt = class e {
|
|
|
8719
8725
|
ext: "pgp",
|
|
8720
8726
|
mime: "application/pgp-encrypted"
|
|
8721
8727
|
};
|
|
8728
|
+
if (e.supportsRandomAccess() && e.fileInfo.size >= 32774) {
|
|
8729
|
+
let t = /* @__PURE__ */ new Uint8Array(5);
|
|
8730
|
+
if (await e.peekBuffer(t, {
|
|
8731
|
+
position: 32769,
|
|
8732
|
+
length: 5,
|
|
8733
|
+
mayBeLess: !0
|
|
8734
|
+
}), z(t, N("CD001"))) return {
|
|
8735
|
+
ext: "iso",
|
|
8736
|
+
mime: "application/x-iso9660-image"
|
|
8737
|
+
};
|
|
8738
|
+
}
|
|
8722
8739
|
};
|
|
8723
8740
|
detectImprecise = async (e) => {
|
|
8724
|
-
this.buffer = new Uint8Array(
|
|
8741
|
+
this.buffer = new Uint8Array(Q);
|
|
8725
8742
|
let t = Vt(e.fileInfo.size);
|
|
8726
8743
|
if (await e.peekBuffer(this.buffer, {
|
|
8727
8744
|
length: Math.min(8, t),
|
|
@@ -8769,9 +8786,9 @@ var qt = class e {
|
|
|
8769
8786
|
mime: "image/x-icon"
|
|
8770
8787
|
};
|
|
8771
8788
|
if (await e.peekBuffer(this.buffer, {
|
|
8772
|
-
length: Math.min(
|
|
8789
|
+
length: Math.min(4 + this.options.mpegOffsetTolerance, t),
|
|
8773
8790
|
mayBeLess: !0
|
|
8774
|
-
}), this.buffer.length >=
|
|
8791
|
+
}), this.buffer.length >= 4 + this.options.mpegOffsetTolerance) for (let e = 0; e <= this.options.mpegOffsetTolerance; ++e) {
|
|
8775
8792
|
let t = this.scanMpeg(e);
|
|
8776
8793
|
if (t) return t;
|
|
8777
8794
|
}
|
|
@@ -8791,7 +8808,7 @@ var qt = class e {
|
|
|
8791
8808
|
}
|
|
8792
8809
|
async readTiffIFD(e) {
|
|
8793
8810
|
let t = await this.tokenizer.readToken(e ? b : y);
|
|
8794
|
-
if (!(t >
|
|
8811
|
+
if (!(t > Ft) && !(B(this.tokenizer) && 2 + t * 12 > Rt)) for (let n = 0; n < t; ++n) {
|
|
8795
8812
|
let t = await this.readTiffTag(e);
|
|
8796
8813
|
if (t) return t;
|
|
8797
8814
|
}
|
|
@@ -8800,7 +8817,7 @@ var qt = class e {
|
|
|
8800
8817
|
let t = {
|
|
8801
8818
|
ext: "tif",
|
|
8802
8819
|
mime: "image/tiff"
|
|
8803
|
-
}, n = (e ? b : y).get(this.buffer, 2), r = (e ?
|
|
8820
|
+
}, n = (e ? b : y).get(this.buffer, 2), r = (e ? _e : x).get(this.buffer, 4);
|
|
8804
8821
|
if (n === 42) {
|
|
8805
8822
|
if (r >= 6) {
|
|
8806
8823
|
if (this.checkString("CR", { offset: 8 })) return {
|
|
@@ -8815,22 +8832,22 @@ var qt = class e {
|
|
|
8815
8832
|
};
|
|
8816
8833
|
}
|
|
8817
8834
|
}
|
|
8818
|
-
if (
|
|
8819
|
-
let n =
|
|
8835
|
+
if (B(this.tokenizer) && r > Lt) return t;
|
|
8836
|
+
let n = B(this.tokenizer) ? Rt : this.tokenizer.fileInfo.size;
|
|
8820
8837
|
try {
|
|
8821
|
-
await
|
|
8838
|
+
await L(this.tokenizer, r, {
|
|
8822
8839
|
maximumLength: n,
|
|
8823
8840
|
reason: "TIFF IFD offset"
|
|
8824
8841
|
});
|
|
8825
8842
|
} catch (e) {
|
|
8826
|
-
if (e instanceof
|
|
8843
|
+
if (e instanceof C) return;
|
|
8827
8844
|
throw e;
|
|
8828
8845
|
}
|
|
8829
8846
|
let i;
|
|
8830
8847
|
try {
|
|
8831
8848
|
i = await this.readTiffIFD(e);
|
|
8832
8849
|
} catch (e) {
|
|
8833
|
-
if (e instanceof
|
|
8850
|
+
if (e instanceof C) return;
|
|
8834
8851
|
throw e;
|
|
8835
8852
|
}
|
|
8836
8853
|
return i ?? t;
|
|
@@ -8845,13 +8862,20 @@ var qt = class e {
|
|
|
8845
8862
|
if (this.check([16], {
|
|
8846
8863
|
offset: e + 1,
|
|
8847
8864
|
mask: [22]
|
|
8848
|
-
})) return
|
|
8849
|
-
offset: e + 1,
|
|
8850
|
-
mask: [8]
|
|
8851
|
-
}), {
|
|
8865
|
+
})) return {
|
|
8852
8866
|
ext: "aac",
|
|
8853
8867
|
mime: "audio/aac"
|
|
8854
8868
|
};
|
|
8869
|
+
if (this.check([255, 254], { offset: e }) || this.check([8], {
|
|
8870
|
+
offset: e + 1,
|
|
8871
|
+
mask: [24]
|
|
8872
|
+
}) || this.check([240], {
|
|
8873
|
+
offset: e + 2,
|
|
8874
|
+
mask: [240]
|
|
8875
|
+
}) || this.check([12], {
|
|
8876
|
+
offset: e + 2,
|
|
8877
|
+
mask: [12]
|
|
8878
|
+
})) return;
|
|
8855
8879
|
if (this.check([2], {
|
|
8856
8880
|
offset: e + 1,
|
|
8857
8881
|
mask: [6]
|
|
@@ -8876,7 +8900,7 @@ var qt = class e {
|
|
|
8876
8900
|
}
|
|
8877
8901
|
}
|
|
8878
8902
|
};
|
|
8879
|
-
new Set(
|
|
8903
|
+
new Set(Qe), new Set($e);
|
|
8880
8904
|
//#endregion
|
|
8881
8905
|
//#region node_modules/@dpuse/dpuse-shared/dist/dpuse-shared-errors.es.js
|
|
8882
8906
|
var Jt = 2048, Yt = class extends Error {
|
|
@@ -9536,5 +9560,3 @@ function ln(e) {
|
|
|
9536
9560
|
}
|
|
9537
9561
|
//#endregion
|
|
9538
9562
|
export { rn as Tool };
|
|
9539
|
-
|
|
9540
|
-
//# sourceMappingURL=dpuse-tool-file-previewer.es.js.map
|