substack-feed-api 1.1.4 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3410 +1,39 @@
1
- function hr(n) {
2
- if (Object.prototype.hasOwnProperty.call(n, "__esModule")) return n;
3
- var a = n.default;
4
- if (typeof a == "function") {
5
- var g = function f() {
6
- return this instanceof f ? Reflect.construct(a, arguments, this.constructor) : a.apply(this, arguments);
7
- };
8
- g.prototype = a.prototype;
9
- } else g = {};
10
- return Object.defineProperty(g, "__esModule", { value: !0 }), Object.keys(n).forEach(function(f) {
11
- var p = Object.getOwnPropertyDescriptor(n, f);
12
- Object.defineProperty(g, f, p.get ? p : {
13
- enumerable: !0,
14
- get: function() {
15
- return n[f];
16
- }
17
- });
18
- }), g;
19
- }
20
- var W = {}, et = {}, fe;
21
- function Wt() {
22
- return fe || (fe = 1, (function() {
23
- et.defaults = {
24
- "0.1": {
25
- explicitCharkey: !1,
26
- trim: !0,
27
- normalize: !0,
28
- normalizeTags: !1,
29
- attrkey: "@",
30
- charkey: "#",
31
- explicitArray: !1,
32
- ignoreAttrs: !1,
33
- mergeAttrs: !1,
34
- explicitRoot: !1,
35
- validator: null,
36
- xmlns: !1,
37
- explicitChildren: !1,
38
- childkey: "@@",
39
- charsAsChildren: !1,
40
- includeWhiteChars: !1,
41
- async: !1,
42
- strict: !0,
43
- attrNameProcessors: null,
44
- attrValueProcessors: null,
45
- tagNameProcessors: null,
46
- valueProcessors: null,
47
- emptyTag: ""
48
- },
49
- "0.2": {
50
- explicitCharkey: !1,
51
- trim: !1,
52
- normalize: !1,
53
- normalizeTags: !1,
54
- attrkey: "$",
55
- charkey: "_",
56
- explicitArray: !0,
57
- ignoreAttrs: !1,
58
- mergeAttrs: !1,
59
- explicitRoot: !0,
60
- validator: null,
61
- xmlns: !1,
62
- explicitChildren: !1,
63
- preserveChildrenOrder: !1,
64
- childkey: "$$",
65
- charsAsChildren: !1,
66
- includeWhiteChars: !1,
67
- async: !1,
68
- strict: !0,
69
- attrNameProcessors: null,
70
- attrValueProcessors: null,
71
- tagNameProcessors: null,
72
- valueProcessors: null,
73
- rootName: "root",
74
- xmldec: {
75
- version: "1.0",
76
- encoding: "UTF-8",
77
- standalone: !0
78
- },
79
- doctype: null,
80
- renderOpts: {
81
- pretty: !0,
82
- indent: " ",
83
- newline: `
84
- `
85
- },
86
- headless: !1,
87
- chunkSize: 1e4,
88
- emptyTag: "",
89
- cdata: !1
90
- }
91
- };
92
- }).call(et)), et;
93
- }
94
- var rt = {}, Y = {}, K = {}, he;
95
- function H() {
96
- return he || (he = 1, (function() {
97
- var n, a, g, f, p, t, e, o = [].slice, l = {}.hasOwnProperty;
98
- n = function() {
99
- var b, m, y, d, w, O;
100
- if (O = arguments[0], w = 2 <= arguments.length ? o.call(arguments, 1) : [], p(Object.assign))
101
- Object.assign.apply(null, arguments);
102
- else
103
- for (b = 0, y = w.length; b < y; b++)
104
- if (d = w[b], d != null)
105
- for (m in d)
106
- l.call(d, m) && (O[m] = d[m]);
107
- return O;
108
- }, p = function(b) {
109
- return !!b && Object.prototype.toString.call(b) === "[object Function]";
110
- }, t = function(b) {
111
- var m;
112
- return !!b && ((m = typeof b) == "function" || m === "object");
113
- }, g = function(b) {
114
- return p(Array.isArray) ? Array.isArray(b) : Object.prototype.toString.call(b) === "[object Array]";
115
- }, f = function(b) {
116
- var m;
117
- if (g(b))
118
- return !b.length;
119
- for (m in b)
120
- if (l.call(b, m))
121
- return !1;
122
- return !0;
123
- }, e = function(b) {
124
- var m, y;
125
- return t(b) && (y = Object.getPrototypeOf(b)) && (m = y.constructor) && typeof m == "function" && m instanceof m && Function.prototype.toString.call(m) === Function.prototype.toString.call(Object);
126
- }, a = function(b) {
127
- return p(b.valueOf) ? b.valueOf() : b;
128
- }, K.assign = n, K.isFunction = p, K.isObject = t, K.isArray = g, K.isEmpty = f, K.isPlainObject = e, K.getValue = a;
129
- }).call(K)), K;
130
- }
131
- var st = { exports: {} }, pr = st.exports, pe;
132
- function Je() {
133
- return pe || (pe = 1, (function() {
134
- st.exports = function() {
135
- function n() {
136
- }
137
- return n.prototype.hasFeature = function(a, g) {
138
- return !0;
139
- }, n.prototype.createDocumentType = function(a, g, f) {
140
- throw new Error("This DOM method is not implemented.");
141
- }, n.prototype.createDocument = function(a, g, f) {
142
- throw new Error("This DOM method is not implemented.");
143
- }, n.prototype.createHTMLDocument = function(a) {
144
- throw new Error("This DOM method is not implemented.");
145
- }, n.prototype.getFeature = function(a, g) {
146
- throw new Error("This DOM method is not implemented.");
147
- }, n;
148
- }();
149
- }).call(pr)), st.exports;
150
- }
151
- var ut = { exports: {} }, at = { exports: {} }, ct = { exports: {} }, dr = ct.exports, de;
152
- function yr() {
153
- return de || (de = 1, (function() {
154
- ct.exports = function() {
155
- function n() {
156
- }
157
- return n.prototype.handleError = function(a) {
158
- throw new Error(a);
159
- }, n;
160
- }();
161
- }).call(dr)), ct.exports;
162
- }
163
- var lt = { exports: {} }, mr = lt.exports, ye;
164
- function gr() {
165
- return ye || (ye = 1, (function() {
166
- lt.exports = function() {
167
- function n(a) {
168
- this.arr = a || [];
169
- }
170
- return Object.defineProperty(n.prototype, "length", {
171
- get: function() {
172
- return this.arr.length;
173
- }
174
- }), n.prototype.item = function(a) {
175
- return this.arr[a] || null;
176
- }, n.prototype.contains = function(a) {
177
- return this.arr.indexOf(a) !== -1;
178
- }, n;
179
- }();
180
- }).call(mr)), lt.exports;
181
- }
182
- var wr = at.exports, me;
183
- function Tr() {
184
- return me || (me = 1, (function() {
185
- var n, a;
186
- n = yr(), a = gr(), at.exports = function() {
187
- function g() {
188
- this.defaultParams = {
189
- "canonical-form": !1,
190
- "cdata-sections": !1,
191
- comments: !1,
192
- "datatype-normalization": !1,
193
- "element-content-whitespace": !0,
194
- entities: !0,
195
- "error-handler": new n(),
196
- infoset: !0,
197
- "validate-if-schema": !1,
198
- namespaces: !0,
199
- "namespace-declarations": !0,
200
- "normalize-characters": !1,
201
- "schema-location": "",
202
- "schema-type": "",
203
- "split-cdata-sections": !0,
204
- validate: !1,
205
- "well-formed": !0
206
- }, this.params = Object.create(this.defaultParams);
207
- }
208
- return Object.defineProperty(g.prototype, "parameterNames", {
209
- get: function() {
210
- return new a(Object.keys(this.defaultParams));
211
- }
212
- }), g.prototype.getParameter = function(f) {
213
- return this.params.hasOwnProperty(f) ? this.params[f] : null;
214
- }, g.prototype.canSetParameter = function(f, p) {
215
- return !0;
216
- }, g.prototype.setParameter = function(f, p) {
217
- return p != null ? this.params[f] = p : delete this.params[f];
218
- }, g;
219
- }();
220
- }).call(wr)), at.exports;
221
- }
222
- var ft = { exports: {} }, ht = { exports: {} }, pt = { exports: {} }, Dr = pt.exports, ge;
223
- function B() {
224
- return ge || (ge = 1, (function() {
225
- pt.exports = {
226
- Element: 1,
227
- Attribute: 2,
228
- Text: 3,
229
- CData: 4,
230
- EntityReference: 5,
231
- EntityDeclaration: 6,
232
- ProcessingInstruction: 7,
233
- Comment: 8,
234
- Document: 9,
235
- DocType: 10,
236
- DocumentFragment: 11,
237
- NotationDeclaration: 12,
238
- Declaration: 201,
239
- Raw: 202,
240
- AttributeDeclaration: 203,
241
- ElementDeclaration: 204,
242
- Dummy: 205
243
- };
244
- }).call(Dr)), pt.exports;
245
- }
246
- var dt = { exports: {} }, Er = dt.exports, we;
247
- function tr() {
248
- return we || (we = 1, (function() {
249
- var n;
250
- n = B(), G(), dt.exports = function() {
251
- function a(g, f, p) {
252
- if (this.parent = g, this.parent && (this.options = this.parent.options, this.stringify = this.parent.stringify), f == null)
253
- throw new Error("Missing attribute name. " + this.debugInfo(f));
254
- this.name = this.stringify.name(f), this.value = this.stringify.attValue(p), this.type = n.Attribute, this.isId = !1, this.schemaTypeInfo = null;
255
- }
256
- return Object.defineProperty(a.prototype, "nodeType", {
257
- get: function() {
258
- return this.type;
259
- }
260
- }), Object.defineProperty(a.prototype, "ownerElement", {
261
- get: function() {
262
- return this.parent;
263
- }
264
- }), Object.defineProperty(a.prototype, "textContent", {
265
- get: function() {
266
- return this.value;
267
- },
268
- set: function(g) {
269
- return this.value = g || "";
270
- }
271
- }), Object.defineProperty(a.prototype, "namespaceURI", {
272
- get: function() {
273
- return "";
274
- }
275
- }), Object.defineProperty(a.prototype, "prefix", {
276
- get: function() {
277
- return "";
278
- }
279
- }), Object.defineProperty(a.prototype, "localName", {
280
- get: function() {
281
- return this.name;
282
- }
283
- }), Object.defineProperty(a.prototype, "specified", {
284
- get: function() {
285
- return !0;
286
- }
287
- }), a.prototype.clone = function() {
288
- return Object.create(this);
289
- }, a.prototype.toString = function(g) {
290
- return this.options.writer.attribute(this, this.options.writer.filterOptions(g));
291
- }, a.prototype.debugInfo = function(g) {
292
- return g = g || this.name, g == null ? "parent: <" + this.parent.name + ">" : "attribute: {" + g + "}, parent: <" + this.parent.name + ">";
293
- }, a.prototype.isEqualNode = function(g) {
294
- return !(g.namespaceURI !== this.namespaceURI || g.prefix !== this.prefix || g.localName !== this.localName || g.value !== this.value);
295
- }, a;
296
- }();
297
- }).call(Er)), dt.exports;
298
- }
299
- var yt = { exports: {} }, br = yt.exports, Te;
300
- function Yt() {
301
- return Te || (Te = 1, (function() {
302
- yt.exports = function() {
303
- function n(a) {
304
- this.nodes = a;
305
- }
306
- return Object.defineProperty(n.prototype, "length", {
307
- get: function() {
308
- return Object.keys(this.nodes).length || 0;
309
- }
310
- }), n.prototype.clone = function() {
311
- return this.nodes = null;
312
- }, n.prototype.getNamedItem = function(a) {
313
- return this.nodes[a];
314
- }, n.prototype.setNamedItem = function(a) {
315
- var g;
316
- return g = this.nodes[a.nodeName], this.nodes[a.nodeName] = a, g || null;
317
- }, n.prototype.removeNamedItem = function(a) {
318
- var g;
319
- return g = this.nodes[a], delete this.nodes[a], g || null;
320
- }, n.prototype.item = function(a) {
321
- return this.nodes[Object.keys(this.nodes)[a]] || null;
322
- }, n.prototype.getNamedItemNS = function(a, g) {
323
- throw new Error("This DOM method is not implemented.");
324
- }, n.prototype.setNamedItemNS = function(a) {
325
- throw new Error("This DOM method is not implemented.");
326
- }, n.prototype.removeNamedItemNS = function(a, g) {
327
- throw new Error("This DOM method is not implemented.");
328
- }, n;
329
- }();
330
- }).call(br)), yt.exports;
331
- }
332
- var Or = ht.exports, De;
333
- function Kt() {
334
- return De || (De = 1, (function() {
335
- var n, a, g, f, p, t, e, o, l = function(m, y) {
336
- for (var d in y)
337
- b.call(y, d) && (m[d] = y[d]);
338
- function w() {
339
- this.constructor = m;
340
- }
341
- return w.prototype = y.prototype, m.prototype = new w(), m.__super__ = y.prototype, m;
342
- }, b = {}.hasOwnProperty;
343
- o = H(), e = o.isObject, t = o.isFunction, p = o.getValue, f = G(), n = B(), a = tr(), g = Yt(), ht.exports = function(m) {
344
- l(y, m);
345
- function y(d, w, O) {
346
- var I, x, _, E;
347
- if (y.__super__.constructor.call(this, d), w == null)
348
- throw new Error("Missing element name. " + this.debugInfo());
349
- if (this.name = this.stringify.name(w), this.type = n.Element, this.attribs = {}, this.schemaTypeInfo = null, O != null && this.attribute(O), d.type === n.Document && (this.isRoot = !0, this.documentObject = d, d.rootObject = this, d.children)) {
350
- for (E = d.children, x = 0, _ = E.length; x < _; x++)
351
- if (I = E[x], I.type === n.DocType) {
352
- I.name = this.name;
353
- break;
354
- }
355
- }
356
- }
357
- return Object.defineProperty(y.prototype, "tagName", {
358
- get: function() {
359
- return this.name;
360
- }
361
- }), Object.defineProperty(y.prototype, "namespaceURI", {
362
- get: function() {
363
- return "";
364
- }
365
- }), Object.defineProperty(y.prototype, "prefix", {
366
- get: function() {
367
- return "";
368
- }
369
- }), Object.defineProperty(y.prototype, "localName", {
370
- get: function() {
371
- return this.name;
372
- }
373
- }), Object.defineProperty(y.prototype, "id", {
374
- get: function() {
375
- throw new Error("This DOM method is not implemented." + this.debugInfo());
376
- }
377
- }), Object.defineProperty(y.prototype, "className", {
378
- get: function() {
379
- throw new Error("This DOM method is not implemented." + this.debugInfo());
380
- }
381
- }), Object.defineProperty(y.prototype, "classList", {
382
- get: function() {
383
- throw new Error("This DOM method is not implemented." + this.debugInfo());
384
- }
385
- }), Object.defineProperty(y.prototype, "attributes", {
386
- get: function() {
387
- return (!this.attributeMap || !this.attributeMap.nodes) && (this.attributeMap = new g(this.attribs)), this.attributeMap;
388
- }
389
- }), y.prototype.clone = function() {
390
- var d, w, O, I;
391
- O = Object.create(this), O.isRoot && (O.documentObject = null), O.attribs = {}, I = this.attribs;
392
- for (w in I)
393
- b.call(I, w) && (d = I[w], O.attribs[w] = d.clone());
394
- return O.children = [], this.children.forEach(function(x) {
395
- var _;
396
- return _ = x.clone(), _.parent = O, O.children.push(_);
397
- }), O;
398
- }, y.prototype.attribute = function(d, w) {
399
- var O, I;
400
- if (d != null && (d = p(d)), e(d))
401
- for (O in d)
402
- b.call(d, O) && (I = d[O], this.attribute(O, I));
403
- else
404
- t(w) && (w = w.apply()), this.options.keepNullAttributes && w == null ? this.attribs[d] = new a(this, d, "") : w != null && (this.attribs[d] = new a(this, d, w));
405
- return this;
406
- }, y.prototype.removeAttribute = function(d) {
407
- var w, O, I;
408
- if (d == null)
409
- throw new Error("Missing attribute name. " + this.debugInfo());
410
- if (d = p(d), Array.isArray(d))
411
- for (O = 0, I = d.length; O < I; O++)
412
- w = d[O], delete this.attribs[w];
413
- else
414
- delete this.attribs[d];
415
- return this;
416
- }, y.prototype.toString = function(d) {
417
- return this.options.writer.element(this, this.options.writer.filterOptions(d));
418
- }, y.prototype.att = function(d, w) {
419
- return this.attribute(d, w);
420
- }, y.prototype.a = function(d, w) {
421
- return this.attribute(d, w);
422
- }, y.prototype.getAttribute = function(d) {
423
- return this.attribs.hasOwnProperty(d) ? this.attribs[d].value : null;
424
- }, y.prototype.setAttribute = function(d, w) {
425
- throw new Error("This DOM method is not implemented." + this.debugInfo());
426
- }, y.prototype.getAttributeNode = function(d) {
427
- return this.attribs.hasOwnProperty(d) ? this.attribs[d] : null;
428
- }, y.prototype.setAttributeNode = function(d) {
429
- throw new Error("This DOM method is not implemented." + this.debugInfo());
430
- }, y.prototype.removeAttributeNode = function(d) {
431
- throw new Error("This DOM method is not implemented." + this.debugInfo());
432
- }, y.prototype.getElementsByTagName = function(d) {
433
- throw new Error("This DOM method is not implemented." + this.debugInfo());
434
- }, y.prototype.getAttributeNS = function(d, w) {
435
- throw new Error("This DOM method is not implemented." + this.debugInfo());
436
- }, y.prototype.setAttributeNS = function(d, w, O) {
437
- throw new Error("This DOM method is not implemented." + this.debugInfo());
438
- }, y.prototype.removeAttributeNS = function(d, w) {
439
- throw new Error("This DOM method is not implemented." + this.debugInfo());
440
- }, y.prototype.getAttributeNodeNS = function(d, w) {
441
- throw new Error("This DOM method is not implemented." + this.debugInfo());
442
- }, y.prototype.setAttributeNodeNS = function(d) {
443
- throw new Error("This DOM method is not implemented." + this.debugInfo());
444
- }, y.prototype.getElementsByTagNameNS = function(d, w) {
445
- throw new Error("This DOM method is not implemented." + this.debugInfo());
446
- }, y.prototype.hasAttribute = function(d) {
447
- return this.attribs.hasOwnProperty(d);
448
- }, y.prototype.hasAttributeNS = function(d, w) {
449
- throw new Error("This DOM method is not implemented." + this.debugInfo());
450
- }, y.prototype.setIdAttribute = function(d, w) {
451
- return this.attribs.hasOwnProperty(d) ? this.attribs[d].isId : w;
452
- }, y.prototype.setIdAttributeNS = function(d, w, O) {
453
- throw new Error("This DOM method is not implemented." + this.debugInfo());
454
- }, y.prototype.setIdAttributeNode = function(d, w) {
455
- throw new Error("This DOM method is not implemented." + this.debugInfo());
456
- }, y.prototype.getElementsByTagName = function(d) {
457
- throw new Error("This DOM method is not implemented." + this.debugInfo());
458
- }, y.prototype.getElementsByTagNameNS = function(d, w) {
459
- throw new Error("This DOM method is not implemented." + this.debugInfo());
460
- }, y.prototype.getElementsByClassName = function(d) {
461
- throw new Error("This DOM method is not implemented." + this.debugInfo());
462
- }, y.prototype.isEqualNode = function(d) {
463
- var w, O, I;
464
- if (!y.__super__.isEqualNode.apply(this, arguments).isEqualNode(d) || d.namespaceURI !== this.namespaceURI || d.prefix !== this.prefix || d.localName !== this.localName || d.attribs.length !== this.attribs.length)
465
- return !1;
466
- for (w = O = 0, I = this.attribs.length - 1; 0 <= I ? O <= I : O >= I; w = 0 <= I ? ++O : --O)
467
- if (!this.attribs[w].isEqualNode(d.attribs[w]))
468
- return !1;
469
- return !0;
470
- }, y;
471
- }(f);
472
- }).call(Or)), ht.exports;
473
- }
474
- var mt = { exports: {} }, gt = { exports: {} }, Nr = gt.exports, Ee;
475
- function jt() {
476
- return Ee || (Ee = 1, (function() {
477
- var n, a = function(f, p) {
478
- for (var t in p)
479
- g.call(p, t) && (f[t] = p[t]);
480
- function e() {
481
- this.constructor = f;
482
- }
483
- return e.prototype = p.prototype, f.prototype = new e(), f.__super__ = p.prototype, f;
484
- }, g = {}.hasOwnProperty;
485
- n = G(), gt.exports = function(f) {
486
- a(p, f);
487
- function p(t) {
488
- p.__super__.constructor.call(this, t), this.value = "";
489
- }
490
- return Object.defineProperty(p.prototype, "data", {
491
- get: function() {
492
- return this.value;
493
- },
494
- set: function(t) {
495
- return this.value = t || "";
496
- }
497
- }), Object.defineProperty(p.prototype, "length", {
498
- get: function() {
499
- return this.value.length;
500
- }
501
- }), Object.defineProperty(p.prototype, "textContent", {
502
- get: function() {
503
- return this.value;
504
- },
505
- set: function(t) {
506
- return this.value = t || "";
507
- }
508
- }), p.prototype.clone = function() {
509
- return Object.create(this);
510
- }, p.prototype.substringData = function(t, e) {
511
- throw new Error("This DOM method is not implemented." + this.debugInfo());
512
- }, p.prototype.appendData = function(t) {
513
- throw new Error("This DOM method is not implemented." + this.debugInfo());
514
- }, p.prototype.insertData = function(t, e) {
515
- throw new Error("This DOM method is not implemented." + this.debugInfo());
516
- }, p.prototype.deleteData = function(t, e) {
517
- throw new Error("This DOM method is not implemented." + this.debugInfo());
518
- }, p.prototype.replaceData = function(t, e, o) {
519
- throw new Error("This DOM method is not implemented." + this.debugInfo());
520
- }, p.prototype.isEqualNode = function(t) {
521
- return !(!p.__super__.isEqualNode.apply(this, arguments).isEqualNode(t) || t.data !== this.data);
522
- }, p;
523
- }(n);
524
- }).call(Nr)), gt.exports;
525
- }
526
- var vr = mt.exports, be;
527
- function zt() {
528
- return be || (be = 1, (function() {
529
- var n, a, g = function(p, t) {
530
- for (var e in t)
531
- f.call(t, e) && (p[e] = t[e]);
532
- function o() {
533
- this.constructor = p;
534
- }
535
- return o.prototype = t.prototype, p.prototype = new o(), p.__super__ = t.prototype, p;
536
- }, f = {}.hasOwnProperty;
537
- n = B(), a = jt(), mt.exports = function(p) {
538
- g(t, p);
539
- function t(e, o) {
540
- if (t.__super__.constructor.call(this, e), o == null)
541
- throw new Error("Missing CDATA text. " + this.debugInfo());
542
- this.name = "#cdata-section", this.type = n.CData, this.value = this.stringify.cdata(o);
543
- }
544
- return t.prototype.clone = function() {
545
- return Object.create(this);
546
- }, t.prototype.toString = function(e) {
547
- return this.options.writer.cdata(this, this.options.writer.filterOptions(e));
548
- }, t;
549
- }(a);
550
- }).call(vr)), mt.exports;
551
- }
552
- var wt = { exports: {} }, Lr = wt.exports, Oe;
553
- function Ht() {
554
- return Oe || (Oe = 1, (function() {
555
- var n, a, g = function(p, t) {
556
- for (var e in t)
557
- f.call(t, e) && (p[e] = t[e]);
558
- function o() {
559
- this.constructor = p;
560
- }
561
- return o.prototype = t.prototype, p.prototype = new o(), p.__super__ = t.prototype, p;
562
- }, f = {}.hasOwnProperty;
563
- n = B(), a = jt(), wt.exports = function(p) {
564
- g(t, p);
565
- function t(e, o) {
566
- if (t.__super__.constructor.call(this, e), o == null)
567
- throw new Error("Missing comment text. " + this.debugInfo());
568
- this.name = "#comment", this.type = n.Comment, this.value = this.stringify.comment(o);
569
- }
570
- return t.prototype.clone = function() {
571
- return Object.create(this);
572
- }, t.prototype.toString = function(e) {
573
- return this.options.writer.comment(this, this.options.writer.filterOptions(e));
574
- }, t;
575
- }(a);
576
- }).call(Lr)), wt.exports;
577
- }
578
- var Tt = { exports: {} }, Ir = Tt.exports, Ne;
579
- function Qt() {
580
- return Ne || (Ne = 1, (function() {
581
- var n, a, g, f = function(t, e) {
582
- for (var o in e)
583
- p.call(e, o) && (t[o] = e[o]);
584
- function l() {
585
- this.constructor = t;
586
- }
587
- return l.prototype = e.prototype, t.prototype = new l(), t.__super__ = e.prototype, t;
588
- }, p = {}.hasOwnProperty;
589
- g = H().isObject, a = G(), n = B(), Tt.exports = function(t) {
590
- f(e, t);
591
- function e(o, l, b, m) {
592
- var y;
593
- e.__super__.constructor.call(this, o), g(l) && (y = l, l = y.version, b = y.encoding, m = y.standalone), l || (l = "1.0"), this.type = n.Declaration, this.version = this.stringify.xmlVersion(l), b != null && (this.encoding = this.stringify.xmlEncoding(b)), m != null && (this.standalone = this.stringify.xmlStandalone(m));
594
- }
595
- return e.prototype.toString = function(o) {
596
- return this.options.writer.declaration(this, this.options.writer.filterOptions(o));
597
- }, e;
598
- }(a);
599
- }).call(Ir)), Tt.exports;
600
- }
601
- var Dt = { exports: {} }, Et = { exports: {} }, xr = Et.exports, ve;
602
- function Zt() {
603
- return ve || (ve = 1, (function() {
604
- var n, a, g = function(p, t) {
605
- for (var e in t)
606
- f.call(t, e) && (p[e] = t[e]);
607
- function o() {
608
- this.constructor = p;
609
- }
610
- return o.prototype = t.prototype, p.prototype = new o(), p.__super__ = t.prototype, p;
611
- }, f = {}.hasOwnProperty;
612
- a = G(), n = B(), Et.exports = function(p) {
613
- g(t, p);
614
- function t(e, o, l, b, m, y) {
615
- if (t.__super__.constructor.call(this, e), o == null)
616
- throw new Error("Missing DTD element name. " + this.debugInfo());
617
- if (l == null)
618
- throw new Error("Missing DTD attribute name. " + this.debugInfo(o));
619
- if (!b)
620
- throw new Error("Missing DTD attribute type. " + this.debugInfo(o));
621
- if (!m)
622
- throw new Error("Missing DTD attribute default. " + this.debugInfo(o));
623
- if (m.indexOf("#") !== 0 && (m = "#" + m), !m.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))
624
- throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. " + this.debugInfo(o));
625
- if (y && !m.match(/^(#FIXED|#DEFAULT)$/))
626
- throw new Error("Default value only applies to #FIXED or #DEFAULT. " + this.debugInfo(o));
627
- this.elementName = this.stringify.name(o), this.type = n.AttributeDeclaration, this.attributeName = this.stringify.name(l), this.attributeType = this.stringify.dtdAttType(b), y && (this.defaultValue = this.stringify.dtdAttDefault(y)), this.defaultValueType = m;
628
- }
629
- return t.prototype.toString = function(e) {
630
- return this.options.writer.dtdAttList(this, this.options.writer.filterOptions(e));
631
- }, t;
632
- }(a);
633
- }).call(xr)), Et.exports;
634
- }
635
- var bt = { exports: {} }, Pr = bt.exports, Le;
636
- function Jt() {
637
- return Le || (Le = 1, (function() {
638
- var n, a, g, f = function(t, e) {
639
- for (var o in e)
640
- p.call(e, o) && (t[o] = e[o]);
641
- function l() {
642
- this.constructor = t;
643
- }
644
- return l.prototype = e.prototype, t.prototype = new l(), t.__super__ = e.prototype, t;
645
- }, p = {}.hasOwnProperty;
646
- g = H().isObject, a = G(), n = B(), bt.exports = function(t) {
647
- f(e, t);
648
- function e(o, l, b, m) {
649
- if (e.__super__.constructor.call(this, o), b == null)
650
- throw new Error("Missing DTD entity name. " + this.debugInfo(b));
651
- if (m == null)
652
- throw new Error("Missing DTD entity value. " + this.debugInfo(b));
653
- if (this.pe = !!l, this.name = this.stringify.name(b), this.type = n.EntityDeclaration, !g(m))
654
- this.value = this.stringify.dtdEntityValue(m), this.internal = !0;
655
- else {
656
- if (!m.pubID && !m.sysID)
657
- throw new Error("Public and/or system identifiers are required for an external entity. " + this.debugInfo(b));
658
- if (m.pubID && !m.sysID)
659
- throw new Error("System identifier is required for a public external entity. " + this.debugInfo(b));
660
- if (this.internal = !1, m.pubID != null && (this.pubID = this.stringify.dtdPubID(m.pubID)), m.sysID != null && (this.sysID = this.stringify.dtdSysID(m.sysID)), m.nData != null && (this.nData = this.stringify.dtdNData(m.nData)), this.pe && this.nData)
661
- throw new Error("Notation declaration is not allowed in a parameter entity. " + this.debugInfo(b));
662
- }
663
- }
664
- return Object.defineProperty(e.prototype, "publicId", {
665
- get: function() {
666
- return this.pubID;
667
- }
668
- }), Object.defineProperty(e.prototype, "systemId", {
669
- get: function() {
670
- return this.sysID;
671
- }
672
- }), Object.defineProperty(e.prototype, "notationName", {
673
- get: function() {
674
- return this.nData || null;
675
- }
676
- }), Object.defineProperty(e.prototype, "inputEncoding", {
677
- get: function() {
678
- return null;
679
- }
680
- }), Object.defineProperty(e.prototype, "xmlEncoding", {
681
- get: function() {
682
- return null;
683
- }
684
- }), Object.defineProperty(e.prototype, "xmlVersion", {
685
- get: function() {
686
- return null;
687
- }
688
- }), e.prototype.toString = function(o) {
689
- return this.options.writer.dtdEntity(this, this.options.writer.filterOptions(o));
690
- }, e;
691
- }(a);
692
- }).call(Pr)), bt.exports;
693
- }
694
- var Ot = { exports: {} }, Ar = Ot.exports, Ie;
695
- function te() {
696
- return Ie || (Ie = 1, (function() {
697
- var n, a, g = function(p, t) {
698
- for (var e in t)
699
- f.call(t, e) && (p[e] = t[e]);
700
- function o() {
701
- this.constructor = p;
702
- }
703
- return o.prototype = t.prototype, p.prototype = new o(), p.__super__ = t.prototype, p;
704
- }, f = {}.hasOwnProperty;
705
- a = G(), n = B(), Ot.exports = function(p) {
706
- g(t, p);
707
- function t(e, o, l) {
708
- if (t.__super__.constructor.call(this, e), o == null)
709
- throw new Error("Missing DTD element name. " + this.debugInfo());
710
- l || (l = "(#PCDATA)"), Array.isArray(l) && (l = "(" + l.join(",") + ")"), this.name = this.stringify.name(o), this.type = n.ElementDeclaration, this.value = this.stringify.dtdElementValue(l);
711
- }
712
- return t.prototype.toString = function(e) {
713
- return this.options.writer.dtdElement(this, this.options.writer.filterOptions(e));
714
- }, t;
715
- }(a);
716
- }).call(Ar)), Ot.exports;
717
- }
718
- var Nt = { exports: {} }, _r = Nt.exports, xe;
719
- function ee() {
720
- return xe || (xe = 1, (function() {
721
- var n, a, g = function(p, t) {
722
- for (var e in t)
723
- f.call(t, e) && (p[e] = t[e]);
724
- function o() {
725
- this.constructor = p;
726
- }
727
- return o.prototype = t.prototype, p.prototype = new o(), p.__super__ = t.prototype, p;
728
- }, f = {}.hasOwnProperty;
729
- a = G(), n = B(), Nt.exports = function(p) {
730
- g(t, p);
731
- function t(e, o, l) {
732
- if (t.__super__.constructor.call(this, e), o == null)
733
- throw new Error("Missing DTD notation name. " + this.debugInfo(o));
734
- if (!l.pubID && !l.sysID)
735
- throw new Error("Public or system identifiers are required for an external entity. " + this.debugInfo(o));
736
- this.name = this.stringify.name(o), this.type = n.NotationDeclaration, l.pubID != null && (this.pubID = this.stringify.dtdPubID(l.pubID)), l.sysID != null && (this.sysID = this.stringify.dtdSysID(l.sysID));
737
- }
738
- return Object.defineProperty(t.prototype, "publicId", {
739
- get: function() {
740
- return this.pubID;
741
- }
742
- }), Object.defineProperty(t.prototype, "systemId", {
743
- get: function() {
744
- return this.sysID;
745
- }
746
- }), t.prototype.toString = function(e) {
747
- return this.options.writer.dtdNotation(this, this.options.writer.filterOptions(e));
748
- }, t;
749
- }(a);
750
- }).call(_r)), Nt.exports;
751
- }
752
- var Mr = Dt.exports, Pe;
753
- function re() {
754
- return Pe || (Pe = 1, (function() {
755
- var n, a, g, f, p, t, e, o, l = function(m, y) {
756
- for (var d in y)
757
- b.call(y, d) && (m[d] = y[d]);
758
- function w() {
759
- this.constructor = m;
760
- }
761
- return w.prototype = y.prototype, m.prototype = new w(), m.__super__ = y.prototype, m;
762
- }, b = {}.hasOwnProperty;
763
- o = H().isObject, e = G(), n = B(), a = Zt(), f = Jt(), g = te(), p = ee(), t = Yt(), Dt.exports = function(m) {
764
- l(y, m);
765
- function y(d, w, O) {
766
- var I, x, _, E, s, c;
767
- if (y.__super__.constructor.call(this, d), this.type = n.DocType, d.children) {
768
- for (E = d.children, x = 0, _ = E.length; x < _; x++)
769
- if (I = E[x], I.type === n.Element) {
770
- this.name = I.name;
771
- break;
772
- }
773
- }
774
- this.documentObject = d, o(w) && (s = w, w = s.pubID, O = s.sysID), O == null && (c = [w, O], O = c[0], w = c[1]), w != null && (this.pubID = this.stringify.dtdPubID(w)), O != null && (this.sysID = this.stringify.dtdSysID(O));
775
- }
776
- return Object.defineProperty(y.prototype, "entities", {
777
- get: function() {
778
- var d, w, O, I, x;
779
- for (I = {}, x = this.children, w = 0, O = x.length; w < O; w++)
780
- d = x[w], d.type === n.EntityDeclaration && !d.pe && (I[d.name] = d);
781
- return new t(I);
782
- }
783
- }), Object.defineProperty(y.prototype, "notations", {
784
- get: function() {
785
- var d, w, O, I, x;
786
- for (I = {}, x = this.children, w = 0, O = x.length; w < O; w++)
787
- d = x[w], d.type === n.NotationDeclaration && (I[d.name] = d);
788
- return new t(I);
789
- }
790
- }), Object.defineProperty(y.prototype, "publicId", {
791
- get: function() {
792
- return this.pubID;
793
- }
794
- }), Object.defineProperty(y.prototype, "systemId", {
795
- get: function() {
796
- return this.sysID;
797
- }
798
- }), Object.defineProperty(y.prototype, "internalSubset", {
799
- get: function() {
800
- throw new Error("This DOM method is not implemented." + this.debugInfo());
801
- }
802
- }), y.prototype.element = function(d, w) {
803
- var O;
804
- return O = new g(this, d, w), this.children.push(O), this;
805
- }, y.prototype.attList = function(d, w, O, I, x) {
806
- var _;
807
- return _ = new a(this, d, w, O, I, x), this.children.push(_), this;
808
- }, y.prototype.entity = function(d, w) {
809
- var O;
810
- return O = new f(this, !1, d, w), this.children.push(O), this;
811
- }, y.prototype.pEntity = function(d, w) {
812
- var O;
813
- return O = new f(this, !0, d, w), this.children.push(O), this;
814
- }, y.prototype.notation = function(d, w) {
815
- var O;
816
- return O = new p(this, d, w), this.children.push(O), this;
817
- }, y.prototype.toString = function(d) {
818
- return this.options.writer.docType(this, this.options.writer.filterOptions(d));
819
- }, y.prototype.ele = function(d, w) {
820
- return this.element(d, w);
821
- }, y.prototype.att = function(d, w, O, I, x) {
822
- return this.attList(d, w, O, I, x);
823
- }, y.prototype.ent = function(d, w) {
824
- return this.entity(d, w);
825
- }, y.prototype.pent = function(d, w) {
826
- return this.pEntity(d, w);
827
- }, y.prototype.not = function(d, w) {
828
- return this.notation(d, w);
829
- }, y.prototype.up = function() {
830
- return this.root() || this.documentObject;
831
- }, y.prototype.isEqualNode = function(d) {
832
- return !(!y.__super__.isEqualNode.apply(this, arguments).isEqualNode(d) || d.name !== this.name || d.publicId !== this.publicId || d.systemId !== this.systemId);
833
- }, y;
834
- }(e);
835
- }).call(Mr)), Dt.exports;
836
- }
837
- var vt = { exports: {} }, Cr = vt.exports, Ae;
838
- function ne() {
839
- return Ae || (Ae = 1, (function() {
840
- var n, a, g = function(p, t) {
841
- for (var e in t)
842
- f.call(t, e) && (p[e] = t[e]);
843
- function o() {
844
- this.constructor = p;
845
- }
846
- return o.prototype = t.prototype, p.prototype = new o(), p.__super__ = t.prototype, p;
847
- }, f = {}.hasOwnProperty;
848
- n = B(), a = G(), vt.exports = function(p) {
849
- g(t, p);
850
- function t(e, o) {
851
- if (t.__super__.constructor.call(this, e), o == null)
852
- throw new Error("Missing raw text. " + this.debugInfo());
853
- this.type = n.Raw, this.value = this.stringify.raw(o);
854
- }
855
- return t.prototype.clone = function() {
856
- return Object.create(this);
857
- }, t.prototype.toString = function(e) {
858
- return this.options.writer.raw(this, this.options.writer.filterOptions(e));
859
- }, t;
860
- }(a);
861
- }).call(Cr)), vt.exports;
862
- }
863
- var Lt = { exports: {} }, Sr = Lt.exports, _e;
864
- function ie() {
865
- return _e || (_e = 1, (function() {
866
- var n, a, g = function(p, t) {
867
- for (var e in t)
868
- f.call(t, e) && (p[e] = t[e]);
869
- function o() {
870
- this.constructor = p;
871
- }
872
- return o.prototype = t.prototype, p.prototype = new o(), p.__super__ = t.prototype, p;
873
- }, f = {}.hasOwnProperty;
874
- n = B(), a = jt(), Lt.exports = function(p) {
875
- g(t, p);
876
- function t(e, o) {
877
- if (t.__super__.constructor.call(this, e), o == null)
878
- throw new Error("Missing element text. " + this.debugInfo());
879
- this.name = "#text", this.type = n.Text, this.value = this.stringify.text(o);
880
- }
881
- return Object.defineProperty(t.prototype, "isElementContentWhitespace", {
882
- get: function() {
883
- throw new Error("This DOM method is not implemented." + this.debugInfo());
884
- }
885
- }), Object.defineProperty(t.prototype, "wholeText", {
886
- get: function() {
887
- var e, o, l;
888
- for (l = "", o = this.previousSibling; o; )
889
- l = o.data + l, o = o.previousSibling;
890
- for (l += this.data, e = this.nextSibling; e; )
891
- l = l + e.data, e = e.nextSibling;
892
- return l;
893
- }
894
- }), t.prototype.clone = function() {
895
- return Object.create(this);
896
- }, t.prototype.toString = function(e) {
897
- return this.options.writer.text(this, this.options.writer.filterOptions(e));
898
- }, t.prototype.splitText = function(e) {
899
- throw new Error("This DOM method is not implemented." + this.debugInfo());
900
- }, t.prototype.replaceWholeText = function(e) {
901
- throw new Error("This DOM method is not implemented." + this.debugInfo());
902
- }, t;
903
- }(a);
904
- }).call(Sr)), Lt.exports;
905
- }
906
- var It = { exports: {} }, Fr = It.exports, Me;
907
- function oe() {
908
- return Me || (Me = 1, (function() {
909
- var n, a, g = function(p, t) {
910
- for (var e in t)
911
- f.call(t, e) && (p[e] = t[e]);
912
- function o() {
913
- this.constructor = p;
914
- }
915
- return o.prototype = t.prototype, p.prototype = new o(), p.__super__ = t.prototype, p;
916
- }, f = {}.hasOwnProperty;
917
- n = B(), a = jt(), It.exports = function(p) {
918
- g(t, p);
919
- function t(e, o, l) {
920
- if (t.__super__.constructor.call(this, e), o == null)
921
- throw new Error("Missing instruction target. " + this.debugInfo());
922
- this.type = n.ProcessingInstruction, this.target = this.stringify.insTarget(o), this.name = this.target, l && (this.value = this.stringify.insValue(l));
923
- }
924
- return t.prototype.clone = function() {
925
- return Object.create(this);
926
- }, t.prototype.toString = function(e) {
927
- return this.options.writer.processingInstruction(this, this.options.writer.filterOptions(e));
928
- }, t.prototype.isEqualNode = function(e) {
929
- return !(!t.__super__.isEqualNode.apply(this, arguments).isEqualNode(e) || e.target !== this.target);
930
- }, t;
931
- }(a);
932
- }).call(Fr)), It.exports;
933
- }
934
- var xt = { exports: {} }, Xr = xt.exports, Ce;
935
- function er() {
936
- return Ce || (Ce = 1, (function() {
937
- var n, a, g = function(p, t) {
938
- for (var e in t)
939
- f.call(t, e) && (p[e] = t[e]);
940
- function o() {
941
- this.constructor = p;
942
- }
943
- return o.prototype = t.prototype, p.prototype = new o(), p.__super__ = t.prototype, p;
944
- }, f = {}.hasOwnProperty;
945
- a = G(), n = B(), xt.exports = function(p) {
946
- g(t, p);
947
- function t(e) {
948
- t.__super__.constructor.call(this, e), this.type = n.Dummy;
949
- }
950
- return t.prototype.clone = function() {
951
- return Object.create(this);
952
- }, t.prototype.toString = function(e) {
953
- return "";
954
- }, t;
955
- }(a);
956
- }).call(Xr)), xt.exports;
957
- }
958
- var Pt = { exports: {} }, Rr = Pt.exports, Se;
959
- function jr() {
960
- return Se || (Se = 1, (function() {
961
- Pt.exports = function() {
962
- function n(a) {
963
- this.nodes = a;
964
- }
965
- return Object.defineProperty(n.prototype, "length", {
966
- get: function() {
967
- return this.nodes.length || 0;
968
- }
969
- }), n.prototype.clone = function() {
970
- return this.nodes = null;
971
- }, n.prototype.item = function(a) {
972
- return this.nodes[a] || null;
973
- }, n;
974
- }();
975
- }).call(Rr)), Pt.exports;
976
- }
977
- var At = { exports: {} }, Br = At.exports, Fe;
978
- function qr() {
979
- return Fe || (Fe = 1, (function() {
980
- At.exports = {
981
- Disconnected: 1,
982
- Preceding: 2,
983
- Following: 4,
984
- Contains: 8,
985
- ContainedBy: 16,
986
- ImplementationSpecific: 32
987
- };
988
- }).call(Br)), At.exports;
989
- }
990
- var Ur = ft.exports, Xe;
991
- function G() {
992
- return Xe || (Xe = 1, (function() {
993
- var n, a, g, f, p, t, e, o, l, b, m, y, d, w, O, I, x, _ = {}.hasOwnProperty;
994
- x = H(), I = x.isObject, O = x.isFunction, w = x.isEmpty, d = x.getValue, o = null, g = null, f = null, p = null, t = null, m = null, y = null, b = null, e = null, a = null, l = null, n = null, ft.exports = function() {
995
- function E(s) {
996
- this.parent = s, this.parent && (this.options = this.parent.options, this.stringify = this.parent.stringify), this.value = null, this.children = [], this.baseURI = null, o || (o = Kt(), g = zt(), f = Ht(), p = Qt(), t = re(), m = ne(), y = ie(), b = oe(), e = er(), a = B(), l = jr(), Yt(), n = qr());
997
- }
998
- return Object.defineProperty(E.prototype, "nodeName", {
999
- get: function() {
1000
- return this.name;
1001
- }
1002
- }), Object.defineProperty(E.prototype, "nodeType", {
1003
- get: function() {
1004
- return this.type;
1005
- }
1006
- }), Object.defineProperty(E.prototype, "nodeValue", {
1007
- get: function() {
1008
- return this.value;
1009
- }
1010
- }), Object.defineProperty(E.prototype, "parentNode", {
1011
- get: function() {
1012
- return this.parent;
1013
- }
1014
- }), Object.defineProperty(E.prototype, "childNodes", {
1015
- get: function() {
1016
- return (!this.childNodeList || !this.childNodeList.nodes) && (this.childNodeList = new l(this.children)), this.childNodeList;
1017
- }
1018
- }), Object.defineProperty(E.prototype, "firstChild", {
1019
- get: function() {
1020
- return this.children[0] || null;
1021
- }
1022
- }), Object.defineProperty(E.prototype, "lastChild", {
1023
- get: function() {
1024
- return this.children[this.children.length - 1] || null;
1025
- }
1026
- }), Object.defineProperty(E.prototype, "previousSibling", {
1027
- get: function() {
1028
- var s;
1029
- return s = this.parent.children.indexOf(this), this.parent.children[s - 1] || null;
1030
- }
1031
- }), Object.defineProperty(E.prototype, "nextSibling", {
1032
- get: function() {
1033
- var s;
1034
- return s = this.parent.children.indexOf(this), this.parent.children[s + 1] || null;
1035
- }
1036
- }), Object.defineProperty(E.prototype, "ownerDocument", {
1037
- get: function() {
1038
- return this.document() || null;
1039
- }
1040
- }), Object.defineProperty(E.prototype, "textContent", {
1041
- get: function() {
1042
- var s, c, h, D, L;
1043
- if (this.nodeType === a.Element || this.nodeType === a.DocumentFragment) {
1044
- for (L = "", D = this.children, c = 0, h = D.length; c < h; c++)
1045
- s = D[c], s.textContent && (L += s.textContent);
1046
- return L;
1047
- } else
1048
- return null;
1049
- },
1050
- set: function(s) {
1051
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1052
- }
1053
- }), E.prototype.setParent = function(s) {
1054
- var c, h, D, L, v;
1055
- for (this.parent = s, s && (this.options = s.options, this.stringify = s.stringify), L = this.children, v = [], h = 0, D = L.length; h < D; h++)
1056
- c = L[h], v.push(c.setParent(this));
1057
- return v;
1058
- }, E.prototype.element = function(s, c, h) {
1059
- var D, L, v, r, N, P, M, C, F, j, X;
1060
- if (P = null, c === null && h == null && (F = [{}, null], c = F[0], h = F[1]), c == null && (c = {}), c = d(c), I(c) || (j = [c, h], h = j[0], c = j[1]), s != null && (s = d(s)), Array.isArray(s))
1061
- for (v = 0, M = s.length; v < M; v++)
1062
- L = s[v], P = this.element(L);
1063
- else if (O(s))
1064
- P = this.element(s.apply());
1065
- else if (I(s)) {
1066
- for (N in s)
1067
- if (_.call(s, N))
1068
- if (X = s[N], O(X) && (X = X.apply()), !this.options.ignoreDecorators && this.stringify.convertAttKey && N.indexOf(this.stringify.convertAttKey) === 0)
1069
- P = this.attribute(N.substr(this.stringify.convertAttKey.length), X);
1070
- else if (!this.options.separateArrayItems && Array.isArray(X) && w(X))
1071
- P = this.dummy();
1072
- else if (I(X) && w(X))
1073
- P = this.element(N);
1074
- else if (!this.options.keepNullNodes && X == null)
1075
- P = this.dummy();
1076
- else if (!this.options.separateArrayItems && Array.isArray(X))
1077
- for (r = 0, C = X.length; r < C; r++)
1078
- L = X[r], D = {}, D[N] = L, P = this.element(D);
1079
- else I(X) ? !this.options.ignoreDecorators && this.stringify.convertTextKey && N.indexOf(this.stringify.convertTextKey) === 0 ? P = this.element(X) : (P = this.element(N), P.element(X)) : P = this.element(N, X);
1080
- } else !this.options.keepNullNodes && h === null ? P = this.dummy() : !this.options.ignoreDecorators && this.stringify.convertTextKey && s.indexOf(this.stringify.convertTextKey) === 0 ? P = this.text(h) : !this.options.ignoreDecorators && this.stringify.convertCDataKey && s.indexOf(this.stringify.convertCDataKey) === 0 ? P = this.cdata(h) : !this.options.ignoreDecorators && this.stringify.convertCommentKey && s.indexOf(this.stringify.convertCommentKey) === 0 ? P = this.comment(h) : !this.options.ignoreDecorators && this.stringify.convertRawKey && s.indexOf(this.stringify.convertRawKey) === 0 ? P = this.raw(h) : !this.options.ignoreDecorators && this.stringify.convertPIKey && s.indexOf(this.stringify.convertPIKey) === 0 ? P = this.instruction(s.substr(this.stringify.convertPIKey.length), h) : P = this.node(s, c, h);
1081
- if (P == null)
1082
- throw new Error("Could not create any elements with: " + s + ". " + this.debugInfo());
1083
- return P;
1084
- }, E.prototype.insertBefore = function(s, c, h) {
1085
- var D, L, v, r, N;
1086
- if (s != null && s.type)
1087
- return v = s, r = c, v.setParent(this), r ? (L = children.indexOf(r), N = children.splice(L), children.push(v), Array.prototype.push.apply(children, N)) : children.push(v), v;
1088
- if (this.isRoot)
1089
- throw new Error("Cannot insert elements at root level. " + this.debugInfo(s));
1090
- return L = this.parent.children.indexOf(this), N = this.parent.children.splice(L), D = this.parent.element(s, c, h), Array.prototype.push.apply(this.parent.children, N), D;
1091
- }, E.prototype.insertAfter = function(s, c, h) {
1092
- var D, L, v;
1093
- if (this.isRoot)
1094
- throw new Error("Cannot insert elements at root level. " + this.debugInfo(s));
1095
- return L = this.parent.children.indexOf(this), v = this.parent.children.splice(L + 1), D = this.parent.element(s, c, h), Array.prototype.push.apply(this.parent.children, v), D;
1096
- }, E.prototype.remove = function() {
1097
- var s;
1098
- if (this.isRoot)
1099
- throw new Error("Cannot remove the root element. " + this.debugInfo());
1100
- return s = this.parent.children.indexOf(this), [].splice.apply(this.parent.children, [s, s - s + 1].concat([])), this.parent;
1101
- }, E.prototype.node = function(s, c, h) {
1102
- var D, L;
1103
- return s != null && (s = d(s)), c || (c = {}), c = d(c), I(c) || (L = [c, h], h = L[0], c = L[1]), D = new o(this, s, c), h != null && D.text(h), this.children.push(D), D;
1104
- }, E.prototype.text = function(s) {
1105
- var c;
1106
- return I(s) && this.element(s), c = new y(this, s), this.children.push(c), this;
1107
- }, E.prototype.cdata = function(s) {
1108
- var c;
1109
- return c = new g(this, s), this.children.push(c), this;
1110
- }, E.prototype.comment = function(s) {
1111
- var c;
1112
- return c = new f(this, s), this.children.push(c), this;
1113
- }, E.prototype.commentBefore = function(s) {
1114
- var c, h;
1115
- return c = this.parent.children.indexOf(this), h = this.parent.children.splice(c), this.parent.comment(s), Array.prototype.push.apply(this.parent.children, h), this;
1116
- }, E.prototype.commentAfter = function(s) {
1117
- var c, h;
1118
- return c = this.parent.children.indexOf(this), h = this.parent.children.splice(c + 1), this.parent.comment(s), Array.prototype.push.apply(this.parent.children, h), this;
1119
- }, E.prototype.raw = function(s) {
1120
- var c;
1121
- return c = new m(this, s), this.children.push(c), this;
1122
- }, E.prototype.dummy = function() {
1123
- var s;
1124
- return s = new e(this), s;
1125
- }, E.prototype.instruction = function(s, c) {
1126
- var h, D, L, v, r;
1127
- if (s != null && (s = d(s)), c != null && (c = d(c)), Array.isArray(s))
1128
- for (v = 0, r = s.length; v < r; v++)
1129
- h = s[v], this.instruction(h);
1130
- else if (I(s))
1131
- for (h in s)
1132
- _.call(s, h) && (D = s[h], this.instruction(h, D));
1133
- else
1134
- O(c) && (c = c.apply()), L = new b(this, s, c), this.children.push(L);
1135
- return this;
1136
- }, E.prototype.instructionBefore = function(s, c) {
1137
- var h, D;
1138
- return h = this.parent.children.indexOf(this), D = this.parent.children.splice(h), this.parent.instruction(s, c), Array.prototype.push.apply(this.parent.children, D), this;
1139
- }, E.prototype.instructionAfter = function(s, c) {
1140
- var h, D;
1141
- return h = this.parent.children.indexOf(this), D = this.parent.children.splice(h + 1), this.parent.instruction(s, c), Array.prototype.push.apply(this.parent.children, D), this;
1142
- }, E.prototype.declaration = function(s, c, h) {
1143
- var D, L;
1144
- return D = this.document(), L = new p(D, s, c, h), D.children.length === 0 ? D.children.unshift(L) : D.children[0].type === a.Declaration ? D.children[0] = L : D.children.unshift(L), D.root() || D;
1145
- }, E.prototype.dtd = function(s, c) {
1146
- var h, D, L, v, r, N, P, M, C, F;
1147
- for (D = this.document(), L = new t(D, s, c), C = D.children, v = r = 0, P = C.length; r < P; v = ++r)
1148
- if (h = C[v], h.type === a.DocType)
1149
- return D.children[v] = L, L;
1150
- for (F = D.children, v = N = 0, M = F.length; N < M; v = ++N)
1151
- if (h = F[v], h.isRoot)
1152
- return D.children.splice(v, 0, L), L;
1153
- return D.children.push(L), L;
1154
- }, E.prototype.up = function() {
1155
- if (this.isRoot)
1156
- throw new Error("The root node has no parent. Use doc() if you need to get the document object.");
1157
- return this.parent;
1158
- }, E.prototype.root = function() {
1159
- var s;
1160
- for (s = this; s; ) {
1161
- if (s.type === a.Document)
1162
- return s.rootObject;
1163
- if (s.isRoot)
1164
- return s;
1165
- s = s.parent;
1166
- }
1167
- }, E.prototype.document = function() {
1168
- var s;
1169
- for (s = this; s; ) {
1170
- if (s.type === a.Document)
1171
- return s;
1172
- s = s.parent;
1173
- }
1174
- }, E.prototype.end = function(s) {
1175
- return this.document().end(s);
1176
- }, E.prototype.prev = function() {
1177
- var s;
1178
- if (s = this.parent.children.indexOf(this), s < 1)
1179
- throw new Error("Already at the first node. " + this.debugInfo());
1180
- return this.parent.children[s - 1];
1181
- }, E.prototype.next = function() {
1182
- var s;
1183
- if (s = this.parent.children.indexOf(this), s === -1 || s === this.parent.children.length - 1)
1184
- throw new Error("Already at the last node. " + this.debugInfo());
1185
- return this.parent.children[s + 1];
1186
- }, E.prototype.importDocument = function(s) {
1187
- var c;
1188
- return c = s.root().clone(), c.parent = this, c.isRoot = !1, this.children.push(c), this;
1189
- }, E.prototype.debugInfo = function(s) {
1190
- var c, h;
1191
- return s = s || this.name, s == null && !((c = this.parent) != null && c.name) ? "" : s == null ? "parent: <" + this.parent.name + ">" : (h = this.parent) != null && h.name ? "node: <" + s + ">, parent: <" + this.parent.name + ">" : "node: <" + s + ">";
1192
- }, E.prototype.ele = function(s, c, h) {
1193
- return this.element(s, c, h);
1194
- }, E.prototype.nod = function(s, c, h) {
1195
- return this.node(s, c, h);
1196
- }, E.prototype.txt = function(s) {
1197
- return this.text(s);
1198
- }, E.prototype.dat = function(s) {
1199
- return this.cdata(s);
1200
- }, E.prototype.com = function(s) {
1201
- return this.comment(s);
1202
- }, E.prototype.ins = function(s, c) {
1203
- return this.instruction(s, c);
1204
- }, E.prototype.doc = function() {
1205
- return this.document();
1206
- }, E.prototype.dec = function(s, c, h) {
1207
- return this.declaration(s, c, h);
1208
- }, E.prototype.e = function(s, c, h) {
1209
- return this.element(s, c, h);
1210
- }, E.prototype.n = function(s, c, h) {
1211
- return this.node(s, c, h);
1212
- }, E.prototype.t = function(s) {
1213
- return this.text(s);
1214
- }, E.prototype.d = function(s) {
1215
- return this.cdata(s);
1216
- }, E.prototype.c = function(s) {
1217
- return this.comment(s);
1218
- }, E.prototype.r = function(s) {
1219
- return this.raw(s);
1220
- }, E.prototype.i = function(s, c) {
1221
- return this.instruction(s, c);
1222
- }, E.prototype.u = function() {
1223
- return this.up();
1224
- }, E.prototype.importXMLBuilder = function(s) {
1225
- return this.importDocument(s);
1226
- }, E.prototype.replaceChild = function(s, c) {
1227
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1228
- }, E.prototype.removeChild = function(s) {
1229
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1230
- }, E.prototype.appendChild = function(s) {
1231
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1232
- }, E.prototype.hasChildNodes = function() {
1233
- return this.children.length !== 0;
1234
- }, E.prototype.cloneNode = function(s) {
1235
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1236
- }, E.prototype.normalize = function() {
1237
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1238
- }, E.prototype.isSupported = function(s, c) {
1239
- return !0;
1240
- }, E.prototype.hasAttributes = function() {
1241
- return this.attribs.length !== 0;
1242
- }, E.prototype.compareDocumentPosition = function(s) {
1243
- var c, h;
1244
- return c = this, c === s ? 0 : this.document() !== s.document() ? (h = n.Disconnected | n.ImplementationSpecific, Math.random() < 0.5 ? h |= n.Preceding : h |= n.Following, h) : c.isAncestor(s) ? n.Contains | n.Preceding : c.isDescendant(s) ? n.Contains | n.Following : c.isPreceding(s) ? n.Preceding : n.Following;
1245
- }, E.prototype.isSameNode = function(s) {
1246
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1247
- }, E.prototype.lookupPrefix = function(s) {
1248
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1249
- }, E.prototype.isDefaultNamespace = function(s) {
1250
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1251
- }, E.prototype.lookupNamespaceURI = function(s) {
1252
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1253
- }, E.prototype.isEqualNode = function(s) {
1254
- var c, h, D;
1255
- if (s.nodeType !== this.nodeType || s.children.length !== this.children.length)
1256
- return !1;
1257
- for (c = h = 0, D = this.children.length - 1; 0 <= D ? h <= D : h >= D; c = 0 <= D ? ++h : --h)
1258
- if (!this.children[c].isEqualNode(s.children[c]))
1259
- return !1;
1260
- return !0;
1261
- }, E.prototype.getFeature = function(s, c) {
1262
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1263
- }, E.prototype.setUserData = function(s, c, h) {
1264
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1265
- }, E.prototype.getUserData = function(s) {
1266
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1267
- }, E.prototype.contains = function(s) {
1268
- return s ? s === this || this.isDescendant(s) : !1;
1269
- }, E.prototype.isDescendant = function(s) {
1270
- var c, h, D, L, v;
1271
- for (v = this.children, D = 0, L = v.length; D < L; D++)
1272
- if (c = v[D], s === c || (h = c.isDescendant(s), h))
1273
- return !0;
1274
- return !1;
1275
- }, E.prototype.isAncestor = function(s) {
1276
- return s.isDescendant(this);
1277
- }, E.prototype.isPreceding = function(s) {
1278
- var c, h;
1279
- return c = this.treePosition(s), h = this.treePosition(this), c === -1 || h === -1 ? !1 : c < h;
1280
- }, E.prototype.isFollowing = function(s) {
1281
- var c, h;
1282
- return c = this.treePosition(s), h = this.treePosition(this), c === -1 || h === -1 ? !1 : c > h;
1283
- }, E.prototype.treePosition = function(s) {
1284
- var c, h;
1285
- return h = 0, c = !1, this.foreachTreeNode(this.document(), function(D) {
1286
- if (h++, !c && D === s)
1287
- return c = !0;
1288
- }), c ? h : -1;
1289
- }, E.prototype.foreachTreeNode = function(s, c) {
1290
- var h, D, L, v, r;
1291
- for (s || (s = this.document()), v = s.children, D = 0, L = v.length; D < L; D++) {
1292
- if (h = v[D], r = c(h))
1293
- return r;
1294
- if (r = this.foreachTreeNode(h, c), r)
1295
- return r;
1296
- }
1297
- }, E;
1298
- }();
1299
- }).call(Ur)), ft.exports;
1300
- }
1301
- var _t = { exports: {} }, Vr = _t.exports, Re;
1302
- function rr() {
1303
- return Re || (Re = 1, (function() {
1304
- var n = function(g, f) {
1305
- return function() {
1306
- return g.apply(f, arguments);
1307
- };
1308
- }, a = {}.hasOwnProperty;
1309
- _t.exports = function() {
1310
- function g(f) {
1311
- this.assertLegalName = n(this.assertLegalName, this), this.assertLegalChar = n(this.assertLegalChar, this);
1312
- var p, t, e;
1313
- f || (f = {}), this.options = f, this.options.version || (this.options.version = "1.0"), t = f.stringify || {};
1314
- for (p in t)
1315
- a.call(t, p) && (e = t[p], this[p] = e);
1316
- }
1317
- return g.prototype.name = function(f) {
1318
- return this.options.noValidation ? f : this.assertLegalName("" + f || "");
1319
- }, g.prototype.text = function(f) {
1320
- return this.options.noValidation ? f : this.assertLegalChar(this.textEscape("" + f || ""));
1321
- }, g.prototype.cdata = function(f) {
1322
- return this.options.noValidation ? f : (f = "" + f || "", f = f.replace("]]>", "]]]]><![CDATA[>"), this.assertLegalChar(f));
1323
- }, g.prototype.comment = function(f) {
1324
- if (this.options.noValidation)
1325
- return f;
1326
- if (f = "" + f || "", f.match(/--/))
1327
- throw new Error("Comment text cannot contain double-hypen: " + f);
1328
- return this.assertLegalChar(f);
1329
- }, g.prototype.raw = function(f) {
1330
- return this.options.noValidation ? f : "" + f || "";
1331
- }, g.prototype.attValue = function(f) {
1332
- return this.options.noValidation ? f : this.assertLegalChar(this.attEscape(f = "" + f || ""));
1333
- }, g.prototype.insTarget = function(f) {
1334
- return this.options.noValidation ? f : this.assertLegalChar("" + f || "");
1335
- }, g.prototype.insValue = function(f) {
1336
- if (this.options.noValidation)
1337
- return f;
1338
- if (f = "" + f || "", f.match(/\?>/))
1339
- throw new Error("Invalid processing instruction value: " + f);
1340
- return this.assertLegalChar(f);
1341
- }, g.prototype.xmlVersion = function(f) {
1342
- if (this.options.noValidation)
1343
- return f;
1344
- if (f = "" + f || "", !f.match(/1\.[0-9]+/))
1345
- throw new Error("Invalid version number: " + f);
1346
- return f;
1347
- }, g.prototype.xmlEncoding = function(f) {
1348
- if (this.options.noValidation)
1349
- return f;
1350
- if (f = "" + f || "", !f.match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))
1351
- throw new Error("Invalid encoding: " + f);
1352
- return this.assertLegalChar(f);
1353
- }, g.prototype.xmlStandalone = function(f) {
1354
- return this.options.noValidation ? f : f ? "yes" : "no";
1355
- }, g.prototype.dtdPubID = function(f) {
1356
- return this.options.noValidation ? f : this.assertLegalChar("" + f || "");
1357
- }, g.prototype.dtdSysID = function(f) {
1358
- return this.options.noValidation ? f : this.assertLegalChar("" + f || "");
1359
- }, g.prototype.dtdElementValue = function(f) {
1360
- return this.options.noValidation ? f : this.assertLegalChar("" + f || "");
1361
- }, g.prototype.dtdAttType = function(f) {
1362
- return this.options.noValidation ? f : this.assertLegalChar("" + f || "");
1363
- }, g.prototype.dtdAttDefault = function(f) {
1364
- return this.options.noValidation ? f : this.assertLegalChar("" + f || "");
1365
- }, g.prototype.dtdEntityValue = function(f) {
1366
- return this.options.noValidation ? f : this.assertLegalChar("" + f || "");
1367
- }, g.prototype.dtdNData = function(f) {
1368
- return this.options.noValidation ? f : this.assertLegalChar("" + f || "");
1369
- }, g.prototype.convertAttKey = "@", g.prototype.convertPIKey = "?", g.prototype.convertTextKey = "#text", g.prototype.convertCDataKey = "#cdata", g.prototype.convertCommentKey = "#comment", g.prototype.convertRawKey = "#raw", g.prototype.assertLegalChar = function(f) {
1370
- var p, t;
1371
- if (this.options.noValidation)
1372
- return f;
1373
- if (p = "", this.options.version === "1.0") {
1374
- if (p = /[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, t = f.match(p))
1375
- throw new Error("Invalid character in string: " + f + " at index " + t.index);
1376
- } else if (this.options.version === "1.1" && (p = /[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, t = f.match(p)))
1377
- throw new Error("Invalid character in string: " + f + " at index " + t.index);
1378
- return f;
1379
- }, g.prototype.assertLegalName = function(f) {
1380
- var p;
1381
- if (this.options.noValidation)
1382
- return f;
1383
- if (this.assertLegalChar(f), p = /^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/, !f.match(p))
1384
- throw new Error("Invalid character in name");
1385
- return f;
1386
- }, g.prototype.textEscape = function(f) {
1387
- var p;
1388
- return this.options.noValidation ? f : (p = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g, f.replace(p, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\r/g, "&#xD;"));
1389
- }, g.prototype.attEscape = function(f) {
1390
- var p;
1391
- return this.options.noValidation ? f : (p = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g, f.replace(p, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;").replace(/\t/g, "&#x9;").replace(/\n/g, "&#xA;").replace(/\r/g, "&#xD;"));
1392
- }, g;
1393
- }();
1394
- }).call(Vr)), _t.exports;
1395
- }
1396
- var Mt = { exports: {} }, Ct = { exports: {} }, St = { exports: {} }, kr = St.exports, je;
1397
- function Bt() {
1398
- return je || (je = 1, (function() {
1399
- St.exports = {
1400
- None: 0,
1401
- OpenTag: 1,
1402
- InsideTag: 2,
1403
- CloseTag: 3
1404
- };
1405
- }).call(kr)), St.exports;
1406
- }
1407
- var $r = Ct.exports, Be;
1408
- function nr() {
1409
- return Be || (Be = 1, (function() {
1410
- var n, a, g, f = {}.hasOwnProperty;
1411
- g = H().assign, n = B(), Qt(), re(), zt(), Ht(), Kt(), ne(), ie(), oe(), er(), Zt(), te(), Jt(), ee(), a = Bt(), Ct.exports = function() {
1412
- function p(t) {
1413
- var e, o, l;
1414
- t || (t = {}), this.options = t, o = t.writer || {};
1415
- for (e in o)
1416
- f.call(o, e) && (l = o[e], this["_" + e] = this[e], this[e] = l);
1417
- }
1418
- return p.prototype.filterOptions = function(t) {
1419
- var e, o, l, b, m, y, d, w;
1420
- return t || (t = {}), t = g({}, this.options, t), e = {
1421
- writer: this
1422
- }, e.pretty = t.pretty || !1, e.allowEmpty = t.allowEmpty || !1, e.indent = (o = t.indent) != null ? o : " ", e.newline = (l = t.newline) != null ? l : `
1423
- `, e.offset = (b = t.offset) != null ? b : 0, e.dontPrettyTextNodes = (m = (y = t.dontPrettyTextNodes) != null ? y : t.dontprettytextnodes) != null ? m : 0, e.spaceBeforeSlash = (d = (w = t.spaceBeforeSlash) != null ? w : t.spacebeforeslash) != null ? d : "", e.spaceBeforeSlash === !0 && (e.spaceBeforeSlash = " "), e.suppressPrettyCount = 0, e.user = {}, e.state = a.None, e;
1424
- }, p.prototype.indent = function(t, e, o) {
1425
- var l;
1426
- return !e.pretty || e.suppressPrettyCount ? "" : e.pretty && (l = (o || 0) + e.offset + 1, l > 0) ? new Array(l).join(e.indent) : "";
1427
- }, p.prototype.endline = function(t, e, o) {
1428
- return !e.pretty || e.suppressPrettyCount ? "" : e.newline;
1429
- }, p.prototype.attribute = function(t, e, o) {
1430
- var l;
1431
- return this.openAttribute(t, e, o), l = " " + t.name + '="' + t.value + '"', this.closeAttribute(t, e, o), l;
1432
- }, p.prototype.cdata = function(t, e, o) {
1433
- var l;
1434
- return this.openNode(t, e, o), e.state = a.OpenTag, l = this.indent(t, e, o) + "<![CDATA[", e.state = a.InsideTag, l += t.value, e.state = a.CloseTag, l += "]]>" + this.endline(t, e, o), e.state = a.None, this.closeNode(t, e, o), l;
1435
- }, p.prototype.comment = function(t, e, o) {
1436
- var l;
1437
- return this.openNode(t, e, o), e.state = a.OpenTag, l = this.indent(t, e, o) + "<!-- ", e.state = a.InsideTag, l += t.value, e.state = a.CloseTag, l += " -->" + this.endline(t, e, o), e.state = a.None, this.closeNode(t, e, o), l;
1438
- }, p.prototype.declaration = function(t, e, o) {
1439
- var l;
1440
- return this.openNode(t, e, o), e.state = a.OpenTag, l = this.indent(t, e, o) + "<?xml", e.state = a.InsideTag, l += ' version="' + t.version + '"', t.encoding != null && (l += ' encoding="' + t.encoding + '"'), t.standalone != null && (l += ' standalone="' + t.standalone + '"'), e.state = a.CloseTag, l += e.spaceBeforeSlash + "?>", l += this.endline(t, e, o), e.state = a.None, this.closeNode(t, e, o), l;
1441
- }, p.prototype.docType = function(t, e, o) {
1442
- var l, b, m, y, d;
1443
- if (o || (o = 0), this.openNode(t, e, o), e.state = a.OpenTag, y = this.indent(t, e, o), y += "<!DOCTYPE " + t.root().name, t.pubID && t.sysID ? y += ' PUBLIC "' + t.pubID + '" "' + t.sysID + '"' : t.sysID && (y += ' SYSTEM "' + t.sysID + '"'), t.children.length > 0) {
1444
- for (y += " [", y += this.endline(t, e, o), e.state = a.InsideTag, d = t.children, b = 0, m = d.length; b < m; b++)
1445
- l = d[b], y += this.writeChildNode(l, e, o + 1);
1446
- e.state = a.CloseTag, y += "]";
1447
- }
1448
- return e.state = a.CloseTag, y += e.spaceBeforeSlash + ">", y += this.endline(t, e, o), e.state = a.None, this.closeNode(t, e, o), y;
1449
- }, p.prototype.element = function(t, e, o) {
1450
- var l, b, m, y, d, w, O, I, x, _, E, s, c, h;
1451
- o || (o = 0), _ = !1, E = "", this.openNode(t, e, o), e.state = a.OpenTag, E += this.indent(t, e, o) + "<" + t.name, s = t.attribs;
1452
- for (x in s)
1453
- f.call(s, x) && (l = s[x], E += this.attribute(l, e, o));
1454
- if (m = t.children.length, y = m === 0 ? null : t.children[0], m === 0 || t.children.every(function(D) {
1455
- return (D.type === n.Text || D.type === n.Raw) && D.value === "";
1456
- }))
1457
- e.allowEmpty ? (E += ">", e.state = a.CloseTag, E += "</" + t.name + ">" + this.endline(t, e, o)) : (e.state = a.CloseTag, E += e.spaceBeforeSlash + "/>" + this.endline(t, e, o));
1458
- else if (e.pretty && m === 1 && (y.type === n.Text || y.type === n.Raw) && y.value != null)
1459
- E += ">", e.state = a.InsideTag, e.suppressPrettyCount++, _ = !0, E += this.writeChildNode(y, e, o + 1), e.suppressPrettyCount--, _ = !1, e.state = a.CloseTag, E += "</" + t.name + ">" + this.endline(t, e, o);
1460
- else {
1461
- if (e.dontPrettyTextNodes) {
1462
- for (c = t.children, d = 0, O = c.length; d < O; d++)
1463
- if (b = c[d], (b.type === n.Text || b.type === n.Raw) && b.value != null) {
1464
- e.suppressPrettyCount++, _ = !0;
1465
- break;
1466
- }
1467
- }
1468
- for (E += ">" + this.endline(t, e, o), e.state = a.InsideTag, h = t.children, w = 0, I = h.length; w < I; w++)
1469
- b = h[w], E += this.writeChildNode(b, e, o + 1);
1470
- e.state = a.CloseTag, E += this.indent(t, e, o) + "</" + t.name + ">", _ && e.suppressPrettyCount--, E += this.endline(t, e, o), e.state = a.None;
1471
- }
1472
- return this.closeNode(t, e, o), E;
1473
- }, p.prototype.writeChildNode = function(t, e, o) {
1474
- switch (t.type) {
1475
- case n.CData:
1476
- return this.cdata(t, e, o);
1477
- case n.Comment:
1478
- return this.comment(t, e, o);
1479
- case n.Element:
1480
- return this.element(t, e, o);
1481
- case n.Raw:
1482
- return this.raw(t, e, o);
1483
- case n.Text:
1484
- return this.text(t, e, o);
1485
- case n.ProcessingInstruction:
1486
- return this.processingInstruction(t, e, o);
1487
- case n.Dummy:
1488
- return "";
1489
- case n.Declaration:
1490
- return this.declaration(t, e, o);
1491
- case n.DocType:
1492
- return this.docType(t, e, o);
1493
- case n.AttributeDeclaration:
1494
- return this.dtdAttList(t, e, o);
1495
- case n.ElementDeclaration:
1496
- return this.dtdElement(t, e, o);
1497
- case n.EntityDeclaration:
1498
- return this.dtdEntity(t, e, o);
1499
- case n.NotationDeclaration:
1500
- return this.dtdNotation(t, e, o);
1501
- default:
1502
- throw new Error("Unknown XML node type: " + t.constructor.name);
1503
- }
1504
- }, p.prototype.processingInstruction = function(t, e, o) {
1505
- var l;
1506
- return this.openNode(t, e, o), e.state = a.OpenTag, l = this.indent(t, e, o) + "<?", e.state = a.InsideTag, l += t.target, t.value && (l += " " + t.value), e.state = a.CloseTag, l += e.spaceBeforeSlash + "?>", l += this.endline(t, e, o), e.state = a.None, this.closeNode(t, e, o), l;
1507
- }, p.prototype.raw = function(t, e, o) {
1508
- var l;
1509
- return this.openNode(t, e, o), e.state = a.OpenTag, l = this.indent(t, e, o), e.state = a.InsideTag, l += t.value, e.state = a.CloseTag, l += this.endline(t, e, o), e.state = a.None, this.closeNode(t, e, o), l;
1510
- }, p.prototype.text = function(t, e, o) {
1511
- var l;
1512
- return this.openNode(t, e, o), e.state = a.OpenTag, l = this.indent(t, e, o), e.state = a.InsideTag, l += t.value, e.state = a.CloseTag, l += this.endline(t, e, o), e.state = a.None, this.closeNode(t, e, o), l;
1513
- }, p.prototype.dtdAttList = function(t, e, o) {
1514
- var l;
1515
- return this.openNode(t, e, o), e.state = a.OpenTag, l = this.indent(t, e, o) + "<!ATTLIST", e.state = a.InsideTag, l += " " + t.elementName + " " + t.attributeName + " " + t.attributeType, t.defaultValueType !== "#DEFAULT" && (l += " " + t.defaultValueType), t.defaultValue && (l += ' "' + t.defaultValue + '"'), e.state = a.CloseTag, l += e.spaceBeforeSlash + ">" + this.endline(t, e, o), e.state = a.None, this.closeNode(t, e, o), l;
1516
- }, p.prototype.dtdElement = function(t, e, o) {
1517
- var l;
1518
- return this.openNode(t, e, o), e.state = a.OpenTag, l = this.indent(t, e, o) + "<!ELEMENT", e.state = a.InsideTag, l += " " + t.name + " " + t.value, e.state = a.CloseTag, l += e.spaceBeforeSlash + ">" + this.endline(t, e, o), e.state = a.None, this.closeNode(t, e, o), l;
1519
- }, p.prototype.dtdEntity = function(t, e, o) {
1520
- var l;
1521
- return this.openNode(t, e, o), e.state = a.OpenTag, l = this.indent(t, e, o) + "<!ENTITY", e.state = a.InsideTag, t.pe && (l += " %"), l += " " + t.name, t.value ? l += ' "' + t.value + '"' : (t.pubID && t.sysID ? l += ' PUBLIC "' + t.pubID + '" "' + t.sysID + '"' : t.sysID && (l += ' SYSTEM "' + t.sysID + '"'), t.nData && (l += " NDATA " + t.nData)), e.state = a.CloseTag, l += e.spaceBeforeSlash + ">" + this.endline(t, e, o), e.state = a.None, this.closeNode(t, e, o), l;
1522
- }, p.prototype.dtdNotation = function(t, e, o) {
1523
- var l;
1524
- return this.openNode(t, e, o), e.state = a.OpenTag, l = this.indent(t, e, o) + "<!NOTATION", e.state = a.InsideTag, l += " " + t.name, t.pubID && t.sysID ? l += ' PUBLIC "' + t.pubID + '" "' + t.sysID + '"' : t.pubID ? l += ' PUBLIC "' + t.pubID + '"' : t.sysID && (l += ' SYSTEM "' + t.sysID + '"'), e.state = a.CloseTag, l += e.spaceBeforeSlash + ">" + this.endline(t, e, o), e.state = a.None, this.closeNode(t, e, o), l;
1525
- }, p.prototype.openNode = function(t, e, o) {
1526
- }, p.prototype.closeNode = function(t, e, o) {
1527
- }, p.prototype.openAttribute = function(t, e, o) {
1528
- }, p.prototype.closeAttribute = function(t, e, o) {
1529
- }, p;
1530
- }();
1531
- }).call($r)), Ct.exports;
1532
- }
1533
- var Gr = Mt.exports, qe;
1534
- function se() {
1535
- return qe || (qe = 1, (function() {
1536
- var n, a = function(f, p) {
1537
- for (var t in p)
1538
- g.call(p, t) && (f[t] = p[t]);
1539
- function e() {
1540
- this.constructor = f;
1541
- }
1542
- return e.prototype = p.prototype, f.prototype = new e(), f.__super__ = p.prototype, f;
1543
- }, g = {}.hasOwnProperty;
1544
- n = nr(), Mt.exports = function(f) {
1545
- a(p, f);
1546
- function p(t) {
1547
- p.__super__.constructor.call(this, t);
1548
- }
1549
- return p.prototype.document = function(t, e) {
1550
- var o, l, b, m, y;
1551
- for (e = this.filterOptions(e), m = "", y = t.children, l = 0, b = y.length; l < b; l++)
1552
- o = y[l], m += this.writeChildNode(o, e, 0);
1553
- return e.pretty && m.slice(-e.newline.length) === e.newline && (m = m.slice(0, -e.newline.length)), m;
1554
- }, p;
1555
- }(n);
1556
- }).call(Gr)), Mt.exports;
1557
- }
1558
- var Wr = ut.exports, Ue;
1559
- function ir() {
1560
- return Ue || (Ue = 1, (function() {
1561
- var n, a, g, f, p, t, e, o = function(b, m) {
1562
- for (var y in m)
1563
- l.call(m, y) && (b[y] = m[y]);
1564
- function d() {
1565
- this.constructor = b;
1566
- }
1567
- return d.prototype = m.prototype, b.prototype = new d(), b.__super__ = m.prototype, b;
1568
- }, l = {}.hasOwnProperty;
1569
- e = H().isPlainObject, g = Je(), a = Tr(), f = G(), n = B(), t = rr(), p = se(), ut.exports = function(b) {
1570
- o(m, b);
1571
- function m(y) {
1572
- m.__super__.constructor.call(this, null), this.name = "#document", this.type = n.Document, this.documentURI = null, this.domConfig = new a(), y || (y = {}), y.writer || (y.writer = new p()), this.options = y, this.stringify = new t(y);
1573
- }
1574
- return Object.defineProperty(m.prototype, "implementation", {
1575
- value: new g()
1576
- }), Object.defineProperty(m.prototype, "doctype", {
1577
- get: function() {
1578
- var y, d, w, O;
1579
- for (O = this.children, d = 0, w = O.length; d < w; d++)
1580
- if (y = O[d], y.type === n.DocType)
1581
- return y;
1582
- return null;
1583
- }
1584
- }), Object.defineProperty(m.prototype, "documentElement", {
1585
- get: function() {
1586
- return this.rootObject || null;
1587
- }
1588
- }), Object.defineProperty(m.prototype, "inputEncoding", {
1589
- get: function() {
1590
- return null;
1591
- }
1592
- }), Object.defineProperty(m.prototype, "strictErrorChecking", {
1593
- get: function() {
1594
- return !1;
1595
- }
1596
- }), Object.defineProperty(m.prototype, "xmlEncoding", {
1597
- get: function() {
1598
- return this.children.length !== 0 && this.children[0].type === n.Declaration ? this.children[0].encoding : null;
1599
- }
1600
- }), Object.defineProperty(m.prototype, "xmlStandalone", {
1601
- get: function() {
1602
- return this.children.length !== 0 && this.children[0].type === n.Declaration ? this.children[0].standalone === "yes" : !1;
1603
- }
1604
- }), Object.defineProperty(m.prototype, "xmlVersion", {
1605
- get: function() {
1606
- return this.children.length !== 0 && this.children[0].type === n.Declaration ? this.children[0].version : "1.0";
1607
- }
1608
- }), Object.defineProperty(m.prototype, "URL", {
1609
- get: function() {
1610
- return this.documentURI;
1611
- }
1612
- }), Object.defineProperty(m.prototype, "origin", {
1613
- get: function() {
1614
- return null;
1615
- }
1616
- }), Object.defineProperty(m.prototype, "compatMode", {
1617
- get: function() {
1618
- return null;
1619
- }
1620
- }), Object.defineProperty(m.prototype, "characterSet", {
1621
- get: function() {
1622
- return null;
1623
- }
1624
- }), Object.defineProperty(m.prototype, "contentType", {
1625
- get: function() {
1626
- return null;
1627
- }
1628
- }), m.prototype.end = function(y) {
1629
- var d;
1630
- return d = {}, y ? e(y) && (d = y, y = this.options.writer) : y = this.options.writer, y.document(this, y.filterOptions(d));
1631
- }, m.prototype.toString = function(y) {
1632
- return this.options.writer.document(this, this.options.writer.filterOptions(y));
1633
- }, m.prototype.createElement = function(y) {
1634
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1635
- }, m.prototype.createDocumentFragment = function() {
1636
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1637
- }, m.prototype.createTextNode = function(y) {
1638
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1639
- }, m.prototype.createComment = function(y) {
1640
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1641
- }, m.prototype.createCDATASection = function(y) {
1642
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1643
- }, m.prototype.createProcessingInstruction = function(y, d) {
1644
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1645
- }, m.prototype.createAttribute = function(y) {
1646
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1647
- }, m.prototype.createEntityReference = function(y) {
1648
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1649
- }, m.prototype.getElementsByTagName = function(y) {
1650
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1651
- }, m.prototype.importNode = function(y, d) {
1652
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1653
- }, m.prototype.createElementNS = function(y, d) {
1654
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1655
- }, m.prototype.createAttributeNS = function(y, d) {
1656
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1657
- }, m.prototype.getElementsByTagNameNS = function(y, d) {
1658
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1659
- }, m.prototype.getElementById = function(y) {
1660
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1661
- }, m.prototype.adoptNode = function(y) {
1662
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1663
- }, m.prototype.normalizeDocument = function() {
1664
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1665
- }, m.prototype.renameNode = function(y, d, w) {
1666
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1667
- }, m.prototype.getElementsByClassName = function(y) {
1668
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1669
- }, m.prototype.createEvent = function(y) {
1670
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1671
- }, m.prototype.createRange = function() {
1672
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1673
- }, m.prototype.createNodeIterator = function(y, d, w) {
1674
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1675
- }, m.prototype.createTreeWalker = function(y, d, w) {
1676
- throw new Error("This DOM method is not implemented." + this.debugInfo());
1677
- }, m;
1678
- }(f);
1679
- }).call(Wr)), ut.exports;
1680
- }
1681
- var Ft = { exports: {} }, Yr = Ft.exports, Ve;
1682
- function Kr() {
1683
- return Ve || (Ve = 1, (function() {
1684
- var n, a, g, f, p, t, e, o, l, b, m, y, d, w, O, I, x, _, E, s, c, h, D, L = {}.hasOwnProperty;
1685
- D = H(), c = D.isObject, s = D.isFunction, h = D.isPlainObject, E = D.getValue, n = B(), y = ir(), d = Kt(), f = zt(), p = Ht(), O = ne(), _ = ie(), w = oe(), b = Qt(), m = re(), t = Zt(), o = Jt(), e = te(), l = ee(), g = tr(), x = rr(), I = se(), a = Bt(), Ft.exports = function() {
1686
- function v(r, N, P) {
1687
- var M;
1688
- this.name = "?xml", this.type = n.Document, r || (r = {}), M = {}, r.writer ? h(r.writer) && (M = r.writer, r.writer = new I()) : r.writer = new I(), this.options = r, this.writer = r.writer, this.writerOptions = this.writer.filterOptions(M), this.stringify = new x(r), this.onDataCallback = N || function() {
1689
- }, this.onEndCallback = P || function() {
1690
- }, this.currentNode = null, this.currentLevel = -1, this.openTags = {}, this.documentStarted = !1, this.documentCompleted = !1, this.root = null;
1691
- }
1692
- return v.prototype.createChildNode = function(r) {
1693
- var N, P, M, C, F, j, X, S;
1694
- switch (r.type) {
1695
- case n.CData:
1696
- this.cdata(r.value);
1697
- break;
1698
- case n.Comment:
1699
- this.comment(r.value);
1700
- break;
1701
- case n.Element:
1702
- M = {}, X = r.attribs;
1703
- for (P in X)
1704
- L.call(X, P) && (N = X[P], M[P] = N.value);
1705
- this.node(r.name, M);
1706
- break;
1707
- case n.Dummy:
1708
- this.dummy();
1709
- break;
1710
- case n.Raw:
1711
- this.raw(r.value);
1712
- break;
1713
- case n.Text:
1714
- this.text(r.value);
1715
- break;
1716
- case n.ProcessingInstruction:
1717
- this.instruction(r.target, r.value);
1718
- break;
1719
- default:
1720
- throw new Error("This XML node type is not supported in a JS object: " + r.constructor.name);
1721
- }
1722
- for (S = r.children, F = 0, j = S.length; F < j; F++)
1723
- C = S[F], this.createChildNode(C), C.type === n.Element && this.up();
1724
- return this;
1725
- }, v.prototype.dummy = function() {
1726
- return this;
1727
- }, v.prototype.node = function(r, N, P) {
1728
- var M;
1729
- if (r == null)
1730
- throw new Error("Missing node name.");
1731
- if (this.root && this.currentLevel === -1)
1732
- throw new Error("Document can only have one root node. " + this.debugInfo(r));
1733
- return this.openCurrent(), r = E(r), N == null && (N = {}), N = E(N), c(N) || (M = [N, P], P = M[0], N = M[1]), this.currentNode = new d(this, r, N), this.currentNode.children = !1, this.currentLevel++, this.openTags[this.currentLevel] = this.currentNode, P != null && this.text(P), this;
1734
- }, v.prototype.element = function(r, N, P) {
1735
- var M, C, F, j, X, S;
1736
- if (this.currentNode && this.currentNode.type === n.DocType)
1737
- this.dtdElement.apply(this, arguments);
1738
- else if (Array.isArray(r) || c(r) || s(r))
1739
- for (j = this.options.noValidation, this.options.noValidation = !0, S = new y(this.options).element("TEMP_ROOT"), S.element(r), this.options.noValidation = j, X = S.children, C = 0, F = X.length; C < F; C++)
1740
- M = X[C], this.createChildNode(M), M.type === n.Element && this.up();
1741
- else
1742
- this.node(r, N, P);
1743
- return this;
1744
- }, v.prototype.attribute = function(r, N) {
1745
- var P, M;
1746
- if (!this.currentNode || this.currentNode.children)
1747
- throw new Error("att() can only be used immediately after an ele() call in callback mode. " + this.debugInfo(r));
1748
- if (r != null && (r = E(r)), c(r))
1749
- for (P in r)
1750
- L.call(r, P) && (M = r[P], this.attribute(P, M));
1751
- else
1752
- s(N) && (N = N.apply()), this.options.keepNullAttributes && N == null ? this.currentNode.attribs[r] = new g(this, r, "") : N != null && (this.currentNode.attribs[r] = new g(this, r, N));
1753
- return this;
1754
- }, v.prototype.text = function(r) {
1755
- var N;
1756
- return this.openCurrent(), N = new _(this, r), this.onData(this.writer.text(N, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this;
1757
- }, v.prototype.cdata = function(r) {
1758
- var N;
1759
- return this.openCurrent(), N = new f(this, r), this.onData(this.writer.cdata(N, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this;
1760
- }, v.prototype.comment = function(r) {
1761
- var N;
1762
- return this.openCurrent(), N = new p(this, r), this.onData(this.writer.comment(N, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this;
1763
- }, v.prototype.raw = function(r) {
1764
- var N;
1765
- return this.openCurrent(), N = new O(this, r), this.onData(this.writer.raw(N, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this;
1766
- }, v.prototype.instruction = function(r, N) {
1767
- var P, M, C, F, j;
1768
- if (this.openCurrent(), r != null && (r = E(r)), N != null && (N = E(N)), Array.isArray(r))
1769
- for (P = 0, F = r.length; P < F; P++)
1770
- M = r[P], this.instruction(M);
1771
- else if (c(r))
1772
- for (M in r)
1773
- L.call(r, M) && (C = r[M], this.instruction(M, C));
1774
- else
1775
- s(N) && (N = N.apply()), j = new w(this, r, N), this.onData(this.writer.processingInstruction(j, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1);
1776
- return this;
1777
- }, v.prototype.declaration = function(r, N, P) {
1778
- var M;
1779
- if (this.openCurrent(), this.documentStarted)
1780
- throw new Error("declaration() must be the first node.");
1781
- return M = new b(this, r, N, P), this.onData(this.writer.declaration(M, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this;
1782
- }, v.prototype.doctype = function(r, N, P) {
1783
- if (this.openCurrent(), r == null)
1784
- throw new Error("Missing root node name.");
1785
- if (this.root)
1786
- throw new Error("dtd() must come before the root node.");
1787
- return this.currentNode = new m(this, N, P), this.currentNode.rootNodeName = r, this.currentNode.children = !1, this.currentLevel++, this.openTags[this.currentLevel] = this.currentNode, this;
1788
- }, v.prototype.dtdElement = function(r, N) {
1789
- var P;
1790
- return this.openCurrent(), P = new e(this, r, N), this.onData(this.writer.dtdElement(P, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this;
1791
- }, v.prototype.attList = function(r, N, P, M, C) {
1792
- var F;
1793
- return this.openCurrent(), F = new t(this, r, N, P, M, C), this.onData(this.writer.dtdAttList(F, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this;
1794
- }, v.prototype.entity = function(r, N) {
1795
- var P;
1796
- return this.openCurrent(), P = new o(this, !1, r, N), this.onData(this.writer.dtdEntity(P, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this;
1797
- }, v.prototype.pEntity = function(r, N) {
1798
- var P;
1799
- return this.openCurrent(), P = new o(this, !0, r, N), this.onData(this.writer.dtdEntity(P, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this;
1800
- }, v.prototype.notation = function(r, N) {
1801
- var P;
1802
- return this.openCurrent(), P = new l(this, r, N), this.onData(this.writer.dtdNotation(P, this.writerOptions, this.currentLevel + 1), this.currentLevel + 1), this;
1803
- }, v.prototype.up = function() {
1804
- if (this.currentLevel < 0)
1805
- throw new Error("The document node has no parent.");
1806
- return this.currentNode ? (this.currentNode.children ? this.closeNode(this.currentNode) : this.openNode(this.currentNode), this.currentNode = null) : this.closeNode(this.openTags[this.currentLevel]), delete this.openTags[this.currentLevel], this.currentLevel--, this;
1807
- }, v.prototype.end = function() {
1808
- for (; this.currentLevel >= 0; )
1809
- this.up();
1810
- return this.onEnd();
1811
- }, v.prototype.openCurrent = function() {
1812
- if (this.currentNode)
1813
- return this.currentNode.children = !0, this.openNode(this.currentNode);
1814
- }, v.prototype.openNode = function(r) {
1815
- var N, P, M, C;
1816
- if (!r.isOpen) {
1817
- if (!this.root && this.currentLevel === 0 && r.type === n.Element && (this.root = r), P = "", r.type === n.Element) {
1818
- this.writerOptions.state = a.OpenTag, P = this.writer.indent(r, this.writerOptions, this.currentLevel) + "<" + r.name, C = r.attribs;
1819
- for (M in C)
1820
- L.call(C, M) && (N = C[M], P += this.writer.attribute(N, this.writerOptions, this.currentLevel));
1821
- P += (r.children ? ">" : "/>") + this.writer.endline(r, this.writerOptions, this.currentLevel), this.writerOptions.state = a.InsideTag;
1822
- } else
1823
- this.writerOptions.state = a.OpenTag, P = this.writer.indent(r, this.writerOptions, this.currentLevel) + "<!DOCTYPE " + r.rootNodeName, r.pubID && r.sysID ? P += ' PUBLIC "' + r.pubID + '" "' + r.sysID + '"' : r.sysID && (P += ' SYSTEM "' + r.sysID + '"'), r.children ? (P += " [", this.writerOptions.state = a.InsideTag) : (this.writerOptions.state = a.CloseTag, P += ">"), P += this.writer.endline(r, this.writerOptions, this.currentLevel);
1824
- return this.onData(P, this.currentLevel), r.isOpen = !0;
1825
- }
1826
- }, v.prototype.closeNode = function(r) {
1827
- var N;
1828
- if (!r.isClosed)
1829
- return N = "", this.writerOptions.state = a.CloseTag, r.type === n.Element ? N = this.writer.indent(r, this.writerOptions, this.currentLevel) + "</" + r.name + ">" + this.writer.endline(r, this.writerOptions, this.currentLevel) : N = this.writer.indent(r, this.writerOptions, this.currentLevel) + "]>" + this.writer.endline(r, this.writerOptions, this.currentLevel), this.writerOptions.state = a.None, this.onData(N, this.currentLevel), r.isClosed = !0;
1830
- }, v.prototype.onData = function(r, N) {
1831
- return this.documentStarted = !0, this.onDataCallback(r, N + 1);
1832
- }, v.prototype.onEnd = function() {
1833
- return this.documentCompleted = !0, this.onEndCallback();
1834
- }, v.prototype.debugInfo = function(r) {
1835
- return r == null ? "" : "node: <" + r + ">";
1836
- }, v.prototype.ele = function() {
1837
- return this.element.apply(this, arguments);
1838
- }, v.prototype.nod = function(r, N, P) {
1839
- return this.node(r, N, P);
1840
- }, v.prototype.txt = function(r) {
1841
- return this.text(r);
1842
- }, v.prototype.dat = function(r) {
1843
- return this.cdata(r);
1844
- }, v.prototype.com = function(r) {
1845
- return this.comment(r);
1846
- }, v.prototype.ins = function(r, N) {
1847
- return this.instruction(r, N);
1848
- }, v.prototype.dec = function(r, N, P) {
1849
- return this.declaration(r, N, P);
1850
- }, v.prototype.dtd = function(r, N, P) {
1851
- return this.doctype(r, N, P);
1852
- }, v.prototype.e = function(r, N, P) {
1853
- return this.element(r, N, P);
1854
- }, v.prototype.n = function(r, N, P) {
1855
- return this.node(r, N, P);
1856
- }, v.prototype.t = function(r) {
1857
- return this.text(r);
1858
- }, v.prototype.d = function(r) {
1859
- return this.cdata(r);
1860
- }, v.prototype.c = function(r) {
1861
- return this.comment(r);
1862
- }, v.prototype.r = function(r) {
1863
- return this.raw(r);
1864
- }, v.prototype.i = function(r, N) {
1865
- return this.instruction(r, N);
1866
- }, v.prototype.att = function() {
1867
- return this.currentNode && this.currentNode.type === n.DocType ? this.attList.apply(this, arguments) : this.attribute.apply(this, arguments);
1868
- }, v.prototype.a = function() {
1869
- return this.currentNode && this.currentNode.type === n.DocType ? this.attList.apply(this, arguments) : this.attribute.apply(this, arguments);
1870
- }, v.prototype.ent = function(r, N) {
1871
- return this.entity(r, N);
1872
- }, v.prototype.pent = function(r, N) {
1873
- return this.pEntity(r, N);
1874
- }, v.prototype.not = function(r, N) {
1875
- return this.notation(r, N);
1876
- }, v;
1877
- }();
1878
- }).call(Yr)), Ft.exports;
1879
- }
1880
- var Xt = { exports: {} }, zr = Xt.exports, ke;
1881
- function Hr() {
1882
- return ke || (ke = 1, (function() {
1883
- var n, a, g, f = function(t, e) {
1884
- for (var o in e)
1885
- p.call(e, o) && (t[o] = e[o]);
1886
- function l() {
1887
- this.constructor = t;
1888
- }
1889
- return l.prototype = e.prototype, t.prototype = new l(), t.__super__ = e.prototype, t;
1890
- }, p = {}.hasOwnProperty;
1891
- n = B(), g = nr(), a = Bt(), Xt.exports = function(t) {
1892
- f(e, t);
1893
- function e(o, l) {
1894
- this.stream = o, e.__super__.constructor.call(this, l);
1895
- }
1896
- return e.prototype.endline = function(o, l, b) {
1897
- return o.isLastRootNode && l.state === a.CloseTag ? "" : e.__super__.endline.call(this, o, l, b);
1898
- }, e.prototype.document = function(o, l) {
1899
- var b, m, y, d, w, O, I, x, _;
1900
- for (I = o.children, m = y = 0, w = I.length; y < w; m = ++y)
1901
- b = I[m], b.isLastRootNode = m === o.children.length - 1;
1902
- for (l = this.filterOptions(l), x = o.children, _ = [], d = 0, O = x.length; d < O; d++)
1903
- b = x[d], _.push(this.writeChildNode(b, l, 0));
1904
- return _;
1905
- }, e.prototype.attribute = function(o, l, b) {
1906
- return this.stream.write(e.__super__.attribute.call(this, o, l, b));
1907
- }, e.prototype.cdata = function(o, l, b) {
1908
- return this.stream.write(e.__super__.cdata.call(this, o, l, b));
1909
- }, e.prototype.comment = function(o, l, b) {
1910
- return this.stream.write(e.__super__.comment.call(this, o, l, b));
1911
- }, e.prototype.declaration = function(o, l, b) {
1912
- return this.stream.write(e.__super__.declaration.call(this, o, l, b));
1913
- }, e.prototype.docType = function(o, l, b) {
1914
- var m, y, d, w;
1915
- if (b || (b = 0), this.openNode(o, l, b), l.state = a.OpenTag, this.stream.write(this.indent(o, l, b)), this.stream.write("<!DOCTYPE " + o.root().name), o.pubID && o.sysID ? this.stream.write(' PUBLIC "' + o.pubID + '" "' + o.sysID + '"') : o.sysID && this.stream.write(' SYSTEM "' + o.sysID + '"'), o.children.length > 0) {
1916
- for (this.stream.write(" ["), this.stream.write(this.endline(o, l, b)), l.state = a.InsideTag, w = o.children, y = 0, d = w.length; y < d; y++)
1917
- m = w[y], this.writeChildNode(m, l, b + 1);
1918
- l.state = a.CloseTag, this.stream.write("]");
1919
- }
1920
- return l.state = a.CloseTag, this.stream.write(l.spaceBeforeSlash + ">"), this.stream.write(this.endline(o, l, b)), l.state = a.None, this.closeNode(o, l, b);
1921
- }, e.prototype.element = function(o, l, b) {
1922
- var m, y, d, w, O, I, x, _, E;
1923
- b || (b = 0), this.openNode(o, l, b), l.state = a.OpenTag, this.stream.write(this.indent(o, l, b) + "<" + o.name), _ = o.attribs;
1924
- for (x in _)
1925
- p.call(_, x) && (m = _[x], this.attribute(m, l, b));
1926
- if (d = o.children.length, w = d === 0 ? null : o.children[0], d === 0 || o.children.every(function(s) {
1927
- return (s.type === n.Text || s.type === n.Raw) && s.value === "";
1928
- }))
1929
- l.allowEmpty ? (this.stream.write(">"), l.state = a.CloseTag, this.stream.write("</" + o.name + ">")) : (l.state = a.CloseTag, this.stream.write(l.spaceBeforeSlash + "/>"));
1930
- else if (l.pretty && d === 1 && (w.type === n.Text || w.type === n.Raw) && w.value != null)
1931
- this.stream.write(">"), l.state = a.InsideTag, l.suppressPrettyCount++, this.writeChildNode(w, l, b + 1), l.suppressPrettyCount--, l.state = a.CloseTag, this.stream.write("</" + o.name + ">");
1932
- else {
1933
- for (this.stream.write(">" + this.endline(o, l, b)), l.state = a.InsideTag, E = o.children, O = 0, I = E.length; O < I; O++)
1934
- y = E[O], this.writeChildNode(y, l, b + 1);
1935
- l.state = a.CloseTag, this.stream.write(this.indent(o, l, b) + "</" + o.name + ">");
1936
- }
1937
- return this.stream.write(this.endline(o, l, b)), l.state = a.None, this.closeNode(o, l, b);
1938
- }, e.prototype.processingInstruction = function(o, l, b) {
1939
- return this.stream.write(e.__super__.processingInstruction.call(this, o, l, b));
1940
- }, e.prototype.raw = function(o, l, b) {
1941
- return this.stream.write(e.__super__.raw.call(this, o, l, b));
1942
- }, e.prototype.text = function(o, l, b) {
1943
- return this.stream.write(e.__super__.text.call(this, o, l, b));
1944
- }, e.prototype.dtdAttList = function(o, l, b) {
1945
- return this.stream.write(e.__super__.dtdAttList.call(this, o, l, b));
1946
- }, e.prototype.dtdElement = function(o, l, b) {
1947
- return this.stream.write(e.__super__.dtdElement.call(this, o, l, b));
1948
- }, e.prototype.dtdEntity = function(o, l, b) {
1949
- return this.stream.write(e.__super__.dtdEntity.call(this, o, l, b));
1950
- }, e.prototype.dtdNotation = function(o, l, b) {
1951
- return this.stream.write(e.__super__.dtdNotation.call(this, o, l, b));
1952
- }, e;
1953
- }(g);
1954
- }).call(zr)), Xt.exports;
1955
- }
1956
- var $e;
1957
- function Qr() {
1958
- return $e || ($e = 1, (function() {
1959
- var n, a, g, f, p, t, e, o, l, b;
1960
- b = H(), o = b.assign, l = b.isFunction, g = Je(), f = ir(), p = Kr(), e = se(), t = Hr(), n = B(), a = Bt(), Y.create = function(m, y, d, w) {
1961
- var O, I;
1962
- if (m == null)
1963
- throw new Error("Root element needs a name.");
1964
- return w = o({}, y, d, w), O = new f(w), I = O.element(m), w.headless || (O.declaration(w), (w.pubID != null || w.sysID != null) && O.dtd(w)), I;
1965
- }, Y.begin = function(m, y, d) {
1966
- var w;
1967
- return l(m) && (w = [m, y], y = w[0], d = w[1], m = {}), y ? new p(m, y, d) : new f(m);
1968
- }, Y.stringWriter = function(m) {
1969
- return new e(m);
1970
- }, Y.streamWriter = function(m, y) {
1971
- return new t(m, y);
1972
- }, Y.implementation = new g(), Y.nodeType = n, Y.writerState = a;
1973
- }).call(Y)), Y;
1974
- }
1975
- var Ge;
1976
- function Zr() {
1977
- return Ge || (Ge = 1, (function() {
1978
- var n, a, g, f, p, t = {}.hasOwnProperty;
1979
- n = Qr(), a = Wt().defaults, f = function(e) {
1980
- return typeof e == "string" && (e.indexOf("&") >= 0 || e.indexOf(">") >= 0 || e.indexOf("<") >= 0);
1981
- }, p = function(e) {
1982
- return "<![CDATA[" + g(e) + "]]>";
1983
- }, g = function(e) {
1984
- return e.replace("]]>", "]]]]><![CDATA[>");
1985
- }, rt.Builder = function() {
1986
- function e(o) {
1987
- var l, b, m;
1988
- this.options = {}, b = a["0.2"];
1989
- for (l in b)
1990
- t.call(b, l) && (m = b[l], this.options[l] = m);
1991
- for (l in o)
1992
- t.call(o, l) && (m = o[l], this.options[l] = m);
1993
- }
1994
- return e.prototype.buildObject = function(o) {
1995
- var l, b, m, y, d;
1996
- return l = this.options.attrkey, b = this.options.charkey, Object.keys(o).length === 1 && this.options.rootName === a["0.2"].rootName ? (d = Object.keys(o)[0], o = o[d]) : d = this.options.rootName, m = /* @__PURE__ */ function(w) {
1997
- return function(O, I) {
1998
- var x, _, E, s, c, h;
1999
- if (typeof I != "object")
2000
- w.options.cdata && f(I) ? O.raw(p(I)) : O.txt(I);
2001
- else if (Array.isArray(I)) {
2002
- for (s in I)
2003
- if (t.call(I, s)) {
2004
- _ = I[s];
2005
- for (c in _)
2006
- E = _[c], O = m(O.ele(c), E).up();
2007
- }
2008
- } else
2009
- for (c in I)
2010
- if (t.call(I, c))
2011
- if (_ = I[c], c === l) {
2012
- if (typeof _ == "object")
2013
- for (x in _)
2014
- h = _[x], O = O.att(x, h);
2015
- } else if (c === b)
2016
- w.options.cdata && f(_) ? O = O.raw(p(_)) : O = O.txt(_);
2017
- else if (Array.isArray(_))
2018
- for (s in _)
2019
- t.call(_, s) && (E = _[s], typeof E == "string" ? w.options.cdata && f(E) ? O = O.ele(c).raw(p(E)).up() : O = O.ele(c, E).up() : O = m(O.ele(c), E).up());
2020
- else typeof _ == "object" ? O = m(O.ele(c), _).up() : typeof _ == "string" && w.options.cdata && f(_) ? O = O.ele(c).raw(p(_)).up() : (_ == null && (_ = ""), O = O.ele(c, _.toString()).up());
2021
- return O;
2022
- };
2023
- }(this), y = n.create(d, this.options.xmldec, this.options.doctype, {
2024
- headless: this.options.headless,
2025
- allowSurrogateChars: this.options.allowSurrogateChars
2026
- }), m(y, o).end(this.options.renderOpts);
2027
- }, e;
2028
- }();
2029
- }).call(rt)), rt;
2030
- }
2031
- var nt = {}, $t = {};
2032
- const Jr = {}, tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2033
- __proto__: null,
2034
- default: Jr
2035
- }, Symbol.toStringTag, { value: "Module" })), Gt = /* @__PURE__ */ hr(tn);
2036
- var We;
2037
- function en() {
2038
- return We || (We = 1, function(n) {
2039
- (function(a) {
2040
- a.parser = function(u, i) {
2041
- return new f(u, i);
2042
- }, a.SAXParser = f, a.SAXStream = m, a.createStream = b, a.MAX_BUFFER_LENGTH = 64 * 1024;
2043
- var g = [
2044
- "comment",
2045
- "sgmlDecl",
2046
- "textNode",
2047
- "tagName",
2048
- "doctype",
2049
- "procInstName",
2050
- "procInstBody",
2051
- "entity",
2052
- "attribName",
2053
- "attribValue",
2054
- "cdata",
2055
- "script"
2056
- ];
2057
- a.EVENTS = [
2058
- "text",
2059
- "processinginstruction",
2060
- "sgmldeclaration",
2061
- "doctype",
2062
- "comment",
2063
- "opentagstart",
2064
- "attribute",
2065
- "opentag",
2066
- "closetag",
2067
- "opencdata",
2068
- "cdata",
2069
- "closecdata",
2070
- "error",
2071
- "end",
2072
- "ready",
2073
- "script",
2074
- "opennamespace",
2075
- "closenamespace"
2076
- ];
2077
- function f(u, i) {
2078
- if (!(this instanceof f))
2079
- return new f(u, i);
2080
- var A = this;
2081
- t(A), A.q = A.c = "", A.bufferCheckPosition = a.MAX_BUFFER_LENGTH, A.opt = i || {}, A.opt.lowercase = A.opt.lowercase || A.opt.lowercasetags, A.looseCase = A.opt.lowercase ? "toLowerCase" : "toUpperCase", A.tags = [], A.closed = A.closedRoot = A.sawRoot = !1, A.tag = A.error = null, A.strict = !!u, A.noscript = !!(u || A.opt.noscript), A.state = r.BEGIN, A.strictEntities = A.opt.strictEntities, A.ENTITIES = A.strictEntities ? Object.create(a.XML_ENTITIES) : Object.create(a.ENTITIES), A.attribList = [], A.opt.xmlns && (A.ns = Object.create(I)), A.opt.unquotedAttributeValues === void 0 && (A.opt.unquotedAttributeValues = !u), A.trackPosition = A.opt.position !== !1, A.trackPosition && (A.position = A.line = A.column = 0), P(A, "onready");
2082
- }
2083
- Object.create || (Object.create = function(u) {
2084
- function i() {
2085
- }
2086
- i.prototype = u;
2087
- var A = new i();
2088
- return A;
2089
- }), Object.keys || (Object.keys = function(u) {
2090
- var i = [];
2091
- for (var A in u) u.hasOwnProperty(A) && i.push(A);
2092
- return i;
2093
- });
2094
- function p(u) {
2095
- for (var i = Math.max(a.MAX_BUFFER_LENGTH, 10), A = 0, T = 0, R = g.length; T < R; T++) {
2096
- var q = u[g[T]].length;
2097
- if (q > i)
2098
- switch (g[T]) {
2099
- case "textNode":
2100
- C(u);
2101
- break;
2102
- case "cdata":
2103
- M(u, "oncdata", u.cdata), u.cdata = "";
2104
- break;
2105
- case "script":
2106
- M(u, "onscript", u.script), u.script = "";
2107
- break;
2108
- default:
2109
- j(u, "Max buffer length exceeded: " + g[T]);
2110
- }
2111
- A = Math.max(A, q);
2112
- }
2113
- var U = a.MAX_BUFFER_LENGTH - A;
2114
- u.bufferCheckPosition = U + u.position;
2115
- }
2116
- function t(u) {
2117
- for (var i = 0, A = g.length; i < A; i++)
2118
- u[g[i]] = "";
2119
- }
2120
- function e(u) {
2121
- C(u), u.cdata !== "" && (M(u, "oncdata", u.cdata), u.cdata = ""), u.script !== "" && (M(u, "onscript", u.script), u.script = "");
2122
- }
2123
- f.prototype = {
2124
- end: function() {
2125
- X(this);
2126
- },
2127
- write: lr,
2128
- resume: function() {
2129
- return this.error = null, this;
2130
- },
2131
- close: function() {
2132
- return this.write(null);
2133
- },
2134
- flush: function() {
2135
- e(this);
2136
- }
2137
- };
2138
- var o;
2139
- try {
2140
- o = Gt.Stream;
2141
- } catch {
2142
- o = function() {
2143
- };
2144
- }
2145
- o || (o = function() {
2146
- });
2147
- var l = a.EVENTS.filter(function(u) {
2148
- return u !== "error" && u !== "end";
2149
- });
2150
- function b(u, i) {
2151
- return new m(u, i);
2152
- }
2153
- function m(u, i) {
2154
- if (!(this instanceof m))
2155
- return new m(u, i);
2156
- o.apply(this), this._parser = new f(u, i), this.writable = !0, this.readable = !0;
2157
- var A = this;
2158
- this._parser.onend = function() {
2159
- A.emit("end");
2160
- }, this._parser.onerror = function(T) {
2161
- A.emit("error", T), A._parser.error = null;
2162
- }, this._decoder = null, l.forEach(function(T) {
2163
- Object.defineProperty(A, "on" + T, {
2164
- get: function() {
2165
- return A._parser["on" + T];
2166
- },
2167
- set: function(R) {
2168
- if (!R)
2169
- return A.removeAllListeners(T), A._parser["on" + T] = R, R;
2170
- A.on(T, R);
2171
- },
2172
- enumerable: !0,
2173
- configurable: !1
2174
- });
2175
- });
2176
- }
2177
- m.prototype = Object.create(o.prototype, {
2178
- constructor: {
2179
- value: m
2180
- }
2181
- }), m.prototype.write = function(u) {
2182
- if (typeof Buffer == "function" && typeof Buffer.isBuffer == "function" && Buffer.isBuffer(u)) {
2183
- if (!this._decoder) {
2184
- var i = Gt.StringDecoder;
2185
- this._decoder = new i("utf8");
2186
- }
2187
- u = this._decoder.write(u);
2188
- }
2189
- return this._parser.write(u.toString()), this.emit("data", u), !0;
2190
- }, m.prototype.end = function(u) {
2191
- return u && u.length && this.write(u), this._parser.end(), !0;
2192
- }, m.prototype.on = function(u, i) {
2193
- var A = this;
2194
- return !A._parser["on" + u] && l.indexOf(u) !== -1 && (A._parser["on" + u] = function() {
2195
- var T = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments);
2196
- T.splice(0, 0, u), A.emit.apply(A, T);
2197
- }), o.prototype.on.call(A, u, i);
2198
- };
2199
- var y = "[CDATA[", d = "DOCTYPE", w = "http://www.w3.org/XML/1998/namespace", O = "http://www.w3.org/2000/xmlns/", I = { xml: w, xmlns: O }, x = /[:_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]/, _ = /[:_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\u00B7\u0300-\u036F\u203F-\u2040.\d-]/, 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]/, s = /[#:_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\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;
2200
- function c(u) {
2201
- return u === " " || u === `
2202
- ` || u === "\r" || u === " ";
2203
- }
2204
- function h(u) {
2205
- return u === '"' || u === "'";
2206
- }
2207
- function D(u) {
2208
- return u === ">" || c(u);
2209
- }
2210
- function L(u, i) {
2211
- return u.test(i);
2212
- }
2213
- function v(u, i) {
2214
- return !L(u, i);
2215
- }
2216
- var r = 0;
2217
- a.STATE = {
2218
- BEGIN: r++,
2219
- // leading byte order mark or whitespace
2220
- BEGIN_WHITESPACE: r++,
2221
- // leading whitespace
2222
- TEXT: r++,
2223
- // general stuff
2224
- TEXT_ENTITY: r++,
2225
- // &amp and such.
2226
- OPEN_WAKA: r++,
2227
- // <
2228
- SGML_DECL: r++,
2229
- // <!BLARG
2230
- SGML_DECL_QUOTED: r++,
2231
- // <!BLARG foo "bar
2232
- DOCTYPE: r++,
2233
- // <!DOCTYPE
2234
- DOCTYPE_QUOTED: r++,
2235
- // <!DOCTYPE "//blah
2236
- DOCTYPE_DTD: r++,
2237
- // <!DOCTYPE "//blah" [ ...
2238
- DOCTYPE_DTD_QUOTED: r++,
2239
- // <!DOCTYPE "//blah" [ "foo
2240
- COMMENT_STARTING: r++,
2241
- // <!-
2242
- COMMENT: r++,
2243
- // <!--
2244
- COMMENT_ENDING: r++,
2245
- // <!-- blah -
2246
- COMMENT_ENDED: r++,
2247
- // <!-- blah --
2248
- CDATA: r++,
2249
- // <![CDATA[ something
2250
- CDATA_ENDING: r++,
2251
- // ]
2252
- CDATA_ENDING_2: r++,
2253
- // ]]
2254
- PROC_INST: r++,
2255
- // <?hi
2256
- PROC_INST_BODY: r++,
2257
- // <?hi there
2258
- PROC_INST_ENDING: r++,
2259
- // <?hi "there" ?
2260
- OPEN_TAG: r++,
2261
- // <strong
2262
- OPEN_TAG_SLASH: r++,
2263
- // <strong /
2264
- ATTRIB: r++,
2265
- // <a
2266
- ATTRIB_NAME: r++,
2267
- // <a foo
2268
- ATTRIB_NAME_SAW_WHITE: r++,
2269
- // <a foo _
2270
- ATTRIB_VALUE: r++,
2271
- // <a foo=
2272
- ATTRIB_VALUE_QUOTED: r++,
2273
- // <a foo="bar
2274
- ATTRIB_VALUE_CLOSED: r++,
2275
- // <a foo="bar"
2276
- ATTRIB_VALUE_UNQUOTED: r++,
2277
- // <a foo=bar
2278
- ATTRIB_VALUE_ENTITY_Q: r++,
2279
- // <foo bar="&quot;"
2280
- ATTRIB_VALUE_ENTITY_U: r++,
2281
- // <foo bar=&quot
2282
- CLOSE_TAG: r++,
2283
- // </a
2284
- CLOSE_TAG_SAW_WHITE: r++,
2285
- // </a >
2286
- SCRIPT: r++,
2287
- // <script> ...
2288
- SCRIPT_ENDING: r++
2289
- // <script> ... <
2290
- }, a.XML_ENTITIES = {
2291
- amp: "&",
2292
- gt: ">",
2293
- lt: "<",
2294
- quot: '"',
2295
- apos: "'"
2296
- }, a.ENTITIES = {
2297
- amp: "&",
2298
- gt: ">",
2299
- lt: "<",
2300
- quot: '"',
2301
- apos: "'",
2302
- AElig: 198,
2303
- Aacute: 193,
2304
- Acirc: 194,
2305
- Agrave: 192,
2306
- Aring: 197,
2307
- Atilde: 195,
2308
- Auml: 196,
2309
- Ccedil: 199,
2310
- ETH: 208,
2311
- Eacute: 201,
2312
- Ecirc: 202,
2313
- Egrave: 200,
2314
- Euml: 203,
2315
- Iacute: 205,
2316
- Icirc: 206,
2317
- Igrave: 204,
2318
- Iuml: 207,
2319
- Ntilde: 209,
2320
- Oacute: 211,
2321
- Ocirc: 212,
2322
- Ograve: 210,
2323
- Oslash: 216,
2324
- Otilde: 213,
2325
- Ouml: 214,
2326
- THORN: 222,
2327
- Uacute: 218,
2328
- Ucirc: 219,
2329
- Ugrave: 217,
2330
- Uuml: 220,
2331
- Yacute: 221,
2332
- aacute: 225,
2333
- acirc: 226,
2334
- aelig: 230,
2335
- agrave: 224,
2336
- aring: 229,
2337
- atilde: 227,
2338
- auml: 228,
2339
- ccedil: 231,
2340
- eacute: 233,
2341
- ecirc: 234,
2342
- egrave: 232,
2343
- eth: 240,
2344
- euml: 235,
2345
- iacute: 237,
2346
- icirc: 238,
2347
- igrave: 236,
2348
- iuml: 239,
2349
- ntilde: 241,
2350
- oacute: 243,
2351
- ocirc: 244,
2352
- ograve: 242,
2353
- oslash: 248,
2354
- otilde: 245,
2355
- ouml: 246,
2356
- szlig: 223,
2357
- thorn: 254,
2358
- uacute: 250,
2359
- ucirc: 251,
2360
- ugrave: 249,
2361
- uuml: 252,
2362
- yacute: 253,
2363
- yuml: 255,
2364
- copy: 169,
2365
- reg: 174,
2366
- nbsp: 160,
2367
- iexcl: 161,
2368
- cent: 162,
2369
- pound: 163,
2370
- curren: 164,
2371
- yen: 165,
2372
- brvbar: 166,
2373
- sect: 167,
2374
- uml: 168,
2375
- ordf: 170,
2376
- laquo: 171,
2377
- not: 172,
2378
- shy: 173,
2379
- macr: 175,
2380
- deg: 176,
2381
- plusmn: 177,
2382
- sup1: 185,
2383
- sup2: 178,
2384
- sup3: 179,
2385
- acute: 180,
2386
- micro: 181,
2387
- para: 182,
2388
- middot: 183,
2389
- cedil: 184,
2390
- ordm: 186,
2391
- raquo: 187,
2392
- frac14: 188,
2393
- frac12: 189,
2394
- frac34: 190,
2395
- iquest: 191,
2396
- times: 215,
2397
- divide: 247,
2398
- OElig: 338,
2399
- oelig: 339,
2400
- Scaron: 352,
2401
- scaron: 353,
2402
- Yuml: 376,
2403
- fnof: 402,
2404
- circ: 710,
2405
- tilde: 732,
2406
- Alpha: 913,
2407
- Beta: 914,
2408
- Gamma: 915,
2409
- Delta: 916,
2410
- Epsilon: 917,
2411
- Zeta: 918,
2412
- Eta: 919,
2413
- Theta: 920,
2414
- Iota: 921,
2415
- Kappa: 922,
2416
- Lambda: 923,
2417
- Mu: 924,
2418
- Nu: 925,
2419
- Xi: 926,
2420
- Omicron: 927,
2421
- Pi: 928,
2422
- Rho: 929,
2423
- Sigma: 931,
2424
- Tau: 932,
2425
- Upsilon: 933,
2426
- Phi: 934,
2427
- Chi: 935,
2428
- Psi: 936,
2429
- Omega: 937,
2430
- alpha: 945,
2431
- beta: 946,
2432
- gamma: 947,
2433
- delta: 948,
2434
- epsilon: 949,
2435
- zeta: 950,
2436
- eta: 951,
2437
- theta: 952,
2438
- iota: 953,
2439
- kappa: 954,
2440
- lambda: 955,
2441
- mu: 956,
2442
- nu: 957,
2443
- xi: 958,
2444
- omicron: 959,
2445
- pi: 960,
2446
- rho: 961,
2447
- sigmaf: 962,
2448
- sigma: 963,
2449
- tau: 964,
2450
- upsilon: 965,
2451
- phi: 966,
2452
- chi: 967,
2453
- psi: 968,
2454
- omega: 969,
2455
- thetasym: 977,
2456
- upsih: 978,
2457
- piv: 982,
2458
- ensp: 8194,
2459
- emsp: 8195,
2460
- thinsp: 8201,
2461
- zwnj: 8204,
2462
- zwj: 8205,
2463
- lrm: 8206,
2464
- rlm: 8207,
2465
- ndash: 8211,
2466
- mdash: 8212,
2467
- lsquo: 8216,
2468
- rsquo: 8217,
2469
- sbquo: 8218,
2470
- ldquo: 8220,
2471
- rdquo: 8221,
2472
- bdquo: 8222,
2473
- dagger: 8224,
2474
- Dagger: 8225,
2475
- bull: 8226,
2476
- hellip: 8230,
2477
- permil: 8240,
2478
- prime: 8242,
2479
- Prime: 8243,
2480
- lsaquo: 8249,
2481
- rsaquo: 8250,
2482
- oline: 8254,
2483
- frasl: 8260,
2484
- euro: 8364,
2485
- image: 8465,
2486
- weierp: 8472,
2487
- real: 8476,
2488
- trade: 8482,
2489
- alefsym: 8501,
2490
- larr: 8592,
2491
- uarr: 8593,
2492
- rarr: 8594,
2493
- darr: 8595,
2494
- harr: 8596,
2495
- crarr: 8629,
2496
- lArr: 8656,
2497
- uArr: 8657,
2498
- rArr: 8658,
2499
- dArr: 8659,
2500
- hArr: 8660,
2501
- forall: 8704,
2502
- part: 8706,
2503
- exist: 8707,
2504
- empty: 8709,
2505
- nabla: 8711,
2506
- isin: 8712,
2507
- notin: 8713,
2508
- ni: 8715,
2509
- prod: 8719,
2510
- sum: 8721,
2511
- minus: 8722,
2512
- lowast: 8727,
2513
- radic: 8730,
2514
- prop: 8733,
2515
- infin: 8734,
2516
- ang: 8736,
2517
- and: 8743,
2518
- or: 8744,
2519
- cap: 8745,
2520
- cup: 8746,
2521
- int: 8747,
2522
- there4: 8756,
2523
- sim: 8764,
2524
- cong: 8773,
2525
- asymp: 8776,
2526
- ne: 8800,
2527
- equiv: 8801,
2528
- le: 8804,
2529
- ge: 8805,
2530
- sub: 8834,
2531
- sup: 8835,
2532
- nsub: 8836,
2533
- sube: 8838,
2534
- supe: 8839,
2535
- oplus: 8853,
2536
- otimes: 8855,
2537
- perp: 8869,
2538
- sdot: 8901,
2539
- lceil: 8968,
2540
- rceil: 8969,
2541
- lfloor: 8970,
2542
- rfloor: 8971,
2543
- lang: 9001,
2544
- rang: 9002,
2545
- loz: 9674,
2546
- spades: 9824,
2547
- clubs: 9827,
2548
- hearts: 9829,
2549
- diams: 9830
2550
- }, Object.keys(a.ENTITIES).forEach(function(u) {
2551
- var i = a.ENTITIES[u], A = typeof i == "number" ? String.fromCharCode(i) : i;
2552
- a.ENTITIES[u] = A;
2553
- });
2554
- for (var N in a.STATE)
2555
- a.STATE[a.STATE[N]] = N;
2556
- r = a.STATE;
2557
- function P(u, i, A) {
2558
- u[i] && u[i](A);
2559
- }
2560
- function M(u, i, A) {
2561
- u.textNode && C(u), P(u, i, A);
2562
- }
2563
- function C(u) {
2564
- u.textNode = F(u.opt, u.textNode), u.textNode && P(u, "ontext", u.textNode), u.textNode = "";
2565
- }
2566
- function F(u, i) {
2567
- return u.trim && (i = i.trim()), u.normalize && (i = i.replace(/\s+/g, " ")), i;
2568
- }
2569
- function j(u, i) {
2570
- return C(u), u.trackPosition && (i += `
2571
- Line: ` + u.line + `
2572
- Column: ` + u.column + `
2573
- Char: ` + u.c), i = new Error(i), u.error = i, P(u, "onerror", i), u;
2574
- }
2575
- function X(u) {
2576
- return u.sawRoot && !u.closedRoot && S(u, "Unclosed root tag"), u.state !== r.BEGIN && u.state !== r.BEGIN_WHITESPACE && u.state !== r.TEXT && j(u, "Unexpected end"), C(u), u.c = "", u.closed = !0, P(u, "onend"), f.call(u, u.strict, u.opt), u;
2577
- }
2578
- function S(u, i) {
2579
- if (typeof u != "object" || !(u instanceof f))
2580
- throw new Error("bad call to strictFail");
2581
- u.strict && j(u, i);
2582
- }
2583
- function ar(u) {
2584
- u.strict || (u.tagName = u.tagName[u.looseCase]());
2585
- var i = u.tags[u.tags.length - 1] || u, A = u.tag = { name: u.tagName, attributes: {} };
2586
- u.opt.xmlns && (A.ns = i.ns), u.attribList.length = 0, M(u, "onopentagstart", A);
2587
- }
2588
- function qt(u, i) {
2589
- var A = u.indexOf(":"), T = A < 0 ? ["", u] : u.split(":"), R = T[0], q = T[1];
2590
- return i && u === "xmlns" && (R = "xmlns", q = ""), { prefix: R, local: q };
2591
- }
2592
- function Ut(u) {
2593
- if (u.strict || (u.attribName = u.attribName[u.looseCase]()), u.attribList.indexOf(u.attribName) !== -1 || u.tag.attributes.hasOwnProperty(u.attribName)) {
2594
- u.attribName = u.attribValue = "";
2595
- return;
2596
- }
2597
- if (u.opt.xmlns) {
2598
- var i = qt(u.attribName, !0), A = i.prefix, T = i.local;
2599
- if (A === "xmlns")
2600
- if (T === "xml" && u.attribValue !== w)
2601
- S(
2602
- u,
2603
- "xml: prefix must be bound to " + w + `
2604
- Actual: ` + u.attribValue
2605
- );
2606
- else if (T === "xmlns" && u.attribValue !== O)
2607
- S(
2608
- u,
2609
- "xmlns: prefix must be bound to " + O + `
2610
- Actual: ` + u.attribValue
2611
- );
2612
- else {
2613
- var R = u.tag, q = u.tags[u.tags.length - 1] || u;
2614
- R.ns === q.ns && (R.ns = Object.create(q.ns)), R.ns[T] = u.attribValue;
2615
- }
2616
- u.attribList.push([u.attribName, u.attribValue]);
2617
- } else
2618
- u.tag.attributes[u.attribName] = u.attribValue, M(u, "onattribute", {
2619
- name: u.attribName,
2620
- value: u.attribValue
2621
- });
2622
- u.attribName = u.attribValue = "";
2623
- }
2624
- function Z(u, i) {
2625
- if (u.opt.xmlns) {
2626
- var A = u.tag, T = qt(u.tagName);
2627
- A.prefix = T.prefix, A.local = T.local, A.uri = A.ns[T.prefix] || "", A.prefix && !A.uri && (S(u, "Unbound namespace prefix: " + JSON.stringify(u.tagName)), A.uri = T.prefix);
2628
- var R = u.tags[u.tags.length - 1] || u;
2629
- A.ns && R.ns !== A.ns && Object.keys(A.ns).forEach(function(le) {
2630
- M(u, "onopennamespace", {
2631
- prefix: le,
2632
- uri: A.ns[le]
2633
- });
2634
- });
2635
- for (var q = 0, U = u.attribList.length; q < U; q++) {
2636
- var k = u.attribList[q], $ = k[0], J = k[1], V = qt($, !0), z = V.prefix, fr = V.local, ce = z === "" ? "" : A.ns[z] || "", kt = {
2637
- name: $,
2638
- value: J,
2639
- prefix: z,
2640
- local: fr,
2641
- uri: ce
2642
- };
2643
- z && z !== "xmlns" && !ce && (S(u, "Unbound namespace prefix: " + JSON.stringify(z)), kt.uri = z), u.tag.attributes[$] = kt, M(u, "onattribute", kt);
2644
- }
2645
- u.attribList.length = 0;
2646
- }
2647
- u.tag.isSelfClosing = !!i, u.sawRoot = !0, u.tags.push(u.tag), M(u, "onopentag", u.tag), i || (!u.noscript && u.tagName.toLowerCase() === "script" ? u.state = r.SCRIPT : u.state = r.TEXT, u.tag = null, u.tagName = ""), u.attribName = u.attribValue = "", u.attribList.length = 0;
2648
- }
2649
- function Vt(u) {
2650
- if (!u.tagName) {
2651
- S(u, "Weird empty close tag."), u.textNode += "</>", u.state = r.TEXT;
2652
- return;
2653
- }
2654
- if (u.script) {
2655
- if (u.tagName !== "script") {
2656
- u.script += "</" + u.tagName + ">", u.tagName = "", u.state = r.SCRIPT;
2657
- return;
2658
- }
2659
- M(u, "onscript", u.script), u.script = "";
2660
- }
2661
- var i = u.tags.length, A = u.tagName;
2662
- u.strict || (A = A[u.looseCase]());
2663
- for (var T = A; i--; ) {
2664
- var R = u.tags[i];
2665
- if (R.name !== T)
2666
- S(u, "Unexpected close tag");
2667
- else
2668
- break;
2669
- }
2670
- if (i < 0) {
2671
- S(u, "Unmatched closing tag: " + u.tagName), u.textNode += "</" + u.tagName + ">", u.state = r.TEXT;
2672
- return;
2673
- }
2674
- u.tagName = A;
2675
- for (var q = u.tags.length; q-- > i; ) {
2676
- var U = u.tag = u.tags.pop();
2677
- u.tagName = u.tag.name, M(u, "onclosetag", u.tagName);
2678
- var k = {};
2679
- for (var $ in U.ns)
2680
- k[$] = U.ns[$];
2681
- var J = u.tags[u.tags.length - 1] || u;
2682
- u.opt.xmlns && U.ns !== J.ns && Object.keys(U.ns).forEach(function(V) {
2683
- var z = U.ns[V];
2684
- M(u, "onclosenamespace", { prefix: V, uri: z });
2685
- });
2686
- }
2687
- i === 0 && (u.closedRoot = !0), u.tagName = u.attribValue = u.attribName = "", u.attribList.length = 0, u.state = r.TEXT;
2688
- }
2689
- function cr(u) {
2690
- var i = u.entity, A = i.toLowerCase(), T, R = "";
2691
- return u.ENTITIES[i] ? u.ENTITIES[i] : u.ENTITIES[A] ? u.ENTITIES[A] : (i = A, i.charAt(0) === "#" && (i.charAt(1) === "x" ? (i = i.slice(2), T = parseInt(i, 16), R = T.toString(16)) : (i = i.slice(1), T = parseInt(i, 10), R = T.toString(10))), i = i.replace(/^0+/, ""), isNaN(T) || R.toLowerCase() !== i ? (S(u, "Invalid character entity"), "&" + u.entity + ";") : String.fromCodePoint(T));
2692
- }
2693
- function ue(u, i) {
2694
- i === "<" ? (u.state = r.OPEN_WAKA, u.startTagPosition = u.position) : c(i) || (S(u, "Non-whitespace before first tag."), u.textNode = i, u.state = r.TEXT);
2695
- }
2696
- function ae(u, i) {
2697
- var A = "";
2698
- return i < u.length && (A = u.charAt(i)), A;
2699
- }
2700
- function lr(u) {
2701
- var i = this;
2702
- if (this.error)
2703
- throw this.error;
2704
- if (i.closed)
2705
- return j(
2706
- i,
2707
- "Cannot write after close. Assign an onready handler."
2708
- );
2709
- if (u === null)
2710
- return X(i);
2711
- typeof u == "object" && (u = u.toString());
2712
- for (var A = 0, T = ""; T = ae(u, A++), i.c = T, !!T; )
2713
- switch (i.trackPosition && (i.position++, T === `
2714
- ` ? (i.line++, i.column = 0) : i.column++), i.state) {
2715
- case r.BEGIN:
2716
- if (i.state = r.BEGIN_WHITESPACE, T === "\uFEFF")
2717
- continue;
2718
- ue(i, T);
2719
- continue;
2720
- case r.BEGIN_WHITESPACE:
2721
- ue(i, T);
2722
- continue;
2723
- case r.TEXT:
2724
- if (i.sawRoot && !i.closedRoot) {
2725
- for (var R = A - 1; T && T !== "<" && T !== "&"; )
2726
- T = ae(u, A++), T && i.trackPosition && (i.position++, T === `
2727
- ` ? (i.line++, i.column = 0) : i.column++);
2728
- i.textNode += u.substring(R, A - 1);
2729
- }
2730
- T === "<" && !(i.sawRoot && i.closedRoot && !i.strict) ? (i.state = r.OPEN_WAKA, i.startTagPosition = i.position) : (!c(T) && (!i.sawRoot || i.closedRoot) && S(i, "Text data outside of root node."), T === "&" ? i.state = r.TEXT_ENTITY : i.textNode += T);
2731
- continue;
2732
- case r.SCRIPT:
2733
- T === "<" ? i.state = r.SCRIPT_ENDING : i.script += T;
2734
- continue;
2735
- case r.SCRIPT_ENDING:
2736
- T === "/" ? i.state = r.CLOSE_TAG : (i.script += "<" + T, i.state = r.SCRIPT);
2737
- continue;
2738
- case r.OPEN_WAKA:
2739
- if (T === "!")
2740
- i.state = r.SGML_DECL, i.sgmlDecl = "";
2741
- else if (!c(T)) if (L(x, T))
2742
- i.state = r.OPEN_TAG, i.tagName = T;
2743
- else if (T === "/")
2744
- i.state = r.CLOSE_TAG, i.tagName = "";
2745
- else if (T === "?")
2746
- i.state = r.PROC_INST, i.procInstName = i.procInstBody = "";
2747
- else {
2748
- if (S(i, "Unencoded <"), i.startTagPosition + 1 < i.position) {
2749
- var q = i.position - i.startTagPosition;
2750
- T = new Array(q).join(" ") + T;
2751
- }
2752
- i.textNode += "<" + T, i.state = r.TEXT;
2753
- }
2754
- continue;
2755
- case r.SGML_DECL:
2756
- if (i.sgmlDecl + T === "--") {
2757
- i.state = r.COMMENT, i.comment = "", i.sgmlDecl = "";
2758
- continue;
2759
- }
2760
- i.doctype && i.doctype !== !0 && i.sgmlDecl ? (i.state = r.DOCTYPE_DTD, i.doctype += "<!" + i.sgmlDecl + T, i.sgmlDecl = "") : (i.sgmlDecl + T).toUpperCase() === y ? (M(i, "onopencdata"), i.state = r.CDATA, i.sgmlDecl = "", i.cdata = "") : (i.sgmlDecl + T).toUpperCase() === d ? (i.state = r.DOCTYPE, (i.doctype || i.sawRoot) && S(
2761
- i,
2762
- "Inappropriately located doctype declaration"
2763
- ), i.doctype = "", i.sgmlDecl = "") : T === ">" ? (M(i, "onsgmldeclaration", i.sgmlDecl), i.sgmlDecl = "", i.state = r.TEXT) : (h(T) && (i.state = r.SGML_DECL_QUOTED), i.sgmlDecl += T);
2764
- continue;
2765
- case r.SGML_DECL_QUOTED:
2766
- T === i.q && (i.state = r.SGML_DECL, i.q = ""), i.sgmlDecl += T;
2767
- continue;
2768
- case r.DOCTYPE:
2769
- T === ">" ? (i.state = r.TEXT, M(i, "ondoctype", i.doctype), i.doctype = !0) : (i.doctype += T, T === "[" ? i.state = r.DOCTYPE_DTD : h(T) && (i.state = r.DOCTYPE_QUOTED, i.q = T));
2770
- continue;
2771
- case r.DOCTYPE_QUOTED:
2772
- i.doctype += T, T === i.q && (i.q = "", i.state = r.DOCTYPE);
2773
- continue;
2774
- case r.DOCTYPE_DTD:
2775
- T === "]" ? (i.doctype += T, i.state = r.DOCTYPE) : T === "<" ? (i.state = r.OPEN_WAKA, i.startTagPosition = i.position) : h(T) ? (i.doctype += T, i.state = r.DOCTYPE_DTD_QUOTED, i.q = T) : i.doctype += T;
2776
- continue;
2777
- case r.DOCTYPE_DTD_QUOTED:
2778
- i.doctype += T, T === i.q && (i.state = r.DOCTYPE_DTD, i.q = "");
2779
- continue;
2780
- case r.COMMENT:
2781
- T === "-" ? i.state = r.COMMENT_ENDING : i.comment += T;
2782
- continue;
2783
- case r.COMMENT_ENDING:
2784
- T === "-" ? (i.state = r.COMMENT_ENDED, i.comment = F(i.opt, i.comment), i.comment && M(i, "oncomment", i.comment), i.comment = "") : (i.comment += "-" + T, i.state = r.COMMENT);
2785
- continue;
2786
- case r.COMMENT_ENDED:
2787
- T !== ">" ? (S(i, "Malformed comment"), i.comment += "--" + T, i.state = r.COMMENT) : i.doctype && i.doctype !== !0 ? i.state = r.DOCTYPE_DTD : i.state = r.TEXT;
2788
- continue;
2789
- case r.CDATA:
2790
- T === "]" ? i.state = r.CDATA_ENDING : i.cdata += T;
2791
- continue;
2792
- case r.CDATA_ENDING:
2793
- T === "]" ? i.state = r.CDATA_ENDING_2 : (i.cdata += "]" + T, i.state = r.CDATA);
2794
- continue;
2795
- case r.CDATA_ENDING_2:
2796
- T === ">" ? (i.cdata && M(i, "oncdata", i.cdata), M(i, "onclosecdata"), i.cdata = "", i.state = r.TEXT) : T === "]" ? i.cdata += "]" : (i.cdata += "]]" + T, i.state = r.CDATA);
2797
- continue;
2798
- case r.PROC_INST:
2799
- T === "?" ? i.state = r.PROC_INST_ENDING : c(T) ? i.state = r.PROC_INST_BODY : i.procInstName += T;
2800
- continue;
2801
- case r.PROC_INST_BODY:
2802
- if (!i.procInstBody && c(T))
2803
- continue;
2804
- T === "?" ? i.state = r.PROC_INST_ENDING : i.procInstBody += T;
2805
- continue;
2806
- case r.PROC_INST_ENDING:
2807
- T === ">" ? (M(i, "onprocessinginstruction", {
2808
- name: i.procInstName,
2809
- body: i.procInstBody
2810
- }), i.procInstName = i.procInstBody = "", i.state = r.TEXT) : (i.procInstBody += "?" + T, i.state = r.PROC_INST_BODY);
2811
- continue;
2812
- case r.OPEN_TAG:
2813
- L(_, T) ? i.tagName += T : (ar(i), T === ">" ? Z(i) : T === "/" ? i.state = r.OPEN_TAG_SLASH : (c(T) || S(i, "Invalid character in tag name"), i.state = r.ATTRIB));
2814
- continue;
2815
- case r.OPEN_TAG_SLASH:
2816
- T === ">" ? (Z(i, !0), Vt(i)) : (S(i, "Forward-slash in opening tag not followed by >"), i.state = r.ATTRIB);
2817
- continue;
2818
- case r.ATTRIB:
2819
- if (c(T))
2820
- continue;
2821
- T === ">" ? Z(i) : T === "/" ? i.state = r.OPEN_TAG_SLASH : L(x, T) ? (i.attribName = T, i.attribValue = "", i.state = r.ATTRIB_NAME) : S(i, "Invalid attribute name");
2822
- continue;
2823
- case r.ATTRIB_NAME:
2824
- T === "=" ? i.state = r.ATTRIB_VALUE : T === ">" ? (S(i, "Attribute without value"), i.attribValue = i.attribName, Ut(i), Z(i)) : c(T) ? i.state = r.ATTRIB_NAME_SAW_WHITE : L(_, T) ? i.attribName += T : S(i, "Invalid attribute name");
2825
- continue;
2826
- case r.ATTRIB_NAME_SAW_WHITE:
2827
- if (T === "=")
2828
- i.state = r.ATTRIB_VALUE;
2829
- else {
2830
- if (c(T))
2831
- continue;
2832
- S(i, "Attribute without value"), i.tag.attributes[i.attribName] = "", i.attribValue = "", M(i, "onattribute", {
2833
- name: i.attribName,
2834
- value: ""
2835
- }), i.attribName = "", T === ">" ? Z(i) : L(x, T) ? (i.attribName = T, i.state = r.ATTRIB_NAME) : (S(i, "Invalid attribute name"), i.state = r.ATTRIB);
2836
- }
2837
- continue;
2838
- case r.ATTRIB_VALUE:
2839
- if (c(T))
2840
- continue;
2841
- h(T) ? (i.q = T, i.state = r.ATTRIB_VALUE_QUOTED) : (i.opt.unquotedAttributeValues || j(i, "Unquoted attribute value"), i.state = r.ATTRIB_VALUE_UNQUOTED, i.attribValue = T);
2842
- continue;
2843
- case r.ATTRIB_VALUE_QUOTED:
2844
- if (T !== i.q) {
2845
- T === "&" ? i.state = r.ATTRIB_VALUE_ENTITY_Q : i.attribValue += T;
2846
- continue;
2847
- }
2848
- Ut(i), i.q = "", i.state = r.ATTRIB_VALUE_CLOSED;
2849
- continue;
2850
- case r.ATTRIB_VALUE_CLOSED:
2851
- c(T) ? i.state = r.ATTRIB : T === ">" ? Z(i) : T === "/" ? i.state = r.OPEN_TAG_SLASH : L(x, T) ? (S(i, "No whitespace between attributes"), i.attribName = T, i.attribValue = "", i.state = r.ATTRIB_NAME) : S(i, "Invalid attribute name");
2852
- continue;
2853
- case r.ATTRIB_VALUE_UNQUOTED:
2854
- if (!D(T)) {
2855
- T === "&" ? i.state = r.ATTRIB_VALUE_ENTITY_U : i.attribValue += T;
2856
- continue;
2857
- }
2858
- Ut(i), T === ">" ? Z(i) : i.state = r.ATTRIB;
2859
- continue;
2860
- case r.CLOSE_TAG:
2861
- if (i.tagName)
2862
- T === ">" ? Vt(i) : L(_, T) ? i.tagName += T : i.script ? (i.script += "</" + i.tagName, i.tagName = "", i.state = r.SCRIPT) : (c(T) || S(i, "Invalid tagname in closing tag"), i.state = r.CLOSE_TAG_SAW_WHITE);
2863
- else {
2864
- if (c(T))
2865
- continue;
2866
- v(x, T) ? i.script ? (i.script += "</" + T, i.state = r.SCRIPT) : S(i, "Invalid tagname in closing tag.") : i.tagName = T;
2867
- }
2868
- continue;
2869
- case r.CLOSE_TAG_SAW_WHITE:
2870
- if (c(T))
2871
- continue;
2872
- T === ">" ? Vt(i) : S(i, "Invalid characters in closing tag");
2873
- continue;
2874
- case r.TEXT_ENTITY:
2875
- case r.ATTRIB_VALUE_ENTITY_Q:
2876
- case r.ATTRIB_VALUE_ENTITY_U:
2877
- var U, k;
2878
- switch (i.state) {
2879
- case r.TEXT_ENTITY:
2880
- U = r.TEXT, k = "textNode";
2881
- break;
2882
- case r.ATTRIB_VALUE_ENTITY_Q:
2883
- U = r.ATTRIB_VALUE_QUOTED, k = "attribValue";
2884
- break;
2885
- case r.ATTRIB_VALUE_ENTITY_U:
2886
- U = r.ATTRIB_VALUE_UNQUOTED, k = "attribValue";
2887
- break;
2888
- }
2889
- if (T === ";") {
2890
- var $ = cr(i);
2891
- i.opt.unparsedEntities && !Object.values(a.XML_ENTITIES).includes($) ? (i.entity = "", i.state = U, i.write($)) : (i[k] += $, i.entity = "", i.state = U);
2892
- } else L(i.entity.length ? s : E, T) ? i.entity += T : (S(i, "Invalid character in entity name"), i[k] += "&" + i.entity + T, i.entity = "", i.state = U);
2893
- continue;
2894
- default:
2895
- throw new Error(i, "Unknown state: " + i.state);
2896
- }
2897
- return i.position >= i.bufferCheckPosition && p(i), i;
2898
- }
2899
- /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */
2900
- String.fromCodePoint || function() {
2901
- var u = String.fromCharCode, i = Math.floor, A = function() {
2902
- var T = 16384, R = [], q, U, k = -1, $ = arguments.length;
2903
- if (!$)
2904
- return "";
2905
- for (var J = ""; ++k < $; ) {
2906
- var V = Number(arguments[k]);
2907
- if (!isFinite(V) || // `NaN`, `+Infinity`, or `-Infinity`
2908
- V < 0 || // not a valid Unicode code point
2909
- V > 1114111 || // not a valid Unicode code point
2910
- i(V) !== V)
2911
- throw RangeError("Invalid code point: " + V);
2912
- V <= 65535 ? R.push(V) : (V -= 65536, q = (V >> 10) + 55296, U = V % 1024 + 56320, R.push(q, U)), (k + 1 === $ || R.length > T) && (J += u.apply(null, R), R.length = 0);
2913
- }
2914
- return J;
2915
- };
2916
- Object.defineProperty ? Object.defineProperty(String, "fromCodePoint", {
2917
- value: A,
2918
- configurable: !0,
2919
- writable: !0
2920
- }) : String.fromCodePoint = A;
2921
- }();
2922
- })(n);
2923
- }($t)), $t;
2924
- }
2925
- var it = { exports: {} }, Ye;
2926
- function rn() {
2927
- if (Ye) return it.exports;
2928
- Ye = 1;
2929
- var n = typeof Reflect == "object" ? Reflect : null, a = n && typeof n.apply == "function" ? n.apply : function(h, D, L) {
2930
- return Function.prototype.apply.call(h, D, L);
2931
- }, g;
2932
- n && typeof n.ownKeys == "function" ? g = n.ownKeys : Object.getOwnPropertySymbols ? g = function(h) {
2933
- return Object.getOwnPropertyNames(h).concat(Object.getOwnPropertySymbols(h));
2934
- } : g = function(h) {
2935
- return Object.getOwnPropertyNames(h);
2936
- };
2937
- function f(c) {
2938
- console && console.warn && console.warn(c);
2939
- }
2940
- var p = Number.isNaN || function(h) {
2941
- return h !== h;
2942
- };
2943
- function t() {
2944
- t.init.call(this);
2945
- }
2946
- it.exports = t, it.exports.once = _, t.EventEmitter = t, t.prototype._events = void 0, t.prototype._eventsCount = 0, t.prototype._maxListeners = void 0;
2947
- var e = 10;
2948
- function o(c) {
2949
- if (typeof c != "function")
2950
- throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof c);
2951
- }
2952
- Object.defineProperty(t, "defaultMaxListeners", {
2953
- enumerable: !0,
2954
- get: function() {
2955
- return e;
2956
- },
2957
- set: function(c) {
2958
- if (typeof c != "number" || c < 0 || p(c))
2959
- throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + c + ".");
2960
- e = c;
2961
- }
2962
- }), t.init = function() {
2963
- (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
2964
- }, t.prototype.setMaxListeners = function(h) {
2965
- if (typeof h != "number" || h < 0 || p(h))
2966
- throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + h + ".");
2967
- return this._maxListeners = h, this;
2968
- };
2969
- function l(c) {
2970
- return c._maxListeners === void 0 ? t.defaultMaxListeners : c._maxListeners;
2971
- }
2972
- t.prototype.getMaxListeners = function() {
2973
- return l(this);
2974
- }, t.prototype.emit = function(h) {
2975
- for (var D = [], L = 1; L < arguments.length; L++) D.push(arguments[L]);
2976
- var v = h === "error", r = this._events;
2977
- if (r !== void 0)
2978
- v = v && r.error === void 0;
2979
- else if (!v)
2980
- return !1;
2981
- if (v) {
2982
- var N;
2983
- if (D.length > 0 && (N = D[0]), N instanceof Error)
2984
- throw N;
2985
- var P = new Error("Unhandled error." + (N ? " (" + N.message + ")" : ""));
2986
- throw P.context = N, P;
2987
- }
2988
- var M = r[h];
2989
- if (M === void 0)
2990
- return !1;
2991
- if (typeof M == "function")
2992
- a(M, this, D);
2993
- else
2994
- for (var C = M.length, F = O(M, C), L = 0; L < C; ++L)
2995
- a(F[L], this, D);
2996
- return !0;
2997
- };
2998
- function b(c, h, D, L) {
2999
- var v, r, N;
3000
- if (o(D), r = c._events, r === void 0 ? (r = c._events = /* @__PURE__ */ Object.create(null), c._eventsCount = 0) : (r.newListener !== void 0 && (c.emit(
3001
- "newListener",
3002
- h,
3003
- D.listener ? D.listener : D
3004
- ), r = c._events), N = r[h]), N === void 0)
3005
- N = r[h] = D, ++c._eventsCount;
3006
- else if (typeof N == "function" ? N = r[h] = L ? [D, N] : [N, D] : L ? N.unshift(D) : N.push(D), v = l(c), v > 0 && N.length > v && !N.warned) {
3007
- N.warned = !0;
3008
- var P = new Error("Possible EventEmitter memory leak detected. " + N.length + " " + String(h) + " listeners added. Use emitter.setMaxListeners() to increase limit");
3009
- P.name = "MaxListenersExceededWarning", P.emitter = c, P.type = h, P.count = N.length, f(P);
3010
- }
3011
- return c;
3012
- }
3013
- t.prototype.addListener = function(h, D) {
3014
- return b(this, h, D, !1);
3015
- }, t.prototype.on = t.prototype.addListener, t.prototype.prependListener = function(h, D) {
3016
- return b(this, h, D, !0);
3017
- };
3018
- function m() {
3019
- if (!this.fired)
3020
- return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
3021
- }
3022
- function y(c, h, D) {
3023
- var L = { fired: !1, wrapFn: void 0, target: c, type: h, listener: D }, v = m.bind(L);
3024
- return v.listener = D, L.wrapFn = v, v;
3025
- }
3026
- t.prototype.once = function(h, D) {
3027
- return o(D), this.on(h, y(this, h, D)), this;
3028
- }, t.prototype.prependOnceListener = function(h, D) {
3029
- return o(D), this.prependListener(h, y(this, h, D)), this;
3030
- }, t.prototype.removeListener = function(h, D) {
3031
- var L, v, r, N, P;
3032
- if (o(D), v = this._events, v === void 0)
3033
- return this;
3034
- if (L = v[h], L === void 0)
3035
- return this;
3036
- if (L === D || L.listener === D)
3037
- --this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : (delete v[h], v.removeListener && this.emit("removeListener", h, L.listener || D));
3038
- else if (typeof L != "function") {
3039
- for (r = -1, N = L.length - 1; N >= 0; N--)
3040
- if (L[N] === D || L[N].listener === D) {
3041
- P = L[N].listener, r = N;
3042
- break;
3043
- }
3044
- if (r < 0)
3045
- return this;
3046
- r === 0 ? L.shift() : I(L, r), L.length === 1 && (v[h] = L[0]), v.removeListener !== void 0 && this.emit("removeListener", h, P || D);
3047
- }
3048
- return this;
3049
- }, t.prototype.off = t.prototype.removeListener, t.prototype.removeAllListeners = function(h) {
3050
- var D, L, v;
3051
- if (L = this._events, L === void 0)
3052
- return this;
3053
- if (L.removeListener === void 0)
3054
- return arguments.length === 0 ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : L[h] !== void 0 && (--this._eventsCount === 0 ? this._events = /* @__PURE__ */ Object.create(null) : delete L[h]), this;
3055
- if (arguments.length === 0) {
3056
- var r = Object.keys(L), N;
3057
- for (v = 0; v < r.length; ++v)
3058
- N = r[v], N !== "removeListener" && this.removeAllListeners(N);
3059
- return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
3060
- }
3061
- if (D = L[h], typeof D == "function")
3062
- this.removeListener(h, D);
3063
- else if (D !== void 0)
3064
- for (v = D.length - 1; v >= 0; v--)
3065
- this.removeListener(h, D[v]);
3066
- return this;
3067
- };
3068
- function d(c, h, D) {
3069
- var L = c._events;
3070
- if (L === void 0)
3071
- return [];
3072
- var v = L[h];
3073
- return v === void 0 ? [] : typeof v == "function" ? D ? [v.listener || v] : [v] : D ? x(v) : O(v, v.length);
3074
- }
3075
- t.prototype.listeners = function(h) {
3076
- return d(this, h, !0);
3077
- }, t.prototype.rawListeners = function(h) {
3078
- return d(this, h, !1);
3079
- }, t.listenerCount = function(c, h) {
3080
- return typeof c.listenerCount == "function" ? c.listenerCount(h) : w.call(c, h);
3081
- }, t.prototype.listenerCount = w;
3082
- function w(c) {
3083
- var h = this._events;
3084
- if (h !== void 0) {
3085
- var D = h[c];
3086
- if (typeof D == "function")
3087
- return 1;
3088
- if (D !== void 0)
3089
- return D.length;
3090
- }
3091
- return 0;
3092
- }
3093
- t.prototype.eventNames = function() {
3094
- return this._eventsCount > 0 ? g(this._events) : [];
3095
- };
3096
- function O(c, h) {
3097
- for (var D = new Array(h), L = 0; L < h; ++L)
3098
- D[L] = c[L];
3099
- return D;
3100
- }
3101
- function I(c, h) {
3102
- for (; h + 1 < c.length; h++)
3103
- c[h] = c[h + 1];
3104
- c.pop();
3105
- }
3106
- function x(c) {
3107
- for (var h = new Array(c.length), D = 0; D < h.length; ++D)
3108
- h[D] = c[D].listener || c[D];
3109
- return h;
3110
- }
3111
- function _(c, h) {
3112
- return new Promise(function(D, L) {
3113
- function v(N) {
3114
- c.removeListener(h, r), L(N);
3115
- }
3116
- function r() {
3117
- typeof c.removeListener == "function" && c.removeListener("error", v), D([].slice.call(arguments));
3118
- }
3119
- s(c, h, r, { once: !0 }), h !== "error" && E(c, v, { once: !0 });
3120
- });
3121
- }
3122
- function E(c, h, D) {
3123
- typeof c.on == "function" && s(c, "error", h, D);
3124
- }
3125
- function s(c, h, D, L) {
3126
- if (typeof c.on == "function")
3127
- L.once ? c.once(h, D) : c.on(h, D);
3128
- else if (typeof c.addEventListener == "function")
3129
- c.addEventListener(h, function v(r) {
3130
- L.once && c.removeEventListener(h, v), D(r);
3131
- });
3132
- else
3133
- throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof c);
3134
- }
3135
- return it.exports;
3136
- }
3137
- var ot = {}, Ke;
3138
- function nn() {
3139
- return Ke || (Ke = 1, (function() {
3140
- ot.stripBOM = function(n) {
3141
- return n[0] === "\uFEFF" ? n.substring(1) : n;
3142
- };
3143
- }).call(ot)), ot;
3144
- }
3145
- var Q = {}, ze;
3146
- function or() {
3147
- return ze || (ze = 1, (function() {
3148
- var n;
3149
- n = new RegExp(/(?!xmlns)^.*:/), Q.normalize = function(a) {
3150
- return a.toLowerCase();
3151
- }, Q.firstCharLowerCase = function(a) {
3152
- return a.charAt(0).toLowerCase() + a.slice(1);
3153
- }, Q.stripPrefix = function(a) {
3154
- return a.replace(n, "");
3155
- }, Q.parseNumbers = function(a) {
3156
- return isNaN(a) || (a = a % 1 === 0 ? parseInt(a, 10) : parseFloat(a)), a;
3157
- }, Q.parseBooleans = function(a) {
3158
- return /^(?:true|false)$/i.test(a) && (a = a.toLowerCase() === "true"), a;
3159
- };
3160
- }).call(Q)), Q;
3161
- }
3162
- var He;
3163
- function on() {
3164
- return He || (He = 1, function(n) {
3165
- (function() {
3166
- var a, g, f, p, t, e, o, l, b, m = function(w, O) {
3167
- return function() {
3168
- return w.apply(O, arguments);
3169
- };
3170
- }, y = function(w, O) {
3171
- for (var I in O)
3172
- d.call(O, I) && (w[I] = O[I]);
3173
- function x() {
3174
- this.constructor = w;
3175
- }
3176
- return x.prototype = O.prototype, w.prototype = new x(), w.__super__ = O.prototype, w;
3177
- }, d = {}.hasOwnProperty;
3178
- l = en(), p = rn(), a = nn(), o = or(), b = Gt.setImmediate, g = Wt().defaults, t = function(w) {
3179
- return typeof w == "object" && w != null && Object.keys(w).length === 0;
3180
- }, e = function(w, O, I) {
3181
- var x, _, E;
3182
- for (x = 0, _ = w.length; x < _; x++)
3183
- E = w[x], O = E(O, I);
3184
- return O;
3185
- }, f = function(w, O, I) {
3186
- var x;
3187
- return x = /* @__PURE__ */ Object.create(null), x.value = I, x.writable = !0, x.enumerable = !0, x.configurable = !0, Object.defineProperty(w, O, x);
3188
- }, n.Parser = function(w) {
3189
- y(O, w);
3190
- function O(I) {
3191
- this.parseStringPromise = m(this.parseStringPromise, this), this.parseString = m(this.parseString, this), this.reset = m(this.reset, this), this.assignOrPush = m(this.assignOrPush, this), this.processAsync = m(this.processAsync, this);
3192
- var x, _, E;
3193
- if (!(this instanceof n.Parser))
3194
- return new n.Parser(I);
3195
- this.options = {}, _ = g["0.2"];
3196
- for (x in _)
3197
- d.call(_, x) && (E = _[x], this.options[x] = E);
3198
- for (x in I)
3199
- d.call(I, x) && (E = I[x], this.options[x] = E);
3200
- this.options.xmlns && (this.options.xmlnskey = this.options.attrkey + "ns"), this.options.normalizeTags && (this.options.tagNameProcessors || (this.options.tagNameProcessors = []), this.options.tagNameProcessors.unshift(o.normalize)), this.reset();
3201
- }
3202
- return O.prototype.processAsync = function() {
3203
- var I, x;
3204
- try {
3205
- return this.remaining.length <= this.options.chunkSize ? (I = this.remaining, this.remaining = "", this.saxParser = this.saxParser.write(I), this.saxParser.close()) : (I = this.remaining.substr(0, this.options.chunkSize), this.remaining = this.remaining.substr(this.options.chunkSize, this.remaining.length), this.saxParser = this.saxParser.write(I), b(this.processAsync));
3206
- } catch (_) {
3207
- if (x = _, !this.saxParser.errThrown)
3208
- return this.saxParser.errThrown = !0, this.emit(x);
3209
- }
3210
- }, O.prototype.assignOrPush = function(I, x, _) {
3211
- return x in I ? (I[x] instanceof Array || f(I, x, [I[x]]), I[x].push(_)) : this.options.explicitArray ? f(I, x, [_]) : f(I, x, _);
3212
- }, O.prototype.reset = function() {
3213
- var I, x, _, E;
3214
- return this.removeAllListeners(), this.saxParser = l.parser(this.options.strict, {
3215
- trim: !1,
3216
- normalize: !1,
3217
- xmlns: this.options.xmlns
3218
- }), this.saxParser.errThrown = !1, this.saxParser.onerror = /* @__PURE__ */ function(s) {
3219
- return function(c) {
3220
- if (s.saxParser.resume(), !s.saxParser.errThrown)
3221
- return s.saxParser.errThrown = !0, s.emit("error", c);
3222
- };
3223
- }(this), this.saxParser.onend = /* @__PURE__ */ function(s) {
3224
- return function() {
3225
- if (!s.saxParser.ended)
3226
- return s.saxParser.ended = !0, s.emit("end", s.resultObject);
3227
- };
3228
- }(this), this.saxParser.ended = !1, this.EXPLICIT_CHARKEY = this.options.explicitCharkey, this.resultObject = null, E = [], I = this.options.attrkey, x = this.options.charkey, this.saxParser.onopentag = /* @__PURE__ */ function(s) {
3229
- return function(c) {
3230
- var h, D, L, v, r;
3231
- if (L = {}, L[x] = "", !s.options.ignoreAttrs) {
3232
- r = c.attributes;
3233
- for (h in r)
3234
- d.call(r, h) && (!(I in L) && !s.options.mergeAttrs && (L[I] = {}), D = s.options.attrValueProcessors ? e(s.options.attrValueProcessors, c.attributes[h], h) : c.attributes[h], v = s.options.attrNameProcessors ? e(s.options.attrNameProcessors, h) : h, s.options.mergeAttrs ? s.assignOrPush(L, v, D) : f(L[I], v, D));
3235
- }
3236
- return L["#name"] = s.options.tagNameProcessors ? e(s.options.tagNameProcessors, c.name) : c.name, s.options.xmlns && (L[s.options.xmlnskey] = {
3237
- uri: c.uri,
3238
- local: c.local
3239
- }), E.push(L);
3240
- };
3241
- }(this), this.saxParser.onclosetag = /* @__PURE__ */ function(s) {
3242
- return function() {
3243
- var c, h, D, L, v, r, N, P, M, C;
3244
- if (r = E.pop(), v = r["#name"], (!s.options.explicitChildren || !s.options.preserveChildrenOrder) && delete r["#name"], r.cdata === !0 && (c = r.cdata, delete r.cdata), M = E[E.length - 1], r[x].match(/^\s*$/) && !c ? (h = r[x], delete r[x]) : (s.options.trim && (r[x] = r[x].trim()), s.options.normalize && (r[x] = r[x].replace(/\s{2,}/g, " ").trim()), r[x] = s.options.valueProcessors ? e(s.options.valueProcessors, r[x], v) : r[x], Object.keys(r).length === 1 && x in r && !s.EXPLICIT_CHARKEY && (r = r[x])), t(r) && (typeof s.options.emptyTag == "function" ? r = s.options.emptyTag() : r = s.options.emptyTag !== "" ? s.options.emptyTag : h), s.options.validator != null && (C = "/" + function() {
3245
- var F, j, X;
3246
- for (X = [], F = 0, j = E.length; F < j; F++)
3247
- L = E[F], X.push(L["#name"]);
3248
- return X;
3249
- }().concat(v).join("/"), function() {
3250
- var F;
3251
- try {
3252
- return r = s.options.validator(C, M && M[v], r);
3253
- } catch (j) {
3254
- return F = j, s.emit("error", F);
3255
- }
3256
- }()), s.options.explicitChildren && !s.options.mergeAttrs && typeof r == "object") {
3257
- if (!s.options.preserveChildrenOrder)
3258
- L = {}, s.options.attrkey in r && (L[s.options.attrkey] = r[s.options.attrkey], delete r[s.options.attrkey]), !s.options.charsAsChildren && s.options.charkey in r && (L[s.options.charkey] = r[s.options.charkey], delete r[s.options.charkey]), Object.getOwnPropertyNames(r).length > 0 && (L[s.options.childkey] = r), r = L;
3259
- else if (M) {
3260
- M[s.options.childkey] = M[s.options.childkey] || [], N = {};
3261
- for (D in r)
3262
- d.call(r, D) && f(N, D, r[D]);
3263
- M[s.options.childkey].push(N), delete r["#name"], Object.keys(r).length === 1 && x in r && !s.EXPLICIT_CHARKEY && (r = r[x]);
3264
- }
3265
- }
3266
- return E.length > 0 ? s.assignOrPush(M, v, r) : (s.options.explicitRoot && (P = r, r = {}, f(r, v, P)), s.resultObject = r, s.saxParser.ended = !0, s.emit("end", s.resultObject));
3267
- };
3268
- }(this), _ = /* @__PURE__ */ function(s) {
3269
- return function(c) {
3270
- var h, D;
3271
- if (D = E[E.length - 1], D)
3272
- return D[x] += c, s.options.explicitChildren && s.options.preserveChildrenOrder && s.options.charsAsChildren && (s.options.includeWhiteChars || c.replace(/\\n/g, "").trim() !== "") && (D[s.options.childkey] = D[s.options.childkey] || [], h = {
3273
- "#name": "__text__"
3274
- }, h[x] = c, s.options.normalize && (h[x] = h[x].replace(/\s{2,}/g, " ").trim()), D[s.options.childkey].push(h)), D;
3275
- };
3276
- }(this), this.saxParser.ontext = _, this.saxParser.oncdata = /* @__PURE__ */ function(s) {
3277
- return function(c) {
3278
- var h;
3279
- if (h = _(c), h)
3280
- return h.cdata = !0;
3281
- };
3282
- }();
3283
- }, O.prototype.parseString = function(I, x) {
3284
- var _;
3285
- x != null && typeof x == "function" && (this.on("end", function(E) {
3286
- return this.reset(), x(null, E);
3287
- }), this.on("error", function(E) {
3288
- return this.reset(), x(E);
3289
- }));
3290
- try {
3291
- return I = I.toString(), I.trim() === "" ? (this.emit("end", null), !0) : (I = a.stripBOM(I), this.options.async ? (this.remaining = I, b(this.processAsync), this.saxParser) : this.saxParser.write(I).close());
3292
- } catch (E) {
3293
- if (_ = E, this.saxParser.errThrown || this.saxParser.ended) {
3294
- if (this.saxParser.ended)
3295
- throw _;
3296
- } else return this.emit("error", _), this.saxParser.errThrown = !0;
3297
- }
3298
- }, O.prototype.parseStringPromise = function(I) {
3299
- return new Promise(/* @__PURE__ */ function(x) {
3300
- return function(_, E) {
3301
- return x.parseString(I, function(s, c) {
3302
- return s ? E(s) : _(c);
3303
- });
3304
- };
3305
- }(this));
3306
- }, O;
3307
- }(p), n.parseString = function(w, O, I) {
3308
- var x, _, E;
3309
- return I != null ? (typeof I == "function" && (x = I), typeof O == "object" && (_ = O)) : (typeof O == "function" && (x = O), _ = {}), E = new n.Parser(_), E.parseString(w, x);
3310
- }, n.parseStringPromise = function(w, O) {
3311
- var I, x;
3312
- return typeof O == "object" && (I = O), x = new n.Parser(I), x.parseStringPromise(w);
3313
- };
3314
- }).call(nt);
3315
- }(nt)), nt;
3316
- }
3317
- var Qe;
3318
- function sn() {
3319
- return Qe || (Qe = 1, (function() {
3320
- var n, a, g, f, p = function(e, o) {
3321
- for (var l in o)
3322
- t.call(o, l) && (e[l] = o[l]);
3323
- function b() {
3324
- this.constructor = e;
3325
- }
3326
- return b.prototype = o.prototype, e.prototype = new b(), e.__super__ = o.prototype, e;
3327
- }, t = {}.hasOwnProperty;
3328
- a = Wt(), n = Zr(), g = on(), f = or(), W.defaults = a.defaults, W.processors = f, W.ValidationError = function(e) {
3329
- p(o, e);
3330
- function o(l) {
3331
- this.message = l;
3332
- }
3333
- return o;
3334
- }(Error), W.Builder = n.Builder, W.Parser = g.Parser, W.parseString = g.parseString, W.parseStringPromise = g.parseStringPromise;
3335
- }).call(W)), W;
3336
- }
3337
- var Ze = sn();
3338
- const un = (n) => n !== null && typeof n == "object" && n.hasOwnProperty("rss") && typeof n.rss == "object" && n.rss !== null && n.rss.hasOwnProperty("channel") && Array.isArray(n.rss.channel), an = (n) => typeof n == "object" && n !== null && n.hasOwnProperty("title") && Array.isArray(n.title) && n.hasOwnProperty("description") && Array.isArray(n.description) && n.hasOwnProperty("link") && Array.isArray(n.link) && n.hasOwnProperty("image") && Array.isArray(n.image) && n.image.every(cn) && n.hasOwnProperty("generator") && Array.isArray(n.generator) && n.hasOwnProperty("lastBuildDate") && Array.isArray(n.lastBuildDate) && n.hasOwnProperty("atom:link") && Array.isArray(n["atom:link"]) && n["atom:link"].every(ln) && n.hasOwnProperty("copyright") && Array.isArray(n.copyright) && n.hasOwnProperty("language") && Array.isArray(n.language) && n.hasOwnProperty("webMaster") && Array.isArray(n.webMaster) && n.hasOwnProperty("itunes:owner") && Array.isArray(n["itunes:owner"]) && n["itunes:owner"].every(fn) && n.hasOwnProperty("itunes:author") && Array.isArray(n["itunes:author"]) && n.hasOwnProperty("googleplay:owner") && Array.isArray(n["googleplay:owner"]) && n.hasOwnProperty("googleplay:email") && Array.isArray(n["googleplay:email"]) && n.hasOwnProperty("googleplay:author") && Array.isArray(n["googleplay:author"]) && n.hasOwnProperty("item") && Array.isArray(n.item) && n.item.every(hn), cn = (n) => typeof n == "object" && n !== null && n.hasOwnProperty("url") && Array.isArray(n.url) && n.hasOwnProperty("title") && Array.isArray(n.title) && n.hasOwnProperty("link") && Array.isArray(n.link), ln = (n) => typeof n == "object" && n !== null && n.hasOwnProperty("$") && typeof n.$ == "object" && n.$ !== null && n.$.hasOwnProperty("href") && typeof n.$.href == "string" && n.$.hasOwnProperty("rel") && typeof n.$.rel == "string" && n.$.hasOwnProperty("type") && typeof n.$.type == "string", fn = (n) => typeof n == "object" && n !== null && n.hasOwnProperty("itunes:email") && Array.isArray(n["itunes:email"]) && n.hasOwnProperty("itunes:name") && Array.isArray(n["itunes:name"]), hn = (n) => typeof n == "object" && n !== null && n.hasOwnProperty("title") && Array.isArray(n.title) && n.hasOwnProperty("description") && Array.isArray(n.description) && n.hasOwnProperty("link") && Array.isArray(n.link) && n.hasOwnProperty("guid") && Array.isArray(n.guid) && n.guid.every(pn) && n.hasOwnProperty("dc:creator") && Array.isArray(n["dc:creator"]) && n.hasOwnProperty("pubDate") && Array.isArray(n.pubDate) && n.hasOwnProperty("enclosure") && Array.isArray(n.enclosure) && n.enclosure.every(dn) && n.hasOwnProperty("content:encoded") && Array.isArray(n["content:encoded"]), pn = (n) => typeof n == "object" && n !== null && n.hasOwnProperty("_") && typeof n._ == "string" && n.hasOwnProperty("$") && typeof n.$ == "object" && n.$ !== null && n.$.hasOwnProperty("isPermaLink") && typeof n.$.isPermaLink == "string", dn = (n) => typeof n == "object" && n !== null && n.hasOwnProperty("$") && typeof n.$ == "object" && n.$ !== null && n.$.hasOwnProperty("url") && typeof n.$.url == "string" && n.$.hasOwnProperty("length") && typeof n.$.length == "string" && n.$.hasOwnProperty("type") && typeof n.$.type == "string", yn = (n) => n && n.contents && n.status.http_code == 200, mn = (n) => n !== null && typeof n == "object" && n.hasOwnProperty("rss"), gn = (n) => typeof n == "object" && n !== null && n.hasOwnProperty("channel"), wn = (n) => typeof n == "object" && n !== null && n.hasOwnProperty("title") && n.hasOwnProperty("item"), sr = (n) => typeof n == "object" && n !== null && n.hasOwnProperty("title") && n.hasOwnProperty("link") && n.hasOwnProperty("book_image_url") && n.hasOwnProperty("book_large_image_url") && n.hasOwnProperty("author_name") && n.hasOwnProperty("book_description"), Tn = (n) => typeof n == "object" && n !== null && n.hasOwnProperty("contents") && n.hasOwnProperty("status"), ur = "https://lol-origin-84f24d4beb26.herokuapp.com/get?url=", tt = typeof document < "u", Dn = async (n) => {
3339
- try {
3340
- const a = tt ? `${ur}${encodeURIComponent(n)}` : n, g = await fetch(a);
3341
- if (g.ok) return tt ? g.json() : g.text();
3342
- } catch (a) {
3343
- throw console.error(a), new Error("Error occurred fetching Feed from Substack");
3344
- }
3345
- }, Rt = async (n = "", a) => {
3346
- if (!a) return Ze.parseStringPromise(n);
3347
- Ze.parseString(n, a);
3348
- }, En = (n) => ({
3349
- title: n.title[0],
3350
- description: n.description[0],
3351
- link: n.link[0],
3352
- pubDate: n.pubDate[0],
3353
- content: n["content:encoded"][0]
3354
- }), Nn = async (n, a) => {
3355
- const g = await Dn(n);
3356
- if (!tt)
3357
- return Rt(g, a);
3358
- if (!yn(g))
3359
- throw new Error("Error occurred fetching Feed from Substack");
3360
- await Rt(g.contents, a);
3361
- }, vn = (n, a) => {
3362
- if (!un(n)) throw new Error("Feed is not in the correct format");
3363
- try {
3364
- return n.rss.channel.filter(an).filter((g) => g.link[0] === a);
3365
- } catch (g) {
3366
- const f = new Error(`Error occurred fetching Feed by Link: ${a}`);
3367
- throw f.cause = g, f;
3368
- }
3369
- }, Ln = (n) => n[0].item.map(En), bn = (n) => {
3370
- if (!sr(n))
3371
- throw new Error("Goodreads item is not in the correct format");
3372
- return {
3373
- title: n.title[0],
3374
- link: n.link[0],
3375
- book_image_url: n.book_large_image_url[0],
3376
- author_name: n.author_name[0],
3377
- book_description: n.book_description[0]
3378
- };
3379
- }, On = async (n, a) => {
3380
- try {
3381
- const g = tt ? `${a ?? ur}${encodeURIComponent(n)}` : n, f = await fetch(g);
3382
- if (f.ok) return tt ? f.json() : f.text();
3383
- } catch (g) {
3384
- throw console.error(g), new Error("Error occurred fetching Feed from Goodreads");
3385
- }
3386
- }, In = async (n, a, g) => {
3387
- const f = await On(n, g);
3388
- if (!tt)
3389
- return Rt(f, a);
3390
- if (!Tn(f))
3391
- throw new Error("Error occurred fetching Feed from Goodreads");
3392
- await Rt(f.contents, a);
3393
- }, xn = (n) => {
3394
- if (!mn(n))
3395
- throw new Error("Goodreads feed is not in the correct format");
3396
- if (!gn(n.rss))
3397
- throw new Error("Goodreads RSS feed is not in the correct format");
3398
- const a = n.rss.channel.filter(wn);
3399
- if (a.length === 0)
3400
- throw new Error("Goodreads feed does not contain any channels");
3401
- const g = a[0];
3402
- return Array.isArray(g.item) ? g.item.filter(sr).map(bn) : [];
1
+ import { parseRssItems as o } from "./substackFeedApi3.js";
2
+ const a = [
3
+ "IS_READING",
4
+ "FINISHED",
5
+ "WANTS_TO_READ"
6
+ ], n = {
7
+ title: "title",
8
+ description: "book_description",
9
+ cover: "book_large_image_url",
10
+ author: "author_name",
11
+ shelves: "user_shelves"
3403
12
  };
13
+ function c(t) {
14
+ return t.includes("currently-reading") ? "IS_READING" : t.includes("read") ? "FINISHED" : "WANTS_TO_READ";
15
+ }
16
+ function l(t, r = {}) {
17
+ const s = {
18
+ ...n,
19
+ ...r.selectors ?? {}
20
+ };
21
+ return o(t, {
22
+ ...r,
23
+ selectors: s
24
+ }).map(
25
+ (e) => ({
26
+ status: c(e.shelves),
27
+ book: {
28
+ title: e.title,
29
+ description: e.description,
30
+ cover: e.cover,
31
+ authors: e.author ? [{ name: e.author }] : []
32
+ }
33
+ })
34
+ );
35
+ }
3404
36
  export {
3405
- vn as getFeedByLink,
3406
- In as getGoodreadsFeed,
3407
- xn as getGoodreadsFeedItems,
3408
- Ln as getPosts,
3409
- Nn as getSubstackFeed
37
+ a as READING_STATES,
38
+ l as parseGoodreadsRss
3410
39
  };