@nextcloud/files 3.1.0 → 3.1.1

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/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const _ = require("@nextcloud/auth"), W = require("@nextcloud/logger"), ge = require("@nextcloud/l10n"), b = require("path"), we = require("@nextcloud/paths"), me = require("@nextcloud/router"), Z = require("webdav");
3
+ const _ = require("@nextcloud/auth"), K = require("@nextcloud/logger"), ge = require("@nextcloud/l10n"), b = require("path"), we = require("@nextcloud/paths"), me = require("@nextcloud/router"), W = require("webdav");
4
4
  /**
5
5
  * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
6
6
  *
@@ -22,7 +22,7 @@ const _ = require("@nextcloud/auth"), W = require("@nextcloud/logger"), ge = req
22
22
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
23
23
  *
24
24
  */
25
- const Ne = (e) => e === null ? W.getLoggerBuilder().setApp("files").build() : W.getLoggerBuilder().setApp("files").setUid(e.uid).build(), N = Ne(_.getCurrentUser());
25
+ const Ne = (e) => e === null ? K.getLoggerBuilder().setApp("files").build() : K.getLoggerBuilder().setApp("files").setUid(e.uid).build(), N = Ne(_.getCurrentUser());
26
26
  /**
27
27
  * @copyright Copyright (c) 2021 John Molakvoæ <skjnldsv@protonmail.com>
28
28
  *
@@ -85,7 +85,7 @@ class Ee {
85
85
  throw new Error("Duplicate entry");
86
86
  }
87
87
  }
88
- const S = function() {
88
+ const L = function() {
89
89
  return typeof window._nc_newfilemenu > "u" && (window._nc_newfilemenu = new Ee(), N.debug("NewFileMenu initialized")), window._nc_newfilemenu;
90
90
  };
91
91
  /**
@@ -160,7 +160,7 @@ function be(e, t = !1) {
160
160
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
161
161
  *
162
162
  */
163
- var L = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.HIDDEN = "hidden", e))(L || {});
163
+ var R = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.HIDDEN = "hidden", e))(R || {});
164
164
  class ve {
165
165
  _action;
166
166
  constructor(t) {
@@ -221,7 +221,7 @@ class ve {
221
221
  throw new Error("Invalid order");
222
222
  if ("parent" in t && typeof t.parent != "string")
223
223
  throw new Error("Invalid parent");
224
- if (t.default && !Object.values(L).includes(t.default))
224
+ if (t.default && !Object.values(R).includes(t.default))
225
225
  throw new Error("Invalid default");
226
226
  if ("inline" in t && typeof t.inline != "function")
227
227
  throw new Error("Invalid inline function");
@@ -355,44 +355,41 @@ const M = [
355
355
  "nc:has-preview",
356
356
  "nc:is-encrypted",
357
357
  "nc:mount-type",
358
- "nc:share-attributes",
359
358
  "oc:comments-unread",
360
359
  "oc:favorite",
361
360
  "oc:fileid",
362
361
  "oc:owner-display-name",
363
362
  "oc:owner-id",
364
363
  "oc:permissions",
365
- "oc:share-types",
366
- "oc:size",
367
- "ocs:share-permissions"
364
+ "oc:size"
368
365
  ], B = {
369
366
  d: "DAV:",
370
367
  nc: "http://nextcloud.org/ns",
371
368
  oc: "http://owncloud.org/ns",
372
369
  ocs: "http://open-collaboration-services.org/ns"
373
- }, Ce = function(e, t = { nc: "http://nextcloud.org/ns" }) {
370
+ }, Oe = function(e, t = { nc: "http://nextcloud.org/ns" }) {
374
371
  typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...M], window._nc_dav_namespaces = { ...B });
375
372
  const r = { ...window._nc_dav_namespaces, ...t };
376
373
  if (window._nc_dav_properties.find((n) => n === e))
377
- return N.error(`${e} already registered`, { prop: e }), !1;
374
+ return N.warn(`${e} already registered`, { prop: e }), !1;
378
375
  if (e.startsWith("<") || e.split(":").length !== 2)
379
376
  return N.error(`${e} is not valid. See example: 'oc:fileid'`, { prop: e }), !1;
380
377
  const s = e.split(":")[0];
381
378
  return r[s] ? (window._nc_dav_properties.push(e), window._nc_dav_namespaces = r, !0) : (N.error(`${e} namespace unknown`, { prop: e, namespaces: r }), !1);
382
379
  }, P = function() {
383
380
  return typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...M]), window._nc_dav_properties.map((e) => `<${e} />`).join(" ");
384
- }, C = function() {
381
+ }, O = function() {
385
382
  return typeof window._nc_dav_namespaces > "u" && (window._nc_dav_namespaces = { ...B }), Object.keys(window._nc_dav_namespaces).map((e) => `xmlns:${e}="${window._nc_dav_namespaces?.[e]}"`).join(" ");
386
- }, Oe = function() {
383
+ }, Ce = function() {
387
384
  return `<?xml version="1.0"?>
388
- <d:propfind ${C()}>
385
+ <d:propfind ${O()}>
389
386
  <d:prop>
390
387
  ${P()}
391
388
  </d:prop>
392
389
  </d:propfind>`;
393
- }, re = function() {
390
+ }, te = function() {
394
391
  return `<?xml version="1.0"?>
395
- <oc:filter-files ${C()}>
392
+ <oc:filter-files ${O()}>
396
393
  <d:prop>
397
394
  ${P()}
398
395
  </d:prop>
@@ -402,7 +399,7 @@ const M = [
402
399
  </oc:filter-files>`;
403
400
  }, Fe = function(e) {
404
401
  return `<?xml version="1.0" encoding="UTF-8"?>
405
- <d:searchrequest ${C()}
402
+ <d:searchrequest ${O()}
406
403
  xmlns:ns="https://github.com/icewind1991/SearchDAV/ns">
407
404
  <d:basicsearch>
408
405
  <d:select>
@@ -479,7 +476,7 @@ const M = [
479
476
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
480
477
  *
481
478
  */
482
- const ne = function(e = "") {
479
+ const re = function(e = "") {
483
480
  let t = m.NONE;
484
481
  return e && ((e.includes("C") || e.includes("K")) && (t |= m.CREATE), e.includes("G") && (t |= m.READ), (e.includes("W") || e.includes("N") || e.includes("V")) && (t |= m.UPDATE), e.includes("D") && (t |= m.DELETE), e.includes("R") && (t |= m.SHARE)), t;
485
482
  };
@@ -504,7 +501,7 @@ const ne = function(e = "") {
504
501
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
505
502
  *
506
503
  */
507
- var O = /* @__PURE__ */ ((e) => (e.Folder = "folder", e.File = "file", e))(O || {});
504
+ var C = /* @__PURE__ */ ((e) => (e.Folder = "folder", e.File = "file", e))(C || {});
508
505
  /**
509
506
  * @copyright Copyright (c) 2022 John Molakvoæ <skjnldsv@protonmail.com>
510
507
  *
@@ -526,9 +523,9 @@ var O = /* @__PURE__ */ ((e) => (e.Folder = "folder", e.File = "file", e))(O ||
526
523
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
527
524
  *
528
525
  */
529
- const ie = function(e, t) {
526
+ const ne = function(e, t) {
530
527
  return e.match(t) !== null;
531
- }, j = (e, t) => {
528
+ }, Z = (e, t) => {
532
529
  if (e.id && typeof e.id != "number")
533
530
  throw new Error("Invalid id type of value");
534
531
  if (!e.source)
@@ -560,7 +557,7 @@ const ie = function(e, t) {
560
557
  throw new Error("Root must start with a leading slash");
561
558
  if (e.root && !e.source.includes(e.root))
562
559
  throw new Error("Root must be part of the source");
563
- if (e.root && ie(e.source, t)) {
560
+ if (e.root && ne(e.source, t)) {
564
561
  const r = e.source.match(t)[0];
565
562
  if (!e.source.includes(b.join(r, e.root)))
566
563
  throw new Error("The root must be relative to the service. e.g /files/emma");
@@ -595,7 +592,7 @@ class q {
595
592
  _attributes;
596
593
  _knownDavService = /(remote|public)\.php\/(web)?dav/i;
597
594
  constructor(t, r) {
598
- j(t, r || this._knownDavService), this._data = t;
595
+ Z(t, r || this._knownDavService), this._data = t;
599
596
  const s = {
600
597
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
601
598
  set: (n, i, a) => (this.updateMtime(), Reflect.set(n, i, a)),
@@ -689,7 +686,7 @@ class q {
689
686
  * Is this a dav-related ressource ?
690
687
  */
691
688
  get isDavRessource() {
692
- return ie(this.source, this._knownDavService);
689
+ return ne(this.source, this._knownDavService);
693
690
  }
694
691
  /**
695
692
  * Get the dav root of this object
@@ -735,7 +732,7 @@ class q {
735
732
  * e.g. https://cloud.domain.com/remote.php/dav/files/emma/Photos/picture.jpg
736
733
  */
737
734
  move(t) {
738
- j({ ...this._data, source: t }, this._knownDavService), this._data.source = t, this.updateMtime();
735
+ Z({ ...this._data, source: t }, this._knownDavService), this._data.source = t, this.updateMtime();
739
736
  }
740
737
  /**
741
738
  * Rename the node
@@ -776,9 +773,9 @@ class q {
776
773
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
777
774
  *
778
775
  */
779
- class se extends q {
776
+ class ie extends q {
780
777
  get type() {
781
- return O.File;
778
+ return C.File;
782
779
  }
783
780
  }
784
781
  /**
@@ -802,7 +799,7 @@ class se extends q {
802
799
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
803
800
  *
804
801
  */
805
- class oe extends q {
802
+ class se extends q {
806
803
  constructor(t) {
807
804
  super({
808
805
  ...t,
@@ -810,7 +807,7 @@ class oe extends q {
810
807
  });
811
808
  }
812
809
  get type() {
813
- return O.Folder;
810
+ return C.Folder;
814
811
  }
815
812
  get extension() {
816
813
  return null;
@@ -842,7 +839,7 @@ class oe extends q {
842
839
  *
843
840
  */
844
841
  const U = `/files/${_.getCurrentUser()?.uid}`, X = me.generateRemoteUrl("dav"), xe = function(e = X, t = {}) {
845
- const r = Z.createClient(e, { headers: t });
842
+ const r = W.createClient(e, { headers: t });
846
843
  function s(i) {
847
844
  r.setHeaders({
848
845
  ...t,
@@ -852,35 +849,38 @@ const U = `/files/${_.getCurrentUser()?.uid}`, X = me.generateRemoteUrl("dav"),
852
849
  requesttoken: i ?? ""
853
850
  });
854
851
  }
855
- return _.onRequestTokenUpdate(s), s(_.getRequestToken()), Z.getPatcher().patch("fetch", (i, a) => {
852
+ return _.onRequestTokenUpdate(s), s(_.getRequestToken()), W.getPatcher().patch("fetch", (i, a) => {
856
853
  const u = a.headers;
857
854
  return u?.method && (a.method = u.method, delete u.method), fetch(i, a);
858
855
  }), r;
859
856
  }, $e = async (e, t = "/", r = U) => (await e.getDirectoryContents(`${r}${t}`, {
860
857
  details: !0,
861
- data: re(),
858
+ data: te(),
862
859
  headers: {
863
860
  // see davGetClient for patched webdav client
864
861
  method: "REPORT"
865
862
  },
866
863
  includeSelf: !0
867
- })).data.filter((n) => n.filename !== t).map((n) => ue(n, r)), ue = function(e, t = U, r = X) {
868
- const s = e.props, n = ne(s?.permissions), i = s?.["owner-id"] || _.getCurrentUser()?.uid, a = {
869
- id: s?.fileid || 0,
864
+ })).data.filter((n) => n.filename !== t).map((n) => oe(n, r)), oe = function(e, t = U, r = X) {
865
+ const s = _.getCurrentUser()?.uid;
866
+ if (!s)
867
+ throw new Error("No user id found");
868
+ const n = e.props, i = re(n?.permissions), a = (n?.["owner-id"] || s).toString(), u = {
869
+ id: n?.fileid || 0,
870
870
  source: `${r}${e.filename}`,
871
871
  mtime: new Date(Date.parse(e.lastmod)),
872
- mime: e.mime,
873
- size: s?.size || Number.parseInt(s.getcontentlength || "0"),
874
- permissions: n,
875
- owner: i,
872
+ mime: e.mime || "application/octet-stream",
873
+ size: n?.size || Number.parseInt(n.getcontentlength || "0"),
874
+ permissions: i,
875
+ owner: a,
876
876
  root: t,
877
877
  attributes: {
878
878
  ...e,
879
- ...s,
880
- hasPreview: s?.["has-preview"]
879
+ ...n,
880
+ hasPreview: n?.["has-preview"]
881
881
  }
882
882
  };
883
- return delete a.attributes?.props, e.type === "file" ? new se(a) : new oe(a);
883
+ return delete u.attributes?.props, e.type === "file" ? new ie(u) : new se(u);
884
884
  };
885
885
  /**
886
886
  * @copyright Copyright (c) 2022 John Molakvoæ <skjnldsv@protonmail.com>
@@ -903,7 +903,7 @@ const U = `/files/${_.getCurrentUser()?.uid}`, X = me.generateRemoteUrl("dav"),
903
903
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
904
904
  *
905
905
  */
906
- class ae {
906
+ class ue {
907
907
  _views = [];
908
908
  _currentView = null;
909
909
  register(t) {
@@ -926,7 +926,7 @@ class ae {
926
926
  }
927
927
  }
928
928
  const Ve = function() {
929
- return typeof window._nc_navigation > "u" && (window._nc_navigation = new ae(), N.debug("Navigation service initialized")), window._nc_navigation;
929
+ return typeof window._nc_navigation > "u" && (window._nc_navigation = new ue(), N.debug("Navigation service initialized")), window._nc_navigation;
930
930
  };
931
931
  /**
932
932
  * @copyright Copyright (c) 2022 John Molakvoæ <skjnldsv@protonmail.com>
@@ -949,10 +949,10 @@ const Ve = function() {
949
949
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
950
950
  *
951
951
  */
952
- class de {
952
+ class ae {
953
953
  _column;
954
954
  constructor(t) {
955
- Re(t), this._column = t;
955
+ Se(t), this._column = t;
956
956
  }
957
957
  get id() {
958
958
  return this._column.id;
@@ -970,7 +970,7 @@ class de {
970
970
  return this._column.summary;
971
971
  }
972
972
  }
973
- const Re = function(e) {
973
+ const Se = function(e) {
974
974
  if (!e.id || typeof e.id != "string")
975
975
  throw new Error("A column id is required");
976
976
  if (!e.title || typeof e.title != "string")
@@ -1015,24 +1015,24 @@ var G = {}, F = {};
1015
1015
  return e.isExist(u) ? u : "";
1016
1016
  }, e.isName = a, e.getAllMatches = i, e.nameRegexp = s;
1017
1017
  })(F);
1018
- const H = F, Se = {
1018
+ const H = F, Le = {
1019
1019
  allowBooleanAttributes: !1,
1020
1020
  //A tag can have attributes without any value
1021
1021
  unpairedTags: []
1022
1022
  };
1023
1023
  G.validate = function(e, t) {
1024
- t = Object.assign({}, Se, t);
1024
+ t = Object.assign({}, Le, t);
1025
1025
  const r = [];
1026
1026
  let s = !1, n = !1;
1027
1027
  e[0] === "\uFEFF" && (e = e.substr(1));
1028
1028
  for (let i = 0; i < e.length; i++)
1029
1029
  if (e[i] === "<" && e[i + 1] === "?") {
1030
- if (i += 2, i = J(e, i), i.err)
1030
+ if (i += 2, i = Y(e, i), i.err)
1031
1031
  return i;
1032
1032
  } else if (e[i] === "<") {
1033
1033
  let a = i;
1034
1034
  if (i++, e[i] === "!") {
1035
- i = Q(e, i);
1035
+ i = J(e, i);
1036
1036
  continue;
1037
1037
  } else {
1038
1038
  let u = !1;
@@ -1052,7 +1052,7 @@ G.validate = function(e, t) {
1052
1052
  if (i = d.index, l[l.length - 1] === "/") {
1053
1053
  const f = i - l.length;
1054
1054
  l = l.substring(0, l.length - 1);
1055
- const c = D(l, t);
1055
+ const c = Q(l, t);
1056
1056
  if (c === !0)
1057
1057
  s = !0;
1058
1058
  else
@@ -1076,7 +1076,7 @@ G.validate = function(e, t) {
1076
1076
  } else
1077
1077
  return p("InvalidTag", "Closing tag '" + o + "' doesn't have proper closing.", w(e, i));
1078
1078
  else {
1079
- const f = D(l, t);
1079
+ const f = Q(l, t);
1080
1080
  if (f !== !0)
1081
1081
  return p(f.err.code, f.err.msg, w(e, i - l.length + f.err.line));
1082
1082
  if (n === !0)
@@ -1086,10 +1086,10 @@ G.validate = function(e, t) {
1086
1086
  for (i++; i < e.length; i++)
1087
1087
  if (e[i] === "<")
1088
1088
  if (e[i + 1] === "!") {
1089
- i++, i = Q(e, i);
1089
+ i++, i = J(e, i);
1090
1090
  continue;
1091
1091
  } else if (e[i + 1] === "?") {
1092
- if (i = J(e, ++i), i.err)
1092
+ if (i = Y(e, ++i), i.err)
1093
1093
  return i;
1094
1094
  } else
1095
1095
  break;
@@ -1098,12 +1098,12 @@ G.validate = function(e, t) {
1098
1098
  if (f == -1)
1099
1099
  return p("InvalidChar", "char '&' is not expected.", w(e, i));
1100
1100
  i = f;
1101
- } else if (n === !0 && !Y(e[i]))
1101
+ } else if (n === !0 && !j(e[i]))
1102
1102
  return p("InvalidXml", "Extra text at the end", w(e, i));
1103
1103
  e[i] === "<" && i--;
1104
1104
  }
1105
1105
  } else {
1106
- if (Y(e[i]))
1106
+ if (j(e[i]))
1107
1107
  continue;
1108
1108
  return p("InvalidChar", "char '" + e[i] + "' is not expected.", w(e, i));
1109
1109
  }
@@ -1116,11 +1116,11 @@ G.validate = function(e, t) {
1116
1116
  return p("InvalidXml", "Start tag expected.", 1);
1117
1117
  return !0;
1118
1118
  };
1119
- function Y(e) {
1119
+ function j(e) {
1120
1120
  return e === " " || e === " " || e === `
1121
1121
  ` || e === "\r";
1122
1122
  }
1123
- function J(e, t) {
1123
+ function Y(e, t) {
1124
1124
  const r = t;
1125
1125
  for (; t < e.length; t++)
1126
1126
  if (e[t] == "?" || e[t] == " ") {
@@ -1135,7 +1135,7 @@ function J(e, t) {
1135
1135
  }
1136
1136
  return t;
1137
1137
  }
1138
- function Q(e, t) {
1138
+ function J(e, t) {
1139
1139
  if (e.length > t + 5 && e[t + 1] === "-" && e[t + 2] === "-") {
1140
1140
  for (t += 3; t < e.length; t++)
1141
1141
  if (e[t] === "-" && e[t + 1] === "-" && e[t + 2] === ">") {
@@ -1158,11 +1158,11 @@ function Q(e, t) {
1158
1158
  }
1159
1159
  return t;
1160
1160
  }
1161
- const Le = '"', Me = "'";
1161
+ const Re = '"', Me = "'";
1162
1162
  function Be(e, t) {
1163
1163
  let r = "", s = "", n = !1;
1164
1164
  for (; t < e.length; t++) {
1165
- if (e[t] === Le || e[t] === Me)
1165
+ if (e[t] === Re || e[t] === Me)
1166
1166
  s === "" ? s = e[t] : s !== e[t] || (s = "");
1167
1167
  else if (e[t] === ">" && s === "") {
1168
1168
  n = !0;
@@ -1177,7 +1177,7 @@ function Be(e, t) {
1177
1177
  };
1178
1178
  }
1179
1179
  const ke = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
1180
- function D(e, t) {
1180
+ function Q(e, t) {
1181
1181
  const r = H.getAllMatches(e, ke), s = {};
1182
1182
  for (let n = 0; n < r.length; n++) {
1183
1183
  if (r[n][1].length === 0)
@@ -1248,7 +1248,7 @@ function I(e) {
1248
1248
  return e.startIndex + e[1].length;
1249
1249
  }
1250
1250
  var z = {};
1251
- const le = {
1251
+ const de = {
1252
1252
  preserveOrder: !1,
1253
1253
  attributeNamePrefix: "@_",
1254
1254
  attributesGroupName: !1,
@@ -1292,10 +1292,10 @@ const le = {
1292
1292
  }
1293
1293
  // skipEmptyListItem: false
1294
1294
  }, He = function(e) {
1295
- return Object.assign({}, le, e);
1295
+ return Object.assign({}, de, e);
1296
1296
  };
1297
1297
  z.buildOptions = He;
1298
- z.defaultOptions = le;
1298
+ z.defaultOptions = de;
1299
1299
  class ze {
1300
1300
  constructor(t) {
1301
1301
  this.tagname = t, this.child = [], this[":@"] = {};
@@ -1416,8 +1416,7 @@ function ut(e) {
1416
1416
  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;
1417
1417
  }
1418
1418
  var at = ot;
1419
- const K = F, A = Ke, dt = rt, lt = at;
1420
- "<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g, K.nameRegexp);
1419
+ const le = F, A = Ke, dt = rt, lt = at;
1421
1420
  let ft = class {
1422
1421
  constructor(t) {
1423
1422
  this.options = t, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = {
@@ -1456,7 +1455,7 @@ function ht(e, t, r, s, n, i, a) {
1456
1455
  if (e !== void 0 && (this.options.trimValues && !s && (e = e.trim()), e.length > 0)) {
1457
1456
  a || (e = this.replaceEntitiesValue(e));
1458
1457
  const u = this.options.tagValueProcessor(t, e, r, n, i);
1459
- return u == null ? e : typeof u != typeof e || u !== e ? u : this.options.trimValues ? R(e, this.options.parseTagValue, this.options.numberParseOptions) : e.trim() === e ? R(e, this.options.parseTagValue, this.options.numberParseOptions) : e;
1458
+ return u == null ? e : typeof u != typeof e || u !== e ? u : this.options.trimValues ? S(e, this.options.parseTagValue, this.options.numberParseOptions) : e.trim() === e ? S(e, this.options.parseTagValue, this.options.numberParseOptions) : e;
1460
1459
  }
1461
1460
  }
1462
1461
  function pt(e) {
@@ -1471,7 +1470,7 @@ function pt(e) {
1471
1470
  const gt = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
1472
1471
  function wt(e, t, r) {
1473
1472
  if (!this.options.ignoreAttributes && typeof e == "string") {
1474
- const s = K.getAllMatches(e, gt), n = s.length, i = {};
1473
+ const s = le.getAllMatches(e, gt), n = s.length, i = {};
1475
1474
  for (let a = 0; a < n; a++) {
1476
1475
  const u = this.resolveNameSpace(s[a][1]);
1477
1476
  let o = s[a][4], d = this.options.attributeNamePrefix + u;
@@ -1479,7 +1478,7 @@ function wt(e, t, r) {
1479
1478
  if (this.options.transformAttributeName && (d = this.options.transformAttributeName(d)), d === "__proto__" && (d = "#__proto__"), o !== void 0) {
1480
1479
  this.options.trimValues && (o = o.trim()), o = this.replaceEntitiesValue(o);
1481
1480
  const l = this.options.attributeValueProcessor(u, o, t);
1482
- l == null ? i[d] = o : typeof l != typeof o || l !== o ? i[d] = l : i[d] = R(
1481
+ l == null ? i[d] = o : typeof l != typeof o || l !== o ? i[d] = l : i[d] = S(
1483
1482
  o,
1484
1483
  this.options.parseAttributeValue,
1485
1484
  this.options.numberParseOptions
@@ -1537,13 +1536,9 @@ const mt = function(e) {
1537
1536
  this.docTypeEntities = u.entities, i = u.i;
1538
1537
  } else if (e.substr(i + 1, 2) === "![") {
1539
1538
  const u = v(e, "]]>", i, "CDATA is not closed.") - 2, o = e.substring(i + 9, u);
1540
- if (s = this.saveTextToParentTag(s, r, n), this.options.cdataPropName)
1541
- r.add(this.options.cdataPropName, [{ [this.options.textNodeName]: o }]);
1542
- else {
1543
- let d = this.parseTextData(o, r.tagname, n, !0, !1, !0);
1544
- d == null && (d = ""), r.add(this.options.textNodeName, d);
1545
- }
1546
- i = u + 2;
1539
+ s = this.saveTextToParentTag(s, r, n);
1540
+ let d = this.parseTextData(o, r.tagname, n, !0, !1, !0, !0);
1541
+ d == null && (d = ""), this.options.cdataPropName ? r.add(this.options.cdataPropName, [{ [this.options.textNodeName]: o }]) : r.add(this.options.textNodeName, d), i = u + 2;
1547
1542
  } else {
1548
1543
  let u = V(e, i, this.options.removeNSPrefix), o = u.tagName;
1549
1544
  const d = u.rawTagName;
@@ -1660,7 +1655,7 @@ function V(e, t, r, s = ">") {
1660
1655
  let i = n.data;
1661
1656
  const a = n.index, u = i.search(/\s/);
1662
1657
  let o = i, d = !0;
1663
- u !== -1 && (o = i.substr(0, u).replace(/\s\s*$/, ""), i = i.substr(u + 1));
1658
+ u !== -1 && (o = i.substring(0, u), i = i.substring(u + 1).trimStart());
1664
1659
  const l = o;
1665
1660
  if (r) {
1666
1661
  const f = o.indexOf(":");
@@ -1698,12 +1693,12 @@ function _t(e, t, r) {
1698
1693
  i && ((i && i.tagName) === t && i.tagExp[i.tagExp.length - 1] !== "/" && n++, r = i.closeIndex);
1699
1694
  }
1700
1695
  }
1701
- function R(e, t, r) {
1696
+ function S(e, t, r) {
1702
1697
  if (t && typeof e == "string") {
1703
1698
  const s = e.trim();
1704
1699
  return s === "true" ? !0 : s === "false" ? !1 : lt(e, r);
1705
1700
  } else
1706
- return K.isExist(e) ? e : "";
1701
+ return le.isExist(e) ? e : "";
1707
1702
  }
1708
1703
  var Tt = ft, fe = {};
1709
1704
  function It(e, t) {
@@ -1722,7 +1717,7 @@ function ce(e, t, r) {
1722
1717
  continue;
1723
1718
  if (a[u]) {
1724
1719
  let d = ce(a[u], t, o);
1725
- const l = Ct(d, t);
1720
+ const l = Ot(d, t);
1726
1721
  a[":@"] ? Pt(d, a[":@"], o, t) : Object.keys(d).length === 1 && d[t.textNodeName] !== void 0 && !t.alwaysCreateTextNode ? d = d[t.textNodeName] : Object.keys(d).length === 0 && (t.alwaysCreateTextNode ? d[t.textNodeName] = "" : d = ""), n[u] !== void 0 && n.hasOwnProperty(u) ? (Array.isArray(n[u]) || (n[u] = [n[u]]), n[u].push(d)) : t.isArray(u, o, l) ? n[u] = [d] : n[u] = d;
1727
1722
  }
1728
1723
  }
@@ -1746,15 +1741,15 @@ function Pt(e, t, r, s) {
1746
1741
  }
1747
1742
  }
1748
1743
  }
1749
- function Ct(e, t) {
1744
+ function Ot(e, t) {
1750
1745
  const { textNodeName: r } = t, s = Object.keys(e).length;
1751
1746
  return !!(s === 0 || s === 1 && (e[r] || typeof e[r] == "boolean" || e[r] === 0));
1752
1747
  }
1753
1748
  fe.prettify = It;
1754
- const { buildOptions: Ot } = z, Ft = Tt, { prettify: xt } = fe, $t = G;
1749
+ const { buildOptions: Ct } = z, Ft = Tt, { prettify: xt } = fe, $t = G;
1755
1750
  let Vt = class {
1756
1751
  constructor(t) {
1757
- this.externalEntities = {}, this.options = Ot(t);
1752
+ this.externalEntities = {}, this.options = Ct(t);
1758
1753
  }
1759
1754
  /**
1760
1755
  * Parse XML dats to JS object
@@ -1793,12 +1788,12 @@ let Vt = class {
1793
1788
  this.externalEntities[t] = r;
1794
1789
  }
1795
1790
  };
1796
- var Rt = Vt;
1797
- const St = `
1791
+ var St = Vt;
1792
+ const Lt = `
1798
1793
  `;
1799
- function Lt(e, t) {
1794
+ function Rt(e, t) {
1800
1795
  let r = "";
1801
- return t.format && t.indentBy.length > 0 && (r = St), he(e, t, "", r);
1796
+ return t.format && t.indentBy.length > 0 && (r = Lt), he(e, t, "", r);
1802
1797
  }
1803
1798
  function he(e, t, r, s) {
1804
1799
  let n = "", i = !1;
@@ -1818,14 +1813,14 @@ function he(e, t, r, s) {
1818
1813
  n += s + `<!--${u[o][0][t.textNodeName]}-->`, i = !0;
1819
1814
  continue;
1820
1815
  } else if (o[0] === "?") {
1821
- const h = ee(u[":@"], t), T = o === "?xml" ? "" : s;
1816
+ const h = D(u[":@"], t), T = o === "?xml" ? "" : s;
1822
1817
  let E = u[o][0][t.textNodeName];
1823
1818
  E = E.length !== 0 ? " " + E : "", n += T + `<${o}${E}${h}?>`, i = !0;
1824
1819
  continue;
1825
1820
  }
1826
1821
  let l = s;
1827
1822
  l !== "" && (l += t.indentBy);
1828
- const f = ee(u[":@"], t), c = s + `<${o}${f}`, g = he(u[o], t, d, l);
1823
+ const f = D(u[":@"], t), c = s + `<${o}${f}`, g = he(u[o], t, d, l);
1829
1824
  t.unpairedTags.indexOf(o) !== -1 ? t.suppressUnpairedNode ? n += c + ">" : n += c + "/>" : (!g || g.length === 0) && t.suppressEmptyNode ? n += c + "/>" : g && g.endsWith(">") ? n += c + `>${g}${s}</${o}>` : (n += c + ">", g && s !== "" && (g.includes("/>") || g.includes("</")) ? n += s + t.indentBy + g + s : n += g, n += `</${o}>`), i = !0;
1830
1825
  }
1831
1826
  return n;
@@ -1838,7 +1833,7 @@ function Mt(e) {
1838
1833
  return s;
1839
1834
  }
1840
1835
  }
1841
- function ee(e, t) {
1836
+ function D(e, t) {
1842
1837
  let r = "";
1843
1838
  if (e && !t.ignoreAttributes)
1844
1839
  for (let s in e) {
@@ -1865,7 +1860,7 @@ function pe(e, t) {
1865
1860
  }
1866
1861
  return e;
1867
1862
  }
1868
- var kt = Lt;
1863
+ var kt = Rt;
1869
1864
  const qt = kt, Ut = {
1870
1865
  attributeNamePrefix: "@_",
1871
1866
  attributesGroupName: !1,
@@ -1995,8 +1990,8 @@ function Ht(e) {
1995
1990
  return e.startsWith(this.options.attributeNamePrefix) && e !== this.options.textNodeName ? e.substr(this.attrPrefixLen) : !1;
1996
1991
  }
1997
1992
  var zt = y;
1998
- const Kt = G, Wt = Rt, Zt = zt;
1999
- var te = {
1993
+ const Kt = G, Wt = St, Zt = zt;
1994
+ var ee = {
2000
1995
  XMLParser: Wt,
2001
1996
  XMLValidator: Kt,
2002
1997
  XMLBuilder: Zt
@@ -2004,10 +1999,10 @@ var te = {
2004
1999
  function jt(e) {
2005
2000
  if (typeof e != "string")
2006
2001
  throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);
2007
- if (e = e.trim(), e.length === 0 || te.XMLValidator.validate(e) !== !0)
2002
+ if (e = e.trim(), e.length === 0 || ee.XMLValidator.validate(e) !== !0)
2008
2003
  return !1;
2009
2004
  let t;
2010
- const r = new te.XMLParser();
2005
+ const r = new ee.XMLParser();
2011
2006
  try {
2012
2007
  t = r.parse(e);
2013
2008
  } catch {
@@ -2113,7 +2108,7 @@ const Jt = function(e) {
2113
2108
  if (!("order" in e) || typeof e.order != "number")
2114
2109
  throw new Error("View order is required and must be a number");
2115
2110
  if (e.columns && e.columns.forEach((t) => {
2116
- if (!(t instanceof de))
2111
+ if (!(t instanceof ae))
2117
2112
  throw new Error("View columns must be an array of Column. Invalid column found");
2118
2113
  }), e.emptyView && typeof e.emptyView != "function")
2119
2114
  throw new Error("View emptyView must be a function");
@@ -2150,37 +2145,37 @@ const Jt = function(e) {
2150
2145
  *
2151
2146
  */
2152
2147
  const Qt = function(e) {
2153
- return S().registerEntry(e);
2148
+ return L().registerEntry(e);
2154
2149
  }, Dt = function(e) {
2155
- return S().unregisterEntry(e);
2150
+ return L().unregisterEntry(e);
2156
2151
  }, er = function(e) {
2157
- return S().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" }));
2152
+ return L().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" }));
2158
2153
  };
2159
- exports.Column = de;
2160
- exports.DefaultType = L;
2161
- exports.File = se;
2154
+ exports.Column = ae;
2155
+ exports.DefaultType = R;
2156
+ exports.File = ie;
2162
2157
  exports.FileAction = ve;
2163
- exports.FileType = O;
2164
- exports.Folder = oe;
2158
+ exports.FileType = C;
2159
+ exports.Folder = se;
2165
2160
  exports.Header = Ie;
2166
- exports.Navigation = ae;
2161
+ exports.Navigation = ue;
2167
2162
  exports.Node = q;
2168
2163
  exports.NodeStatus = k;
2169
2164
  exports.Permission = m;
2170
2165
  exports.View = Yt;
2171
2166
  exports.addNewFileMenuEntry = Qt;
2172
2167
  exports.davGetClient = xe;
2173
- exports.davGetDefaultPropfind = Oe;
2174
- exports.davGetFavoritesReport = re;
2168
+ exports.davGetDefaultPropfind = Ce;
2169
+ exports.davGetFavoritesReport = te;
2175
2170
  exports.davGetRecentSearch = Fe;
2176
- exports.davParsePermissions = ne;
2171
+ exports.davParsePermissions = re;
2177
2172
  exports.davRemoteURL = X;
2178
- exports.davResultToNode = ue;
2173
+ exports.davResultToNode = oe;
2179
2174
  exports.davRootPath = U;
2180
2175
  exports.defaultDavNamespaces = B;
2181
2176
  exports.defaultDavProperties = M;
2182
2177
  exports.formatFileSize = ye;
2183
- exports.getDavNameSpaces = C;
2178
+ exports.getDavNameSpaces = O;
2184
2179
  exports.getDavProperties = P;
2185
2180
  exports.getFavoriteNodes = $e;
2186
2181
  exports.getFileActions = Te;
@@ -2188,7 +2183,7 @@ exports.getFileListHeaders = Pe;
2188
2183
  exports.getNavigation = Ve;
2189
2184
  exports.getNewFileMenuEntries = er;
2190
2185
  exports.parseFileSize = be;
2191
- exports.registerDavProperty = Ce;
2186
+ exports.registerDavProperty = Oe;
2192
2187
  exports.registerFileAction = _e;
2193
2188
  exports.registerFileListHeaders = Ae;
2194
2189
  exports.removeNewFileMenuEntry = Dt;