@loaders.gl/wms 3.3.0-alpha.8

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.
@@ -0,0 +1,1686 @@
1
+ (() => {
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
9
+ var __esm = (fn, res) => function __init() {
10
+ return fn && (res = (0, fn[Object.keys(fn)[0]])(fn = 0)), res;
11
+ };
12
+ var __commonJS = (cb, mod) => function __require() {
13
+ return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
14
+ };
15
+ var __export = (target, all) => {
16
+ __markAsModule(target);
17
+ for (var name in all)
18
+ __defProp(target, name, { get: all[name], enumerable: true });
19
+ };
20
+ var __reExport = (target, module, desc) => {
21
+ if (module && typeof module === "object" || typeof module === "function") {
22
+ for (let key of __getOwnPropNames(module))
23
+ if (!__hasOwnProp.call(target, key) && key !== "default")
24
+ __defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
25
+ }
26
+ return target;
27
+ };
28
+ var __toModule = (module) => {
29
+ return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module);
30
+ };
31
+
32
+ // ../xml/node_modules/fast-xml-parser/src/util.js
33
+ var require_util = __commonJS({
34
+ "../xml/node_modules/fast-xml-parser/src/util.js"(exports) {
35
+ "use strict";
36
+ var nameStartChar = ":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";
37
+ var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
38
+ var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*";
39
+ var regexName = new RegExp("^" + nameRegexp + "$");
40
+ var getAllMatches = function(string, regex) {
41
+ const matches = [];
42
+ let match = regex.exec(string);
43
+ while (match) {
44
+ const allmatches = [];
45
+ allmatches.startIndex = regex.lastIndex - match[0].length;
46
+ const len = match.length;
47
+ for (let index = 0; index < len; index++) {
48
+ allmatches.push(match[index]);
49
+ }
50
+ matches.push(allmatches);
51
+ match = regex.exec(string);
52
+ }
53
+ return matches;
54
+ };
55
+ var isName = function(string) {
56
+ const match = regexName.exec(string);
57
+ return !(match === null || typeof match === "undefined");
58
+ };
59
+ exports.isExist = function(v) {
60
+ return typeof v !== "undefined";
61
+ };
62
+ exports.isEmptyObject = function(obj) {
63
+ return Object.keys(obj).length === 0;
64
+ };
65
+ exports.merge = function(target, a, arrayMode) {
66
+ if (a) {
67
+ const keys = Object.keys(a);
68
+ const len = keys.length;
69
+ for (let i = 0; i < len; i++) {
70
+ if (arrayMode === "strict") {
71
+ target[keys[i]] = [a[keys[i]]];
72
+ } else {
73
+ target[keys[i]] = a[keys[i]];
74
+ }
75
+ }
76
+ }
77
+ };
78
+ exports.getValue = function(v) {
79
+ if (exports.isExist(v)) {
80
+ return v;
81
+ } else {
82
+ return "";
83
+ }
84
+ };
85
+ exports.isName = isName;
86
+ exports.getAllMatches = getAllMatches;
87
+ exports.nameRegexp = nameRegexp;
88
+ }
89
+ });
90
+
91
+ // ../xml/node_modules/fast-xml-parser/src/validator.js
92
+ var require_validator = __commonJS({
93
+ "../xml/node_modules/fast-xml-parser/src/validator.js"(exports) {
94
+ "use strict";
95
+ var util = require_util();
96
+ var defaultOptions = {
97
+ allowBooleanAttributes: false,
98
+ unpairedTags: []
99
+ };
100
+ exports.validate = function(xmlData, options) {
101
+ options = Object.assign({}, defaultOptions, options);
102
+ const tags = [];
103
+ let tagFound = false;
104
+ let reachedRoot = false;
105
+ if (xmlData[0] === "\uFEFF") {
106
+ xmlData = xmlData.substr(1);
107
+ }
108
+ for (let i = 0; i < xmlData.length; i++) {
109
+ if (xmlData[i] === "<" && xmlData[i + 1] === "?") {
110
+ i += 2;
111
+ i = readPI(xmlData, i);
112
+ if (i.err)
113
+ return i;
114
+ } else if (xmlData[i] === "<") {
115
+ let tagStartPos = i;
116
+ i++;
117
+ if (xmlData[i] === "!") {
118
+ i = readCommentAndCDATA(xmlData, i);
119
+ continue;
120
+ } else {
121
+ let closingTag = false;
122
+ if (xmlData[i] === "/") {
123
+ closingTag = true;
124
+ i++;
125
+ }
126
+ let tagName = "";
127
+ for (; i < xmlData.length && xmlData[i] !== ">" && xmlData[i] !== " " && xmlData[i] !== " " && xmlData[i] !== "\n" && xmlData[i] !== "\r"; i++) {
128
+ tagName += xmlData[i];
129
+ }
130
+ tagName = tagName.trim();
131
+ if (tagName[tagName.length - 1] === "/") {
132
+ tagName = tagName.substring(0, tagName.length - 1);
133
+ i--;
134
+ }
135
+ if (!validateTagName(tagName)) {
136
+ let msg;
137
+ if (tagName.trim().length === 0) {
138
+ msg = "Invalid space after '<'.";
139
+ } else {
140
+ msg = "Tag '" + tagName + "' is an invalid name.";
141
+ }
142
+ return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i));
143
+ }
144
+ const result = readAttributeStr(xmlData, i);
145
+ if (result === false) {
146
+ return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData, i));
147
+ }
148
+ let attrStr = result.value;
149
+ i = result.index;
150
+ if (attrStr[attrStr.length - 1] === "/") {
151
+ const attrStrStart = i - attrStr.length;
152
+ attrStr = attrStr.substring(0, attrStr.length - 1);
153
+ const isValid = validateAttributeString(attrStr, options);
154
+ if (isValid === true) {
155
+ tagFound = true;
156
+ } else {
157
+ return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line));
158
+ }
159
+ } else if (closingTag) {
160
+ if (!result.tagClosed) {
161
+ return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' doesn't have proper closing.", getLineNumberForPosition(xmlData, i));
162
+ } else if (attrStr.trim().length > 0) {
163
+ return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos));
164
+ } else {
165
+ const otg = tags.pop();
166
+ if (tagName !== otg.tagName) {
167
+ let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos);
168
+ return getErrorObject("InvalidTag", "Expected closing tag '" + otg.tagName + "' (opened in line " + openPos.line + ", col " + openPos.col + ") instead of closing tag '" + tagName + "'.", getLineNumberForPosition(xmlData, tagStartPos));
169
+ }
170
+ if (tags.length == 0) {
171
+ reachedRoot = true;
172
+ }
173
+ }
174
+ } else {
175
+ const isValid = validateAttributeString(attrStr, options);
176
+ if (isValid !== true) {
177
+ return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line));
178
+ }
179
+ if (reachedRoot === true) {
180
+ return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i));
181
+ } else if (options.unpairedTags.indexOf(tagName) !== -1) {
182
+ } else {
183
+ tags.push({ tagName, tagStartPos });
184
+ }
185
+ tagFound = true;
186
+ }
187
+ for (i++; i < xmlData.length; i++) {
188
+ if (xmlData[i] === "<") {
189
+ if (xmlData[i + 1] === "!") {
190
+ i++;
191
+ i = readCommentAndCDATA(xmlData, i);
192
+ continue;
193
+ } else if (xmlData[i + 1] === "?") {
194
+ i = readPI(xmlData, ++i);
195
+ if (i.err)
196
+ return i;
197
+ } else {
198
+ break;
199
+ }
200
+ } else if (xmlData[i] === "&") {
201
+ const afterAmp = validateAmpersand(xmlData, i);
202
+ if (afterAmp == -1)
203
+ return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData, i));
204
+ i = afterAmp;
205
+ } else {
206
+ if (reachedRoot === true && !isWhiteSpace(xmlData[i])) {
207
+ return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData, i));
208
+ }
209
+ }
210
+ }
211
+ if (xmlData[i] === "<") {
212
+ i--;
213
+ }
214
+ }
215
+ } else {
216
+ if (isWhiteSpace(xmlData[i])) {
217
+ continue;
218
+ }
219
+ return getErrorObject("InvalidChar", "char '" + xmlData[i] + "' is not expected.", getLineNumberForPosition(xmlData, i));
220
+ }
221
+ }
222
+ if (!tagFound) {
223
+ return getErrorObject("InvalidXml", "Start tag expected.", 1);
224
+ } else if (tags.length == 1) {
225
+ return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos));
226
+ } else if (tags.length > 0) {
227
+ return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
228
+ }
229
+ return true;
230
+ };
231
+ function isWhiteSpace(char) {
232
+ return char === " " || char === " " || char === "\n" || char === "\r";
233
+ }
234
+ function readPI(xmlData, i) {
235
+ const start = i;
236
+ for (; i < xmlData.length; i++) {
237
+ if (xmlData[i] == "?" || xmlData[i] == " ") {
238
+ const tagname = xmlData.substr(start, i - start);
239
+ if (i > 5 && tagname === "xml") {
240
+ return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData, i));
241
+ } else if (xmlData[i] == "?" && xmlData[i + 1] == ">") {
242
+ i++;
243
+ break;
244
+ } else {
245
+ continue;
246
+ }
247
+ }
248
+ }
249
+ return i;
250
+ }
251
+ function readCommentAndCDATA(xmlData, i) {
252
+ if (xmlData.length > i + 5 && xmlData[i + 1] === "-" && xmlData[i + 2] === "-") {
253
+ for (i += 3; i < xmlData.length; i++) {
254
+ if (xmlData[i] === "-" && xmlData[i + 1] === "-" && xmlData[i + 2] === ">") {
255
+ i += 2;
256
+ break;
257
+ }
258
+ }
259
+ } else if (xmlData.length > i + 8 && xmlData[i + 1] === "D" && xmlData[i + 2] === "O" && xmlData[i + 3] === "C" && xmlData[i + 4] === "T" && xmlData[i + 5] === "Y" && xmlData[i + 6] === "P" && xmlData[i + 7] === "E") {
260
+ let angleBracketsCount = 1;
261
+ for (i += 8; i < xmlData.length; i++) {
262
+ if (xmlData[i] === "<") {
263
+ angleBracketsCount++;
264
+ } else if (xmlData[i] === ">") {
265
+ angleBracketsCount--;
266
+ if (angleBracketsCount === 0) {
267
+ break;
268
+ }
269
+ }
270
+ }
271
+ } else if (xmlData.length > i + 9 && xmlData[i + 1] === "[" && xmlData[i + 2] === "C" && xmlData[i + 3] === "D" && xmlData[i + 4] === "A" && xmlData[i + 5] === "T" && xmlData[i + 6] === "A" && xmlData[i + 7] === "[") {
272
+ for (i += 8; i < xmlData.length; i++) {
273
+ if (xmlData[i] === "]" && xmlData[i + 1] === "]" && xmlData[i + 2] === ">") {
274
+ i += 2;
275
+ break;
276
+ }
277
+ }
278
+ }
279
+ return i;
280
+ }
281
+ var doubleQuote = '"';
282
+ var singleQuote = "'";
283
+ function readAttributeStr(xmlData, i) {
284
+ let attrStr = "";
285
+ let startChar = "";
286
+ let tagClosed = false;
287
+ for (; i < xmlData.length; i++) {
288
+ if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) {
289
+ if (startChar === "") {
290
+ startChar = xmlData[i];
291
+ } else if (startChar !== xmlData[i]) {
292
+ } else {
293
+ startChar = "";
294
+ }
295
+ } else if (xmlData[i] === ">") {
296
+ if (startChar === "") {
297
+ tagClosed = true;
298
+ break;
299
+ }
300
+ }
301
+ attrStr += xmlData[i];
302
+ }
303
+ if (startChar !== "") {
304
+ return false;
305
+ }
306
+ return {
307
+ value: attrStr,
308
+ index: i,
309
+ tagClosed
310
+ };
311
+ }
312
+ var validAttrStrRegxp = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
313
+ function validateAttributeString(attrStr, options) {
314
+ const matches = util.getAllMatches(attrStr, validAttrStrRegxp);
315
+ const attrNames = {};
316
+ for (let i = 0; i < matches.length; i++) {
317
+ if (matches[i][1].length === 0) {
318
+ return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' has no space in starting.", getPositionFromMatch(matches[i]));
319
+ } else if (matches[i][3] !== void 0 && matches[i][4] === void 0) {
320
+ return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' is without value.", getPositionFromMatch(matches[i]));
321
+ } else if (matches[i][3] === void 0 && !options.allowBooleanAttributes) {
322
+ return getErrorObject("InvalidAttr", "boolean attribute '" + matches[i][2] + "' is not allowed.", getPositionFromMatch(matches[i]));
323
+ }
324
+ const attrName = matches[i][2];
325
+ if (!validateAttrName(attrName)) {
326
+ return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i]));
327
+ }
328
+ if (!attrNames.hasOwnProperty(attrName)) {
329
+ attrNames[attrName] = 1;
330
+ } else {
331
+ return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i]));
332
+ }
333
+ }
334
+ return true;
335
+ }
336
+ function validateNumberAmpersand(xmlData, i) {
337
+ let re = /\d/;
338
+ if (xmlData[i] === "x") {
339
+ i++;
340
+ re = /[\da-fA-F]/;
341
+ }
342
+ for (; i < xmlData.length; i++) {
343
+ if (xmlData[i] === ";")
344
+ return i;
345
+ if (!xmlData[i].match(re))
346
+ break;
347
+ }
348
+ return -1;
349
+ }
350
+ function validateAmpersand(xmlData, i) {
351
+ i++;
352
+ if (xmlData[i] === ";")
353
+ return -1;
354
+ if (xmlData[i] === "#") {
355
+ i++;
356
+ return validateNumberAmpersand(xmlData, i);
357
+ }
358
+ let count = 0;
359
+ for (; i < xmlData.length; i++, count++) {
360
+ if (xmlData[i].match(/\w/) && count < 20)
361
+ continue;
362
+ if (xmlData[i] === ";")
363
+ break;
364
+ return -1;
365
+ }
366
+ return i;
367
+ }
368
+ function getErrorObject(code, message, lineNumber) {
369
+ return {
370
+ err: {
371
+ code,
372
+ msg: message,
373
+ line: lineNumber.line || lineNumber,
374
+ col: lineNumber.col
375
+ }
376
+ };
377
+ }
378
+ function validateAttrName(attrName) {
379
+ return util.isName(attrName);
380
+ }
381
+ function validateTagName(tagname) {
382
+ return util.isName(tagname);
383
+ }
384
+ function getLineNumberForPosition(xmlData, index) {
385
+ const lines = xmlData.substring(0, index).split(/\r?\n/);
386
+ return {
387
+ line: lines.length,
388
+ col: lines[lines.length - 1].length + 1
389
+ };
390
+ }
391
+ function getPositionFromMatch(match) {
392
+ return match.startIndex + match[1].length;
393
+ }
394
+ }
395
+ });
396
+
397
+ // ../xml/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js
398
+ var require_OptionsBuilder = __commonJS({
399
+ "../xml/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js"(exports) {
400
+ var defaultOptions = {
401
+ preserveOrder: false,
402
+ attributeNamePrefix: "@_",
403
+ attributesGroupName: false,
404
+ textNodeName: "#text",
405
+ ignoreAttributes: true,
406
+ removeNSPrefix: false,
407
+ allowBooleanAttributes: false,
408
+ parseTagValue: true,
409
+ parseAttributeValue: false,
410
+ trimValues: true,
411
+ cdataPropName: false,
412
+ numberParseOptions: {
413
+ hex: true,
414
+ leadingZeros: true
415
+ },
416
+ tagValueProcessor: function(tagName, val) {
417
+ return val;
418
+ },
419
+ attributeValueProcessor: function(attrName, val) {
420
+ return val;
421
+ },
422
+ stopNodes: [],
423
+ alwaysCreateTextNode: false,
424
+ isArray: () => false,
425
+ commentPropName: false,
426
+ unpairedTags: [],
427
+ processEntities: true,
428
+ htmlEntities: false,
429
+ ignoreDeclaration: false,
430
+ ignorePiTags: false,
431
+ transformTagName: false
432
+ };
433
+ var buildOptions = function(options) {
434
+ return Object.assign({}, defaultOptions, options);
435
+ };
436
+ exports.buildOptions = buildOptions;
437
+ exports.defaultOptions = defaultOptions;
438
+ }
439
+ });
440
+
441
+ // ../xml/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js
442
+ var require_xmlNode = __commonJS({
443
+ "../xml/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js"(exports, module) {
444
+ "use strict";
445
+ var XmlNode = class {
446
+ constructor(tagname) {
447
+ this.tagname = tagname;
448
+ this.child = [];
449
+ this[":@"] = {};
450
+ }
451
+ add(key, val) {
452
+ this.child.push({ [key]: val });
453
+ }
454
+ addChild(node) {
455
+ if (node[":@"] && Object.keys(node[":@"]).length > 0) {
456
+ this.child.push({ [node.tagname]: node.child, [":@"]: node[":@"] });
457
+ } else {
458
+ this.child.push({ [node.tagname]: node.child });
459
+ }
460
+ }
461
+ };
462
+ module.exports = XmlNode;
463
+ }
464
+ });
465
+
466
+ // ../xml/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js
467
+ var require_DocTypeReader = __commonJS({
468
+ "../xml/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js"(exports, module) {
469
+ function readDocType(xmlData, i) {
470
+ const entities = {};
471
+ if (xmlData[i + 3] === "O" && xmlData[i + 4] === "C" && xmlData[i + 5] === "T" && xmlData[i + 6] === "Y" && xmlData[i + 7] === "P" && xmlData[i + 8] === "E") {
472
+ i = i + 9;
473
+ let angleBracketsCount = 1;
474
+ let hasBody = false, entity = false, comment = false;
475
+ let exp = "";
476
+ for (; i < xmlData.length; i++) {
477
+ if (xmlData[i] === "<") {
478
+ if (hasBody && xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "N" && xmlData[i + 4] === "T" && xmlData[i + 5] === "I" && xmlData[i + 6] === "T" && xmlData[i + 7] === "Y") {
479
+ i += 7;
480
+ entity = true;
481
+ } else if (hasBody && xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "L" && xmlData[i + 4] === "E" && xmlData[i + 5] === "M" && xmlData[i + 6] === "E" && xmlData[i + 7] === "N" && xmlData[i + 8] === "T") {
482
+ i += 8;
483
+ } else if (hasBody && xmlData[i + 1] === "!" && xmlData[i + 2] === "A" && xmlData[i + 3] === "T" && xmlData[i + 4] === "T" && xmlData[i + 5] === "L" && xmlData[i + 6] === "I" && xmlData[i + 7] === "S" && xmlData[i + 8] === "T") {
484
+ i += 8;
485
+ } else if (hasBody && xmlData[i + 1] === "!" && xmlData[i + 2] === "N" && xmlData[i + 3] === "O" && xmlData[i + 4] === "T" && xmlData[i + 5] === "A" && xmlData[i + 6] === "T" && xmlData[i + 7] === "I" && xmlData[i + 8] === "O" && xmlData[i + 9] === "N") {
486
+ i += 9;
487
+ } else if (xmlData[i + 1] === "!" && xmlData[i + 2] === "-" && xmlData[i + 3] === "-") {
488
+ comment = true;
489
+ } else {
490
+ throw new Error("Invalid DOCTYPE");
491
+ }
492
+ angleBracketsCount++;
493
+ exp = "";
494
+ } else if (xmlData[i] === ">") {
495
+ if (comment) {
496
+ if (xmlData[i - 1] === "-" && xmlData[i - 2] === "-") {
497
+ comment = false;
498
+ } else {
499
+ throw new Error(`Invalid XML comment in DOCTYPE`);
500
+ }
501
+ } else if (entity) {
502
+ parseEntityExp(exp, entities);
503
+ entity = false;
504
+ }
505
+ angleBracketsCount--;
506
+ if (angleBracketsCount === 0) {
507
+ break;
508
+ }
509
+ } else if (xmlData[i] === "[") {
510
+ hasBody = true;
511
+ } else {
512
+ exp += xmlData[i];
513
+ }
514
+ }
515
+ if (angleBracketsCount !== 0) {
516
+ throw new Error(`Unclosed DOCTYPE`);
517
+ }
518
+ } else {
519
+ throw new Error(`Invalid Tag instead of DOCTYPE`);
520
+ }
521
+ return { entities, i };
522
+ }
523
+ var entityRegex = RegExp(`^\\s([a-zA-z0-0]+)[ ](['"])([^&]+)\\2`);
524
+ function parseEntityExp(exp, entities) {
525
+ const match = entityRegex.exec(exp);
526
+ if (match) {
527
+ entities[match[1]] = {
528
+ regx: RegExp(`&${match[1]};`, "g"),
529
+ val: match[3]
530
+ };
531
+ }
532
+ }
533
+ module.exports = readDocType;
534
+ }
535
+ });
536
+
537
+ // ../../node_modules/strnum/strnum.js
538
+ var require_strnum = __commonJS({
539
+ "../../node_modules/strnum/strnum.js"(exports, module) {
540
+ var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/;
541
+ var numRegex = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;
542
+ if (!Number.parseInt && window.parseInt) {
543
+ Number.parseInt = window.parseInt;
544
+ }
545
+ if (!Number.parseFloat && window.parseFloat) {
546
+ Number.parseFloat = window.parseFloat;
547
+ }
548
+ var consider = {
549
+ hex: true,
550
+ leadingZeros: true,
551
+ decimalPoint: ".",
552
+ eNotation: true
553
+ };
554
+ function toNumber(str, options = {}) {
555
+ options = Object.assign({}, consider, options);
556
+ if (!str || typeof str !== "string")
557
+ return str;
558
+ let trimmedStr = str.trim();
559
+ if (options.skipLike !== void 0 && options.skipLike.test(trimmedStr))
560
+ return str;
561
+ else if (options.hex && hexRegex.test(trimmedStr)) {
562
+ return Number.parseInt(trimmedStr, 16);
563
+ } else {
564
+ const match = numRegex.exec(trimmedStr);
565
+ if (match) {
566
+ const sign = match[1];
567
+ const leadingZeros = match[2];
568
+ let numTrimmedByZeros = trimZeros(match[3]);
569
+ const eNotation = match[4] || match[6];
570
+ if (!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".")
571
+ return str;
572
+ else if (!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".")
573
+ return str;
574
+ else {
575
+ const num = Number(trimmedStr);
576
+ const numStr = "" + num;
577
+ if (numStr.search(/[eE]/) !== -1) {
578
+ if (options.eNotation)
579
+ return num;
580
+ else
581
+ return str;
582
+ } else if (eNotation) {
583
+ if (options.eNotation)
584
+ return num;
585
+ else
586
+ return str;
587
+ } else if (trimmedStr.indexOf(".") !== -1) {
588
+ if (numStr === "0" && numTrimmedByZeros === "")
589
+ return num;
590
+ else if (numStr === numTrimmedByZeros)
591
+ return num;
592
+ else if (sign && numStr === "-" + numTrimmedByZeros)
593
+ return num;
594
+ else
595
+ return str;
596
+ }
597
+ if (leadingZeros) {
598
+ if (numTrimmedByZeros === numStr)
599
+ return num;
600
+ else if (sign + numTrimmedByZeros === numStr)
601
+ return num;
602
+ else
603
+ return str;
604
+ }
605
+ if (trimmedStr === numStr)
606
+ return num;
607
+ else if (trimmedStr === sign + numStr)
608
+ return num;
609
+ return str;
610
+ }
611
+ } else {
612
+ return str;
613
+ }
614
+ }
615
+ }
616
+ function trimZeros(numStr) {
617
+ if (numStr && numStr.indexOf(".") !== -1) {
618
+ numStr = numStr.replace(/0+$/, "");
619
+ if (numStr === ".")
620
+ numStr = "0";
621
+ else if (numStr[0] === ".")
622
+ numStr = "0" + numStr;
623
+ else if (numStr[numStr.length - 1] === ".")
624
+ numStr = numStr.substr(0, numStr.length - 1);
625
+ return numStr;
626
+ }
627
+ return numStr;
628
+ }
629
+ module.exports = toNumber;
630
+ }
631
+ });
632
+
633
+ // ../xml/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js
634
+ var require_OrderedObjParser = __commonJS({
635
+ "../xml/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js"(exports, module) {
636
+ "use strict";
637
+ var util = require_util();
638
+ var xmlNode = require_xmlNode();
639
+ var readDocType = require_DocTypeReader();
640
+ var toNumber = require_strnum();
641
+ var regx = "<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g, util.nameRegexp);
642
+ var OrderedObjParser = class {
643
+ constructor(options) {
644
+ this.options = options;
645
+ this.currentNode = null;
646
+ this.tagsNodeStack = [];
647
+ this.docTypeEntities = {};
648
+ this.lastEntities = {
649
+ "apos": { regex: /&(apos|#39|#x27);/g, val: "'" },
650
+ "gt": { regex: /&(gt|#62|#x3E);/g, val: ">" },
651
+ "lt": { regex: /&(lt|#60|#x3C);/g, val: "<" },
652
+ "quot": { regex: /&(quot|#34|#x22);/g, val: '"' }
653
+ };
654
+ this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" };
655
+ this.htmlEntities = {
656
+ "space": { regex: /&(nbsp|#160);/g, val: " " },
657
+ "cent": { regex: /&(cent|#162);/g, val: "\xA2" },
658
+ "pound": { regex: /&(pound|#163);/g, val: "\xA3" },
659
+ "yen": { regex: /&(yen|#165);/g, val: "\xA5" },
660
+ "euro": { regex: /&(euro|#8364);/g, val: "\u20AC" },
661
+ "copyright": { regex: /&(copy|#169);/g, val: "\xA9" },
662
+ "reg": { regex: /&(reg|#174);/g, val: "\xAE" },
663
+ "inr": { regex: /&(inr|#8377);/g, val: "\u20B9" }
664
+ };
665
+ this.addExternalEntities = addExternalEntities;
666
+ this.parseXml = parseXml;
667
+ this.parseTextData = parseTextData;
668
+ this.resolveNameSpace = resolveNameSpace;
669
+ this.buildAttributesMap = buildAttributesMap;
670
+ this.isItStopNode = isItStopNode;
671
+ this.replaceEntitiesValue = replaceEntitiesValue;
672
+ this.readStopNodeData = readStopNodeData;
673
+ this.saveTextToParentTag = saveTextToParentTag;
674
+ }
675
+ };
676
+ function addExternalEntities(externalEntities) {
677
+ const entKeys = Object.keys(externalEntities);
678
+ for (let i = 0; i < entKeys.length; i++) {
679
+ const ent = entKeys[i];
680
+ this.lastEntities[ent] = {
681
+ regex: new RegExp("&" + ent + ";", "g"),
682
+ val: externalEntities[ent]
683
+ };
684
+ }
685
+ }
686
+ function parseTextData(val, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) {
687
+ if (val !== void 0) {
688
+ if (this.options.trimValues && !dontTrim) {
689
+ val = val.trim();
690
+ }
691
+ if (val.length > 0) {
692
+ if (!escapeEntities)
693
+ val = this.replaceEntitiesValue(val);
694
+ const newval = this.options.tagValueProcessor(tagName, val, jPath, hasAttributes, isLeafNode);
695
+ if (newval === null || newval === void 0) {
696
+ return val;
697
+ } else if (typeof newval !== typeof val || newval !== val) {
698
+ return newval;
699
+ } else if (this.options.trimValues) {
700
+ return parseValue(val, this.options.parseTagValue, this.options.numberParseOptions);
701
+ } else {
702
+ const trimmedVal = val.trim();
703
+ if (trimmedVal === val) {
704
+ return parseValue(val, this.options.parseTagValue, this.options.numberParseOptions);
705
+ } else {
706
+ return val;
707
+ }
708
+ }
709
+ }
710
+ }
711
+ }
712
+ function resolveNameSpace(tagname) {
713
+ if (this.options.removeNSPrefix) {
714
+ const tags = tagname.split(":");
715
+ const prefix = tagname.charAt(0) === "/" ? "/" : "";
716
+ if (tags[0] === "xmlns") {
717
+ return "";
718
+ }
719
+ if (tags.length === 2) {
720
+ tagname = prefix + tags[1];
721
+ }
722
+ }
723
+ return tagname;
724
+ }
725
+ var attrsRegx = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
726
+ function buildAttributesMap(attrStr, jPath) {
727
+ if (!this.options.ignoreAttributes && typeof attrStr === "string") {
728
+ const matches = util.getAllMatches(attrStr, attrsRegx);
729
+ const len = matches.length;
730
+ const attrs = {};
731
+ for (let i = 0; i < len; i++) {
732
+ const attrName = this.resolveNameSpace(matches[i][1]);
733
+ let oldVal = matches[i][4];
734
+ const aName = this.options.attributeNamePrefix + attrName;
735
+ if (attrName.length) {
736
+ if (oldVal !== void 0) {
737
+ if (this.options.trimValues) {
738
+ oldVal = oldVal.trim();
739
+ }
740
+ oldVal = this.replaceEntitiesValue(oldVal);
741
+ const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath);
742
+ if (newVal === null || newVal === void 0) {
743
+ attrs[aName] = oldVal;
744
+ } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) {
745
+ attrs[aName] = newVal;
746
+ } else {
747
+ attrs[aName] = parseValue(oldVal, this.options.parseAttributeValue, this.options.numberParseOptions);
748
+ }
749
+ } else if (this.options.allowBooleanAttributes) {
750
+ attrs[aName] = true;
751
+ }
752
+ }
753
+ }
754
+ if (!Object.keys(attrs).length) {
755
+ return;
756
+ }
757
+ if (this.options.attributesGroupName) {
758
+ const attrCollection = {};
759
+ attrCollection[this.options.attributesGroupName] = attrs;
760
+ return attrCollection;
761
+ }
762
+ return attrs;
763
+ }
764
+ }
765
+ var parseXml = function(xmlData) {
766
+ xmlData = xmlData.replace(/\r\n?/g, "\n");
767
+ const xmlObj = new xmlNode("!xml");
768
+ let currentNode = xmlObj;
769
+ let textData = "";
770
+ let jPath = "";
771
+ for (let i = 0; i < xmlData.length; i++) {
772
+ const ch = xmlData[i];
773
+ if (ch === "<") {
774
+ if (xmlData[i + 1] === "/") {
775
+ const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed.");
776
+ let tagName = xmlData.substring(i + 2, closeIndex).trim();
777
+ if (this.options.removeNSPrefix) {
778
+ const colonIndex = tagName.indexOf(":");
779
+ if (colonIndex !== -1) {
780
+ tagName = tagName.substr(colonIndex + 1);
781
+ }
782
+ }
783
+ if (this.options.transformTagName) {
784
+ tagName = this.options.transformTagName(tagName);
785
+ }
786
+ if (currentNode) {
787
+ textData = this.saveTextToParentTag(textData, currentNode, jPath);
788
+ }
789
+ jPath = jPath.substr(0, jPath.lastIndexOf("."));
790
+ currentNode = this.tagsNodeStack.pop();
791
+ textData = "";
792
+ i = closeIndex;
793
+ } else if (xmlData[i + 1] === "?") {
794
+ let tagData = readTagExp(xmlData, i, false, "?>");
795
+ if (!tagData)
796
+ throw new Error("Pi Tag is not closed.");
797
+ textData = this.saveTextToParentTag(textData, currentNode, jPath);
798
+ if (this.options.ignoreDeclaration && tagData.tagName === "?xml" || this.options.ignorePiTags) {
799
+ } else {
800
+ const childNode = new xmlNode(tagData.tagName);
801
+ childNode.add(this.options.textNodeName, "");
802
+ if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) {
803
+ childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath);
804
+ }
805
+ currentNode.addChild(childNode);
806
+ }
807
+ i = tagData.closeIndex + 1;
808
+ } else if (xmlData.substr(i + 1, 3) === "!--") {
809
+ const endIndex = findClosingIndex(xmlData, "-->", i + 4, "Comment is not closed.");
810
+ if (this.options.commentPropName) {
811
+ const comment = xmlData.substring(i + 4, endIndex - 2);
812
+ textData = this.saveTextToParentTag(textData, currentNode, jPath);
813
+ currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]);
814
+ }
815
+ i = endIndex;
816
+ } else if (xmlData.substr(i + 1, 2) === "!D") {
817
+ const result = readDocType(xmlData, i);
818
+ this.docTypeEntities = result.entities;
819
+ i = result.i;
820
+ } else if (xmlData.substr(i + 1, 2) === "![") {
821
+ const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2;
822
+ const tagExp = xmlData.substring(i + 9, closeIndex);
823
+ textData = this.saveTextToParentTag(textData, currentNode, jPath);
824
+ if (this.options.cdataPropName) {
825
+ currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]);
826
+ } else {
827
+ let val = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true);
828
+ if (val == void 0)
829
+ val = "";
830
+ currentNode.add(this.options.textNodeName, val);
831
+ }
832
+ i = closeIndex + 2;
833
+ } else {
834
+ let result = readTagExp(xmlData, i, this.options.removeNSPrefix);
835
+ let tagName = result.tagName;
836
+ let tagExp = result.tagExp;
837
+ let attrExpPresent = result.attrExpPresent;
838
+ let closeIndex = result.closeIndex;
839
+ if (this.options.transformTagName) {
840
+ tagName = this.options.transformTagName(tagName);
841
+ }
842
+ if (currentNode && textData) {
843
+ if (currentNode.tagname !== "!xml") {
844
+ textData = this.saveTextToParentTag(textData, currentNode, jPath, false);
845
+ }
846
+ }
847
+ if (tagName !== xmlObj.tagname) {
848
+ jPath += jPath ? "." + tagName : tagName;
849
+ }
850
+ const lastTag = currentNode;
851
+ if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) {
852
+ currentNode = this.tagsNodeStack.pop();
853
+ }
854
+ if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) {
855
+ let tagContent = "";
856
+ if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) {
857
+ i = result.closeIndex;
858
+ } else if (this.options.unpairedTags.indexOf(tagName) !== -1) {
859
+ i = result.closeIndex;
860
+ } else {
861
+ const result2 = this.readStopNodeData(xmlData, tagName, closeIndex + 1);
862
+ if (!result2)
863
+ throw new Error(`Unexpected end of ${tagName}`);
864
+ i = result2.i;
865
+ tagContent = result2.tagContent;
866
+ }
867
+ const childNode = new xmlNode(tagName);
868
+ if (tagName !== tagExp && attrExpPresent) {
869
+ childNode[":@"] = this.buildAttributesMap(tagExp, jPath);
870
+ }
871
+ if (tagContent) {
872
+ tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true);
873
+ }
874
+ jPath = jPath.substr(0, jPath.lastIndexOf("."));
875
+ childNode.add(this.options.textNodeName, tagContent);
876
+ currentNode.addChild(childNode);
877
+ } else {
878
+ if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) {
879
+ if (tagName[tagName.length - 1] === "/") {
880
+ tagName = tagName.substr(0, tagName.length - 1);
881
+ tagExp = tagName;
882
+ } else {
883
+ tagExp = tagExp.substr(0, tagExp.length - 1);
884
+ }
885
+ if (this.options.transformTagName) {
886
+ tagName = this.options.transformTagName(tagName);
887
+ }
888
+ const childNode = new xmlNode(tagName);
889
+ if (tagName !== tagExp && attrExpPresent) {
890
+ childNode[":@"] = this.buildAttributesMap(tagExp, jPath);
891
+ }
892
+ jPath = jPath.substr(0, jPath.lastIndexOf("."));
893
+ currentNode.addChild(childNode);
894
+ } else {
895
+ const childNode = new xmlNode(tagName);
896
+ this.tagsNodeStack.push(currentNode);
897
+ if (tagName !== tagExp && attrExpPresent) {
898
+ childNode[":@"] = this.buildAttributesMap(tagExp, jPath);
899
+ }
900
+ currentNode.addChild(childNode);
901
+ currentNode = childNode;
902
+ }
903
+ textData = "";
904
+ i = closeIndex;
905
+ }
906
+ }
907
+ } else {
908
+ textData += xmlData[i];
909
+ }
910
+ }
911
+ return xmlObj.child;
912
+ };
913
+ var replaceEntitiesValue = function(val) {
914
+ if (this.options.processEntities) {
915
+ for (let entityName in this.docTypeEntities) {
916
+ const entity = this.docTypeEntities[entityName];
917
+ val = val.replace(entity.regx, entity.val);
918
+ }
919
+ for (let entityName in this.lastEntities) {
920
+ const entity = this.lastEntities[entityName];
921
+ val = val.replace(entity.regex, entity.val);
922
+ }
923
+ if (this.options.htmlEntities) {
924
+ for (let entityName in this.htmlEntities) {
925
+ const entity = this.htmlEntities[entityName];
926
+ val = val.replace(entity.regex, entity.val);
927
+ }
928
+ }
929
+ val = val.replace(this.ampEntity.regex, this.ampEntity.val);
930
+ }
931
+ return val;
932
+ };
933
+ function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) {
934
+ if (textData) {
935
+ if (isLeafNode === void 0)
936
+ isLeafNode = Object.keys(currentNode.child).length === 0;
937
+ textData = this.parseTextData(textData, currentNode.tagname, jPath, false, currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false, isLeafNode);
938
+ if (textData !== void 0 && textData !== "")
939
+ currentNode.add(this.options.textNodeName, textData);
940
+ textData = "";
941
+ }
942
+ return textData;
943
+ }
944
+ function isItStopNode(stopNodes, jPath, currentTagName) {
945
+ const allNodesExp = "*." + currentTagName;
946
+ for (const stopNodePath in stopNodes) {
947
+ const stopNodeExp = stopNodes[stopNodePath];
948
+ if (allNodesExp === stopNodeExp || jPath === stopNodeExp)
949
+ return true;
950
+ }
951
+ return false;
952
+ }
953
+ function tagExpWithClosingIndex(xmlData, i, closingChar = ">") {
954
+ let attrBoundary;
955
+ let tagExp = "";
956
+ for (let index = i; index < xmlData.length; index++) {
957
+ let ch = xmlData[index];
958
+ if (attrBoundary) {
959
+ if (ch === attrBoundary)
960
+ attrBoundary = "";
961
+ } else if (ch === '"' || ch === "'") {
962
+ attrBoundary = ch;
963
+ } else if (ch === closingChar[0]) {
964
+ if (closingChar[1]) {
965
+ if (xmlData[index + 1] === closingChar[1]) {
966
+ return {
967
+ data: tagExp,
968
+ index
969
+ };
970
+ }
971
+ } else {
972
+ return {
973
+ data: tagExp,
974
+ index
975
+ };
976
+ }
977
+ } else if (ch === " ") {
978
+ ch = " ";
979
+ }
980
+ tagExp += ch;
981
+ }
982
+ }
983
+ function findClosingIndex(xmlData, str, i, errMsg) {
984
+ const closingIndex = xmlData.indexOf(str, i);
985
+ if (closingIndex === -1) {
986
+ throw new Error(errMsg);
987
+ } else {
988
+ return closingIndex + str.length - 1;
989
+ }
990
+ }
991
+ function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") {
992
+ const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar);
993
+ if (!result)
994
+ return;
995
+ let tagExp = result.data;
996
+ const closeIndex = result.index;
997
+ const separatorIndex = tagExp.search(/\s/);
998
+ let tagName = tagExp;
999
+ let attrExpPresent = true;
1000
+ if (separatorIndex !== -1) {
1001
+ tagName = tagExp.substr(0, separatorIndex).replace(/\s\s*$/, "");
1002
+ tagExp = tagExp.substr(separatorIndex + 1);
1003
+ }
1004
+ if (removeNSPrefix) {
1005
+ const colonIndex = tagName.indexOf(":");
1006
+ if (colonIndex !== -1) {
1007
+ tagName = tagName.substr(colonIndex + 1);
1008
+ attrExpPresent = tagName !== result.data.substr(colonIndex + 1);
1009
+ }
1010
+ }
1011
+ return {
1012
+ tagName,
1013
+ tagExp,
1014
+ closeIndex,
1015
+ attrExpPresent
1016
+ };
1017
+ }
1018
+ function readStopNodeData(xmlData, tagName, i) {
1019
+ const startIndex = i;
1020
+ let openTagCount = 1;
1021
+ for (; i < xmlData.length; i++) {
1022
+ if (xmlData[i] === "<") {
1023
+ if (xmlData[i + 1] === "/") {
1024
+ const closeIndex = findClosingIndex(xmlData, ">", i, `${tagName} is not closed`);
1025
+ let closeTagName = xmlData.substring(i + 2, closeIndex).trim();
1026
+ if (closeTagName === tagName) {
1027
+ openTagCount--;
1028
+ if (openTagCount === 0) {
1029
+ return {
1030
+ tagContent: xmlData.substring(startIndex, i),
1031
+ i: closeIndex
1032
+ };
1033
+ }
1034
+ }
1035
+ i = closeIndex;
1036
+ } else if (xmlData[i + 1] === "?") {
1037
+ const closeIndex = findClosingIndex(xmlData, "?>", i + 1, "StopNode is not closed.");
1038
+ i = closeIndex;
1039
+ } else if (xmlData.substr(i + 1, 3) === "!--") {
1040
+ const closeIndex = findClosingIndex(xmlData, "-->", i + 3, "StopNode is not closed.");
1041
+ i = closeIndex;
1042
+ } else if (xmlData.substr(i + 1, 2) === "![") {
1043
+ const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2;
1044
+ i = closeIndex;
1045
+ } else {
1046
+ const tagData = readTagExp(xmlData, i, ">");
1047
+ if (tagData) {
1048
+ const openTagName = tagData && tagData.tagName;
1049
+ if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") {
1050
+ openTagCount++;
1051
+ }
1052
+ i = tagData.closeIndex;
1053
+ }
1054
+ }
1055
+ }
1056
+ }
1057
+ }
1058
+ function parseValue(val, shouldParse, options) {
1059
+ if (shouldParse && typeof val === "string") {
1060
+ const newval = val.trim();
1061
+ if (newval === "true")
1062
+ return true;
1063
+ else if (newval === "false")
1064
+ return false;
1065
+ else
1066
+ return toNumber(val, options);
1067
+ } else {
1068
+ if (util.isExist(val)) {
1069
+ return val;
1070
+ } else {
1071
+ return "";
1072
+ }
1073
+ }
1074
+ }
1075
+ module.exports = OrderedObjParser;
1076
+ }
1077
+ });
1078
+
1079
+ // ../xml/node_modules/fast-xml-parser/src/xmlparser/node2json.js
1080
+ var require_node2json = __commonJS({
1081
+ "../xml/node_modules/fast-xml-parser/src/xmlparser/node2json.js"(exports) {
1082
+ "use strict";
1083
+ function prettify(node, options) {
1084
+ return compress(node, options);
1085
+ }
1086
+ function compress(arr, options, jPath) {
1087
+ let text;
1088
+ const compressedObj = {};
1089
+ for (let i = 0; i < arr.length; i++) {
1090
+ const tagObj = arr[i];
1091
+ const property = propName(tagObj);
1092
+ let newJpath = "";
1093
+ if (jPath === void 0)
1094
+ newJpath = property;
1095
+ else
1096
+ newJpath = jPath + "." + property;
1097
+ if (property === options.textNodeName) {
1098
+ if (text === void 0)
1099
+ text = tagObj[property];
1100
+ else
1101
+ text += "" + tagObj[property];
1102
+ } else if (property === void 0) {
1103
+ continue;
1104
+ } else if (tagObj[property]) {
1105
+ let val = compress(tagObj[property], options, newJpath);
1106
+ const isLeaf = isLeafTag(val, options);
1107
+ if (tagObj[":@"]) {
1108
+ assignAttributes(val, tagObj[":@"], newJpath, options);
1109
+ } else if (Object.keys(val).length === 1 && val[options.textNodeName] !== void 0 && !options.alwaysCreateTextNode) {
1110
+ val = val[options.textNodeName];
1111
+ } else if (Object.keys(val).length === 0) {
1112
+ if (options.alwaysCreateTextNode)
1113
+ val[options.textNodeName] = "";
1114
+ else
1115
+ val = "";
1116
+ }
1117
+ if (compressedObj[property] !== void 0 && compressedObj.hasOwnProperty(property)) {
1118
+ if (!Array.isArray(compressedObj[property])) {
1119
+ compressedObj[property] = [compressedObj[property]];
1120
+ }
1121
+ compressedObj[property].push(val);
1122
+ } else {
1123
+ if (options.isArray(property, newJpath, isLeaf)) {
1124
+ compressedObj[property] = [val];
1125
+ } else {
1126
+ compressedObj[property] = val;
1127
+ }
1128
+ }
1129
+ }
1130
+ }
1131
+ if (typeof text === "string") {
1132
+ if (text.length > 0)
1133
+ compressedObj[options.textNodeName] = text;
1134
+ } else if (text !== void 0)
1135
+ compressedObj[options.textNodeName] = text;
1136
+ return compressedObj;
1137
+ }
1138
+ function propName(obj) {
1139
+ const keys = Object.keys(obj);
1140
+ for (let i = 0; i < keys.length; i++) {
1141
+ const key = keys[i];
1142
+ if (key !== ":@")
1143
+ return key;
1144
+ }
1145
+ }
1146
+ function assignAttributes(obj, attrMap, jpath, options) {
1147
+ if (attrMap) {
1148
+ const keys = Object.keys(attrMap);
1149
+ const len = keys.length;
1150
+ for (let i = 0; i < len; i++) {
1151
+ const atrrName = keys[i];
1152
+ if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) {
1153
+ obj[atrrName] = [attrMap[atrrName]];
1154
+ } else {
1155
+ obj[atrrName] = attrMap[atrrName];
1156
+ }
1157
+ }
1158
+ }
1159
+ }
1160
+ function isLeafTag(obj, options) {
1161
+ const propCount = Object.keys(obj).length;
1162
+ if (propCount === 0 || propCount === 1 && obj[options.textNodeName])
1163
+ return true;
1164
+ return false;
1165
+ }
1166
+ exports.prettify = prettify;
1167
+ }
1168
+ });
1169
+
1170
+ // ../xml/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js
1171
+ var require_XMLParser = __commonJS({
1172
+ "../xml/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"(exports, module) {
1173
+ var { buildOptions } = require_OptionsBuilder();
1174
+ var OrderedObjParser = require_OrderedObjParser();
1175
+ var { prettify } = require_node2json();
1176
+ var validator = require_validator();
1177
+ var XMLParser = class {
1178
+ constructor(options) {
1179
+ this.externalEntities = {};
1180
+ this.options = buildOptions(options);
1181
+ }
1182
+ parse(xmlData, validationOption) {
1183
+ if (typeof xmlData === "string") {
1184
+ } else if (xmlData.toString) {
1185
+ xmlData = xmlData.toString();
1186
+ } else {
1187
+ throw new Error("XML data is accepted in String or Bytes[] form.");
1188
+ }
1189
+ if (validationOption) {
1190
+ if (validationOption === true)
1191
+ validationOption = {};
1192
+ const result = validator.validate(xmlData, validationOption);
1193
+ if (result !== true) {
1194
+ throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`);
1195
+ }
1196
+ }
1197
+ const orderedObjParser = new OrderedObjParser(this.options);
1198
+ orderedObjParser.addExternalEntities(this.externalEntities);
1199
+ const orderedResult = orderedObjParser.parseXml(xmlData);
1200
+ if (this.options.preserveOrder || orderedResult === void 0)
1201
+ return orderedResult;
1202
+ else
1203
+ return prettify(orderedResult, this.options);
1204
+ }
1205
+ addEntity(key, value) {
1206
+ if (value.indexOf("&") !== -1) {
1207
+ throw new Error("Entity value can't have '&'");
1208
+ } else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) {
1209
+ throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");
1210
+ } else if (value === "&") {
1211
+ throw new Error("An entity with value '&' is not permitted");
1212
+ } else {
1213
+ this.externalEntities[key] = value;
1214
+ }
1215
+ }
1216
+ };
1217
+ module.exports = XMLParser;
1218
+ }
1219
+ });
1220
+
1221
+ // ../xml/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js
1222
+ var require_orderedJs2Xml = __commonJS({
1223
+ "../xml/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js"(exports, module) {
1224
+ var EOL = "\n";
1225
+ function toXml(jArray, options) {
1226
+ return arrToStr(jArray, options, "", 0);
1227
+ }
1228
+ function arrToStr(arr, options, jPath, level) {
1229
+ let xmlStr = "";
1230
+ let indentation = "";
1231
+ if (options.format && options.indentBy.length > 0) {
1232
+ indentation = EOL + "" + options.indentBy.repeat(level);
1233
+ }
1234
+ for (let i = 0; i < arr.length; i++) {
1235
+ const tagObj = arr[i];
1236
+ const tagName = propName(tagObj);
1237
+ let newJPath = "";
1238
+ if (jPath.length === 0)
1239
+ newJPath = tagName;
1240
+ else
1241
+ newJPath = `${jPath}.${tagName}`;
1242
+ if (tagName === options.textNodeName) {
1243
+ let tagText = tagObj[tagName];
1244
+ if (!isStopNode(newJPath, options)) {
1245
+ tagText = options.tagValueProcessor(tagName, tagText);
1246
+ tagText = replaceEntitiesValue(tagText, options);
1247
+ }
1248
+ xmlStr += indentation + tagText;
1249
+ continue;
1250
+ } else if (tagName === options.cdataPropName) {
1251
+ xmlStr += indentation + `<![CDATA[${tagObj[tagName][0][options.textNodeName]}]]>`;
1252
+ continue;
1253
+ } else if (tagName === options.commentPropName) {
1254
+ xmlStr += indentation + `<!--${tagObj[tagName][0][options.textNodeName]}-->`;
1255
+ continue;
1256
+ } else if (tagName[0] === "?") {
1257
+ const attStr2 = attr_to_str(tagObj[":@"], options);
1258
+ const tempInd = tagName === "?xml" ? "" : indentation;
1259
+ let piTextNodeName = tagObj[tagName][0][options.textNodeName];
1260
+ piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : "";
1261
+ xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr2}?>`;
1262
+ continue;
1263
+ }
1264
+ const attStr = attr_to_str(tagObj[":@"], options);
1265
+ let tagStart = indentation + `<${tagName}${attStr}`;
1266
+ let tagValue = arrToStr(tagObj[tagName], options, newJPath, level + 1);
1267
+ if (options.unpairedTags.indexOf(tagName) !== -1) {
1268
+ if (options.suppressUnpairedNode)
1269
+ xmlStr += tagStart + ">";
1270
+ else
1271
+ xmlStr += tagStart + "/>";
1272
+ } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) {
1273
+ xmlStr += tagStart + "/>";
1274
+ } else {
1275
+ xmlStr += tagStart + `>${tagValue}${indentation}</${tagName}>`;
1276
+ }
1277
+ }
1278
+ return xmlStr;
1279
+ }
1280
+ function propName(obj) {
1281
+ const keys = Object.keys(obj);
1282
+ for (let i = 0; i < keys.length; i++) {
1283
+ const key = keys[i];
1284
+ if (key !== ":@")
1285
+ return key;
1286
+ }
1287
+ }
1288
+ function attr_to_str(attrMap, options) {
1289
+ let attrStr = "";
1290
+ if (attrMap && !options.ignoreAttributes) {
1291
+ for (let attr in attrMap) {
1292
+ let attrVal = options.attributeValueProcessor(attr, attrMap[attr]);
1293
+ attrVal = replaceEntitiesValue(attrVal, options);
1294
+ if (attrVal === true && options.suppressBooleanAttributes) {
1295
+ attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`;
1296
+ } else {
1297
+ attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`;
1298
+ }
1299
+ }
1300
+ }
1301
+ return attrStr;
1302
+ }
1303
+ function isStopNode(jPath, options) {
1304
+ jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1);
1305
+ let tagName = jPath.substr(jPath.lastIndexOf(".") + 1);
1306
+ for (let index in options.stopNodes) {
1307
+ if (options.stopNodes[index] === jPath || options.stopNodes[index] === "*." + tagName)
1308
+ return true;
1309
+ }
1310
+ return false;
1311
+ }
1312
+ function replaceEntitiesValue(textValue, options) {
1313
+ if (textValue && textValue.length > 0 && options.processEntities) {
1314
+ for (let i = 0; i < options.entities.length; i++) {
1315
+ const entity = options.entities[i];
1316
+ textValue = textValue.replace(entity.regex, entity.val);
1317
+ }
1318
+ }
1319
+ return textValue;
1320
+ }
1321
+ module.exports = toXml;
1322
+ }
1323
+ });
1324
+
1325
+ // ../xml/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js
1326
+ var require_json2xml = __commonJS({
1327
+ "../xml/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js"(exports, module) {
1328
+ "use strict";
1329
+ var buildFromOrderedJs = require_orderedJs2Xml();
1330
+ var defaultOptions = {
1331
+ attributeNamePrefix: "@_",
1332
+ attributesGroupName: false,
1333
+ textNodeName: "#text",
1334
+ ignoreAttributes: true,
1335
+ cdataPropName: false,
1336
+ format: false,
1337
+ indentBy: " ",
1338
+ suppressEmptyNode: false,
1339
+ suppressUnpairedNode: true,
1340
+ suppressBooleanAttributes: true,
1341
+ tagValueProcessor: function(key, a) {
1342
+ return a;
1343
+ },
1344
+ attributeValueProcessor: function(attrName, a) {
1345
+ return a;
1346
+ },
1347
+ preserveOrder: false,
1348
+ commentPropName: false,
1349
+ unpairedTags: [],
1350
+ entities: [
1351
+ { regex: new RegExp("&", "g"), val: "&amp;" },
1352
+ { regex: new RegExp(">", "g"), val: "&gt;" },
1353
+ { regex: new RegExp("<", "g"), val: "&lt;" },
1354
+ { regex: new RegExp("'", "g"), val: "&apos;" },
1355
+ { regex: new RegExp('"', "g"), val: "&quot;" }
1356
+ ],
1357
+ processEntities: true,
1358
+ stopNodes: [],
1359
+ transformTagName: false
1360
+ };
1361
+ function Builder(options) {
1362
+ this.options = Object.assign({}, defaultOptions, options);
1363
+ if (this.options.ignoreAttributes || this.options.attributesGroupName) {
1364
+ this.isAttribute = function() {
1365
+ return false;
1366
+ };
1367
+ } else {
1368
+ this.attrPrefixLen = this.options.attributeNamePrefix.length;
1369
+ this.isAttribute = isAttribute;
1370
+ }
1371
+ this.processTextOrObjNode = processTextOrObjNode;
1372
+ if (this.options.format) {
1373
+ this.indentate = indentate;
1374
+ this.tagEndChar = ">\n";
1375
+ this.newLine = "\n";
1376
+ } else {
1377
+ this.indentate = function() {
1378
+ return "";
1379
+ };
1380
+ this.tagEndChar = ">";
1381
+ this.newLine = "";
1382
+ }
1383
+ if (this.options.suppressEmptyNode) {
1384
+ this.buildTextNode = buildEmptyTextNode;
1385
+ this.buildObjNode = buildEmptyObjNode;
1386
+ } else {
1387
+ this.buildTextNode = buildTextValNode;
1388
+ this.buildObjNode = buildObjectNode;
1389
+ }
1390
+ this.buildTextValNode = buildTextValNode;
1391
+ this.buildObjectNode = buildObjectNode;
1392
+ this.replaceEntitiesValue = replaceEntitiesValue;
1393
+ this.buildAttrPairStr = buildAttrPairStr;
1394
+ }
1395
+ Builder.prototype.build = function(jObj) {
1396
+ if (this.options.preserveOrder) {
1397
+ return buildFromOrderedJs(jObj, this.options);
1398
+ } else {
1399
+ if (Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) {
1400
+ jObj = {
1401
+ [this.options.arrayNodeName]: jObj
1402
+ };
1403
+ }
1404
+ return this.j2x(jObj, 0).val;
1405
+ }
1406
+ };
1407
+ Builder.prototype.j2x = function(jObj, level) {
1408
+ let attrStr = "";
1409
+ let val = "";
1410
+ for (let key in jObj) {
1411
+ if (typeof jObj[key] === "undefined") {
1412
+ } else if (jObj[key] === null) {
1413
+ if (key[0] === "?")
1414
+ val += this.indentate(level) + "<" + key + "?" + this.tagEndChar;
1415
+ else
1416
+ val += this.indentate(level) + "<" + key + "/" + this.tagEndChar;
1417
+ } else if (jObj[key] instanceof Date) {
1418
+ val += this.buildTextNode(jObj[key], key, "", level);
1419
+ } else if (typeof jObj[key] !== "object") {
1420
+ const attr = this.isAttribute(key);
1421
+ if (attr) {
1422
+ attrStr += this.buildAttrPairStr(attr, "" + jObj[key]);
1423
+ } else {
1424
+ if (key === this.options.textNodeName) {
1425
+ let newval = this.options.tagValueProcessor(key, "" + jObj[key]);
1426
+ val += this.replaceEntitiesValue(newval);
1427
+ } else {
1428
+ val += this.buildTextNode(jObj[key], key, "", level);
1429
+ }
1430
+ }
1431
+ } else if (Array.isArray(jObj[key])) {
1432
+ const arrLen = jObj[key].length;
1433
+ for (let j = 0; j < arrLen; j++) {
1434
+ const item = jObj[key][j];
1435
+ if (typeof item === "undefined") {
1436
+ } else if (item === null) {
1437
+ if (key[0] === "?")
1438
+ val += this.indentate(level) + "<" + key + "?" + this.tagEndChar;
1439
+ else
1440
+ val += this.indentate(level) + "<" + key + "/" + this.tagEndChar;
1441
+ } else if (typeof item === "object") {
1442
+ val += this.processTextOrObjNode(item, key, level);
1443
+ } else {
1444
+ val += this.buildTextNode(item, key, "", level);
1445
+ }
1446
+ }
1447
+ } else {
1448
+ if (this.options.attributesGroupName && key === this.options.attributesGroupName) {
1449
+ const Ks = Object.keys(jObj[key]);
1450
+ const L = Ks.length;
1451
+ for (let j = 0; j < L; j++) {
1452
+ attrStr += this.buildAttrPairStr(Ks[j], "" + jObj[key][Ks[j]]);
1453
+ }
1454
+ } else {
1455
+ val += this.processTextOrObjNode(jObj[key], key, level);
1456
+ }
1457
+ }
1458
+ }
1459
+ return { attrStr, val };
1460
+ };
1461
+ function buildAttrPairStr(attrName, val) {
1462
+ val = this.options.attributeValueProcessor(attrName, "" + val);
1463
+ val = this.replaceEntitiesValue(val);
1464
+ if (this.options.suppressBooleanAttributes && val === "true") {
1465
+ return " " + attrName;
1466
+ } else
1467
+ return " " + attrName + '="' + val + '"';
1468
+ }
1469
+ function processTextOrObjNode(object, key, level) {
1470
+ const result = this.j2x(object, level + 1);
1471
+ if (object[this.options.textNodeName] !== void 0 && Object.keys(object).length === 1) {
1472
+ return this.buildTextNode(object[this.options.textNodeName], key, result.attrStr, level);
1473
+ } else {
1474
+ return this.buildObjNode(result.val, key, result.attrStr, level);
1475
+ }
1476
+ }
1477
+ function buildObjectNode(val, key, attrStr, level) {
1478
+ let tagEndExp = "</" + key + this.tagEndChar;
1479
+ let piClosingChar = "";
1480
+ if (key[0] === "?") {
1481
+ piClosingChar = "?";
1482
+ tagEndExp = "";
1483
+ }
1484
+ if (attrStr && val.indexOf("<") === -1) {
1485
+ return this.indentate(level) + "<" + key + attrStr + piClosingChar + ">" + val + tagEndExp;
1486
+ } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) {
1487
+ return this.indentate(level) + `<!--${val}-->` + this.newLine;
1488
+ } else {
1489
+ return this.indentate(level) + "<" + key + attrStr + piClosingChar + this.tagEndChar + val + this.indentate(level) + tagEndExp;
1490
+ }
1491
+ }
1492
+ function buildEmptyObjNode(val, key, attrStr, level) {
1493
+ if (val !== "") {
1494
+ return this.buildObjectNode(val, key, attrStr, level);
1495
+ } else {
1496
+ if (key[0] === "?")
1497
+ return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar;
1498
+ else
1499
+ return this.indentate(level) + "<" + key + attrStr + "/" + this.tagEndChar;
1500
+ }
1501
+ }
1502
+ function buildTextValNode(val, key, attrStr, level) {
1503
+ if (this.options.cdataPropName !== false && key === this.options.cdataPropName) {
1504
+ return this.indentate(level) + `<![CDATA[${val}]]>` + this.newLine;
1505
+ } else if (this.options.commentPropName !== false && key === this.options.commentPropName) {
1506
+ return this.indentate(level) + `<!--${val}-->` + this.newLine;
1507
+ } else {
1508
+ let textValue = this.options.tagValueProcessor(key, val);
1509
+ textValue = this.replaceEntitiesValue(textValue);
1510
+ if (textValue === "" && this.options.unpairedTags.indexOf(key) !== -1) {
1511
+ if (this.options.suppressUnpairedNode) {
1512
+ return this.indentate(level) + "<" + key + this.tagEndChar;
1513
+ } else {
1514
+ return this.indentate(level) + "<" + key + "/" + this.tagEndChar;
1515
+ }
1516
+ } else {
1517
+ return this.indentate(level) + "<" + key + attrStr + ">" + textValue + "</" + key + this.tagEndChar;
1518
+ }
1519
+ }
1520
+ }
1521
+ function replaceEntitiesValue(textValue) {
1522
+ if (textValue && textValue.length > 0 && this.options.processEntities) {
1523
+ for (let i = 0; i < this.options.entities.length; i++) {
1524
+ const entity = this.options.entities[i];
1525
+ textValue = textValue.replace(entity.regex, entity.val);
1526
+ }
1527
+ }
1528
+ return textValue;
1529
+ }
1530
+ function buildEmptyTextNode(val, key, attrStr, level) {
1531
+ if (val === "" && this.options.unpairedTags.indexOf(key) !== -1) {
1532
+ if (this.options.suppressUnpairedNode) {
1533
+ return this.indentate(level) + "<" + key + this.tagEndChar;
1534
+ } else {
1535
+ return this.indentate(level) + "<" + key + "/" + this.tagEndChar;
1536
+ }
1537
+ } else if (val !== "") {
1538
+ return this.buildTextValNode(val, key, attrStr, level);
1539
+ } else {
1540
+ if (key[0] === "?")
1541
+ return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar;
1542
+ else
1543
+ return this.indentate(level) + "<" + key + attrStr + "/" + this.tagEndChar;
1544
+ }
1545
+ }
1546
+ function indentate(level) {
1547
+ return this.options.indentBy.repeat(level);
1548
+ }
1549
+ function isAttribute(name) {
1550
+ if (name.startsWith(this.options.attributeNamePrefix)) {
1551
+ return name.substr(this.attrPrefixLen);
1552
+ } else {
1553
+ return false;
1554
+ }
1555
+ }
1556
+ module.exports = Builder;
1557
+ }
1558
+ });
1559
+
1560
+ // ../xml/node_modules/fast-xml-parser/src/fxp.js
1561
+ var require_fxp = __commonJS({
1562
+ "../xml/node_modules/fast-xml-parser/src/fxp.js"(exports, module) {
1563
+ "use strict";
1564
+ var validator = require_validator();
1565
+ var XMLParser = require_XMLParser();
1566
+ var XMLBuilder = require_json2xml();
1567
+ module.exports = {
1568
+ XMLParser,
1569
+ XMLValidator: validator,
1570
+ XMLBuilder
1571
+ };
1572
+ }
1573
+ });
1574
+
1575
+ // ../xml/src/lib/parse-xml.ts
1576
+ function parseXML(text, options) {
1577
+ const parser = new import_fast_xml_parser.XMLParser({ ...options });
1578
+ const parsedXML = parser.parse(text);
1579
+ return parsedXML;
1580
+ }
1581
+ var import_fast_xml_parser;
1582
+ var init_parse_xml = __esm({
1583
+ "../xml/src/lib/parse-xml.ts"() {
1584
+ import_fast_xml_parser = __toModule(require_fxp());
1585
+ }
1586
+ });
1587
+
1588
+ // ../xml/src/xml-loader.ts
1589
+ function testXMLFile(text) {
1590
+ return text.startsWith("<?xml");
1591
+ }
1592
+ var VERSION, XMLLoader;
1593
+ var init_xml_loader = __esm({
1594
+ "../xml/src/xml-loader.ts"() {
1595
+ init_parse_xml();
1596
+ VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
1597
+ XMLLoader = {
1598
+ name: "XML",
1599
+ id: "xml",
1600
+ module: "xml",
1601
+ version: VERSION,
1602
+ worker: false,
1603
+ extensions: ["xml"],
1604
+ mimeTypes: ["application/xml", "text/xml"],
1605
+ testText: testXMLFile,
1606
+ options: {
1607
+ xml: {}
1608
+ },
1609
+ parse: async (arrayBuffer, options) => parseXML(new TextDecoder().decode(arrayBuffer), options),
1610
+ parseTextSync: (text, options) => parseXML(text, options)
1611
+ };
1612
+ }
1613
+ });
1614
+
1615
+ // ../xml/src/index.ts
1616
+ var init_src = __esm({
1617
+ "../xml/src/index.ts"() {
1618
+ init_xml_loader();
1619
+ }
1620
+ });
1621
+
1622
+ // src/lib/parse-wms-capabilities.ts
1623
+ function parseWMSCapabilities(text, options) {
1624
+ const parsedXML = XMLLoader.parseTextSync(text, options);
1625
+ if (parsedXML.WMT_MS_Capabilities) {
1626
+ return parsedXML.WMT_MS_Capabilities;
1627
+ }
1628
+ if (parsedXML.WMS_Capabilities) {
1629
+ return parsedXML.WMS_Capabilities;
1630
+ }
1631
+ return parsedXML;
1632
+ }
1633
+ var init_parse_wms_capabilities = __esm({
1634
+ "src/lib/parse-wms-capabilities.ts"() {
1635
+ init_src();
1636
+ }
1637
+ });
1638
+
1639
+ // src/wms-capabilities-loader.ts
1640
+ function testXMLFile2(text) {
1641
+ return text.startsWith("<?xml");
1642
+ }
1643
+ var VERSION2, WMSCapabilitiesLoader;
1644
+ var init_wms_capabilities_loader = __esm({
1645
+ "src/wms-capabilities-loader.ts"() {
1646
+ init_parse_wms_capabilities();
1647
+ VERSION2 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
1648
+ WMSCapabilitiesLoader = {
1649
+ name: "WMS Capabilities",
1650
+ id: "wms",
1651
+ module: "wms",
1652
+ version: VERSION2,
1653
+ worker: false,
1654
+ extensions: ["xml"],
1655
+ mimeTypes: ["application/vnd.ogc.wms_xml", "application/xml", "text/xml"],
1656
+ testText: testXMLFile2,
1657
+ options: {
1658
+ obj: {}
1659
+ },
1660
+ parse: async (arrayBuffer, options) => parseWMSCapabilities(new TextDecoder().decode(arrayBuffer), options),
1661
+ parseTextSync: (text, options) => parseWMSCapabilities(text, options)
1662
+ };
1663
+ }
1664
+ });
1665
+
1666
+ // src/index.ts
1667
+ var src_exports = {};
1668
+ __export(src_exports, {
1669
+ WMSCapabilitiesLoader: () => WMSCapabilitiesLoader
1670
+ });
1671
+ var init_src2 = __esm({
1672
+ "src/index.ts"() {
1673
+ init_wms_capabilities_loader();
1674
+ }
1675
+ });
1676
+
1677
+ // src/bundle.ts
1678
+ var require_bundle = __commonJS({
1679
+ "src/bundle.ts"(exports, module) {
1680
+ var moduleExports = (init_src2(), src_exports);
1681
+ globalThis.loaders = globalThis.loaders || {};
1682
+ module.exports = Object.assign(globalThis.loaders, moduleExports);
1683
+ }
1684
+ });
1685
+ require_bundle();
1686
+ })();