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