lakutata 2.0.12 → 2.0.13

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.
Files changed (140) hide show
  1. package/com/database.cjs +13 -3
  2. package/com/database.mjs +13 -3
  3. package/com/docker.cjs +6 -2
  4. package/com/docker.d.ts +29 -11
  5. package/com/docker.mjs +6 -2
  6. package/com/logger.cjs +2 -2
  7. package/com/logger.mjs +2 -2
  8. package/decorator/orm.cjs +21 -11
  9. package/decorator/orm.mjs +13 -3
  10. package/helper.cjs +12 -12
  11. package/helper.d.ts +559 -82
  12. package/helper.mjs +5 -5
  13. package/lakutata.cjs +2 -2
  14. package/lakutata.mjs +2 -2
  15. package/orm.cjs +13 -3
  16. package/orm.mjs +39 -29
  17. package/package.json +2 -4
  18. package/src/components/Database.cjs +17 -7
  19. package/src/components/Database.mjs +13 -3
  20. package/src/components/Logger.cjs +2 -2
  21. package/src/components/Logger.mjs +2 -2
  22. package/src/components/docker/ConnectionOptionsBuilder.cjs +6 -2
  23. package/src/components/docker/ConnectionOptionsBuilder.mjs +6 -2
  24. package/src/components/docker/Docker.cjs +8 -3
  25. package/src/components/docker/Docker.mjs +8 -3
  26. package/src/components/docker/lib/DockerContainer.cjs +10 -6
  27. package/src/components/docker/lib/DockerContainer.mjs +6 -2
  28. package/src/components/docker/lib/DockerContainerTTY.cjs +6 -2
  29. package/src/components/docker/lib/DockerContainerTTY.mjs +6 -2
  30. package/src/decorators/orm/AfterInsert.cjs +13 -3
  31. package/src/decorators/orm/AfterInsert.mjs +17 -7
  32. package/src/decorators/orm/AfterLoad.cjs +17 -7
  33. package/src/decorators/orm/AfterLoad.mjs +13 -3
  34. package/src/decorators/orm/AfterRecover.cjs +17 -7
  35. package/src/decorators/orm/AfterRecover.mjs +17 -7
  36. package/src/decorators/orm/AfterRemove.cjs +17 -7
  37. package/src/decorators/orm/AfterRemove.mjs +22 -12
  38. package/src/decorators/orm/AfterSoftRemove.cjs +13 -3
  39. package/src/decorators/orm/AfterSoftRemove.mjs +24 -14
  40. package/src/decorators/orm/AfterUpdate.cjs +13 -3
  41. package/src/decorators/orm/AfterUpdate.mjs +22 -12
  42. package/src/decorators/orm/BeforeInsert.cjs +17 -7
  43. package/src/decorators/orm/BeforeInsert.mjs +17 -7
  44. package/src/decorators/orm/BeforeRecover.cjs +17 -7
  45. package/src/decorators/orm/BeforeRecover.mjs +22 -12
  46. package/src/decorators/orm/BeforeRemove.cjs +17 -7
  47. package/src/decorators/orm/BeforeRemove.mjs +17 -7
  48. package/src/decorators/orm/BeforeSoftRemove.cjs +17 -7
  49. package/src/decorators/orm/BeforeSoftRemove.mjs +23 -13
  50. package/src/decorators/orm/BeforeUpdate.cjs +17 -7
  51. package/src/decorators/orm/BeforeUpdate.mjs +22 -12
  52. package/src/decorators/orm/Check.cjs +18 -8
  53. package/src/decorators/orm/Check.mjs +13 -3
  54. package/src/decorators/orm/ChildEntity.cjs +13 -3
  55. package/src/decorators/orm/ChildEntity.mjs +13 -3
  56. package/src/decorators/orm/Column.cjs +26 -16
  57. package/src/decorators/orm/Column.mjs +23 -13
  58. package/src/decorators/orm/CreateDateColumn.cjs +19 -9
  59. package/src/decorators/orm/CreateDateColumn.mjs +24 -14
  60. package/src/decorators/orm/DeleteDateColumn.cjs +19 -9
  61. package/src/decorators/orm/DeleteDateColumn.mjs +23 -13
  62. package/src/decorators/orm/Entity.cjs +26 -16
  63. package/src/decorators/orm/Entity.mjs +32 -22
  64. package/src/decorators/orm/EventSubscriber.cjs +13 -3
  65. package/src/decorators/orm/EventSubscriber.mjs +18 -8
  66. package/src/decorators/orm/Exclusion.cjs +21 -11
  67. package/src/decorators/orm/Exclusion.mjs +21 -11
  68. package/src/decorators/orm/Generated.cjs +13 -3
  69. package/src/decorators/orm/Generated.mjs +13 -3
  70. package/src/decorators/orm/Index.cjs +22 -12
  71. package/src/decorators/orm/Index.mjs +27 -17
  72. package/src/decorators/orm/JoinColumn.cjs +19 -9
  73. package/src/decorators/orm/JoinColumn.mjs +27 -17
  74. package/src/decorators/orm/JoinTable.cjs +13 -3
  75. package/src/decorators/orm/JoinTable.mjs +29 -19
  76. package/src/decorators/orm/ManyToMany.cjs +25 -15
  77. package/src/decorators/orm/ManyToMany.mjs +26 -16
  78. package/src/decorators/orm/ManyToOne.cjs +25 -15
  79. package/src/decorators/orm/ManyToOne.mjs +26 -16
  80. package/src/decorators/orm/ObjectIdColumn.cjs +13 -3
  81. package/src/decorators/orm/ObjectIdColumn.mjs +26 -16
  82. package/src/decorators/orm/OneToMany.cjs +21 -11
  83. package/src/decorators/orm/OneToMany.mjs +22 -12
  84. package/src/decorators/orm/OneToOne.cjs +16 -6
  85. package/src/decorators/orm/OneToOne.mjs +36 -26
  86. package/src/decorators/orm/PrimaryColumn.cjs +23 -13
  87. package/src/decorators/orm/PrimaryColumn.mjs +24 -14
  88. package/src/decorators/orm/PrimaryGeneratedColumn.cjs +32 -22
  89. package/src/decorators/orm/PrimaryGeneratedColumn.mjs +18 -8
  90. package/src/decorators/orm/RelationId.cjs +19 -9
  91. package/src/decorators/orm/RelationId.mjs +18 -8
  92. package/src/decorators/orm/TableInheritance.cjs +17 -7
  93. package/src/decorators/orm/TableInheritance.mjs +26 -16
  94. package/src/decorators/orm/Tree.cjs +13 -3
  95. package/src/decorators/orm/Tree.mjs +26 -16
  96. package/src/decorators/orm/TreeChildren.cjs +15 -5
  97. package/src/decorators/orm/TreeChildren.mjs +18 -8
  98. package/src/decorators/orm/TreeLevelColumn.cjs +13 -3
  99. package/src/decorators/orm/TreeLevelColumn.mjs +20 -10
  100. package/src/decorators/orm/TreeParent.cjs +19 -9
  101. package/src/decorators/orm/TreeParent.mjs +13 -3
  102. package/src/decorators/orm/Unique.cjs +29 -19
  103. package/src/decorators/orm/Unique.mjs +30 -20
  104. package/src/decorators/orm/UpdateDateColumn.cjs +19 -9
  105. package/src/decorators/orm/UpdateDateColumn.mjs +25 -15
  106. package/src/decorators/orm/VersionColumn.cjs +13 -3
  107. package/src/decorators/orm/VersionColumn.mjs +26 -16
  108. package/src/decorators/orm/ViewColumn.cjs +13 -3
  109. package/src/decorators/orm/ViewColumn.mjs +26 -16
  110. package/src/decorators/orm/ViewEntity.cjs +27 -17
  111. package/src/decorators/orm/ViewEntity.mjs +19 -9
  112. package/src/decorators/orm/VirtualColumn.cjs +18 -8
  113. package/src/decorators/orm/VirtualColumn.mjs +30 -20
  114. package/src/lib/base/internal/PatternManager.cjs +2 -2
  115. package/src/lib/base/internal/PatternManager.mjs +2 -2
  116. package/src/lib/core/Application.cjs +2 -2
  117. package/src/lib/core/Application.mjs +2 -2
  118. package/src/lib/helpers/Glob.cjs +1220 -1149
  119. package/src/lib/helpers/Glob.mjs +769 -700
  120. package/src/lib/helpers/IsXML.cjs +863 -801
  121. package/src/lib/helpers/IsXML.mjs +862 -800
  122. package/src/lib/ioc/ListModules.cjs +967 -909
  123. package/src/lib/ioc/ListModules.mjs +849 -791
  124. package/src/lib/validation/VLD.cjs +20 -10
  125. package/src/lib/validation/VLD.mjs +20 -10
  126. package/vendor/Package.1.cjs +170 -129
  127. package/vendor/Package.1.mjs +169 -128
  128. package/vendor/Package.13.cjs +0 -2
  129. package/vendor/Package.13.mjs +0 -2
  130. package/vendor/Package.14.cjs +8756 -8658
  131. package/vendor/Package.14.mjs +8665 -8581
  132. package/vendor/Package.16.cjs +36855 -15590
  133. package/vendor/Package.16.mjs +36893 -15633
  134. package/vendor/Package.2.cjs +2442 -2440
  135. package/vendor/Package.2.mjs +444 -442
  136. package/vendor/Package.4.cjs +325 -319
  137. package/vendor/Package.4.mjs +326 -320
  138. package/vendor/Package.7.cjs +299 -299
  139. package/vendor/Package.7.mjs +299 -299
  140. package/vendor/TypeDef.5.d.ts +6 -0
@@ -1,104 +1,104 @@
1
- import { g as e } from "../../../vendor/Package.5.mjs";
1
+ import { g as t } from "../../../vendor/Package.5.mjs";
2
2
 
3
- var t = {};
3
+ var e = {};
4
4
 
5
- var i = {};
5
+ var n = {};
6
6
 
7
- (function(e) {
7
+ (function(t) {
8
8
  "use strict";
9
- const t = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
10
- const i = t + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
11
- const n = "[" + t + "][" + i + "]*";
12
- const s = new RegExp("^" + n + "$");
13
- const r = function(e, t) {
14
- const i = [];
15
- let n = t.exec(e);
16
- while (n) {
9
+ 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";
10
+ const n = e + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
11
+ const i = "[" + e + "][" + n + "]*";
12
+ const s = new RegExp("^" + i + "$");
13
+ const r = function(t, e) {
14
+ const n = [];
15
+ let i = e.exec(t);
16
+ while (i) {
17
17
  const s = [];
18
- s.startIndex = t.lastIndex - n[0].length;
19
- const r = n.length;
20
- for (let e = 0; e < r; e++) {
21
- s.push(n[e]);
18
+ s.startIndex = e.lastIndex - i[0].length;
19
+ const r = i.length;
20
+ for (let t = 0; t < r; t++) {
21
+ s.push(i[t]);
22
22
  }
23
- i.push(s);
24
- n = t.exec(e);
23
+ n.push(s);
24
+ i = e.exec(t);
25
25
  }
26
- return i;
26
+ return n;
27
27
  };
28
- const o = function(e) {
29
- const t = s.exec(e);
30
- return !(t === null || typeof t === "undefined");
28
+ const o = function(t) {
29
+ const e = s.exec(t);
30
+ return !(e === null || typeof e === "undefined");
31
31
  };
32
- e.isExist = function(e) {
33
- return typeof e !== "undefined";
32
+ t.isExist = function(t) {
33
+ return typeof t !== "undefined";
34
34
  };
35
- e.isEmptyObject = function(e) {
36
- return Object.keys(e).length === 0;
35
+ t.isEmptyObject = function(t) {
36
+ return Object.keys(t).length === 0;
37
37
  };
38
- e.merge = function(e, t, i) {
39
- if (t) {
40
- const n = Object.keys(t);
41
- const s = n.length;
38
+ t.merge = function(t, e, n) {
39
+ if (e) {
40
+ const i = Object.keys(e);
41
+ const s = i.length;
42
42
  for (let r = 0; r < s; r++) {
43
- if (i === "strict") {
44
- e[n[r]] = [ t[n[r]] ];
43
+ if (n === "strict") {
44
+ t[i[r]] = [ e[i[r]] ];
45
45
  } else {
46
- e[n[r]] = t[n[r]];
46
+ t[i[r]] = e[i[r]];
47
47
  }
48
48
  }
49
49
  }
50
50
  };
51
- e.getValue = function(t) {
52
- if (e.isExist(t)) {
53
- return t;
51
+ t.getValue = function(e) {
52
+ if (t.isExist(e)) {
53
+ return e;
54
54
  } else {
55
55
  return "";
56
56
  }
57
57
  };
58
- e.isName = o;
59
- e.getAllMatches = r;
60
- e.nameRegexp = n;
61
- })(i);
58
+ t.isName = o;
59
+ t.getAllMatches = r;
60
+ t.nameRegexp = i;
61
+ })(n);
62
62
 
63
- const n = e(i);
63
+ const i = t(n);
64
64
 
65
65
  "use strict";
66
66
 
67
- const s = i;
67
+ const s = n;
68
68
 
69
69
  const r = {
70
70
  allowBooleanAttributes: false,
71
71
  unpairedTags: []
72
72
  };
73
73
 
74
- var o = t.validate = function(e, t) {
75
- t = Object.assign({}, r, t);
76
- const i = [];
77
- let n = false;
74
+ var o = e.validate = function(t, e) {
75
+ e = Object.assign({}, r, e);
76
+ const n = [];
77
+ let i = false;
78
78
  let s = false;
79
- if (e[0] === "\ufeff") {
80
- e = e.substr(1);
79
+ if (t[0] === "\ufeff") {
80
+ t = t.substr(1);
81
81
  }
82
- for (let r = 0; r < e.length; r++) {
83
- if (e[r] === "<" && e[r + 1] === "?") {
82
+ for (let r = 0; r < t.length; r++) {
83
+ if (t[r] === "<" && t[r + 1] === "?") {
84
84
  r += 2;
85
- r = l(e, r);
85
+ r = l(t, r);
86
86
  if (r.err) return r;
87
- } else if (e[r] === "<") {
87
+ } else if (t[r] === "<") {
88
88
  let o = r;
89
89
  r++;
90
- if (e[r] === "!") {
91
- r = u(e, r);
90
+ if (t[r] === "!") {
91
+ r = u(t, r);
92
92
  continue;
93
93
  } else {
94
94
  let f = false;
95
- if (e[r] === "/") {
95
+ if (t[r] === "/") {
96
96
  f = true;
97
97
  r++;
98
98
  }
99
99
  let c = "";
100
- for (;r < e.length && e[r] !== ">" && e[r] !== " " && e[r] !== "\t" && e[r] !== "\n" && e[r] !== "\r"; r++) {
101
- c += e[r];
100
+ for (;r < t.length && t[r] !== ">" && t[r] !== " " && t[r] !== "\t" && t[r] !== "\n" && t[r] !== "\r"; r++) {
101
+ c += t[r];
102
102
  }
103
103
  c = c.trim();
104
104
  if (c[c.length - 1] === "/") {
@@ -106,98 +106,100 @@ var o = t.validate = function(e, t) {
106
106
  r--;
107
107
  }
108
108
  if (!b(c)) {
109
- let t;
109
+ let e;
110
110
  if (c.trim().length === 0) {
111
- t = "Invalid space after '<'.";
111
+ e = "Invalid space after '<'.";
112
112
  } else {
113
- t = "Tag '" + c + "' is an invalid name.";
113
+ e = "Tag '" + c + "' is an invalid name.";
114
114
  }
115
- return x("InvalidTag", t, E(e, r));
115
+ return x("InvalidTag", e, E(t, r));
116
116
  }
117
- const h = d(e, r);
118
- if (h === false) {
119
- return x("InvalidAttr", "Attributes for '" + c + "' have open quote.", E(e, r));
117
+ const d = h(t, r);
118
+ if (d === false) {
119
+ return x("InvalidAttr", "Attributes for '" + c + "' have open quote.", E(t, r));
120
120
  }
121
- let g = h.value;
122
- r = h.index;
121
+ let g = d.value;
122
+ r = d.index;
123
123
  if (g[g.length - 1] === "/") {
124
- const i = r - g.length;
124
+ const n = r - g.length;
125
125
  g = g.substring(0, g.length - 1);
126
- const s = p(g, t);
126
+ const s = p(g, e);
127
127
  if (s === true) {
128
- n = true;
128
+ i = true;
129
129
  } else {
130
- return x(s.err.code, s.err.msg, E(e, i + s.err.line));
130
+ return x(s.err.code, s.err.msg, E(t, n + s.err.line));
131
131
  }
132
132
  } else if (f) {
133
- if (!h.tagClosed) {
134
- return x("InvalidTag", "Closing tag '" + c + "' doesn't have proper closing.", E(e, r));
133
+ if (!d.tagClosed) {
134
+ return x("InvalidTag", "Closing tag '" + c + "' doesn't have proper closing.", E(t, r));
135
135
  } else if (g.trim().length > 0) {
136
- return x("InvalidTag", "Closing tag '" + c + "' can't have attributes or invalid starting.", E(e, o));
136
+ return x("InvalidTag", "Closing tag '" + c + "' can't have attributes or invalid starting.", E(t, o));
137
+ } else if (n.length === 0) {
138
+ return x("InvalidTag", "Closing tag '" + c + "' has not been opened.", E(t, o));
137
139
  } else {
138
- const t = i.pop();
139
- if (c !== t.tagName) {
140
- let i = E(e, t.tagStartPos);
141
- return x("InvalidTag", "Expected closing tag '" + t.tagName + "' (opened in line " + i.line + ", col " + i.col + ") instead of closing tag '" + c + "'.", E(e, o));
140
+ const e = n.pop();
141
+ if (c !== e.tagName) {
142
+ let n = E(t, e.tagStartPos);
143
+ return x("InvalidTag", "Expected closing tag '" + e.tagName + "' (opened in line " + n.line + ", col " + n.col + ") instead of closing tag '" + c + "'.", E(t, o));
142
144
  }
143
- if (i.length == 0) {
145
+ if (n.length == 0) {
144
146
  s = true;
145
147
  }
146
148
  }
147
149
  } else {
148
- const a = p(g, t);
150
+ const a = p(g, e);
149
151
  if (a !== true) {
150
- return x(a.err.code, a.err.msg, E(e, r - g.length + a.err.line));
152
+ return x(a.err.code, a.err.msg, E(t, r - g.length + a.err.line));
151
153
  }
152
154
  if (s === true) {
153
- return x("InvalidXml", "Multiple possible root nodes found.", E(e, r));
154
- } else if (t.unpairedTags.indexOf(c) !== -1) {} else {
155
- i.push({
155
+ return x("InvalidXml", "Multiple possible root nodes found.", E(t, r));
156
+ } else if (e.unpairedTags.indexOf(c) !== -1) {} else {
157
+ n.push({
156
158
  tagName: c,
157
159
  tagStartPos: o
158
160
  });
159
161
  }
160
- n = true;
162
+ i = true;
161
163
  }
162
- for (r++; r < e.length; r++) {
163
- if (e[r] === "<") {
164
- if (e[r + 1] === "!") {
164
+ for (r++; r < t.length; r++) {
165
+ if (t[r] === "<") {
166
+ if (t[r + 1] === "!") {
165
167
  r++;
166
- r = u(e, r);
168
+ r = u(t, r);
167
169
  continue;
168
- } else if (e[r + 1] === "?") {
169
- r = l(e, ++r);
170
+ } else if (t[r + 1] === "?") {
171
+ r = l(t, ++r);
170
172
  if (r.err) return r;
171
173
  } else {
172
174
  break;
173
175
  }
174
- } else if (e[r] === "&") {
175
- const t = m(e, r);
176
- if (t == -1) return x("InvalidChar", "char '&' is not expected.", E(e, r));
177
- r = t;
176
+ } else if (t[r] === "&") {
177
+ const e = m(t, r);
178
+ if (e == -1) return x("InvalidChar", "char '&' is not expected.", E(t, r));
179
+ r = e;
178
180
  } else {
179
- if (s === true && !a(e[r])) {
180
- return x("InvalidXml", "Extra text at the end", E(e, r));
181
+ if (s === true && !a(t[r])) {
182
+ return x("InvalidXml", "Extra text at the end", E(t, r));
181
183
  }
182
184
  }
183
185
  }
184
- if (e[r] === "<") {
186
+ if (t[r] === "<") {
185
187
  r--;
186
188
  }
187
189
  }
188
190
  } else {
189
- if (a(e[r])) {
191
+ if (a(t[r])) {
190
192
  continue;
191
193
  }
192
- return x("InvalidChar", "char '" + e[r] + "' is not expected.", E(e, r));
194
+ return x("InvalidChar", "char '" + t[r] + "' is not expected.", E(t, r));
193
195
  }
194
196
  }
195
- if (!n) {
197
+ if (!i) {
196
198
  return x("InvalidXml", "Start tag expected.", 1);
197
- } else if (i.length == 1) {
198
- return x("InvalidTag", "Unclosed tag '" + i[0].tagName + "'.", E(e, i[0].tagStartPos));
199
- } else if (i.length > 0) {
200
- return x("InvalidXml", "Invalid '" + JSON.stringify(i.map((e => e.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", {
199
+ } else if (n.length == 1) {
200
+ return x("InvalidTag", "Unclosed tag '" + n[0].tagName + "'.", E(t, n[0].tagStartPos));
201
+ } else if (n.length > 0) {
202
+ return x("InvalidXml", "Invalid '" + JSON.stringify(n.map((t => t.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", {
201
203
  line: 1,
202
204
  col: 1
203
205
  });
@@ -205,176 +207,176 @@ var o = t.validate = function(e, t) {
205
207
  return true;
206
208
  };
207
209
 
208
- function a(e) {
209
- return e === " " || e === "\t" || e === "\n" || e === "\r";
210
+ function a(t) {
211
+ return t === " " || t === "\t" || t === "\n" || t === "\r";
210
212
  }
211
213
 
212
- function l(e, t) {
213
- const i = t;
214
- for (;t < e.length; t++) {
215
- if (e[t] == "?" || e[t] == " ") {
216
- const n = e.substr(i, t - i);
217
- if (t > 5 && n === "xml") {
218
- return x("InvalidXml", "XML declaration allowed only at the start of the document.", E(e, t));
219
- } else if (e[t] == "?" && e[t + 1] == ">") {
220
- t++;
214
+ function l(t, e) {
215
+ const n = e;
216
+ for (;e < t.length; e++) {
217
+ if (t[e] == "?" || t[e] == " ") {
218
+ const i = t.substr(n, e - n);
219
+ if (e > 5 && i === "xml") {
220
+ return x("InvalidXml", "XML declaration allowed only at the start of the document.", E(t, e));
221
+ } else if (t[e] == "?" && t[e + 1] == ">") {
222
+ e++;
221
223
  break;
222
224
  } else {
223
225
  continue;
224
226
  }
225
227
  }
226
228
  }
227
- return t;
229
+ return e;
228
230
  }
229
231
 
230
- function u(e, t) {
231
- if (e.length > t + 5 && e[t + 1] === "-" && e[t + 2] === "-") {
232
- for (t += 3; t < e.length; t++) {
233
- if (e[t] === "-" && e[t + 1] === "-" && e[t + 2] === ">") {
234
- t += 2;
232
+ function u(t, e) {
233
+ if (t.length > e + 5 && t[e + 1] === "-" && t[e + 2] === "-") {
234
+ for (e += 3; e < t.length; e++) {
235
+ if (t[e] === "-" && t[e + 1] === "-" && t[e + 2] === ">") {
236
+ e += 2;
235
237
  break;
236
238
  }
237
239
  }
238
- } else if (e.length > t + 8 && e[t + 1] === "D" && e[t + 2] === "O" && e[t + 3] === "C" && e[t + 4] === "T" && e[t + 5] === "Y" && e[t + 6] === "P" && e[t + 7] === "E") {
239
- let i = 1;
240
- for (t += 8; t < e.length; t++) {
241
- if (e[t] === "<") {
242
- i++;
243
- } else if (e[t] === ">") {
244
- i--;
245
- if (i === 0) {
240
+ } else if (t.length > e + 8 && t[e + 1] === "D" && t[e + 2] === "O" && t[e + 3] === "C" && t[e + 4] === "T" && t[e + 5] === "Y" && t[e + 6] === "P" && t[e + 7] === "E") {
241
+ let n = 1;
242
+ for (e += 8; e < t.length; e++) {
243
+ if (t[e] === "<") {
244
+ n++;
245
+ } else if (t[e] === ">") {
246
+ n--;
247
+ if (n === 0) {
246
248
  break;
247
249
  }
248
250
  }
249
251
  }
250
- } else if (e.length > t + 9 && e[t + 1] === "[" && e[t + 2] === "C" && e[t + 3] === "D" && e[t + 4] === "A" && e[t + 5] === "T" && e[t + 6] === "A" && e[t + 7] === "[") {
251
- for (t += 8; t < e.length; t++) {
252
- if (e[t] === "]" && e[t + 1] === "]" && e[t + 2] === ">") {
253
- t += 2;
252
+ } else if (t.length > e + 9 && t[e + 1] === "[" && t[e + 2] === "C" && t[e + 3] === "D" && t[e + 4] === "A" && t[e + 5] === "T" && t[e + 6] === "A" && t[e + 7] === "[") {
253
+ for (e += 8; e < t.length; e++) {
254
+ if (t[e] === "]" && t[e + 1] === "]" && t[e + 2] === ">") {
255
+ e += 2;
254
256
  break;
255
257
  }
256
258
  }
257
259
  }
258
- return t;
260
+ return e;
259
261
  }
260
262
 
261
263
  const f = '"';
262
264
 
263
265
  const c = "'";
264
266
 
265
- function d(e, t) {
266
- let i = "";
267
+ function h(t, e) {
267
268
  let n = "";
269
+ let i = "";
268
270
  let s = false;
269
- for (;t < e.length; t++) {
270
- if (e[t] === f || e[t] === c) {
271
- if (n === "") {
272
- n = e[t];
273
- } else if (n !== e[t]) {} else {
274
- n = "";
271
+ for (;e < t.length; e++) {
272
+ if (t[e] === f || t[e] === c) {
273
+ if (i === "") {
274
+ i = t[e];
275
+ } else if (i !== t[e]) {} else {
276
+ i = "";
275
277
  }
276
- } else if (e[t] === ">") {
277
- if (n === "") {
278
+ } else if (t[e] === ">") {
279
+ if (i === "") {
278
280
  s = true;
279
281
  break;
280
282
  }
281
283
  }
282
- i += e[t];
284
+ n += t[e];
283
285
  }
284
- if (n !== "") {
286
+ if (i !== "") {
285
287
  return false;
286
288
  }
287
289
  return {
288
- value: i,
289
- index: t,
290
+ value: n,
291
+ index: e,
290
292
  tagClosed: s
291
293
  };
292
294
  }
293
295
 
294
- const h = new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?", "g");
296
+ const d = new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?", "g");
295
297
 
296
- function p(e, t) {
297
- const i = s.getAllMatches(e, h);
298
- const n = {};
299
- for (let e = 0; e < i.length; e++) {
300
- if (i[e][1].length === 0) {
301
- return x("InvalidAttr", "Attribute '" + i[e][2] + "' has no space in starting.", v(i[e]));
302
- } else if (i[e][3] !== undefined && i[e][4] === undefined) {
303
- return x("InvalidAttr", "Attribute '" + i[e][2] + "' is without value.", v(i[e]));
304
- } else if (i[e][3] === undefined && !t.allowBooleanAttributes) {
305
- return x("InvalidAttr", "boolean attribute '" + i[e][2] + "' is not allowed.", v(i[e]));
298
+ function p(t, e) {
299
+ const n = s.getAllMatches(t, d);
300
+ const i = {};
301
+ for (let t = 0; t < n.length; t++) {
302
+ if (n[t][1].length === 0) {
303
+ return x("InvalidAttr", "Attribute '" + n[t][2] + "' has no space in starting.", v(n[t]));
304
+ } else if (n[t][3] !== undefined && n[t][4] === undefined) {
305
+ return x("InvalidAttr", "Attribute '" + n[t][2] + "' is without value.", v(n[t]));
306
+ } else if (n[t][3] === undefined && !e.allowBooleanAttributes) {
307
+ return x("InvalidAttr", "boolean attribute '" + n[t][2] + "' is not allowed.", v(n[t]));
306
308
  }
307
- const s = i[e][2];
309
+ const s = n[t][2];
308
310
  if (!N(s)) {
309
- return x("InvalidAttr", "Attribute '" + s + "' is an invalid name.", v(i[e]));
311
+ return x("InvalidAttr", "Attribute '" + s + "' is an invalid name.", v(n[t]));
310
312
  }
311
- if (!n.hasOwnProperty(s)) {
312
- n[s] = 1;
313
+ if (!i.hasOwnProperty(s)) {
314
+ i[s] = 1;
313
315
  } else {
314
- return x("InvalidAttr", "Attribute '" + s + "' is repeated.", v(i[e]));
316
+ return x("InvalidAttr", "Attribute '" + s + "' is repeated.", v(n[t]));
315
317
  }
316
318
  }
317
319
  return true;
318
320
  }
319
321
 
320
- function g(e, t) {
321
- let i = /\d/;
322
- if (e[t] === "x") {
323
- t++;
324
- i = /[\da-fA-F]/;
322
+ function g(t, e) {
323
+ let n = /\d/;
324
+ if (t[e] === "x") {
325
+ e++;
326
+ n = /[\da-fA-F]/;
325
327
  }
326
- for (;t < e.length; t++) {
327
- if (e[t] === ";") return t;
328
- if (!e[t].match(i)) break;
328
+ for (;e < t.length; e++) {
329
+ if (t[e] === ";") return e;
330
+ if (!t[e].match(n)) break;
329
331
  }
330
332
  return -1;
331
333
  }
332
334
 
333
- function m(e, t) {
334
- t++;
335
- if (e[t] === ";") return -1;
336
- if (e[t] === "#") {
337
- t++;
338
- return g(e, t);
339
- }
340
- let i = 0;
341
- for (;t < e.length; t++, i++) {
342
- if (e[t].match(/\w/) && i < 20) continue;
343
- if (e[t] === ";") break;
335
+ function m(t, e) {
336
+ e++;
337
+ if (t[e] === ";") return -1;
338
+ if (t[e] === "#") {
339
+ e++;
340
+ return g(t, e);
341
+ }
342
+ let n = 0;
343
+ for (;e < t.length; e++, n++) {
344
+ if (t[e].match(/\w/) && n < 20) continue;
345
+ if (t[e] === ";") break;
344
346
  return -1;
345
347
  }
346
- return t;
348
+ return e;
347
349
  }
348
350
 
349
- function x(e, t, i) {
351
+ function x(t, e, n) {
350
352
  return {
351
353
  err: {
352
- code: e,
353
- msg: t,
354
- line: i.line || i,
355
- col: i.col
354
+ code: t,
355
+ msg: e,
356
+ line: n.line || n,
357
+ col: n.col
356
358
  }
357
359
  };
358
360
  }
359
361
 
360
- function N(e) {
361
- return s.isName(e);
362
+ function N(t) {
363
+ return s.isName(t);
362
364
  }
363
365
 
364
- function b(e) {
365
- return s.isName(e);
366
+ function b(t) {
367
+ return s.isName(t);
366
368
  }
367
369
 
368
- function E(e, t) {
369
- const i = e.substring(0, t).split(/\r?\n/);
370
+ function E(t, e) {
371
+ const n = t.substring(0, e).split(/\r?\n/);
370
372
  return {
371
- line: i.length,
372
- col: i[i.length - 1].length + 1
373
+ line: n.length,
374
+ col: n[n.length - 1].length + 1
373
375
  };
374
376
  }
375
377
 
376
- function v(e) {
377
- return e.startIndex + e[1].length;
378
+ function v(t) {
379
+ return t.startIndex + t[1].length;
378
380
  }
379
381
 
380
382
  var y = {};
@@ -396,11 +398,11 @@ const T = {
396
398
  leadingZeros: true,
397
399
  eNotation: true
398
400
  },
399
- tagValueProcessor: function(e, t) {
400
- return t;
401
+ tagValueProcessor: function(t, e) {
402
+ return e;
401
403
  },
402
- attributeValueProcessor: function(e, t) {
403
- return t;
404
+ attributeValueProcessor: function(t, e) {
405
+ return e;
404
406
  },
405
407
  stopNodes: [],
406
408
  alwaysCreateTextNode: false,
@@ -413,150 +415,151 @@ const T = {
413
415
  ignorePiTags: false,
414
416
  transformTagName: false,
415
417
  transformAttributeName: false,
416
- updateTag: function(e, t, i) {
417
- return e;
418
+ updateTag: function(t, e, n) {
419
+ return t;
418
420
  }
419
421
  };
420
422
 
421
- const O = function(e) {
422
- return Object.assign({}, T, e);
423
+ const O = function(t) {
424
+ return Object.assign({}, T, t);
423
425
  };
424
426
 
425
- var w = y.buildOptions = O;
427
+ var A = y.buildOptions = O;
426
428
 
427
429
  var P = y.defaultOptions = T;
428
430
 
429
431
  "use strict";
430
432
 
431
433
  class XmlNode {
432
- constructor(e) {
433
- this.tagname = e;
434
+ constructor(t) {
435
+ this.tagname = t;
434
436
  this.child = [];
435
437
  this[":@"] = {};
436
438
  }
437
- add(e, t) {
438
- if (e === "__proto__") e = "#__proto__";
439
+ add(t, e) {
440
+ if (t === "__proto__") t = "#__proto__";
439
441
  this.child.push({
440
- [e]: t
442
+ [t]: e
441
443
  });
442
444
  }
443
- addChild(e) {
444
- if (e.tagname === "__proto__") e.tagname = "#__proto__";
445
- if (e[":@"] && Object.keys(e[":@"]).length > 0) {
445
+ addChild(t) {
446
+ if (t.tagname === "__proto__") t.tagname = "#__proto__";
447
+ if (t[":@"] && Object.keys(t[":@"]).length > 0) {
446
448
  this.child.push({
447
- [e.tagname]: e.child,
448
- [":@"]: e[":@"]
449
+ [t.tagname]: t.child,
450
+ [":@"]: t[":@"]
449
451
  });
450
452
  } else {
451
453
  this.child.push({
452
- [e.tagname]: e.child
454
+ [t.tagname]: t.child
453
455
  });
454
456
  }
455
457
  }
456
458
  }
457
459
 
458
- var A = XmlNode;
460
+ var w = XmlNode;
459
461
 
460
- const I = e(A);
462
+ const C = t(w);
461
463
 
462
- const C = i;
464
+ const I = n;
463
465
 
464
- function j(e, t) {
465
- const i = {};
466
- if (e[t + 3] === "O" && e[t + 4] === "C" && e[t + 5] === "T" && e[t + 6] === "Y" && e[t + 7] === "P" && e[t + 8] === "E") {
467
- t = t + 9;
468
- let n = 1;
466
+ function S(t, e) {
467
+ const n = {};
468
+ 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") {
469
+ e = e + 9;
470
+ let i = 1;
469
471
  let s = false, r = false;
470
472
  let o = "";
471
- for (;t < e.length; t++) {
472
- if (e[t] === "<" && !r) {
473
- if (s && k(e, t)) {
474
- t += 7;
475
- [entityName, val, t] = S(e, t + 1);
476
- if (val.indexOf("&") === -1) i[_(entityName)] = {
477
- regx: RegExp(`&${entityName};`, "g"),
478
- val: val
473
+ for (;e < t.length; e++) {
474
+ if (t[e] === "<" && !r) {
475
+ if (s && k(t, e)) {
476
+ e += 7;
477
+ let i, s;
478
+ [i, s, e] = j(t, e + 1);
479
+ if (s.indexOf("&") === -1) n[D(i)] = {
480
+ regx: RegExp(`&${i};`, "g"),
481
+ val: s
479
482
  };
480
- } else if (s && $(e, t)) t += 8; else if (s && F(e, t)) t += 8; else if (s && D(e, t)) t += 9; else if (V) r = true; else throw new Error("Invalid DOCTYPE");
481
- n++;
483
+ } else if (s && F(t, e)) e += 8; else if (s && $(t, e)) e += 8; else if (s && _(t, e)) e += 9; else if (V) r = true; else throw new Error("Invalid DOCTYPE");
484
+ i++;
482
485
  o = "";
483
- } else if (e[t] === ">") {
486
+ } else if (t[e] === ">") {
484
487
  if (r) {
485
- if (e[t - 1] === "-" && e[t - 2] === "-") {
488
+ if (t[e - 1] === "-" && t[e - 2] === "-") {
486
489
  r = false;
487
- n--;
490
+ i--;
488
491
  }
489
492
  } else {
490
- n--;
493
+ i--;
491
494
  }
492
- if (n === 0) {
495
+ if (i === 0) {
493
496
  break;
494
497
  }
495
- } else if (e[t] === "[") {
498
+ } else if (t[e] === "[") {
496
499
  s = true;
497
500
  } else {
498
- o += e[t];
501
+ o += t[e];
499
502
  }
500
503
  }
501
- if (n !== 0) {
504
+ if (i !== 0) {
502
505
  throw new Error(`Unclosed DOCTYPE`);
503
506
  }
504
507
  } else {
505
508
  throw new Error(`Invalid Tag instead of DOCTYPE`);
506
509
  }
507
510
  return {
508
- entities: i,
509
- i: t
511
+ entities: n,
512
+ i: e
510
513
  };
511
514
  }
512
515
 
513
- function S(e, t) {
514
- let i = "";
515
- for (;t < e.length && (e[t] !== "'" && e[t] !== '"'); t++) {
516
- i += e[t];
516
+ function j(t, e) {
517
+ let n = "";
518
+ for (;e < t.length && (t[e] !== "'" && t[e] !== '"'); e++) {
519
+ n += t[e];
517
520
  }
518
- i = i.trim();
519
- if (i.indexOf(" ") !== -1) throw new Error("External entites are not supported");
520
- const n = e[t++];
521
+ n = n.trim();
522
+ if (n.indexOf(" ") !== -1) throw new Error("External entites are not supported");
523
+ const i = t[e++];
521
524
  let s = "";
522
- for (;t < e.length && e[t] !== n; t++) {
523
- s += e[t];
525
+ for (;e < t.length && t[e] !== i; e++) {
526
+ s += t[e];
524
527
  }
525
- return [ i, s, t ];
528
+ return [ n, s, e ];
526
529
  }
527
530
 
528
- function V(e, t) {
529
- if (e[t + 1] === "!" && e[t + 2] === "-" && e[t + 3] === "-") return true;
531
+ function V(t, e) {
532
+ if (t[e + 1] === "!" && t[e + 2] === "-" && t[e + 3] === "-") return true;
530
533
  return false;
531
534
  }
532
535
 
533
- function k(e, t) {
534
- if (e[t + 1] === "!" && e[t + 2] === "E" && e[t + 3] === "N" && e[t + 4] === "T" && e[t + 5] === "I" && e[t + 6] === "T" && e[t + 7] === "Y") return true;
536
+ function k(t, e) {
537
+ if (t[e + 1] === "!" && t[e + 2] === "E" && t[e + 3] === "N" && t[e + 4] === "T" && t[e + 5] === "I" && t[e + 6] === "T" && t[e + 7] === "Y") return true;
535
538
  return false;
536
539
  }
537
540
 
538
- function $(e, t) {
539
- if (e[t + 1] === "!" && e[t + 2] === "E" && e[t + 3] === "L" && e[t + 4] === "E" && e[t + 5] === "M" && e[t + 6] === "E" && e[t + 7] === "N" && e[t + 8] === "T") return true;
541
+ function F(t, e) {
542
+ if (t[e + 1] === "!" && t[e + 2] === "E" && t[e + 3] === "L" && t[e + 4] === "E" && t[e + 5] === "M" && t[e + 6] === "E" && t[e + 7] === "N" && t[e + 8] === "T") return true;
540
543
  return false;
541
544
  }
542
545
 
543
- function F(e, t) {
544
- if (e[t + 1] === "!" && e[t + 2] === "A" && e[t + 3] === "T" && e[t + 4] === "T" && e[t + 5] === "L" && e[t + 6] === "I" && e[t + 7] === "S" && e[t + 8] === "T") return true;
546
+ function $(t, e) {
547
+ if (t[e + 1] === "!" && t[e + 2] === "A" && t[e + 3] === "T" && t[e + 4] === "T" && t[e + 5] === "L" && t[e + 6] === "I" && t[e + 7] === "S" && t[e + 8] === "T") return true;
545
548
  return false;
546
549
  }
547
550
 
548
- function D(e, t) {
549
- if (e[t + 1] === "!" && e[t + 2] === "N" && e[t + 3] === "O" && e[t + 4] === "T" && e[t + 5] === "A" && e[t + 6] === "T" && e[t + 7] === "I" && e[t + 8] === "O" && e[t + 9] === "N") return true;
551
+ function _(t, e) {
552
+ if (t[e + 1] === "!" && t[e + 2] === "N" && t[e + 3] === "O" && t[e + 4] === "T" && t[e + 5] === "A" && t[e + 6] === "T" && t[e + 7] === "I" && t[e + 8] === "O" && t[e + 9] === "N") return true;
550
553
  return false;
551
554
  }
552
555
 
553
- function _(e) {
554
- if (C.isName(e)) return e; else throw new Error(`Invalid entity name ${e}`);
556
+ function D(t) {
557
+ if (I.isName(t)) return t; else throw new Error(`Invalid entity name ${t}`);
555
558
  }
556
559
 
557
- var L = j;
560
+ var L = S;
558
561
 
559
- const M = e(L);
562
+ const M = t(L);
560
563
 
561
564
  const B = /^[-+]?0x[a-fA-F0-9]+$/;
562
565
 
@@ -570,74 +573,99 @@ if (!Number.parseFloat && window.parseFloat) {
570
573
  Number.parseFloat = window.parseFloat;
571
574
  }
572
575
 
573
- const R = {
576
+ const G = {
574
577
  hex: true,
575
578
  leadingZeros: true,
576
579
  decimalPoint: ".",
577
580
  eNotation: true
578
581
  };
579
582
 
580
- function G(e, t = {}) {
581
- t = Object.assign({}, R, t);
582
- if (!e || typeof e !== "string") return e;
583
- let i = e.trim();
584
- if (t.skipLike !== undefined && t.skipLike.test(i)) return e; else if (t.hex && B.test(i)) {
585
- return Number.parseInt(i, 16);
583
+ function R(t, e = {}) {
584
+ e = Object.assign({}, G, e);
585
+ if (!t || typeof t !== "string") return t;
586
+ let n = t.trim();
587
+ if (e.skipLike !== undefined && e.skipLike.test(n)) return t; else if (e.hex && B.test(n)) {
588
+ return Number.parseInt(n, 16);
586
589
  } else {
587
- const n = X.exec(i);
588
- if (n) {
589
- const s = n[1];
590
- const r = n[2];
591
- let o = U(n[3]);
592
- const a = n[4] || n[6];
593
- if (!t.leadingZeros && r.length > 0 && s && i[2] !== ".") return e; else if (!t.leadingZeros && r.length > 0 && !s && i[1] !== ".") return e; else {
594
- const n = Number(i);
595
- const l = "" + n;
590
+ const i = X.exec(n);
591
+ if (i) {
592
+ const s = i[1];
593
+ const r = i[2];
594
+ let o = U(i[3]);
595
+ const a = i[4] || i[6];
596
+ if (!e.leadingZeros && r.length > 0 && s && n[2] !== ".") return t; else if (!e.leadingZeros && r.length > 0 && !s && n[1] !== ".") return t; else {
597
+ const i = Number(n);
598
+ const l = "" + i;
596
599
  if (l.search(/[eE]/) !== -1) {
597
- if (t.eNotation) return n; else return e;
600
+ if (e.eNotation) return i; else return t;
598
601
  } else if (a) {
599
- if (t.eNotation) return n; else return e;
600
- } else if (i.indexOf(".") !== -1) {
601
- if (l === "0" && o === "") return n; else if (l === o) return n; else if (s && l === "-" + o) return n; else return e;
602
+ if (e.eNotation) return i; else return t;
603
+ } else if (n.indexOf(".") !== -1) {
604
+ if (l === "0" && o === "") return i; else if (l === o) return i; else if (s && l === "-" + o) return i; else return t;
602
605
  }
603
606
  if (r) {
604
- if (o === l) return n; else if (s + o === l) return n; else return e;
607
+ if (o === l) return i; else if (s + o === l) return i; else return t;
605
608
  }
606
- if (i === l) return n; else if (i === s + l) return n;
607
- return e;
609
+ if (n === l) return i; else if (n === s + l) return i;
610
+ return t;
608
611
  }
609
612
  } else {
610
- return e;
613
+ return t;
611
614
  }
612
615
  }
613
616
  }
614
617
 
615
- function U(e) {
616
- if (e && e.indexOf(".") !== -1) {
617
- e = e.replace(/0+$/, "");
618
- if (e === ".") e = "0"; else if (e[0] === ".") e = "0" + e; else if (e[e.length - 1] === ".") e = e.substr(0, e.length - 1);
619
- return e;
618
+ function U(t) {
619
+ if (t && t.indexOf(".") !== -1) {
620
+ t = t.replace(/0+$/, "");
621
+ if (t === ".") t = "0"; else if (t[0] === ".") t = "0" + t; else if (t[t.length - 1] === ".") t = t.substr(0, t.length - 1);
622
+ return t;
620
623
  }
621
- return e;
624
+ return t;
625
+ }
626
+
627
+ var Y = R;
628
+
629
+ const Z = t(Y);
630
+
631
+ function q(t) {
632
+ if (typeof t === "function") {
633
+ return t;
634
+ }
635
+ if (Array.isArray(t)) {
636
+ return e => {
637
+ for (const n of t) {
638
+ if (typeof n === "string" && e === n) {
639
+ return true;
640
+ }
641
+ if (n instanceof RegExp && n.test(e)) {
642
+ return true;
643
+ }
644
+ }
645
+ };
646
+ }
647
+ return () => false;
622
648
  }
623
649
 
624
- var Y = G;
650
+ var W = q;
625
651
 
626
- const Z = e(Y);
652
+ const z = t(W);
627
653
 
628
654
  "use strict";
629
655
 
630
- const q = i;
656
+ const J = n;
657
+
658
+ const H = w;
631
659
 
632
- const W = A;
660
+ const K = L;
633
661
 
634
- const z = L;
662
+ const Q = Y;
635
663
 
636
- const J = Y;
664
+ const tt = W;
637
665
 
638
- let H = class OrderedObjParser {
639
- constructor(e) {
640
- this.options = e;
666
+ let et = class OrderedObjParser {
667
+ constructor(t) {
668
+ this.options = t;
641
669
  this.currentNode = null;
642
670
  this.tagsNodeStack = [];
643
671
  this.docTypeEntities = {};
@@ -695,84 +723,96 @@ let H = class OrderedObjParser {
695
723
  inr: {
696
724
  regex: /&(inr|#8377);/g,
697
725
  val: "₹"
726
+ },
727
+ num_dec: {
728
+ regex: /&#([0-9]{1,7});/g,
729
+ val: (t, e) => String.fromCharCode(Number.parseInt(e, 10))
730
+ },
731
+ num_hex: {
732
+ regex: /&#x([0-9a-fA-F]{1,6});/g,
733
+ val: (t, e) => String.fromCharCode(Number.parseInt(e, 16))
698
734
  }
699
735
  };
700
- this.addExternalEntities = K;
701
- this.parseXml = ne;
702
- this.parseTextData = Q;
703
- this.resolveNameSpace = ee;
704
- this.buildAttributesMap = ie;
705
- this.isItStopNode = ae;
706
- this.replaceEntitiesValue = re;
707
- this.readStopNodeData = ce;
708
- this.saveTextToParentTag = oe;
709
- this.addChild = se;
736
+ this.addExternalEntities = nt;
737
+ this.parseXml = at;
738
+ this.parseTextData = it;
739
+ this.resolveNameSpace = st;
740
+ this.buildAttributesMap = ot;
741
+ this.isItStopNode = ct;
742
+ this.replaceEntitiesValue = ut;
743
+ this.readStopNodeData = gt;
744
+ this.saveTextToParentTag = ft;
745
+ this.addChild = lt;
746
+ this.ignoreAttributesFn = tt(this.options.ignoreAttributes);
710
747
  }
711
748
  };
712
749
 
713
- function K(e) {
714
- const t = Object.keys(e);
715
- for (let i = 0; i < t.length; i++) {
716
- const n = t[i];
717
- this.lastEntities[n] = {
718
- regex: new RegExp("&" + n + ";", "g"),
719
- val: e[n]
750
+ function nt(t) {
751
+ const e = Object.keys(t);
752
+ for (let n = 0; n < e.length; n++) {
753
+ const i = e[n];
754
+ this.lastEntities[i] = {
755
+ regex: new RegExp("&" + i + ";", "g"),
756
+ val: t[i]
720
757
  };
721
758
  }
722
759
  }
723
760
 
724
- function Q(e, t, i, n, s, r, o) {
725
- if (e !== undefined) {
726
- if (this.options.trimValues && !n) {
727
- e = e.trim();
761
+ function it(t, e, n, i, s, r, o) {
762
+ if (t !== undefined) {
763
+ if (this.options.trimValues && !i) {
764
+ t = t.trim();
728
765
  }
729
- if (e.length > 0) {
730
- if (!o) e = this.replaceEntitiesValue(e);
731
- const n = this.options.tagValueProcessor(t, e, i, s, r);
732
- if (n === null || n === undefined) {
733
- return e;
734
- } else if (typeof n !== typeof e || n !== e) {
735
- return n;
766
+ if (t.length > 0) {
767
+ if (!o) t = this.replaceEntitiesValue(t);
768
+ const i = this.options.tagValueProcessor(e, t, n, s, r);
769
+ if (i === null || i === undefined) {
770
+ return t;
771
+ } else if (typeof i !== typeof t || i !== t) {
772
+ return i;
736
773
  } else if (this.options.trimValues) {
737
- return de(e, this.options.parseTagValue, this.options.numberParseOptions);
774
+ return mt(t, this.options.parseTagValue, this.options.numberParseOptions);
738
775
  } else {
739
- const t = e.trim();
740
- if (t === e) {
741
- return de(e, this.options.parseTagValue, this.options.numberParseOptions);
776
+ const e = t.trim();
777
+ if (e === t) {
778
+ return mt(t, this.options.parseTagValue, this.options.numberParseOptions);
742
779
  } else {
743
- return e;
780
+ return t;
744
781
  }
745
782
  }
746
783
  }
747
784
  }
748
785
  }
749
786
 
750
- function ee(e) {
787
+ function st(t) {
751
788
  if (this.options.removeNSPrefix) {
752
- const t = e.split(":");
753
- const i = e.charAt(0) === "/" ? "/" : "";
754
- if (t[0] === "xmlns") {
789
+ const e = t.split(":");
790
+ const n = t.charAt(0) === "/" ? "/" : "";
791
+ if (e[0] === "xmlns") {
755
792
  return "";
756
793
  }
757
- if (t.length === 2) {
758
- e = i + t[1];
794
+ if (e.length === 2) {
795
+ t = n + e[1];
759
796
  }
760
797
  }
761
- return e;
798
+ return t;
762
799
  }
763
800
 
764
- const te = new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?", "gm");
801
+ const rt = new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?", "gm");
765
802
 
766
- function ie(e, t, i) {
767
- if (!this.options.ignoreAttributes && typeof e === "string") {
768
- const i = q.getAllMatches(e, te);
769
- const n = i.length;
803
+ function ot(t, e, n) {
804
+ if (this.options.ignoreAttributes !== true && typeof t === "string") {
805
+ const n = J.getAllMatches(t, rt);
806
+ const i = n.length;
770
807
  const s = {};
771
- for (let e = 0; e < n; e++) {
772
- const n = this.resolveNameSpace(i[e][1]);
773
- let r = i[e][4];
774
- let o = this.options.attributeNamePrefix + n;
775
- if (n.length) {
808
+ for (let t = 0; t < i; t++) {
809
+ const i = this.resolveNameSpace(n[t][1]);
810
+ if (this.ignoreAttributesFn(i, e)) {
811
+ continue;
812
+ }
813
+ let r = n[t][4];
814
+ let o = this.options.attributeNamePrefix + i;
815
+ if (i.length) {
776
816
  if (this.options.transformAttributeName) {
777
817
  o = this.options.transformAttributeName(o);
778
818
  }
@@ -782,13 +822,13 @@ function ie(e, t, i) {
782
822
  r = r.trim();
783
823
  }
784
824
  r = this.replaceEntitiesValue(r);
785
- const e = this.options.attributeValueProcessor(n, r, t);
786
- if (e === null || e === undefined) {
825
+ const t = this.options.attributeValueProcessor(i, r, e);
826
+ if (t === null || t === undefined) {
787
827
  s[o] = r;
788
- } else if (typeof e !== typeof r || e !== r) {
789
- s[o] = e;
828
+ } else if (typeof t !== typeof r || t !== r) {
829
+ s[o] = t;
790
830
  } else {
791
- s[o] = de(r, this.options.parseAttributeValue, this.options.numberParseOptions);
831
+ s[o] = mt(r, this.options.parseAttributeValue, this.options.numberParseOptions);
792
832
  }
793
833
  } else if (this.options.allowBooleanAttributes) {
794
834
  s[o] = true;
@@ -799,37 +839,37 @@ function ie(e, t, i) {
799
839
  return;
800
840
  }
801
841
  if (this.options.attributesGroupName) {
802
- const e = {};
803
- e[this.options.attributesGroupName] = s;
804
- return e;
842
+ const t = {};
843
+ t[this.options.attributesGroupName] = s;
844
+ return t;
805
845
  }
806
846
  return s;
807
847
  }
808
848
  }
809
849
 
810
- const ne = function(e) {
811
- e = e.replace(/\r\n?/g, "\n");
812
- const t = new W("!xml");
813
- let i = t;
814
- let n = "";
850
+ const at = function(t) {
851
+ t = t.replace(/\r\n?/g, "\n");
852
+ const e = new H("!xml");
853
+ let n = e;
854
+ let i = "";
815
855
  let s = "";
816
- for (let r = 0; r < e.length; r++) {
817
- const o = e[r];
856
+ for (let r = 0; r < t.length; r++) {
857
+ const o = t[r];
818
858
  if (o === "<") {
819
- if (e[r + 1] === "/") {
820
- const t = ue(e, ">", r, "Closing Tag is not closed.");
821
- let o = e.substring(r + 2, t).trim();
859
+ if (t[r + 1] === "/") {
860
+ const e = dt(t, ">", r, "Closing Tag is not closed.");
861
+ let o = t.substring(r + 2, e).trim();
822
862
  if (this.options.removeNSPrefix) {
823
- const e = o.indexOf(":");
824
- if (e !== -1) {
825
- o = o.substr(e + 1);
863
+ const t = o.indexOf(":");
864
+ if (t !== -1) {
865
+ o = o.substr(t + 1);
826
866
  }
827
867
  }
828
868
  if (this.options.transformTagName) {
829
869
  o = this.options.transformTagName(o);
830
870
  }
831
- if (i) {
832
- n = this.saveTextToParentTag(n, i, s);
871
+ if (n) {
872
+ i = this.saveTextToParentTag(i, n, s);
833
873
  }
834
874
  const a = s.substring(s.lastIndexOf(".") + 1);
835
875
  if (o && this.options.unpairedTags.indexOf(o) !== -1) {
@@ -843,52 +883,52 @@ const ne = function(e) {
843
883
  l = s.lastIndexOf(".");
844
884
  }
845
885
  s = s.substring(0, l);
846
- i = this.tagsNodeStack.pop();
847
- n = "";
848
- r = t;
849
- } else if (e[r + 1] === "?") {
850
- let t = fe(e, r, false, "?>");
851
- if (!t) throw new Error("Pi Tag is not closed.");
852
- n = this.saveTextToParentTag(n, i, s);
853
- if (this.options.ignoreDeclaration && t.tagName === "?xml" || this.options.ignorePiTags) {} else {
854
- const e = new W(t.tagName);
855
- e.add(this.options.textNodeName, "");
856
- if (t.tagName !== t.tagExp && t.attrExpPresent) {
857
- e[":@"] = this.buildAttributesMap(t.tagExp, s, t.tagName);
886
+ n = this.tagsNodeStack.pop();
887
+ i = "";
888
+ r = e;
889
+ } else if (t[r + 1] === "?") {
890
+ let e = pt(t, r, false, "?>");
891
+ if (!e) throw new Error("Pi Tag is not closed.");
892
+ i = this.saveTextToParentTag(i, n, s);
893
+ if (this.options.ignoreDeclaration && e.tagName === "?xml" || this.options.ignorePiTags) {} else {
894
+ const t = new H(e.tagName);
895
+ t.add(this.options.textNodeName, "");
896
+ if (e.tagName !== e.tagExp && e.attrExpPresent) {
897
+ t[":@"] = this.buildAttributesMap(e.tagExp, s, e.tagName);
858
898
  }
859
- this.addChild(i, e, s);
899
+ this.addChild(n, t, s);
860
900
  }
861
- r = t.closeIndex + 1;
862
- } else if (e.substr(r + 1, 3) === "!--") {
863
- const t = ue(e, "--\x3e", r + 4, "Comment is not closed.");
901
+ r = e.closeIndex + 1;
902
+ } else if (t.substr(r + 1, 3) === "!--") {
903
+ const e = dt(t, "--\x3e", r + 4, "Comment is not closed.");
864
904
  if (this.options.commentPropName) {
865
- const o = e.substring(r + 4, t - 2);
866
- n = this.saveTextToParentTag(n, i, s);
867
- i.add(this.options.commentPropName, [ {
905
+ const o = t.substring(r + 4, e - 2);
906
+ i = this.saveTextToParentTag(i, n, s);
907
+ n.add(this.options.commentPropName, [ {
868
908
  [this.options.textNodeName]: o
869
909
  } ]);
870
910
  }
871
- r = t;
872
- } else if (e.substr(r + 1, 2) === "!D") {
873
- const t = z(e, r);
874
- this.docTypeEntities = t.entities;
875
- r = t.i;
876
- } else if (e.substr(r + 1, 2) === "![") {
877
- const t = ue(e, "]]>", r, "CDATA is not closed.") - 2;
878
- const o = e.substring(r + 9, t);
879
- n = this.saveTextToParentTag(n, i, s);
880
- let a = this.parseTextData(o, i.tagname, s, true, false, true, true);
911
+ r = e;
912
+ } else if (t.substr(r + 1, 2) === "!D") {
913
+ const e = K(t, r);
914
+ this.docTypeEntities = e.entities;
915
+ r = e.i;
916
+ } else if (t.substr(r + 1, 2) === "![") {
917
+ const e = dt(t, "]]>", r, "CDATA is not closed.") - 2;
918
+ const o = t.substring(r + 9, e);
919
+ i = this.saveTextToParentTag(i, n, s);
920
+ let a = this.parseTextData(o, n.tagname, s, true, false, true, true);
881
921
  if (a == undefined) a = "";
882
922
  if (this.options.cdataPropName) {
883
- i.add(this.options.cdataPropName, [ {
923
+ n.add(this.options.cdataPropName, [ {
884
924
  [this.options.textNodeName]: o
885
925
  } ]);
886
926
  } else {
887
- i.add(this.options.textNodeName, a);
927
+ n.add(this.options.textNodeName, a);
888
928
  }
889
- r = t + 2;
929
+ r = e + 2;
890
930
  } else {
891
- let o = fe(e, r, this.options.removeNSPrefix);
931
+ let o = pt(t, r, this.options.removeNSPrefix);
892
932
  let a = o.tagName;
893
933
  const l = o.rawTagName;
894
934
  let u = o.tagExp;
@@ -897,41 +937,48 @@ const ne = function(e) {
897
937
  if (this.options.transformTagName) {
898
938
  a = this.options.transformTagName(a);
899
939
  }
900
- if (i && n) {
901
- if (i.tagname !== "!xml") {
902
- n = this.saveTextToParentTag(n, i, s, false);
940
+ if (n && i) {
941
+ if (n.tagname !== "!xml") {
942
+ i = this.saveTextToParentTag(i, n, s, false);
903
943
  }
904
944
  }
905
- const d = i;
906
- if (d && this.options.unpairedTags.indexOf(d.tagname) !== -1) {
907
- i = this.tagsNodeStack.pop();
945
+ const h = n;
946
+ if (h && this.options.unpairedTags.indexOf(h.tagname) !== -1) {
947
+ n = this.tagsNodeStack.pop();
908
948
  s = s.substring(0, s.lastIndexOf("."));
909
949
  }
910
- if (a !== t.tagname) {
950
+ if (a !== e.tagname) {
911
951
  s += s ? "." + a : a;
912
952
  }
913
953
  if (this.isItStopNode(this.options.stopNodes, s, a)) {
914
- let t = "";
954
+ let e = "";
915
955
  if (u.length > 0 && u.lastIndexOf("/") === u.length - 1) {
956
+ if (a[a.length - 1] === "/") {
957
+ a = a.substr(0, a.length - 1);
958
+ s = s.substr(0, s.length - 1);
959
+ u = a;
960
+ } else {
961
+ u = u.substr(0, u.length - 1);
962
+ }
916
963
  r = o.closeIndex;
917
964
  } else if (this.options.unpairedTags.indexOf(a) !== -1) {
918
965
  r = o.closeIndex;
919
966
  } else {
920
- const i = this.readStopNodeData(e, l, c + 1);
921
- if (!i) throw new Error(`Unexpected end of ${l}`);
922
- r = i.i;
923
- t = i.tagContent;
967
+ const n = this.readStopNodeData(t, l, c + 1);
968
+ if (!n) throw new Error(`Unexpected end of ${l}`);
969
+ r = n.i;
970
+ e = n.tagContent;
924
971
  }
925
- const n = new W(a);
972
+ const i = new H(a);
926
973
  if (a !== u && f) {
927
- n[":@"] = this.buildAttributesMap(u, s, a);
974
+ i[":@"] = this.buildAttributesMap(u, s, a);
928
975
  }
929
- if (t) {
930
- t = this.parseTextData(t, a, s, true, f, true, true);
976
+ if (e) {
977
+ e = this.parseTextData(e, a, s, true, f, true, true);
931
978
  }
932
979
  s = s.substr(0, s.lastIndexOf("."));
933
- n.add(this.options.textNodeName, t);
934
- this.addChild(i, n, s);
980
+ i.add(this.options.textNodeName, e);
981
+ this.addChild(n, i, s);
935
982
  } else {
936
983
  if (u.length > 0 && u.lastIndexOf("/") === u.length - 1) {
937
984
  if (a[a.length - 1] === "/") {
@@ -944,94 +991,94 @@ const ne = function(e) {
944
991
  if (this.options.transformTagName) {
945
992
  a = this.options.transformTagName(a);
946
993
  }
947
- const e = new W(a);
994
+ const t = new H(a);
948
995
  if (a !== u && f) {
949
- e[":@"] = this.buildAttributesMap(u, s, a);
996
+ t[":@"] = this.buildAttributesMap(u, s, a);
950
997
  }
951
- this.addChild(i, e, s);
998
+ this.addChild(n, t, s);
952
999
  s = s.substr(0, s.lastIndexOf("."));
953
1000
  } else {
954
- const e = new W(a);
955
- this.tagsNodeStack.push(i);
1001
+ const t = new H(a);
1002
+ this.tagsNodeStack.push(n);
956
1003
  if (a !== u && f) {
957
- e[":@"] = this.buildAttributesMap(u, s, a);
1004
+ t[":@"] = this.buildAttributesMap(u, s, a);
958
1005
  }
959
- this.addChild(i, e, s);
960
- i = e;
1006
+ this.addChild(n, t, s);
1007
+ n = t;
961
1008
  }
962
- n = "";
1009
+ i = "";
963
1010
  r = c;
964
1011
  }
965
1012
  }
966
1013
  } else {
967
- n += e[r];
1014
+ i += t[r];
968
1015
  }
969
1016
  }
970
- return t.child;
1017
+ return e.child;
971
1018
  };
972
1019
 
973
- function se(e, t, i) {
974
- const n = this.options.updateTag(t.tagname, i, t[":@"]);
975
- if (n === false) {} else if (typeof n === "string") {
976
- t.tagname = n;
977
- e.addChild(t);
1020
+ function lt(t, e, n) {
1021
+ const i = this.options.updateTag(e.tagname, n, e[":@"]);
1022
+ if (i === false) {} else if (typeof i === "string") {
1023
+ e.tagname = i;
1024
+ t.addChild(e);
978
1025
  } else {
979
- e.addChild(t);
1026
+ t.addChild(e);
980
1027
  }
981
1028
  }
982
1029
 
983
- const re = function(e) {
1030
+ const ut = function(t) {
984
1031
  if (this.options.processEntities) {
985
- for (let t in this.docTypeEntities) {
986
- const i = this.docTypeEntities[t];
987
- e = e.replace(i.regx, i.val);
1032
+ for (let e in this.docTypeEntities) {
1033
+ const n = this.docTypeEntities[e];
1034
+ t = t.replace(n.regx, n.val);
988
1035
  }
989
- for (let t in this.lastEntities) {
990
- const i = this.lastEntities[t];
991
- e = e.replace(i.regex, i.val);
1036
+ for (let e in this.lastEntities) {
1037
+ const n = this.lastEntities[e];
1038
+ t = t.replace(n.regex, n.val);
992
1039
  }
993
1040
  if (this.options.htmlEntities) {
994
- for (let t in this.htmlEntities) {
995
- const i = this.htmlEntities[t];
996
- e = e.replace(i.regex, i.val);
1041
+ for (let e in this.htmlEntities) {
1042
+ const n = this.htmlEntities[e];
1043
+ t = t.replace(n.regex, n.val);
997
1044
  }
998
1045
  }
999
- e = e.replace(this.ampEntity.regex, this.ampEntity.val);
1046
+ t = t.replace(this.ampEntity.regex, this.ampEntity.val);
1000
1047
  }
1001
- return e;
1048
+ return t;
1002
1049
  };
1003
1050
 
1004
- function oe(e, t, i, n) {
1005
- if (e) {
1006
- if (n === undefined) n = Object.keys(t.child).length === 0;
1007
- e = this.parseTextData(e, t.tagname, i, false, t[":@"] ? Object.keys(t[":@"]).length !== 0 : false, n);
1008
- if (e !== undefined && e !== "") t.add(this.options.textNodeName, e);
1009
- e = "";
1051
+ function ft(t, e, n, i) {
1052
+ if (t) {
1053
+ if (i === undefined) i = Object.keys(e.child).length === 0;
1054
+ t = this.parseTextData(t, e.tagname, n, false, e[":@"] ? Object.keys(e[":@"]).length !== 0 : false, i);
1055
+ if (t !== undefined && t !== "") e.add(this.options.textNodeName, t);
1056
+ t = "";
1010
1057
  }
1011
- return e;
1058
+ return t;
1012
1059
  }
1013
1060
 
1014
- function ae(e, t, i) {
1015
- const n = "*." + i;
1016
- for (const i in e) {
1017
- const s = e[i];
1018
- if (n === s || t === s) return true;
1061
+ function ct(t, e, n) {
1062
+ const i = "*." + n;
1063
+ for (const n in t) {
1064
+ const s = t[n];
1065
+ if (i === s || e === s) return true;
1019
1066
  }
1020
1067
  return false;
1021
1068
  }
1022
1069
 
1023
- function le(e, t, i = ">") {
1024
- let n;
1070
+ function ht(t, e, n = ">") {
1071
+ let i;
1025
1072
  let s = "";
1026
- for (let r = t; r < e.length; r++) {
1027
- let t = e[r];
1028
- if (n) {
1029
- if (t === n) n = "";
1030
- } else if (t === '"' || t === "'") {
1031
- n = t;
1032
- } else if (t === i[0]) {
1033
- if (i[1]) {
1034
- if (e[r + 1] === i[1]) {
1073
+ for (let r = e; r < t.length; r++) {
1074
+ let e = t[r];
1075
+ if (i) {
1076
+ if (e === i) i = "";
1077
+ } else if (e === '"' || e === "'") {
1078
+ i = e;
1079
+ } else if (e === n[0]) {
1080
+ if (n[1]) {
1081
+ if (t[r + 1] === n[1]) {
1035
1082
  return {
1036
1083
  data: s,
1037
1084
  index: r
@@ -1043,24 +1090,24 @@ function le(e, t, i = ">") {
1043
1090
  index: r
1044
1091
  };
1045
1092
  }
1046
- } else if (t === "\t") {
1047
- t = " ";
1093
+ } else if (e === "\t") {
1094
+ e = " ";
1048
1095
  }
1049
- s += t;
1096
+ s += e;
1050
1097
  }
1051
1098
  }
1052
1099
 
1053
- function ue(e, t, i, n) {
1054
- const s = e.indexOf(t, i);
1100
+ function dt(t, e, n, i) {
1101
+ const s = t.indexOf(e, n);
1055
1102
  if (s === -1) {
1056
- throw new Error(n);
1103
+ throw new Error(i);
1057
1104
  } else {
1058
- return s + t.length - 1;
1105
+ return s + e.length - 1;
1059
1106
  }
1060
1107
  }
1061
1108
 
1062
- function fe(e, t, i, n = ">") {
1063
- const s = le(e, t + 1, n);
1109
+ function pt(t, e, n, i = ">") {
1110
+ const s = ht(t, e + 1, i);
1064
1111
  if (!s) return;
1065
1112
  let r = s.data;
1066
1113
  const o = s.index;
@@ -1072,11 +1119,11 @@ function fe(e, t, i, n = ">") {
1072
1119
  r = r.substring(a + 1).trimStart();
1073
1120
  }
1074
1121
  const f = l;
1075
- if (i) {
1076
- const e = l.indexOf(":");
1077
- if (e !== -1) {
1078
- l = l.substr(e + 1);
1079
- u = l !== s.data.substr(e + 1);
1122
+ if (n) {
1123
+ const t = l.indexOf(":");
1124
+ if (t !== -1) {
1125
+ l = l.substr(t + 1);
1126
+ u = l !== s.data.substr(t + 1);
1080
1127
  }
1081
1128
  }
1082
1129
  return {
@@ -1088,269 +1135,269 @@ function fe(e, t, i, n = ">") {
1088
1135
  };
1089
1136
  }
1090
1137
 
1091
- function ce(e, t, i) {
1092
- const n = i;
1138
+ function gt(t, e, n) {
1139
+ const i = n;
1093
1140
  let s = 1;
1094
- for (;i < e.length; i++) {
1095
- if (e[i] === "<") {
1096
- if (e[i + 1] === "/") {
1097
- const r = ue(e, ">", i, `${t} is not closed`);
1098
- let o = e.substring(i + 2, r).trim();
1099
- if (o === t) {
1141
+ for (;n < t.length; n++) {
1142
+ if (t[n] === "<") {
1143
+ if (t[n + 1] === "/") {
1144
+ const r = dt(t, ">", n, `${e} is not closed`);
1145
+ let o = t.substring(n + 2, r).trim();
1146
+ if (o === e) {
1100
1147
  s--;
1101
1148
  if (s === 0) {
1102
1149
  return {
1103
- tagContent: e.substring(n, i),
1150
+ tagContent: t.substring(i, n),
1104
1151
  i: r
1105
1152
  };
1106
1153
  }
1107
1154
  }
1108
- i = r;
1109
- } else if (e[i + 1] === "?") {
1110
- const t = ue(e, "?>", i + 1, "StopNode is not closed.");
1111
- i = t;
1112
- } else if (e.substr(i + 1, 3) === "!--") {
1113
- const t = ue(e, "--\x3e", i + 3, "StopNode is not closed.");
1114
- i = t;
1115
- } else if (e.substr(i + 1, 2) === "![") {
1116
- const t = ue(e, "]]>", i, "StopNode is not closed.") - 2;
1117
- i = t;
1155
+ n = r;
1156
+ } else if (t[n + 1] === "?") {
1157
+ const e = dt(t, "?>", n + 1, "StopNode is not closed.");
1158
+ n = e;
1159
+ } else if (t.substr(n + 1, 3) === "!--") {
1160
+ const e = dt(t, "--\x3e", n + 3, "StopNode is not closed.");
1161
+ n = e;
1162
+ } else if (t.substr(n + 1, 2) === "![") {
1163
+ const e = dt(t, "]]>", n, "StopNode is not closed.") - 2;
1164
+ n = e;
1118
1165
  } else {
1119
- const n = fe(e, i, ">");
1120
- if (n) {
1121
- const e = n && n.tagName;
1122
- if (e === t && n.tagExp[n.tagExp.length - 1] !== "/") {
1166
+ const i = pt(t, n, ">");
1167
+ if (i) {
1168
+ const t = i && i.tagName;
1169
+ if (t === e && i.tagExp[i.tagExp.length - 1] !== "/") {
1123
1170
  s++;
1124
1171
  }
1125
- i = n.closeIndex;
1172
+ n = i.closeIndex;
1126
1173
  }
1127
1174
  }
1128
1175
  }
1129
1176
  }
1130
1177
  }
1131
1178
 
1132
- function de(e, t, i) {
1133
- if (t && typeof e === "string") {
1134
- const t = e.trim();
1135
- if (t === "true") return true; else if (t === "false") return false; else return J(e, i);
1179
+ function mt(t, e, n) {
1180
+ if (e && typeof t === "string") {
1181
+ const e = t.trim();
1182
+ if (e === "true") return true; else if (e === "false") return false; else return Q(t, n);
1136
1183
  } else {
1137
- if (q.isExist(e)) {
1138
- return e;
1184
+ if (J.isExist(t)) {
1185
+ return t;
1139
1186
  } else {
1140
1187
  return "";
1141
1188
  }
1142
1189
  }
1143
1190
  }
1144
1191
 
1145
- var he = H;
1192
+ var xt = et;
1146
1193
 
1147
- const pe = e(he);
1194
+ const Nt = t(xt);
1148
1195
 
1149
- var ge = {};
1196
+ var bt = {};
1150
1197
 
1151
1198
  "use strict";
1152
1199
 
1153
- function me(e, t) {
1154
- return xe(e, t);
1200
+ function Et(t, e) {
1201
+ return vt(t, e);
1155
1202
  }
1156
1203
 
1157
- function xe(e, t, i) {
1158
- let n;
1204
+ function vt(t, e, n) {
1205
+ let i;
1159
1206
  const s = {};
1160
- for (let r = 0; r < e.length; r++) {
1161
- const o = e[r];
1162
- const a = Ne(o);
1207
+ for (let r = 0; r < t.length; r++) {
1208
+ const o = t[r];
1209
+ const a = yt(o);
1163
1210
  let l = "";
1164
- if (i === undefined) l = a; else l = i + "." + a;
1165
- if (a === t.textNodeName) {
1166
- if (n === undefined) n = o[a]; else n += "" + o[a];
1211
+ if (n === undefined) l = a; else l = n + "." + a;
1212
+ if (a === e.textNodeName) {
1213
+ if (i === undefined) i = o[a]; else i += "" + o[a];
1167
1214
  } else if (a === undefined) {
1168
1215
  continue;
1169
1216
  } else if (o[a]) {
1170
- let e = xe(o[a], t, l);
1171
- const i = Ee(e, t);
1217
+ let t = vt(o[a], e, l);
1218
+ const n = Ot(t, e);
1172
1219
  if (o[":@"]) {
1173
- be(e, o[":@"], l, t);
1174
- } else if (Object.keys(e).length === 1 && e[t.textNodeName] !== undefined && !t.alwaysCreateTextNode) {
1175
- e = e[t.textNodeName];
1176
- } else if (Object.keys(e).length === 0) {
1177
- if (t.alwaysCreateTextNode) e[t.textNodeName] = ""; else e = "";
1220
+ Tt(t, o[":@"], l, e);
1221
+ } else if (Object.keys(t).length === 1 && t[e.textNodeName] !== undefined && !e.alwaysCreateTextNode) {
1222
+ t = t[e.textNodeName];
1223
+ } else if (Object.keys(t).length === 0) {
1224
+ if (e.alwaysCreateTextNode) t[e.textNodeName] = ""; else t = "";
1178
1225
  }
1179
1226
  if (s[a] !== undefined && s.hasOwnProperty(a)) {
1180
1227
  if (!Array.isArray(s[a])) {
1181
1228
  s[a] = [ s[a] ];
1182
1229
  }
1183
- s[a].push(e);
1230
+ s[a].push(t);
1184
1231
  } else {
1185
- if (t.isArray(a, l, i)) {
1186
- s[a] = [ e ];
1232
+ if (e.isArray(a, l, n)) {
1233
+ s[a] = [ t ];
1187
1234
  } else {
1188
- s[a] = e;
1235
+ s[a] = t;
1189
1236
  }
1190
1237
  }
1191
1238
  }
1192
1239
  }
1193
- if (typeof n === "string") {
1194
- if (n.length > 0) s[t.textNodeName] = n;
1195
- } else if (n !== undefined) s[t.textNodeName] = n;
1240
+ if (typeof i === "string") {
1241
+ if (i.length > 0) s[e.textNodeName] = i;
1242
+ } else if (i !== undefined) s[e.textNodeName] = i;
1196
1243
  return s;
1197
1244
  }
1198
1245
 
1199
- function Ne(e) {
1200
- const t = Object.keys(e);
1201
- for (let e = 0; e < t.length; e++) {
1202
- const i = t[e];
1203
- if (i !== ":@") return i;
1246
+ function yt(t) {
1247
+ const e = Object.keys(t);
1248
+ for (let t = 0; t < e.length; t++) {
1249
+ const n = e[t];
1250
+ if (n !== ":@") return n;
1204
1251
  }
1205
1252
  }
1206
1253
 
1207
- function be(e, t, i, n) {
1208
- if (t) {
1209
- const s = Object.keys(t);
1254
+ function Tt(t, e, n, i) {
1255
+ if (e) {
1256
+ const s = Object.keys(e);
1210
1257
  const r = s.length;
1211
1258
  for (let o = 0; o < r; o++) {
1212
1259
  const r = s[o];
1213
- if (n.isArray(r, i + "." + r, true, true)) {
1214
- e[r] = [ t[r] ];
1260
+ if (i.isArray(r, n + "." + r, true, true)) {
1261
+ t[r] = [ e[r] ];
1215
1262
  } else {
1216
- e[r] = t[r];
1263
+ t[r] = e[r];
1217
1264
  }
1218
1265
  }
1219
1266
  }
1220
1267
  }
1221
1268
 
1222
- function Ee(e, t) {
1223
- const {textNodeName: i} = t;
1224
- const n = Object.keys(e).length;
1225
- if (n === 0) {
1269
+ function Ot(t, e) {
1270
+ const {textNodeName: n} = e;
1271
+ const i = Object.keys(t).length;
1272
+ if (i === 0) {
1226
1273
  return true;
1227
1274
  }
1228
- if (n === 1 && (e[i] || typeof e[i] === "boolean" || e[i] === 0)) {
1275
+ if (i === 1 && (t[n] || typeof t[n] === "boolean" || t[n] === 0)) {
1229
1276
  return true;
1230
1277
  }
1231
1278
  return false;
1232
1279
  }
1233
1280
 
1234
- var ve = ge.prettify = me;
1281
+ var At = bt.prettify = Et;
1235
1282
 
1236
- const {buildOptions: ye} = y;
1283
+ const {buildOptions: Pt} = y;
1237
1284
 
1238
- const Te = he;
1285
+ const wt = xt;
1239
1286
 
1240
- const {prettify: Oe} = ge;
1287
+ const {prettify: Ct} = bt;
1241
1288
 
1242
- const we = t;
1289
+ const It = e;
1243
1290
 
1244
- let Pe = class XMLParser {
1245
- constructor(e) {
1291
+ let St = class XMLParser {
1292
+ constructor(t) {
1246
1293
  this.externalEntities = {};
1247
- this.options = ye(e);
1294
+ this.options = Pt(t);
1248
1295
  }
1249
- parse(e, t) {
1250
- if (typeof e === "string") {} else if (e.toString) {
1251
- e = e.toString();
1296
+ parse(t, e) {
1297
+ if (typeof t === "string") {} else if (t.toString) {
1298
+ t = t.toString();
1252
1299
  } else {
1253
1300
  throw new Error("XML data is accepted in String or Bytes[] form.");
1254
1301
  }
1255
- if (t) {
1256
- if (t === true) t = {};
1257
- const i = we.validate(e, t);
1258
- if (i !== true) {
1259
- throw Error(`${i.err.msg}:${i.err.line}:${i.err.col}`);
1302
+ if (e) {
1303
+ if (e === true) e = {};
1304
+ const n = It.validate(t, e);
1305
+ if (n !== true) {
1306
+ throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`);
1260
1307
  }
1261
1308
  }
1262
- const i = new Te(this.options);
1263
- i.addExternalEntities(this.externalEntities);
1264
- const n = i.parseXml(e);
1265
- if (this.options.preserveOrder || n === undefined) return n; else return Oe(n, this.options);
1309
+ const n = new wt(this.options);
1310
+ n.addExternalEntities(this.externalEntities);
1311
+ const i = n.parseXml(t);
1312
+ if (this.options.preserveOrder || i === undefined) return i; else return Ct(i, this.options);
1266
1313
  }
1267
- addEntity(e, t) {
1268
- if (t.indexOf("&") !== -1) {
1314
+ addEntity(t, e) {
1315
+ if (e.indexOf("&") !== -1) {
1269
1316
  throw new Error("Entity value can't have '&'");
1270
- } else if (e.indexOf("&") !== -1 || e.indexOf(";") !== -1) {
1317
+ } else if (t.indexOf("&") !== -1 || t.indexOf(";") !== -1) {
1271
1318
  throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");
1272
- } else if (t === "&") {
1319
+ } else if (e === "&") {
1273
1320
  throw new Error("An entity with value '&' is not permitted");
1274
1321
  } else {
1275
- this.externalEntities[e] = t;
1322
+ this.externalEntities[t] = e;
1276
1323
  }
1277
1324
  }
1278
1325
  };
1279
1326
 
1280
- var Ae = Pe;
1327
+ var jt = St;
1281
1328
 
1282
- const Ie = e(Ae);
1329
+ const Vt = t(jt);
1283
1330
 
1284
- const Ce = "\n";
1331
+ const kt = "\n";
1285
1332
 
1286
- function je(e, t) {
1287
- let i = "";
1288
- if (t.format && t.indentBy.length > 0) {
1289
- i = Ce;
1333
+ function Ft(t, e) {
1334
+ let n = "";
1335
+ if (e.format && e.indentBy.length > 0) {
1336
+ n = kt;
1290
1337
  }
1291
- return Se(e, t, "", i);
1338
+ return $t(t, e, "", n);
1292
1339
  }
1293
1340
 
1294
- function Se(e, t, i, n) {
1341
+ function $t(t, e, n, i) {
1295
1342
  let s = "";
1296
1343
  let r = false;
1297
- for (let o = 0; o < e.length; o++) {
1298
- const a = e[o];
1299
- const l = Ve(a);
1344
+ for (let o = 0; o < t.length; o++) {
1345
+ const a = t[o];
1346
+ const l = _t(a);
1300
1347
  if (l === undefined) continue;
1301
1348
  let u = "";
1302
- if (i.length === 0) u = l; else u = `${i}.${l}`;
1303
- if (l === t.textNodeName) {
1304
- let e = a[l];
1305
- if (!$e(u, t)) {
1306
- e = t.tagValueProcessor(l, e);
1307
- e = Fe(e, t);
1349
+ if (n.length === 0) u = l; else u = `${n}.${l}`;
1350
+ if (l === e.textNodeName) {
1351
+ let t = a[l];
1352
+ if (!Lt(u, e)) {
1353
+ t = e.tagValueProcessor(l, t);
1354
+ t = Mt(t, e);
1308
1355
  }
1309
1356
  if (r) {
1310
- s += n;
1357
+ s += i;
1311
1358
  }
1312
- s += e;
1359
+ s += t;
1313
1360
  r = false;
1314
1361
  continue;
1315
- } else if (l === t.cdataPropName) {
1362
+ } else if (l === e.cdataPropName) {
1316
1363
  if (r) {
1317
- s += n;
1364
+ s += i;
1318
1365
  }
1319
- s += `<![CDATA[${a[l][0][t.textNodeName]}]]>`;
1366
+ s += `<![CDATA[${a[l][0][e.textNodeName]}]]>`;
1320
1367
  r = false;
1321
1368
  continue;
1322
- } else if (l === t.commentPropName) {
1323
- s += n + `\x3c!--${a[l][0][t.textNodeName]}--\x3e`;
1369
+ } else if (l === e.commentPropName) {
1370
+ s += i + `\x3c!--${a[l][0][e.textNodeName]}--\x3e`;
1324
1371
  r = true;
1325
1372
  continue;
1326
1373
  } else if (l[0] === "?") {
1327
- const e = ke(a[":@"], t);
1328
- const i = l === "?xml" ? "" : n;
1329
- let o = a[l][0][t.textNodeName];
1374
+ const t = Dt(a[":@"], e);
1375
+ const n = l === "?xml" ? "" : i;
1376
+ let o = a[l][0][e.textNodeName];
1330
1377
  o = o.length !== 0 ? " " + o : "";
1331
- s += i + `<${l}${o}${e}?>`;
1378
+ s += n + `<${l}${o}${t}?>`;
1332
1379
  r = true;
1333
1380
  continue;
1334
1381
  }
1335
- let f = n;
1382
+ let f = i;
1336
1383
  if (f !== "") {
1337
- f += t.indentBy;
1384
+ f += e.indentBy;
1338
1385
  }
1339
- const c = ke(a[":@"], t);
1340
- const d = n + `<${l}${c}`;
1341
- const h = Se(a[l], t, u, f);
1342
- if (t.unpairedTags.indexOf(l) !== -1) {
1343
- if (t.suppressUnpairedNode) s += d + ">"; else s += d + "/>";
1344
- } else if ((!h || h.length === 0) && t.suppressEmptyNode) {
1345
- s += d + "/>";
1346
- } else if (h && h.endsWith(">")) {
1347
- s += d + `>${h}${n}</${l}>`;
1386
+ const c = Dt(a[":@"], e);
1387
+ const h = i + `<${l}${c}`;
1388
+ const d = $t(a[l], e, u, f);
1389
+ if (e.unpairedTags.indexOf(l) !== -1) {
1390
+ if (e.suppressUnpairedNode) s += h + ">"; else s += h + "/>";
1391
+ } else if ((!d || d.length === 0) && e.suppressEmptyNode) {
1392
+ s += h + "/>";
1393
+ } else if (d && d.endsWith(">")) {
1394
+ s += h + `>${d}${i}</${l}>`;
1348
1395
  } else {
1349
- s += d + ">";
1350
- if (h && n !== "" && (h.includes("/>") || h.includes("</"))) {
1351
- s += n + t.indentBy + h + n;
1396
+ s += h + ">";
1397
+ if (d && i !== "" && (d.includes("/>") || d.includes("</"))) {
1398
+ s += i + e.indentBy + d + i;
1352
1399
  } else {
1353
- s += h;
1400
+ s += d;
1354
1401
  }
1355
1402
  s += `</${l}>`;
1356
1403
  }
@@ -1359,60 +1406,62 @@ function Se(e, t, i, n) {
1359
1406
  return s;
1360
1407
  }
1361
1408
 
1362
- function Ve(e) {
1363
- const t = Object.keys(e);
1364
- for (let i = 0; i < t.length; i++) {
1365
- const n = t[i];
1366
- if (!e.hasOwnProperty(n)) continue;
1367
- if (n !== ":@") return n;
1409
+ function _t(t) {
1410
+ const e = Object.keys(t);
1411
+ for (let n = 0; n < e.length; n++) {
1412
+ const i = e[n];
1413
+ if (!t.hasOwnProperty(i)) continue;
1414
+ if (i !== ":@") return i;
1368
1415
  }
1369
1416
  }
1370
1417
 
1371
- function ke(e, t) {
1372
- let i = "";
1373
- if (e && !t.ignoreAttributes) {
1374
- for (let n in e) {
1375
- if (!e.hasOwnProperty(n)) continue;
1376
- let s = t.attributeValueProcessor(n, e[n]);
1377
- s = Fe(s, t);
1378
- if (s === true && t.suppressBooleanAttributes) {
1379
- i += ` ${n.substr(t.attributeNamePrefix.length)}`;
1418
+ function Dt(t, e) {
1419
+ let n = "";
1420
+ if (t && !e.ignoreAttributes) {
1421
+ for (let i in t) {
1422
+ if (!t.hasOwnProperty(i)) continue;
1423
+ let s = e.attributeValueProcessor(i, t[i]);
1424
+ s = Mt(s, e);
1425
+ if (s === true && e.suppressBooleanAttributes) {
1426
+ n += ` ${i.substr(e.attributeNamePrefix.length)}`;
1380
1427
  } else {
1381
- i += ` ${n.substr(t.attributeNamePrefix.length)}="${s}"`;
1428
+ n += ` ${i.substr(e.attributeNamePrefix.length)}="${s}"`;
1382
1429
  }
1383
1430
  }
1384
1431
  }
1385
- return i;
1432
+ return n;
1386
1433
  }
1387
1434
 
1388
- function $e(e, t) {
1389
- e = e.substr(0, e.length - t.textNodeName.length - 1);
1390
- let i = e.substr(e.lastIndexOf(".") + 1);
1391
- for (let n in t.stopNodes) {
1392
- if (t.stopNodes[n] === e || t.stopNodes[n] === "*." + i) return true;
1435
+ function Lt(t, e) {
1436
+ t = t.substr(0, t.length - e.textNodeName.length - 1);
1437
+ let n = t.substr(t.lastIndexOf(".") + 1);
1438
+ for (let i in e.stopNodes) {
1439
+ if (e.stopNodes[i] === t || e.stopNodes[i] === "*." + n) return true;
1393
1440
  }
1394
1441
  return false;
1395
1442
  }
1396
1443
 
1397
- function Fe(e, t) {
1398
- if (e && e.length > 0 && t.processEntities) {
1399
- for (let i = 0; i < t.entities.length; i++) {
1400
- const n = t.entities[i];
1401
- e = e.replace(n.regex, n.val);
1444
+ function Mt(t, e) {
1445
+ if (t && t.length > 0 && e.processEntities) {
1446
+ for (let n = 0; n < e.entities.length; n++) {
1447
+ const i = e.entities[n];
1448
+ t = t.replace(i.regex, i.val);
1402
1449
  }
1403
1450
  }
1404
- return e;
1451
+ return t;
1405
1452
  }
1406
1453
 
1407
- var De = je;
1454
+ var Bt = Ft;
1408
1455
 
1409
- const _e = e(De);
1456
+ const Xt = t(Bt);
1410
1457
 
1411
1458
  "use strict";
1412
1459
 
1413
- const Le = De;
1460
+ const Gt = Bt;
1461
+
1462
+ const Rt = W;
1414
1463
 
1415
- const Me = {
1464
+ const Ut = {
1416
1465
  attributeNamePrefix: "@_",
1417
1466
  attributesGroupName: false,
1418
1467
  textNodeName: "#text",
@@ -1423,11 +1472,11 @@ const Me = {
1423
1472
  suppressEmptyNode: false,
1424
1473
  suppressUnpairedNode: true,
1425
1474
  suppressBooleanAttributes: true,
1426
- tagValueProcessor: function(e, t) {
1427
- return t;
1475
+ tagValueProcessor: function(t, e) {
1476
+ return e;
1428
1477
  },
1429
- attributeValueProcessor: function(e, t) {
1430
- return t;
1478
+ attributeValueProcessor: function(t, e) {
1479
+ return e;
1431
1480
  },
1432
1481
  preserveOrder: false,
1433
1482
  commentPropName: false,
@@ -1453,19 +1502,20 @@ const Me = {
1453
1502
  oneListGroup: false
1454
1503
  };
1455
1504
 
1456
- function Be(e) {
1457
- this.options = Object.assign({}, Me, e);
1458
- if (this.options.ignoreAttributes || this.options.attributesGroupName) {
1505
+ function Yt(t) {
1506
+ this.options = Object.assign({}, Ut, t);
1507
+ if (this.options.ignoreAttributes === true || this.options.attributesGroupName) {
1459
1508
  this.isAttribute = function() {
1460
1509
  return false;
1461
1510
  };
1462
1511
  } else {
1512
+ this.ignoreAttributesFn = Rt(this.options.ignoreAttributes);
1463
1513
  this.attrPrefixLen = this.options.attributeNamePrefix.length;
1464
- this.isAttribute = Ue;
1514
+ this.isAttribute = zt;
1465
1515
  }
1466
- this.processTextOrObjNode = Xe;
1516
+ this.processTextOrObjNode = Zt;
1467
1517
  if (this.options.format) {
1468
- this.indentate = Ge;
1518
+ this.indentate = Wt;
1469
1519
  this.tagEndChar = ">\n";
1470
1520
  this.newLine = "\n";
1471
1521
  } else {
@@ -1477,219 +1527,231 @@ function Be(e) {
1477
1527
  }
1478
1528
  }
1479
1529
 
1480
- Be.prototype.build = function(e) {
1530
+ Yt.prototype.build = function(t) {
1481
1531
  if (this.options.preserveOrder) {
1482
- return Le(e, this.options);
1532
+ return Gt(t, this.options);
1483
1533
  } else {
1484
- if (Array.isArray(e) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) {
1485
- e = {
1486
- [this.options.arrayNodeName]: e
1534
+ if (Array.isArray(t) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) {
1535
+ t = {
1536
+ [this.options.arrayNodeName]: t
1487
1537
  };
1488
1538
  }
1489
- return this.j2x(e, 0).val;
1539
+ return this.j2x(t, 0, []).val;
1490
1540
  }
1491
1541
  };
1492
1542
 
1493
- Be.prototype.j2x = function(e, t) {
1543
+ Yt.prototype.j2x = function(t, e, n) {
1494
1544
  let i = "";
1495
- let n = "";
1496
- for (let s in e) {
1497
- if (!Object.prototype.hasOwnProperty.call(e, s)) continue;
1498
- if (typeof e[s] === "undefined") {
1499
- if (this.isAttribute(s)) {
1500
- n += "";
1545
+ let s = "";
1546
+ const r = n.join(".");
1547
+ for (let o in t) {
1548
+ if (!Object.prototype.hasOwnProperty.call(t, o)) continue;
1549
+ if (typeof t[o] === "undefined") {
1550
+ if (this.isAttribute(o)) {
1551
+ s += "";
1501
1552
  }
1502
- } else if (e[s] === null) {
1503
- if (this.isAttribute(s)) {
1504
- n += "";
1505
- } else if (s[0] === "?") {
1506
- n += this.indentate(t) + "<" + s + "?" + this.tagEndChar;
1553
+ } else if (t[o] === null) {
1554
+ if (this.isAttribute(o)) {
1555
+ s += "";
1556
+ } else if (o[0] === "?") {
1557
+ s += this.indentate(e) + "<" + o + "?" + this.tagEndChar;
1507
1558
  } else {
1508
- n += this.indentate(t) + "<" + s + "/" + this.tagEndChar;
1559
+ s += this.indentate(e) + "<" + o + "/" + this.tagEndChar;
1509
1560
  }
1510
- } else if (e[s] instanceof Date) {
1511
- n += this.buildTextValNode(e[s], s, "", t);
1512
- } else if (typeof e[s] !== "object") {
1513
- const r = this.isAttribute(s);
1514
- if (r) {
1515
- i += this.buildAttrPairStr(r, "" + e[s]);
1516
- } else {
1517
- if (s === this.options.textNodeName) {
1518
- let t = this.options.tagValueProcessor(s, "" + e[s]);
1519
- n += this.replaceEntitiesValue(t);
1561
+ } else if (t[o] instanceof Date) {
1562
+ s += this.buildTextValNode(t[o], o, "", e);
1563
+ } else if (typeof t[o] !== "object") {
1564
+ const n = this.isAttribute(o);
1565
+ if (n && !this.ignoreAttributesFn(n, r)) {
1566
+ i += this.buildAttrPairStr(n, "" + t[o]);
1567
+ } else if (!n) {
1568
+ if (o === this.options.textNodeName) {
1569
+ let e = this.options.tagValueProcessor(o, "" + t[o]);
1570
+ s += this.replaceEntitiesValue(e);
1520
1571
  } else {
1521
- n += this.buildTextValNode(e[s], s, "", t);
1572
+ s += this.buildTextValNode(t[o], o, "", e);
1522
1573
  }
1523
1574
  }
1524
- } else if (Array.isArray(e[s])) {
1525
- const i = e[s].length;
1575
+ } else if (Array.isArray(t[o])) {
1576
+ const i = t[o].length;
1526
1577
  let r = "";
1527
- for (let o = 0; o < i; o++) {
1528
- const i = e[s][o];
1578
+ let a = "";
1579
+ for (let l = 0; l < i; l++) {
1580
+ const i = t[o][l];
1529
1581
  if (typeof i === "undefined") {} else if (i === null) {
1530
- if (s[0] === "?") n += this.indentate(t) + "<" + s + "?" + this.tagEndChar; else n += this.indentate(t) + "<" + s + "/" + this.tagEndChar;
1582
+ if (o[0] === "?") s += this.indentate(e) + "<" + o + "?" + this.tagEndChar; else s += this.indentate(e) + "<" + o + "/" + this.tagEndChar;
1531
1583
  } else if (typeof i === "object") {
1532
1584
  if (this.options.oneListGroup) {
1533
- r += this.j2x(i, t + 1).val;
1585
+ const t = this.j2x(i, e + 1, n.concat(o));
1586
+ r += t.val;
1587
+ if (this.options.attributesGroupName && i.hasOwnProperty(this.options.attributesGroupName)) {
1588
+ a += t.attrStr;
1589
+ }
1534
1590
  } else {
1535
- r += this.processTextOrObjNode(i, s, t);
1591
+ r += this.processTextOrObjNode(i, o, e, n);
1536
1592
  }
1537
1593
  } else {
1538
- r += this.buildTextValNode(i, s, "", t);
1594
+ if (this.options.oneListGroup) {
1595
+ let t = this.options.tagValueProcessor(o, i);
1596
+ t = this.replaceEntitiesValue(t);
1597
+ r += t;
1598
+ } else {
1599
+ r += this.buildTextValNode(i, o, "", e);
1600
+ }
1539
1601
  }
1540
1602
  }
1541
1603
  if (this.options.oneListGroup) {
1542
- r = this.buildObjectNode(r, s, "", t);
1604
+ r = this.buildObjectNode(r, o, a, e);
1543
1605
  }
1544
- n += r;
1606
+ s += r;
1545
1607
  } else {
1546
- if (this.options.attributesGroupName && s === this.options.attributesGroupName) {
1547
- const t = Object.keys(e[s]);
1548
- const n = t.length;
1549
- for (let r = 0; r < n; r++) {
1550
- i += this.buildAttrPairStr(t[r], "" + e[s][t[r]]);
1608
+ if (this.options.attributesGroupName && o === this.options.attributesGroupName) {
1609
+ const e = Object.keys(t[o]);
1610
+ const n = e.length;
1611
+ for (let s = 0; s < n; s++) {
1612
+ i += this.buildAttrPairStr(e[s], "" + t[o][e[s]]);
1551
1613
  }
1552
1614
  } else {
1553
- n += this.processTextOrObjNode(e[s], s, t);
1615
+ s += this.processTextOrObjNode(t[o], o, e, n);
1554
1616
  }
1555
1617
  }
1556
1618
  }
1557
1619
  return {
1558
1620
  attrStr: i,
1559
- val: n
1621
+ val: s
1560
1622
  };
1561
1623
  };
1562
1624
 
1563
- Be.prototype.buildAttrPairStr = function(e, t) {
1564
- t = this.options.attributeValueProcessor(e, "" + t);
1565
- t = this.replaceEntitiesValue(t);
1566
- if (this.options.suppressBooleanAttributes && t === "true") {
1567
- return " " + e;
1568
- } else return " " + e + '="' + t + '"';
1625
+ Yt.prototype.buildAttrPairStr = function(t, e) {
1626
+ e = this.options.attributeValueProcessor(t, "" + e);
1627
+ e = this.replaceEntitiesValue(e);
1628
+ if (this.options.suppressBooleanAttributes && e === "true") {
1629
+ return " " + t;
1630
+ } else return " " + t + '="' + e + '"';
1569
1631
  };
1570
1632
 
1571
- function Xe(e, t, i) {
1572
- const n = this.j2x(e, i + 1);
1573
- if (e[this.options.textNodeName] !== undefined && Object.keys(e).length === 1) {
1574
- return this.buildTextValNode(e[this.options.textNodeName], t, n.attrStr, i);
1633
+ function Zt(t, e, n, i) {
1634
+ const s = this.j2x(t, n + 1, i.concat(e));
1635
+ if (t[this.options.textNodeName] !== undefined && Object.keys(t).length === 1) {
1636
+ return this.buildTextValNode(t[this.options.textNodeName], e, s.attrStr, n);
1575
1637
  } else {
1576
- return this.buildObjectNode(n.val, t, n.attrStr, i);
1638
+ return this.buildObjectNode(s.val, e, s.attrStr, n);
1577
1639
  }
1578
1640
  }
1579
1641
 
1580
- Be.prototype.buildObjectNode = function(e, t, i, n) {
1581
- if (e === "") {
1582
- if (t[0] === "?") return this.indentate(n) + "<" + t + i + "?" + this.tagEndChar; else {
1583
- return this.indentate(n) + "<" + t + i + this.closeTag(t) + this.tagEndChar;
1642
+ Yt.prototype.buildObjectNode = function(t, e, n, i) {
1643
+ if (t === "") {
1644
+ if (e[0] === "?") return this.indentate(i) + "<" + e + n + "?" + this.tagEndChar; else {
1645
+ return this.indentate(i) + "<" + e + n + this.closeTag(e) + this.tagEndChar;
1584
1646
  }
1585
1647
  } else {
1586
- let s = "</" + t + this.tagEndChar;
1648
+ let s = "</" + e + this.tagEndChar;
1587
1649
  let r = "";
1588
- if (t[0] === "?") {
1650
+ if (e[0] === "?") {
1589
1651
  r = "?";
1590
1652
  s = "";
1591
1653
  }
1592
- if ((i || i === "") && e.indexOf("<") === -1) {
1593
- return this.indentate(n) + "<" + t + i + r + ">" + e + s;
1594
- } else if (this.options.commentPropName !== false && t === this.options.commentPropName && r.length === 0) {
1595
- return this.indentate(n) + `\x3c!--${e}--\x3e` + this.newLine;
1654
+ if ((n || n === "") && t.indexOf("<") === -1) {
1655
+ return this.indentate(i) + "<" + e + n + r + ">" + t + s;
1656
+ } else if (this.options.commentPropName !== false && e === this.options.commentPropName && r.length === 0) {
1657
+ return this.indentate(i) + `\x3c!--${t}--\x3e` + this.newLine;
1596
1658
  } else {
1597
- return this.indentate(n) + "<" + t + i + r + this.tagEndChar + e + this.indentate(n) + s;
1659
+ return this.indentate(i) + "<" + e + n + r + this.tagEndChar + t + this.indentate(i) + s;
1598
1660
  }
1599
1661
  }
1600
1662
  };
1601
1663
 
1602
- Be.prototype.closeTag = function(e) {
1603
- let t = "";
1604
- if (this.options.unpairedTags.indexOf(e) !== -1) {
1605
- if (!this.options.suppressUnpairedNode) t = "/";
1664
+ Yt.prototype.closeTag = function(t) {
1665
+ let e = "";
1666
+ if (this.options.unpairedTags.indexOf(t) !== -1) {
1667
+ if (!this.options.suppressUnpairedNode) e = "/";
1606
1668
  } else if (this.options.suppressEmptyNode) {
1607
- t = "/";
1669
+ e = "/";
1608
1670
  } else {
1609
- t = `></${e}`;
1671
+ e = `></${t}`;
1610
1672
  }
1611
- return t;
1673
+ return e;
1612
1674
  };
1613
1675
 
1614
- function Re(e, t, i, n) {
1615
- if (e !== "") {
1616
- return this.buildObjectNode(e, t, i, n);
1676
+ function qt(t, e, n, i) {
1677
+ if (t !== "") {
1678
+ return this.buildObjectNode(t, e, n, i);
1617
1679
  } else {
1618
- if (t[0] === "?") return this.indentate(n) + "<" + t + i + "?" + this.tagEndChar; else {
1619
- return this.indentate(n) + "<" + t + i + "/" + this.tagEndChar;
1680
+ if (e[0] === "?") return this.indentate(i) + "<" + e + n + "?" + this.tagEndChar; else {
1681
+ return this.indentate(i) + "<" + e + n + "/" + this.tagEndChar;
1620
1682
  }
1621
1683
  }
1622
1684
  }
1623
1685
 
1624
- Be.prototype.buildTextValNode = function(e, t, i, n) {
1625
- if (this.options.cdataPropName !== false && t === this.options.cdataPropName) {
1626
- return this.indentate(n) + `<![CDATA[${e}]]>` + this.newLine;
1627
- } else if (this.options.commentPropName !== false && t === this.options.commentPropName) {
1628
- return this.indentate(n) + `\x3c!--${e}--\x3e` + this.newLine;
1629
- } else if (t[0] === "?") {
1630
- return this.indentate(n) + "<" + t + i + "?" + this.tagEndChar;
1686
+ Yt.prototype.buildTextValNode = function(t, e, n, i) {
1687
+ if (this.options.cdataPropName !== false && e === this.options.cdataPropName) {
1688
+ return this.indentate(i) + `<![CDATA[${t}]]>` + this.newLine;
1689
+ } else if (this.options.commentPropName !== false && e === this.options.commentPropName) {
1690
+ return this.indentate(i) + `\x3c!--${t}--\x3e` + this.newLine;
1691
+ } else if (e[0] === "?") {
1692
+ return this.indentate(i) + "<" + e + n + "?" + this.tagEndChar;
1631
1693
  } else {
1632
- let s = this.options.tagValueProcessor(t, e);
1694
+ let s = this.options.tagValueProcessor(e, t);
1633
1695
  s = this.replaceEntitiesValue(s);
1634
1696
  if (s === "") {
1635
- return this.indentate(n) + "<" + t + i + this.closeTag(t) + this.tagEndChar;
1697
+ return this.indentate(i) + "<" + e + n + this.closeTag(e) + this.tagEndChar;
1636
1698
  } else {
1637
- return this.indentate(n) + "<" + t + i + ">" + s + "</" + t + this.tagEndChar;
1699
+ return this.indentate(i) + "<" + e + n + ">" + s + "</" + e + this.tagEndChar;
1638
1700
  }
1639
1701
  }
1640
1702
  };
1641
1703
 
1642
- Be.prototype.replaceEntitiesValue = function(e) {
1643
- if (e && e.length > 0 && this.options.processEntities) {
1644
- for (let t = 0; t < this.options.entities.length; t++) {
1645
- const i = this.options.entities[t];
1646
- e = e.replace(i.regex, i.val);
1704
+ Yt.prototype.replaceEntitiesValue = function(t) {
1705
+ if (t && t.length > 0 && this.options.processEntities) {
1706
+ for (let e = 0; e < this.options.entities.length; e++) {
1707
+ const n = this.options.entities[e];
1708
+ t = t.replace(n.regex, n.val);
1647
1709
  }
1648
1710
  }
1649
- return e;
1711
+ return t;
1650
1712
  };
1651
1713
 
1652
- function Ge(e) {
1653
- return this.options.indentBy.repeat(e);
1714
+ function Wt(t) {
1715
+ return this.options.indentBy.repeat(t);
1654
1716
  }
1655
1717
 
1656
- function Ue(e) {
1657
- if (e.startsWith(this.options.attributeNamePrefix) && e !== this.options.textNodeName) {
1658
- return e.substr(this.attrPrefixLen);
1718
+ function zt(t) {
1719
+ if (t.startsWith(this.options.attributeNamePrefix) && t !== this.options.textNodeName) {
1720
+ return t.substr(this.attrPrefixLen);
1659
1721
  } else {
1660
1722
  return false;
1661
1723
  }
1662
1724
  }
1663
1725
 
1664
- var Ye = Be;
1726
+ var Jt = Yt;
1665
1727
 
1666
- const Ze = e(Ye);
1728
+ const Ht = t(Jt);
1667
1729
 
1668
1730
  "use strict";
1669
1731
 
1670
- const qe = t;
1732
+ const Kt = e;
1671
1733
 
1672
- const We = Ae;
1734
+ const Qt = jt;
1673
1735
 
1674
- const ze = Ye;
1736
+ const te = Jt;
1675
1737
 
1676
- var Je = {
1677
- XMLParser: We,
1678
- XMLValidator: qe,
1679
- XMLBuilder: ze
1738
+ var ee = {
1739
+ XMLParser: Qt,
1740
+ XMLValidator: Kt,
1741
+ XMLBuilder: te
1680
1742
  };
1681
1743
 
1682
- const He = e(Je);
1744
+ const ne = t(ee);
1683
1745
 
1684
- function Ke(e) {
1746
+ function ie(t) {
1685
1747
  try {
1686
- Je.XMLValidator.validate(e, {
1748
+ ee.XMLValidator.validate(t, {
1687
1749
  allowBooleanAttributes: true
1688
1750
  });
1689
1751
  return true;
1690
- } catch (e) {
1752
+ } catch (t) {
1691
1753
  return false;
1692
1754
  }
1693
1755
  }
1694
1756
 
1695
- export { Ke as IsXML };
1757
+ export { ie as IsXML };