@nextcloud/files 3.1.1 → 3.2.0
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/dav/dav.d.ts +2 -1
- package/dist/index.cjs +191 -177
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +195 -180
- package/dist/index.mjs.map +1 -1
- package/dist/vendor.LICENSE.txt +1 -1
- package/package.json +9 -8
package/dist/index.mjs
CHANGED
|
@@ -5,6 +5,7 @@ import { join as le, basename as fe, extname as ce, dirname as I } from "path";
|
|
|
5
5
|
import { encodePath as he } from "@nextcloud/paths";
|
|
6
6
|
import { generateRemoteUrl as pe } from "@nextcloud/router";
|
|
7
7
|
import { createClient as ge, getPatcher as we } from "webdav";
|
|
8
|
+
import { CancelablePromise as me } from "cancelable-promise";
|
|
8
9
|
/**
|
|
9
10
|
* @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
|
|
10
11
|
*
|
|
@@ -26,7 +27,7 @@ import { createClient as ge, getPatcher as we } from "webdav";
|
|
|
26
27
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
27
28
|
*
|
|
28
29
|
*/
|
|
29
|
-
const
|
|
30
|
+
const Ne = (e) => e === null ? B().setApp("files").build() : B().setApp("files").setUid(e.uid).build(), m = Ne(A());
|
|
30
31
|
/**
|
|
31
32
|
* @copyright Copyright (c) 2021 John Molakvoæ <skjnldsv@protonmail.com>
|
|
32
33
|
*
|
|
@@ -48,7 +49,7 @@ const me = (e) => e === null ? B().setApp("files").build() : B().setApp("files")
|
|
|
48
49
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
49
50
|
*
|
|
50
51
|
*/
|
|
51
|
-
class
|
|
52
|
+
class Ee {
|
|
52
53
|
_entries = [];
|
|
53
54
|
registerEntry(t) {
|
|
54
55
|
this.validateEntry(t), this._entries.push(t);
|
|
@@ -90,7 +91,7 @@ class Ne {
|
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
const F = function() {
|
|
93
|
-
return typeof window._nc_newfilemenu > "u" && (window._nc_newfilemenu = new
|
|
94
|
+
return typeof window._nc_newfilemenu > "u" && (window._nc_newfilemenu = new Ee(), m.debug("NewFileMenu initialized")), window._nc_newfilemenu;
|
|
94
95
|
};
|
|
95
96
|
/**
|
|
96
97
|
* @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
|
|
@@ -114,16 +115,16 @@ const F = function() {
|
|
|
114
115
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
115
116
|
*
|
|
116
117
|
*/
|
|
117
|
-
const
|
|
118
|
-
function
|
|
118
|
+
const O = ["B", "KB", "MB", "GB", "TB", "PB"], P = ["B", "KiB", "MiB", "GiB", "TiB", "PiB"];
|
|
119
|
+
function Qt(e, t = !1, r = !1, s = !1) {
|
|
119
120
|
r = r && !s, typeof e == "string" && (e = Number(e));
|
|
120
121
|
let n = e > 0 ? Math.floor(Math.log(e) / Math.log(s ? 1e3 : 1024)) : 0;
|
|
121
|
-
n = Math.min((r ? P.length :
|
|
122
|
-
const i = r ? P[n] :
|
|
122
|
+
n = Math.min((r ? P.length : O.length) - 1, n);
|
|
123
|
+
const i = r ? P[n] : O[n];
|
|
123
124
|
let d = (e / Math.pow(s ? 1e3 : 1024, n)).toFixed(1);
|
|
124
|
-
return t === !0 && n === 0 ? (d !== "0.0" ? "< 1 " : "0 ") + (r ? P[1] :
|
|
125
|
+
return t === !0 && n === 0 ? (d !== "0.0" ? "< 1 " : "0 ") + (r ? P[1] : O[1]) : (n < 2 ? d = parseFloat(d).toFixed(0) : d = parseFloat(d).toLocaleString(ae()), d + " " + i);
|
|
125
126
|
}
|
|
126
|
-
function
|
|
127
|
+
function Dt(e, t = !1) {
|
|
127
128
|
try {
|
|
128
129
|
e = `${e}`.toLocaleLowerCase().replaceAll(/\s+/g, "").replaceAll(",", ".");
|
|
129
130
|
} catch {
|
|
@@ -165,7 +166,7 @@ function Jt(e, t = !1) {
|
|
|
165
166
|
*
|
|
166
167
|
*/
|
|
167
168
|
var W = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.HIDDEN = "hidden", e))(W || {});
|
|
168
|
-
class
|
|
169
|
+
class er {
|
|
169
170
|
_action;
|
|
170
171
|
constructor(t) {
|
|
171
172
|
this.validateAction(t), this._action = t;
|
|
@@ -233,13 +234,13 @@ class Qt {
|
|
|
233
234
|
throw new Error("Invalid renderInline function");
|
|
234
235
|
}
|
|
235
236
|
}
|
|
236
|
-
const
|
|
237
|
+
const tr = function(e) {
|
|
237
238
|
if (typeof window._nc_fileactions > "u" && (window._nc_fileactions = [], m.debug("FileActions initialized")), window._nc_fileactions.find((t) => t.id === e.id)) {
|
|
238
239
|
m.error(`FileAction ${e.id} already registered`, { action: e });
|
|
239
240
|
return;
|
|
240
241
|
}
|
|
241
242
|
window._nc_fileactions.push(e);
|
|
242
|
-
},
|
|
243
|
+
}, rr = function() {
|
|
243
244
|
return typeof window._nc_fileactions > "u" && (window._nc_fileactions = [], m.debug("FileActions initialized")), window._nc_fileactions;
|
|
244
245
|
};
|
|
245
246
|
/**
|
|
@@ -263,7 +264,7 @@ const Dt = function(e) {
|
|
|
263
264
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
264
265
|
*
|
|
265
266
|
*/
|
|
266
|
-
class
|
|
267
|
+
class nr {
|
|
267
268
|
_header;
|
|
268
269
|
constructor(t) {
|
|
269
270
|
this.validateHeader(t), this._header = t;
|
|
@@ -296,13 +297,13 @@ class tr {
|
|
|
296
297
|
throw new Error("Invalid updated property");
|
|
297
298
|
}
|
|
298
299
|
}
|
|
299
|
-
const
|
|
300
|
+
const ir = function(e) {
|
|
300
301
|
if (typeof window._nc_filelistheader > "u" && (window._nc_filelistheader = [], m.debug("FileListHeaders initialized")), window._nc_filelistheader.find((t) => t.id === e.id)) {
|
|
301
302
|
m.error(`Header ${e.id} already registered`, { header: e });
|
|
302
303
|
return;
|
|
303
304
|
}
|
|
304
305
|
window._nc_filelistheader.push(e);
|
|
305
|
-
},
|
|
306
|
+
}, sr = function() {
|
|
306
307
|
return typeof window._nc_filelistheader > "u" && (window._nc_filelistheader = [], m.debug("FileListHeaders initialized")), window._nc_filelistheader;
|
|
307
308
|
};
|
|
308
309
|
/**
|
|
@@ -371,7 +372,7 @@ const Z = [
|
|
|
371
372
|
nc: "http://nextcloud.org/ns",
|
|
372
373
|
oc: "http://owncloud.org/ns",
|
|
373
374
|
ocs: "http://open-collaboration-services.org/ns"
|
|
374
|
-
},
|
|
375
|
+
}, or = function(e, t = { nc: "http://nextcloud.org/ns" }) {
|
|
375
376
|
typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...Z], window._nc_dav_namespaces = { ...j });
|
|
376
377
|
const r = { ...window._nc_dav_namespaces, ...t };
|
|
377
378
|
if (window._nc_dav_properties.find((n) => n === e))
|
|
@@ -382,18 +383,18 @@ const Z = [
|
|
|
382
383
|
return r[s] ? (window._nc_dav_properties.push(e), window._nc_dav_namespaces = r, !0) : (m.error(`${e} namespace unknown`, { prop: e, namespaces: r }), !1);
|
|
383
384
|
}, V = function() {
|
|
384
385
|
return typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...Z]), window._nc_dav_properties.map((e) => `<${e} />`).join(" ");
|
|
385
|
-
},
|
|
386
|
+
}, S = function() {
|
|
386
387
|
return typeof window._nc_dav_namespaces > "u" && (window._nc_dav_namespaces = { ...j }), Object.keys(window._nc_dav_namespaces).map((e) => `xmlns:${e}="${window._nc_dav_namespaces?.[e]}"`).join(" ");
|
|
387
|
-
},
|
|
388
|
+
}, ur = function() {
|
|
388
389
|
return `<?xml version="1.0"?>
|
|
389
|
-
<d:propfind ${
|
|
390
|
+
<d:propfind ${S()}>
|
|
390
391
|
<d:prop>
|
|
391
392
|
${V()}
|
|
392
393
|
</d:prop>
|
|
393
394
|
</d:propfind>`;
|
|
394
|
-
},
|
|
395
|
+
}, be = function() {
|
|
395
396
|
return `<?xml version="1.0"?>
|
|
396
|
-
<oc:filter-files ${
|
|
397
|
+
<oc:filter-files ${S()}>
|
|
397
398
|
<d:prop>
|
|
398
399
|
${V()}
|
|
399
400
|
</d:prop>
|
|
@@ -401,9 +402,9 @@ const Z = [
|
|
|
401
402
|
<oc:favorite>1</oc:favorite>
|
|
402
403
|
</oc:filter-rules>
|
|
403
404
|
</oc:filter-files>`;
|
|
404
|
-
},
|
|
405
|
+
}, dr = function(e) {
|
|
405
406
|
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
406
|
-
<d:searchrequest ${
|
|
407
|
+
<d:searchrequest ${S()}
|
|
407
408
|
xmlns:ns="https://github.com/icewind1991/SearchDAV/ns">
|
|
408
409
|
<d:basicsearch>
|
|
409
410
|
<d:select>
|
|
@@ -480,7 +481,7 @@ const Z = [
|
|
|
480
481
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
481
482
|
*
|
|
482
483
|
*/
|
|
483
|
-
const
|
|
484
|
+
const ye = function(e = "") {
|
|
484
485
|
let t = N.NONE;
|
|
485
486
|
return e && ((e.includes("C") || e.includes("K")) && (t |= N.CREATE), e.includes("G") && (t |= N.READ), (e.includes("W") || e.includes("N") || e.includes("V")) && (t |= N.UPDATE), e.includes("D") && (t |= N.DELETE), e.includes("R") && (t |= N.SHARE)), t;
|
|
486
487
|
};
|
|
@@ -505,7 +506,7 @@ const be = function(e = "") {
|
|
|
505
506
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
506
507
|
*
|
|
507
508
|
*/
|
|
508
|
-
var
|
|
509
|
+
var L = /* @__PURE__ */ ((e) => (e.Folder = "folder", e.File = "file", e))(L || {});
|
|
509
510
|
/**
|
|
510
511
|
* @copyright Copyright (c) 2022 John Molakvoæ <skjnldsv@protonmail.com>
|
|
511
512
|
*
|
|
@@ -777,9 +778,9 @@ class Q {
|
|
|
777
778
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
778
779
|
*
|
|
779
780
|
*/
|
|
780
|
-
class
|
|
781
|
+
class _e extends Q {
|
|
781
782
|
get type() {
|
|
782
|
-
return
|
|
783
|
+
return L.File;
|
|
783
784
|
}
|
|
784
785
|
}
|
|
785
786
|
/**
|
|
@@ -803,7 +804,7 @@ class ye extends Q {
|
|
|
803
804
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
804
805
|
*
|
|
805
806
|
*/
|
|
806
|
-
class
|
|
807
|
+
class ve extends Q {
|
|
807
808
|
constructor(t) {
|
|
808
809
|
super({
|
|
809
810
|
...t,
|
|
@@ -811,7 +812,7 @@ class _e extends Q {
|
|
|
811
812
|
});
|
|
812
813
|
}
|
|
813
814
|
get type() {
|
|
814
|
-
return
|
|
815
|
+
return L.Folder;
|
|
815
816
|
}
|
|
816
817
|
get extension() {
|
|
817
818
|
return null;
|
|
@@ -842,7 +843,7 @@ class _e extends Q {
|
|
|
842
843
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
843
844
|
*
|
|
844
845
|
*/
|
|
845
|
-
const D = `/files/${A()?.uid}`, ee = pe("dav"),
|
|
846
|
+
const D = `/files/${A()?.uid}`, ee = pe("dav"), ar = function(e = ee, t = {}) {
|
|
846
847
|
const r = ge(e, { headers: t });
|
|
847
848
|
function s(i) {
|
|
848
849
|
r.setHeaders({
|
|
@@ -857,19 +858,31 @@ const D = `/files/${A()?.uid}`, ee = pe("dav"), ur = function(e = ee, t = {}) {
|
|
|
857
858
|
const u = d.headers;
|
|
858
859
|
return u?.method && (d.method = u.method, delete u.method), fetch(i, d);
|
|
859
860
|
}), r;
|
|
860
|
-
},
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
861
|
+
}, lr = (e, t = "/", r = D) => {
|
|
862
|
+
const s = new AbortController();
|
|
863
|
+
return new me(async (n, i, d) => {
|
|
864
|
+
d(() => s.abort());
|
|
865
|
+
try {
|
|
866
|
+
const o = (await e.getDirectoryContents(`${r}${t}`, {
|
|
867
|
+
signal: s.signal,
|
|
868
|
+
details: !0,
|
|
869
|
+
data: be(),
|
|
870
|
+
headers: {
|
|
871
|
+
// see davGetClient for patched webdav client
|
|
872
|
+
method: "REPORT"
|
|
873
|
+
},
|
|
874
|
+
includeSelf: !0
|
|
875
|
+
})).data.filter((a) => a.filename !== t).map((a) => Te(a, r));
|
|
876
|
+
n(o);
|
|
877
|
+
} catch (u) {
|
|
878
|
+
i(u);
|
|
879
|
+
}
|
|
880
|
+
});
|
|
881
|
+
}, Te = function(e, t = D, r = ee) {
|
|
869
882
|
const s = A()?.uid;
|
|
870
883
|
if (!s)
|
|
871
884
|
throw new Error("No user id found");
|
|
872
|
-
const n = e.props, i =
|
|
885
|
+
const n = e.props, i = ye(n?.permissions), d = (n?.["owner-id"] || s).toString(), u = {
|
|
873
886
|
id: n?.fileid || 0,
|
|
874
887
|
source: `${r}${e.filename}`,
|
|
875
888
|
mtime: new Date(Date.parse(e.lastmod)),
|
|
@@ -884,7 +897,7 @@ const D = `/files/${A()?.uid}`, ee = pe("dav"), ur = function(e = ee, t = {}) {
|
|
|
884
897
|
hasPreview: n?.["has-preview"]
|
|
885
898
|
}
|
|
886
899
|
};
|
|
887
|
-
return delete u.attributes?.props, e.type === "file" ? new
|
|
900
|
+
return delete u.attributes?.props, e.type === "file" ? new _e(u) : new ve(u);
|
|
888
901
|
};
|
|
889
902
|
/**
|
|
890
903
|
* @copyright Copyright (c) 2022 John Molakvoæ <skjnldsv@protonmail.com>
|
|
@@ -907,7 +920,7 @@ const D = `/files/${A()?.uid}`, ee = pe("dav"), ur = function(e = ee, t = {}) {
|
|
|
907
920
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
908
921
|
*
|
|
909
922
|
*/
|
|
910
|
-
class
|
|
923
|
+
class Ie {
|
|
911
924
|
_views = [];
|
|
912
925
|
_currentView = null;
|
|
913
926
|
register(t) {
|
|
@@ -929,8 +942,8 @@ class Te {
|
|
|
929
942
|
return this._currentView;
|
|
930
943
|
}
|
|
931
944
|
}
|
|
932
|
-
const
|
|
933
|
-
return typeof window._nc_navigation > "u" && (window._nc_navigation = new
|
|
945
|
+
const fr = function() {
|
|
946
|
+
return typeof window._nc_navigation > "u" && (window._nc_navigation = new Ie(), m.debug("Navigation service initialized")), window._nc_navigation;
|
|
934
947
|
};
|
|
935
948
|
/**
|
|
936
949
|
* @copyright Copyright (c) 2022 John Molakvoæ <skjnldsv@protonmail.com>
|
|
@@ -953,10 +966,10 @@ const ar = function() {
|
|
|
953
966
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
954
967
|
*
|
|
955
968
|
*/
|
|
956
|
-
class
|
|
969
|
+
class Ae {
|
|
957
970
|
_column;
|
|
958
971
|
constructor(t) {
|
|
959
|
-
|
|
972
|
+
Ce(t), this._column = t;
|
|
960
973
|
}
|
|
961
974
|
get id() {
|
|
962
975
|
return this._column.id;
|
|
@@ -974,7 +987,7 @@ class Ie {
|
|
|
974
987
|
return this._column.summary;
|
|
975
988
|
}
|
|
976
989
|
}
|
|
977
|
-
const
|
|
990
|
+
const Ce = function(e) {
|
|
978
991
|
if (!e.id || typeof e.id != "string")
|
|
979
992
|
throw new Error("A column id is required");
|
|
980
993
|
if (!e.title || typeof e.title != "string")
|
|
@@ -987,7 +1000,7 @@ const Ae = function(e) {
|
|
|
987
1000
|
throw new Error("Column summary must be a function");
|
|
988
1001
|
return !0;
|
|
989
1002
|
};
|
|
990
|
-
var R = {},
|
|
1003
|
+
var R = {}, C = {};
|
|
991
1004
|
(function(e) {
|
|
992
1005
|
const t = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", r = t + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040", s = "[" + t + "][" + r + "]*", n = new RegExp("^" + s + "$"), i = function(u, o) {
|
|
993
1006
|
const a = [];
|
|
@@ -1018,8 +1031,8 @@ var R = {}, O = {};
|
|
|
1018
1031
|
}, e.getValue = function(u) {
|
|
1019
1032
|
return e.isExist(u) ? u : "";
|
|
1020
1033
|
}, e.isName = d, e.getAllMatches = i, e.nameRegexp = s;
|
|
1021
|
-
})(
|
|
1022
|
-
const M =
|
|
1034
|
+
})(C);
|
|
1035
|
+
const M = C, Oe = {
|
|
1023
1036
|
allowBooleanAttributes: !1,
|
|
1024
1037
|
//A tag can have attributes without any value
|
|
1025
1038
|
unpairedTags: []
|
|
@@ -1045,11 +1058,11 @@ R.validate = function(e, t) {
|
|
|
1045
1058
|
for (; i < e.length && e[i] !== ">" && e[i] !== " " && e[i] !== " " && e[i] !== `
|
|
1046
1059
|
` && e[i] !== "\r"; i++)
|
|
1047
1060
|
o += e[i];
|
|
1048
|
-
if (o = o.trim(), o[o.length - 1] === "/" && (o = o.substring(0, o.length - 1), i--), !
|
|
1061
|
+
if (o = o.trim(), o[o.length - 1] === "/" && (o = o.substring(0, o.length - 1), i--), !Re(o)) {
|
|
1049
1062
|
let f;
|
|
1050
1063
|
return o.trim().length === 0 ? f = "Invalid space after '<'." : f = "Tag '" + o + "' is an invalid name.", p("InvalidTag", f, w(e, i));
|
|
1051
1064
|
}
|
|
1052
|
-
const a =
|
|
1065
|
+
const a = $e(e, i);
|
|
1053
1066
|
if (a === !1)
|
|
1054
1067
|
return p("InvalidAttr", "Attributes for '" + o + "' have open quote.", w(e, i));
|
|
1055
1068
|
let l = a.value;
|
|
@@ -1098,7 +1111,7 @@ R.validate = function(e, t) {
|
|
|
1098
1111
|
} else
|
|
1099
1112
|
break;
|
|
1100
1113
|
else if (e[i] === "&") {
|
|
1101
|
-
const f =
|
|
1114
|
+
const f = Se(e, i);
|
|
1102
1115
|
if (f == -1)
|
|
1103
1116
|
return p("InvalidChar", "char '&' is not expected.", w(e, i));
|
|
1104
1117
|
i = f;
|
|
@@ -1162,11 +1175,11 @@ function G(e, t) {
|
|
|
1162
1175
|
}
|
|
1163
1176
|
return t;
|
|
1164
1177
|
}
|
|
1165
|
-
const
|
|
1166
|
-
function
|
|
1178
|
+
const Pe = '"', xe = "'";
|
|
1179
|
+
function $e(e, t) {
|
|
1167
1180
|
let r = "", s = "", n = !1;
|
|
1168
1181
|
for (; t < e.length; t++) {
|
|
1169
|
-
if (e[t] ===
|
|
1182
|
+
if (e[t] === Pe || e[t] === xe)
|
|
1170
1183
|
s === "" ? s = e[t] : s !== e[t] || (s = "");
|
|
1171
1184
|
else if (e[t] === ">" && s === "") {
|
|
1172
1185
|
n = !0;
|
|
@@ -1180,9 +1193,9 @@ function xe(e, t) {
|
|
|
1180
1193
|
tagClosed: n
|
|
1181
1194
|
};
|
|
1182
1195
|
}
|
|
1183
|
-
const
|
|
1196
|
+
const Fe = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
|
|
1184
1197
|
function z(e, t) {
|
|
1185
|
-
const r = M.getAllMatches(e,
|
|
1198
|
+
const r = M.getAllMatches(e, Fe), s = {};
|
|
1186
1199
|
for (let n = 0; n < r.length; n++) {
|
|
1187
1200
|
if (r[n][1].length === 0)
|
|
1188
1201
|
return p("InvalidAttr", "Attribute '" + r[n][2] + "' has no space in starting.", v(r[n]));
|
|
@@ -1200,7 +1213,7 @@ function z(e, t) {
|
|
|
1200
1213
|
}
|
|
1201
1214
|
return !0;
|
|
1202
1215
|
}
|
|
1203
|
-
function
|
|
1216
|
+
function Ve(e, t) {
|
|
1204
1217
|
let r = /\d/;
|
|
1205
1218
|
for (e[t] === "x" && (t++, r = /[\da-fA-F]/); t < e.length; t++) {
|
|
1206
1219
|
if (e[t] === ";")
|
|
@@ -1210,11 +1223,11 @@ function Fe(e, t) {
|
|
|
1210
1223
|
}
|
|
1211
1224
|
return -1;
|
|
1212
1225
|
}
|
|
1213
|
-
function
|
|
1226
|
+
function Se(e, t) {
|
|
1214
1227
|
if (t++, e[t] === ";")
|
|
1215
1228
|
return -1;
|
|
1216
1229
|
if (e[t] === "#")
|
|
1217
|
-
return t++,
|
|
1230
|
+
return t++, Ve(e, t);
|
|
1218
1231
|
let r = 0;
|
|
1219
1232
|
for (; t < e.length; t++, r++)
|
|
1220
1233
|
if (!(e[t].match(/\w/) && r < 20)) {
|
|
@@ -1237,7 +1250,7 @@ function p(e, t, r) {
|
|
|
1237
1250
|
function Le(e) {
|
|
1238
1251
|
return M.isName(e);
|
|
1239
1252
|
}
|
|
1240
|
-
function
|
|
1253
|
+
function Re(e) {
|
|
1241
1254
|
return M.isName(e);
|
|
1242
1255
|
}
|
|
1243
1256
|
function w(e, t) {
|
|
@@ -1295,12 +1308,12 @@ const te = {
|
|
|
1295
1308
|
return e;
|
|
1296
1309
|
}
|
|
1297
1310
|
// skipEmptyListItem: false
|
|
1298
|
-
},
|
|
1311
|
+
}, Me = function(e) {
|
|
1299
1312
|
return Object.assign({}, te, e);
|
|
1300
1313
|
};
|
|
1301
|
-
k.buildOptions =
|
|
1314
|
+
k.buildOptions = Me;
|
|
1302
1315
|
k.defaultOptions = te;
|
|
1303
|
-
class
|
|
1316
|
+
class ke {
|
|
1304
1317
|
constructor(t) {
|
|
1305
1318
|
this.tagname = t, this.child = [], this[":@"] = {};
|
|
1306
1319
|
}
|
|
@@ -1311,27 +1324,27 @@ class Me {
|
|
|
1311
1324
|
t.tagname === "__proto__" && (t.tagname = "#__proto__"), t[":@"] && Object.keys(t[":@"]).length > 0 ? this.child.push({ [t.tagname]: t.child, ":@": t[":@"] }) : this.child.push({ [t.tagname]: t.child });
|
|
1312
1325
|
}
|
|
1313
1326
|
}
|
|
1314
|
-
var
|
|
1315
|
-
const
|
|
1316
|
-
function
|
|
1327
|
+
var Be = ke;
|
|
1328
|
+
const qe = C;
|
|
1329
|
+
function Xe(e, t) {
|
|
1317
1330
|
const r = {};
|
|
1318
1331
|
if (e[t + 3] === "O" && e[t + 4] === "C" && e[t + 5] === "T" && e[t + 6] === "Y" && e[t + 7] === "P" && e[t + 8] === "E") {
|
|
1319
1332
|
t = t + 9;
|
|
1320
1333
|
let s = 1, n = !1, i = !1, d = "";
|
|
1321
1334
|
for (; t < e.length; t++)
|
|
1322
1335
|
if (e[t] === "<" && !i) {
|
|
1323
|
-
if (n &&
|
|
1324
|
-
t += 7, [entityName, val, t] =
|
|
1336
|
+
if (n && ze(e, t))
|
|
1337
|
+
t += 7, [entityName, val, t] = Ue(e, t + 1), val.indexOf("&") === -1 && (r[Ze(entityName)] = {
|
|
1325
1338
|
regx: RegExp(`&${entityName};`, "g"),
|
|
1326
1339
|
val
|
|
1327
1340
|
});
|
|
1328
|
-
else if (n && ze(e, t))
|
|
1329
|
-
t += 8;
|
|
1330
1341
|
else if (n && He(e, t))
|
|
1331
1342
|
t += 8;
|
|
1332
1343
|
else if (n && Ke(e, t))
|
|
1344
|
+
t += 8;
|
|
1345
|
+
else if (n && We(e, t))
|
|
1333
1346
|
t += 9;
|
|
1334
|
-
else if (
|
|
1347
|
+
else if (Ge)
|
|
1335
1348
|
i = !0;
|
|
1336
1349
|
else
|
|
1337
1350
|
throw new Error("Invalid DOCTYPE");
|
|
@@ -1347,7 +1360,7 @@ function qe(e, t) {
|
|
|
1347
1360
|
throw new Error("Invalid Tag instead of DOCTYPE");
|
|
1348
1361
|
return { entities: r, i: t };
|
|
1349
1362
|
}
|
|
1350
|
-
function
|
|
1363
|
+
function Ue(e, t) {
|
|
1351
1364
|
let r = "";
|
|
1352
1365
|
for (; t < e.length && e[t] !== "'" && e[t] !== '"'; t++)
|
|
1353
1366
|
r += e[t];
|
|
@@ -1359,50 +1372,50 @@ function Xe(e, t) {
|
|
|
1359
1372
|
n += e[t];
|
|
1360
1373
|
return [r, n, t];
|
|
1361
1374
|
}
|
|
1362
|
-
function
|
|
1375
|
+
function Ge(e, t) {
|
|
1363
1376
|
return e[t + 1] === "!" && e[t + 2] === "-" && e[t + 3] === "-";
|
|
1364
1377
|
}
|
|
1365
|
-
function
|
|
1378
|
+
function ze(e, t) {
|
|
1366
1379
|
return e[t + 1] === "!" && e[t + 2] === "E" && e[t + 3] === "N" && e[t + 4] === "T" && e[t + 5] === "I" && e[t + 6] === "T" && e[t + 7] === "Y";
|
|
1367
1380
|
}
|
|
1368
|
-
function
|
|
1381
|
+
function He(e, t) {
|
|
1369
1382
|
return e[t + 1] === "!" && e[t + 2] === "E" && e[t + 3] === "L" && e[t + 4] === "E" && e[t + 5] === "M" && e[t + 6] === "E" && e[t + 7] === "N" && e[t + 8] === "T";
|
|
1370
1383
|
}
|
|
1371
|
-
function
|
|
1384
|
+
function Ke(e, t) {
|
|
1372
1385
|
return e[t + 1] === "!" && e[t + 2] === "A" && e[t + 3] === "T" && e[t + 4] === "T" && e[t + 5] === "L" && e[t + 6] === "I" && e[t + 7] === "S" && e[t + 8] === "T";
|
|
1373
1386
|
}
|
|
1374
|
-
function
|
|
1387
|
+
function We(e, t) {
|
|
1375
1388
|
return e[t + 1] === "!" && e[t + 2] === "N" && e[t + 3] === "O" && e[t + 4] === "T" && e[t + 5] === "A" && e[t + 6] === "T" && e[t + 7] === "I" && e[t + 8] === "O" && e[t + 9] === "N";
|
|
1376
1389
|
}
|
|
1377
|
-
function
|
|
1378
|
-
if (
|
|
1390
|
+
function Ze(e) {
|
|
1391
|
+
if (qe.isName(e))
|
|
1379
1392
|
return e;
|
|
1380
1393
|
throw new Error(`Invalid entity name ${e}`);
|
|
1381
1394
|
}
|
|
1382
|
-
var
|
|
1383
|
-
const
|
|
1395
|
+
var je = Xe;
|
|
1396
|
+
const Ye = /^[-+]?0x[a-fA-F0-9]+$/, Je = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;
|
|
1384
1397
|
!Number.parseInt && window.parseInt && (Number.parseInt = window.parseInt);
|
|
1385
1398
|
!Number.parseFloat && window.parseFloat && (Number.parseFloat = window.parseFloat);
|
|
1386
|
-
const
|
|
1399
|
+
const Qe = {
|
|
1387
1400
|
hex: !0,
|
|
1388
1401
|
leadingZeros: !0,
|
|
1389
1402
|
decimalPoint: ".",
|
|
1390
1403
|
eNotation: !0
|
|
1391
1404
|
//skipLike: /regex/
|
|
1392
1405
|
};
|
|
1393
|
-
function
|
|
1394
|
-
if (t = Object.assign({},
|
|
1406
|
+
function De(e, t = {}) {
|
|
1407
|
+
if (t = Object.assign({}, Qe, t), !e || typeof e != "string")
|
|
1395
1408
|
return e;
|
|
1396
1409
|
let r = e.trim();
|
|
1397
1410
|
if (t.skipLike !== void 0 && t.skipLike.test(r))
|
|
1398
1411
|
return e;
|
|
1399
|
-
if (t.hex &&
|
|
1412
|
+
if (t.hex && Ye.test(r))
|
|
1400
1413
|
return Number.parseInt(r, 16);
|
|
1401
1414
|
{
|
|
1402
|
-
const s =
|
|
1415
|
+
const s = Je.exec(r);
|
|
1403
1416
|
if (s) {
|
|
1404
1417
|
const n = s[1], i = s[2];
|
|
1405
|
-
let d =
|
|
1418
|
+
let d = et(s[3]);
|
|
1406
1419
|
const u = s[4] || s[6];
|
|
1407
1420
|
if (!t.leadingZeros && i.length > 0 && n && r[2] !== ".")
|
|
1408
1421
|
return e;
|
|
@@ -1416,12 +1429,12 @@ function Qe(e, t = {}) {
|
|
|
1416
1429
|
return e;
|
|
1417
1430
|
}
|
|
1418
1431
|
}
|
|
1419
|
-
function
|
|
1432
|
+
function et(e) {
|
|
1420
1433
|
return e && e.indexOf(".") !== -1 && (e = e.replace(/0+$/, ""), e === "." ? e = "0" : e[0] === "." ? e = "0" + e : e[e.length - 1] === "." && (e = e.substr(0, e.length - 1))), e;
|
|
1421
1434
|
}
|
|
1422
|
-
var
|
|
1423
|
-
const re =
|
|
1424
|
-
let
|
|
1435
|
+
var tt = De;
|
|
1436
|
+
const re = C, T = Be, rt = je, nt = tt;
|
|
1437
|
+
let it = class {
|
|
1425
1438
|
constructor(t) {
|
|
1426
1439
|
this.options = t, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = {
|
|
1427
1440
|
apos: { regex: /&(apos|#39|#x27);/g, val: "'" },
|
|
@@ -1441,11 +1454,13 @@ let nt = class {
|
|
|
1441
1454
|
euro: { regex: /&(euro|#8364);/g, val: "€" },
|
|
1442
1455
|
copyright: { regex: /&(copy|#169);/g, val: "©" },
|
|
1443
1456
|
reg: { regex: /&(reg|#174);/g, val: "®" },
|
|
1444
|
-
inr: { regex: /&(inr|#8377);/g, val: "₹" }
|
|
1445
|
-
|
|
1457
|
+
inr: { regex: /&(inr|#8377);/g, val: "₹" },
|
|
1458
|
+
num_dec: { regex: /&#([0-9]{1,7});/g, val: (r, s) => String.fromCharCode(Number.parseInt(s, 10)) },
|
|
1459
|
+
num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (r, s) => String.fromCharCode(Number.parseInt(s, 16)) }
|
|
1460
|
+
}, this.addExternalEntities = st, this.parseXml = lt, this.parseTextData = ot, this.resolveNameSpace = ut, this.buildAttributesMap = at, this.isItStopNode = pt, this.replaceEntitiesValue = ct, this.readStopNodeData = wt, this.saveTextToParentTag = ht, this.addChild = ft;
|
|
1446
1461
|
}
|
|
1447
1462
|
};
|
|
1448
|
-
function
|
|
1463
|
+
function st(e) {
|
|
1449
1464
|
const t = Object.keys(e);
|
|
1450
1465
|
for (let r = 0; r < t.length; r++) {
|
|
1451
1466
|
const s = t[r];
|
|
@@ -1455,14 +1470,14 @@ function it(e) {
|
|
|
1455
1470
|
};
|
|
1456
1471
|
}
|
|
1457
1472
|
}
|
|
1458
|
-
function
|
|
1473
|
+
function ot(e, t, r, s, n, i, d) {
|
|
1459
1474
|
if (e !== void 0 && (this.options.trimValues && !s && (e = e.trim()), e.length > 0)) {
|
|
1460
1475
|
d || (e = this.replaceEntitiesValue(e));
|
|
1461
1476
|
const u = this.options.tagValueProcessor(t, e, r, n, i);
|
|
1462
1477
|
return u == null ? e : typeof u != typeof e || u !== e ? u : this.options.trimValues ? $(e, this.options.parseTagValue, this.options.numberParseOptions) : e.trim() === e ? $(e, this.options.parseTagValue, this.options.numberParseOptions) : e;
|
|
1463
1478
|
}
|
|
1464
1479
|
}
|
|
1465
|
-
function
|
|
1480
|
+
function ut(e) {
|
|
1466
1481
|
if (this.options.removeNSPrefix) {
|
|
1467
1482
|
const t = e.split(":"), r = e.charAt(0) === "/" ? "/" : "";
|
|
1468
1483
|
if (t[0] === "xmlns")
|
|
@@ -1471,10 +1486,10 @@ function ot(e) {
|
|
|
1471
1486
|
}
|
|
1472
1487
|
return e;
|
|
1473
1488
|
}
|
|
1474
|
-
const
|
|
1475
|
-
function
|
|
1489
|
+
const dt = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
|
|
1490
|
+
function at(e, t, r) {
|
|
1476
1491
|
if (!this.options.ignoreAttributes && typeof e == "string") {
|
|
1477
|
-
const s = re.getAllMatches(e,
|
|
1492
|
+
const s = re.getAllMatches(e, dt), n = s.length, i = {};
|
|
1478
1493
|
for (let d = 0; d < n; d++) {
|
|
1479
1494
|
const u = this.resolveNameSpace(s[d][1]);
|
|
1480
1495
|
let o = s[d][4], a = this.options.attributeNamePrefix + u;
|
|
@@ -1499,7 +1514,7 @@ function dt(e, t, r) {
|
|
|
1499
1514
|
return i;
|
|
1500
1515
|
}
|
|
1501
1516
|
}
|
|
1502
|
-
const
|
|
1517
|
+
const lt = function(e) {
|
|
1503
1518
|
e = e.replace(/\r\n?/g, `
|
|
1504
1519
|
`);
|
|
1505
1520
|
const t = new T("!xml");
|
|
@@ -1536,7 +1551,7 @@ const at = function(e) {
|
|
|
1536
1551
|
}
|
|
1537
1552
|
i = u;
|
|
1538
1553
|
} else if (e.substr(i + 1, 2) === "!D") {
|
|
1539
|
-
const u =
|
|
1554
|
+
const u = rt(e, i);
|
|
1540
1555
|
this.docTypeEntities = u.entities, i = u.i;
|
|
1541
1556
|
} else if (e.substr(i + 1, 2) === "![") {
|
|
1542
1557
|
const u = y(e, "]]>", i, "CDATA is not closed.") - 2, o = e.substring(i + 9, u);
|
|
@@ -1579,11 +1594,11 @@ const at = function(e) {
|
|
|
1579
1594
|
s += e[i];
|
|
1580
1595
|
return t.child;
|
|
1581
1596
|
};
|
|
1582
|
-
function
|
|
1597
|
+
function ft(e, t, r) {
|
|
1583
1598
|
const s = this.options.updateTag(t.tagname, r, t[":@"]);
|
|
1584
1599
|
s === !1 || (typeof s == "string" && (t.tagname = s), e.addChild(t));
|
|
1585
1600
|
}
|
|
1586
|
-
const
|
|
1601
|
+
const ct = function(e) {
|
|
1587
1602
|
if (this.options.processEntities) {
|
|
1588
1603
|
for (let t in this.docTypeEntities) {
|
|
1589
1604
|
const r = this.docTypeEntities[t];
|
|
@@ -1602,7 +1617,7 @@ const ft = function(e) {
|
|
|
1602
1617
|
}
|
|
1603
1618
|
return e;
|
|
1604
1619
|
};
|
|
1605
|
-
function
|
|
1620
|
+
function ht(e, t, r, s) {
|
|
1606
1621
|
return e && (s === void 0 && (s = Object.keys(t.child).length === 0), e = this.parseTextData(
|
|
1607
1622
|
e,
|
|
1608
1623
|
t.tagname,
|
|
@@ -1612,7 +1627,7 @@ function ct(e, t, r, s) {
|
|
|
1612
1627
|
s
|
|
1613
1628
|
), e !== void 0 && e !== "" && t.add(this.options.textNodeName, e), e = ""), e;
|
|
1614
1629
|
}
|
|
1615
|
-
function
|
|
1630
|
+
function pt(e, t, r) {
|
|
1616
1631
|
const s = "*." + r;
|
|
1617
1632
|
for (const n in e) {
|
|
1618
1633
|
const i = e[n];
|
|
@@ -1621,7 +1636,7 @@ function ht(e, t, r) {
|
|
|
1621
1636
|
}
|
|
1622
1637
|
return !1;
|
|
1623
1638
|
}
|
|
1624
|
-
function
|
|
1639
|
+
function gt(e, t, r = ">") {
|
|
1625
1640
|
let s, n = "";
|
|
1626
1641
|
for (let i = t; i < e.length; i++) {
|
|
1627
1642
|
let d = e[i];
|
|
@@ -1653,7 +1668,7 @@ function y(e, t, r, s) {
|
|
|
1653
1668
|
return n + t.length - 1;
|
|
1654
1669
|
}
|
|
1655
1670
|
function x(e, t, r, s = ">") {
|
|
1656
|
-
const n =
|
|
1671
|
+
const n = gt(e, t + 1, s);
|
|
1657
1672
|
if (!n)
|
|
1658
1673
|
return;
|
|
1659
1674
|
let i = n.data;
|
|
@@ -1673,7 +1688,7 @@ function x(e, t, r, s = ">") {
|
|
|
1673
1688
|
rawTagName: l
|
|
1674
1689
|
};
|
|
1675
1690
|
}
|
|
1676
|
-
function
|
|
1691
|
+
function wt(e, t, r) {
|
|
1677
1692
|
const s = r;
|
|
1678
1693
|
let n = 1;
|
|
1679
1694
|
for (; r < e.length; r++)
|
|
@@ -1700,19 +1715,19 @@ function gt(e, t, r) {
|
|
|
1700
1715
|
function $(e, t, r) {
|
|
1701
1716
|
if (t && typeof e == "string") {
|
|
1702
1717
|
const s = e.trim();
|
|
1703
|
-
return s === "true" ? !0 : s === "false" ? !1 :
|
|
1718
|
+
return s === "true" ? !0 : s === "false" ? !1 : nt(e, r);
|
|
1704
1719
|
} else
|
|
1705
1720
|
return re.isExist(e) ? e : "";
|
|
1706
1721
|
}
|
|
1707
|
-
var
|
|
1708
|
-
function
|
|
1722
|
+
var mt = it, ne = {};
|
|
1723
|
+
function Nt(e, t) {
|
|
1709
1724
|
return ie(e, t);
|
|
1710
1725
|
}
|
|
1711
1726
|
function ie(e, t, r) {
|
|
1712
1727
|
let s;
|
|
1713
1728
|
const n = {};
|
|
1714
1729
|
for (let i = 0; i < e.length; i++) {
|
|
1715
|
-
const d = e[i], u =
|
|
1730
|
+
const d = e[i], u = Et(d);
|
|
1716
1731
|
let o = "";
|
|
1717
1732
|
if (r === void 0 ? o = u : o = r + "." + u, u === t.textNodeName)
|
|
1718
1733
|
s === void 0 ? s = d[u] : s += "" + d[u];
|
|
@@ -1721,14 +1736,14 @@ function ie(e, t, r) {
|
|
|
1721
1736
|
continue;
|
|
1722
1737
|
if (d[u]) {
|
|
1723
1738
|
let a = ie(d[u], t, o);
|
|
1724
|
-
const l =
|
|
1725
|
-
d[":@"] ?
|
|
1739
|
+
const l = yt(a, t);
|
|
1740
|
+
d[":@"] ? bt(a, d[":@"], o, t) : Object.keys(a).length === 1 && a[t.textNodeName] !== void 0 && !t.alwaysCreateTextNode ? a = a[t.textNodeName] : Object.keys(a).length === 0 && (t.alwaysCreateTextNode ? a[t.textNodeName] = "" : a = ""), n[u] !== void 0 && n.hasOwnProperty(u) ? (Array.isArray(n[u]) || (n[u] = [n[u]]), n[u].push(a)) : t.isArray(u, o, l) ? n[u] = [a] : n[u] = a;
|
|
1726
1741
|
}
|
|
1727
1742
|
}
|
|
1728
1743
|
}
|
|
1729
1744
|
return typeof s == "string" ? s.length > 0 && (n[t.textNodeName] = s) : s !== void 0 && (n[t.textNodeName] = s), n;
|
|
1730
1745
|
}
|
|
1731
|
-
function
|
|
1746
|
+
function Et(e) {
|
|
1732
1747
|
const t = Object.keys(e);
|
|
1733
1748
|
for (let r = 0; r < t.length; r++) {
|
|
1734
1749
|
const s = t[r];
|
|
@@ -1736,7 +1751,7 @@ function Nt(e) {
|
|
|
1736
1751
|
return s;
|
|
1737
1752
|
}
|
|
1738
1753
|
}
|
|
1739
|
-
function
|
|
1754
|
+
function bt(e, t, r, s) {
|
|
1740
1755
|
if (t) {
|
|
1741
1756
|
const n = Object.keys(t), i = n.length;
|
|
1742
1757
|
for (let d = 0; d < i; d++) {
|
|
@@ -1745,15 +1760,15 @@ function Et(e, t, r, s) {
|
|
|
1745
1760
|
}
|
|
1746
1761
|
}
|
|
1747
1762
|
}
|
|
1748
|
-
function
|
|
1763
|
+
function yt(e, t) {
|
|
1749
1764
|
const { textNodeName: r } = t, s = Object.keys(e).length;
|
|
1750
1765
|
return !!(s === 0 || s === 1 && (e[r] || typeof e[r] == "boolean" || e[r] === 0));
|
|
1751
1766
|
}
|
|
1752
|
-
ne.prettify =
|
|
1753
|
-
const { buildOptions:
|
|
1754
|
-
let
|
|
1767
|
+
ne.prettify = Nt;
|
|
1768
|
+
const { buildOptions: _t } = k, vt = mt, { prettify: Tt } = ne, It = R;
|
|
1769
|
+
let At = class {
|
|
1755
1770
|
constructor(t) {
|
|
1756
|
-
this.externalEntities = {}, this.options =
|
|
1771
|
+
this.externalEntities = {}, this.options = _t(t);
|
|
1757
1772
|
}
|
|
1758
1773
|
/**
|
|
1759
1774
|
* Parse XML dats to JS object
|
|
@@ -1768,14 +1783,14 @@ let It = class {
|
|
|
1768
1783
|
throw new Error("XML data is accepted in String or Bytes[] form.");
|
|
1769
1784
|
if (r) {
|
|
1770
1785
|
r === !0 && (r = {});
|
|
1771
|
-
const i =
|
|
1786
|
+
const i = It.validate(t, r);
|
|
1772
1787
|
if (i !== !0)
|
|
1773
1788
|
throw Error(`${i.err.msg}:${i.err.line}:${i.err.col}`);
|
|
1774
1789
|
}
|
|
1775
|
-
const s = new
|
|
1790
|
+
const s = new vt(this.options);
|
|
1776
1791
|
s.addExternalEntities(this.externalEntities);
|
|
1777
1792
|
const n = s.parseXml(t);
|
|
1778
|
-
return this.options.preserveOrder || n === void 0 ? n :
|
|
1793
|
+
return this.options.preserveOrder || n === void 0 ? n : Tt(n, this.options);
|
|
1779
1794
|
}
|
|
1780
1795
|
/**
|
|
1781
1796
|
* Add Entity which is not by default supported by this library
|
|
@@ -1792,23 +1807,23 @@ let It = class {
|
|
|
1792
1807
|
this.externalEntities[t] = r;
|
|
1793
1808
|
}
|
|
1794
1809
|
};
|
|
1795
|
-
var
|
|
1810
|
+
var Ct = At;
|
|
1796
1811
|
const Ot = `
|
|
1797
1812
|
`;
|
|
1798
|
-
function
|
|
1813
|
+
function Pt(e, t) {
|
|
1799
1814
|
let r = "";
|
|
1800
1815
|
return t.format && t.indentBy.length > 0 && (r = Ot), se(e, t, "", r);
|
|
1801
1816
|
}
|
|
1802
1817
|
function se(e, t, r, s) {
|
|
1803
1818
|
let n = "", i = !1;
|
|
1804
1819
|
for (let d = 0; d < e.length; d++) {
|
|
1805
|
-
const u = e[d], o =
|
|
1820
|
+
const u = e[d], o = xt(u);
|
|
1806
1821
|
if (o === void 0)
|
|
1807
1822
|
continue;
|
|
1808
1823
|
let a = "";
|
|
1809
1824
|
if (r.length === 0 ? a = o : a = `${r}.${o}`, o === t.textNodeName) {
|
|
1810
1825
|
let h = u[o];
|
|
1811
|
-
|
|
1826
|
+
$t(a, t) || (h = t.tagValueProcessor(o, h), h = oe(h, t)), i && (n += s), n += h, i = !1;
|
|
1812
1827
|
continue;
|
|
1813
1828
|
} else if (o === t.cdataPropName) {
|
|
1814
1829
|
i && (n += s), n += `<![CDATA[${u[o][0][t.textNodeName]}]]>`, i = !1;
|
|
@@ -1829,7 +1844,7 @@ function se(e, t, r, s) {
|
|
|
1829
1844
|
}
|
|
1830
1845
|
return n;
|
|
1831
1846
|
}
|
|
1832
|
-
function
|
|
1847
|
+
function xt(e) {
|
|
1833
1848
|
const t = Object.keys(e);
|
|
1834
1849
|
for (let r = 0; r < t.length; r++) {
|
|
1835
1850
|
const s = t[r];
|
|
@@ -1848,7 +1863,7 @@ function H(e, t) {
|
|
|
1848
1863
|
}
|
|
1849
1864
|
return r;
|
|
1850
1865
|
}
|
|
1851
|
-
function
|
|
1866
|
+
function $t(e, t) {
|
|
1852
1867
|
e = e.substr(0, e.length - t.textNodeName.length - 1);
|
|
1853
1868
|
let r = e.substr(e.lastIndexOf(".") + 1);
|
|
1854
1869
|
for (let s in t.stopNodes)
|
|
@@ -1864,8 +1879,8 @@ function oe(e, t) {
|
|
|
1864
1879
|
}
|
|
1865
1880
|
return e;
|
|
1866
1881
|
}
|
|
1867
|
-
var
|
|
1868
|
-
const
|
|
1882
|
+
var Ft = Pt;
|
|
1883
|
+
const Vt = Ft, St = {
|
|
1869
1884
|
attributeNamePrefix: "@_",
|
|
1870
1885
|
attributesGroupName: !1,
|
|
1871
1886
|
textNodeName: "#text",
|
|
@@ -1900,16 +1915,16 @@ const Ft = $t, Vt = {
|
|
|
1900
1915
|
oneListGroup: !1
|
|
1901
1916
|
};
|
|
1902
1917
|
function b(e) {
|
|
1903
|
-
this.options = Object.assign({},
|
|
1918
|
+
this.options = Object.assign({}, St, e), this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() {
|
|
1904
1919
|
return !1;
|
|
1905
|
-
} : (this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute =
|
|
1920
|
+
} : (this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = Mt), this.processTextOrObjNode = Lt, this.options.format ? (this.indentate = Rt, this.tagEndChar = `>
|
|
1906
1921
|
`, this.newLine = `
|
|
1907
1922
|
`) : (this.indentate = function() {
|
|
1908
1923
|
return "";
|
|
1909
1924
|
}, this.tagEndChar = ">", this.newLine = "");
|
|
1910
1925
|
}
|
|
1911
1926
|
b.prototype.build = function(e) {
|
|
1912
|
-
return this.options.preserveOrder ?
|
|
1927
|
+
return this.options.preserveOrder ? Vt(e, this.options) : (Array.isArray(e) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (e = {
|
|
1913
1928
|
[this.options.arrayNodeName]: e
|
|
1914
1929
|
}), this.j2x(e, 0).val);
|
|
1915
1930
|
};
|
|
@@ -1987,20 +2002,20 @@ b.prototype.replaceEntitiesValue = function(e) {
|
|
|
1987
2002
|
}
|
|
1988
2003
|
return e;
|
|
1989
2004
|
};
|
|
1990
|
-
function
|
|
2005
|
+
function Rt(e) {
|
|
1991
2006
|
return this.options.indentBy.repeat(e);
|
|
1992
2007
|
}
|
|
1993
|
-
function
|
|
2008
|
+
function Mt(e) {
|
|
1994
2009
|
return e.startsWith(this.options.attributeNamePrefix) && e !== this.options.textNodeName ? e.substr(this.attrPrefixLen) : !1;
|
|
1995
2010
|
}
|
|
1996
|
-
var
|
|
1997
|
-
const
|
|
2011
|
+
var kt = b;
|
|
2012
|
+
const Bt = R, qt = Ct, Xt = kt;
|
|
1998
2013
|
var K = {
|
|
1999
|
-
XMLParser:
|
|
2000
|
-
XMLValidator:
|
|
2001
|
-
XMLBuilder:
|
|
2014
|
+
XMLParser: qt,
|
|
2015
|
+
XMLValidator: Bt,
|
|
2016
|
+
XMLBuilder: Xt
|
|
2002
2017
|
};
|
|
2003
|
-
function
|
|
2018
|
+
function Ut(e) {
|
|
2004
2019
|
if (typeof e != "string")
|
|
2005
2020
|
throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);
|
|
2006
2021
|
if (e = e.trim(), e.length === 0 || K.XMLValidator.validate(e) !== !0)
|
|
@@ -2035,10 +2050,10 @@ function Xt(e) {
|
|
|
2035
2050
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
2036
2051
|
*
|
|
2037
2052
|
*/
|
|
2038
|
-
class
|
|
2053
|
+
class pr {
|
|
2039
2054
|
_view;
|
|
2040
2055
|
constructor(t) {
|
|
2041
|
-
|
|
2056
|
+
Gt(t), this._view = t;
|
|
2042
2057
|
}
|
|
2043
2058
|
get id() {
|
|
2044
2059
|
return this._view.id;
|
|
@@ -2098,7 +2113,7 @@ class cr {
|
|
|
2098
2113
|
return this._view.defaultSortKey;
|
|
2099
2114
|
}
|
|
2100
2115
|
}
|
|
2101
|
-
const
|
|
2116
|
+
const Gt = function(e) {
|
|
2102
2117
|
if (!e.id || typeof e.id != "string")
|
|
2103
2118
|
throw new Error("View id is required and must be a string");
|
|
2104
2119
|
if (!e.name || typeof e.name != "string")
|
|
@@ -2107,12 +2122,12 @@ const Ut = function(e) {
|
|
|
2107
2122
|
throw new Error("View caption is required for top-level views and must be a string");
|
|
2108
2123
|
if (!e.getContents || typeof e.getContents != "function")
|
|
2109
2124
|
throw new Error("View getContents is required and must be a function");
|
|
2110
|
-
if (!e.icon || typeof e.icon != "string" || !
|
|
2125
|
+
if (!e.icon || typeof e.icon != "string" || !Ut(e.icon))
|
|
2111
2126
|
throw new Error("View icon is required and must be a valid svg string");
|
|
2112
2127
|
if (!("order" in e) || typeof e.order != "number")
|
|
2113
2128
|
throw new Error("View order is required and must be a number");
|
|
2114
2129
|
if (e.columns && e.columns.forEach((t) => {
|
|
2115
|
-
if (!(t instanceof
|
|
2130
|
+
if (!(t instanceof Ae))
|
|
2116
2131
|
throw new Error("View columns must be an array of Column. Invalid column found");
|
|
2117
2132
|
}), e.emptyView && typeof e.emptyView != "function")
|
|
2118
2133
|
throw new Error("View emptyView must be a function");
|
|
@@ -2148,48 +2163,48 @@ const Ut = function(e) {
|
|
|
2148
2163
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
2149
2164
|
*
|
|
2150
2165
|
*/
|
|
2151
|
-
const
|
|
2166
|
+
const gr = function(e) {
|
|
2152
2167
|
return F().registerEntry(e);
|
|
2153
|
-
},
|
|
2168
|
+
}, wr = function(e) {
|
|
2154
2169
|
return F().unregisterEntry(e);
|
|
2155
|
-
},
|
|
2170
|
+
}, mr = function(e) {
|
|
2156
2171
|
return F().getEntries(e).sort((r, s) => r.order !== void 0 && s.order !== void 0 && r.order !== s.order ? r.order - s.order : r.displayName.localeCompare(s.displayName, void 0, { numeric: !0, sensitivity: "base" }));
|
|
2157
2172
|
};
|
|
2158
2173
|
export {
|
|
2159
|
-
|
|
2174
|
+
Ae as Column,
|
|
2160
2175
|
W as DefaultType,
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2176
|
+
_e as File,
|
|
2177
|
+
er as FileAction,
|
|
2178
|
+
L as FileType,
|
|
2179
|
+
ve as Folder,
|
|
2180
|
+
nr as Header,
|
|
2181
|
+
Ie as Navigation,
|
|
2167
2182
|
Q as Node,
|
|
2168
2183
|
J as NodeStatus,
|
|
2169
2184
|
N as Permission,
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2185
|
+
pr as View,
|
|
2186
|
+
gr as addNewFileMenuEntry,
|
|
2187
|
+
ar as davGetClient,
|
|
2188
|
+
ur as davGetDefaultPropfind,
|
|
2189
|
+
be as davGetFavoritesReport,
|
|
2190
|
+
dr as davGetRecentSearch,
|
|
2191
|
+
ye as davParsePermissions,
|
|
2177
2192
|
ee as davRemoteURL,
|
|
2178
|
-
|
|
2193
|
+
Te as davResultToNode,
|
|
2179
2194
|
D as davRootPath,
|
|
2180
2195
|
j as defaultDavNamespaces,
|
|
2181
2196
|
Z as defaultDavProperties,
|
|
2182
|
-
|
|
2183
|
-
|
|
2197
|
+
Qt as formatFileSize,
|
|
2198
|
+
S as getDavNameSpaces,
|
|
2184
2199
|
V as getDavProperties,
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2200
|
+
lr as getFavoriteNodes,
|
|
2201
|
+
rr as getFileActions,
|
|
2202
|
+
sr as getFileListHeaders,
|
|
2203
|
+
fr as getNavigation,
|
|
2204
|
+
mr as getNewFileMenuEntries,
|
|
2205
|
+
Dt as parseFileSize,
|
|
2206
|
+
or as registerDavProperty,
|
|
2207
|
+
tr as registerFileAction,
|
|
2208
|
+
ir as registerFileListHeaders,
|
|
2209
|
+
wr as removeNewFileMenuEntry
|
|
2195
2210
|
};
|