@nextcloud/files 3.0.0-beta.22 → 3.0.0-beta.23

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.mjs CHANGED
@@ -1,11 +1,11 @@
1
- import { getCurrentUser as A, getRequestToken as at } from "@nextcloud/auth";
2
- import { getLoggerBuilder as j } from "@nextcloud/logger";
1
+ import { getCurrentUser as T, getRequestToken as at } from "@nextcloud/auth";
2
+ import { getLoggerBuilder as M } from "@nextcloud/logger";
3
3
  import { getCanonicalLocale as lt } from "@nextcloud/l10n";
4
- import { join as dt, basename as ut, extname as ct, dirname as _ } from "path";
4
+ import { join as dt, basename as ut, extname as ct, dirname as A } from "path";
5
5
  import { generateRemoteUrl as ht } from "@nextcloud/router";
6
6
  import { createClient as pt, getPatcher as ft } from "webdav";
7
7
  import { request as gt } from "webdav/dist/node/request.js";
8
- const mt = (t) => t === null ? j().setApp("files").build() : j().setApp("files").setUid(t.uid).build(), m = mt(A());
8
+ const mt = (t) => t === null ? M().setApp("files").build() : M().setApp("files").setUid(t.uid).build(), m = mt(T());
9
9
  class wt {
10
10
  _entries = [];
11
11
  registerEntry(e) {
@@ -44,18 +44,18 @@ class wt {
44
44
  throw new Error("Duplicate entry");
45
45
  }
46
46
  }
47
- const S = function() {
47
+ const F = function() {
48
48
  return typeof window._nc_newfilemenu > "u" && (window._nc_newfilemenu = new wt(), m.debug("NewFileMenu initialized")), window._nc_newfilemenu;
49
- }, I = ["B", "KB", "MB", "GB", "TB", "PB"], O = ["B", "KiB", "MiB", "GiB", "TiB", "PiB"];
50
- function We(t, e = !1, i = !1) {
49
+ }, O = ["B", "KB", "MB", "GB", "TB", "PB"], P = ["B", "KiB", "MiB", "GiB", "TiB", "PiB"];
50
+ function We(t, e = !1, i = !0) {
51
51
  typeof t == "string" && (t = Number(t));
52
- let s = t > 0 ? Math.floor(Math.log(t) / Math.log(i ? 1024 : 1e3)) : 0;
53
- s = Math.min((i ? O.length : I.length) - 1, s);
54
- const n = i ? O[s] : I[s];
55
- let r = (t / Math.pow(i ? 1024 : 1e3, s)).toFixed(1);
56
- return e === !0 && s === 0 ? (r !== "0.0" ? "< 1 " : "0 ") + (i ? O[1] : I[1]) : (s < 2 ? r = parseFloat(r).toFixed(0) : r = parseFloat(r).toLocaleString(lt()), r + " " + n);
52
+ let r = t > 0 ? Math.floor(Math.log(t) / Math.log(i ? 1024 : 1e3)) : 0;
53
+ r = Math.min((i ? P.length : O.length) - 1, r);
54
+ const n = i ? P[r] : O[r];
55
+ let s = (t / Math.pow(i ? 1024 : 1e3, r)).toFixed(1);
56
+ return e === !0 && r === 0 ? (s !== "0.0" ? "< 1 " : "0 ") + (i ? P[1] : O[1]) : (r < 2 ? s = parseFloat(s).toFixed(0) : s = parseFloat(s).toLocaleString(lt()), s + " " + n);
57
57
  }
58
- var H = ((t) => (t.DEFAULT = "default", t.HIDDEN = "hidden", t))(H || {});
58
+ var K = ((t) => (t.DEFAULT = "default", t.HIDDEN = "hidden", t))(K || {});
59
59
  class Ye {
60
60
  _action;
61
61
  constructor(e) {
@@ -111,7 +111,7 @@ class Ye {
111
111
  throw new Error("Invalid execBatch function");
112
112
  if ("order" in e && typeof e.order != "number")
113
113
  throw new Error("Invalid order");
114
- if (e.default && !Object.values(H).includes(e.default))
114
+ if (e.default && !Object.values(K).includes(e.default))
115
115
  throw new Error("Invalid default");
116
116
  if ("inline" in e && typeof e.inline != "function")
117
117
  throw new Error("Invalid inline function");
@@ -171,31 +171,31 @@ const ti = function(t) {
171
171
  return typeof window._nc_filelistheader > "u" && (window._nc_filelistheader = [], m.debug("FileListHeaders initialized")), window._nc_filelistheader;
172
172
  };
173
173
  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 || {});
174
- const K = ["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"], W = { d: "DAV:", nc: "http://nextcloud.org/ns", oc: "http://owncloud.org/ns", ocs: "http://open-collaboration-services.org/ns" }, ii = function(t, e = { nc: "http://nextcloud.org/ns" }) {
175
- typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...K], window._nc_dav_namespaces = { ...W });
174
+ 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" }, ii = function(t, e = { nc: "http://nextcloud.org/ns" }) {
175
+ typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...W], window._nc_dav_namespaces = { ...Y });
176
176
  const i = { ...window._nc_dav_namespaces, ...e };
177
177
  if (window._nc_dav_properties.find((n) => n === t))
178
178
  return m.error(`${t} already registered`, { prop: t }), !1;
179
179
  if (t.startsWith("<") || t.split(":").length !== 2)
180
180
  return m.error(`${t} is not valid. See example: 'oc:fileid'`, { prop: t }), !1;
181
- const s = t.split(":")[0];
182
- return i[s] ? (window._nc_dav_properties.push(t), window._nc_dav_namespaces = i, !0) : (m.error(`${t} namespace unknown`, { prop: t, namespaces: i }), !1);
183
- }, F = function() {
184
- return typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...K]), window._nc_dav_properties.map((t) => `<${t} />`).join(" ");
181
+ const r = t.split(":")[0];
182
+ return i[r] ? (window._nc_dav_properties.push(t), window._nc_dav_namespaces = i, !0) : (m.error(`${t} namespace unknown`, { prop: t, namespaces: i }), !1);
185
183
  }, V = function() {
186
- return typeof window._nc_dav_namespaces > "u" && (window._nc_dav_namespaces = { ...W }), Object.keys(window._nc_dav_namespaces).map((t) => `xmlns:${t}="${window._nc_dav_namespaces?.[t]}"`).join(" ");
184
+ return typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...W]), window._nc_dav_properties.map((t) => `<${t} />`).join(" ");
185
+ }, $ = function() {
186
+ 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(" ");
187
187
  }, ni = function() {
188
188
  return `<?xml version="1.0"?>
189
- <d:propfind ${V()}>
189
+ <d:propfind ${$()}>
190
190
  <d:prop>
191
- ${F()}
191
+ ${V()}
192
192
  </d:prop>
193
193
  </d:propfind>`;
194
194
  }, vt = function() {
195
195
  return `<?xml version="1.0"?>
196
- <oc:filter-files ${V()}>
196
+ <oc:filter-files ${$()}>
197
197
  <d:prop>
198
- ${F()}
198
+ ${V()}
199
199
  </d:prop>
200
200
  <oc:filter-rules>
201
201
  <oc:favorite>1</oc:favorite>
@@ -203,17 +203,17 @@ const K = ["d:getcontentlength", "d:getcontenttype", "d:getetag", "d:getlastmodi
203
203
  </oc:filter-files>`;
204
204
  }, ri = function(t) {
205
205
  return `<?xml version="1.0" encoding="UTF-8"?>
206
- <d:searchrequest ${V()}
206
+ <d:searchrequest ${$()}
207
207
  xmlns:ns="https://github.com/icewind1991/SearchDAV/ns">
208
208
  <d:basicsearch>
209
209
  <d:select>
210
210
  <d:prop>
211
- ${F()}
211
+ ${V()}
212
212
  </d:prop>
213
213
  </d:select>
214
214
  <d:from>
215
215
  <d:scope>
216
- <d:href>/files/${A()?.uid}/</d:href>
216
+ <d:href>/files/${T()?.uid}/</d:href>
217
217
  <d:depth>infinity</d:depth>
218
218
  </d:scope>
219
219
  </d:from>
@@ -261,10 +261,10 @@ const K = ["d:getcontentlength", "d:getcontenttype", "d:getetag", "d:getlastmodi
261
261
  let e = v.NONE;
262
262
  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;
263
263
  };
264
- var $ = ((t) => (t.Folder = "folder", t.File = "file", t))($ || {});
265
- const Y = function(t, e) {
264
+ var k = ((t) => (t.Folder = "folder", t.File = "file", t))(k || {});
265
+ const Z = function(t, e) {
266
266
  return t.match(e) !== null;
267
- }, M = (t, e) => {
267
+ }, B = (t, e) => {
268
268
  if (t.id && typeof t.id != "number")
269
269
  throw new Error("Invalid id type of value");
270
270
  if (!t.source)
@@ -296,23 +296,23 @@ const Y = function(t, e) {
296
296
  throw new Error("Root must start with a leading slash");
297
297
  if (t.root && !t.source.includes(t.root))
298
298
  throw new Error("Root must be part of the source");
299
- if (t.root && Y(t.source, e)) {
299
+ if (t.root && Z(t.source, e)) {
300
300
  const i = t.source.match(e)[0];
301
301
  if (!t.source.includes(dt(i, t.root)))
302
302
  throw new Error("The root must be relative to the service. e.g /files/emma");
303
303
  }
304
- if (t.status && !Object.values(Z).includes(t.status))
304
+ if (t.status && !Object.values(J).includes(t.status))
305
305
  throw new Error("Status must be a valid NodeStatus");
306
306
  };
307
- var Z = ((t) => (t.NEW = "new", t.FAILED = "failed", t.LOADING = "loading", t.LOCKED = "locked", t))(Z || {});
308
- class J {
307
+ var J = ((t) => (t.NEW = "new", t.FAILED = "failed", t.LOADING = "loading", t.LOCKED = "locked", t))(J || {});
308
+ class Q {
309
309
  _data;
310
310
  _attributes;
311
311
  _knownDavService = /(remote|public)\.php\/(web)?dav/i;
312
312
  constructor(e, i) {
313
- M(e, i || this._knownDavService), this._data = e;
314
- const s = { set: (n, r, l) => (this.updateMtime(), Reflect.set(n, r, l)), deleteProperty: (n, r) => (this.updateMtime(), Reflect.deleteProperty(n, r)) };
315
- this._attributes = new Proxy(e.attributes || {}, s), delete this._data.attributes, i && (this._knownDavService = i);
313
+ B(e, i || this._knownDavService), this._data = e;
314
+ const r = { set: (n, s, a) => (this.updateMtime(), Reflect.set(n, s, a)), deleteProperty: (n, s) => (this.updateMtime(), Reflect.deleteProperty(n, s)) };
315
+ this._attributes = new Proxy(e.attributes || {}, r), delete this._data.attributes, i && (this._knownDavService = i);
316
316
  }
317
317
  get source() {
318
318
  return this._data.source.replace(/\/$/i, "");
@@ -326,10 +326,10 @@ class J {
326
326
  get dirname() {
327
327
  if (this.root) {
328
328
  const i = this.source.indexOf(this.root);
329
- return _(this.source.slice(i + this.root.length) || "/");
329
+ return A(this.source.slice(i + this.root.length) || "/");
330
330
  }
331
331
  const e = new URL(this.source);
332
- return _(e.pathname);
332
+ return A(e.pathname);
333
333
  }
334
334
  get mime() {
335
335
  return this._data.mime;
@@ -353,10 +353,10 @@ class J {
353
353
  return this.isDavRessource ? this._data.owner : null;
354
354
  }
355
355
  get isDavRessource() {
356
- return Y(this.source, this._knownDavService);
356
+ return Z(this.source, this._knownDavService);
357
357
  }
358
358
  get root() {
359
- return this._data.root ? this._data.root.replace(/^(.+)\/$/, "$1") : this.isDavRessource && _(this.source).split(this._knownDavService).pop() || null;
359
+ return this._data.root ? this._data.root.replace(/^(.+)\/$/, "$1") : this.isDavRessource && A(this.source).split(this._knownDavService).pop() || null;
360
360
  }
361
361
  get path() {
362
362
  if (this.root) {
@@ -375,28 +375,28 @@ class J {
375
375
  this._data.status = e;
376
376
  }
377
377
  move(e) {
378
- M({ ...this._data, source: e }, this._knownDavService), this._data.source = e, this.updateMtime();
378
+ B({ ...this._data, source: e }, this._knownDavService), this._data.source = e, this.updateMtime();
379
379
  }
380
380
  rename(e) {
381
381
  if (e.includes("/"))
382
382
  throw new Error("Invalid basename");
383
- this.move(_(this.source) + "/" + e);
383
+ this.move(A(this.source) + "/" + e);
384
384
  }
385
385
  updateMtime() {
386
386
  this._data.mtime && (this._data.mtime = /* @__PURE__ */ new Date());
387
387
  }
388
388
  }
389
- class xt extends J {
389
+ class xt extends Q {
390
390
  get type() {
391
- return $.File;
391
+ return k.File;
392
392
  }
393
393
  }
394
- class bt extends J {
394
+ class bt extends Q {
395
395
  constructor(e) {
396
396
  super({ ...e, mime: "httpd/unix-directory" });
397
397
  }
398
398
  get type() {
399
- return $.Folder;
399
+ return k.Folder;
400
400
  }
401
401
  get extension() {
402
402
  return null;
@@ -405,12 +405,12 @@ class bt extends J {
405
405
  return "httpd/unix-directory";
406
406
  }
407
407
  }
408
- const Q = `/files/${A()?.uid}`, tt = ht("dav"), si = function(t = tt) {
408
+ const tt = `/files/${T()?.uid}`, et = ht("dav"), si = function(t = et) {
409
409
  const e = pt(t, { headers: { requesttoken: at() || "" } });
410
410
  return ft().patch("request", (i) => (i.headers?.method && (i.method = i.headers.method, delete i.headers.method), gt(i))), e;
411
- }, oi = async (t, e = "/", i = Q) => (await t.getDirectoryContents(`${i}${e}`, { details: !0, data: vt(), headers: { method: "REPORT" }, includeSelf: !0 })).data.filter((s) => s.filename !== e).map((s) => Et(s, i)), Et = function(t, e = Q, i = tt) {
412
- const s = t.props, n = yt(s?.permissions), r = A()?.uid, l = { id: s?.fileid || 0, source: `${i}${t.filename}`, mtime: new Date(Date.parse(t.lastmod)), mime: t.mime, size: s?.size || Number.parseInt(s.getcontentlength || "0"), permissions: n, owner: r, root: e, attributes: { ...t, ...s, hasPreview: s?.["has-preview"] } };
413
- return delete l.attributes?.props, t.type === "file" ? new xt(l) : new bt(l);
411
+ }, oi = async (t, e = "/", i = tt) => (await t.getDirectoryContents(`${i}${e}`, { details: !0, data: vt(), headers: { method: "REPORT" }, includeSelf: !0 })).data.filter((r) => r.filename !== e).map((r) => Et(r, i)), Et = function(t, e = tt, i = et) {
412
+ const r = t.props, n = yt(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"] } };
413
+ return delete a.attributes?.props, t.type === "file" ? new xt(a) : new bt(a);
414
414
  };
415
415
  class Nt {
416
416
  _views = [];
@@ -421,7 +421,7 @@ class Nt {
421
421
  this._views.push(e);
422
422
  }
423
423
  remove(e) {
424
- const i = this._views.findIndex((s) => s.id === e);
424
+ const i = this._views.findIndex((r) => r.id === e);
425
425
  i !== -1 && this._views.splice(i, 1);
426
426
  }
427
427
  get views() {
@@ -471,142 +471,142 @@ const At = function(t) {
471
471
  throw new Error("Column summary must be a function");
472
472
  return !0;
473
473
  };
474
- var k = {}, T = {};
474
+ var L = {}, I = {};
475
475
  (function(t) {
476
- const e = ":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", i = e + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040", s = "[" + e + "][" + i + "]*", n = new RegExp("^" + s + "$"), r = function(o, a) {
476
+ const e = ":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", i = e + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040", r = "[" + e + "][" + i + "]*", n = new RegExp("^" + r + "$"), s = function(o, l) {
477
477
  const d = [];
478
- let u = a.exec(o);
478
+ let u = l.exec(o);
479
479
  for (; u; ) {
480
- const h = [];
481
- h.startIndex = a.lastIndex - u[0].length;
482
- const c = u.length;
483
- for (let f = 0; f < c; f++)
484
- h.push(u[f]);
485
- d.push(h), u = a.exec(o);
480
+ const c = [];
481
+ c.startIndex = l.lastIndex - u[0].length;
482
+ const p = u.length;
483
+ for (let h = 0; h < p; h++)
484
+ c.push(u[h]);
485
+ d.push(c), u = l.exec(o);
486
486
  }
487
487
  return d;
488
- }, l = function(o) {
489
- const a = n.exec(o);
490
- return !(a === null || typeof a > "u");
488
+ }, a = function(o) {
489
+ const l = n.exec(o);
490
+ return !(l === null || typeof l > "u");
491
491
  };
492
492
  t.isExist = function(o) {
493
493
  return typeof o < "u";
494
494
  }, t.isEmptyObject = function(o) {
495
495
  return Object.keys(o).length === 0;
496
- }, t.merge = function(o, a, d) {
497
- if (a) {
498
- const u = Object.keys(a), h = u.length;
499
- for (let c = 0; c < h; c++)
500
- d === "strict" ? o[u[c]] = [a[u[c]]] : o[u[c]] = a[u[c]];
496
+ }, t.merge = function(o, l, d) {
497
+ if (l) {
498
+ const u = Object.keys(l), c = u.length;
499
+ for (let p = 0; p < c; p++)
500
+ d === "strict" ? o[u[p]] = [l[u[p]]] : o[u[p]] = l[u[p]];
501
501
  }
502
502
  }, t.getValue = function(o) {
503
503
  return t.isExist(o) ? o : "";
504
- }, t.isName = l, t.getAllMatches = r, t.nameRegexp = s;
505
- })(T);
506
- const L = T, Tt = { allowBooleanAttributes: !1, unpairedTags: [] };
507
- k.validate = function(t, e) {
504
+ }, t.isName = a, t.getAllMatches = s, t.nameRegexp = r;
505
+ })(I);
506
+ const R = I, Tt = { allowBooleanAttributes: !1, unpairedTags: [] };
507
+ L.validate = function(t, e) {
508
508
  e = Object.assign({}, Tt, e);
509
509
  const i = [];
510
- let s = !1, n = !1;
510
+ let r = !1, n = !1;
511
511
  t[0] === "\uFEFF" && (t = t.substr(1));
512
- for (let r = 0; r < t.length; r++)
513
- if (t[r] === "<" && t[r + 1] === "?") {
514
- if (r += 2, r = q(t, r), r.err)
515
- return r;
516
- } else if (t[r] === "<") {
517
- let l = r;
518
- if (r++, t[r] === "!") {
519
- r = U(t, r);
512
+ for (let s = 0; s < t.length; s++)
513
+ if (t[s] === "<" && t[s + 1] === "?") {
514
+ if (s += 2, s = U(t, s), s.err)
515
+ return s;
516
+ } else if (t[s] === "<") {
517
+ let a = s;
518
+ if (s++, t[s] === "!") {
519
+ s = z(t, s);
520
520
  continue;
521
521
  } else {
522
522
  let o = !1;
523
- t[r] === "/" && (o = !0, r++);
524
- let a = "";
525
- for (; r < t.length && t[r] !== ">" && t[r] !== " " && t[r] !== " " && t[r] !== `
526
- ` && t[r] !== "\r"; r++)
527
- a += t[r];
528
- if (a = a.trim(), a[a.length - 1] === "/" && (a = a.substring(0, a.length - 1), r--), !Vt(a)) {
529
- let h;
530
- return a.trim().length === 0 ? h = "Invalid space after '<'." : h = "Tag '" + a + "' is an invalid name.", p("InvalidTag", h, g(t, r));
523
+ t[s] === "/" && (o = !0, s++);
524
+ let l = "";
525
+ for (; s < t.length && t[s] !== ">" && t[s] !== " " && t[s] !== " " && t[s] !== `
526
+ ` && t[s] !== "\r"; s++)
527
+ l += t[s];
528
+ if (l = l.trim(), l[l.length - 1] === "/" && (l = l.substring(0, l.length - 1), s--), !Vt(l)) {
529
+ let c;
530
+ return l.trim().length === 0 ? c = "Invalid space after '<'." : c = "Tag '" + l + "' is an invalid name.", f("InvalidTag", c, g(t, s));
531
531
  }
532
- const d = Pt(t, r);
532
+ const d = Pt(t, s);
533
533
  if (d === !1)
534
- return p("InvalidAttr", "Attributes for '" + a + "' have open quote.", g(t, r));
534
+ return f("InvalidAttr", "Attributes for '" + l + "' have open quote.", g(t, s));
535
535
  let u = d.value;
536
- if (r = d.index, u[u.length - 1] === "/") {
537
- const h = r - u.length;
536
+ if (s = d.index, u[u.length - 1] === "/") {
537
+ const c = s - u.length;
538
538
  u = u.substring(0, u.length - 1);
539
- const c = z(u, e);
540
- if (c === !0)
541
- s = !0;
539
+ const p = G(u, e);
540
+ if (p === !0)
541
+ r = !0;
542
542
  else
543
- return p(c.err.code, c.err.msg, g(t, h + c.err.line));
543
+ return f(p.err.code, p.err.msg, g(t, c + p.err.line));
544
544
  } else if (o)
545
545
  if (d.tagClosed) {
546
546
  if (u.trim().length > 0)
547
- return p("InvalidTag", "Closing tag '" + a + "' can't have attributes or invalid starting.", g(t, l));
547
+ return f("InvalidTag", "Closing tag '" + l + "' can't have attributes or invalid starting.", g(t, a));
548
548
  {
549
- const h = i.pop();
550
- if (a !== h.tagName) {
551
- let c = g(t, h.tagStartPos);
552
- return p("InvalidTag", "Expected closing tag '" + h.tagName + "' (opened in line " + c.line + ", col " + c.col + ") instead of closing tag '" + a + "'.", g(t, l));
549
+ const c = i.pop();
550
+ if (l !== c.tagName) {
551
+ let p = g(t, c.tagStartPos);
552
+ return f("InvalidTag", "Expected closing tag '" + c.tagName + "' (opened in line " + p.line + ", col " + p.col + ") instead of closing tag '" + l + "'.", g(t, a));
553
553
  }
554
554
  i.length == 0 && (n = !0);
555
555
  }
556
556
  } else
557
- return p("InvalidTag", "Closing tag '" + a + "' doesn't have proper closing.", g(t, r));
557
+ return f("InvalidTag", "Closing tag '" + l + "' doesn't have proper closing.", g(t, s));
558
558
  else {
559
- const h = z(u, e);
560
- if (h !== !0)
561
- return p(h.err.code, h.err.msg, g(t, r - u.length + h.err.line));
559
+ const c = G(u, e);
560
+ if (c !== !0)
561
+ return f(c.err.code, c.err.msg, g(t, s - u.length + c.err.line));
562
562
  if (n === !0)
563
- return p("InvalidXml", "Multiple possible root nodes found.", g(t, r));
564
- e.unpairedTags.indexOf(a) !== -1 || i.push({ tagName: a, tagStartPos: l }), s = !0;
563
+ return f("InvalidXml", "Multiple possible root nodes found.", g(t, s));
564
+ e.unpairedTags.indexOf(l) !== -1 || i.push({ tagName: l, tagStartPos: a }), r = !0;
565
565
  }
566
- for (r++; r < t.length; r++)
567
- if (t[r] === "<")
568
- if (t[r + 1] === "!") {
569
- r++, r = U(t, r);
566
+ for (s++; s < t.length; s++)
567
+ if (t[s] === "<")
568
+ if (t[s + 1] === "!") {
569
+ s++, s = z(t, s);
570
570
  continue;
571
- } else if (t[r + 1] === "?") {
572
- if (r = q(t, ++r), r.err)
573
- return r;
571
+ } else if (t[s + 1] === "?") {
572
+ if (s = U(t, ++s), s.err)
573
+ return s;
574
574
  } else
575
575
  break;
576
- else if (t[r] === "&") {
577
- const h = St(t, r);
578
- if (h == -1)
579
- return p("InvalidChar", "char '&' is not expected.", g(t, r));
580
- r = h;
581
- } else if (n === !0 && !B(t[r]))
582
- return p("InvalidXml", "Extra text at the end", g(t, r));
583
- t[r] === "<" && r--;
576
+ else if (t[s] === "&") {
577
+ const c = St(t, s);
578
+ if (c == -1)
579
+ return f("InvalidChar", "char '&' is not expected.", g(t, s));
580
+ s = c;
581
+ } else if (n === !0 && !q(t[s]))
582
+ return f("InvalidXml", "Extra text at the end", g(t, s));
583
+ t[s] === "<" && s--;
584
584
  }
585
585
  } else {
586
- if (B(t[r]))
586
+ if (q(t[s]))
587
587
  continue;
588
- return p("InvalidChar", "char '" + t[r] + "' is not expected.", g(t, r));
588
+ return f("InvalidChar", "char '" + t[s] + "' is not expected.", g(t, s));
589
589
  }
590
- if (s) {
590
+ if (r) {
591
591
  if (i.length == 1)
592
- return p("InvalidTag", "Unclosed tag '" + i[0].tagName + "'.", g(t, i[0].tagStartPos));
592
+ return f("InvalidTag", "Unclosed tag '" + i[0].tagName + "'.", g(t, i[0].tagStartPos));
593
593
  if (i.length > 0)
594
- return p("InvalidXml", "Invalid '" + JSON.stringify(i.map((r) => r.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
594
+ return f("InvalidXml", "Invalid '" + JSON.stringify(i.map((s) => s.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
595
595
  } else
596
- return p("InvalidXml", "Start tag expected.", 1);
596
+ return f("InvalidXml", "Start tag expected.", 1);
597
597
  return !0;
598
598
  };
599
- function B(t) {
599
+ function q(t) {
600
600
  return t === " " || t === " " || t === `
601
601
  ` || t === "\r";
602
602
  }
603
- function q(t, e) {
603
+ function U(t, e) {
604
604
  const i = e;
605
605
  for (; e < t.length; e++)
606
606
  if (t[e] == "?" || t[e] == " ") {
607
- const s = t.substr(i, e - i);
608
- if (e > 5 && s === "xml")
609
- return p("InvalidXml", "XML declaration allowed only at the start of the document.", g(t, e));
607
+ const r = t.substr(i, e - i);
608
+ if (e > 5 && r === "xml")
609
+ return f("InvalidXml", "XML declaration allowed only at the start of the document.", g(t, e));
610
610
  if (t[e] == "?" && t[e + 1] == ">") {
611
611
  e++;
612
612
  break;
@@ -615,7 +615,7 @@ function q(t, e) {
615
615
  }
616
616
  return e;
617
617
  }
618
- function U(t, e) {
618
+ function z(t, e) {
619
619
  if (t.length > e + 5 && t[e + 1] === "-" && t[e + 2] === "-") {
620
620
  for (e += 3; e < t.length; e++)
621
621
  if (t[e] === "-" && t[e + 1] === "-" && t[e + 2] === ">") {
@@ -640,35 +640,35 @@ function U(t, e) {
640
640
  }
641
641
  const It = '"', Ot = "'";
642
642
  function Pt(t, e) {
643
- let i = "", s = "", n = !1;
643
+ let i = "", r = "", n = !1;
644
644
  for (; e < t.length; e++) {
645
645
  if (t[e] === It || t[e] === Ot)
646
- s === "" ? s = t[e] : s !== t[e] || (s = "");
647
- else if (t[e] === ">" && s === "") {
646
+ r === "" ? r = t[e] : r !== t[e] || (r = "");
647
+ else if (t[e] === ">" && r === "") {
648
648
  n = !0;
649
649
  break;
650
650
  }
651
651
  i += t[e];
652
652
  }
653
- return s !== "" ? !1 : { value: i, index: e, tagClosed: n };
653
+ return r !== "" ? !1 : { value: i, index: e, tagClosed: n };
654
654
  }
655
655
  const Ct = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
656
- function z(t, e) {
657
- const i = L.getAllMatches(t, Ct), s = {};
656
+ function G(t, e) {
657
+ const i = R.getAllMatches(t, Ct), r = {};
658
658
  for (let n = 0; n < i.length; n++) {
659
659
  if (i[n][1].length === 0)
660
- return p("InvalidAttr", "Attribute '" + i[n][2] + "' has no space in starting.", b(i[n]));
660
+ return f("InvalidAttr", "Attribute '" + i[n][2] + "' has no space in starting.", E(i[n]));
661
661
  if (i[n][3] !== void 0 && i[n][4] === void 0)
662
- return p("InvalidAttr", "Attribute '" + i[n][2] + "' is without value.", b(i[n]));
662
+ return f("InvalidAttr", "Attribute '" + i[n][2] + "' is without value.", E(i[n]));
663
663
  if (i[n][3] === void 0 && !e.allowBooleanAttributes)
664
- return p("InvalidAttr", "boolean attribute '" + i[n][2] + "' is not allowed.", b(i[n]));
665
- const r = i[n][2];
666
- if (!Ft(r))
667
- return p("InvalidAttr", "Attribute '" + r + "' is an invalid name.", b(i[n]));
668
- if (!s.hasOwnProperty(r))
669
- s[r] = 1;
664
+ return f("InvalidAttr", "boolean attribute '" + i[n][2] + "' is not allowed.", E(i[n]));
665
+ const s = i[n][2];
666
+ if (!Ft(s))
667
+ return f("InvalidAttr", "Attribute '" + s + "' is an invalid name.", E(i[n]));
668
+ if (!r.hasOwnProperty(s))
669
+ r[s] = 1;
670
670
  else
671
- return p("InvalidAttr", "Attribute '" + r + "' is repeated.", b(i[n]));
671
+ return f("InvalidAttr", "Attribute '" + s + "' is repeated.", E(i[n]));
672
672
  }
673
673
  return !0;
674
674
  }
@@ -696,33 +696,33 @@ function St(t, e) {
696
696
  }
697
697
  return e;
698
698
  }
699
- function p(t, e, i) {
699
+ function f(t, e, i) {
700
700
  return { err: { code: t, msg: e, line: i.line || i, col: i.col } };
701
701
  }
702
702
  function Ft(t) {
703
- return L.isName(t);
703
+ return R.isName(t);
704
704
  }
705
705
  function Vt(t) {
706
- return L.isName(t);
706
+ return R.isName(t);
707
707
  }
708
708
  function g(t, e) {
709
709
  const i = t.substring(0, e).split(/\r?\n/);
710
710
  return { line: i.length, col: i[i.length - 1].length + 1 };
711
711
  }
712
- function b(t) {
712
+ function E(t) {
713
713
  return t.startIndex + t[1].length;
714
714
  }
715
- var P = {};
716
- const et = { preserveOrder: !1, attributeNamePrefix: "@_", attributesGroupName: !1, textNodeName: "#text", ignoreAttributes: !0, removeNSPrefix: !1, allowBooleanAttributes: !1, parseTagValue: !0, parseAttributeValue: !1, trimValues: !0, cdataPropName: !1, numberParseOptions: { hex: !0, leadingZeros: !0, eNotation: !0 }, tagValueProcessor: function(t, e) {
715
+ var C = {};
716
+ const it = { preserveOrder: !1, attributeNamePrefix: "@_", attributesGroupName: !1, textNodeName: "#text", ignoreAttributes: !0, removeNSPrefix: !1, allowBooleanAttributes: !1, parseTagValue: !0, parseAttributeValue: !1, trimValues: !0, cdataPropName: !1, numberParseOptions: { hex: !0, leadingZeros: !0, eNotation: !0 }, tagValueProcessor: function(t, e) {
717
717
  return e;
718
718
  }, attributeValueProcessor: function(t, e) {
719
719
  return e;
720
720
  }, 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) {
721
721
  return t;
722
722
  } }, $t = function(t) {
723
- return Object.assign({}, et, t);
723
+ return Object.assign({}, it, t);
724
724
  };
725
- P.buildOptions = $t, P.defaultOptions = et;
725
+ C.buildOptions = $t, C.defaultOptions = it;
726
726
  class kt {
727
727
  constructor(e) {
728
728
  this.tagname = e, this.child = [], this[":@"] = {};
@@ -735,14 +735,14 @@ class kt {
735
735
  }
736
736
  }
737
737
  var Lt = kt;
738
- const Rt = T;
738
+ const Rt = I;
739
739
  function jt(t, e) {
740
740
  const i = {};
741
741
  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") {
742
742
  e = e + 9;
743
- let s = 1, n = !1, r = !1, l = "";
743
+ let r = 1, n = !1, s = !1, a = "";
744
744
  for (; e < t.length; e++)
745
- if (t[e] === "<" && !r) {
745
+ if (t[e] === "<" && !s) {
746
746
  if (n && qt(t, e))
747
747
  e += 7, [entityName, val, e] = Mt(t, e + 1), val.indexOf("&") === -1 && (i[Xt(entityName)] = { regx: RegExp(`&${entityName};`, "g"), val });
748
748
  else if (n && Ut(t, e))
@@ -752,16 +752,16 @@ function jt(t, e) {
752
752
  else if (n && Gt(t, e))
753
753
  e += 9;
754
754
  else if (Bt)
755
- r = !0;
755
+ s = !0;
756
756
  else
757
757
  throw new Error("Invalid DOCTYPE");
758
- s++, l = "";
758
+ r++, a = "";
759
759
  } else if (t[e] === ">") {
760
- if (r ? t[e - 1] === "-" && t[e - 2] === "-" && (r = !1, s--) : s--, s === 0)
760
+ if (s ? t[e - 1] === "-" && t[e - 2] === "-" && (s = !1, r--) : r--, r === 0)
761
761
  break;
762
762
  } else
763
- t[e] === "[" ? n = !0 : l += t[e];
764
- if (s !== 0)
763
+ t[e] === "[" ? n = !0 : a += t[e];
764
+ if (r !== 0)
765
765
  throw new Error("Unclosed DOCTYPE");
766
766
  } else
767
767
  throw new Error("Invalid Tag instead of DOCTYPE");
@@ -773,9 +773,9 @@ function Mt(t, e) {
773
773
  i += t[e];
774
774
  if (i = i.trim(), i.indexOf(" ") !== -1)
775
775
  throw new Error("External entites are not supported");
776
- const s = t[e++];
776
+ const r = t[e++];
777
777
  let n = "";
778
- for (; e < t.length && t[e] !== s; e++)
778
+ for (; e < t.length && t[e] !== r; e++)
779
779
  n += t[e];
780
780
  return [i, n, e];
781
781
  }
@@ -812,16 +812,16 @@ function Zt(t, e = {}) {
812
812
  if (e.hex && Kt.test(i))
813
813
  return Number.parseInt(i, 16);
814
814
  {
815
- const s = Wt.exec(i);
816
- if (s) {
817
- const n = s[1], r = s[2];
818
- let l = Jt(s[3]);
819
- const o = s[4] || s[6];
820
- if (!e.leadingZeros && r.length > 0 && n && i[2] !== "." || !e.leadingZeros && r.length > 0 && !n && i[1] !== ".")
815
+ const r = Wt.exec(i);
816
+ if (r) {
817
+ const n = r[1], s = r[2];
818
+ let a = Jt(r[3]);
819
+ const o = r[4] || r[6];
820
+ if (!e.leadingZeros && s.length > 0 && n && i[2] !== "." || !e.leadingZeros && s.length > 0 && !n && i[1] !== ".")
821
821
  return t;
822
822
  {
823
- const a = Number(i), d = "" + a;
824
- return d.search(/[eE]/) !== -1 || o ? e.eNotation ? a : t : i.indexOf(".") !== -1 ? d === "0" && l === "" || d === l || n && d === "-" + l ? a : t : r ? l === d || n + l === d ? a : t : i === d || i === n + d ? a : t;
823
+ const l = Number(i), d = "" + l;
824
+ return d.search(/[eE]/) !== -1 || o ? e.eNotation ? l : t : i.indexOf(".") !== -1 ? d === "0" && a === "" || d === a || n && d === "-" + a ? l : t : s ? a === d || n + a === d ? l : t : i === d || i === n + d ? l : t;
825
825
  }
826
826
  } else
827
827
  return t;
@@ -831,8 +831,8 @@ function Jt(t) {
831
831
  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;
832
832
  }
833
833
  var Qt = Zt;
834
- const R = T, E = Lt, te = Ht, ee = Qt;
835
- "<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g, R.nameRegexp);
834
+ const j = I, N = Lt, te = Ht, ee = Qt;
835
+ "<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g, j.nameRegexp);
836
836
  let ie = class {
837
837
  constructor(t) {
838
838
  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 = ne, this.parseXml = le, this.parseTextData = re, this.resolveNameSpace = se, this.buildAttributesMap = ae, this.isItStopNode = he, this.replaceEntitiesValue = ue, this.readStopNodeData = fe, this.saveTextToParentTag = ce, this.addChild = de;
@@ -841,15 +841,15 @@ let ie = class {
841
841
  function ne(t) {
842
842
  const e = Object.keys(t);
843
843
  for (let i = 0; i < e.length; i++) {
844
- const s = e[i];
845
- this.lastEntities[s] = { regex: new RegExp("&" + s + ";", "g"), val: t[s] };
844
+ const r = e[i];
845
+ this.lastEntities[r] = { regex: new RegExp("&" + r + ";", "g"), val: t[r] };
846
846
  }
847
847
  }
848
- function re(t, e, i, s, n, r, l) {
849
- if (t !== void 0 && (this.options.trimValues && !s && (t = t.trim()), t.length > 0)) {
850
- l || (t = this.replaceEntitiesValue(t));
851
- const o = this.options.tagValueProcessor(e, t, i, n, r);
852
- return o == null ? t : typeof o != typeof t || o !== t ? o : this.options.trimValues ? D(t, this.options.parseTagValue, this.options.numberParseOptions) : t.trim() === t ? D(t, this.options.parseTagValue, this.options.numberParseOptions) : t;
848
+ function re(t, e, i, r, n, s, a) {
849
+ if (t !== void 0 && (this.options.trimValues && !r && (t = t.trim()), t.length > 0)) {
850
+ a || (t = this.replaceEntitiesValue(t));
851
+ const o = this.options.tagValueProcessor(e, t, i, n, s);
852
+ 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;
853
853
  }
854
854
  }
855
855
  function se(t) {
@@ -864,112 +864,114 @@ function se(t) {
864
864
  const oe = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
865
865
  function ae(t, e, i) {
866
866
  if (!this.options.ignoreAttributes && typeof t == "string") {
867
- const s = R.getAllMatches(t, oe), n = s.length, r = {};
868
- for (let l = 0; l < n; l++) {
869
- const o = this.resolveNameSpace(s[l][1]);
870
- let a = s[l][4], d = this.options.attributeNamePrefix + o;
867
+ const r = j.getAllMatches(t, oe), n = r.length, s = {};
868
+ for (let a = 0; a < n; a++) {
869
+ const o = this.resolveNameSpace(r[a][1]);
870
+ let l = r[a][4], d = this.options.attributeNamePrefix + o;
871
871
  if (o.length)
872
- if (this.options.transformAttributeName && (d = this.options.transformAttributeName(d)), d === "__proto__" && (d = "#__proto__"), a !== void 0) {
873
- this.options.trimValues && (a = a.trim()), a = this.replaceEntitiesValue(a);
874
- const u = this.options.attributeValueProcessor(o, a, e);
875
- u == null ? r[d] = a : typeof u != typeof a || u !== a ? r[d] = u : r[d] = D(a, this.options.parseAttributeValue, this.options.numberParseOptions);
872
+ if (this.options.transformAttributeName && (d = this.options.transformAttributeName(d)), d === "__proto__" && (d = "#__proto__"), l !== void 0) {
873
+ this.options.trimValues && (l = l.trim()), l = this.replaceEntitiesValue(l);
874
+ const u = this.options.attributeValueProcessor(o, l, e);
875
+ u == null ? s[d] = l : typeof u != typeof l || u !== l ? s[d] = u : s[d] = S(l, this.options.parseAttributeValue, this.options.numberParseOptions);
876
876
  } else
877
- this.options.allowBooleanAttributes && (r[d] = !0);
877
+ this.options.allowBooleanAttributes && (s[d] = !0);
878
878
  }
879
- if (!Object.keys(r).length)
879
+ if (!Object.keys(s).length)
880
880
  return;
881
881
  if (this.options.attributesGroupName) {
882
- const l = {};
883
- return l[this.options.attributesGroupName] = r, l;
882
+ const a = {};
883
+ return a[this.options.attributesGroupName] = s, a;
884
884
  }
885
- return r;
885
+ return s;
886
886
  }
887
887
  }
888
888
  const le = function(t) {
889
889
  t = t.replace(/\r\n?/g, `
890
890
  `);
891
- const e = new E("!xml");
892
- let i = e, s = "", n = "";
893
- for (let r = 0; r < t.length; r++)
894
- if (t[r] === "<")
895
- if (t[r + 1] === "/") {
896
- const l = x(t, ">", r, "Closing Tag is not closed.");
897
- let o = t.substring(r + 2, l).trim();
891
+ const e = new N("!xml");
892
+ let i = e, r = "", n = "";
893
+ for (let s = 0; s < t.length; s++)
894
+ if (t[s] === "<")
895
+ if (t[s + 1] === "/") {
896
+ const a = x(t, ">", s, "Closing Tag is not closed.");
897
+ let o = t.substring(s + 2, a).trim();
898
898
  if (this.options.removeNSPrefix) {
899
899
  const u = o.indexOf(":");
900
900
  u !== -1 && (o = o.substr(u + 1));
901
901
  }
902
- this.options.transformTagName && (o = this.options.transformTagName(o)), i && (s = this.saveTextToParentTag(s, i, n));
903
- const a = n.substring(n.lastIndexOf(".") + 1);
902
+ this.options.transformTagName && (o = this.options.transformTagName(o)), i && (r = this.saveTextToParentTag(r, i, n));
903
+ const l = n.substring(n.lastIndexOf(".") + 1);
904
904
  if (o && this.options.unpairedTags.indexOf(o) !== -1)
905
905
  throw new Error(`Unpaired tag can not be used as closing tag: </${o}>`);
906
906
  let d = 0;
907
- a && this.options.unpairedTags.indexOf(a) !== -1 ? (d = n.lastIndexOf(".", n.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : d = n.lastIndexOf("."), n = n.substring(0, d), i = this.tagsNodeStack.pop(), s = "", r = l;
908
- } else if (t[r + 1] === "?") {
909
- let l = C(t, r, !1, "?>");
910
- if (!l)
907
+ l && this.options.unpairedTags.indexOf(l) !== -1 ? (d = n.lastIndexOf(".", n.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : d = n.lastIndexOf("."), n = n.substring(0, d), i = this.tagsNodeStack.pop(), r = "", s = a;
908
+ } else if (t[s + 1] === "?") {
909
+ let a = D(t, s, !1, "?>");
910
+ if (!a)
911
911
  throw new Error("Pi Tag is not closed.");
912
- if (s = this.saveTextToParentTag(s, i, n), !(this.options.ignoreDeclaration && l.tagName === "?xml" || this.options.ignorePiTags)) {
913
- const o = new E(l.tagName);
914
- o.add(this.options.textNodeName, ""), l.tagName !== l.tagExp && l.attrExpPresent && (o[":@"] = this.buildAttributesMap(l.tagExp, n, l.tagName)), this.addChild(i, o, n);
912
+ if (r = this.saveTextToParentTag(r, i, n), !(this.options.ignoreDeclaration && a.tagName === "?xml" || this.options.ignorePiTags)) {
913
+ const o = new N(a.tagName);
914
+ o.add(this.options.textNodeName, ""), a.tagName !== a.tagExp && a.attrExpPresent && (o[":@"] = this.buildAttributesMap(a.tagExp, n, a.tagName)), this.addChild(i, o, n);
915
915
  }
916
- r = l.closeIndex + 1;
917
- } else if (t.substr(r + 1, 3) === "!--") {
918
- const l = x(t, "-->", r + 4, "Comment is not closed.");
916
+ s = a.closeIndex + 1;
917
+ } else if (t.substr(s + 1, 3) === "!--") {
918
+ const a = x(t, "-->", s + 4, "Comment is not closed.");
919
919
  if (this.options.commentPropName) {
920
- const o = t.substring(r + 4, l - 2);
921
- s = this.saveTextToParentTag(s, i, n), i.add(this.options.commentPropName, [{ [this.options.textNodeName]: o }]);
920
+ const o = t.substring(s + 4, a - 2);
921
+ r = this.saveTextToParentTag(r, i, n), i.add(this.options.commentPropName, [{ [this.options.textNodeName]: o }]);
922
922
  }
923
- r = l;
924
- } else if (t.substr(r + 1, 2) === "!D") {
925
- const l = te(t, r);
926
- this.docTypeEntities = l.entities, r = l.i;
927
- } else if (t.substr(r + 1, 2) === "![") {
928
- const l = x(t, "]]>", r, "CDATA is not closed.") - 2, o = t.substring(r + 9, l);
929
- if (s = this.saveTextToParentTag(s, i, n), this.options.cdataPropName)
923
+ s = a;
924
+ } else if (t.substr(s + 1, 2) === "!D") {
925
+ const a = te(t, s);
926
+ this.docTypeEntities = a.entities, s = a.i;
927
+ } else if (t.substr(s + 1, 2) === "![") {
928
+ const a = x(t, "]]>", s, "CDATA is not closed.") - 2, o = t.substring(s + 9, a);
929
+ if (r = this.saveTextToParentTag(r, i, n), this.options.cdataPropName)
930
930
  i.add(this.options.cdataPropName, [{ [this.options.textNodeName]: o }]);
931
931
  else {
932
- let a = this.parseTextData(o, i.tagname, n, !0, !1, !0);
933
- a == null && (a = ""), i.add(this.options.textNodeName, a);
932
+ let l = this.parseTextData(o, i.tagname, n, !0, !1, !0);
933
+ l == null && (l = ""), i.add(this.options.textNodeName, l);
934
934
  }
935
- r = l + 2;
935
+ s = a + 2;
936
936
  } else {
937
- let l = C(t, r, this.options.removeNSPrefix), o = l.tagName, a = l.tagExp, d = l.attrExpPresent, u = l.closeIndex;
938
- this.options.transformTagName && (o = this.options.transformTagName(o)), i && s && i.tagname !== "!xml" && (s = this.saveTextToParentTag(s, i, n, !1));
939
- const h = i;
940
- if (h && this.options.unpairedTags.indexOf(h.tagname) !== -1 && (i = this.tagsNodeStack.pop(), n = n.substring(0, n.lastIndexOf("."))), o !== e.tagname && (n += n ? "." + o : o), this.isItStopNode(this.options.stopNodes, n, o)) {
941
- let c = "";
942
- if (a.length > 0 && a.lastIndexOf("/") === a.length - 1)
943
- r = l.closeIndex;
937
+ let a = D(t, s, this.options.removeNSPrefix), o = a.tagName;
938
+ const l = a.rawTagName;
939
+ let d = a.tagExp, u = a.attrExpPresent, c = a.closeIndex;
940
+ this.options.transformTagName && (o = this.options.transformTagName(o)), i && r && i.tagname !== "!xml" && (r = this.saveTextToParentTag(r, i, n, !1));
941
+ const p = i;
942
+ if (p && this.options.unpairedTags.indexOf(p.tagname) !== -1 && (i = this.tagsNodeStack.pop(), n = n.substring(0, n.lastIndexOf("."))), o !== e.tagname && (n += n ? "." + o : o), this.isItStopNode(this.options.stopNodes, n, o)) {
943
+ let h = "";
944
+ if (d.length > 0 && d.lastIndexOf("/") === d.length - 1)
945
+ s = a.closeIndex;
944
946
  else if (this.options.unpairedTags.indexOf(o) !== -1)
945
- r = l.closeIndex;
947
+ s = a.closeIndex;
946
948
  else {
947
- const w = this.readStopNodeData(t, o, u + 1);
948
- if (!w)
949
- throw new Error(`Unexpected end of ${o}`);
950
- r = w.i, c = w.tagContent;
949
+ const b = this.readStopNodeData(t, l, c + 1);
950
+ if (!b)
951
+ throw new Error(`Unexpected end of ${l}`);
952
+ s = b.i, h = b.tagContent;
951
953
  }
952
- const f = new E(o);
953
- o !== a && d && (f[":@"] = this.buildAttributesMap(a, n, o)), c && (c = this.parseTextData(c, o, n, !0, d, !0, !0)), n = n.substr(0, n.lastIndexOf(".")), f.add(this.options.textNodeName, c), this.addChild(i, f, n);
954
+ const w = new N(o);
955
+ o !== d && u && (w[":@"] = this.buildAttributesMap(d, n, o)), h && (h = this.parseTextData(h, o, n, !0, u, !0, !0)), n = n.substr(0, n.lastIndexOf(".")), w.add(this.options.textNodeName, h), this.addChild(i, w, n);
954
956
  } else {
955
- if (a.length > 0 && a.lastIndexOf("/") === a.length - 1) {
956
- o[o.length - 1] === "/" ? (o = o.substr(0, o.length - 1), n = n.substr(0, n.length - 1), a = o) : a = a.substr(0, a.length - 1), this.options.transformTagName && (o = this.options.transformTagName(o));
957
- const c = new E(o);
958
- o !== a && d && (c[":@"] = this.buildAttributesMap(a, n, o)), this.addChild(i, c, n), n = n.substr(0, n.lastIndexOf("."));
957
+ if (d.length > 0 && d.lastIndexOf("/") === d.length - 1) {
958
+ o[o.length - 1] === "/" ? (o = o.substr(0, o.length - 1), n = n.substr(0, n.length - 1), d = o) : d = d.substr(0, d.length - 1), this.options.transformTagName && (o = this.options.transformTagName(o));
959
+ const h = new N(o);
960
+ o !== d && u && (h[":@"] = this.buildAttributesMap(d, n, o)), this.addChild(i, h, n), n = n.substr(0, n.lastIndexOf("."));
959
961
  } else {
960
- const c = new E(o);
961
- this.tagsNodeStack.push(i), o !== a && d && (c[":@"] = this.buildAttributesMap(a, n, o)), this.addChild(i, c, n), i = c;
962
+ const h = new N(o);
963
+ this.tagsNodeStack.push(i), o !== d && u && (h[":@"] = this.buildAttributesMap(d, n, o)), this.addChild(i, h, n), i = h;
962
964
  }
963
- s = "", r = u;
965
+ r = "", s = c;
964
966
  }
965
967
  }
966
968
  else
967
- s += t[r];
969
+ r += t[s];
968
970
  return e.child;
969
971
  };
970
972
  function de(t, e, i) {
971
- const s = this.options.updateTag(e.tagname, i, e[":@"]);
972
- s === !1 || (typeof s == "string" && (e.tagname = s), t.addChild(e));
973
+ const r = this.options.updateTag(e.tagname, i, e[":@"]);
974
+ r === !1 || (typeof r == "string" && (e.tagname = r), t.addChild(e));
973
975
  }
974
976
  const ue = function(t) {
975
977
  if (this.options.processEntities) {
@@ -990,66 +992,68 @@ const ue = function(t) {
990
992
  }
991
993
  return t;
992
994
  };
993
- function ce(t, e, i, s) {
994
- return t && (s === void 0 && (s = Object.keys(e.child).length === 0), t = this.parseTextData(t, e.tagname, i, !1, e[":@"] ? Object.keys(e[":@"]).length !== 0 : !1, s), t !== void 0 && t !== "" && e.add(this.options.textNodeName, t), t = ""), t;
995
+ function ce(t, e, i, r) {
996
+ 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;
995
997
  }
996
998
  function he(t, e, i) {
997
- const s = "*." + i;
999
+ const r = "*." + i;
998
1000
  for (const n in t) {
999
- const r = t[n];
1000
- if (s === r || e === r)
1001
+ const s = t[n];
1002
+ if (r === s || e === s)
1001
1003
  return !0;
1002
1004
  }
1003
1005
  return !1;
1004
1006
  }
1005
1007
  function pe(t, e, i = ">") {
1006
- let s, n = "";
1007
- for (let r = e; r < t.length; r++) {
1008
- let l = t[r];
1009
- if (s)
1010
- l === s && (s = "");
1011
- else if (l === '"' || l === "'")
1012
- s = l;
1013
- else if (l === i[0])
1008
+ let r, n = "";
1009
+ for (let s = e; s < t.length; s++) {
1010
+ let a = t[s];
1011
+ if (r)
1012
+ a === r && (r = "");
1013
+ else if (a === '"' || a === "'")
1014
+ r = a;
1015
+ else if (a === i[0])
1014
1016
  if (i[1]) {
1015
- if (t[r + 1] === i[1])
1016
- return { data: n, index: r };
1017
+ if (t[s + 1] === i[1])
1018
+ return { data: n, index: s };
1017
1019
  } else
1018
- return { data: n, index: r };
1020
+ return { data: n, index: s };
1019
1021
  else
1020
- l === " " && (l = " ");
1021
- n += l;
1022
+ a === " " && (a = " ");
1023
+ n += a;
1022
1024
  }
1023
1025
  }
1024
- function x(t, e, i, s) {
1026
+ function x(t, e, i, r) {
1025
1027
  const n = t.indexOf(e, i);
1026
1028
  if (n === -1)
1027
- throw new Error(s);
1029
+ throw new Error(r);
1028
1030
  return n + e.length - 1;
1029
1031
  }
1030
- function C(t, e, i, s = ">") {
1031
- const n = pe(t, e + 1, s);
1032
+ function D(t, e, i, r = ">") {
1033
+ const n = pe(t, e + 1, r);
1032
1034
  if (!n)
1033
1035
  return;
1034
- let r = n.data;
1035
- const l = n.index, o = r.search(/\s/);
1036
- let a = r, d = !0;
1037
- if (o !== -1 && (a = r.substr(0, o).replace(/\s\s*$/, ""), r = r.substr(o + 1)), i) {
1038
- const u = a.indexOf(":");
1039
- u !== -1 && (a = a.substr(u + 1), d = a !== n.data.substr(u + 1));
1040
- }
1041
- return { tagName: a, tagExp: r, closeIndex: l, attrExpPresent: d };
1036
+ let s = n.data;
1037
+ const a = n.index, o = s.search(/\s/);
1038
+ let l = s, d = !0;
1039
+ o !== -1 && (l = s.substr(0, o).replace(/\s\s*$/, ""), s = s.substr(o + 1));
1040
+ const u = l;
1041
+ if (i) {
1042
+ const c = l.indexOf(":");
1043
+ c !== -1 && (l = l.substr(c + 1), d = l !== n.data.substr(c + 1));
1044
+ }
1045
+ return { tagName: l, tagExp: s, closeIndex: a, attrExpPresent: d, rawTagName: u };
1042
1046
  }
1043
1047
  function fe(t, e, i) {
1044
- const s = i;
1048
+ const r = i;
1045
1049
  let n = 1;
1046
1050
  for (; i < t.length; i++)
1047
1051
  if (t[i] === "<")
1048
1052
  if (t[i + 1] === "/") {
1049
- const r = x(t, ">", i, `${e} is not closed`);
1050
- if (t.substring(i + 2, r).trim() === e && (n--, n === 0))
1051
- return { tagContent: t.substring(s, i), i: r };
1052
- i = r;
1053
+ const s = x(t, ">", i, `${e} is not closed`);
1054
+ if (t.substring(i + 2, s).trim() === e && (n--, n === 0))
1055
+ return { tagContent: t.substring(r, i), i: s };
1056
+ i = s;
1053
1057
  } else if (t[i + 1] === "?")
1054
1058
  i = x(t, "?>", i + 1, "StopNode is not closed.");
1055
1059
  else if (t.substr(i + 1, 3) === "!--")
@@ -1057,64 +1061,64 @@ function fe(t, e, i) {
1057
1061
  else if (t.substr(i + 1, 2) === "![")
1058
1062
  i = x(t, "]]>", i, "StopNode is not closed.") - 2;
1059
1063
  else {
1060
- const r = C(t, i, ">");
1061
- r && ((r && r.tagName) === e && r.tagExp[r.tagExp.length - 1] !== "/" && n++, i = r.closeIndex);
1064
+ const s = D(t, i, ">");
1065
+ s && ((s && s.tagName) === e && s.tagExp[s.tagExp.length - 1] !== "/" && n++, i = s.closeIndex);
1062
1066
  }
1063
1067
  }
1064
- function D(t, e, i) {
1068
+ function S(t, e, i) {
1065
1069
  if (e && typeof t == "string") {
1066
- const s = t.trim();
1067
- return s === "true" ? !0 : s === "false" ? !1 : ee(t, i);
1070
+ const r = t.trim();
1071
+ return r === "true" ? !0 : r === "false" ? !1 : ee(t, i);
1068
1072
  } else
1069
- return R.isExist(t) ? t : "";
1073
+ return j.isExist(t) ? t : "";
1070
1074
  }
1071
- var ge = ie, it = {};
1075
+ var ge = ie, nt = {};
1072
1076
  function me(t, e) {
1073
- return nt(t, e);
1077
+ return rt(t, e);
1074
1078
  }
1075
- function nt(t, e, i) {
1076
- let s;
1079
+ function rt(t, e, i) {
1080
+ let r;
1077
1081
  const n = {};
1078
- for (let r = 0; r < t.length; r++) {
1079
- const l = t[r], o = we(l);
1080
- let a = "";
1081
- if (i === void 0 ? a = o : a = i + "." + o, o === e.textNodeName)
1082
- s === void 0 ? s = l[o] : s += "" + l[o];
1082
+ for (let s = 0; s < t.length; s++) {
1083
+ const a = t[s], o = we(a);
1084
+ let l = "";
1085
+ if (i === void 0 ? l = o : l = i + "." + o, o === e.textNodeName)
1086
+ r === void 0 ? r = a[o] : r += "" + a[o];
1083
1087
  else {
1084
1088
  if (o === void 0)
1085
1089
  continue;
1086
- if (l[o]) {
1087
- let d = nt(l[o], e, a);
1090
+ if (a[o]) {
1091
+ let d = rt(a[o], e, l);
1088
1092
  const u = ye(d, e);
1089
- l[":@"] ? ve(d, l[":@"], a, 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, a, u) ? n[o] = [d] : n[o] = d;
1093
+ a[":@"] ? ve(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;
1090
1094
  }
1091
1095
  }
1092
1096
  }
1093
- return typeof s == "string" ? s.length > 0 && (n[e.textNodeName] = s) : s !== void 0 && (n[e.textNodeName] = s), n;
1097
+ return typeof r == "string" ? r.length > 0 && (n[e.textNodeName] = r) : r !== void 0 && (n[e.textNodeName] = r), n;
1094
1098
  }
1095
1099
  function we(t) {
1096
1100
  const e = Object.keys(t);
1097
1101
  for (let i = 0; i < e.length; i++) {
1098
- const s = e[i];
1099
- if (s !== ":@")
1100
- return s;
1102
+ const r = e[i];
1103
+ if (r !== ":@")
1104
+ return r;
1101
1105
  }
1102
1106
  }
1103
- function ve(t, e, i, s) {
1107
+ function ve(t, e, i, r) {
1104
1108
  if (e) {
1105
- const n = Object.keys(e), r = n.length;
1106
- for (let l = 0; l < r; l++) {
1107
- const o = n[l];
1108
- s.isArray(o, i + "." + o, !0, !0) ? t[o] = [e[o]] : t[o] = e[o];
1109
+ const n = Object.keys(e), s = n.length;
1110
+ for (let a = 0; a < s; a++) {
1111
+ const o = n[a];
1112
+ r.isArray(o, i + "." + o, !0, !0) ? t[o] = [e[o]] : t[o] = e[o];
1109
1113
  }
1110
1114
  }
1111
1115
  }
1112
1116
  function ye(t, e) {
1113
- const { textNodeName: i } = e, s = Object.keys(t).length;
1114
- return !!(s === 0 || s === 1 && (t[i] || typeof t[i] == "boolean" || t[i] === 0));
1117
+ const { textNodeName: i } = e, r = Object.keys(t).length;
1118
+ return !!(r === 0 || r === 1 && (t[i] || typeof t[i] == "boolean" || t[i] === 0));
1115
1119
  }
1116
- it.prettify = me;
1117
- const { buildOptions: xe } = P, be = ge, { prettify: Ee } = it, Ne = k;
1120
+ nt.prettify = me;
1121
+ const { buildOptions: xe } = C, be = ge, { prettify: Ee } = nt, Ne = L;
1118
1122
  let _e = class {
1119
1123
  constructor(t) {
1120
1124
  this.externalEntities = {}, this.options = xe(t);
@@ -1133,8 +1137,8 @@ let _e = class {
1133
1137
  }
1134
1138
  const i = new be(this.options);
1135
1139
  i.addExternalEntities(this.externalEntities);
1136
- const s = i.parseXml(t);
1137
- return this.options.preserveOrder || s === void 0 ? s : Ee(s, this.options);
1140
+ const r = i.parseXml(t);
1141
+ return this.options.preserveOrder || r === void 0 ? r : Ee(r, this.options);
1138
1142
  }
1139
1143
  addEntity(t, e) {
1140
1144
  if (e.indexOf("&") !== -1)
@@ -1151,66 +1155,70 @@ const Te = `
1151
1155
  `;
1152
1156
  function Ie(t, e) {
1153
1157
  let i = "";
1154
- return e.format && e.indentBy.length > 0 && (i = Te), rt(t, e, "", i);
1158
+ return e.format && e.indentBy.length > 0 && (i = Te), st(t, e, "", i);
1155
1159
  }
1156
- function rt(t, e, i, s) {
1157
- let n = "", r = !1;
1158
- for (let l = 0; l < t.length; l++) {
1159
- const o = t[l], a = Oe(o);
1160
+ function st(t, e, i, r) {
1161
+ let n = "", s = !1;
1162
+ for (let a = 0; a < t.length; a++) {
1163
+ const o = t[a], l = Oe(o);
1164
+ if (l === void 0)
1165
+ continue;
1160
1166
  let d = "";
1161
- if (i.length === 0 ? d = a : d = `${i}.${a}`, a === e.textNodeName) {
1162
- let w = o[a];
1163
- Pe(d, e) || (w = e.tagValueProcessor(a, w), w = st(w, e)), r && (n += s), n += w, r = !1;
1167
+ if (i.length === 0 ? d = l : d = `${i}.${l}`, l === e.textNodeName) {
1168
+ let w = o[l];
1169
+ Pe(d, e) || (w = e.tagValueProcessor(l, w), w = ot(w, e)), s && (n += r), n += w, s = !1;
1164
1170
  continue;
1165
- } else if (a === e.cdataPropName) {
1166
- r && (n += s), n += `<![CDATA[${o[a][0][e.textNodeName]}]]>`, r = !1;
1171
+ } else if (l === e.cdataPropName) {
1172
+ s && (n += r), n += `<![CDATA[${o[l][0][e.textNodeName]}]]>`, s = !1;
1167
1173
  continue;
1168
- } else if (a === e.commentPropName) {
1169
- n += s + `<!--${o[a][0][e.textNodeName]}-->`, r = !0;
1174
+ } else if (l === e.commentPropName) {
1175
+ n += r + `<!--${o[l][0][e.textNodeName]}-->`, s = !0;
1170
1176
  continue;
1171
- } else if (a[0] === "?") {
1172
- const w = G(o[":@"], e), ot = a === "?xml" ? "" : s;
1173
- let N = o[a][0][e.textNodeName];
1174
- N = N.length !== 0 ? " " + N : "", n += ot + `<${a}${N}${w}?>`, r = !0;
1177
+ } else if (l[0] === "?") {
1178
+ const w = X(o[":@"], e), b = l === "?xml" ? "" : r;
1179
+ let _ = o[l][0][e.textNodeName];
1180
+ _ = _.length !== 0 ? " " + _ : "", n += b + `<${l}${_}${w}?>`, s = !0;
1175
1181
  continue;
1176
1182
  }
1177
- let u = s;
1183
+ let u = r;
1178
1184
  u !== "" && (u += e.indentBy);
1179
- const h = G(o[":@"], e), c = s + `<${a}${h}`, f = rt(o[a], e, d, u);
1180
- e.unpairedTags.indexOf(a) !== -1 ? e.suppressUnpairedNode ? n += c + ">" : n += c + "/>" : (!f || f.length === 0) && e.suppressEmptyNode ? n += c + "/>" : f && f.endsWith(">") ? n += c + `>${f}${s}</${a}>` : (n += c + ">", f && s !== "" && (f.includes("/>") || f.includes("</")) ? n += s + e.indentBy + f + s : n += f, n += `</${a}>`), r = !0;
1185
+ const c = X(o[":@"], e), p = r + `<${l}${c}`, h = st(o[l], e, d, u);
1186
+ e.unpairedTags.indexOf(l) !== -1 ? e.suppressUnpairedNode ? n += p + ">" : n += p + "/>" : (!h || h.length === 0) && e.suppressEmptyNode ? n += p + "/>" : h && h.endsWith(">") ? n += p + `>${h}${r}</${l}>` : (n += p + ">", h && r !== "" && (h.includes("/>") || h.includes("</")) ? n += r + e.indentBy + h + r : n += h, n += `</${l}>`), s = !0;
1181
1187
  }
1182
1188
  return n;
1183
1189
  }
1184
1190
  function Oe(t) {
1185
1191
  const e = Object.keys(t);
1186
1192
  for (let i = 0; i < e.length; i++) {
1187
- const s = e[i];
1188
- if (s !== ":@")
1189
- return s;
1193
+ const r = e[i];
1194
+ if (t.hasOwnProperty(r) && r !== ":@")
1195
+ return r;
1190
1196
  }
1191
1197
  }
1192
- function G(t, e) {
1198
+ function X(t, e) {
1193
1199
  let i = "";
1194
1200
  if (t && !e.ignoreAttributes)
1195
- for (let s in t) {
1196
- let n = e.attributeValueProcessor(s, t[s]);
1197
- n = st(n, e), n === !0 && e.suppressBooleanAttributes ? i += ` ${s.substr(e.attributeNamePrefix.length)}` : i += ` ${s.substr(e.attributeNamePrefix.length)}="${n}"`;
1201
+ for (let r in t) {
1202
+ if (!t.hasOwnProperty(r))
1203
+ continue;
1204
+ let n = e.attributeValueProcessor(r, t[r]);
1205
+ n = ot(n, e), n === !0 && e.suppressBooleanAttributes ? i += ` ${r.substr(e.attributeNamePrefix.length)}` : i += ` ${r.substr(e.attributeNamePrefix.length)}="${n}"`;
1198
1206
  }
1199
1207
  return i;
1200
1208
  }
1201
1209
  function Pe(t, e) {
1202
1210
  t = t.substr(0, t.length - e.textNodeName.length - 1);
1203
1211
  let i = t.substr(t.lastIndexOf(".") + 1);
1204
- for (let s in e.stopNodes)
1205
- if (e.stopNodes[s] === t || e.stopNodes[s] === "*." + i)
1212
+ for (let r in e.stopNodes)
1213
+ if (e.stopNodes[r] === t || e.stopNodes[r] === "*." + i)
1206
1214
  return !0;
1207
1215
  return !1;
1208
1216
  }
1209
- function st(t, e) {
1217
+ function ot(t, e) {
1210
1218
  if (t && t.length > 0 && e.processEntities)
1211
1219
  for (let i = 0; i < e.entities.length; i++) {
1212
- const s = e.entities[i];
1213
- t = t.replace(s.regex, s.val);
1220
+ const r = e.entities[i];
1221
+ t = t.replace(r.regex, r.val);
1214
1222
  }
1215
1223
  return t;
1216
1224
  }
@@ -1232,65 +1240,66 @@ function y(t) {
1232
1240
  y.prototype.build = function(t) {
1233
1241
  return this.options.preserveOrder ? De(t, this.options) : (Array.isArray(t) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t = { [this.options.arrayNodeName]: t }), this.j2x(t, 0).val);
1234
1242
  }, y.prototype.j2x = function(t, e) {
1235
- let i = "", s = "";
1243
+ let i = "", r = "";
1236
1244
  for (let n in t)
1237
- if (typeof t[n] > "u")
1238
- this.isAttribute(n) && (s += "");
1239
- else if (t[n] === null)
1240
- this.isAttribute(n) ? s += "" : n[0] === "?" ? s += this.indentate(e) + "<" + n + "?" + this.tagEndChar : s += this.indentate(e) + "<" + n + "/" + this.tagEndChar;
1241
- else if (t[n] instanceof Date)
1242
- s += this.buildTextValNode(t[n], n, "", e);
1243
- else if (typeof t[n] != "object") {
1244
- const r = this.isAttribute(n);
1245
- if (r)
1246
- i += this.buildAttrPairStr(r, "" + t[n]);
1247
- else if (n === this.options.textNodeName) {
1248
- let l = this.options.tagValueProcessor(n, "" + t[n]);
1249
- s += this.replaceEntitiesValue(l);
1245
+ if (t.hasOwnProperty(n))
1246
+ if (typeof t[n] > "u")
1247
+ this.isAttribute(n) && (r += "");
1248
+ else if (t[n] === null)
1249
+ this.isAttribute(n) ? r += "" : n[0] === "?" ? r += this.indentate(e) + "<" + n + "?" + this.tagEndChar : r += this.indentate(e) + "<" + n + "/" + this.tagEndChar;
1250
+ else if (t[n] instanceof Date)
1251
+ r += this.buildTextValNode(t[n], n, "", e);
1252
+ else if (typeof t[n] != "object") {
1253
+ const s = this.isAttribute(n);
1254
+ if (s)
1255
+ i += this.buildAttrPairStr(s, "" + t[n]);
1256
+ else if (n === this.options.textNodeName) {
1257
+ let a = this.options.tagValueProcessor(n, "" + t[n]);
1258
+ r += this.replaceEntitiesValue(a);
1259
+ } else
1260
+ r += this.buildTextValNode(t[n], n, "", e);
1261
+ } else if (Array.isArray(t[n])) {
1262
+ const s = t[n].length;
1263
+ let a = "";
1264
+ for (let o = 0; o < s; o++) {
1265
+ const l = t[n][o];
1266
+ typeof l > "u" || (l === null ? n[0] === "?" ? r += this.indentate(e) + "<" + n + "?" + this.tagEndChar : r += this.indentate(e) + "<" + n + "/" + this.tagEndChar : typeof l == "object" ? this.options.oneListGroup ? a += this.j2x(l, e + 1).val : a += this.processTextOrObjNode(l, n, e) : a += this.buildTextValNode(l, n, "", e));
1267
+ }
1268
+ this.options.oneListGroup && (a = this.buildObjectNode(a, n, "", e)), r += a;
1269
+ } else if (this.options.attributesGroupName && n === this.options.attributesGroupName) {
1270
+ const s = Object.keys(t[n]), a = s.length;
1271
+ for (let o = 0; o < a; o++)
1272
+ i += this.buildAttrPairStr(s[o], "" + t[n][s[o]]);
1250
1273
  } else
1251
- s += this.buildTextValNode(t[n], n, "", e);
1252
- } else if (Array.isArray(t[n])) {
1253
- const r = t[n].length;
1254
- let l = "";
1255
- for (let o = 0; o < r; o++) {
1256
- const a = t[n][o];
1257
- typeof a > "u" || (a === null ? n[0] === "?" ? s += this.indentate(e) + "<" + n + "?" + this.tagEndChar : s += this.indentate(e) + "<" + n + "/" + this.tagEndChar : typeof a == "object" ? this.options.oneListGroup ? l += this.j2x(a, e + 1).val : l += this.processTextOrObjNode(a, n, e) : l += this.buildTextValNode(a, n, "", e));
1258
- }
1259
- this.options.oneListGroup && (l = this.buildObjectNode(l, n, "", e)), s += l;
1260
- } else if (this.options.attributesGroupName && n === this.options.attributesGroupName) {
1261
- const r = Object.keys(t[n]), l = r.length;
1262
- for (let o = 0; o < l; o++)
1263
- i += this.buildAttrPairStr(r[o], "" + t[n][r[o]]);
1264
- } else
1265
- s += this.processTextOrObjNode(t[n], n, e);
1266
- return { attrStr: i, val: s };
1274
+ r += this.processTextOrObjNode(t[n], n, e);
1275
+ return { attrStr: i, val: r };
1267
1276
  }, y.prototype.buildAttrPairStr = function(t, e) {
1268
1277
  return e = this.options.attributeValueProcessor(t, "" + e), e = this.replaceEntitiesValue(e), this.options.suppressBooleanAttributes && e === "true" ? " " + t : " " + t + '="' + e + '"';
1269
1278
  };
1270
1279
  function Fe(t, e, i) {
1271
- const s = this.j2x(t, i + 1);
1272
- return t[this.options.textNodeName] !== void 0 && Object.keys(t).length === 1 ? this.buildTextValNode(t[this.options.textNodeName], e, s.attrStr, i) : this.buildObjectNode(s.val, e, s.attrStr, i);
1280
+ const r = this.j2x(t, i + 1);
1281
+ 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);
1273
1282
  }
1274
- y.prototype.buildObjectNode = function(t, e, i, s) {
1283
+ y.prototype.buildObjectNode = function(t, e, i, r) {
1275
1284
  if (t === "")
1276
- return e[0] === "?" ? this.indentate(s) + "<" + e + i + "?" + this.tagEndChar : this.indentate(s) + "<" + e + i + this.closeTag(e) + this.tagEndChar;
1285
+ return e[0] === "?" ? this.indentate(r) + "<" + e + i + "?" + this.tagEndChar : this.indentate(r) + "<" + e + i + this.closeTag(e) + this.tagEndChar;
1277
1286
  {
1278
- let n = "</" + e + this.tagEndChar, r = "";
1279
- return e[0] === "?" && (r = "?", n = ""), (i || i === "") && t.indexOf("<") === -1 ? this.indentate(s) + "<" + e + i + r + ">" + t + n : this.options.commentPropName !== !1 && e === this.options.commentPropName && r.length === 0 ? this.indentate(s) + `<!--${t}-->` + this.newLine : this.indentate(s) + "<" + e + i + r + this.tagEndChar + t + this.indentate(s) + n;
1287
+ let n = "</" + e + this.tagEndChar, s = "";
1288
+ return e[0] === "?" && (s = "?", n = ""), (i || i === "") && t.indexOf("<") === -1 ? this.indentate(r) + "<" + e + i + s + ">" + t + n : this.options.commentPropName !== !1 && e === this.options.commentPropName && s.length === 0 ? this.indentate(r) + `<!--${t}-->` + this.newLine : this.indentate(r) + "<" + e + i + s + this.tagEndChar + t + this.indentate(r) + n;
1280
1289
  }
1281
1290
  }, y.prototype.closeTag = function(t) {
1282
1291
  let e = "";
1283
1292
  return this.options.unpairedTags.indexOf(t) !== -1 ? this.options.suppressUnpairedNode || (e = "/") : this.options.suppressEmptyNode ? e = "/" : e = `></${t}`, e;
1284
- }, y.prototype.buildTextValNode = function(t, e, i, s) {
1293
+ }, y.prototype.buildTextValNode = function(t, e, i, r) {
1285
1294
  if (this.options.cdataPropName !== !1 && e === this.options.cdataPropName)
1286
- return this.indentate(s) + `<![CDATA[${t}]]>` + this.newLine;
1295
+ return this.indentate(r) + `<![CDATA[${t}]]>` + this.newLine;
1287
1296
  if (this.options.commentPropName !== !1 && e === this.options.commentPropName)
1288
- return this.indentate(s) + `<!--${t}-->` + this.newLine;
1297
+ return this.indentate(r) + `<!--${t}-->` + this.newLine;
1289
1298
  if (e[0] === "?")
1290
- return this.indentate(s) + "<" + e + i + "?" + this.tagEndChar;
1299
+ return this.indentate(r) + "<" + e + i + "?" + this.tagEndChar;
1291
1300
  {
1292
1301
  let n = this.options.tagValueProcessor(e, t);
1293
- return n = this.replaceEntitiesValue(n), n === "" ? this.indentate(s) + "<" + e + i + this.closeTag(e) + this.tagEndChar : this.indentate(s) + "<" + e + i + ">" + n + "</" + e + this.tagEndChar;
1302
+ return n = this.replaceEntitiesValue(n), n === "" ? this.indentate(r) + "<" + e + i + this.closeTag(e) + this.tagEndChar : this.indentate(r) + "<" + e + i + ">" + n + "</" + e + this.tagEndChar;
1294
1303
  }
1295
1304
  }, y.prototype.replaceEntitiesValue = function(t) {
1296
1305
  if (t && t.length > 0 && this.options.processEntities)
@@ -1307,15 +1316,15 @@ function $e(t) {
1307
1316
  return t.startsWith(this.options.attributeNamePrefix) && t !== this.options.textNodeName ? t.substr(this.attrPrefixLen) : !1;
1308
1317
  }
1309
1318
  var ke = y;
1310
- const Le = k, Re = Ae, je = ke;
1311
- var X = { XMLParser: Re, XMLValidator: Le, XMLBuilder: je };
1319
+ const Le = L, Re = Ae, je = ke;
1320
+ var H = { XMLParser: Re, XMLValidator: Le, XMLBuilder: je };
1312
1321
  function Me(t) {
1313
1322
  if (typeof t != "string")
1314
1323
  throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
1315
- if (t = t.trim(), t.length === 0 || X.XMLValidator.validate(t) !== !0)
1324
+ if (t = t.trim(), t.length === 0 || H.XMLValidator.validate(t) !== !0)
1316
1325
  return !1;
1317
1326
  let e;
1318
- const i = new X.XMLParser();
1327
+ const i = new H.XMLParser();
1319
1328
  try {
1320
1329
  e = i.parse(t);
1321
1330
  } catch {
@@ -1414,23 +1423,23 @@ const Be = function(t) {
1414
1423
  throw new Error("View defaultSortKey must be a string");
1415
1424
  return !0;
1416
1425
  }, di = function(t) {
1417
- return S().registerEntry(t);
1426
+ return F().registerEntry(t);
1418
1427
  }, ui = function(t) {
1419
- return S().unregisterEntry(t);
1428
+ return F().unregisterEntry(t);
1420
1429
  }, ci = function(t) {
1421
- return S().getEntries(t);
1430
+ return F().getEntries(t);
1422
1431
  };
1423
1432
  export {
1424
1433
  _t as Column,
1425
- H as DefaultType,
1434
+ K as DefaultType,
1426
1435
  xt as File,
1427
1436
  Ye as FileAction,
1428
- $ as FileType,
1437
+ k as FileType,
1429
1438
  bt as Folder,
1430
1439
  Qe as Header,
1431
1440
  Nt as Navigation,
1432
- J as Node,
1433
- Z as NodeStatus,
1441
+ Q as Node,
1442
+ J as NodeStatus,
1434
1443
  v as Permission,
1435
1444
  li as View,
1436
1445
  di as addNewFileMenuEntry,
@@ -1439,14 +1448,14 @@ export {
1439
1448
  vt as davGetFavoritesReport,
1440
1449
  ri as davGetRecentSearch,
1441
1450
  yt as davParsePermissions,
1442
- tt as davRemoteURL,
1451
+ et as davRemoteURL,
1443
1452
  Et as davResultToNode,
1444
- Q as davRootPath,
1445
- W as defaultDavNamespaces,
1446
- K as defaultDavProperties,
1453
+ tt as davRootPath,
1454
+ Y as defaultDavNamespaces,
1455
+ W as defaultDavProperties,
1447
1456
  We as formatFileSize,
1448
- V as getDavNameSpaces,
1449
- F as getDavProperties,
1457
+ $ as getDavNameSpaces,
1458
+ V as getDavProperties,
1450
1459
  oi as getFavoriteNodes,
1451
1460
  Je as getFileActions,
1452
1461
  ei as getFileListHeaders,