@nextcloud/files 3.0.0-beta.24 → 3.0.0-beta.25
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/files/node.d.ts +4 -0
- package/dist/index.cjs +11 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +177 -172
- package/dist/index.mjs.map +1 -1
- package/dist/vendor.LICENSE.txt +1 -1
- package/package.json +9 -8
package/dist/index.mjs
CHANGED
|
@@ -2,11 +2,12 @@ import { getCurrentUser as T, getRequestToken as at } from "@nextcloud/auth";
|
|
|
2
2
|
import { getLoggerBuilder as M } from "@nextcloud/logger";
|
|
3
3
|
import { getCanonicalLocale as lt } from "@nextcloud/l10n";
|
|
4
4
|
import { join as dt, basename as ut, extname as ct, dirname as A } from "path";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import { encodePath as ht } from "@nextcloud/paths";
|
|
6
|
+
import { generateRemoteUrl as pt } from "@nextcloud/router";
|
|
7
|
+
import { createClient as ft, getPatcher as gt } from "webdav";
|
|
8
|
+
import { request as mt } from "webdav/dist/node/request.js";
|
|
9
|
+
const wt = (t) => t === null ? M().setApp("files").build() : M().setApp("files").setUid(t.uid).build(), m = wt(T());
|
|
10
|
+
class vt {
|
|
10
11
|
_entries = [];
|
|
11
12
|
registerEntry(e) {
|
|
12
13
|
this.validateEntry(e), this._entries.push(e);
|
|
@@ -45,17 +46,17 @@ class wt {
|
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
const F = function() {
|
|
48
|
-
return typeof window._nc_newfilemenu > "u" && (window._nc_newfilemenu = new
|
|
49
|
-
},
|
|
50
|
-
function
|
|
49
|
+
return typeof window._nc_newfilemenu > "u" && (window._nc_newfilemenu = new vt(), m.debug("NewFileMenu initialized")), window._nc_newfilemenu;
|
|
50
|
+
}, P = ["B", "KB", "MB", "GB", "TB", "PB"], O = ["B", "KiB", "MiB", "GiB", "TiB", "PiB"];
|
|
51
|
+
function Ze(t, e = !1, i = !0) {
|
|
51
52
|
typeof t == "string" && (t = Number(t));
|
|
52
53
|
let r = t > 0 ? Math.floor(Math.log(t) / Math.log(i ? 1024 : 1e3)) : 0;
|
|
53
|
-
r = Math.min((i ?
|
|
54
|
-
const n = i ?
|
|
54
|
+
r = Math.min((i ? O.length : P.length) - 1, r);
|
|
55
|
+
const n = i ? O[r] : P[r];
|
|
55
56
|
let s = (t / Math.pow(i ? 1024 : 1e3, r)).toFixed(1);
|
|
56
|
-
return e === !0 && r === 0 ? (s !== "0.0" ? "< 1 " : "0 ") + (i ?
|
|
57
|
+
return e === !0 && r === 0 ? (s !== "0.0" ? "< 1 " : "0 ") + (i ? O[1] : P[1]) : (r < 2 ? s = parseFloat(s).toFixed(0) : s = parseFloat(s).toLocaleString(lt()), s + " " + n);
|
|
57
58
|
}
|
|
58
|
-
function
|
|
59
|
+
function Je(t, e = !1) {
|
|
59
60
|
try {
|
|
60
61
|
t = `${t}`.toLocaleLowerCase().replaceAll(/\s+/g, "").replaceAll(",", ".");
|
|
61
62
|
} catch {
|
|
@@ -68,7 +69,7 @@ function Ye(t, e = !1) {
|
|
|
68
69
|
return Math.round(Number.parseFloat(n) * s ** r[i[3]]);
|
|
69
70
|
}
|
|
70
71
|
var K = ((t) => (t.DEFAULT = "default", t.HIDDEN = "hidden", t))(K || {});
|
|
71
|
-
class
|
|
72
|
+
class Qe {
|
|
72
73
|
_action;
|
|
73
74
|
constructor(e) {
|
|
74
75
|
this.validateAction(e), this._action = e;
|
|
@@ -131,16 +132,16 @@ class Ze {
|
|
|
131
132
|
throw new Error("Invalid renderInline function");
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
|
-
const
|
|
135
|
+
const ti = function(t) {
|
|
135
136
|
if (typeof window._nc_fileactions > "u" && (window._nc_fileactions = [], m.debug("FileActions initialized")), window._nc_fileactions.find((e) => e.id === t.id)) {
|
|
136
137
|
m.error(`FileAction ${t.id} already registered`, { action: t });
|
|
137
138
|
return;
|
|
138
139
|
}
|
|
139
140
|
window._nc_fileactions.push(t);
|
|
140
|
-
},
|
|
141
|
+
}, ei = function() {
|
|
141
142
|
return typeof window._nc_fileactions > "u" && (window._nc_fileactions = [], m.debug("FileActions initialized")), window._nc_fileactions;
|
|
142
143
|
};
|
|
143
|
-
class
|
|
144
|
+
class ii {
|
|
144
145
|
_header;
|
|
145
146
|
constructor(e) {
|
|
146
147
|
this.validateHeader(e), this._header = e;
|
|
@@ -173,17 +174,17 @@ class ti {
|
|
|
173
174
|
throw new Error("Invalid updated property");
|
|
174
175
|
}
|
|
175
176
|
}
|
|
176
|
-
const
|
|
177
|
+
const ni = function(t) {
|
|
177
178
|
if (typeof window._nc_filelistheader > "u" && (window._nc_filelistheader = [], m.debug("FileListHeaders initialized")), window._nc_filelistheader.find((e) => e.id === t.id)) {
|
|
178
179
|
m.error(`Header ${t.id} already registered`, { header: t });
|
|
179
180
|
return;
|
|
180
181
|
}
|
|
181
182
|
window._nc_filelistheader.push(t);
|
|
182
|
-
},
|
|
183
|
+
}, ri = function() {
|
|
183
184
|
return typeof window._nc_filelistheader > "u" && (window._nc_filelistheader = [], m.debug("FileListHeaders initialized")), window._nc_filelistheader;
|
|
184
185
|
};
|
|
185
186
|
var v = ((t) => (t[t.NONE = 0] = "NONE", t[t.CREATE = 4] = "CREATE", t[t.READ = 1] = "READ", t[t.UPDATE = 2] = "UPDATE", t[t.DELETE = 8] = "DELETE", t[t.SHARE = 16] = "SHARE", t[t.ALL = 31] = "ALL", t))(v || {});
|
|
186
|
-
const W = ["d:getcontentlength", "d:getcontenttype", "d:getetag", "d:getlastmodified", "d:quota-available-bytes", "d:resourcetype", "nc:has-preview", "nc:is-encrypted", "nc:mount-type", "nc:share-attributes", "oc:comments-unread", "oc:favorite", "oc:fileid", "oc:owner-display-name", "oc:owner-id", "oc:permissions", "oc:share-types", "oc:size", "ocs:share-permissions"], Y = { d: "DAV:", nc: "http://nextcloud.org/ns", oc: "http://owncloud.org/ns", ocs: "http://open-collaboration-services.org/ns" },
|
|
187
|
+
const W = ["d:getcontentlength", "d:getcontenttype", "d:getetag", "d:getlastmodified", "d:quota-available-bytes", "d:resourcetype", "nc:has-preview", "nc:is-encrypted", "nc:mount-type", "nc:share-attributes", "oc:comments-unread", "oc:favorite", "oc:fileid", "oc:owner-display-name", "oc:owner-id", "oc:permissions", "oc:share-types", "oc:size", "ocs:share-permissions"], Y = { d: "DAV:", nc: "http://nextcloud.org/ns", oc: "http://owncloud.org/ns", ocs: "http://open-collaboration-services.org/ns" }, si = function(t, e = { nc: "http://nextcloud.org/ns" }) {
|
|
187
188
|
typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...W], window._nc_dav_namespaces = { ...Y });
|
|
188
189
|
const i = { ...window._nc_dav_namespaces, ...e };
|
|
189
190
|
if (window._nc_dav_properties.find((n) => n === t))
|
|
@@ -196,14 +197,14 @@ const W = ["d:getcontentlength", "d:getcontenttype", "d:getetag", "d:getlastmodi
|
|
|
196
197
|
return typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...W]), window._nc_dav_properties.map((t) => `<${t} />`).join(" ");
|
|
197
198
|
}, V = function() {
|
|
198
199
|
return typeof window._nc_dav_namespaces > "u" && (window._nc_dav_namespaces = { ...Y }), Object.keys(window._nc_dav_namespaces).map((t) => `xmlns:${t}="${window._nc_dav_namespaces?.[t]}"`).join(" ");
|
|
199
|
-
},
|
|
200
|
+
}, oi = function() {
|
|
200
201
|
return `<?xml version="1.0"?>
|
|
201
202
|
<d:propfind ${V()}>
|
|
202
203
|
<d:prop>
|
|
203
204
|
${$()}
|
|
204
205
|
</d:prop>
|
|
205
206
|
</d:propfind>`;
|
|
206
|
-
},
|
|
207
|
+
}, yt = function() {
|
|
207
208
|
return `<?xml version="1.0"?>
|
|
208
209
|
<oc:filter-files ${V()}>
|
|
209
210
|
<d:prop>
|
|
@@ -213,7 +214,7 @@ const W = ["d:getcontentlength", "d:getcontenttype", "d:getetag", "d:getlastmodi
|
|
|
213
214
|
<oc:favorite>1</oc:favorite>
|
|
214
215
|
</oc:filter-rules>
|
|
215
216
|
</oc:filter-files>`;
|
|
216
|
-
},
|
|
217
|
+
}, ai = function(t) {
|
|
217
218
|
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
218
219
|
<d:searchrequest ${V()}
|
|
219
220
|
xmlns:ns="https://github.com/icewind1991/SearchDAV/ns">
|
|
@@ -269,7 +270,7 @@ const W = ["d:getcontentlength", "d:getcontenttype", "d:getetag", "d:getlastmodi
|
|
|
269
270
|
</d:limit>
|
|
270
271
|
</d:basicsearch>
|
|
271
272
|
</d:searchrequest>`;
|
|
272
|
-
},
|
|
273
|
+
}, xt = function(t = "") {
|
|
273
274
|
let e = v.NONE;
|
|
274
275
|
return t && ((t.includes("C") || t.includes("K")) && (e |= v.CREATE), t.includes("G") && (e |= v.READ), (t.includes("W") || t.includes("N") || t.includes("V")) && (e |= v.UPDATE), t.includes("D") && (e |= v.DELETE), t.includes("R") && (e |= v.SHARE)), e;
|
|
275
276
|
};
|
|
@@ -329,6 +330,10 @@ class Q {
|
|
|
329
330
|
get source() {
|
|
330
331
|
return this._data.source.replace(/\/$/i, "");
|
|
331
332
|
}
|
|
333
|
+
get encodedSource() {
|
|
334
|
+
const { origin: e } = new URL(this.source);
|
|
335
|
+
return e + ht(this.source.slice(e.length));
|
|
336
|
+
}
|
|
332
337
|
get basename() {
|
|
333
338
|
return ut(this.source);
|
|
334
339
|
}
|
|
@@ -398,12 +403,12 @@ class Q {
|
|
|
398
403
|
this._data.mtime && (this._data.mtime = /* @__PURE__ */ new Date());
|
|
399
404
|
}
|
|
400
405
|
}
|
|
401
|
-
class
|
|
406
|
+
class bt extends Q {
|
|
402
407
|
get type() {
|
|
403
408
|
return k.File;
|
|
404
409
|
}
|
|
405
410
|
}
|
|
406
|
-
class
|
|
411
|
+
class Et extends Q {
|
|
407
412
|
constructor(e) {
|
|
408
413
|
super({ ...e, mime: "httpd/unix-directory" });
|
|
409
414
|
}
|
|
@@ -417,14 +422,14 @@ class bt extends Q {
|
|
|
417
422
|
return "httpd/unix-directory";
|
|
418
423
|
}
|
|
419
424
|
}
|
|
420
|
-
const tt = `/files/${T()?.uid}`, et =
|
|
421
|
-
const e =
|
|
422
|
-
return
|
|
423
|
-
},
|
|
424
|
-
const r = t.props, n =
|
|
425
|
-
return delete a.attributes?.props, t.type === "file" ? new
|
|
425
|
+
const tt = `/files/${T()?.uid}`, et = pt("dav"), li = function(t = et) {
|
|
426
|
+
const e = ft(t, { headers: { requesttoken: at() || "" } });
|
|
427
|
+
return gt().patch("request", (i) => (i.headers?.method && (i.method = i.headers.method, delete i.headers.method), mt(i))), e;
|
|
428
|
+
}, di = async (t, e = "/", i = tt) => (await t.getDirectoryContents(`${i}${e}`, { details: !0, data: yt(), headers: { method: "REPORT" }, includeSelf: !0 })).data.filter((r) => r.filename !== e).map((r) => Nt(r, i)), Nt = function(t, e = tt, i = et) {
|
|
429
|
+
const r = t.props, n = xt(r?.permissions), s = T()?.uid, a = { id: r?.fileid || 0, source: `${i}${t.filename}`, mtime: new Date(Date.parse(t.lastmod)), mime: t.mime, size: r?.size || Number.parseInt(r.getcontentlength || "0"), permissions: n, owner: s, root: e, attributes: { ...t, ...r, hasPreview: r?.["has-preview"] } };
|
|
430
|
+
return delete a.attributes?.props, t.type === "file" ? new bt(a) : new Et(a);
|
|
426
431
|
};
|
|
427
|
-
class
|
|
432
|
+
class _t {
|
|
428
433
|
_views = [];
|
|
429
434
|
_currentView = null;
|
|
430
435
|
register(e) {
|
|
@@ -446,13 +451,13 @@ class Nt {
|
|
|
446
451
|
return this._currentView;
|
|
447
452
|
}
|
|
448
453
|
}
|
|
449
|
-
const
|
|
450
|
-
return typeof window._nc_navigation > "u" && (window._nc_navigation = new
|
|
454
|
+
const ui = function() {
|
|
455
|
+
return typeof window._nc_navigation > "u" && (window._nc_navigation = new _t(), m.debug("Navigation service initialized")), window._nc_navigation;
|
|
451
456
|
};
|
|
452
|
-
class
|
|
457
|
+
class At {
|
|
453
458
|
_column;
|
|
454
459
|
constructor(e) {
|
|
455
|
-
|
|
460
|
+
Tt(e), this._column = e;
|
|
456
461
|
}
|
|
457
462
|
get id() {
|
|
458
463
|
return this._column.id;
|
|
@@ -470,7 +475,7 @@ class _t {
|
|
|
470
475
|
return this._column.summary;
|
|
471
476
|
}
|
|
472
477
|
}
|
|
473
|
-
const
|
|
478
|
+
const Tt = function(t) {
|
|
474
479
|
if (!t.id || typeof t.id != "string")
|
|
475
480
|
throw new Error("A column id is required");
|
|
476
481
|
if (!t.title || typeof t.title != "string")
|
|
@@ -515,20 +520,20 @@ var L = {}, I = {};
|
|
|
515
520
|
return t.isExist(o) ? o : "";
|
|
516
521
|
}, t.isName = a, t.getAllMatches = s, t.nameRegexp = r;
|
|
517
522
|
})(I);
|
|
518
|
-
const R = I,
|
|
523
|
+
const R = I, It = { allowBooleanAttributes: !1, unpairedTags: [] };
|
|
519
524
|
L.validate = function(t, e) {
|
|
520
|
-
e = Object.assign({},
|
|
525
|
+
e = Object.assign({}, It, e);
|
|
521
526
|
const i = [];
|
|
522
527
|
let r = !1, n = !1;
|
|
523
528
|
t[0] === "\uFEFF" && (t = t.substr(1));
|
|
524
529
|
for (let s = 0; s < t.length; s++)
|
|
525
530
|
if (t[s] === "<" && t[s + 1] === "?") {
|
|
526
|
-
if (s += 2, s =
|
|
531
|
+
if (s += 2, s = U(t, s), s.err)
|
|
527
532
|
return s;
|
|
528
533
|
} else if (t[s] === "<") {
|
|
529
534
|
let a = s;
|
|
530
535
|
if (s++, t[s] === "!") {
|
|
531
|
-
s =
|
|
536
|
+
s = z(t, s);
|
|
532
537
|
continue;
|
|
533
538
|
} else {
|
|
534
539
|
let o = !1;
|
|
@@ -537,11 +542,11 @@ L.validate = function(t, e) {
|
|
|
537
542
|
for (; s < t.length && t[s] !== ">" && t[s] !== " " && t[s] !== " " && t[s] !== `
|
|
538
543
|
` && t[s] !== "\r"; s++)
|
|
539
544
|
l += t[s];
|
|
540
|
-
if (l = l.trim(), l[l.length - 1] === "/" && (l = l.substring(0, l.length - 1), s--),
|
|
545
|
+
if (l = l.trim(), l[l.length - 1] === "/" && (l = l.substring(0, l.length - 1), s--), !Vt(l)) {
|
|
541
546
|
let c;
|
|
542
547
|
return l.trim().length === 0 ? c = "Invalid space after '<'." : c = "Tag '" + l + "' is an invalid name.", f("InvalidTag", c, g(t, s));
|
|
543
548
|
}
|
|
544
|
-
const d =
|
|
549
|
+
const d = Ct(t, s);
|
|
545
550
|
if (d === !1)
|
|
546
551
|
return f("InvalidAttr", "Attributes for '" + l + "' have open quote.", g(t, s));
|
|
547
552
|
let u = d.value;
|
|
@@ -578,15 +583,15 @@ L.validate = function(t, e) {
|
|
|
578
583
|
for (s++; s < t.length; s++)
|
|
579
584
|
if (t[s] === "<")
|
|
580
585
|
if (t[s + 1] === "!") {
|
|
581
|
-
s++, s =
|
|
586
|
+
s++, s = z(t, s);
|
|
582
587
|
continue;
|
|
583
588
|
} else if (t[s + 1] === "?") {
|
|
584
|
-
if (s =
|
|
589
|
+
if (s = U(t, ++s), s.err)
|
|
585
590
|
return s;
|
|
586
591
|
} else
|
|
587
592
|
break;
|
|
588
593
|
else if (t[s] === "&") {
|
|
589
|
-
const c =
|
|
594
|
+
const c = Ft(t, s);
|
|
590
595
|
if (c == -1)
|
|
591
596
|
return f("InvalidChar", "char '&' is not expected.", g(t, s));
|
|
592
597
|
s = c;
|
|
@@ -612,7 +617,7 @@ function q(t) {
|
|
|
612
617
|
return t === " " || t === " " || t === `
|
|
613
618
|
` || t === "\r";
|
|
614
619
|
}
|
|
615
|
-
function
|
|
620
|
+
function U(t, e) {
|
|
616
621
|
const i = e;
|
|
617
622
|
for (; e < t.length; e++)
|
|
618
623
|
if (t[e] == "?" || t[e] == " ") {
|
|
@@ -627,7 +632,7 @@ function z(t, e) {
|
|
|
627
632
|
}
|
|
628
633
|
return e;
|
|
629
634
|
}
|
|
630
|
-
function
|
|
635
|
+
function z(t, e) {
|
|
631
636
|
if (t.length > e + 5 && t[e + 1] === "-" && t[e + 2] === "-") {
|
|
632
637
|
for (e += 3; e < t.length; e++)
|
|
633
638
|
if (t[e] === "-" && t[e + 1] === "-" && t[e + 2] === ">") {
|
|
@@ -650,11 +655,11 @@ function U(t, e) {
|
|
|
650
655
|
}
|
|
651
656
|
return e;
|
|
652
657
|
}
|
|
653
|
-
const
|
|
654
|
-
function
|
|
658
|
+
const Pt = '"', Ot = "'";
|
|
659
|
+
function Ct(t, e) {
|
|
655
660
|
let i = "", r = "", n = !1;
|
|
656
661
|
for (; e < t.length; e++) {
|
|
657
|
-
if (t[e] ===
|
|
662
|
+
if (t[e] === Pt || t[e] === Ot)
|
|
658
663
|
r === "" ? r = t[e] : r !== t[e] || (r = "");
|
|
659
664
|
else if (t[e] === ">" && r === "") {
|
|
660
665
|
n = !0;
|
|
@@ -664,9 +669,9 @@ function Pt(t, e) {
|
|
|
664
669
|
}
|
|
665
670
|
return r !== "" ? !1 : { value: i, index: e, tagClosed: n };
|
|
666
671
|
}
|
|
667
|
-
const
|
|
672
|
+
const Dt = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
|
|
668
673
|
function G(t, e) {
|
|
669
|
-
const i = R.getAllMatches(t,
|
|
674
|
+
const i = R.getAllMatches(t, Dt), r = {};
|
|
670
675
|
for (let n = 0; n < i.length; n++) {
|
|
671
676
|
if (i[n][1].length === 0)
|
|
672
677
|
return f("InvalidAttr", "Attribute '" + i[n][2] + "' has no space in starting.", E(i[n]));
|
|
@@ -675,7 +680,7 @@ function G(t, e) {
|
|
|
675
680
|
if (i[n][3] === void 0 && !e.allowBooleanAttributes)
|
|
676
681
|
return f("InvalidAttr", "boolean attribute '" + i[n][2] + "' is not allowed.", E(i[n]));
|
|
677
682
|
const s = i[n][2];
|
|
678
|
-
if (
|
|
683
|
+
if (!$t(s))
|
|
679
684
|
return f("InvalidAttr", "Attribute '" + s + "' is an invalid name.", E(i[n]));
|
|
680
685
|
if (!r.hasOwnProperty(s))
|
|
681
686
|
r[s] = 1;
|
|
@@ -684,7 +689,7 @@ function G(t, e) {
|
|
|
684
689
|
}
|
|
685
690
|
return !0;
|
|
686
691
|
}
|
|
687
|
-
function
|
|
692
|
+
function St(t, e) {
|
|
688
693
|
let i = /\d/;
|
|
689
694
|
for (t[e] === "x" && (e++, i = /[\da-fA-F]/); e < t.length; e++) {
|
|
690
695
|
if (t[e] === ";")
|
|
@@ -694,11 +699,11 @@ function Dt(t, e) {
|
|
|
694
699
|
}
|
|
695
700
|
return -1;
|
|
696
701
|
}
|
|
697
|
-
function
|
|
702
|
+
function Ft(t, e) {
|
|
698
703
|
if (e++, t[e] === ";")
|
|
699
704
|
return -1;
|
|
700
705
|
if (t[e] === "#")
|
|
701
|
-
return e++,
|
|
706
|
+
return e++, St(t, e);
|
|
702
707
|
let i = 0;
|
|
703
708
|
for (; e < t.length; e++, i++)
|
|
704
709
|
if (!(t[e].match(/\w/) && i < 20)) {
|
|
@@ -711,10 +716,10 @@ function St(t, e) {
|
|
|
711
716
|
function f(t, e, i) {
|
|
712
717
|
return { err: { code: t, msg: e, line: i.line || i, col: i.col } };
|
|
713
718
|
}
|
|
714
|
-
function
|
|
719
|
+
function $t(t) {
|
|
715
720
|
return R.isName(t);
|
|
716
721
|
}
|
|
717
|
-
function
|
|
722
|
+
function Vt(t) {
|
|
718
723
|
return R.isName(t);
|
|
719
724
|
}
|
|
720
725
|
function g(t, e) {
|
|
@@ -731,11 +736,11 @@ const it = { preserveOrder: !1, attributeNamePrefix: "@_", attributesGroupName:
|
|
|
731
736
|
return e;
|
|
732
737
|
}, stopNodes: [], alwaysCreateTextNode: !1, isArray: () => !1, commentPropName: !1, unpairedTags: [], processEntities: !0, htmlEntities: !1, ignoreDeclaration: !1, ignorePiTags: !1, transformTagName: !1, transformAttributeName: !1, updateTag: function(t, e, i) {
|
|
733
738
|
return t;
|
|
734
|
-
} },
|
|
739
|
+
} }, kt = function(t) {
|
|
735
740
|
return Object.assign({}, it, t);
|
|
736
741
|
};
|
|
737
|
-
C.buildOptions =
|
|
738
|
-
class
|
|
742
|
+
C.buildOptions = kt, C.defaultOptions = it;
|
|
743
|
+
class Lt {
|
|
739
744
|
constructor(e) {
|
|
740
745
|
this.tagname = e, this.child = [], this[":@"] = {};
|
|
741
746
|
}
|
|
@@ -746,24 +751,24 @@ class kt {
|
|
|
746
751
|
e.tagname === "__proto__" && (e.tagname = "#__proto__"), e[":@"] && Object.keys(e[":@"]).length > 0 ? this.child.push({ [e.tagname]: e.child, ":@": e[":@"] }) : this.child.push({ [e.tagname]: e.child });
|
|
747
752
|
}
|
|
748
753
|
}
|
|
749
|
-
var
|
|
750
|
-
const
|
|
751
|
-
function
|
|
754
|
+
var Rt = Lt;
|
|
755
|
+
const jt = I;
|
|
756
|
+
function Mt(t, e) {
|
|
752
757
|
const i = {};
|
|
753
758
|
if (t[e + 3] === "O" && t[e + 4] === "C" && t[e + 5] === "T" && t[e + 6] === "Y" && t[e + 7] === "P" && t[e + 8] === "E") {
|
|
754
759
|
e = e + 9;
|
|
755
760
|
let r = 1, n = !1, s = !1, a = "";
|
|
756
761
|
for (; e < t.length; e++)
|
|
757
762
|
if (t[e] === "<" && !s) {
|
|
758
|
-
if (n &&
|
|
759
|
-
e += 7, [entityName, val, e] =
|
|
763
|
+
if (n && Ut(t, e))
|
|
764
|
+
e += 7, [entityName, val, e] = Bt(t, e + 1), val.indexOf("&") === -1 && (i[Ht(entityName)] = { regx: RegExp(`&${entityName};`, "g"), val });
|
|
760
765
|
else if (n && zt(t, e))
|
|
761
766
|
e += 8;
|
|
762
|
-
else if (n && Ut(t, e))
|
|
763
|
-
e += 8;
|
|
764
767
|
else if (n && Gt(t, e))
|
|
768
|
+
e += 8;
|
|
769
|
+
else if (n && Xt(t, e))
|
|
765
770
|
e += 9;
|
|
766
|
-
else if (
|
|
771
|
+
else if (qt)
|
|
767
772
|
s = !0;
|
|
768
773
|
else
|
|
769
774
|
throw new Error("Invalid DOCTYPE");
|
|
@@ -779,7 +784,7 @@ function jt(t, e) {
|
|
|
779
784
|
throw new Error("Invalid Tag instead of DOCTYPE");
|
|
780
785
|
return { entities: i, i: e };
|
|
781
786
|
}
|
|
782
|
-
function
|
|
787
|
+
function Bt(t, e) {
|
|
783
788
|
let i = "";
|
|
784
789
|
for (; e < t.length && t[e] !== "'" && t[e] !== '"'; e++)
|
|
785
790
|
i += t[e];
|
|
@@ -791,43 +796,43 @@ function Mt(t, e) {
|
|
|
791
796
|
n += t[e];
|
|
792
797
|
return [i, n, e];
|
|
793
798
|
}
|
|
794
|
-
function
|
|
799
|
+
function qt(t, e) {
|
|
795
800
|
return t[e + 1] === "!" && t[e + 2] === "-" && t[e + 3] === "-";
|
|
796
801
|
}
|
|
797
|
-
function
|
|
802
|
+
function Ut(t, e) {
|
|
798
803
|
return t[e + 1] === "!" && t[e + 2] === "E" && t[e + 3] === "N" && t[e + 4] === "T" && t[e + 5] === "I" && t[e + 6] === "T" && t[e + 7] === "Y";
|
|
799
804
|
}
|
|
800
805
|
function zt(t, e) {
|
|
801
806
|
return t[e + 1] === "!" && t[e + 2] === "E" && t[e + 3] === "L" && t[e + 4] === "E" && t[e + 5] === "M" && t[e + 6] === "E" && t[e + 7] === "N" && t[e + 8] === "T";
|
|
802
807
|
}
|
|
803
|
-
function
|
|
808
|
+
function Gt(t, e) {
|
|
804
809
|
return t[e + 1] === "!" && t[e + 2] === "A" && t[e + 3] === "T" && t[e + 4] === "T" && t[e + 5] === "L" && t[e + 6] === "I" && t[e + 7] === "S" && t[e + 8] === "T";
|
|
805
810
|
}
|
|
806
|
-
function
|
|
811
|
+
function Xt(t, e) {
|
|
807
812
|
return t[e + 1] === "!" && t[e + 2] === "N" && t[e + 3] === "O" && t[e + 4] === "T" && t[e + 5] === "A" && t[e + 6] === "T" && t[e + 7] === "I" && t[e + 8] === "O" && t[e + 9] === "N";
|
|
808
813
|
}
|
|
809
|
-
function
|
|
810
|
-
if (
|
|
814
|
+
function Ht(t) {
|
|
815
|
+
if (jt.isName(t))
|
|
811
816
|
return t;
|
|
812
817
|
throw new Error(`Invalid entity name ${t}`);
|
|
813
818
|
}
|
|
814
|
-
var
|
|
815
|
-
const
|
|
819
|
+
var Kt = Mt;
|
|
820
|
+
const Wt = /^[-+]?0x[a-fA-F0-9]+$/, Yt = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;
|
|
816
821
|
!Number.parseInt && window.parseInt && (Number.parseInt = window.parseInt), !Number.parseFloat && window.parseFloat && (Number.parseFloat = window.parseFloat);
|
|
817
|
-
const
|
|
818
|
-
function
|
|
819
|
-
if (e = Object.assign({},
|
|
822
|
+
const Zt = { hex: !0, leadingZeros: !0, decimalPoint: ".", eNotation: !0 };
|
|
823
|
+
function Jt(t, e = {}) {
|
|
824
|
+
if (e = Object.assign({}, Zt, e), !t || typeof t != "string")
|
|
820
825
|
return t;
|
|
821
826
|
let i = t.trim();
|
|
822
827
|
if (e.skipLike !== void 0 && e.skipLike.test(i))
|
|
823
828
|
return t;
|
|
824
|
-
if (e.hex &&
|
|
829
|
+
if (e.hex && Wt.test(i))
|
|
825
830
|
return Number.parseInt(i, 16);
|
|
826
831
|
{
|
|
827
|
-
const r =
|
|
832
|
+
const r = Yt.exec(i);
|
|
828
833
|
if (r) {
|
|
829
834
|
const n = r[1], s = r[2];
|
|
830
|
-
let a =
|
|
835
|
+
let a = Qt(r[3]);
|
|
831
836
|
const o = r[4] || r[6];
|
|
832
837
|
if (!e.leadingZeros && s.length > 0 && n && i[2] !== "." || !e.leadingZeros && s.length > 0 && !n && i[1] !== ".")
|
|
833
838
|
return t;
|
|
@@ -839,32 +844,32 @@ function Zt(t, e = {}) {
|
|
|
839
844
|
return t;
|
|
840
845
|
}
|
|
841
846
|
}
|
|
842
|
-
function
|
|
847
|
+
function Qt(t) {
|
|
843
848
|
return t && t.indexOf(".") !== -1 && (t = t.replace(/0+$/, ""), t === "." ? t = "0" : t[0] === "." ? t = "0" + t : t[t.length - 1] === "." && (t = t.substr(0, t.length - 1))), t;
|
|
844
849
|
}
|
|
845
|
-
var
|
|
846
|
-
const j = I, N =
|
|
850
|
+
var te = Jt;
|
|
851
|
+
const j = I, N = Rt, ee = Kt, ie = te;
|
|
847
852
|
"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g, j.nameRegexp);
|
|
848
|
-
let
|
|
853
|
+
let ne = class {
|
|
849
854
|
constructor(t) {
|
|
850
|
-
this.options = t, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "¢" }, pound: { regex: /&(pound|#163);/g, val: "£" }, yen: { regex: /&(yen|#165);/g, val: "¥" }, euro: { regex: /&(euro|#8364);/g, val: "€" }, copyright: { regex: /&(copy|#169);/g, val: "©" }, reg: { regex: /&(reg|#174);/g, val: "®" }, inr: { regex: /&(inr|#8377);/g, val: "₹" } }, this.addExternalEntities =
|
|
855
|
+
this.options = t, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "¢" }, pound: { regex: /&(pound|#163);/g, val: "£" }, yen: { regex: /&(yen|#165);/g, val: "¥" }, euro: { regex: /&(euro|#8364);/g, val: "€" }, copyright: { regex: /&(copy|#169);/g, val: "©" }, reg: { regex: /&(reg|#174);/g, val: "®" }, inr: { regex: /&(inr|#8377);/g, val: "₹" } }, this.addExternalEntities = re, this.parseXml = de, this.parseTextData = se, this.resolveNameSpace = oe, this.buildAttributesMap = le, this.isItStopNode = pe, this.replaceEntitiesValue = ce, this.readStopNodeData = ge, this.saveTextToParentTag = he, this.addChild = ue;
|
|
851
856
|
}
|
|
852
857
|
};
|
|
853
|
-
function
|
|
858
|
+
function re(t) {
|
|
854
859
|
const e = Object.keys(t);
|
|
855
860
|
for (let i = 0; i < e.length; i++) {
|
|
856
861
|
const r = e[i];
|
|
857
862
|
this.lastEntities[r] = { regex: new RegExp("&" + r + ";", "g"), val: t[r] };
|
|
858
863
|
}
|
|
859
864
|
}
|
|
860
|
-
function
|
|
865
|
+
function se(t, e, i, r, n, s, a) {
|
|
861
866
|
if (t !== void 0 && (this.options.trimValues && !r && (t = t.trim()), t.length > 0)) {
|
|
862
867
|
a || (t = this.replaceEntitiesValue(t));
|
|
863
868
|
const o = this.options.tagValueProcessor(e, t, i, n, s);
|
|
864
869
|
return o == null ? t : typeof o != typeof t || o !== t ? o : this.options.trimValues ? S(t, this.options.parseTagValue, this.options.numberParseOptions) : t.trim() === t ? S(t, this.options.parseTagValue, this.options.numberParseOptions) : t;
|
|
865
870
|
}
|
|
866
871
|
}
|
|
867
|
-
function
|
|
872
|
+
function oe(t) {
|
|
868
873
|
if (this.options.removeNSPrefix) {
|
|
869
874
|
const e = t.split(":"), i = t.charAt(0) === "/" ? "/" : "";
|
|
870
875
|
if (e[0] === "xmlns")
|
|
@@ -873,10 +878,10 @@ function se(t) {
|
|
|
873
878
|
}
|
|
874
879
|
return t;
|
|
875
880
|
}
|
|
876
|
-
const
|
|
877
|
-
function
|
|
881
|
+
const ae = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
|
|
882
|
+
function le(t, e, i) {
|
|
878
883
|
if (!this.options.ignoreAttributes && typeof t == "string") {
|
|
879
|
-
const r = j.getAllMatches(t,
|
|
884
|
+
const r = j.getAllMatches(t, ae), n = r.length, s = {};
|
|
880
885
|
for (let a = 0; a < n; a++) {
|
|
881
886
|
const o = this.resolveNameSpace(r[a][1]);
|
|
882
887
|
let l = r[a][4], d = this.options.attributeNamePrefix + o;
|
|
@@ -897,7 +902,7 @@ function ae(t, e, i) {
|
|
|
897
902
|
return s;
|
|
898
903
|
}
|
|
899
904
|
}
|
|
900
|
-
const
|
|
905
|
+
const de = function(t) {
|
|
901
906
|
t = t.replace(/\r\n?/g, `
|
|
902
907
|
`);
|
|
903
908
|
const e = new N("!xml");
|
|
@@ -934,7 +939,7 @@ const le = function(t) {
|
|
|
934
939
|
}
|
|
935
940
|
s = a;
|
|
936
941
|
} else if (t.substr(s + 1, 2) === "!D") {
|
|
937
|
-
const a =
|
|
942
|
+
const a = ee(t, s);
|
|
938
943
|
this.docTypeEntities = a.entities, s = a.i;
|
|
939
944
|
} else if (t.substr(s + 1, 2) === "![") {
|
|
940
945
|
const a = x(t, "]]>", s, "CDATA is not closed.") - 2, o = t.substring(s + 9, a);
|
|
@@ -981,11 +986,11 @@ const le = function(t) {
|
|
|
981
986
|
r += t[s];
|
|
982
987
|
return e.child;
|
|
983
988
|
};
|
|
984
|
-
function
|
|
989
|
+
function ue(t, e, i) {
|
|
985
990
|
const r = this.options.updateTag(e.tagname, i, e[":@"]);
|
|
986
991
|
r === !1 || (typeof r == "string" && (e.tagname = r), t.addChild(e));
|
|
987
992
|
}
|
|
988
|
-
const
|
|
993
|
+
const ce = function(t) {
|
|
989
994
|
if (this.options.processEntities) {
|
|
990
995
|
for (let e in this.docTypeEntities) {
|
|
991
996
|
const i = this.docTypeEntities[e];
|
|
@@ -1004,10 +1009,10 @@ const ue = function(t) {
|
|
|
1004
1009
|
}
|
|
1005
1010
|
return t;
|
|
1006
1011
|
};
|
|
1007
|
-
function
|
|
1012
|
+
function he(t, e, i, r) {
|
|
1008
1013
|
return t && (r === void 0 && (r = Object.keys(e.child).length === 0), t = this.parseTextData(t, e.tagname, i, !1, e[":@"] ? Object.keys(e[":@"]).length !== 0 : !1, r), t !== void 0 && t !== "" && e.add(this.options.textNodeName, t), t = ""), t;
|
|
1009
1014
|
}
|
|
1010
|
-
function
|
|
1015
|
+
function pe(t, e, i) {
|
|
1011
1016
|
const r = "*." + i;
|
|
1012
1017
|
for (const n in t) {
|
|
1013
1018
|
const s = t[n];
|
|
@@ -1016,7 +1021,7 @@ function he(t, e, i) {
|
|
|
1016
1021
|
}
|
|
1017
1022
|
return !1;
|
|
1018
1023
|
}
|
|
1019
|
-
function
|
|
1024
|
+
function fe(t, e, i = ">") {
|
|
1020
1025
|
let r, n = "";
|
|
1021
1026
|
for (let s = e; s < t.length; s++) {
|
|
1022
1027
|
let a = t[s];
|
|
@@ -1042,7 +1047,7 @@ function x(t, e, i, r) {
|
|
|
1042
1047
|
return n + e.length - 1;
|
|
1043
1048
|
}
|
|
1044
1049
|
function D(t, e, i, r = ">") {
|
|
1045
|
-
const n =
|
|
1050
|
+
const n = fe(t, e + 1, r);
|
|
1046
1051
|
if (!n)
|
|
1047
1052
|
return;
|
|
1048
1053
|
let s = n.data;
|
|
@@ -1056,7 +1061,7 @@ function D(t, e, i, r = ">") {
|
|
|
1056
1061
|
}
|
|
1057
1062
|
return { tagName: l, tagExp: s, closeIndex: a, attrExpPresent: d, rawTagName: u };
|
|
1058
1063
|
}
|
|
1059
|
-
function
|
|
1064
|
+
function ge(t, e, i) {
|
|
1060
1065
|
const r = i;
|
|
1061
1066
|
let n = 1;
|
|
1062
1067
|
for (; i < t.length; i++)
|
|
@@ -1080,19 +1085,19 @@ function fe(t, e, i) {
|
|
|
1080
1085
|
function S(t, e, i) {
|
|
1081
1086
|
if (e && typeof t == "string") {
|
|
1082
1087
|
const r = t.trim();
|
|
1083
|
-
return r === "true" ? !0 : r === "false" ? !1 :
|
|
1088
|
+
return r === "true" ? !0 : r === "false" ? !1 : ie(t, i);
|
|
1084
1089
|
} else
|
|
1085
1090
|
return j.isExist(t) ? t : "";
|
|
1086
1091
|
}
|
|
1087
|
-
var
|
|
1088
|
-
function
|
|
1092
|
+
var me = ne, nt = {};
|
|
1093
|
+
function we(t, e) {
|
|
1089
1094
|
return rt(t, e);
|
|
1090
1095
|
}
|
|
1091
1096
|
function rt(t, e, i) {
|
|
1092
1097
|
let r;
|
|
1093
1098
|
const n = {};
|
|
1094
1099
|
for (let s = 0; s < t.length; s++) {
|
|
1095
|
-
const a = t[s], o =
|
|
1100
|
+
const a = t[s], o = ve(a);
|
|
1096
1101
|
let l = "";
|
|
1097
1102
|
if (i === void 0 ? l = o : l = i + "." + o, o === e.textNodeName)
|
|
1098
1103
|
r === void 0 ? r = a[o] : r += "" + a[o];
|
|
@@ -1101,14 +1106,14 @@ function rt(t, e, i) {
|
|
|
1101
1106
|
continue;
|
|
1102
1107
|
if (a[o]) {
|
|
1103
1108
|
let d = rt(a[o], e, l);
|
|
1104
|
-
const u =
|
|
1105
|
-
a[":@"] ?
|
|
1109
|
+
const u = xe(d, e);
|
|
1110
|
+
a[":@"] ? ye(d, a[":@"], l, e) : Object.keys(d).length === 1 && d[e.textNodeName] !== void 0 && !e.alwaysCreateTextNode ? d = d[e.textNodeName] : Object.keys(d).length === 0 && (e.alwaysCreateTextNode ? d[e.textNodeName] = "" : d = ""), n[o] !== void 0 && n.hasOwnProperty(o) ? (Array.isArray(n[o]) || (n[o] = [n[o]]), n[o].push(d)) : e.isArray(o, l, u) ? n[o] = [d] : n[o] = d;
|
|
1106
1111
|
}
|
|
1107
1112
|
}
|
|
1108
1113
|
}
|
|
1109
1114
|
return typeof r == "string" ? r.length > 0 && (n[e.textNodeName] = r) : r !== void 0 && (n[e.textNodeName] = r), n;
|
|
1110
1115
|
}
|
|
1111
|
-
function
|
|
1116
|
+
function ve(t) {
|
|
1112
1117
|
const e = Object.keys(t);
|
|
1113
1118
|
for (let i = 0; i < e.length; i++) {
|
|
1114
1119
|
const r = e[i];
|
|
@@ -1116,7 +1121,7 @@ function we(t) {
|
|
|
1116
1121
|
return r;
|
|
1117
1122
|
}
|
|
1118
1123
|
}
|
|
1119
|
-
function
|
|
1124
|
+
function ye(t, e, i, r) {
|
|
1120
1125
|
if (e) {
|
|
1121
1126
|
const n = Object.keys(e), s = n.length;
|
|
1122
1127
|
for (let a = 0; a < s; a++) {
|
|
@@ -1125,15 +1130,15 @@ function ve(t, e, i, r) {
|
|
|
1125
1130
|
}
|
|
1126
1131
|
}
|
|
1127
1132
|
}
|
|
1128
|
-
function
|
|
1133
|
+
function xe(t, e) {
|
|
1129
1134
|
const { textNodeName: i } = e, r = Object.keys(t).length;
|
|
1130
1135
|
return !!(r === 0 || r === 1 && (t[i] || typeof t[i] == "boolean" || t[i] === 0));
|
|
1131
1136
|
}
|
|
1132
|
-
nt.prettify =
|
|
1133
|
-
const { buildOptions:
|
|
1134
|
-
let
|
|
1137
|
+
nt.prettify = we;
|
|
1138
|
+
const { buildOptions: be } = C, Ee = me, { prettify: Ne } = nt, _e = L;
|
|
1139
|
+
let Ae = class {
|
|
1135
1140
|
constructor(t) {
|
|
1136
|
-
this.externalEntities = {}, this.options =
|
|
1141
|
+
this.externalEntities = {}, this.options = be(t);
|
|
1137
1142
|
}
|
|
1138
1143
|
parse(t, e) {
|
|
1139
1144
|
if (typeof t != "string")
|
|
@@ -1143,14 +1148,14 @@ let _e = class {
|
|
|
1143
1148
|
throw new Error("XML data is accepted in String or Bytes[] form.");
|
|
1144
1149
|
if (e) {
|
|
1145
1150
|
e === !0 && (e = {});
|
|
1146
|
-
const n =
|
|
1151
|
+
const n = _e.validate(t, e);
|
|
1147
1152
|
if (n !== !0)
|
|
1148
1153
|
throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`);
|
|
1149
1154
|
}
|
|
1150
|
-
const i = new
|
|
1155
|
+
const i = new Ee(this.options);
|
|
1151
1156
|
i.addExternalEntities(this.externalEntities);
|
|
1152
1157
|
const r = i.parseXml(t);
|
|
1153
|
-
return this.options.preserveOrder || r === void 0 ? r :
|
|
1158
|
+
return this.options.preserveOrder || r === void 0 ? r : Ne(r, this.options);
|
|
1154
1159
|
}
|
|
1155
1160
|
addEntity(t, e) {
|
|
1156
1161
|
if (e.indexOf("&") !== -1)
|
|
@@ -1162,12 +1167,12 @@ let _e = class {
|
|
|
1162
1167
|
this.externalEntities[t] = e;
|
|
1163
1168
|
}
|
|
1164
1169
|
};
|
|
1165
|
-
var
|
|
1166
|
-
const
|
|
1170
|
+
var Te = Ae;
|
|
1171
|
+
const Ie = `
|
|
1167
1172
|
`;
|
|
1168
|
-
function
|
|
1173
|
+
function Pe(t, e) {
|
|
1169
1174
|
let i = "";
|
|
1170
|
-
return e.format && e.indentBy.length > 0 && (i =
|
|
1175
|
+
return e.format && e.indentBy.length > 0 && (i = Ie), st(t, e, "", i);
|
|
1171
1176
|
}
|
|
1172
1177
|
function st(t, e, i, r) {
|
|
1173
1178
|
let n = "", s = !1;
|
|
@@ -1178,7 +1183,7 @@ function st(t, e, i, r) {
|
|
|
1178
1183
|
let d = "";
|
|
1179
1184
|
if (i.length === 0 ? d = l : d = `${i}.${l}`, l === e.textNodeName) {
|
|
1180
1185
|
let w = o[l];
|
|
1181
|
-
|
|
1186
|
+
Ce(d, e) || (w = e.tagValueProcessor(l, w), w = ot(w, e)), s && (n += r), n += w, s = !1;
|
|
1182
1187
|
continue;
|
|
1183
1188
|
} else if (l === e.cdataPropName) {
|
|
1184
1189
|
s && (n += r), n += `<![CDATA[${o[l][0][e.textNodeName]}]]>`, s = !1;
|
|
@@ -1218,7 +1223,7 @@ function X(t, e) {
|
|
|
1218
1223
|
}
|
|
1219
1224
|
return i;
|
|
1220
1225
|
}
|
|
1221
|
-
function
|
|
1226
|
+
function Ce(t, e) {
|
|
1222
1227
|
t = t.substr(0, t.length - e.textNodeName.length - 1);
|
|
1223
1228
|
let i = t.substr(t.lastIndexOf(".") + 1);
|
|
1224
1229
|
for (let r in e.stopNodes)
|
|
@@ -1234,23 +1239,23 @@ function ot(t, e) {
|
|
|
1234
1239
|
}
|
|
1235
1240
|
return t;
|
|
1236
1241
|
}
|
|
1237
|
-
var
|
|
1238
|
-
const
|
|
1242
|
+
var De = Pe;
|
|
1243
|
+
const Se = De, Fe = { attributeNamePrefix: "@_", attributesGroupName: !1, textNodeName: "#text", ignoreAttributes: !0, cdataPropName: !1, format: !1, indentBy: " ", suppressEmptyNode: !1, suppressUnpairedNode: !0, suppressBooleanAttributes: !0, tagValueProcessor: function(t, e) {
|
|
1239
1244
|
return e;
|
|
1240
1245
|
}, attributeValueProcessor: function(t, e) {
|
|
1241
1246
|
return e;
|
|
1242
1247
|
}, preserveOrder: !1, commentPropName: !1, unpairedTags: [], entities: [{ regex: new RegExp("&", "g"), val: "&" }, { regex: new RegExp(">", "g"), val: ">" }, { regex: new RegExp("<", "g"), val: "<" }, { regex: new RegExp("'", "g"), val: "'" }, { regex: new RegExp('"', "g"), val: """ }], processEntities: !0, stopNodes: [], oneListGroup: !1 };
|
|
1243
1248
|
function y(t) {
|
|
1244
|
-
this.options = Object.assign({},
|
|
1249
|
+
this.options = Object.assign({}, Fe, t), this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() {
|
|
1245
1250
|
return !1;
|
|
1246
|
-
} : (this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute =
|
|
1251
|
+
} : (this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = ke), this.processTextOrObjNode = $e, this.options.format ? (this.indentate = Ve, this.tagEndChar = `>
|
|
1247
1252
|
`, this.newLine = `
|
|
1248
1253
|
`) : (this.indentate = function() {
|
|
1249
1254
|
return "";
|
|
1250
1255
|
}, this.tagEndChar = ">", this.newLine = "");
|
|
1251
1256
|
}
|
|
1252
1257
|
y.prototype.build = function(t) {
|
|
1253
|
-
return this.options.preserveOrder ?
|
|
1258
|
+
return this.options.preserveOrder ? Se(t, this.options) : (Array.isArray(t) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t = { [this.options.arrayNodeName]: t }), this.j2x(t, 0).val);
|
|
1254
1259
|
}, y.prototype.j2x = function(t, e) {
|
|
1255
1260
|
let i = "", r = "";
|
|
1256
1261
|
for (let n in t)
|
|
@@ -1288,7 +1293,7 @@ y.prototype.build = function(t) {
|
|
|
1288
1293
|
}, y.prototype.buildAttrPairStr = function(t, e) {
|
|
1289
1294
|
return e = this.options.attributeValueProcessor(t, "" + e), e = this.replaceEntitiesValue(e), this.options.suppressBooleanAttributes && e === "true" ? " " + t : " " + t + '="' + e + '"';
|
|
1290
1295
|
};
|
|
1291
|
-
function
|
|
1296
|
+
function $e(t, e, i) {
|
|
1292
1297
|
const r = this.j2x(t, i + 1);
|
|
1293
1298
|
return t[this.options.textNodeName] !== void 0 && Object.keys(t).length === 1 ? this.buildTextValNode(t[this.options.textNodeName], e, r.attrStr, i) : this.buildObjectNode(r.val, e, r.attrStr, i);
|
|
1294
1299
|
}
|
|
@@ -1321,16 +1326,16 @@ y.prototype.buildObjectNode = function(t, e, i, r) {
|
|
|
1321
1326
|
}
|
|
1322
1327
|
return t;
|
|
1323
1328
|
};
|
|
1324
|
-
function
|
|
1329
|
+
function Ve(t) {
|
|
1325
1330
|
return this.options.indentBy.repeat(t);
|
|
1326
1331
|
}
|
|
1327
|
-
function
|
|
1332
|
+
function ke(t) {
|
|
1328
1333
|
return t.startsWith(this.options.attributeNamePrefix) && t !== this.options.textNodeName ? t.substr(this.attrPrefixLen) : !1;
|
|
1329
1334
|
}
|
|
1330
|
-
var
|
|
1331
|
-
const
|
|
1332
|
-
var H = { XMLParser:
|
|
1333
|
-
function
|
|
1335
|
+
var Le = y;
|
|
1336
|
+
const Re = L, je = Te, Me = Le;
|
|
1337
|
+
var H = { XMLParser: je, XMLValidator: Re, XMLBuilder: Me };
|
|
1338
|
+
function Be(t) {
|
|
1334
1339
|
if (typeof t != "string")
|
|
1335
1340
|
throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
|
|
1336
1341
|
if (t = t.trim(), t.length === 0 || H.XMLValidator.validate(t) !== !0)
|
|
@@ -1344,10 +1349,10 @@ function Me(t) {
|
|
|
1344
1349
|
}
|
|
1345
1350
|
return !(!e || !("svg" in e));
|
|
1346
1351
|
}
|
|
1347
|
-
class
|
|
1352
|
+
class ci {
|
|
1348
1353
|
_view;
|
|
1349
1354
|
constructor(e) {
|
|
1350
|
-
|
|
1355
|
+
qe(e), this._view = e;
|
|
1351
1356
|
}
|
|
1352
1357
|
get id() {
|
|
1353
1358
|
return this._view.id;
|
|
@@ -1407,7 +1412,7 @@ class di {
|
|
|
1407
1412
|
return this._view.defaultSortKey;
|
|
1408
1413
|
}
|
|
1409
1414
|
}
|
|
1410
|
-
const
|
|
1415
|
+
const qe = function(t) {
|
|
1411
1416
|
if (!t.id || typeof t.id != "string")
|
|
1412
1417
|
throw new Error("View id is required and must be a string");
|
|
1413
1418
|
if (!t.name || typeof t.name != "string")
|
|
@@ -1416,12 +1421,12 @@ const Be = function(t) {
|
|
|
1416
1421
|
throw new Error("View caption is required for top-level views and must be a string");
|
|
1417
1422
|
if (!t.getContents || typeof t.getContents != "function")
|
|
1418
1423
|
throw new Error("View getContents is required and must be a function");
|
|
1419
|
-
if (!t.icon || typeof t.icon != "string" || !
|
|
1424
|
+
if (!t.icon || typeof t.icon != "string" || !Be(t.icon))
|
|
1420
1425
|
throw new Error("View icon is required and must be a valid svg string");
|
|
1421
1426
|
if (!("order" in t) || typeof t.order != "number")
|
|
1422
1427
|
throw new Error("View order is required and must be a number");
|
|
1423
1428
|
if (t.columns && t.columns.forEach((e) => {
|
|
1424
|
-
if (!(e instanceof
|
|
1429
|
+
if (!(e instanceof At))
|
|
1425
1430
|
throw new Error("View columns must be an array of Column. Invalid column found");
|
|
1426
1431
|
}), t.emptyView && typeof t.emptyView != "function")
|
|
1427
1432
|
throw new Error("View emptyView must be a function");
|
|
@@ -1434,48 +1439,48 @@ const Be = function(t) {
|
|
|
1434
1439
|
if (t.defaultSortKey && typeof t.defaultSortKey != "string")
|
|
1435
1440
|
throw new Error("View defaultSortKey must be a string");
|
|
1436
1441
|
return !0;
|
|
1437
|
-
},
|
|
1442
|
+
}, hi = function(t) {
|
|
1438
1443
|
return F().registerEntry(t);
|
|
1439
|
-
},
|
|
1444
|
+
}, pi = function(t) {
|
|
1440
1445
|
return F().unregisterEntry(t);
|
|
1441
|
-
},
|
|
1446
|
+
}, fi = function(t) {
|
|
1442
1447
|
return F().getEntries(t);
|
|
1443
1448
|
};
|
|
1444
1449
|
export {
|
|
1445
|
-
|
|
1450
|
+
At as Column,
|
|
1446
1451
|
K as DefaultType,
|
|
1447
|
-
|
|
1448
|
-
|
|
1452
|
+
bt as File,
|
|
1453
|
+
Qe as FileAction,
|
|
1449
1454
|
k as FileType,
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1455
|
+
Et as Folder,
|
|
1456
|
+
ii as Header,
|
|
1457
|
+
_t as Navigation,
|
|
1453
1458
|
Q as Node,
|
|
1454
1459
|
J as NodeStatus,
|
|
1455
1460
|
v as Permission,
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1461
|
+
ci as View,
|
|
1462
|
+
hi as addNewFileMenuEntry,
|
|
1463
|
+
li as davGetClient,
|
|
1464
|
+
oi as davGetDefaultPropfind,
|
|
1465
|
+
yt as davGetFavoritesReport,
|
|
1466
|
+
ai as davGetRecentSearch,
|
|
1467
|
+
xt as davParsePermissions,
|
|
1463
1468
|
et as davRemoteURL,
|
|
1464
|
-
|
|
1469
|
+
Nt as davResultToNode,
|
|
1465
1470
|
tt as davRootPath,
|
|
1466
1471
|
Y as defaultDavNamespaces,
|
|
1467
1472
|
W as defaultDavProperties,
|
|
1468
|
-
|
|
1473
|
+
Ze as formatFileSize,
|
|
1469
1474
|
V as getDavNameSpaces,
|
|
1470
1475
|
$ as getDavProperties,
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1476
|
+
di as getFavoriteNodes,
|
|
1477
|
+
ei as getFileActions,
|
|
1478
|
+
ri as getFileListHeaders,
|
|
1479
|
+
ui as getNavigation,
|
|
1480
|
+
fi as getNewFileMenuEntries,
|
|
1481
|
+
Je as parseFileSize,
|
|
1482
|
+
si as registerDavProperty,
|
|
1483
|
+
ti as registerFileAction,
|
|
1484
|
+
ni as registerFileListHeaders,
|
|
1485
|
+
pi as removeNewFileMenuEntry
|
|
1481
1486
|
};
|