lone-format 0.4.0 → 0.5.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,4 +1,4 @@
1
- import { defineComponent as ye, useCssVars as Oe, ref as z, computed as V, resolveComponent as Ue, createElementBlock as k, openBlock as x, createElementVNode as v, createCommentVNode as F, withDirectives as _e, toDisplayString as R, withKeys as ue, vModelText as xe, createTextVNode as Se, Fragment as de, renderList as fe, createVNode as Fe, normalizeClass as Te, nextTick as he, watch as Xe, normalizeStyle as P, createBlock as He } from "vue";
1
+ import { defineComponent as ye, useCssVars as Oe, ref as Y, computed as V, resolveComponent as Me, createElementBlock as x, openBlock as _, createElementVNode as y, createCommentVNode as U, withDirectives as Ee, toDisplayString as B, withKeys as de, vModelText as xe, Fragment as ne, renderList as ie, createVNode as Ue, normalizeClass as Te, createTextVNode as De, nextTick as he, watch as Fe, normalizeStyle as N, createBlock as Xe } from "vue";
2
2
  class Je {
3
3
  /**
4
4
  * @callback HookCallback
@@ -69,7 +69,7 @@ class et {
69
69
  });
70
70
  }
71
71
  }
72
- class c {
72
+ class d {
73
73
  /**
74
74
  * @returns {string}
75
75
  */
@@ -80,7 +80,7 @@ class c {
80
80
  * @returns {string}
81
81
  */
82
82
  static toString() {
83
- return "JavaScript Expression Parser (JSEP) v" + c.version;
83
+ return "JavaScript Expression Parser (JSEP) v" + d.version;
84
84
  }
85
85
  // ==================== CONFIG ================================
86
86
  /**
@@ -89,7 +89,7 @@ class c {
89
89
  * @returns {Jsep}
90
90
  */
91
91
  static addUnaryOp(e) {
92
- return c.max_unop_len = Math.max(e.length, c.max_unop_len), c.unary_ops[e] = 1, c;
92
+ return d.max_unop_len = Math.max(e.length, d.max_unop_len), d.unary_ops[e] = 1, d;
93
93
  }
94
94
  /**
95
95
  * @method jsep.addBinaryOp
@@ -99,7 +99,7 @@ class c {
99
99
  * @returns {Jsep}
100
100
  */
101
101
  static addBinaryOp(e, t, s) {
102
- return c.max_binop_len = Math.max(e.length, c.max_binop_len), c.binary_ops[e] = t, s ? c.right_associative.add(e) : c.right_associative.delete(e), c;
102
+ return d.max_binop_len = Math.max(e.length, d.max_binop_len), d.binary_ops[e] = t, s ? d.right_associative.add(e) : d.right_associative.delete(e), d;
103
103
  }
104
104
  /**
105
105
  * @method addIdentifierChar
@@ -107,7 +107,7 @@ class c {
107
107
  * @returns {Jsep}
108
108
  */
109
109
  static addIdentifierChar(e) {
110
- return c.additional_identifier_chars.add(e), c;
110
+ return d.additional_identifier_chars.add(e), d;
111
111
  }
112
112
  /**
113
113
  * @method addLiteral
@@ -116,7 +116,7 @@ class c {
116
116
  * @returns {Jsep}
117
117
  */
118
118
  static addLiteral(e, t) {
119
- return c.literals[e] = t, c;
119
+ return d.literals[e] = t, d;
120
120
  }
121
121
  /**
122
122
  * @method removeUnaryOp
@@ -124,14 +124,14 @@ class c {
124
124
  * @returns {Jsep}
125
125
  */
126
126
  static removeUnaryOp(e) {
127
- return delete c.unary_ops[e], e.length === c.max_unop_len && (c.max_unop_len = c.getMaxKeyLen(c.unary_ops)), c;
127
+ return delete d.unary_ops[e], e.length === d.max_unop_len && (d.max_unop_len = d.getMaxKeyLen(d.unary_ops)), d;
128
128
  }
129
129
  /**
130
130
  * @method removeAllUnaryOps
131
131
  * @returns {Jsep}
132
132
  */
133
133
  static removeAllUnaryOps() {
134
- return c.unary_ops = {}, c.max_unop_len = 0, c;
134
+ return d.unary_ops = {}, d.max_unop_len = 0, d;
135
135
  }
136
136
  /**
137
137
  * @method removeIdentifierChar
@@ -139,7 +139,7 @@ class c {
139
139
  * @returns {Jsep}
140
140
  */
141
141
  static removeIdentifierChar(e) {
142
- return c.additional_identifier_chars.delete(e), c;
142
+ return d.additional_identifier_chars.delete(e), d;
143
143
  }
144
144
  /**
145
145
  * @method removeBinaryOp
@@ -147,14 +147,14 @@ class c {
147
147
  * @returns {Jsep}
148
148
  */
149
149
  static removeBinaryOp(e) {
150
- return delete c.binary_ops[e], e.length === c.max_binop_len && (c.max_binop_len = c.getMaxKeyLen(c.binary_ops)), c.right_associative.delete(e), c;
150
+ return delete d.binary_ops[e], e.length === d.max_binop_len && (d.max_binop_len = d.getMaxKeyLen(d.binary_ops)), d.right_associative.delete(e), d;
151
151
  }
152
152
  /**
153
153
  * @method removeAllBinaryOps
154
154
  * @returns {Jsep}
155
155
  */
156
156
  static removeAllBinaryOps() {
157
- return c.binary_ops = {}, c.max_binop_len = 0, c;
157
+ return d.binary_ops = {}, d.max_binop_len = 0, d;
158
158
  }
159
159
  /**
160
160
  * @method removeLiteral
@@ -162,14 +162,14 @@ class c {
162
162
  * @returns {Jsep}
163
163
  */
164
164
  static removeLiteral(e) {
165
- return delete c.literals[e], c;
165
+ return delete d.literals[e], d;
166
166
  }
167
167
  /**
168
168
  * @method removeAllLiterals
169
169
  * @returns {Jsep}
170
170
  */
171
171
  static removeAllLiterals() {
172
- return c.literals = {}, c;
172
+ return d.literals = {}, d;
173
173
  }
174
174
  // ==================== END CONFIG ============================
175
175
  /**
@@ -196,7 +196,7 @@ class c {
196
196
  * @returns {jsep.Expression}
197
197
  */
198
198
  static parse(e) {
199
- return new c(e).parse();
199
+ return new d(e).parse();
200
200
  }
201
201
  /**
202
202
  * Get the longest key length of any object
@@ -220,7 +220,7 @@ class c {
220
220
  * @returns {number}
221
221
  */
222
222
  static binaryPrecedence(e) {
223
- return c.binary_ops[e] || 0;
223
+ return d.binary_ops[e] || 0;
224
224
  }
225
225
  /**
226
226
  * Looks for start of identifier
@@ -230,15 +230,15 @@ class c {
230
230
  static isIdentifierStart(e) {
231
231
  return e >= 65 && e <= 90 || // A...Z
232
232
  e >= 97 && e <= 122 || // a...z
233
- e >= 128 && !c.binary_ops[String.fromCharCode(e)] || // any non-ASCII that is not an operator
234
- c.additional_identifier_chars.has(String.fromCharCode(e));
233
+ e >= 128 && !d.binary_ops[String.fromCharCode(e)] || // any non-ASCII that is not an operator
234
+ d.additional_identifier_chars.has(String.fromCharCode(e));
235
235
  }
236
236
  /**
237
237
  * @param {number} ch
238
238
  * @returns {boolean}
239
239
  */
240
240
  static isIdentifierPart(e) {
241
- return c.isIdentifierStart(e) || c.isDecimalDigit(e);
241
+ return d.isIdentifierStart(e) || d.isDecimalDigit(e);
242
242
  }
243
243
  /**
244
244
  * throw error at index of the expression
@@ -256,12 +256,12 @@ class c {
256
256
  * @returns {?jsep.Expression}
257
257
  */
258
258
  runHook(e, t) {
259
- if (c.hooks[e]) {
259
+ if (d.hooks[e]) {
260
260
  const s = {
261
261
  context: this,
262
262
  node: t
263
263
  };
264
- return c.hooks.run(e, s), s.node;
264
+ return d.hooks.run(e, s), s.node;
265
265
  }
266
266
  return t;
267
267
  }
@@ -271,11 +271,11 @@ class c {
271
271
  * @returns {?jsep.Expression}
272
272
  */
273
273
  searchHook(e) {
274
- if (c.hooks[e]) {
274
+ if (d.hooks[e]) {
275
275
  const t = {
276
276
  context: this
277
277
  };
278
- return c.hooks[e].find(function(s) {
278
+ return d.hooks[e].find(function(s) {
279
279
  return s.call(t.context, t), t.node;
280
280
  }), t.node;
281
281
  }
@@ -285,7 +285,7 @@ class c {
285
285
  */
286
286
  gobbleSpaces() {
287
287
  let e = this.code;
288
- for (; e === c.SPACE_CODE || e === c.TAB_CODE || e === c.LF_CODE || e === c.CR_CODE; )
288
+ for (; e === d.SPACE_CODE || e === d.TAB_CODE || e === d.LF_CODE || e === d.CR_CODE; )
289
289
  e = this.expr.charCodeAt(++this.index);
290
290
  this.runHook("gobble-spaces");
291
291
  }
@@ -296,7 +296,7 @@ class c {
296
296
  parse() {
297
297
  this.runHook("before-all");
298
298
  const e = this.gobbleExpressions(), t = e.length === 1 ? e[0] : {
299
- type: c.COMPOUND,
299
+ type: d.COMPOUND,
300
300
  body: e
301
301
  };
302
302
  return this.runHook("after-all", t);
@@ -309,7 +309,7 @@ class c {
309
309
  gobbleExpressions(e) {
310
310
  let t = [], s, n;
311
311
  for (; this.index < this.expr.length; )
312
- if (s = this.code, s === c.SEMCOL_CODE || s === c.COMMA_CODE)
312
+ if (s = this.code, s === d.SEMCOL_CODE || s === d.COMMA_CODE)
313
313
  this.index++;
314
314
  else if (n = this.gobbleExpression())
315
315
  t.push(n);
@@ -337,9 +337,9 @@ class c {
337
337
  */
338
338
  gobbleBinaryOp() {
339
339
  this.gobbleSpaces();
340
- let e = this.expr.substr(this.index, c.max_binop_len), t = e.length;
340
+ let e = this.expr.substr(this.index, d.max_binop_len), t = e.length;
341
341
  for (; t > 0; ) {
342
- if (c.binary_ops.hasOwnProperty(e) && (!c.isIdentifierStart(this.code) || this.index + e.length < this.expr.length && !c.isIdentifierPart(this.expr.charCodeAt(this.index + e.length))))
342
+ if (d.binary_ops.hasOwnProperty(e) && (!d.isIdentifierStart(this.code) || this.index + e.length < this.expr.length && !d.isIdentifierPart(this.expr.charCodeAt(this.index + e.length))))
343
343
  return this.index += t, e;
344
344
  e = e.substr(0, --t);
345
345
  }
@@ -356,22 +356,22 @@ class c {
356
356
  return i;
357
357
  for (o = {
358
358
  value: t,
359
- prec: c.binaryPrecedence(t),
360
- right_a: c.right_associative.has(t)
359
+ prec: d.binaryPrecedence(t),
360
+ right_a: d.right_associative.has(t)
361
361
  }, u = this.gobbleToken(), u || this.throwError("Expected expression after " + t), n = [i, o, u]; t = this.gobbleBinaryOp(); ) {
362
- if (s = c.binaryPrecedence(t), s === 0) {
362
+ if (s = d.binaryPrecedence(t), s === 0) {
363
363
  this.index -= t.length;
364
364
  break;
365
365
  }
366
366
  o = {
367
367
  value: t,
368
368
  prec: s,
369
- right_a: c.right_associative.has(t)
369
+ right_a: d.right_associative.has(t)
370
370
  }, l = t;
371
- const h = (f) => o.right_a && f.right_a ? s > f.prec : s <= f.prec;
372
- for (; n.length > 2 && h(n[n.length - 2]); )
371
+ const p = (h) => o.right_a && h.right_a ? s > h.prec : s <= h.prec;
372
+ for (; n.length > 2 && p(n[n.length - 2]); )
373
373
  u = n.pop(), t = n.pop().value, i = n.pop(), e = {
374
- type: c.BINARY_EXP,
374
+ type: d.BINARY_EXP,
375
375
  operator: t,
376
376
  left: i,
377
377
  right: u
@@ -380,7 +380,7 @@ class c {
380
380
  }
381
381
  for (a = n.length - 1, e = n[a]; a > 1; )
382
382
  e = {
383
- type: c.BINARY_EXP,
383
+ type: d.BINARY_EXP,
384
384
  operator: n[a - 1].value,
385
385
  left: n[a - 2],
386
386
  right: e
@@ -396,19 +396,19 @@ class c {
396
396
  let e, t, s, n;
397
397
  if (this.gobbleSpaces(), n = this.searchHook("gobble-token"), n)
398
398
  return this.runHook("after-token", n);
399
- if (e = this.code, c.isDecimalDigit(e) || e === c.PERIOD_CODE)
399
+ if (e = this.code, d.isDecimalDigit(e) || e === d.PERIOD_CODE)
400
400
  return this.gobbleNumericLiteral();
401
- if (e === c.SQUOTE_CODE || e === c.DQUOTE_CODE)
401
+ if (e === d.SQUOTE_CODE || e === d.DQUOTE_CODE)
402
402
  n = this.gobbleStringLiteral();
403
- else if (e === c.OBRACK_CODE)
403
+ else if (e === d.OBRACK_CODE)
404
404
  n = this.gobbleArray();
405
405
  else {
406
- for (t = this.expr.substr(this.index, c.max_unop_len), s = t.length; s > 0; ) {
407
- if (c.unary_ops.hasOwnProperty(t) && (!c.isIdentifierStart(this.code) || this.index + t.length < this.expr.length && !c.isIdentifierPart(this.expr.charCodeAt(this.index + t.length)))) {
406
+ for (t = this.expr.substr(this.index, d.max_unop_len), s = t.length; s > 0; ) {
407
+ if (d.unary_ops.hasOwnProperty(t) && (!d.isIdentifierStart(this.code) || this.index + t.length < this.expr.length && !d.isIdentifierPart(this.expr.charCodeAt(this.index + t.length)))) {
408
408
  this.index += s;
409
409
  const o = this.gobbleToken();
410
410
  return o || this.throwError("missing unaryOp argument"), this.runHook("after-token", {
411
- type: c.UNARY_EXP,
411
+ type: d.UNARY_EXP,
412
412
  operator: t,
413
413
  argument: o,
414
414
  prefix: !0
@@ -416,13 +416,13 @@ class c {
416
416
  }
417
417
  t = t.substr(0, --s);
418
418
  }
419
- c.isIdentifierStart(e) ? (n = this.gobbleIdentifier(), c.literals.hasOwnProperty(n.name) ? n = {
420
- type: c.LITERAL,
421
- value: c.literals[n.name],
419
+ d.isIdentifierStart(e) ? (n = this.gobbleIdentifier(), d.literals.hasOwnProperty(n.name) ? n = {
420
+ type: d.LITERAL,
421
+ value: d.literals[n.name],
422
422
  raw: n.name
423
- } : n.name === c.this_str && (n = {
424
- type: c.THIS_EXP
425
- })) : e === c.OPAREN_CODE && (n = this.gobbleGroup());
423
+ } : n.name === d.this_str && (n = {
424
+ type: d.THIS_EXP
425
+ })) : e === d.OPAREN_CODE && (n = this.gobbleGroup());
426
426
  }
427
427
  return n ? (n = this.gobbleTokenProperty(n), this.runHook("after-token", n)) : this.runHook("after-token", !1);
428
428
  }
@@ -437,24 +437,24 @@ class c {
437
437
  gobbleTokenProperty(e) {
438
438
  this.gobbleSpaces();
439
439
  let t = this.code;
440
- for (; t === c.PERIOD_CODE || t === c.OBRACK_CODE || t === c.OPAREN_CODE || t === c.QUMARK_CODE; ) {
440
+ for (; t === d.PERIOD_CODE || t === d.OBRACK_CODE || t === d.OPAREN_CODE || t === d.QUMARK_CODE; ) {
441
441
  let s;
442
- if (t === c.QUMARK_CODE) {
443
- if (this.expr.charCodeAt(this.index + 1) !== c.PERIOD_CODE)
442
+ if (t === d.QUMARK_CODE) {
443
+ if (this.expr.charCodeAt(this.index + 1) !== d.PERIOD_CODE)
444
444
  break;
445
445
  s = !0, this.index += 2, this.gobbleSpaces(), t = this.code;
446
446
  }
447
- this.index++, t === c.OBRACK_CODE ? (e = {
448
- type: c.MEMBER_EXP,
447
+ this.index++, t === d.OBRACK_CODE ? (e = {
448
+ type: d.MEMBER_EXP,
449
449
  computed: !0,
450
450
  object: e,
451
451
  property: this.gobbleExpression()
452
- }, e.property || this.throwError('Unexpected "' + this.char + '"'), this.gobbleSpaces(), t = this.code, t !== c.CBRACK_CODE && this.throwError("Unclosed ["), this.index++) : t === c.OPAREN_CODE ? e = {
453
- type: c.CALL_EXP,
454
- arguments: this.gobbleArguments(c.CPAREN_CODE),
452
+ }, e.property || this.throwError('Unexpected "' + this.char + '"'), this.gobbleSpaces(), t = this.code, t !== d.CBRACK_CODE && this.throwError("Unclosed ["), this.index++) : t === d.OPAREN_CODE ? e = {
453
+ type: d.CALL_EXP,
454
+ arguments: this.gobbleArguments(d.CPAREN_CODE),
455
455
  callee: e
456
- } : (t === c.PERIOD_CODE || s) && (s && this.index--, this.gobbleSpaces(), e = {
457
- type: c.MEMBER_EXP,
456
+ } : (t === d.PERIOD_CODE || s) && (s && this.index--, this.gobbleSpaces(), e = {
457
+ type: d.MEMBER_EXP,
458
458
  computed: !1,
459
459
  object: e,
460
460
  property: this.gobbleIdentifier()
@@ -469,18 +469,18 @@ class c {
469
469
  */
470
470
  gobbleNumericLiteral() {
471
471
  let e = "", t, s;
472
- for (; c.isDecimalDigit(this.code); )
472
+ for (; d.isDecimalDigit(this.code); )
473
473
  e += this.expr.charAt(this.index++);
474
- if (this.code === c.PERIOD_CODE)
475
- for (e += this.expr.charAt(this.index++); c.isDecimalDigit(this.code); )
474
+ if (this.code === d.PERIOD_CODE)
475
+ for (e += this.expr.charAt(this.index++); d.isDecimalDigit(this.code); )
476
476
  e += this.expr.charAt(this.index++);
477
477
  if (t = this.char, t === "e" || t === "E") {
478
- for (e += this.expr.charAt(this.index++), t = this.char, (t === "+" || t === "-") && (e += this.expr.charAt(this.index++)); c.isDecimalDigit(this.code); )
478
+ for (e += this.expr.charAt(this.index++), t = this.char, (t === "+" || t === "-") && (e += this.expr.charAt(this.index++)); d.isDecimalDigit(this.code); )
479
479
  e += this.expr.charAt(this.index++);
480
- c.isDecimalDigit(this.expr.charCodeAt(this.index - 1)) || this.throwError("Expected exponent (" + e + this.char + ")");
480
+ d.isDecimalDigit(this.expr.charCodeAt(this.index - 1)) || this.throwError("Expected exponent (" + e + this.char + ")");
481
481
  }
482
- return s = this.code, c.isIdentifierStart(s) ? this.throwError("Variable names cannot start with a number (" + e + this.char + ")") : (s === c.PERIOD_CODE || e.length === 1 && e.charCodeAt(0) === c.PERIOD_CODE) && this.throwError("Unexpected period"), {
483
- type: c.LITERAL,
482
+ return s = this.code, d.isIdentifierStart(s) ? this.throwError("Variable names cannot start with a number (" + e + this.char + ")") : (s === d.PERIOD_CODE || e.length === 1 && e.charCodeAt(0) === d.PERIOD_CODE) && this.throwError("Unexpected period"), {
483
+ type: d.LITERAL,
484
484
  value: parseFloat(e),
485
485
  raw: e
486
486
  };
@@ -527,7 +527,7 @@ class c {
527
527
  e += o;
528
528
  }
529
529
  return n || this.throwError('Unclosed quote after "' + e + '"'), {
530
- type: c.LITERAL,
530
+ type: d.LITERAL,
531
531
  value: e,
532
532
  raw: this.expr.substring(t, this.index)
533
533
  };
@@ -541,10 +541,10 @@ class c {
541
541
  */
542
542
  gobbleIdentifier() {
543
543
  let e = this.code, t = this.index;
544
- for (c.isIdentifierStart(e) ? this.index++ : this.throwError("Unexpected " + this.char); this.index < this.expr.length && (e = this.code, c.isIdentifierPart(e)); )
544
+ for (d.isIdentifierStart(e) ? this.index++ : this.throwError("Unexpected " + this.char); this.index < this.expr.length && (e = this.code, d.isIdentifierPart(e)); )
545
545
  this.index++;
546
546
  return {
547
- type: c.IDENTIFIER,
547
+ type: d.IDENTIFIER,
548
548
  name: this.expr.slice(t, this.index)
549
549
  };
550
550
  }
@@ -564,13 +564,13 @@ class c {
564
564
  this.gobbleSpaces();
565
565
  let o = this.code;
566
566
  if (o === e) {
567
- s = !0, this.index++, e === c.CPAREN_CODE && n && n >= t.length && this.throwError("Unexpected token " + String.fromCharCode(e));
567
+ s = !0, this.index++, e === d.CPAREN_CODE && n && n >= t.length && this.throwError("Unexpected token " + String.fromCharCode(e));
568
568
  break;
569
- } else if (o === c.COMMA_CODE) {
569
+ } else if (o === d.COMMA_CODE) {
570
570
  if (this.index++, n++, n !== t.length) {
571
- if (e === c.CPAREN_CODE)
571
+ if (e === d.CPAREN_CODE)
572
572
  this.throwError("Unexpected token ,");
573
- else if (e === c.CBRACK_CODE)
573
+ else if (e === d.CBRACK_CODE)
574
574
  for (let i = t.length; i < n; i++)
575
575
  t.push(null);
576
576
  }
@@ -578,7 +578,7 @@ class c {
578
578
  this.throwError("Expected comma");
579
579
  else {
580
580
  const i = this.gobbleExpression();
581
- (!i || i.type === c.COMPOUND) && this.throwError("Expected comma"), t.push(i);
581
+ (!i || i.type === d.COMPOUND) && this.throwError("Expected comma"), t.push(i);
582
582
  }
583
583
  }
584
584
  return s || this.throwError("Expected " + String.fromCharCode(e)), t;
@@ -594,10 +594,10 @@ class c {
594
594
  */
595
595
  gobbleGroup() {
596
596
  this.index++;
597
- let e = this.gobbleExpressions(c.CPAREN_CODE);
598
- if (this.code === c.CPAREN_CODE)
597
+ let e = this.gobbleExpressions(d.CPAREN_CODE);
598
+ if (this.code === d.CPAREN_CODE)
599
599
  return this.index++, e.length === 1 ? e[0] : e.length ? {
600
- type: c.SEQUENCE_EXP,
600
+ type: d.SEQUENCE_EXP,
601
601
  expressions: e
602
602
  } : !1;
603
603
  this.throwError("Unclosed (");
@@ -610,15 +610,15 @@ class c {
610
610
  */
611
611
  gobbleArray() {
612
612
  return this.index++, {
613
- type: c.ARRAY_EXP,
614
- elements: this.gobbleArguments(c.CBRACK_CODE)
613
+ type: d.ARRAY_EXP,
614
+ elements: this.gobbleArguments(d.CBRACK_CODE)
615
615
  };
616
616
  }
617
617
  }
618
618
  const tt = new Je();
619
- Object.assign(c, {
619
+ Object.assign(d, {
620
620
  hooks: tt,
621
- plugins: new et(c),
621
+ plugins: new et(d),
622
622
  // Node Types
623
623
  // ----------
624
624
  // This is the full set of types that any JSEP node can be.
@@ -712,14 +712,14 @@ Object.assign(c, {
712
712
  // Except for `this`, which is special. This could be changed to something like `'self'` as well
713
713
  this_str: "this"
714
714
  });
715
- c.max_unop_len = c.getMaxKeyLen(c.unary_ops);
716
- c.max_binop_len = c.getMaxKeyLen(c.binary_ops);
717
- const te = (r) => new c(r).parse(), rt = Object.getOwnPropertyNames(class {
715
+ d.max_unop_len = d.getMaxKeyLen(d.unary_ops);
716
+ d.max_binop_len = d.getMaxKeyLen(d.binary_ops);
717
+ const J = (r) => new d(r).parse(), rt = Object.getOwnPropertyNames(class {
718
718
  });
719
- Object.getOwnPropertyNames(c).filter((r) => !rt.includes(r) && te[r] === void 0).forEach((r) => {
720
- te[r] = c[r];
719
+ Object.getOwnPropertyNames(d).filter((r) => !rt.includes(r) && J[r] === void 0).forEach((r) => {
720
+ J[r] = d[r];
721
721
  });
722
- te.Jsep = c;
722
+ J.Jsep = d;
723
723
  const nt = "ConditionalExpression";
724
724
  var st = {
725
725
  name: "ternary",
@@ -748,17 +748,17 @@ var st = {
748
748
  });
749
749
  }
750
750
  };
751
- te.plugins.register(st);
752
- const Ie = 47, ot = 92;
751
+ J.plugins.register(st);
752
+ const Se = 47, ot = 92;
753
753
  var it = {
754
754
  name: "regex",
755
755
  init(r) {
756
756
  r.hooks.add("gobble-token", function(t) {
757
- if (this.code === Ie) {
757
+ if (this.code === Se) {
758
758
  const s = ++this.index;
759
759
  let n = !1;
760
760
  for (; this.index < this.expr.length; ) {
761
- if (this.code === Ie && !n) {
761
+ if (this.code === Se && !n) {
762
762
  const o = this.expr.slice(s, this.index);
763
763
  let i = "";
764
764
  for (; ++this.index < this.expr.length; ) {
@@ -787,27 +787,27 @@ var it = {
787
787
  });
788
788
  }
789
789
  };
790
- const Ne = 43, at = 45, ce = {
790
+ const ke = 43, at = 45, fe = {
791
791
  name: "assignment",
792
792
  assignmentOperators: /* @__PURE__ */ new Set(["=", "*=", "**=", "/=", "%=", "+=", "-=", "<<=", ">>=", ">>>=", "&=", "^=", "|=", "||=", "&&=", "??="]),
793
- updateOperators: [Ne, at],
793
+ updateOperators: [ke, at],
794
794
  assignmentPrecedence: 0.9,
795
795
  init(r) {
796
796
  const e = [r.IDENTIFIER, r.MEMBER_EXP];
797
- ce.assignmentOperators.forEach((s) => r.addBinaryOp(s, ce.assignmentPrecedence, !0)), r.hooks.add("gobble-token", function(n) {
797
+ fe.assignmentOperators.forEach((s) => r.addBinaryOp(s, fe.assignmentPrecedence, !0)), r.hooks.add("gobble-token", function(n) {
798
798
  const o = this.code;
799
- ce.updateOperators.some((i) => i === o && i === this.expr.charCodeAt(this.index + 1)) && (this.index += 2, n.node = {
799
+ fe.updateOperators.some((i) => i === o && i === this.expr.charCodeAt(this.index + 1)) && (this.index += 2, n.node = {
800
800
  type: "UpdateExpression",
801
- operator: o === Ne ? "++" : "--",
801
+ operator: o === ke ? "++" : "--",
802
802
  argument: this.gobbleTokenProperty(this.gobbleIdentifier()),
803
803
  prefix: !0
804
804
  }, (!n.node.argument || !e.includes(n.node.argument.type)) && this.throwError(`Unexpected ${n.node.operator}`));
805
805
  }), r.hooks.add("after-token", function(n) {
806
806
  if (n.node) {
807
807
  const o = this.code;
808
- ce.updateOperators.some((i) => i === o && i === this.expr.charCodeAt(this.index + 1)) && (e.includes(n.node.type) || this.throwError(`Unexpected ${n.node.operator}`), this.index += 2, n.node = {
808
+ fe.updateOperators.some((i) => i === o && i === this.expr.charCodeAt(this.index + 1)) && (e.includes(n.node.type) || this.throwError(`Unexpected ${n.node.operator}`), this.index += 2, n.node = {
809
809
  type: "UpdateExpression",
810
- operator: o === Ne ? "++" : "--",
810
+ operator: o === ke ? "++" : "--",
811
811
  argument: n.node,
812
812
  prefix: !1
813
813
  });
@@ -816,17 +816,17 @@ const Ne = 43, at = 45, ce = {
816
816
  n.node && t(n.node);
817
817
  });
818
818
  function t(s) {
819
- ce.assignmentOperators.has(s.operator) ? (s.type = "AssignmentExpression", t(s.left), t(s.right)) : s.operator || Object.values(s).forEach((n) => {
819
+ fe.assignmentOperators.has(s.operator) ? (s.type = "AssignmentExpression", t(s.left), t(s.right)) : s.operator || Object.values(s).forEach((n) => {
820
820
  n && typeof n == "object" && t(n);
821
821
  });
822
822
  }
823
823
  }
824
824
  };
825
- te.plugins.register(it, ce);
826
- te.addUnaryOp("typeof");
827
- te.addLiteral("null", null);
828
- te.addLiteral("undefined", void 0);
829
- const lt = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter__", "__defineSetter__"]), M = {
825
+ J.plugins.register(it, fe);
826
+ J.addUnaryOp("typeof");
827
+ J.addLiteral("null", null);
828
+ J.addLiteral("undefined", void 0);
829
+ const lt = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter__", "__defineSetter__"]), R = {
830
830
  /**
831
831
  * @param {jsep.Expression} ast
832
832
  * @param {Record<string, any>} subs
@@ -835,25 +835,25 @@ const lt = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter_
835
835
  switch (r.type) {
836
836
  case "BinaryExpression":
837
837
  case "LogicalExpression":
838
- return M.evalBinaryExpression(r, e);
838
+ return R.evalBinaryExpression(r, e);
839
839
  case "Compound":
840
- return M.evalCompound(r, e);
840
+ return R.evalCompound(r, e);
841
841
  case "ConditionalExpression":
842
- return M.evalConditionalExpression(r, e);
842
+ return R.evalConditionalExpression(r, e);
843
843
  case "Identifier":
844
- return M.evalIdentifier(r, e);
844
+ return R.evalIdentifier(r, e);
845
845
  case "Literal":
846
- return M.evalLiteral(r, e);
846
+ return R.evalLiteral(r, e);
847
847
  case "MemberExpression":
848
- return M.evalMemberExpression(r, e);
848
+ return R.evalMemberExpression(r, e);
849
849
  case "UnaryExpression":
850
- return M.evalUnaryExpression(r, e);
850
+ return R.evalUnaryExpression(r, e);
851
851
  case "ArrayExpression":
852
- return M.evalArrayExpression(r, e);
852
+ return R.evalArrayExpression(r, e);
853
853
  case "CallExpression":
854
- return M.evalCallExpression(r, e);
854
+ return R.evalCallExpression(r, e);
855
855
  case "AssignmentExpression":
856
- return M.evalAssignmentExpression(r, e);
856
+ return R.evalAssignmentExpression(r, e);
857
857
  default:
858
858
  throw SyntaxError("Unexpected expression", r);
859
859
  }
@@ -883,19 +883,19 @@ const lt = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter_
883
883
  "*": (s, n) => s * n(),
884
884
  "/": (s, n) => s / n(),
885
885
  "%": (s, n) => s % n()
886
- }[r.operator](M.evalAst(r.left, e), () => M.evalAst(r.right, e));
886
+ }[r.operator](R.evalAst(r.left, e), () => R.evalAst(r.right, e));
887
887
  },
888
888
  evalCompound(r, e) {
889
889
  let t;
890
890
  for (let s = 0; s < r.body.length; s++) {
891
891
  r.body[s].type === "Identifier" && ["var", "let", "const"].includes(r.body[s].name) && r.body[s + 1] && r.body[s + 1].type === "AssignmentExpression" && (s += 1);
892
892
  const n = r.body[s];
893
- t = M.evalAst(n, e);
893
+ t = R.evalAst(n, e);
894
894
  }
895
895
  return t;
896
896
  },
897
897
  evalConditionalExpression(r, e) {
898
- return M.evalAst(r.test, e) ? M.evalAst(r.consequent, e) : M.evalAst(r.alternate, e);
898
+ return R.evalAst(r.test, e) ? R.evalAst(r.consequent, e) : R.evalAst(r.alternate, e);
899
899
  },
900
900
  evalIdentifier(r, e) {
901
901
  if (Object.hasOwn(e, r.name))
@@ -910,9 +910,9 @@ const lt = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter_
910
910
  // NOTE: `String(value)` throws error when
911
911
  // value has overwritten the toString method to return non-string
912
912
  // i.e. `value = {toString: () => []}`
913
- r.computed ? M.evalAst(r.property) : r.property.name
913
+ r.computed ? R.evalAst(r.property) : r.property.name
914
914
  // `object.property` property is Identifier
915
- ), s = M.evalAst(r.object, e);
915
+ ), s = R.evalAst(r.object, e);
916
916
  if (s == null)
917
917
  throw TypeError(`Cannot read properties of ${s} (reading '${t}')`);
918
918
  if (!Object.hasOwn(s, t) && lt.has(t))
@@ -922,25 +922,25 @@ const lt = /* @__PURE__ */ new Set(["constructor", "__proto__", "__defineGetter_
922
922
  },
923
923
  evalUnaryExpression(r, e) {
924
924
  return {
925
- "-": (s) => -M.evalAst(s, e),
926
- "!": (s) => !M.evalAst(s, e),
927
- "~": (s) => ~M.evalAst(s, e),
925
+ "-": (s) => -R.evalAst(s, e),
926
+ "!": (s) => !R.evalAst(s, e),
927
+ "~": (s) => ~R.evalAst(s, e),
928
928
  // eslint-disable-next-line no-implicit-coercion -- API
929
- "+": (s) => +M.evalAst(s, e),
930
- typeof: (s) => typeof M.evalAst(s, e)
929
+ "+": (s) => +R.evalAst(s, e),
930
+ typeof: (s) => typeof R.evalAst(s, e)
931
931
  }[r.operator](r.argument);
932
932
  },
933
933
  evalArrayExpression(r, e) {
934
- return r.elements.map((t) => M.evalAst(t, e));
934
+ return r.elements.map((t) => R.evalAst(t, e));
935
935
  },
936
936
  evalCallExpression(r, e) {
937
- const t = r.arguments.map((n) => M.evalAst(n, e));
938
- return M.evalAst(r.callee, e)(...t);
937
+ const t = r.arguments.map((n) => R.evalAst(n, e));
938
+ return R.evalAst(r.callee, e)(...t);
939
939
  },
940
940
  evalAssignmentExpression(r, e) {
941
941
  if (r.left.type !== "Identifier")
942
942
  throw SyntaxError("Invalid left-hand side in assignment");
943
- const t = r.left.name, s = M.evalAst(r.right, e);
943
+ const t = r.left.name, s = R.evalAst(r.right, e);
944
944
  return e[t] = s, e[t];
945
945
  }
946
946
  };
@@ -949,7 +949,7 @@ class ut {
949
949
  * @param {string} expr Expression to evaluate
950
950
  */
951
951
  constructor(e) {
952
- this.code = e, this.ast = te(this.code);
952
+ this.code = e, this.ast = J(this.code);
953
953
  }
954
954
  /**
955
955
  * @param {object} context Object whose items will be added
@@ -958,7 +958,7 @@ class ut {
958
958
  */
959
959
  runInNewContext(e) {
960
960
  const t = Object.assign(/* @__PURE__ */ Object.create(null), e);
961
- return M.evalAst(this.ast, t);
961
+ return R.evalAst(this.ast, t);
962
962
  }
963
963
  }
964
964
  function re(r, e) {
@@ -975,10 +975,10 @@ class ct extends Error {
975
975
  super('JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'), this.avoidNew = !0, this.value = e, this.name = "NewError";
976
976
  }
977
977
  }
978
- function B(r, e, t, s, n) {
979
- if (!(this instanceof B))
978
+ function L(r, e, t, s, n) {
979
+ if (!(this instanceof L))
980
980
  try {
981
- return new B(r, e, t, s, n);
981
+ return new L(r, e, t, s, n);
982
982
  } catch (i) {
983
983
  if (!i.avoidNew)
984
984
  throw i;
@@ -999,7 +999,7 @@ function B(r, e, t, s, n) {
999
999
  return u;
1000
1000
  }
1001
1001
  }
1002
- B.prototype.evaluate = function(r, e, t, s) {
1002
+ L.prototype.evaluate = function(r, e, t, s) {
1003
1003
  let n = this.parent, o = this.parentProperty, {
1004
1004
  flatten: i,
1005
1005
  wrap: u
@@ -1013,44 +1013,44 @@ B.prototype.evaluate = function(r, e, t, s) {
1013
1013
  json: e
1014
1014
  } = r), i = Object.hasOwn(r, "flatten") ? r.flatten : i, this.currResultType = Object.hasOwn(r, "resultType") ? r.resultType : this.currResultType, this.currSandbox = Object.hasOwn(r, "sandbox") ? r.sandbox : this.currSandbox, u = Object.hasOwn(r, "wrap") ? r.wrap : u, this.currEval = Object.hasOwn(r, "eval") ? r.eval : this.currEval, t = Object.hasOwn(r, "callback") ? r.callback : t, this.currOtherTypeCallback = Object.hasOwn(r, "otherTypeCallback") ? r.otherTypeCallback : this.currOtherTypeCallback, n = Object.hasOwn(r, "parent") ? r.parent : n, o = Object.hasOwn(r, "parentProperty") ? r.parentProperty : o, r = r.path;
1015
1015
  }
1016
- if (n = n || null, o = o || null, Array.isArray(r) && (r = B.toPathString(r)), !r && r !== "" || !e)
1016
+ if (n = n || null, o = o || null, Array.isArray(r) && (r = L.toPathString(r)), !r && r !== "" || !e)
1017
1017
  return;
1018
- const a = B.toPathArray(r);
1018
+ const a = L.toPathArray(r);
1019
1019
  a[0] === "$" && a.length > 1 && a.shift(), this._hasParentSelector = null;
1020
- const l = this._trace(a, e, ["$"], n, o, t).filter(function(h) {
1021
- return h && !h.isParentSelector;
1020
+ const l = this._trace(a, e, ["$"], n, o, t).filter(function(p) {
1021
+ return p && !p.isParentSelector;
1022
1022
  });
1023
- return l.length ? !u && l.length === 1 && !l[0].hasArrExpr ? this._getPreferredOutput(l[0]) : l.reduce((h, f) => {
1024
- const b = this._getPreferredOutput(f);
1025
- return i && Array.isArray(b) ? h = h.concat(b) : h.push(b), h;
1023
+ return l.length ? !u && l.length === 1 && !l[0].hasArrExpr ? this._getPreferredOutput(l[0]) : l.reduce((p, h) => {
1024
+ const v = this._getPreferredOutput(h);
1025
+ return i && Array.isArray(v) ? p = p.concat(v) : p.push(v), p;
1026
1026
  }, []) : u ? [] : void 0;
1027
1027
  };
1028
- B.prototype._getPreferredOutput = function(r) {
1028
+ L.prototype._getPreferredOutput = function(r) {
1029
1029
  const e = this.currResultType;
1030
1030
  switch (e) {
1031
1031
  case "all": {
1032
- const t = Array.isArray(r.path) ? r.path : B.toPathArray(r.path);
1033
- return r.pointer = B.toPointer(t), r.path = typeof r.path == "string" ? r.path : B.toPathString(r.path), r;
1032
+ const t = Array.isArray(r.path) ? r.path : L.toPathArray(r.path);
1033
+ return r.pointer = L.toPointer(t), r.path = typeof r.path == "string" ? r.path : L.toPathString(r.path), r;
1034
1034
  }
1035
1035
  case "value":
1036
1036
  case "parent":
1037
1037
  case "parentProperty":
1038
1038
  return r[e];
1039
1039
  case "path":
1040
- return B.toPathString(r[e]);
1040
+ return L.toPathString(r[e]);
1041
1041
  case "pointer":
1042
- return B.toPointer(r.path);
1042
+ return L.toPointer(r.path);
1043
1043
  default:
1044
1044
  throw new TypeError("Unknown result type");
1045
1045
  }
1046
1046
  };
1047
- B.prototype._handleCallback = function(r, e, t) {
1047
+ L.prototype._handleCallback = function(r, e, t) {
1048
1048
  if (e) {
1049
1049
  const s = this._getPreferredOutput(r);
1050
- r.path = typeof r.path == "string" ? r.path : B.toPathString(r.path), e(s, t, r);
1050
+ r.path = typeof r.path == "string" ? r.path : L.toPathString(r.path), e(s, t, r);
1051
1051
  }
1052
1052
  };
1053
- B.prototype._trace = function(r, e, t, s, n, o, i, u) {
1053
+ L.prototype._trace = function(r, e, t, s, n, o, i, u) {
1054
1054
  let a;
1055
1055
  if (!r.length)
1056
1056
  return a = {
@@ -1060,27 +1060,27 @@ B.prototype._trace = function(r, e, t, s, n, o, i, u) {
1060
1060
  parentProperty: n,
1061
1061
  hasArrExpr: i
1062
1062
  }, this._handleCallback(a, o, "value"), a;
1063
- const l = r[0], h = r.slice(1), f = [];
1064
- function b(m) {
1065
- Array.isArray(m) ? m.forEach((w) => {
1066
- f.push(w);
1067
- }) : f.push(m);
1063
+ const l = r[0], p = r.slice(1), h = [];
1064
+ function v(b) {
1065
+ Array.isArray(b) ? b.forEach((A) => {
1066
+ h.push(A);
1067
+ }) : h.push(b);
1068
1068
  }
1069
1069
  if ((typeof l != "string" || u) && e && Object.hasOwn(e, l))
1070
- b(this._trace(h, e[l], re(t, l), e, l, o, i));
1070
+ v(this._trace(p, e[l], re(t, l), e, l, o, i));
1071
1071
  else if (l === "*")
1072
- this._walk(e, (m) => {
1073
- b(this._trace(h, e[m], re(t, m), e, m, o, !0, !0));
1072
+ this._walk(e, (b) => {
1073
+ v(this._trace(p, e[b], re(t, b), e, b, o, !0, !0));
1074
1074
  });
1075
1075
  else if (l === "..")
1076
- b(this._trace(h, e, t, s, n, o, i)), this._walk(e, (m) => {
1077
- typeof e[m] == "object" && b(this._trace(r.slice(), e[m], re(t, m), e, m, o, !0));
1076
+ v(this._trace(p, e, t, s, n, o, i)), this._walk(e, (b) => {
1077
+ typeof e[b] == "object" && v(this._trace(r.slice(), e[b], re(t, b), e, b, o, !0));
1078
1078
  });
1079
1079
  else {
1080
1080
  if (l === "^")
1081
1081
  return this._hasParentSelector = !0, {
1082
1082
  path: t.slice(0, -1),
1083
- expr: h,
1083
+ expr: p,
1084
1084
  isParentSelector: !0
1085
1085
  };
1086
1086
  if (l === "~")
@@ -1091,62 +1091,62 @@ B.prototype._trace = function(r, e, t, s, n, o, i, u) {
1091
1091
  parentProperty: null
1092
1092
  }, this._handleCallback(a, o, "property"), a;
1093
1093
  if (l === "$")
1094
- b(this._trace(h, e, t, null, null, o, i));
1094
+ v(this._trace(p, e, t, null, null, o, i));
1095
1095
  else if (/^(-?\d*):(-?\d*):?(\d*)$/u.test(l))
1096
- b(this._slice(l, h, e, t, s, n, o));
1096
+ v(this._slice(l, p, e, t, s, n, o));
1097
1097
  else if (l.indexOf("?(") === 0) {
1098
1098
  if (this.currEval === !1)
1099
1099
  throw new Error("Eval [?(expr)] prevented in JSONPath expression.");
1100
- const m = l.replace(/^\?\((.*?)\)$/u, "$1"), w = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(m);
1101
- w ? this._walk(e, (S) => {
1102
- const _ = [w[2]], j = w[1] ? e[S][w[1]] : e[S];
1103
- this._trace(_, j, t, s, n, o, !0).length > 0 && b(this._trace(h, e[S], re(t, S), e, S, o, !0));
1104
- }) : this._walk(e, (S) => {
1105
- this._eval(m, e[S], S, t, s, n) && b(this._trace(h, e[S], re(t, S), e, S, o, !0));
1100
+ const b = l.replace(/^\?\((.*?)\)$/u, "$1"), A = /@.?([^?]*)[['](\??\(.*?\))(?!.\)\])[\]']/gu.exec(b);
1101
+ A ? this._walk(e, (P) => {
1102
+ const k = [A[2]], S = A[1] ? e[P][A[1]] : e[P];
1103
+ this._trace(k, S, t, s, n, o, !0).length > 0 && v(this._trace(p, e[P], re(t, P), e, P, o, !0));
1104
+ }) : this._walk(e, (P) => {
1105
+ this._eval(b, e[P], P, t, s, n) && v(this._trace(p, e[P], re(t, P), e, P, o, !0));
1106
1106
  });
1107
1107
  } else if (l[0] === "(") {
1108
1108
  if (this.currEval === !1)
1109
1109
  throw new Error("Eval [(expr)] prevented in JSONPath expression.");
1110
- b(this._trace(Ae(this._eval(l, e, t.at(-1), t.slice(0, -1), s, n), h), e, t, s, n, o, i));
1110
+ v(this._trace(Ae(this._eval(l, e, t.at(-1), t.slice(0, -1), s, n), p), e, t, s, n, o, i));
1111
1111
  } else if (l[0] === "@") {
1112
- let m = !1;
1113
- const w = l.slice(1, -2);
1114
- switch (w) {
1112
+ let b = !1;
1113
+ const A = l.slice(1, -2);
1114
+ switch (A) {
1115
1115
  case "scalar":
1116
- (!e || !["object", "function"].includes(typeof e)) && (m = !0);
1116
+ (!e || !["object", "function"].includes(typeof e)) && (b = !0);
1117
1117
  break;
1118
1118
  case "boolean":
1119
1119
  case "string":
1120
1120
  case "undefined":
1121
1121
  case "function":
1122
- typeof e === w && (m = !0);
1122
+ typeof e === A && (b = !0);
1123
1123
  break;
1124
1124
  case "integer":
1125
- Number.isFinite(e) && !(e % 1) && (m = !0);
1125
+ Number.isFinite(e) && !(e % 1) && (b = !0);
1126
1126
  break;
1127
1127
  case "number":
1128
- Number.isFinite(e) && (m = !0);
1128
+ Number.isFinite(e) && (b = !0);
1129
1129
  break;
1130
1130
  case "nonFinite":
1131
- typeof e == "number" && !Number.isFinite(e) && (m = !0);
1131
+ typeof e == "number" && !Number.isFinite(e) && (b = !0);
1132
1132
  break;
1133
1133
  case "object":
1134
- e && typeof e === w && (m = !0);
1134
+ e && typeof e === A && (b = !0);
1135
1135
  break;
1136
1136
  case "array":
1137
- Array.isArray(e) && (m = !0);
1137
+ Array.isArray(e) && (b = !0);
1138
1138
  break;
1139
1139
  case "other":
1140
- m = this.currOtherTypeCallback(e, t, s, n);
1140
+ b = this.currOtherTypeCallback(e, t, s, n);
1141
1141
  break;
1142
1142
  case "null":
1143
- e === null && (m = !0);
1143
+ e === null && (b = !0);
1144
1144
  break;
1145
1145
  /* c8 ignore next 2 */
1146
1146
  default:
1147
- throw new TypeError("Unknown value type " + w);
1147
+ throw new TypeError("Unknown value type " + A);
1148
1148
  }
1149
- if (m)
1149
+ if (b)
1150
1150
  return a = {
1151
1151
  path: t,
1152
1152
  value: e,
@@ -1154,31 +1154,31 @@ B.prototype._trace = function(r, e, t, s, n, o, i, u) {
1154
1154
  parentProperty: n
1155
1155
  }, this._handleCallback(a, o, "value"), a;
1156
1156
  } else if (l[0] === "`" && e && Object.hasOwn(e, l.slice(1))) {
1157
- const m = l.slice(1);
1158
- b(this._trace(h, e[m], re(t, m), e, m, o, i, !0));
1157
+ const b = l.slice(1);
1158
+ v(this._trace(p, e[b], re(t, b), e, b, o, i, !0));
1159
1159
  } else if (l.includes(",")) {
1160
- const m = l.split(",");
1161
- for (const w of m)
1162
- b(this._trace(Ae(w, h), e, t, s, n, o, !0));
1163
- } else !u && e && Object.hasOwn(e, l) && b(this._trace(h, e[l], re(t, l), e, l, o, i, !0));
1160
+ const b = l.split(",");
1161
+ for (const A of b)
1162
+ v(this._trace(Ae(A, p), e, t, s, n, o, !0));
1163
+ } else !u && e && Object.hasOwn(e, l) && v(this._trace(p, e[l], re(t, l), e, l, o, i, !0));
1164
1164
  }
1165
1165
  if (this._hasParentSelector)
1166
- for (let m = 0; m < f.length; m++) {
1167
- const w = f[m];
1168
- if (w && w.isParentSelector) {
1169
- const S = this._trace(w.expr, e, w.path, s, n, o, i);
1170
- if (Array.isArray(S)) {
1171
- f[m] = S[0];
1172
- const _ = S.length;
1173
- for (let j = 1; j < _; j++)
1174
- m++, f.splice(m, 0, S[j]);
1166
+ for (let b = 0; b < h.length; b++) {
1167
+ const A = h[b];
1168
+ if (A && A.isParentSelector) {
1169
+ const P = this._trace(A.expr, e, A.path, s, n, o, i);
1170
+ if (Array.isArray(P)) {
1171
+ h[b] = P[0];
1172
+ const k = P.length;
1173
+ for (let S = 1; S < k; S++)
1174
+ b++, h.splice(b, 0, P[S]);
1175
1175
  } else
1176
- f[m] = S;
1176
+ h[b] = P;
1177
1177
  }
1178
1178
  }
1179
- return f;
1179
+ return h;
1180
1180
  };
1181
- B.prototype._walk = function(r, e) {
1181
+ L.prototype._walk = function(r, e) {
1182
1182
  if (Array.isArray(r)) {
1183
1183
  const t = r.length;
1184
1184
  for (let s = 0; s < t; s++)
@@ -1187,67 +1187,67 @@ B.prototype._walk = function(r, e) {
1187
1187
  e(t);
1188
1188
  });
1189
1189
  };
1190
- B.prototype._slice = function(r, e, t, s, n, o, i) {
1190
+ L.prototype._slice = function(r, e, t, s, n, o, i) {
1191
1191
  if (!Array.isArray(t))
1192
1192
  return;
1193
1193
  const u = t.length, a = r.split(":"), l = a[2] && Number.parseInt(a[2]) || 1;
1194
- let h = a[0] && Number.parseInt(a[0]) || 0, f = a[1] && Number.parseInt(a[1]) || u;
1195
- h = h < 0 ? Math.max(0, h + u) : Math.min(u, h), f = f < 0 ? Math.max(0, f + u) : Math.min(u, f);
1196
- const b = [];
1197
- for (let m = h; m < f; m += l)
1198
- this._trace(Ae(m, e), t, s, n, o, i, !0).forEach((S) => {
1199
- b.push(S);
1194
+ let p = a[0] && Number.parseInt(a[0]) || 0, h = a[1] && Number.parseInt(a[1]) || u;
1195
+ p = p < 0 ? Math.max(0, p + u) : Math.min(u, p), h = h < 0 ? Math.max(0, h + u) : Math.min(u, h);
1196
+ const v = [];
1197
+ for (let b = p; b < h; b += l)
1198
+ this._trace(Ae(b, e), t, s, n, o, i, !0).forEach((P) => {
1199
+ v.push(P);
1200
1200
  });
1201
- return b;
1201
+ return v;
1202
1202
  };
1203
- B.prototype._eval = function(r, e, t, s, n, o) {
1203
+ L.prototype._eval = function(r, e, t, s, n, o) {
1204
1204
  this.currSandbox._$_parentProperty = o, this.currSandbox._$_parent = n, this.currSandbox._$_property = t, this.currSandbox._$_root = this.json, this.currSandbox._$_v = e;
1205
1205
  const i = r.includes("@path");
1206
- i && (this.currSandbox._$_path = B.toPathString(s.concat([t])));
1206
+ i && (this.currSandbox._$_path = L.toPathString(s.concat([t])));
1207
1207
  const u = this.currEval + "Script:" + r;
1208
- if (!B.cache[u]) {
1208
+ if (!L.cache[u]) {
1209
1209
  let a = r.replaceAll("@parentProperty", "_$_parentProperty").replaceAll("@parent", "_$_parent").replaceAll("@property", "_$_property").replaceAll("@root", "_$_root").replaceAll(/@([.\s)[])/gu, "_$_v$1");
1210
1210
  if (i && (a = a.replaceAll("@path", "_$_path")), this.currEval === "safe" || this.currEval === !0 || this.currEval === void 0)
1211
- B.cache[u] = new this.safeVm.Script(a);
1211
+ L.cache[u] = new this.safeVm.Script(a);
1212
1212
  else if (this.currEval === "native")
1213
- B.cache[u] = new this.vm.Script(a);
1213
+ L.cache[u] = new this.vm.Script(a);
1214
1214
  else if (typeof this.currEval == "function" && this.currEval.prototype && Object.hasOwn(this.currEval.prototype, "runInNewContext")) {
1215
1215
  const l = this.currEval;
1216
- B.cache[u] = new l(a);
1216
+ L.cache[u] = new l(a);
1217
1217
  } else if (typeof this.currEval == "function")
1218
- B.cache[u] = {
1218
+ L.cache[u] = {
1219
1219
  runInNewContext: (l) => this.currEval(a, l)
1220
1220
  };
1221
1221
  else
1222
1222
  throw new TypeError(`Unknown "eval" property "${this.currEval}"`);
1223
1223
  }
1224
1224
  try {
1225
- return B.cache[u].runInNewContext(this.currSandbox);
1225
+ return L.cache[u].runInNewContext(this.currSandbox);
1226
1226
  } catch (a) {
1227
1227
  if (this.ignoreEvalErrors)
1228
1228
  return !1;
1229
1229
  throw new Error("jsonPath: " + a.message + ": " + r);
1230
1230
  }
1231
1231
  };
1232
- B.cache = {};
1233
- B.toPathString = function(r) {
1232
+ L.cache = {};
1233
+ L.toPathString = function(r) {
1234
1234
  const e = r, t = e.length;
1235
1235
  let s = "$";
1236
1236
  for (let n = 1; n < t; n++)
1237
1237
  /^(~|\^|@.*?\(\))$/u.test(e[n]) || (s += /^[0-9*]+$/u.test(e[n]) ? "[" + e[n] + "]" : "['" + e[n] + "']");
1238
1238
  return s;
1239
1239
  };
1240
- B.toPointer = function(r) {
1240
+ L.toPointer = function(r) {
1241
1241
  const e = r, t = e.length;
1242
1242
  let s = "";
1243
1243
  for (let n = 1; n < t; n++)
1244
1244
  /^(~|\^|@.*?\(\))$/u.test(e[n]) || (s += "/" + e[n].toString().replaceAll("~", "~0").replaceAll("/", "~1"));
1245
1245
  return s;
1246
1246
  };
1247
- B.toPathArray = function(r) {
1247
+ L.toPathArray = function(r) {
1248
1248
  const {
1249
1249
  cache: e
1250
- } = B;
1250
+ } = L;
1251
1251
  if (e[r])
1252
1252
  return e[r].concat();
1253
1253
  const t = [], n = r.replaceAll(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/gu, ";$&;").replaceAll(/[['](\??\(.*?\))[\]'](?!.\])/gu, function(o, i) {
@@ -1262,7 +1262,7 @@ B.toPathArray = function(r) {
1262
1262
  });
1263
1263
  return e[r] = n, e[r].concat();
1264
1264
  };
1265
- B.prototype.safeVm = {
1265
+ L.prototype.safeVm = {
1266
1266
  Script: ut
1267
1267
  };
1268
1268
  const dt = function(r, e, t) {
@@ -1289,15 +1289,15 @@ class ft {
1289
1289
  const s = Object.keys(e), n = [];
1290
1290
  dt(s, n, (l) => typeof e[l] == "function");
1291
1291
  const o = s.map((l) => e[l]);
1292
- t = n.reduce((l, h) => {
1293
- let f = e[h].toString();
1294
- return /function/u.test(f) || (f = "function " + f), "var " + h + "=" + f + ";" + l;
1292
+ t = n.reduce((l, p) => {
1293
+ let h = e[p].toString();
1294
+ return /function/u.test(h) || (h = "function " + h), "var " + p + "=" + h + ";" + l;
1295
1295
  }, "") + t, !/(['"])use strict\1/u.test(t) && !s.includes("arguments") && (t = "var arguments = undefined;" + t), t = t.replace(/;\s*$/u, "");
1296
1296
  const u = t.lastIndexOf(";"), a = u !== -1 ? t.slice(0, u + 1) + " return " + t.slice(u + 1) : " return " + t;
1297
1297
  return new Function(...s, a)(...o);
1298
1298
  }
1299
1299
  }
1300
- B.prototype.vm = {
1300
+ L.prototype.vm = {
1301
1301
  Script: ft
1302
1302
  };
1303
1303
  const ht = { class: "json-node" }, pt = {
@@ -1306,16 +1306,13 @@ const ht = { class: "json-node" }, pt = {
1306
1306
  }, gt = { class: "json-node__line" }, mt = {
1307
1307
  key: 2,
1308
1308
  class: "json-node__colon"
1309
- }, yt = ["title"], bt = {
1310
- key: 3,
1311
- class: "json-node__collapsed"
1312
- }, vt = {
1313
- key: 4,
1309
+ }, yt = ["title"], bt = ["title"], vt = {
1310
+ key: 5,
1314
1311
  class: "json-node__comma"
1315
- }, Et = {
1312
+ }, _t = {
1316
1313
  key: 0,
1317
1314
  class: "json-node__children"
1318
- }, _t = { class: "json-node__children-content" }, xt = { class: "json-node__line json-node__closing-bracket" }, Nt = { class: "json-node__bracket" }, kt = {
1315
+ }, Et = { class: "json-node__children-content" }, xt = { class: "json-node__line json-node__closing-bracket" }, kt = { class: "json-node__bracket" }, Nt = {
1319
1316
  key: 0,
1320
1317
  class: "json-node__comma"
1321
1318
  }, At = {
@@ -1341,181 +1338,192 @@ const ht = { class: "json-node" }, pt = {
1341
1338
  },
1342
1339
  emits: ["update:value", "toggle-expand", "copy", "update:key"],
1343
1340
  setup(r, { emit: e }) {
1344
- Oe((y) => ({
1345
- "7b112182": y.level,
1346
- "1501a3a8": y.theme.colors.syntaxKey,
1347
- "4c2226b6": y.theme.colors.hoverBackground,
1348
- "30aa351e": y.theme.colors.syntaxBracket,
1349
- "090e30f3": y.theme.colors.textSecondary,
1350
- cf872bb0: y.theme.colors.syntaxString,
1351
- e0803540: y.theme.colors.syntaxNumber,
1352
- "3954b61e": y.theme.colors.syntaxBoolean,
1353
- e9972d44: y.theme.colors.syntaxNull,
1354
- "231c0282": y.theme.colors.background,
1355
- e1dce7d8: y.theme.colors.indentLine
1341
+ Oe((c) => ({
1342
+ "35be1c39": c.level,
1343
+ "5e416c24": c.theme.colors.syntaxKey,
1344
+ a0c0ff08: c.theme.colors.hoverBackground,
1345
+ d7c00e92: c.theme.colors.syntaxBracket,
1346
+ "5de67d96": c.theme.colors.collapsedText,
1347
+ "19acdad7": c.theme.colors.collapsedBackground,
1348
+ f54fa6b6: c.theme.colors.collapsedBackgroundHover,
1349
+ "825653bc": c.theme.colors.syntaxString,
1350
+ "934f5d4c": c.theme.colors.syntaxNumber,
1351
+ e06a8f92: c.theme.colors.syntaxBoolean,
1352
+ "4b0b8bd8": c.theme.colors.syntaxNull,
1353
+ "3a19b608": c.theme.colors.background,
1354
+ "4ee8ae8e": c.theme.colors.indentLine
1356
1355
  }));
1357
- const t = r, s = e, n = z(!1), o = z(!1), i = z(""), u = z(""), a = (y) => y !== null && typeof y == "object" && !Array.isArray(y) && "__protected_number__" in y && Object.keys(y).length === 1, l = (y) => a(y) ? y.__protected_number__ : "", h = V(() => a(t.value) ? !1 : t.value !== null && typeof t.value == "object"), f = V(() => Array.isArray(t.value)), b = V(() => t.path ? t.path : t.keyName ? t.keyName : "root"), m = V(() => t.expanded.has(b.value)), w = V(() => t.keyName), S = V(() => f.value ? "[" : "{"), _ = V(() => f.value ? "]" : "}"), j = V(() => {
1356
+ const t = r, s = e, n = Y(!1), o = Y(!1), i = Y(""), u = Y(""), a = Y("string"), l = (c) => c !== null && typeof c == "object" && !Array.isArray(c) && "__protected_number__" in c && Object.keys(c).length === 1, p = (c) => l(c) ? c.__protected_number__ : "", h = V(() => l(t.value) ? !1 : t.value !== null && typeof t.value == "object"), v = V(() => Array.isArray(t.value)), b = V(() => t.path ? t.path : t.keyName ? t.keyName : "root"), A = V(() => t.expanded.has(b.value)), P = V(() => t.keyName), k = V(() => v.value ? "[" : "{"), S = V(() => v.value ? "]" : "}"), F = V(() => {
1358
1357
  if (!t.value) return "";
1359
- const d = Object.keys(t.value).length;
1360
- return f.value ? d > 0 ? ` ${d} items ` : " " : d > 0 ? ` ${d} keys ` : " ";
1361
- }), H = V(() => {
1362
- const y = typeof t.value;
1363
- return t.value === null ? "json-node__value--null" : y === "boolean" ? "json-node__value--boolean" : y === "number" || a(t.value) ? "json-node__value--number" : y === "string" ? "json-node__value--string" : "";
1364
- }), p = V(() => o.value ? u.value : t.value === null ? "null" : typeof t.value == "boolean" || typeof t.value == "number" ? String(t.value) : a(t.value) ? l(t.value) : typeof t.value == "string" ? `"${t.value}"` : String(t.value)), $ = V(() => "Click to edit, double-click to copy"), E = (y) => t.level === 0 ? y : b.value ? `${b.value}.${y}` : y, O = (y) => {
1365
- const d = Object.keys(t.value);
1366
- return d.indexOf(y) === d.length - 1;
1367
- }, I = () => {
1358
+ const f = Object.keys(t.value).length;
1359
+ return v.value ? f > 0 ? ` ${f} items ` : " " : f > 0 ? ` ${f} keys ` : " ";
1360
+ }), Z = V(() => {
1361
+ const c = typeof t.value;
1362
+ return t.value === null ? "json-node__value--null" : c === "boolean" ? "json-node__value--boolean" : c === "number" || l(t.value) ? "json-node__value--number" : c === "string" ? "json-node__value--string" : "";
1363
+ }), g = V(() => o.value ? u.value : t.value === null ? "null" : typeof t.value == "boolean" || typeof t.value == "number" ? String(t.value) : l(t.value) ? p(t.value) : typeof t.value == "string" ? `"${t.value}"` : String(t.value)), m = V(() => "Click to edit, double-click to copy"), O = (c) => t.level === 0 ? c : b.value ? `${b.value}.${c}` : c, $ = (c) => {
1364
+ const f = Object.keys(t.value);
1365
+ return f.indexOf(c) === f.length - 1;
1366
+ }, j = () => {
1368
1367
  s("toggle-expand", b.value);
1369
- }, X = () => {
1368
+ }, H = () => {
1370
1369
  t.level !== 0 && (n.value = !0, i.value = t.keyName, he(() => {
1371
- const y = document.querySelectorAll(".json-node__key-input"), d = y[y.length - 1];
1372
- d && (d.focus(), d.select());
1370
+ const c = document.querySelectorAll(".json-node__key-input"), f = c[c.length - 1];
1371
+ f && (f.focus(), f.select());
1373
1372
  }));
1374
- }, Z = () => {
1375
- h.value || (o.value = !0, a(t.value) ? u.value = l(t.value) : typeof t.value == "string" ? u.value = t.value : u.value = String(t.value), he(() => {
1376
- const y = document.querySelectorAll(".json-node__value-input"), d = y[y.length - 1];
1377
- d && (d.focus(), d.select());
1373
+ }, G = () => {
1374
+ h.value || (o.value = !0, t.value === null ? a.value = "null" : l(t.value) ? a.value = "protected-number" : typeof t.value == "string" ? a.value = "string" : typeof t.value == "number" ? a.value = "number" : typeof t.value == "boolean" && (a.value = "boolean"), l(t.value) ? u.value = p(t.value) : typeof t.value == "string" ? u.value = t.value : u.value = String(t.value), he(() => {
1375
+ const c = document.querySelectorAll(".json-node__value-input"), f = c[c.length - 1];
1376
+ f && (f.focus(), f.select());
1378
1377
  }));
1379
- }, Y = () => {
1378
+ }, K = () => {
1380
1379
  if (t.level === 0 || !n.value) return;
1381
- const y = i.value.trim();
1382
- if (!y) {
1383
- ee();
1380
+ const c = i.value.trim();
1381
+ if (!c) {
1382
+ te();
1384
1383
  return;
1385
1384
  }
1386
- if (y === t.keyName) {
1385
+ if (c === t.keyName) {
1387
1386
  n.value = !1;
1388
1387
  return;
1389
1388
  }
1390
- n.value = !1, s("update:key", b.value, y);
1391
- }, Q = () => {
1389
+ n.value = !1, s("update:key", b.value, c);
1390
+ }, ee = () => {
1392
1391
  try {
1393
- let y;
1394
- const d = u.value.trim();
1395
- if (d === "null")
1396
- y = null;
1397
- else if (d === "true" || d === "false")
1398
- y = d === "true";
1399
- else if (!isNaN(Number(d)) && d !== "") {
1400
- const g = Number(d);
1401
- !Number.isSafeInteger(g) || d.length > 15 ? y = { __protected_number__: d } : y = g;
1392
+ let c;
1393
+ const f = u.value.trim();
1394
+ if (a.value === "string")
1395
+ f === "null" ? c = null : f === "true" || f === "false" ? c = f === "true" : c = u.value;
1396
+ else if (a.value === "protected-number")
1397
+ c = { __protected_number__: f };
1398
+ else if (f === "null")
1399
+ c = null;
1400
+ else if (f === "true" || f === "false")
1401
+ c = f === "true";
1402
+ else if (!isNaN(Number(f)) && f !== "") {
1403
+ const w = Number(f);
1404
+ !Number.isSafeInteger(w) || f.length > 15 ? c = { __protected_number__: f } : c = w;
1402
1405
  } else
1403
- y = u.value;
1404
- s("update:value", b.value, y), o.value = !1;
1405
- } catch (y) {
1406
- console.error("Failed to parse value:", y), o.value = !1;
1406
+ c = u.value;
1407
+ s("update:value", b.value, c), o.value = !1;
1408
+ } catch (c) {
1409
+ console.error("Failed to parse value:", c), o.value = !1;
1407
1410
  }
1408
- }, ee = () => {
1411
+ }, te = () => {
1409
1412
  n.value = !1, i.value = t.keyName;
1410
- }, ae = () => {
1411
- o.value = !1, a(t.value) ? u.value = l(t.value) : typeof t.value == "string" ? u.value = t.value : u.value = String(t.value);
1413
+ }, ue = () => {
1414
+ o.value = !1, l(t.value) ? u.value = p(t.value) : typeof t.value == "string" ? u.value = t.value : u.value = String(t.value);
1412
1415
  };
1413
- return (y, d) => {
1414
- const g = Ue("JsonNode", !0);
1415
- return x(), k("div", ht, [
1416
- h.value ? (x(), k("div", pt, [
1417
- v("div", gt, [
1418
- y.keyName && !n.value ? (x(), k("span", {
1416
+ return (c, f) => {
1417
+ const w = Me("JsonNode", !0);
1418
+ return _(), x("div", ht, [
1419
+ h.value ? (_(), x("div", pt, [
1420
+ y("div", gt, [
1421
+ c.keyName && !n.value ? (_(), x("span", {
1419
1422
  key: 0,
1420
1423
  class: "json-node__key",
1421
- onClick: X,
1424
+ onClick: H,
1422
1425
  title: "Click to edit key"
1423
- }, ' "' + R(w.value) + '" ', 1)) : F("", !0),
1424
- y.keyName && n.value ? _e((x(), k("input", {
1426
+ }, ' "' + B(P.value) + '" ', 1)) : U("", !0),
1427
+ c.keyName && n.value ? Ee((_(), x("input", {
1425
1428
  key: 1,
1426
- "onUpdate:modelValue": d[0] || (d[0] = (A) => i.value = A),
1429
+ "onUpdate:modelValue": f[0] || (f[0] = (E) => i.value = E),
1427
1430
  onKeyup: [
1428
- ue(Y, ["enter"]),
1429
- ue(ee, ["escape"])
1431
+ de(K, ["enter"]),
1432
+ de(te, ["escape"])
1430
1433
  ],
1431
- onBlur: Y,
1434
+ onBlur: K,
1432
1435
  class: "json-node__key-input"
1433
1436
  }, null, 544)), [
1434
1437
  [xe, i.value]
1435
- ]) : F("", !0),
1436
- y.keyName ? (x(), k("span", mt, ": ")) : F("", !0),
1437
- v("span", {
1438
+ ]) : U("", !0),
1439
+ c.keyName ? (_(), x("span", mt, ": ")) : U("", !0),
1440
+ y("span", {
1438
1441
  class: "json-node__bracket json-node__bracket--clickable",
1439
- onClick: I,
1440
- title: m.value ? "Click to collapse" : "Click to expand"
1441
- }, R(S.value), 9, yt),
1442
- m.value ? F("", !0) : (x(), k("span", bt, [
1443
- Se(R(j.value) + " ", 1),
1444
- v("span", {
1445
- class: "json-node__bracket json-node__bracket--clickable",
1446
- onClick: I
1447
- }, R(_.value), 1)
1448
- ])),
1449
- !m.value && !y.isLast ? (x(), k("span", vt, ",")) : F("", !0)
1442
+ onClick: j,
1443
+ title: A.value ? "Click to collapse" : "Click to expand"
1444
+ }, B(k.value), 9, yt),
1445
+ A.value ? U("", !0) : (_(), x("span", {
1446
+ key: 3,
1447
+ class: "json-node__collapsed-info",
1448
+ onClick: j,
1449
+ title: `Click to expand ${F.value.trim()}`
1450
+ }, B(F.value), 9, bt)),
1451
+ A.value ? U("", !0) : (_(), x("span", {
1452
+ key: 4,
1453
+ class: "json-node__bracket json-node__bracket--clickable",
1454
+ onClick: j,
1455
+ title: "Click to expand"
1456
+ }, B(S.value), 1)),
1457
+ !A.value && !c.isLast ? (_(), x("span", vt, ",")) : U("", !0)
1450
1458
  ]),
1451
- m.value ? (x(), k("div", Et, [
1452
- v("div", _t, [
1453
- (x(!0), k(de, null, fe(y.value, (A, N) => (x(), k("div", {
1454
- key: N,
1459
+ A.value ? (_(), x("div", _t, [
1460
+ y("div", Et, [
1461
+ (_(!0), x(ne, null, ie(c.value, (E, T) => (_(), x("div", {
1462
+ key: T,
1455
1463
  class: "json-node__child"
1456
1464
  }, [
1457
- Fe(g, {
1458
- value: A,
1459
- "key-name": f.value ? "" : String(N),
1460
- level: y.level + 1,
1461
- path: E(String(N)),
1462
- expanded: y.expanded,
1463
- theme: y.theme,
1464
- "onUpdate:value": d[1] || (d[1] = (C, T) => y.$emit("update:value", C, T)),
1465
- onToggleExpand: d[2] || (d[2] = (C) => y.$emit("toggle-expand", C)),
1466
- onCopy: d[3] || (d[3] = (C) => y.$emit("copy", C)),
1467
- "onUpdate:key": d[4] || (d[4] = (C, T) => y.$emit("update:key", C, T)),
1468
- "is-last": O(String(N))
1465
+ Ue(w, {
1466
+ value: E,
1467
+ "key-name": v.value ? "" : String(T),
1468
+ level: c.level + 1,
1469
+ path: O(String(T)),
1470
+ expanded: c.expanded,
1471
+ theme: c.theme,
1472
+ "onUpdate:value": f[1] || (f[1] = (C, I) => c.$emit("update:value", C, I)),
1473
+ onToggleExpand: f[2] || (f[2] = (C) => c.$emit("toggle-expand", C)),
1474
+ onCopy: f[3] || (f[3] = (C) => c.$emit("copy", C)),
1475
+ "onUpdate:key": f[4] || (f[4] = (C, I) => c.$emit("update:key", C, I)),
1476
+ "is-last": $(String(T))
1469
1477
  }, null, 8, ["value", "key-name", "level", "path", "expanded", "theme", "is-last"])
1470
1478
  ]))), 128))
1471
1479
  ]),
1472
- v("div", xt, [
1473
- v("span", Nt, R(_.value), 1),
1474
- y.isLast ? F("", !0) : (x(), k("span", kt, ","))
1480
+ y("div", xt, [
1481
+ y("span", kt, B(S.value), 1),
1482
+ c.isLast ? U("", !0) : (_(), x("span", Nt, ","))
1475
1483
  ])
1476
- ])) : F("", !0)
1477
- ])) : (x(), k("div", At, [
1478
- y.keyName && !n.value ? (x(), k("span", {
1484
+ ])) : U("", !0)
1485
+ ])) : (_(), x("div", At, [
1486
+ c.keyName && !n.value ? (_(), x("span", {
1479
1487
  key: 0,
1480
1488
  class: "json-node__key",
1481
- onClick: X,
1489
+ onClick: H,
1482
1490
  title: "Click to edit key"
1483
- }, ' "' + R(w.value) + '" ', 1)) : F("", !0),
1484
- y.keyName && n.value ? _e((x(), k("input", {
1491
+ }, ' "' + B(P.value) + '" ', 1)) : U("", !0),
1492
+ c.keyName && n.value ? Ee((_(), x("input", {
1485
1493
  key: 1,
1486
- "onUpdate:modelValue": d[5] || (d[5] = (A) => i.value = A),
1494
+ "onUpdate:modelValue": f[5] || (f[5] = (E) => i.value = E),
1487
1495
  onKeyup: [
1488
- ue(Y, ["enter"]),
1489
- ue(ee, ["escape"])
1496
+ de(K, ["enter"]),
1497
+ de(te, ["escape"])
1490
1498
  ],
1491
- onBlur: Y,
1499
+ onBlur: K,
1492
1500
  class: "json-node__key-input"
1493
1501
  }, null, 544)), [
1494
1502
  [xe, i.value]
1495
- ]) : F("", !0),
1496
- y.keyName ? (x(), k("span", wt, ": ")) : F("", !0),
1497
- o.value ? F("", !0) : (x(), k("span", {
1503
+ ]) : U("", !0),
1504
+ c.keyName ? (_(), x("span", wt, ": ")) : U("", !0),
1505
+ o.value ? U("", !0) : (_(), x("span", {
1498
1506
  key: 3,
1499
- class: Te(["json-node__value", H.value]),
1500
- onClick: Z,
1501
- onDblclick: d[6] || (d[6] = (A) => y.$emit("copy", y.value)),
1502
- title: $.value
1507
+ class: Te(["json-node__value", Z.value]),
1508
+ onClick: G,
1509
+ onDblclick: f[6] || (f[6] = (E) => c.$emit("copy", c.value)),
1510
+ title: m.value
1503
1511
  }, [
1504
- Se(R(p.value), 1),
1505
- y.isLast ? F("", !0) : (x(), k("span", Ot, ","))
1512
+ De(B(g.value), 1),
1513
+ c.isLast ? U("", !0) : (_(), x("span", Ot, ","))
1506
1514
  ], 42, Ct)),
1507
- o.value ? _e((x(), k("input", {
1515
+ o.value ? Ee((_(), x("input", {
1508
1516
  key: 4,
1509
- "onUpdate:modelValue": d[7] || (d[7] = (A) => u.value = A),
1517
+ "onUpdate:modelValue": f[7] || (f[7] = (E) => u.value = E),
1510
1518
  onKeyup: [
1511
- ue(Q, ["enter"]),
1512
- ue(ae, ["escape"])
1519
+ de(ee, ["enter"]),
1520
+ de(ue, ["escape"])
1513
1521
  ],
1514
- onBlur: Q,
1522
+ onBlur: ee,
1515
1523
  class: "json-node__value-input"
1516
1524
  }, null, 544)), [
1517
1525
  [xe, u.value]
1518
- ]) : F("", !0)
1526
+ ]) : U("", !0)
1519
1527
  ]))
1520
1528
  ]);
1521
1529
  };
@@ -1525,7 +1533,7 @@ const ht = { class: "json-node" }, pt = {
1525
1533
  for (const [s, n] of e)
1526
1534
  t[s] = n;
1527
1535
  return t;
1528
- }, Pt = /* @__PURE__ */ be(Tt, [["__scopeId", "data-v-860beb35"]]), Ke = {
1536
+ }, Pt = /* @__PURE__ */ be(Tt, [["__scopeId", "data-v-58992c45"]]), He = {
1529
1537
  name: "github-light",
1530
1538
  colors: {
1531
1539
  // 背景色
@@ -1555,12 +1563,12 @@ const ht = { class: "json-node" }, pt = {
1555
1563
  syntaxNull: "#656d76",
1556
1564
  syntaxKey: "#0969da",
1557
1565
  syntaxBracket: "#24292f",
1558
- // 滚动条
1559
- scrollbarTrack: "#f6f8fa",
1560
- scrollbarThumb: "#d0d7de",
1561
- scrollbarThumbHover: "#afb8c1",
1562
1566
  // 悬停效果
1563
1567
  hoverBackground: "#f6f8fa",
1568
+ // 折叠信息样式
1569
+ collapsedBackground: "#ddf4ff",
1570
+ collapsedBackgroundHover: "#b6e3ff",
1571
+ collapsedText: "#0969da",
1564
1572
  // 缩进线
1565
1573
  indentLine: "#d0d7de"
1566
1574
  }
@@ -1594,12 +1602,12 @@ const ht = { class: "json-node" }, pt = {
1594
1602
  syntaxNull: "#7d8590",
1595
1603
  syntaxKey: "#79c0ff",
1596
1604
  syntaxBracket: "#e6edf3",
1597
- // 滚动条
1598
- scrollbarTrack: "#161b22",
1599
- scrollbarThumb: "#30363d",
1600
- scrollbarThumbHover: "#6e7681",
1601
1605
  // 悬停效果
1602
1606
  hoverBackground: "#161b22",
1607
+ // 折叠信息样式
1608
+ collapsedBackground: "#1c2128",
1609
+ collapsedBackgroundHover: "#2d333b",
1610
+ collapsedText: "#79c0ff",
1603
1611
  // 缩进线
1604
1612
  indentLine: "#30363d"
1605
1613
  }
@@ -1633,16 +1641,16 @@ const ht = { class: "json-node" }, pt = {
1633
1641
  syntaxNull: "#6b7280",
1634
1642
  syntaxKey: "#1f2937",
1635
1643
  syntaxBracket: "#374151",
1636
- // 滚动条 - 极简
1637
- scrollbarTrack: "#f5f5f5",
1638
- scrollbarThumb: "#d1d5db",
1639
- scrollbarThumbHover: "#9ca3af",
1640
1644
  // 悬停效果
1641
1645
  hoverBackground: "#f9f9f9",
1646
+ // 折叠信息样式
1647
+ collapsedBackground: "#e0f2fe",
1648
+ collapsedBackgroundHover: "#bae6fd",
1649
+ collapsedText: "#0284c7",
1642
1650
  // 缩进线
1643
1651
  indentLine: "#e5e7eb"
1644
1652
  }
1645
- }, It = {
1653
+ }, Bt = {
1646
1654
  name: "slack-ochin",
1647
1655
  colors: {
1648
1656
  // 背景色 - 温暖的米色调
@@ -1672,40 +1680,40 @@ const ht = { class: "json-node" }, pt = {
1672
1680
  syntaxNull: "#8b7355",
1673
1681
  syntaxKey: "#4a3b2a",
1674
1682
  syntaxBracket: "#6b5444",
1675
- // 滚动条 - 暖色调
1676
- scrollbarTrack: "#f4ede4",
1677
- scrollbarThumb: "#e8d5b7",
1678
- scrollbarThumbHover: "#d4c4a8",
1679
1683
  // 悬停效果
1680
1684
  hoverBackground: "#f8f2eb",
1685
+ // 折叠信息样式
1686
+ collapsedBackground: "#ffe8d6",
1687
+ collapsedBackgroundHover: "#ffd4b0",
1688
+ collapsedText: "#d73502",
1681
1689
  // 缩进线
1682
1690
  indentLine: "#e8d5b7"
1683
1691
  }
1684
- }, Bt = {
1685
- "github-light": Ke,
1692
+ }, It = {
1693
+ "github-light": He,
1686
1694
  "github-dark": $t,
1687
1695
  "min-light": St,
1688
- "slack-ochin": It
1696
+ "slack-ochin": Bt
1689
1697
  };
1690
1698
  function Vt(r = "github-light") {
1691
- return Bt[r] || Ke;
1699
+ return It[r] || He;
1692
1700
  }
1693
1701
  const Lt = {
1694
1702
  key: 0,
1695
1703
  class: "json-format__toolbar"
1696
- }, Rt = { class: "json-format__actions" }, jt = ["disabled"], Mt = ["disabled"], Ut = ["disabled"], Ft = ["disabled"], Xt = { class: "json-format__info" }, Ht = {
1704
+ }, jt = { class: "json-format__actions" }, Rt = ["disabled"], Mt = ["disabled"], Ut = ["disabled"], Ft = ["disabled"], Xt = { class: "json-format__info" }, Ht = {
1697
1705
  key: 0,
1698
1706
  class: "json-format__status json-format__status--success"
1699
1707
  }, Kt = {
1700
1708
  key: 1,
1701
1709
  class: "json-format__status json-format__status--error"
1702
- }, qt = { class: "json-format__content" }, Yt = {
1710
+ }, qt = { class: "json-format__content" }, Qt = {
1703
1711
  key: 0,
1704
1712
  class: "json-format__error"
1705
- }, Qt = {
1713
+ }, Wt = {
1706
1714
  key: 1,
1707
1715
  class: "json-format__error"
1708
- }, Wt = {
1716
+ }, Yt = {
1709
1717
  key: 2,
1710
1718
  class: "json-format__viewer"
1711
1719
  }, Gt = /* @__PURE__ */ ye({
@@ -1720,73 +1728,70 @@ const Lt = {
1720
1728
  },
1721
1729
  emits: ["update:modelValue", "copy-success", "copy-error", "expand-all", "collapse-all", "compress"],
1722
1730
  setup(r, { expose: e, emit: t }) {
1723
- Oe((d) => ({
1724
- "50e4672c": f.value.colors.border,
1725
- "64d14328": f.value.colors.background,
1726
- "668c94eb": f.value.colors.text,
1727
- "8370c286": f.value.colors.surfaceBackground,
1728
- "1698e888": f.value.colors.buttonBorder,
1729
- "584924be": f.value.colors.buttonBackground,
1730
- "325e00bd": f.value.colors.buttonText,
1731
- "2430fb1e": f.value.colors.buttonBackgroundHover,
1732
- ea0e2f1c: f.value.colors.buttonPrimary,
1733
- "3b0b67ea": f.value.colors.buttonPrimaryHover,
1734
- "2e7b3e93": f.value.colors.successBackground,
1735
- b24220f6: f.value.colors.success,
1736
- "0c7db250": f.value.colors.errorBackground,
1737
- "6a387a0a": f.value.colors.error,
1738
- "2c13c5fa": f.value.colors.scrollbarTrack,
1739
- "2c1c44e4": f.value.colors.scrollbarThumb,
1740
- "8ba97764": f.value.colors.scrollbarThumbHover
1731
+ Oe((c) => ({
1732
+ "325d5f6b": h.value.colors.border,
1733
+ "407388ed": h.value.colors.background,
1734
+ "1276f42c": h.value.colors.text,
1735
+ "34805dc8": h.value.colors.surfaceBackground,
1736
+ "212f19fd": h.value.colors.buttonBorder,
1737
+ b83cab02: h.value.colors.buttonBackground,
1738
+ b58ba984: h.value.colors.buttonText,
1739
+ d50a3406: h.value.colors.buttonBackgroundHover,
1740
+ "2421bb5e": h.value.colors.buttonPrimary,
1741
+ "0299816b": h.value.colors.buttonPrimaryHover,
1742
+ "55f370f2": h.value.colors.successBackground,
1743
+ b3fc86b8: h.value.colors.success,
1744
+ "781064f7": h.value.colors.errorBackground,
1745
+ "3b9a02e9": h.value.colors.error
1741
1746
  }));
1742
- const s = r, n = t, o = z(null), i = z(""), u = z(/* @__PURE__ */ new Set()), a = z(null), l = z(""), h = V(() => i.value === ""), f = V(() => Vt(s.theme)), b = V(() => l.value ? null : a.value !== null ? a.value : o.value), m = (d) => {
1743
- if (!d.trim()) {
1747
+ const s = r, n = t, o = Y(null), i = Y(""), u = Y(/* @__PURE__ */ new Set()), a = Y(null), l = Y(""), p = V(() => i.value === ""), h = V(() => Vt(s.theme)), v = V(() => l.value ? null : a.value !== null ? a.value : o.value), b = (c) => {
1748
+ if (!c.trim()) {
1744
1749
  o.value = null, i.value = "", a.value = null, l.value = "";
1745
1750
  return;
1746
1751
  }
1747
1752
  try {
1748
- let g = d;
1749
- const A = /(:\s*|,\s*|\[\s*)-?\d{16,}/.test(g), N = /(:\s*|,\s*|\[\s*)-?\d+\.\d*0+\s*[,}\]\s]*/.test(g);
1750
- if (!A && !N)
1753
+ let f = c;
1754
+ const w = /(:\s*|,\s*|\[\s*)-?\d{16,}/.test(f), E = /(:\s*|,\s*|\[\s*)-?\d+\.\d*0+\s*[,}\]\s]*/.test(f);
1755
+ if (!w && !E)
1751
1756
  try {
1752
- o.value = JSON.parse(g), i.value = "", a.value = null, l.value = "", he(() => {
1753
- b.value !== null && $();
1757
+ o.value = JSON.parse(f), i.value = "", a.value = null, l.value = "", he(() => {
1758
+ v.value !== null && g();
1754
1759
  });
1755
1760
  return;
1756
1761
  } catch {
1757
1762
  }
1758
- g = ((T) => {
1759
- let L = "", K = !1, q = !1, J = 0;
1760
- for (; J < T.length; ) {
1761
- const le = T[J];
1762
- if (K)
1763
- q ? q = !1 : le === "\\" ? q = !0 : le === '"' && (K = !1), L += le, J++;
1764
- else if (le === '"')
1765
- K = !0, L += le, J++;
1763
+ f = ((C) => {
1764
+ let I = "", X = !1, q = !1, D = 0;
1765
+ for (; D < C.length; ) {
1766
+ const ce = C[D];
1767
+ if (X)
1768
+ q ? q = !1 : ce === "\\" ? q = !0 : ce === '"' && (X = !1), I += ce, D++;
1769
+ else if (ce === '"')
1770
+ X = !0, I += ce, D++;
1766
1771
  else {
1767
- const $e = T.slice(J);
1768
- let D = $e.match(/^([:,\[\s]*)(-?\d{16,})(\s*[,\}\]\s]|$)/);
1769
- if (D) {
1770
- L += D[1] + '{"__protected_number__":"' + D[2] + '"}' + D[3], J += D[0].length;
1772
+ const $e = C.slice(D);
1773
+ let z = $e.match(/^([:,\[\s]*)(-?\d{16,})(\s*[,\}\]\s]|$)/);
1774
+ if (z) {
1775
+ I += z[1] + '{"__protected_number__":"' + z[2] + '"}' + z[3], D += z[0].length;
1771
1776
  continue;
1772
1777
  }
1773
- if (D = $e.match(/^([:,\[\s]*)(-?\d+\.\d*0+)(\s*[,\}\]\s]|$)/), D) {
1774
- L += D[1] + '{"__protected_number__":"' + D[2] + '"}' + D[3], J += D[0].length;
1778
+ if (z = $e.match(/^([:,\[\s]*)(-?\d+\.\d*0+)(\s*[,\}\]\s]|$)/), z) {
1779
+ I += z[1] + '{"__protected_number__":"' + z[2] + '"}' + z[3], D += z[0].length;
1775
1780
  continue;
1776
1781
  }
1777
- L += le, J++;
1782
+ I += ce, D++;
1778
1783
  }
1779
1784
  }
1780
- return L;
1781
- })(g), o.value = JSON.parse(g), i.value = "", a.value = null, l.value = "", he(() => {
1782
- b.value !== null && $();
1785
+ return I;
1786
+ })(f), o.value = JSON.parse(f), i.value = "", a.value = null, l.value = "", he(() => {
1787
+ v.value !== null && g();
1783
1788
  });
1784
- } catch (g) {
1785
- i.value = g instanceof Error ? g.message : "Unknown parsing error", o.value = null, a.value = null, l.value = "";
1789
+ } catch (f) {
1790
+ i.value = f instanceof Error ? f.message : "Unknown parsing error", o.value = null, a.value = null, l.value = "";
1786
1791
  }
1787
- }, w = (d) => {
1788
- if (!d || !d.expression.trim()) {
1789
- S();
1792
+ }, A = (c) => {
1793
+ if (!c || !c.expression.trim()) {
1794
+ P();
1790
1795
  return;
1791
1796
  }
1792
1797
  if (!o.value) {
@@ -1794,248 +1799,248 @@ const Lt = {
1794
1799
  return;
1795
1800
  }
1796
1801
  try {
1797
- let g;
1798
- if (d.type === "jsonpath")
1799
- g = B({ path: d.expression, json: o.value }), g.length === 1 && d.expression.includes("$[") === !1 && !d.expression.endsWith("[*]") ? a.value = g[0] : a.value = g;
1800
- else if (d.type === "js")
1801
- g = new Function("data", `
1802
+ let f;
1803
+ if (c.type === "jsonpath")
1804
+ f = L({ path: c.expression, json: o.value }), f.length === 1 && c.expression.includes("$[") === !1 && !c.expression.endsWith("[*]") ? a.value = f[0] : a.value = f;
1805
+ else if (c.type === "js")
1806
+ f = new Function("data", `
1802
1807
  try {
1803
- return ${d.expression};
1808
+ return ${c.expression};
1804
1809
  } catch (error) {
1805
1810
  throw new Error('JavaScript expression error: ' + error.message);
1806
1811
  }
1807
- `)(o.value), a.value = g;
1812
+ `)(o.value), a.value = f;
1808
1813
  else
1809
- throw new Error(`Unsupported filter type: ${d.type}`);
1814
+ throw new Error(`Unsupported filter type: ${c.type}`);
1810
1815
  l.value = "", he(() => {
1811
- $();
1816
+ g();
1812
1817
  });
1813
- } catch (g) {
1814
- l.value = g instanceof Error ? g.message : "Filter execution error", a.value = null;
1818
+ } catch (f) {
1819
+ l.value = f instanceof Error ? f.message : "Filter execution error", a.value = null;
1815
1820
  }
1816
- }, S = () => {
1821
+ }, P = () => {
1817
1822
  a.value = null, l.value = "";
1818
1823
  };
1819
- Xe(() => s.modelValue, (d) => {
1820
- m(d);
1824
+ Fe(() => s.modelValue, (c) => {
1825
+ b(c);
1821
1826
  }, { immediate: !0 });
1822
- const _ = (d, g, A) => {
1823
- const N = (L) => {
1824
- if (L === null || typeof L != "object")
1825
- return L;
1826
- if (!Array.isArray(L) && "__protected_number__" in L && Object.keys(L).length === 1)
1827
- return `__PROTECTED_NUMBER_${L.__protected_number__}_PROTECTED_NUMBER__`;
1828
- if (Array.isArray(L))
1829
- return L.map((q) => N(q));
1830
- const K = {};
1831
- for (const [q, J] of Object.entries(L))
1832
- K[q] = N(J);
1833
- return K;
1834
- }, C = N(d);
1835
- return JSON.stringify(C, g, A).replace(/"__PROTECTED_NUMBER_(.+?)_PROTECTED_NUMBER__"/g, "$1");
1836
- }, j = (d, g) => {
1827
+ const k = (c, f, w) => {
1828
+ const E = (I) => {
1829
+ if (I === null || typeof I != "object")
1830
+ return I;
1831
+ if (!Array.isArray(I) && "__protected_number__" in I && Object.keys(I).length === 1)
1832
+ return `__PROTECTED_NUMBER_${I.__protected_number__}_PROTECTED_NUMBER__`;
1833
+ if (Array.isArray(I))
1834
+ return I.map((q) => E(q));
1835
+ const X = {};
1836
+ for (const [q, D] of Object.entries(I))
1837
+ X[q] = E(D);
1838
+ return X;
1839
+ }, T = E(c);
1840
+ return JSON.stringify(T, f, w).replace(/"__PROTECTED_NUMBER_(.+?)_PROTECTED_NUMBER__"/g, "$1");
1841
+ }, S = (c, f) => {
1837
1842
  if (!s.readonly)
1838
1843
  try {
1839
- const A = H(o.value, d, g), N = _(A, null, 2);
1840
- n("update:modelValue", N);
1841
- } catch (A) {
1842
- console.error("Failed to update JSON:", A);
1844
+ const w = F(o.value, c, f), E = k(w, null, 2);
1845
+ n("update:modelValue", E);
1846
+ } catch (w) {
1847
+ console.error("Failed to update JSON:", w);
1843
1848
  }
1844
- }, H = (d, g, A) => {
1845
- if (!g || g === "root") return A;
1846
- const N = g.split("."), C = Q(d, N.slice(0, -1));
1847
- let T = C;
1848
- for (let K = 0; K < N.length - 1; K++) {
1849
- const q = N[K];
1850
- q !== "root" && (Array.isArray(T) ? T = T[parseInt(q)] : T = T[q]);
1849
+ }, F = (c, f, w) => {
1850
+ if (!f || f === "root") return w;
1851
+ const E = f.split("."), T = K(c, E.slice(0, -1));
1852
+ let C = T;
1853
+ for (let X = 0; X < E.length - 1; X++) {
1854
+ const q = E[X];
1855
+ q !== "root" && (Array.isArray(C) ? C = C[parseInt(q)] : C = C[q]);
1851
1856
  }
1852
- const L = N[N.length - 1];
1853
- return L === "root" ? A : (Array.isArray(T) ? T[parseInt(L)] = A : T[L] = A, C);
1854
- }, p = (d) => {
1855
- u.value.has(d) ? u.value.delete(d) : u.value.add(d);
1856
- }, $ = () => {
1857
- const d = /* @__PURE__ */ new Set(), g = (A, N = "") => {
1858
- A !== null && typeof A == "object" && (d.add(N || "root"), Array.isArray(A) ? A.forEach((C, T) => {
1859
- const L = N ? `${N}.${T}` : `${T}`;
1860
- g(C, L);
1861
- }) : Object.keys(A).forEach((C) => {
1862
- const T = N ? `${N}.${C}` : C;
1863
- g(A[C], T);
1857
+ const I = E[E.length - 1];
1858
+ return I === "root" ? w : (Array.isArray(C) ? C[parseInt(I)] = w : C[I] = w, T);
1859
+ }, Z = (c) => {
1860
+ u.value.has(c) ? u.value.delete(c) : u.value.add(c);
1861
+ }, g = () => {
1862
+ const c = /* @__PURE__ */ new Set(), f = (w, E = "") => {
1863
+ w !== null && typeof w == "object" && (c.add(E || "root"), Array.isArray(w) ? w.forEach((T, C) => {
1864
+ const I = E ? `${E}.${C}` : `${C}`;
1865
+ f(T, I);
1866
+ }) : Object.keys(w).forEach((T) => {
1867
+ const C = E ? `${E}.${T}` : T;
1868
+ f(w[T], C);
1864
1869
  }));
1865
1870
  };
1866
- g(b.value), u.value = d, n("expand-all");
1867
- }, E = () => {
1871
+ f(v.value), u.value = c, n("expand-all");
1872
+ }, m = () => {
1868
1873
  u.value = /* @__PURE__ */ new Set(["root"]), n("collapse-all");
1869
1874
  }, O = async () => {
1870
- if (h.value)
1875
+ if (p.value)
1871
1876
  try {
1872
- const d = b.value, g = _(d, null, 2);
1873
- await navigator.clipboard.writeText(g), n("copy-success", g);
1874
- } catch (d) {
1875
- console.error("Failed to copy JSON:", d), n("copy-error", d instanceof Error ? d : new Error("Failed to copy JSON"));
1877
+ const c = v.value, f = k(c, null, 2);
1878
+ await navigator.clipboard.writeText(f), n("copy-success", f);
1879
+ } catch (c) {
1880
+ console.error("Failed to copy JSON:", c), n("copy-error", c instanceof Error ? c : new Error("Failed to copy JSON"));
1876
1881
  }
1877
- }, I = () => {
1878
- if (h.value)
1882
+ }, $ = () => {
1883
+ if (p.value)
1879
1884
  try {
1880
- const d = b.value, g = _(d);
1881
- n("update:modelValue", g), n("compress", g);
1882
- } catch (d) {
1883
- console.error("Failed to compress JSON:", d);
1885
+ const c = v.value, f = k(c);
1886
+ n("update:modelValue", f), n("compress", f);
1887
+ } catch (c) {
1888
+ console.error("Failed to compress JSON:", c);
1884
1889
  }
1885
- }, X = async (d) => {
1890
+ }, j = async (c) => {
1886
1891
  try {
1887
- let g;
1888
- typeof d == "object" && d !== null && !Array.isArray(d) && "__protected_number__" in d && Object.keys(d).length === 1 ? g = d.__protected_number__ : typeof d == "string" ? g = `"${d}"` : g = JSON.stringify(d), await navigator.clipboard.writeText(g);
1889
- } catch (g) {
1890
- console.error("Failed to copy value:", g);
1892
+ let f;
1893
+ typeof c == "object" && c !== null && !Array.isArray(c) && "__protected_number__" in c && Object.keys(c).length === 1 ? f = c.__protected_number__ : typeof c == "string" ? f = `"${c}"` : f = JSON.stringify(c), await navigator.clipboard.writeText(f);
1894
+ } catch (f) {
1895
+ console.error("Failed to copy value:", f);
1891
1896
  }
1892
- }, Z = (d, g) => {
1897
+ }, H = (c, f) => {
1893
1898
  if (!s.readonly)
1894
1899
  try {
1895
- const A = Y(o.value, d, g), N = _(A, null, 2);
1896
- n("update:modelValue", N), y(d, g);
1897
- } catch (A) {
1898
- console.error("Failed to rename key:", A);
1900
+ const w = G(o.value, c, f), E = k(w, null, 2);
1901
+ n("update:modelValue", E), ue(c, f);
1902
+ } catch (w) {
1903
+ console.error("Failed to rename key:", w);
1899
1904
  }
1900
- }, Y = (d, g, A) => {
1901
- if (!g || g === "root") return d;
1902
- const N = g.split("."), C = Q(d, N.slice(0, -1));
1903
- if (N.length === 1) {
1904
- const K = N[0];
1905
- return C && typeof C == "object" && !Array.isArray(C) ? ee(C, K, A) : C;
1905
+ }, G = (c, f, w) => {
1906
+ if (!f || f === "root") return c;
1907
+ const E = f.split("."), T = K(c, E.slice(0, -1));
1908
+ if (E.length === 1) {
1909
+ const X = E[0];
1910
+ return T && typeof T == "object" && !Array.isArray(T) ? ee(T, X, w) : T;
1906
1911
  }
1907
- let T = C;
1908
- for (let K = 0; K < N.length - 1; K++) {
1909
- const q = N[K];
1910
- Array.isArray(T) ? T = T[parseInt(q)] : T = T[q];
1912
+ let C = T;
1913
+ for (let X = 0; X < E.length - 1; X++) {
1914
+ const q = E[X];
1915
+ Array.isArray(C) ? C = C[parseInt(q)] : C = C[q];
1911
1916
  }
1912
- const L = N[N.length - 1];
1913
- if (!Array.isArray(T) && T && typeof T == "object") {
1914
- const K = ee(T, L, A), q = N.slice(0, -1);
1915
- q.length > 0 && ae(C, q, K);
1917
+ const I = E[E.length - 1];
1918
+ if (!Array.isArray(C) && C && typeof C == "object") {
1919
+ const X = ee(C, I, w), q = E.slice(0, -1);
1920
+ q.length > 0 && te(T, q, X);
1916
1921
  }
1917
- return C;
1918
- }, Q = (d, g) => {
1919
- if (g.length === 0) return d;
1920
- if (Array.isArray(d)) {
1921
- const A = [...d], N = g[0], C = parseInt(N);
1922
- return g.length === 1 || (A[C] = Q(d[C], g.slice(1))), A;
1923
- } else if (d && typeof d == "object") {
1924
- const A = { ...d }, N = g[0];
1925
- return g.length === 1 || (A[N] = Q(d[N], g.slice(1))), A;
1922
+ return T;
1923
+ }, K = (c, f) => {
1924
+ if (f.length === 0) return c;
1925
+ if (Array.isArray(c)) {
1926
+ const w = [...c], E = f[0], T = parseInt(E);
1927
+ return f.length === 1 || (w[T] = K(c[T], f.slice(1))), w;
1928
+ } else if (c && typeof c == "object") {
1929
+ const w = { ...c }, E = f[0];
1930
+ return f.length === 1 || (w[E] = K(c[E], f.slice(1))), w;
1926
1931
  }
1927
- return d;
1928
- }, ee = (d, g, A) => {
1929
- if (!d || typeof d != "object" || Array.isArray(d))
1930
- return d;
1931
- const N = Object.keys(d), C = {};
1932
- for (const T of N)
1933
- T === g ? C[A] = d[T] : C[T] = d[T];
1934
- return C;
1935
- }, ae = (d, g, A) => {
1936
- let N = d;
1937
- for (let T = 0; T < g.length - 1; T++) {
1938
- const L = g[T];
1939
- Array.isArray(N) ? N = N[parseInt(L)] : N = N[L];
1932
+ return c;
1933
+ }, ee = (c, f, w) => {
1934
+ if (!c || typeof c != "object" || Array.isArray(c))
1935
+ return c;
1936
+ const E = Object.keys(c), T = {};
1937
+ for (const C of E)
1938
+ C === f ? T[w] = c[C] : T[C] = c[C];
1939
+ return T;
1940
+ }, te = (c, f, w) => {
1941
+ let E = c;
1942
+ for (let C = 0; C < f.length - 1; C++) {
1943
+ const I = f[C];
1944
+ Array.isArray(E) ? E = E[parseInt(I)] : E = E[I];
1940
1945
  }
1941
- const C = g[g.length - 1];
1942
- Array.isArray(N) ? N[parseInt(C)] = A : N[C] = A;
1943
- }, y = (d, g) => {
1944
- const A = /* @__PURE__ */ new Set();
1945
- u.value.forEach((N) => {
1946
- if (N === d) {
1947
- const C = d.split(".");
1948
- C[C.length - 1] = g, A.add(C.join("."));
1949
- } else if (N.startsWith(d + ".")) {
1950
- const C = d.split(".");
1951
- C[C.length - 1] = g;
1952
- const T = C.join("."), L = N.substring(d.length);
1953
- A.add(T + L);
1946
+ const T = f[f.length - 1];
1947
+ Array.isArray(E) ? E[parseInt(T)] = w : E[T] = w;
1948
+ }, ue = (c, f) => {
1949
+ const w = /* @__PURE__ */ new Set();
1950
+ u.value.forEach((E) => {
1951
+ if (E === c) {
1952
+ const T = c.split(".");
1953
+ T[T.length - 1] = f, w.add(T.join("."));
1954
+ } else if (E.startsWith(c + ".")) {
1955
+ const T = c.split(".");
1956
+ T[T.length - 1] = f;
1957
+ const C = T.join("."), I = E.substring(c.length);
1958
+ w.add(C + I);
1954
1959
  } else
1955
- A.add(N);
1956
- }), u.value = A;
1960
+ w.add(E);
1961
+ }), u.value = w;
1957
1962
  };
1958
1963
  return e({
1959
1964
  // 核心操作方法
1960
1965
  copyJson: O,
1961
- compressSource: I,
1962
- expandAll: $,
1963
- collapseAll: E,
1964
- toggleExpand: p,
1965
- updateValue: j,
1966
- updateKey: Z,
1966
+ compressSource: $,
1967
+ expandAll: g,
1968
+ collapseAll: m,
1969
+ toggleExpand: Z,
1970
+ updateValue: S,
1971
+ updateKey: H,
1967
1972
  // Filter 相关方法
1968
- filter: w,
1969
- clearFilter: S,
1973
+ filter: A,
1974
+ clearFilter: P,
1970
1975
  // 状态访问方法
1971
- isValidJson: () => h.value,
1976
+ isValidJson: () => p.value,
1972
1977
  getParsedJson: () => o.value,
1973
1978
  getFilteredJson: () => a.value,
1974
1979
  getExpandedNodes: () => u.value,
1975
1980
  getParseError: () => i.value,
1976
1981
  getFilterError: () => l.value,
1977
1982
  // 工具方法
1978
- parseJson: (d) => m(d),
1979
- copyValue: (d) => X(d)
1980
- }), (d, g) => (x(), k("div", {
1981
- class: Te(["json-format", `json-format--${f.value.name}`])
1983
+ parseJson: (c) => b(c),
1984
+ copyValue: (c) => j(c)
1985
+ }), (c, f) => (_(), x("div", {
1986
+ class: Te(["json-format", `json-format--${h.value.name}`])
1982
1987
  }, [
1983
- d.showToolbar ? (x(), k("div", Lt, [
1984
- v("div", Rt, [
1985
- v("button", {
1988
+ c.showToolbar ? (_(), x("div", Lt, [
1989
+ y("div", jt, [
1990
+ y("button", {
1986
1991
  class: "json-format__btn json-format__btn--primary",
1987
1992
  onClick: O,
1988
- disabled: !h.value,
1993
+ disabled: !p.value,
1989
1994
  title: "Copy JSON"
1990
- }, " 📋 Copy ", 8, jt),
1991
- v("button", {
1995
+ }, " 📋 Copy ", 8, Rt),
1996
+ y("button", {
1992
1997
  class: "json-format__btn json-format__btn--secondary",
1993
- onClick: $,
1994
- disabled: !h.value,
1998
+ onClick: g,
1999
+ disabled: !p.value,
1995
2000
  title: "Expand All"
1996
2001
  }, " ⬇️ Expand All ", 8, Mt),
1997
- v("button", {
2002
+ y("button", {
1998
2003
  class: "json-format__btn json-format__btn--secondary",
1999
- onClick: E,
2000
- disabled: !h.value,
2004
+ onClick: m,
2005
+ disabled: !p.value,
2001
2006
  title: "Collapse All"
2002
2007
  }, " ➡️ Collapse All ", 8, Ut),
2003
- v("button", {
2008
+ y("button", {
2004
2009
  class: "json-format__btn json-format__btn--secondary",
2005
- onClick: I,
2006
- disabled: !h.value,
2010
+ onClick: $,
2011
+ disabled: !p.value,
2007
2012
  title: "Compress JSON"
2008
2013
  }, " 📦 Compress ", 8, Ft)
2009
2014
  ]),
2010
- v("div", Xt, [
2011
- h.value ? (x(), k("span", Ht, " ✅ Valid JSON ")) : (x(), k("span", Kt, " ❌ Invalid JSON "))
2015
+ y("div", Xt, [
2016
+ p.value ? (_(), x("span", Ht, " ✅ Valid JSON ")) : (_(), x("span", Kt, " ❌ Invalid JSON "))
2012
2017
  ])
2013
- ])) : F("", !0),
2014
- v("div", qt, [
2015
- h.value ? l.value ? (x(), k("div", Qt, [
2016
- g[1] || (g[1] = v("h4", null, "Filter Error:", -1)),
2017
- v("pre", null, R(l.value), 1)
2018
- ])) : (x(), k("div", Wt, [
2019
- Fe(Pt, {
2020
- value: b.value,
2018
+ ])) : U("", !0),
2019
+ y("div", qt, [
2020
+ p.value ? l.value ? (_(), x("div", Wt, [
2021
+ f[1] || (f[1] = y("h4", null, "Filter Error:", -1)),
2022
+ y("pre", null, B(l.value), 1)
2023
+ ])) : (_(), x("div", Yt, [
2024
+ Ue(Pt, {
2025
+ value: v.value,
2021
2026
  "key-name": "",
2022
2027
  level: 0,
2023
2028
  expanded: u.value,
2024
2029
  "is-last": !0,
2025
- theme: f.value,
2026
- "onUpdate:value": j,
2027
- onToggleExpand: p,
2028
- onCopy: X,
2029
- "onUpdate:key": Z
2030
+ theme: h.value,
2031
+ "onUpdate:value": S,
2032
+ onToggleExpand: Z,
2033
+ onCopy: j,
2034
+ "onUpdate:key": H
2030
2035
  }, null, 8, ["value", "expanded", "theme"])
2031
- ])) : (x(), k("div", Yt, [
2032
- g[0] || (g[0] = v("h4", null, "JSON Parse Error:", -1)),
2033
- v("pre", null, R(i.value), 1)
2036
+ ])) : (_(), x("div", Qt, [
2037
+ f[0] || (f[0] = y("h4", null, "JSON Parse Error:", -1)),
2038
+ y("pre", null, B(i.value), 1)
2034
2039
  ]))
2035
2040
  ])
2036
2041
  ], 2));
2037
2042
  }
2038
- }), Zt = /* @__PURE__ */ be(Gt, [["__scopeId", "data-v-7a477244"]]), zt = {
2043
+ }), Zt = /* @__PURE__ */ be(Gt, [["__scopeId", "data-v-b956002c"]]), zt = {
2039
2044
  key: 0,
2040
2045
  class: "xml-node__comment"
2041
2046
  }, Dt = {
@@ -2050,16 +2055,19 @@ const Lt = {
2050
2055
  }, tr = {
2051
2056
  key: 1,
2052
2057
  class: "xml-node__line"
2053
- }, rr = { key: 2 }, nr = { class: "xml-node__line" }, sr = ["title"], or = { key: 1 }, ir = ["title"], ar = {
2058
+ }, rr = { key: 2 }, nr = {
2059
+ key: 0,
2060
+ class: "xml-node__line"
2061
+ }, sr = ["title"], or = { class: "xml-node__line" }, ir = ["title"], ar = { key: 1 }, lr = ["title"], ur = {
2054
2062
  key: 0,
2055
2063
  class: "xml-node__children"
2056
- }, lr = {
2064
+ }, cr = {
2057
2065
  key: 0,
2058
2066
  class: "xml-node__text"
2059
- }, ur = {
2067
+ }, dr = {
2060
2068
  key: 1,
2061
2069
  class: "xml-node__line"
2062
- }, cr = /* @__PURE__ */ ye({
2070
+ }, fr = /* @__PURE__ */ ye({
2063
2071
  __name: "XmlNode",
2064
2072
  props: {
2065
2073
  node: {},
@@ -2071,279 +2079,351 @@ const Lt = {
2071
2079
  },
2072
2080
  emits: ["toggle-expand", "copy"],
2073
2081
  setup(r, { emit: e }) {
2074
- const t = r, s = e, n = V(() => Object.keys(t.node).find(($) => !$.startsWith(":") && !$.startsWith("#")) || ""), o = V(() => n.value ? t.parentPath ? `${t.parentPath}[${t.index}]` : `${n.value}[${t.index}]` : ""), i = V(() => t.expanded.has(o.value)), u = V(() => t.node["#comment"] ? "comment" : t.node.__cdata ? "cdata" : n.value ? "element" : "unknown"), a = V(() => {
2075
- const p = t.node[":@"] || {}, $ = {};
2076
- return Object.keys(p).forEach((E) => {
2077
- E.startsWith("@_") && ($[E.substring(2)] = p[E]);
2078
- }), $;
2082
+ const t = r, s = e, n = V(() => Object.keys(t.node).find((m) => !m.startsWith(":") && !m.startsWith("#")) || ""), o = V(() => n.value ? t.parentPath ? `${t.parentPath}[${t.index}]` : `${n.value}[${t.index}]` : ""), i = V(() => t.expanded.has(o.value)), u = V(() => t.node["#comment"] ? "comment" : t.node.__cdata ? "cdata" : n.value ? "element" : "unknown"), a = V(() => {
2083
+ const g = t.node[":@"] || {}, m = {};
2084
+ return Object.keys(g).forEach((O) => {
2085
+ O.startsWith("@_") && (m[O.substring(2)] = g[O]);
2086
+ }), m;
2079
2087
  }), l = V(() => {
2080
2088
  if (u.value !== "element" || !n.value) return [];
2081
- const p = t.node[n.value];
2082
- return Array.isArray(p) ? p : [];
2083
- }), h = V(() => l.value.some((p) => p.__cdata)), f = V(() => {
2084
- if (!h.value) return "";
2085
- const p = l.value.find(($) => $.__cdata);
2086
- if (p && Array.isArray(p.__cdata)) {
2087
- const $ = p.__cdata;
2088
- if ($.length > 0 && $[0]["#text"])
2089
- return $[0]["#text"];
2089
+ const g = t.node[n.value];
2090
+ return Array.isArray(g) ? g : [];
2091
+ }), p = V(() => l.value.some((g) => g.__cdata)), h = V(() => {
2092
+ if (!p.value) return "";
2093
+ const g = l.value.find((m) => m.__cdata);
2094
+ if (g && Array.isArray(g.__cdata)) {
2095
+ const m = g.__cdata;
2096
+ if (m.length > 0 && m[0]["#text"])
2097
+ return m[0]["#text"];
2090
2098
  }
2091
2099
  return "";
2100
+ }), v = V(() => {
2101
+ if (u.value !== "element" || !n.value || p.value) return "";
2102
+ const g = t.node[n.value];
2103
+ if (!Array.isArray(g)) return "";
2104
+ const m = g.find((O) => O["#text"]);
2105
+ return m ? m["#text"] : "";
2092
2106
  }), b = V(() => {
2093
- if (u.value !== "element" || !n.value || h.value) return "";
2094
- const p = t.node[n.value];
2095
- if (!Array.isArray(p)) return "";
2096
- const $ = p.find((E) => E["#text"]);
2097
- return $ ? $["#text"] : "";
2098
- }), m = V(() => {
2099
2107
  if (u.value !== "comment") return "";
2100
- const p = t.node["#comment"];
2101
- return Array.isArray(p) && p.length > 0 && p[0]["#text"] || "";
2102
- }), w = V(() => l.value.some((p) => Object.keys(p).some((E) => !E.startsWith("#") && !E.startsWith(":")))), S = V(() => u.value === "element" && !w.value && b.value.trim() !== ""), _ = () => {
2103
- w.value && s("toggle-expand", o.value);
2104
- }, j = (p, $) => `${o.value}-child-${$}`, H = () => `${o.value}.${n.value}`;
2105
- return (p, $) => {
2106
- const E = Ue("XmlNode", !0);
2107
- return x(), k("div", {
2108
+ const g = t.node["#comment"];
2109
+ return Array.isArray(g) && g.length > 0 && g[0]["#text"] || "";
2110
+ }), A = V(() => l.value.some((g) => Object.keys(g).some((O) => !O.startsWith("#") && !O.startsWith(":")))), P = V(() => A.value ? l.value.filter((g) => Object.keys(g).some((O) => !O.startsWith("#") && !O.startsWith(":"))).length : 0), k = V(() => u.value === "element" && !A.value && v.value.trim() !== ""), S = () => {
2111
+ A.value && s("toggle-expand", o.value);
2112
+ }, F = (g, m) => `${o.value}-child-${m}`, Z = () => `${o.value}.${n.value}`;
2113
+ return (g, m) => {
2114
+ const O = Me("XmlNode", !0);
2115
+ return _(), x("div", {
2108
2116
  class: "xml-node",
2109
- style: P({ paddingLeft: p.level > 0 ? "16px" : "0" })
2117
+ style: N({ paddingLeft: g.level > 0 ? "16px" : "0" })
2110
2118
  }, [
2111
- u.value === "comment" ? (x(), k("div", zt, [
2112
- v("span", {
2113
- style: P({ color: p.theme.colors.xmlComment })
2114
- }, " <!-- " + R(m.value) + " --> ", 5)
2115
- ])) : u.value === "cdata" ? (x(), k("div", Dt, [
2116
- v("span", {
2117
- style: P({ color: p.theme.colors.xmlCdata })
2118
- }, " <![CDATA[" + R(p.node.__cdata) + "]]> ", 5)
2119
- ])) : u.value === "element" ? (x(), k("div", Jt, [
2120
- h.value ? (x(), k("div", er, [
2121
- v("span", {
2119
+ u.value === "comment" ? (_(), x("div", zt, [
2120
+ y("span", {
2121
+ style: N({ color: g.theme.colors.xmlComment })
2122
+ }, " <!-- " + B(b.value) + " --> ", 5)
2123
+ ])) : u.value === "cdata" ? (_(), x("div", Dt, [
2124
+ y("span", {
2125
+ style: N({ color: g.theme.colors.xmlCdata })
2126
+ }, " <![CDATA[" + B(g.node.__cdata) + "]]> ", 5)
2127
+ ])) : u.value === "element" ? (_(), x("div", Jt, [
2128
+ p.value ? (_(), x("div", er, [
2129
+ y("span", {
2122
2130
  class: "xml-node__bracket",
2123
- style: P({ color: p.theme.colors.xmlBracket })
2131
+ style: N({ color: g.theme.colors.xmlBracket })
2124
2132
  }, "<", 4),
2125
- v("span", {
2133
+ y("span", {
2126
2134
  class: "xml-node__tag",
2127
- style: P({ color: p.theme.colors.xmlTag })
2128
- }, R(n.value), 5),
2129
- (x(!0), k(de, null, fe(a.value, (O, I) => (x(), k("span", {
2130
- key: I,
2135
+ style: N({ color: g.theme.colors.xmlTag })
2136
+ }, B(n.value), 5),
2137
+ (_(!0), x(ne, null, ie(a.value, ($, j) => (_(), x("span", {
2138
+ key: j,
2131
2139
  class: "xml-node__attribute"
2132
2140
  }, [
2133
- v("span", {
2141
+ y("span", {
2134
2142
  class: "xml-node__attr-name",
2135
- style: P({ color: p.theme.colors.xmlAttribute })
2136
- }, R(I), 5),
2137
- v("span", {
2143
+ style: N({ color: g.theme.colors.xmlAttribute })
2144
+ }, B(j), 5),
2145
+ y("span", {
2138
2146
  class: "xml-node__equals",
2139
- style: P({ color: p.theme.colors.xmlEquals })
2147
+ style: N({ color: g.theme.colors.xmlEquals })
2140
2148
  }, "=", 4),
2141
- v("span", {
2149
+ y("span", {
2142
2150
  class: "xml-node__quote",
2143
- style: P({ color: p.theme.colors.xmlQuote })
2151
+ style: N({ color: g.theme.colors.xmlQuote })
2144
2152
  }, '"', 4),
2145
- v("span", {
2153
+ y("span", {
2146
2154
  class: "xml-node__attr-value",
2147
- style: P({ color: p.theme.colors.xmlAttributeValue })
2148
- }, R(O), 5),
2149
- v("span", {
2155
+ style: N({ color: g.theme.colors.xmlAttributeValue })
2156
+ }, B($), 5),
2157
+ y("span", {
2150
2158
  class: "xml-node__quote",
2151
- style: P({ color: p.theme.colors.xmlQuote })
2159
+ style: N({ color: g.theme.colors.xmlQuote })
2152
2160
  }, '"', 4)
2153
2161
  ]))), 128)),
2154
- v("span", {
2162
+ y("span", {
2155
2163
  class: "xml-node__bracket",
2156
- style: P({ color: p.theme.colors.xmlBracket })
2164
+ style: N({ color: g.theme.colors.xmlBracket })
2157
2165
  }, ">", 4),
2158
- v("span", {
2166
+ y("span", {
2159
2167
  class: "xml-node__cdata",
2160
- style: P({ color: p.theme.colors.xmlCdata })
2161
- }, "<![CDATA[" + R(f.value) + "]]>", 5),
2162
- v("span", {
2168
+ style: N({ color: g.theme.colors.xmlCdata })
2169
+ }, "<![CDATA[" + B(h.value) + "]]>", 5),
2170
+ y("span", {
2163
2171
  class: "xml-node__bracket",
2164
- style: P({ color: p.theme.colors.xmlBracket })
2172
+ style: N({ color: g.theme.colors.xmlBracket })
2165
2173
  }, "</", 4),
2166
- v("span", {
2174
+ y("span", {
2167
2175
  class: "xml-node__tag",
2168
- style: P({ color: p.theme.colors.xmlTag })
2169
- }, R(n.value), 5),
2170
- v("span", {
2176
+ style: N({ color: g.theme.colors.xmlTag })
2177
+ }, B(n.value), 5),
2178
+ y("span", {
2171
2179
  class: "xml-node__bracket",
2172
- style: P({ color: p.theme.colors.xmlBracket })
2180
+ style: N({ color: g.theme.colors.xmlBracket })
2173
2181
  }, ">", 4)
2174
- ])) : S.value ? (x(), k("div", tr, [
2175
- v("span", {
2182
+ ])) : k.value ? (_(), x("div", tr, [
2183
+ y("span", {
2176
2184
  class: "xml-node__bracket",
2177
- style: P({ color: p.theme.colors.xmlBracket })
2185
+ style: N({ color: g.theme.colors.xmlBracket })
2178
2186
  }, "<", 4),
2179
- v("span", {
2187
+ y("span", {
2180
2188
  class: "xml-node__tag",
2181
- style: P({ color: p.theme.colors.xmlTag })
2182
- }, R(n.value), 5),
2183
- (x(!0), k(de, null, fe(a.value, (O, I) => (x(), k("span", {
2184
- key: I,
2189
+ style: N({ color: g.theme.colors.xmlTag })
2190
+ }, B(n.value), 5),
2191
+ (_(!0), x(ne, null, ie(a.value, ($, j) => (_(), x("span", {
2192
+ key: j,
2185
2193
  class: "xml-node__attribute"
2186
2194
  }, [
2187
- v("span", {
2195
+ y("span", {
2188
2196
  class: "xml-node__attr-name",
2189
- style: P({ color: p.theme.colors.xmlAttribute })
2190
- }, R(I), 5),
2191
- v("span", {
2197
+ style: N({ color: g.theme.colors.xmlAttribute })
2198
+ }, B(j), 5),
2199
+ y("span", {
2192
2200
  class: "xml-node__equals",
2193
- style: P({ color: p.theme.colors.xmlEquals })
2201
+ style: N({ color: g.theme.colors.xmlEquals })
2194
2202
  }, "=", 4),
2195
- v("span", {
2203
+ y("span", {
2196
2204
  class: "xml-node__quote",
2197
- style: P({ color: p.theme.colors.xmlQuote })
2205
+ style: N({ color: g.theme.colors.xmlQuote })
2198
2206
  }, '"', 4),
2199
- v("span", {
2207
+ y("span", {
2200
2208
  class: "xml-node__attr-value",
2201
- style: P({ color: p.theme.colors.xmlAttributeValue })
2202
- }, R(O), 5),
2203
- v("span", {
2209
+ style: N({ color: g.theme.colors.xmlAttributeValue })
2210
+ }, B($), 5),
2211
+ y("span", {
2204
2212
  class: "xml-node__quote",
2205
- style: P({ color: p.theme.colors.xmlQuote })
2213
+ style: N({ color: g.theme.colors.xmlQuote })
2206
2214
  }, '"', 4)
2207
2215
  ]))), 128)),
2208
- v("span", {
2216
+ y("span", {
2209
2217
  class: "xml-node__bracket",
2210
- style: P({ color: p.theme.colors.xmlBracket })
2218
+ style: N({ color: g.theme.colors.xmlBracket })
2211
2219
  }, ">", 4),
2212
- v("span", {
2220
+ y("span", {
2213
2221
  class: "xml-node__text-content",
2214
- style: P({ color: p.theme.colors.xmlText })
2215
- }, R(b.value), 5),
2216
- v("span", {
2222
+ style: N({ color: g.theme.colors.xmlText })
2223
+ }, B(v.value), 5),
2224
+ y("span", {
2217
2225
  class: "xml-node__bracket",
2218
- style: P({ color: p.theme.colors.xmlBracket })
2226
+ style: N({ color: g.theme.colors.xmlBracket })
2219
2227
  }, "</", 4),
2220
- v("span", {
2228
+ y("span", {
2221
2229
  class: "xml-node__tag",
2222
- style: P({ color: p.theme.colors.xmlTag })
2223
- }, R(n.value), 5),
2224
- v("span", {
2230
+ style: N({ color: g.theme.colors.xmlTag })
2231
+ }, B(n.value), 5),
2232
+ y("span", {
2225
2233
  class: "xml-node__bracket",
2226
- style: P({ color: p.theme.colors.xmlBracket })
2234
+ style: N({ color: g.theme.colors.xmlBracket })
2227
2235
  }, ">", 4)
2228
- ])) : (x(), k("div", rr, [
2229
- v("div", nr, [
2230
- w.value ? (x(), k("span", {
2231
- key: 0,
2236
+ ])) : (_(), x("div", rr, [
2237
+ !i.value && A.value ? (_(), x("div", nr, [
2238
+ y("span", {
2232
2239
  class: "xml-node__clickable-part",
2233
- onClick: $[0] || ($[0] = (O) => _()),
2234
- title: i.value ? "Click to collapse" : "Click to expand"
2240
+ onClick: m[0] || (m[0] = ($) => S()),
2241
+ title: "Click to expand"
2235
2242
  }, [
2236
- v("span", {
2243
+ y("span", {
2237
2244
  class: "xml-node__bracket",
2238
- style: P({ color: p.theme.colors.xmlBracket })
2245
+ style: N({ color: g.theme.colors.xmlBracket })
2239
2246
  }, "<", 4),
2240
- v("span", {
2247
+ y("span", {
2241
2248
  class: "xml-node__tag",
2242
- style: P({ color: p.theme.colors.xmlTag })
2243
- }, R(n.value), 5)
2244
- ], 8, sr)) : (x(), k("span", or, [
2245
- v("span", {
2246
- class: "xml-node__bracket",
2247
- style: P({ color: p.theme.colors.xmlBracket })
2248
- }, "<", 4),
2249
- v("span", {
2250
- class: "xml-node__tag",
2251
- style: P({ color: p.theme.colors.xmlTag })
2252
- }, R(n.value), 5)
2253
- ])),
2254
- (x(!0), k(de, null, fe(a.value, (O, I) => (x(), k("span", {
2255
- key: I,
2249
+ style: N({ color: g.theme.colors.xmlTag })
2250
+ }, B(n.value), 5)
2251
+ ]),
2252
+ (_(!0), x(ne, null, ie(a.value, ($, j) => (_(), x("span", {
2253
+ key: j,
2256
2254
  class: "xml-node__attribute"
2257
2255
  }, [
2258
- v("span", {
2256
+ y("span", {
2259
2257
  class: "xml-node__attr-name",
2260
- style: P({ color: p.theme.colors.xmlAttribute })
2261
- }, R(I), 5),
2262
- v("span", {
2258
+ style: N({ color: g.theme.colors.xmlAttribute })
2259
+ }, B(j), 5),
2260
+ y("span", {
2263
2261
  class: "xml-node__equals",
2264
- style: P({ color: p.theme.colors.xmlEquals })
2262
+ style: N({ color: g.theme.colors.xmlEquals })
2265
2263
  }, "=", 4),
2266
- v("span", {
2264
+ y("span", {
2267
2265
  class: "xml-node__quote",
2268
- style: P({ color: p.theme.colors.xmlQuote })
2266
+ style: N({ color: g.theme.colors.xmlQuote })
2269
2267
  }, '"', 4),
2270
- v("span", {
2268
+ y("span", {
2271
2269
  class: "xml-node__attr-value",
2272
- style: P({ color: p.theme.colors.xmlAttributeValue })
2273
- }, R(O), 5),
2274
- v("span", {
2270
+ style: N({ color: g.theme.colors.xmlAttributeValue })
2271
+ }, B($), 5),
2272
+ y("span", {
2275
2273
  class: "xml-node__quote",
2276
- style: P({ color: p.theme.colors.xmlQuote })
2274
+ style: N({ color: g.theme.colors.xmlQuote })
2277
2275
  }, '"', 4)
2278
2276
  ]))), 128)),
2279
- w.value ? (x(), k("span", {
2280
- key: 2,
2277
+ y("span", {
2281
2278
  class: "xml-node__clickable-part",
2282
- onClick: $[1] || ($[1] = (O) => _()),
2283
- title: i.value ? "Click to collapse" : "Click to expand"
2279
+ onClick: m[1] || (m[1] = ($) => S()),
2280
+ title: "Click to expand"
2284
2281
  }, [
2285
- v("span", {
2282
+ y("span", {
2286
2283
  class: "xml-node__bracket",
2287
- style: P({ color: p.theme.colors.xmlBracket })
2284
+ style: N({ color: g.theme.colors.xmlBracket })
2288
2285
  }, ">", 4)
2289
- ], 8, ir)) : (x(), k("span", {
2290
- key: 3,
2291
- class: "xml-node__bracket",
2292
- style: P({ color: p.theme.colors.xmlBracket })
2293
- }, R(w.value ? ">" : "/>"), 5)),
2294
- !i.value && w.value ? (x(), k("span", {
2295
- key: 4,
2296
- class: "xml-node__collapsed xml-node__collapsed--clickable",
2297
- style: P({ color: p.theme.colors.textSecondary }),
2298
- onClick: $[2] || ($[2] = (O) => _()),
2299
- title: "Click to expand"
2300
- }, "...", 4)) : F("", !0)
2301
- ]),
2302
- i.value && w.value ? (x(), k("div", ar, [
2303
- l.value.length === 0 && b.value.trim() ? (x(), k("div", lr, [
2304
- v("span", {
2305
- class: "xml-node__text-content",
2306
- style: P({ color: p.theme.colors.xmlText })
2307
- }, R(b.value), 5)
2308
- ])) : F("", !0),
2309
- (x(!0), k(de, null, fe(l.value, (O, I) => (x(), He(E, {
2310
- key: j(O, I),
2311
- node: O,
2312
- index: I,
2313
- level: p.level + 1,
2314
- "parent-path": H(),
2315
- expanded: p.expanded,
2316
- theme: p.theme,
2317
- onToggleExpand: $[3] || ($[3] = (X) => p.$emit("toggle-expand", X)),
2318
- onCopy: $[4] || ($[4] = (X) => p.$emit("copy", X))
2319
- }, null, 8, ["node", "index", "level", "parent-path", "expanded", "theme"]))), 128))
2320
- ])) : F("", !0),
2321
- i.value && w.value ? (x(), k("div", ur, [
2322
- v("span", {
2286
+ ]),
2287
+ y("span", {
2288
+ class: "xml-node__collapsed-badge",
2289
+ style: N({
2290
+ backgroundColor: g.theme.colors.collapsedBackground,
2291
+ color: g.theme.colors.collapsedText
2292
+ }),
2293
+ onClick: m[2] || (m[2] = ($) => S()),
2294
+ title: `Click to expand ${P.value} child element${P.value > 1 ? "s" : ""}`
2295
+ }, B(P.value) + " child" + B(P.value > 1 ? "ren" : ""), 13, sr),
2296
+ y("span", {
2323
2297
  class: "xml-node__clickable-part",
2324
- onClick: $[5] || ($[5] = (O) => _()),
2325
- title: "Click to collapse"
2298
+ onClick: m[3] || (m[3] = ($) => S()),
2299
+ title: "Click to expand"
2326
2300
  }, [
2327
- v("span", {
2301
+ y("span", {
2328
2302
  class: "xml-node__bracket",
2329
- style: P({ color: p.theme.colors.xmlBracket })
2303
+ style: N({ color: g.theme.colors.xmlBracket })
2330
2304
  }, "</", 4),
2331
- v("span", {
2305
+ y("span", {
2332
2306
  class: "xml-node__tag",
2333
- style: P({ color: p.theme.colors.xmlTag })
2334
- }, R(n.value), 5),
2335
- v("span", {
2307
+ style: N({ color: g.theme.colors.xmlTag })
2308
+ }, B(n.value), 5),
2309
+ y("span", {
2336
2310
  class: "xml-node__bracket",
2337
- style: P({ color: p.theme.colors.xmlBracket })
2311
+ style: N({ color: g.theme.colors.xmlBracket })
2338
2312
  }, ">", 4)
2339
2313
  ])
2340
- ])) : F("", !0)
2314
+ ])) : (_(), x(ne, { key: 1 }, [
2315
+ y("div", or, [
2316
+ A.value ? (_(), x("span", {
2317
+ key: 0,
2318
+ class: "xml-node__clickable-part",
2319
+ onClick: m[4] || (m[4] = ($) => S()),
2320
+ title: i.value ? "Click to collapse" : "Click to expand"
2321
+ }, [
2322
+ y("span", {
2323
+ class: "xml-node__bracket",
2324
+ style: N({ color: g.theme.colors.xmlBracket })
2325
+ }, "<", 4),
2326
+ y("span", {
2327
+ class: "xml-node__tag",
2328
+ style: N({ color: g.theme.colors.xmlTag })
2329
+ }, B(n.value), 5)
2330
+ ], 8, ir)) : (_(), x("span", ar, [
2331
+ y("span", {
2332
+ class: "xml-node__bracket",
2333
+ style: N({ color: g.theme.colors.xmlBracket })
2334
+ }, "<", 4),
2335
+ y("span", {
2336
+ class: "xml-node__tag",
2337
+ style: N({ color: g.theme.colors.xmlTag })
2338
+ }, B(n.value), 5)
2339
+ ])),
2340
+ (_(!0), x(ne, null, ie(a.value, ($, j) => (_(), x("span", {
2341
+ key: j,
2342
+ class: "xml-node__attribute"
2343
+ }, [
2344
+ y("span", {
2345
+ class: "xml-node__attr-name",
2346
+ style: N({ color: g.theme.colors.xmlAttribute })
2347
+ }, B(j), 5),
2348
+ y("span", {
2349
+ class: "xml-node__equals",
2350
+ style: N({ color: g.theme.colors.xmlEquals })
2351
+ }, "=", 4),
2352
+ y("span", {
2353
+ class: "xml-node__quote",
2354
+ style: N({ color: g.theme.colors.xmlQuote })
2355
+ }, '"', 4),
2356
+ y("span", {
2357
+ class: "xml-node__attr-value",
2358
+ style: N({ color: g.theme.colors.xmlAttributeValue })
2359
+ }, B($), 5),
2360
+ y("span", {
2361
+ class: "xml-node__quote",
2362
+ style: N({ color: g.theme.colors.xmlQuote })
2363
+ }, '"', 4)
2364
+ ]))), 128)),
2365
+ A.value ? (_(), x("span", {
2366
+ key: 2,
2367
+ class: "xml-node__clickable-part",
2368
+ onClick: m[5] || (m[5] = ($) => S()),
2369
+ title: i.value ? "Click to collapse" : "Click to expand"
2370
+ }, [
2371
+ y("span", {
2372
+ class: "xml-node__bracket",
2373
+ style: N({ color: g.theme.colors.xmlBracket })
2374
+ }, ">", 4)
2375
+ ], 8, lr)) : (_(), x("span", {
2376
+ key: 3,
2377
+ class: "xml-node__bracket",
2378
+ style: N({ color: g.theme.colors.xmlBracket })
2379
+ }, B(A.value ? ">" : "/>"), 5))
2380
+ ]),
2381
+ i.value && A.value ? (_(), x("div", ur, [
2382
+ l.value.length === 0 && v.value.trim() ? (_(), x("div", cr, [
2383
+ y("span", {
2384
+ class: "xml-node__text-content",
2385
+ style: N({ color: g.theme.colors.xmlText })
2386
+ }, B(v.value), 5)
2387
+ ])) : U("", !0),
2388
+ (_(!0), x(ne, null, ie(l.value, ($, j) => (_(), Xe(O, {
2389
+ key: F($, j),
2390
+ node: $,
2391
+ index: j,
2392
+ level: g.level + 1,
2393
+ "parent-path": Z(),
2394
+ expanded: g.expanded,
2395
+ theme: g.theme,
2396
+ onToggleExpand: m[6] || (m[6] = (H) => g.$emit("toggle-expand", H)),
2397
+ onCopy: m[7] || (m[7] = (H) => g.$emit("copy", H))
2398
+ }, null, 8, ["node", "index", "level", "parent-path", "expanded", "theme"]))), 128))
2399
+ ])) : U("", !0),
2400
+ i.value && A.value ? (_(), x("div", dr, [
2401
+ y("span", {
2402
+ class: "xml-node__clickable-part",
2403
+ onClick: m[8] || (m[8] = ($) => S()),
2404
+ title: "Click to collapse"
2405
+ }, [
2406
+ y("span", {
2407
+ class: "xml-node__bracket",
2408
+ style: N({ color: g.theme.colors.xmlBracket })
2409
+ }, "</", 4),
2410
+ y("span", {
2411
+ class: "xml-node__tag",
2412
+ style: N({ color: g.theme.colors.xmlTag })
2413
+ }, B(n.value), 5),
2414
+ y("span", {
2415
+ class: "xml-node__bracket",
2416
+ style: N({ color: g.theme.colors.xmlBracket })
2417
+ }, ">", 4)
2418
+ ])
2419
+ ])) : U("", !0)
2420
+ ], 64))
2341
2421
  ]))
2342
- ])) : F("", !0)
2422
+ ])) : U("", !0)
2343
2423
  ], 4);
2344
2424
  };
2345
2425
  }
2346
- }), dr = /* @__PURE__ */ be(cr, [["__scopeId", "data-v-9c0c90fa"]]), fr = {
2426
+ }), hr = /* @__PURE__ */ be(fr, [["__scopeId", "data-v-afb7b2ab"]]), pr = {
2347
2427
  name: "github-light",
2348
2428
  colors: {
2349
2429
  // 背景色
@@ -2385,10 +2465,15 @@ const Lt = {
2385
2465
  // 括号 - 灰色
2386
2466
  xmlEquals: "#6e7781",
2387
2467
  // 等号 - 灰色
2388
- xmlQuote: "#0550ae"
2468
+ xmlQuote: "#0550ae",
2389
2469
  // 引号 - 蓝色
2470
+ // 折叠效果
2471
+ collapsedBackground: "#ddf4ff",
2472
+ // 折叠信息背景色 - 浅蓝
2473
+ collapsedText: "#0969da"
2474
+ // 折叠信息文本色 - 蓝色
2390
2475
  }
2391
- }, hr = {
2476
+ }, gr = {
2392
2477
  name: "github-dark",
2393
2478
  colors: {
2394
2479
  // 背景色
@@ -2430,10 +2515,15 @@ const Lt = {
2430
2515
  // 括号 - 灰色
2431
2516
  xmlEquals: "#8b949e",
2432
2517
  // 等号 - 灰色
2433
- xmlQuote: "#79c0ff"
2518
+ xmlQuote: "#79c0ff",
2434
2519
  // 引号 - 亮蓝色
2520
+ // 折叠效果
2521
+ collapsedBackground: "#1c2d41",
2522
+ // 折叠信息背景色 - 深蓝
2523
+ collapsedText: "#58a6ff"
2524
+ // 折叠信息文本色 - 亮蓝
2435
2525
  }
2436
- }, pr = {
2526
+ }, mr = {
2437
2527
  name: "min-light",
2438
2528
  colors: {
2439
2529
  // 背景色
@@ -2475,10 +2565,15 @@ const Lt = {
2475
2565
  // 括号 - 灰色
2476
2566
  xmlEquals: "#737373",
2477
2567
  // 等号 - 灰色
2478
- xmlQuote: "#2563eb"
2568
+ xmlQuote: "#2563eb",
2479
2569
  // 引号 - 蓝色
2570
+ // 折叠效果
2571
+ collapsedBackground: "#dbeafe",
2572
+ // 折叠信息背景色 - 浅蓝
2573
+ collapsedText: "#1d4ed8"
2574
+ // 折叠信息文本色 - 蓝色
2480
2575
  }
2481
- }, gr = {
2576
+ }, yr = {
2482
2577
  name: "slack-ochin",
2483
2578
  colors: {
2484
2579
  // 背景色
@@ -2520,16 +2615,21 @@ const Lt = {
2520
2615
  // 括号 - 灰色
2521
2616
  xmlEquals: "#616061",
2522
2617
  // 等号 - 灰色
2523
- xmlQuote: "#1264a3"
2618
+ xmlQuote: "#1264a3",
2524
2619
  // 引号 - 蓝色
2620
+ // 折叠效果
2621
+ collapsedBackground: "#d8eaf5",
2622
+ // 折叠信息背景色 - 浅蓝
2623
+ collapsedText: "#0b4c8c"
2624
+ // 折叠信息文本色 - 深蓝
2525
2625
  }
2526
2626
  }, Be = {
2527
- "github-light": fr,
2528
- "github-dark": hr,
2529
- "min-light": pr,
2530
- "slack-ochin": gr
2531
- }, mr = (r) => Be[r] || Be["github-light"], qe = ":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", yr = qe + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040", br = "[" + qe + "][" + yr + "]*", vr = new RegExp("^" + br + "$");
2532
- function Ye(r, e) {
2627
+ "github-light": pr,
2628
+ "github-dark": gr,
2629
+ "min-light": mr,
2630
+ "slack-ochin": yr
2631
+ }, br = (r) => Be[r] || Be["github-light"], Ke = ":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", vr = Ke + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040", _r = "[" + Ke + "][" + vr + "]*", Er = new RegExp("^" + _r + "$");
2632
+ function qe(r, e) {
2533
2633
  const t = [];
2534
2634
  let s = e.exec(r);
2535
2635
  for (; s; ) {
@@ -2543,29 +2643,29 @@ function Ye(r, e) {
2543
2643
  return t;
2544
2644
  }
2545
2645
  const ve = function(r) {
2546
- const e = vr.exec(r);
2646
+ const e = Er.exec(r);
2547
2647
  return !(e === null || typeof e > "u");
2548
2648
  };
2549
- function Er(r) {
2649
+ function xr(r) {
2550
2650
  return typeof r < "u";
2551
2651
  }
2552
- const _r = {
2652
+ const kr = {
2553
2653
  allowBooleanAttributes: !1,
2554
2654
  //A tag can have attributes without any value
2555
2655
  unpairedTags: []
2556
2656
  };
2557
2657
  function Qe(r, e) {
2558
- e = Object.assign({}, _r, e);
2658
+ e = Object.assign({}, kr, e);
2559
2659
  const t = [];
2560
2660
  let s = !1, n = !1;
2561
2661
  r[0] === "\uFEFF" && (r = r.substr(1));
2562
2662
  for (let o = 0; o < r.length; o++)
2563
2663
  if (r[o] === "<" && r[o + 1] === "?") {
2564
- if (o += 2, o = Le(r, o), o.err) return o;
2664
+ if (o += 2, o = Ve(r, o), o.err) return o;
2565
2665
  } else if (r[o] === "<") {
2566
2666
  let i = o;
2567
2667
  if (o++, r[o] === "!") {
2568
- o = Re(r, o);
2668
+ o = Le(r, o);
2569
2669
  continue;
2570
2670
  } else {
2571
2671
  let u = !1;
@@ -2574,91 +2674,91 @@ function Qe(r, e) {
2574
2674
  for (; o < r.length && r[o] !== ">" && r[o] !== " " && r[o] !== " " && r[o] !== `
2575
2675
  ` && r[o] !== "\r"; o++)
2576
2676
  a += r[o];
2577
- if (a = a.trim(), a[a.length - 1] === "/" && (a = a.substring(0, a.length - 1), o--), !Tr(a)) {
2578
- let f;
2579
- return a.trim().length === 0 ? f = "Invalid space after '<'." : f = "Tag '" + a + "' is an invalid name.", U("InvalidTag", f, W(r, o));
2677
+ if (a = a.trim(), a[a.length - 1] === "/" && (a = a.substring(0, a.length - 1), o--), !$r(a)) {
2678
+ let h;
2679
+ return a.trim().length === 0 ? h = "Invalid space after '<'." : h = "Tag '" + a + "' is an invalid name.", M("InvalidTag", h, Q(r, o));
2580
2680
  }
2581
- const l = kr(r, o);
2681
+ const l = wr(r, o);
2582
2682
  if (l === !1)
2583
- return U("InvalidAttr", "Attributes for '" + a + "' have open quote.", W(r, o));
2584
- let h = l.value;
2585
- if (o = l.index, h[h.length - 1] === "/") {
2586
- const f = o - h.length;
2587
- h = h.substring(0, h.length - 1);
2588
- const b = je(h, e);
2589
- if (b === !0)
2683
+ return M("InvalidAttr", "Attributes for '" + a + "' have open quote.", Q(r, o));
2684
+ let p = l.value;
2685
+ if (o = l.index, p[p.length - 1] === "/") {
2686
+ const h = o - p.length;
2687
+ p = p.substring(0, p.length - 1);
2688
+ const v = je(p, e);
2689
+ if (v === !0)
2590
2690
  s = !0;
2591
2691
  else
2592
- return U(b.err.code, b.err.msg, W(r, f + b.err.line));
2692
+ return M(v.err.code, v.err.msg, Q(r, h + v.err.line));
2593
2693
  } else if (u)
2594
2694
  if (l.tagClosed) {
2595
- if (h.trim().length > 0)
2596
- return U("InvalidTag", "Closing tag '" + a + "' can't have attributes or invalid starting.", W(r, i));
2695
+ if (p.trim().length > 0)
2696
+ return M("InvalidTag", "Closing tag '" + a + "' can't have attributes or invalid starting.", Q(r, i));
2597
2697
  if (t.length === 0)
2598
- return U("InvalidTag", "Closing tag '" + a + "' has not been opened.", W(r, i));
2698
+ return M("InvalidTag", "Closing tag '" + a + "' has not been opened.", Q(r, i));
2599
2699
  {
2600
- const f = t.pop();
2601
- if (a !== f.tagName) {
2602
- let b = W(r, f.tagStartPos);
2603
- return U(
2700
+ const h = t.pop();
2701
+ if (a !== h.tagName) {
2702
+ let v = Q(r, h.tagStartPos);
2703
+ return M(
2604
2704
  "InvalidTag",
2605
- "Expected closing tag '" + f.tagName + "' (opened in line " + b.line + ", col " + b.col + ") instead of closing tag '" + a + "'.",
2606
- W(r, i)
2705
+ "Expected closing tag '" + h.tagName + "' (opened in line " + v.line + ", col " + v.col + ") instead of closing tag '" + a + "'.",
2706
+ Q(r, i)
2607
2707
  );
2608
2708
  }
2609
2709
  t.length == 0 && (n = !0);
2610
2710
  }
2611
- } else return U("InvalidTag", "Closing tag '" + a + "' doesn't have proper closing.", W(r, o));
2711
+ } else return M("InvalidTag", "Closing tag '" + a + "' doesn't have proper closing.", Q(r, o));
2612
2712
  else {
2613
- const f = je(h, e);
2614
- if (f !== !0)
2615
- return U(f.err.code, f.err.msg, W(r, o - h.length + f.err.line));
2713
+ const h = je(p, e);
2714
+ if (h !== !0)
2715
+ return M(h.err.code, h.err.msg, Q(r, o - p.length + h.err.line));
2616
2716
  if (n === !0)
2617
- return U("InvalidXml", "Multiple possible root nodes found.", W(r, o));
2717
+ return M("InvalidXml", "Multiple possible root nodes found.", Q(r, o));
2618
2718
  e.unpairedTags.indexOf(a) !== -1 || t.push({ tagName: a, tagStartPos: i }), s = !0;
2619
2719
  }
2620
2720
  for (o++; o < r.length; o++)
2621
2721
  if (r[o] === "<")
2622
2722
  if (r[o + 1] === "!") {
2623
- o++, o = Re(r, o);
2723
+ o++, o = Le(r, o);
2624
2724
  continue;
2625
2725
  } else if (r[o + 1] === "?") {
2626
- if (o = Le(r, ++o), o.err) return o;
2726
+ if (o = Ve(r, ++o), o.err) return o;
2627
2727
  } else
2628
2728
  break;
2629
2729
  else if (r[o] === "&") {
2630
- const f = Cr(r, o);
2631
- if (f == -1)
2632
- return U("InvalidChar", "char '&' is not expected.", W(r, o));
2633
- o = f;
2634
- } else if (n === !0 && !Ve(r[o]))
2635
- return U("InvalidXml", "Extra text at the end", W(r, o));
2730
+ const h = Tr(r, o);
2731
+ if (h == -1)
2732
+ return M("InvalidChar", "char '&' is not expected.", Q(r, o));
2733
+ o = h;
2734
+ } else if (n === !0 && !Ie(r[o]))
2735
+ return M("InvalidXml", "Extra text at the end", Q(r, o));
2636
2736
  r[o] === "<" && o--;
2637
2737
  }
2638
2738
  } else {
2639
- if (Ve(r[o]))
2739
+ if (Ie(r[o]))
2640
2740
  continue;
2641
- return U("InvalidChar", "char '" + r[o] + "' is not expected.", W(r, o));
2741
+ return M("InvalidChar", "char '" + r[o] + "' is not expected.", Q(r, o));
2642
2742
  }
2643
2743
  if (s) {
2644
2744
  if (t.length == 1)
2645
- return U("InvalidTag", "Unclosed tag '" + t[0].tagName + "'.", W(r, t[0].tagStartPos));
2745
+ return M("InvalidTag", "Unclosed tag '" + t[0].tagName + "'.", Q(r, t[0].tagStartPos));
2646
2746
  if (t.length > 0)
2647
- return U("InvalidXml", "Invalid '" + JSON.stringify(t.map((o) => o.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
2648
- } else return U("InvalidXml", "Start tag expected.", 1);
2747
+ return M("InvalidXml", "Invalid '" + JSON.stringify(t.map((o) => o.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
2748
+ } else return M("InvalidXml", "Start tag expected.", 1);
2649
2749
  return !0;
2650
2750
  }
2651
- function Ve(r) {
2751
+ function Ie(r) {
2652
2752
  return r === " " || r === " " || r === `
2653
2753
  ` || r === "\r";
2654
2754
  }
2655
- function Le(r, e) {
2755
+ function Ve(r, e) {
2656
2756
  const t = e;
2657
2757
  for (; e < r.length; e++)
2658
2758
  if (r[e] == "?" || r[e] == " ") {
2659
2759
  const s = r.substr(t, e - t);
2660
2760
  if (e > 5 && s === "xml")
2661
- return U("InvalidXml", "XML declaration allowed only at the start of the document.", W(r, e));
2761
+ return M("InvalidXml", "XML declaration allowed only at the start of the document.", Q(r, e));
2662
2762
  if (r[e] == "?" && r[e + 1] == ">") {
2663
2763
  e++;
2664
2764
  break;
@@ -2667,7 +2767,7 @@ function Le(r, e) {
2667
2767
  }
2668
2768
  return e;
2669
2769
  }
2670
- function Re(r, e) {
2770
+ function Le(r, e) {
2671
2771
  if (r.length > e + 5 && r[e + 1] === "-" && r[e + 2] === "-") {
2672
2772
  for (e += 3; e < r.length; e++)
2673
2773
  if (r[e] === "-" && r[e + 1] === "-" && r[e + 2] === ">") {
@@ -2690,11 +2790,11 @@ function Re(r, e) {
2690
2790
  }
2691
2791
  return e;
2692
2792
  }
2693
- const xr = '"', Nr = "'";
2694
- function kr(r, e) {
2793
+ const Nr = '"', Ar = "'";
2794
+ function wr(r, e) {
2695
2795
  let t = "", s = "", n = !1;
2696
2796
  for (; e < r.length; e++) {
2697
- if (r[e] === xr || r[e] === Nr)
2797
+ if (r[e] === Nr || r[e] === Ar)
2698
2798
  s === "" ? s = r[e] : s !== r[e] || (s = "");
2699
2799
  else if (r[e] === ">" && s === "") {
2700
2800
  n = !0;
@@ -2708,27 +2808,27 @@ function kr(r, e) {
2708
2808
  tagClosed: n
2709
2809
  };
2710
2810
  }
2711
- const Ar = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
2811
+ const Cr = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
2712
2812
  function je(r, e) {
2713
- const t = Ye(r, Ar), s = {};
2813
+ const t = qe(r, Cr), s = {};
2714
2814
  for (let n = 0; n < t.length; n++) {
2715
2815
  if (t[n][1].length === 0)
2716
- return U("InvalidAttr", "Attribute '" + t[n][2] + "' has no space in starting.", pe(t[n]));
2816
+ return M("InvalidAttr", "Attribute '" + t[n][2] + "' has no space in starting.", pe(t[n]));
2717
2817
  if (t[n][3] !== void 0 && t[n][4] === void 0)
2718
- return U("InvalidAttr", "Attribute '" + t[n][2] + "' is without value.", pe(t[n]));
2818
+ return M("InvalidAttr", "Attribute '" + t[n][2] + "' is without value.", pe(t[n]));
2719
2819
  if (t[n][3] === void 0 && !e.allowBooleanAttributes)
2720
- return U("InvalidAttr", "boolean attribute '" + t[n][2] + "' is not allowed.", pe(t[n]));
2820
+ return M("InvalidAttr", "boolean attribute '" + t[n][2] + "' is not allowed.", pe(t[n]));
2721
2821
  const o = t[n][2];
2722
- if (!Or(o))
2723
- return U("InvalidAttr", "Attribute '" + o + "' is an invalid name.", pe(t[n]));
2822
+ if (!Pr(o))
2823
+ return M("InvalidAttr", "Attribute '" + o + "' is an invalid name.", pe(t[n]));
2724
2824
  if (!s.hasOwnProperty(o))
2725
2825
  s[o] = 1;
2726
2826
  else
2727
- return U("InvalidAttr", "Attribute '" + o + "' is repeated.", pe(t[n]));
2827
+ return M("InvalidAttr", "Attribute '" + o + "' is repeated.", pe(t[n]));
2728
2828
  }
2729
2829
  return !0;
2730
2830
  }
2731
- function wr(r, e) {
2831
+ function Or(r, e) {
2732
2832
  let t = /\d/;
2733
2833
  for (r[e] === "x" && (e++, t = /[\da-fA-F]/); e < r.length; e++) {
2734
2834
  if (r[e] === ";")
@@ -2738,11 +2838,11 @@ function wr(r, e) {
2738
2838
  }
2739
2839
  return -1;
2740
2840
  }
2741
- function Cr(r, e) {
2841
+ function Tr(r, e) {
2742
2842
  if (e++, r[e] === ";")
2743
2843
  return -1;
2744
2844
  if (r[e] === "#")
2745
- return e++, wr(r, e);
2845
+ return e++, Or(r, e);
2746
2846
  let t = 0;
2747
2847
  for (; e < r.length; e++, t++)
2748
2848
  if (!(r[e].match(/\w/) && t < 20)) {
@@ -2752,7 +2852,7 @@ function Cr(r, e) {
2752
2852
  }
2753
2853
  return e;
2754
2854
  }
2755
- function U(r, e, t) {
2855
+ function M(r, e, t) {
2756
2856
  return {
2757
2857
  err: {
2758
2858
  code: r,
@@ -2762,13 +2862,13 @@ function U(r, e, t) {
2762
2862
  }
2763
2863
  };
2764
2864
  }
2765
- function Or(r) {
2865
+ function Pr(r) {
2766
2866
  return ve(r);
2767
2867
  }
2768
- function Tr(r) {
2868
+ function $r(r) {
2769
2869
  return ve(r);
2770
2870
  }
2771
- function W(r, e) {
2871
+ function Q(r, e) {
2772
2872
  const t = r.substring(0, e).split(/\r?\n/);
2773
2873
  return {
2774
2874
  line: t.length,
@@ -2779,7 +2879,7 @@ function W(r, e) {
2779
2879
  function pe(r) {
2780
2880
  return r.startIndex + r[1].length;
2781
2881
  }
2782
- const Pr = {
2882
+ const Sr = {
2783
2883
  preserveOrder: !1,
2784
2884
  attributeNamePrefix: "@_",
2785
2885
  attributesGroupName: !1,
@@ -2823,12 +2923,12 @@ const Pr = {
2823
2923
  },
2824
2924
  // skipEmptyListItem: false
2825
2925
  captureMetaData: !1
2826
- }, $r = function(r) {
2827
- return Object.assign({}, Pr, r);
2926
+ }, Br = function(r) {
2927
+ return Object.assign({}, Sr, r);
2828
2928
  };
2829
2929
  let me;
2830
2930
  typeof Symbol != "function" ? me = "@@xmlMetadata" : me = Symbol("XML Node Metadata");
2831
- class oe {
2931
+ class ae {
2832
2932
  constructor(e) {
2833
2933
  this.tagname = e, this.child = [], this[":@"] = {};
2834
2934
  }
@@ -2843,7 +2943,7 @@ class oe {
2843
2943
  return me;
2844
2944
  }
2845
2945
  }
2846
- class Sr {
2946
+ class Ir {
2847
2947
  constructor(e) {
2848
2948
  this.suppressValidationErr = !e;
2849
2949
  }
@@ -2854,24 +2954,24 @@ class Sr {
2854
2954
  let n = 1, o = !1, i = !1, u = "";
2855
2955
  for (; t < e.length; t++)
2856
2956
  if (e[t] === "<" && !i) {
2857
- if (o && se(e, "!ENTITY", t)) {
2957
+ if (o && oe(e, "!ENTITY", t)) {
2858
2958
  t += 7;
2859
2959
  let a, l;
2860
2960
  [a, l, t] = this.readEntityExp(e, t + 1, this.suppressValidationErr), l.indexOf("&") === -1 && (s[a] = {
2861
2961
  regx: RegExp(`&${a};`, "g"),
2862
2962
  val: l
2863
2963
  });
2864
- } else if (o && se(e, "!ELEMENT", t)) {
2964
+ } else if (o && oe(e, "!ELEMENT", t)) {
2865
2965
  t += 8;
2866
2966
  const { index: a } = this.readElementExp(e, t + 1);
2867
2967
  t = a;
2868
- } else if (o && se(e, "!ATTLIST", t))
2968
+ } else if (o && oe(e, "!ATTLIST", t))
2869
2969
  t += 8;
2870
- else if (o && se(e, "!NOTATION", t)) {
2970
+ else if (o && oe(e, "!NOTATION", t)) {
2871
2971
  t += 9;
2872
2972
  const { index: a } = this.readNotationExp(e, t + 1, this.suppressValidationErr);
2873
2973
  t = a;
2874
- } else if (se(e, "!--", t)) i = !0;
2974
+ } else if (oe(e, "!--", t)) i = !0;
2875
2975
  else throw new Error("Invalid DOCTYPE");
2876
2976
  n++, u = "";
2877
2977
  } else if (e[t] === ">") {
@@ -2885,11 +2985,11 @@ class Sr {
2885
2985
  return { entities: s, i: t };
2886
2986
  }
2887
2987
  readEntityExp(e, t) {
2888
- t = G(e, t);
2988
+ t = W(e, t);
2889
2989
  let s = "";
2890
2990
  for (; t < e.length && !/\s/.test(e[t]) && e[t] !== '"' && e[t] !== "'"; )
2891
2991
  s += e[t], t++;
2892
- if (ge(s), t = G(e, t), !this.suppressValidationErr) {
2992
+ if (ge(s), t = W(e, t), !this.suppressValidationErr) {
2893
2993
  if (e.substring(t, t + 6).toUpperCase() === "SYSTEM")
2894
2994
  throw new Error("External entities are not supported");
2895
2995
  if (e[t] === "%")
@@ -2899,18 +2999,18 @@ class Sr {
2899
2999
  return [t, n] = this.readIdentifierVal(e, t, "entity"), t--, [s, n, t];
2900
3000
  }
2901
3001
  readNotationExp(e, t) {
2902
- t = G(e, t);
3002
+ t = W(e, t);
2903
3003
  let s = "";
2904
3004
  for (; t < e.length && !/\s/.test(e[t]); )
2905
3005
  s += e[t], t++;
2906
- !this.suppressValidationErr && ge(s), t = G(e, t);
3006
+ !this.suppressValidationErr && ge(s), t = W(e, t);
2907
3007
  const n = e.substring(t, t + 6).toUpperCase();
2908
3008
  if (!this.suppressValidationErr && n !== "SYSTEM" && n !== "PUBLIC")
2909
3009
  throw new Error(`Expected SYSTEM or PUBLIC, found "${n}"`);
2910
- t += n.length, t = G(e, t);
3010
+ t += n.length, t = W(e, t);
2911
3011
  let o = null, i = null;
2912
3012
  if (n === "PUBLIC")
2913
- [t, o] = this.readIdentifierVal(e, t, "publicIdentifier"), t = G(e, t), (e[t] === '"' || e[t] === "'") && ([t, i] = this.readIdentifierVal(e, t, "systemIdentifier"));
3013
+ [t, o] = this.readIdentifierVal(e, t, "publicIdentifier"), t = W(e, t), (e[t] === '"' || e[t] === "'") && ([t, i] = this.readIdentifierVal(e, t, "systemIdentifier"));
2914
3014
  else if (n === "SYSTEM" && ([t, i] = this.readIdentifierVal(e, t, "systemIdentifier"), !this.suppressValidationErr && !i))
2915
3015
  throw new Error("Missing mandatory system identifier for SYSTEM notation");
2916
3016
  return { notationName: s, publicIdentifier: o, systemIdentifier: i, index: --t };
@@ -2927,16 +3027,16 @@ class Sr {
2927
3027
  return t++, [t, n];
2928
3028
  }
2929
3029
  readElementExp(e, t) {
2930
- t = G(e, t);
3030
+ t = W(e, t);
2931
3031
  let s = "";
2932
3032
  for (; t < e.length && !/\s/.test(e[t]); )
2933
3033
  s += e[t], t++;
2934
3034
  if (!this.suppressValidationErr && !ve(s))
2935
3035
  throw new Error(`Invalid element name: "${s}"`);
2936
- t = G(e, t);
3036
+ t = W(e, t);
2937
3037
  let n = "";
2938
- if (e[t] === "E" && se(e, "MPTY", t)) t += 4;
2939
- else if (e[t] === "A" && se(e, "NY", t)) t += 2;
3038
+ if (e[t] === "E" && oe(e, "MPTY", t)) t += 4;
3039
+ else if (e[t] === "A" && oe(e, "NY", t)) t += 2;
2940
3040
  else if (e[t] === "(") {
2941
3041
  for (t++; t < e.length && e[t] !== ")"; )
2942
3042
  n += e[t], t++;
@@ -2951,20 +3051,20 @@ class Sr {
2951
3051
  };
2952
3052
  }
2953
3053
  readAttlistExp(e, t) {
2954
- t = G(e, t);
3054
+ t = W(e, t);
2955
3055
  let s = "";
2956
3056
  for (; t < e.length && !/\s/.test(e[t]); )
2957
3057
  s += e[t], t++;
2958
- ge(s), t = G(e, t);
3058
+ ge(s), t = W(e, t);
2959
3059
  let n = "";
2960
3060
  for (; t < e.length && !/\s/.test(e[t]); )
2961
3061
  n += e[t], t++;
2962
3062
  if (!ge(n))
2963
3063
  throw new Error(`Invalid attribute name: "${n}"`);
2964
- t = G(e, t);
3064
+ t = W(e, t);
2965
3065
  let o = "";
2966
3066
  if (e.substring(t, t + 8).toUpperCase() === "NOTATION") {
2967
- if (o = "NOTATION", t += 8, t = G(e, t), e[t] !== "(")
3067
+ if (o = "NOTATION", t += 8, t = W(e, t), e[t] !== "(")
2968
3068
  throw new Error(`Expected '(', found "${e[t]}"`);
2969
3069
  t++;
2970
3070
  let u = [];
@@ -2974,7 +3074,7 @@ class Sr {
2974
3074
  a += e[t], t++;
2975
3075
  if (a = a.trim(), !ge(a))
2976
3076
  throw new Error(`Invalid notation name: "${a}"`);
2977
- u.push(a), e[t] === "|" && (t++, t = G(e, t));
3077
+ u.push(a), e[t] === "|" && (t++, t = W(e, t));
2978
3078
  }
2979
3079
  if (e[t] !== ")")
2980
3080
  throw new Error("Unterminated list of notations");
@@ -2986,7 +3086,7 @@ class Sr {
2986
3086
  if (!this.suppressValidationErr && !u.includes(o.toUpperCase()))
2987
3087
  throw new Error(`Invalid attribute type: "${o}"`);
2988
3088
  }
2989
- t = G(e, t);
3089
+ t = W(e, t);
2990
3090
  let i = "";
2991
3091
  return e.substring(t, t + 8).toUpperCase() === "#REQUIRED" ? (i = "#REQUIRED", t += 8) : e.substring(t, t + 7).toUpperCase() === "#IMPLIED" ? (i = "#IMPLIED", t += 7) : [t, i] = this.readIdentifierVal(e, t, "ATTLIST"), {
2992
3092
  elementName: s,
@@ -2997,12 +3097,12 @@ class Sr {
2997
3097
  };
2998
3098
  }
2999
3099
  }
3000
- const G = (r, e) => {
3100
+ const W = (r, e) => {
3001
3101
  for (; e < r.length && /\s/.test(r[e]); )
3002
3102
  e++;
3003
3103
  return e;
3004
3104
  };
3005
- function se(r, e, t) {
3105
+ function oe(r, e, t) {
3006
3106
  for (let s = 0; s < e.length; s++)
3007
3107
  if (e[s] !== r[t + s + 1]) return !1;
3008
3108
  return !0;
@@ -3012,7 +3112,7 @@ function ge(r) {
3012
3112
  return r;
3013
3113
  throw new Error(`Invalid entity name ${r}`);
3014
3114
  }
3015
- const Ir = /^[-+]?0x[a-fA-F0-9]+$/, Br = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, Vr = {
3115
+ const Vr = /^[-+]?0x[a-fA-F0-9]+$/, Lr = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, jr = {
3016
3116
  hex: !0,
3017
3117
  // oct: false,
3018
3118
  leadingZeros: !0,
@@ -3020,20 +3120,20 @@ const Ir = /^[-+]?0x[a-fA-F0-9]+$/, Br = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, V
3020
3120
  eNotation: !0
3021
3121
  //skipLike: /regex/
3022
3122
  };
3023
- function Lr(r, e = {}) {
3024
- if (e = Object.assign({}, Vr, e), !r || typeof r != "string") return r;
3123
+ function Rr(r, e = {}) {
3124
+ if (e = Object.assign({}, jr, e), !r || typeof r != "string") return r;
3025
3125
  let t = r.trim();
3026
3126
  if (e.skipLike !== void 0 && e.skipLike.test(t)) return r;
3027
3127
  if (r === "0") return 0;
3028
- if (e.hex && Ir.test(t))
3029
- return Ur(t, 16);
3128
+ if (e.hex && Vr.test(t))
3129
+ return Xr(t, 16);
3030
3130
  if (t.search(/.+[eE].+/) !== -1)
3031
- return jr(r, t, e);
3131
+ return Ur(r, t, e);
3032
3132
  {
3033
- const s = Br.exec(t);
3133
+ const s = Lr.exec(t);
3034
3134
  if (s) {
3035
3135
  const n = s[1] || "", o = s[2];
3036
- let i = Mr(s[3]);
3136
+ let i = Fr(s[3]);
3037
3137
  const u = n ? (
3038
3138
  // 0., -00., 000.
3039
3139
  r[o.length + 1] === "."
@@ -3047,17 +3147,17 @@ function Lr(r, e = {}) {
3047
3147
  return e.eNotation ? a : r;
3048
3148
  if (t.indexOf(".") !== -1)
3049
3149
  return l === "0" || l === i || l === `${n}${i}` ? a : r;
3050
- let h = o ? i : t;
3051
- return o ? h === l || n + h === l ? a : r : h === l || h === n + l ? a : r;
3150
+ let p = o ? i : t;
3151
+ return o ? p === l || n + p === l ? a : r : p === l || p === n + l ? a : r;
3052
3152
  }
3053
3153
  } else
3054
3154
  return r;
3055
3155
  }
3056
3156
  }
3057
- const Rr = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;
3058
- function jr(r, e, t) {
3157
+ const Mr = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;
3158
+ function Ur(r, e, t) {
3059
3159
  if (!t.eNotation) return r;
3060
- const s = e.match(Rr);
3160
+ const s = e.match(Mr);
3061
3161
  if (s) {
3062
3162
  let n = s[1] || "";
3063
3163
  const o = s[3].indexOf("e") === -1 ? "E" : "e", i = s[2], u = n ? (
@@ -3068,10 +3168,10 @@ function jr(r, e, t) {
3068
3168
  } else
3069
3169
  return r;
3070
3170
  }
3071
- function Mr(r) {
3171
+ function Fr(r) {
3072
3172
  return r && r.indexOf(".") !== -1 && (r = r.replace(/0+$/, ""), r === "." ? r = "0" : r[0] === "." ? r = "0" + r : r[r.length - 1] === "." && (r = r.substring(0, r.length - 1))), r;
3073
3173
  }
3074
- function Ur(r, e) {
3174
+ function Xr(r, e) {
3075
3175
  if (parseInt) return parseInt(r, e);
3076
3176
  if (Number.parseInt) return Number.parseInt(r, e);
3077
3177
  if (window && window.parseInt) return window.parseInt(r, e);
@@ -3084,7 +3184,7 @@ function We(r) {
3084
3184
  return !0;
3085
3185
  } : () => !1;
3086
3186
  }
3087
- class Fr {
3187
+ class Hr {
3088
3188
  constructor(e) {
3089
3189
  this.options = e, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = {
3090
3190
  apos: { regex: /&(apos|#39|#x27);/g, val: "'" },
@@ -3107,10 +3207,10 @@ class Fr {
3107
3207
  inr: { regex: /&(inr|#8377);/g, val: "₹" },
3108
3208
  num_dec: { regex: /&#([0-9]{1,7});/g, val: (t, s) => String.fromCodePoint(Number.parseInt(s, 10)) },
3109
3209
  num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t, s) => String.fromCodePoint(Number.parseInt(s, 16)) }
3110
- }, this.addExternalEntities = Xr, this.parseXml = Qr, this.parseTextData = Hr, this.resolveNameSpace = Kr, this.buildAttributesMap = Yr, this.isItStopNode = zr, this.replaceEntitiesValue = Gr, this.readStopNodeData = Jr, this.saveTextToParentTag = Zr, this.addChild = Wr, this.ignoreAttributesFn = We(this.options.ignoreAttributes);
3210
+ }, this.addExternalEntities = Kr, this.parseXml = Gr, this.parseTextData = qr, this.resolveNameSpace = Qr, this.buildAttributesMap = Yr, this.isItStopNode = Jr, this.replaceEntitiesValue = zr, this.readStopNodeData = tn, this.saveTextToParentTag = Dr, this.addChild = Zr, this.ignoreAttributesFn = We(this.options.ignoreAttributes);
3111
3211
  }
3112
3212
  }
3113
- function Xr(r) {
3213
+ function Kr(r) {
3114
3214
  const e = Object.keys(r);
3115
3215
  for (let t = 0; t < e.length; t++) {
3116
3216
  const s = e[t];
@@ -3120,14 +3220,14 @@ function Xr(r) {
3120
3220
  };
3121
3221
  }
3122
3222
  }
3123
- function Hr(r, e, t, s, n, o, i) {
3223
+ function qr(r, e, t, s, n, o, i) {
3124
3224
  if (r !== void 0 && (this.options.trimValues && !s && (r = r.trim()), r.length > 0)) {
3125
3225
  i || (r = this.replaceEntitiesValue(r));
3126
3226
  const u = this.options.tagValueProcessor(e, r, t, n, o);
3127
3227
  return u == null ? r : typeof u != typeof r || u !== r ? u : this.options.trimValues ? Ce(r, this.options.parseTagValue, this.options.numberParseOptions) : r.trim() === r ? Ce(r, this.options.parseTagValue, this.options.numberParseOptions) : r;
3128
3228
  }
3129
3229
  }
3130
- function Kr(r) {
3230
+ function Qr(r) {
3131
3231
  if (this.options.removeNSPrefix) {
3132
3232
  const e = r.split(":"), t = r.charAt(0) === "/" ? "/" : "";
3133
3233
  if (e[0] === "xmlns")
@@ -3136,10 +3236,10 @@ function Kr(r) {
3136
3236
  }
3137
3237
  return r;
3138
3238
  }
3139
- const qr = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
3239
+ const Wr = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
3140
3240
  function Yr(r, e, t) {
3141
3241
  if (this.options.ignoreAttributes !== !0 && typeof r == "string") {
3142
- const s = Ye(r, qr), n = s.length, o = {};
3242
+ const s = qe(r, Wr), n = s.length, o = {};
3143
3243
  for (let i = 0; i < n; i++) {
3144
3244
  const u = this.resolveNameSpace(s[i][1]);
3145
3245
  if (this.ignoreAttributesFn(u, e))
@@ -3148,8 +3248,8 @@ function Yr(r, e, t) {
3148
3248
  if (u.length)
3149
3249
  if (this.options.transformAttributeName && (l = this.options.transformAttributeName(l)), l === "__proto__" && (l = "#__proto__"), a !== void 0) {
3150
3250
  this.options.trimValues && (a = a.trim()), a = this.replaceEntitiesValue(a);
3151
- const h = this.options.attributeValueProcessor(u, a, e);
3152
- h == null ? o[l] = a : typeof h != typeof a || h !== a ? o[l] = h : o[l] = Ce(
3251
+ const p = this.options.attributeValueProcessor(u, a, e);
3252
+ p == null ? o[l] = a : typeof p != typeof a || p !== a ? o[l] = p : o[l] = Ce(
3153
3253
  a,
3154
3254
  this.options.parseAttributeValue,
3155
3255
  this.options.numberParseOptions
@@ -3165,37 +3265,37 @@ function Yr(r, e, t) {
3165
3265
  return o;
3166
3266
  }
3167
3267
  }
3168
- const Qr = function(r) {
3268
+ const Gr = function(r) {
3169
3269
  r = r.replace(/\r\n?/g, `
3170
3270
  `);
3171
- const e = new oe("!xml");
3271
+ const e = new ae("!xml");
3172
3272
  let t = e, s = "", n = "";
3173
- const o = new Sr(this.options.processEntities);
3273
+ const o = new Ir(this.options.processEntities);
3174
3274
  for (let i = 0; i < r.length; i++)
3175
3275
  if (r[i] === "<")
3176
3276
  if (r[i + 1] === "/") {
3177
- const a = ie(r, ">", i, "Closing Tag is not closed.");
3277
+ const a = le(r, ">", i, "Closing Tag is not closed.");
3178
3278
  let l = r.substring(i + 2, a).trim();
3179
3279
  if (this.options.removeNSPrefix) {
3180
- const b = l.indexOf(":");
3181
- b !== -1 && (l = l.substr(b + 1));
3280
+ const v = l.indexOf(":");
3281
+ v !== -1 && (l = l.substr(v + 1));
3182
3282
  }
3183
3283
  this.options.transformTagName && (l = this.options.transformTagName(l)), t && (s = this.saveTextToParentTag(s, t, n));
3184
- const h = n.substring(n.lastIndexOf(".") + 1);
3284
+ const p = n.substring(n.lastIndexOf(".") + 1);
3185
3285
  if (l && this.options.unpairedTags.indexOf(l) !== -1)
3186
3286
  throw new Error(`Unpaired tag can not be used as closing tag: </${l}>`);
3187
- let f = 0;
3188
- h && this.options.unpairedTags.indexOf(h) !== -1 ? (f = n.lastIndexOf(".", n.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : f = n.lastIndexOf("."), n = n.substring(0, f), t = this.tagsNodeStack.pop(), s = "", i = a;
3287
+ let h = 0;
3288
+ p && this.options.unpairedTags.indexOf(p) !== -1 ? (h = n.lastIndexOf(".", n.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : h = n.lastIndexOf("."), n = n.substring(0, h), t = this.tagsNodeStack.pop(), s = "", i = a;
3189
3289
  } else if (r[i + 1] === "?") {
3190
3290
  let a = we(r, i, !1, "?>");
3191
3291
  if (!a) throw new Error("Pi Tag is not closed.");
3192
3292
  if (s = this.saveTextToParentTag(s, t, n), !(this.options.ignoreDeclaration && a.tagName === "?xml" || this.options.ignorePiTags)) {
3193
- const l = new oe(a.tagName);
3293
+ const l = new ae(a.tagName);
3194
3294
  l.add(this.options.textNodeName, ""), a.tagName !== a.tagExp && a.attrExpPresent && (l[":@"] = this.buildAttributesMap(a.tagExp, n, a.tagName)), this.addChild(t, l, n, i);
3195
3295
  }
3196
3296
  i = a.closeIndex + 1;
3197
3297
  } else if (r.substr(i + 1, 3) === "!--") {
3198
- const a = ie(r, "-->", i + 4, "Comment is not closed.");
3298
+ const a = le(r, "-->", i + 4, "Comment is not closed.");
3199
3299
  if (this.options.commentPropName) {
3200
3300
  const l = r.substring(i + 4, a - 2);
3201
3301
  s = this.saveTextToParentTag(s, t, n), t.add(this.options.commentPropName, [{ [this.options.textNodeName]: l }]);
@@ -3205,53 +3305,53 @@ const Qr = function(r) {
3205
3305
  const a = o.readDocType(r, i);
3206
3306
  this.docTypeEntities = a.entities, i = a.i;
3207
3307
  } else if (r.substr(i + 1, 2) === "![") {
3208
- const a = ie(r, "]]>", i, "CDATA is not closed.") - 2, l = r.substring(i + 9, a);
3308
+ const a = le(r, "]]>", i, "CDATA is not closed.") - 2, l = r.substring(i + 9, a);
3209
3309
  s = this.saveTextToParentTag(s, t, n);
3210
- let h = this.parseTextData(l, t.tagname, n, !0, !1, !0, !0);
3211
- h == null && (h = ""), this.options.cdataPropName ? t.add(this.options.cdataPropName, [{ [this.options.textNodeName]: l }]) : t.add(this.options.textNodeName, h), i = a + 2;
3310
+ let p = this.parseTextData(l, t.tagname, n, !0, !1, !0, !0);
3311
+ p == null && (p = ""), this.options.cdataPropName ? t.add(this.options.cdataPropName, [{ [this.options.textNodeName]: l }]) : t.add(this.options.textNodeName, p), i = a + 2;
3212
3312
  } else {
3213
3313
  let a = we(r, i, this.options.removeNSPrefix), l = a.tagName;
3214
- const h = a.rawTagName;
3215
- let f = a.tagExp, b = a.attrExpPresent, m = a.closeIndex;
3314
+ const p = a.rawTagName;
3315
+ let h = a.tagExp, v = a.attrExpPresent, b = a.closeIndex;
3216
3316
  this.options.transformTagName && (l = this.options.transformTagName(l)), t && s && t.tagname !== "!xml" && (s = this.saveTextToParentTag(s, t, n, !1));
3217
- const w = t;
3218
- w && this.options.unpairedTags.indexOf(w.tagname) !== -1 && (t = this.tagsNodeStack.pop(), n = n.substring(0, n.lastIndexOf("."))), l !== e.tagname && (n += n ? "." + l : l);
3219
- const S = i;
3317
+ const A = t;
3318
+ A && this.options.unpairedTags.indexOf(A.tagname) !== -1 && (t = this.tagsNodeStack.pop(), n = n.substring(0, n.lastIndexOf("."))), l !== e.tagname && (n += n ? "." + l : l);
3319
+ const P = i;
3220
3320
  if (this.isItStopNode(this.options.stopNodes, n, l)) {
3221
- let _ = "";
3222
- if (f.length > 0 && f.lastIndexOf("/") === f.length - 1)
3223
- l[l.length - 1] === "/" ? (l = l.substr(0, l.length - 1), n = n.substr(0, n.length - 1), f = l) : f = f.substr(0, f.length - 1), i = a.closeIndex;
3321
+ let k = "";
3322
+ if (h.length > 0 && h.lastIndexOf("/") === h.length - 1)
3323
+ l[l.length - 1] === "/" ? (l = l.substr(0, l.length - 1), n = n.substr(0, n.length - 1), h = l) : h = h.substr(0, h.length - 1), i = a.closeIndex;
3224
3324
  else if (this.options.unpairedTags.indexOf(l) !== -1)
3225
3325
  i = a.closeIndex;
3226
3326
  else {
3227
- const H = this.readStopNodeData(r, h, m + 1);
3228
- if (!H) throw new Error(`Unexpected end of ${h}`);
3229
- i = H.i, _ = H.tagContent;
3327
+ const F = this.readStopNodeData(r, p, b + 1);
3328
+ if (!F) throw new Error(`Unexpected end of ${p}`);
3329
+ i = F.i, k = F.tagContent;
3230
3330
  }
3231
- const j = new oe(l);
3232
- l !== f && b && (j[":@"] = this.buildAttributesMap(f, n, l)), _ && (_ = this.parseTextData(_, l, n, !0, b, !0, !0)), n = n.substr(0, n.lastIndexOf(".")), j.add(this.options.textNodeName, _), this.addChild(t, j, n, S);
3331
+ const S = new ae(l);
3332
+ l !== h && v && (S[":@"] = this.buildAttributesMap(h, n, l)), k && (k = this.parseTextData(k, l, n, !0, v, !0, !0)), n = n.substr(0, n.lastIndexOf(".")), S.add(this.options.textNodeName, k), this.addChild(t, S, n, P);
3233
3333
  } else {
3234
- if (f.length > 0 && f.lastIndexOf("/") === f.length - 1) {
3235
- l[l.length - 1] === "/" ? (l = l.substr(0, l.length - 1), n = n.substr(0, n.length - 1), f = l) : f = f.substr(0, f.length - 1), this.options.transformTagName && (l = this.options.transformTagName(l));
3236
- const _ = new oe(l);
3237
- l !== f && b && (_[":@"] = this.buildAttributesMap(f, n, l)), this.addChild(t, _, n, S), n = n.substr(0, n.lastIndexOf("."));
3334
+ if (h.length > 0 && h.lastIndexOf("/") === h.length - 1) {
3335
+ l[l.length - 1] === "/" ? (l = l.substr(0, l.length - 1), n = n.substr(0, n.length - 1), h = l) : h = h.substr(0, h.length - 1), this.options.transformTagName && (l = this.options.transformTagName(l));
3336
+ const k = new ae(l);
3337
+ l !== h && v && (k[":@"] = this.buildAttributesMap(h, n, l)), this.addChild(t, k, n, P), n = n.substr(0, n.lastIndexOf("."));
3238
3338
  } else {
3239
- const _ = new oe(l);
3240
- this.tagsNodeStack.push(t), l !== f && b && (_[":@"] = this.buildAttributesMap(f, n, l)), this.addChild(t, _, n, S), t = _;
3339
+ const k = new ae(l);
3340
+ this.tagsNodeStack.push(t), l !== h && v && (k[":@"] = this.buildAttributesMap(h, n, l)), this.addChild(t, k, n, P), t = k;
3241
3341
  }
3242
- s = "", i = m;
3342
+ s = "", i = b;
3243
3343
  }
3244
3344
  }
3245
3345
  else
3246
3346
  s += r[i];
3247
3347
  return e.child;
3248
3348
  };
3249
- function Wr(r, e, t, s) {
3349
+ function Zr(r, e, t, s) {
3250
3350
  this.options.captureMetaData || (s = void 0);
3251
3351
  const n = this.options.updateTag(e.tagname, t, e[":@"]);
3252
3352
  n === !1 || (typeof n == "string" && (e.tagname = n), r.addChild(e, s));
3253
3353
  }
3254
- const Gr = function(r) {
3354
+ const zr = function(r) {
3255
3355
  if (this.options.processEntities) {
3256
3356
  for (let e in this.docTypeEntities) {
3257
3357
  const t = this.docTypeEntities[e];
@@ -3270,7 +3370,7 @@ const Gr = function(r) {
3270
3370
  }
3271
3371
  return r;
3272
3372
  };
3273
- function Zr(r, e, t, s) {
3373
+ function Dr(r, e, t, s) {
3274
3374
  return r && (s === void 0 && (s = e.child.length === 0), r = this.parseTextData(
3275
3375
  r,
3276
3376
  e.tagname,
@@ -3280,7 +3380,7 @@ function Zr(r, e, t, s) {
3280
3380
  s
3281
3381
  ), r !== void 0 && r !== "" && e.add(this.options.textNodeName, r), r = ""), r;
3282
3382
  }
3283
- function zr(r, e, t) {
3383
+ function Jr(r, e, t) {
3284
3384
  const s = "*." + t;
3285
3385
  for (const n in r) {
3286
3386
  const o = r[n];
@@ -3288,7 +3388,7 @@ function zr(r, e, t) {
3288
3388
  }
3289
3389
  return !1;
3290
3390
  }
3291
- function Dr(r, e, t = ">") {
3391
+ function en(r, e, t = ">") {
3292
3392
  let s, n = "";
3293
3393
  for (let o = e; o < r.length; o++) {
3294
3394
  let i = r[o];
@@ -3312,39 +3412,39 @@ function Dr(r, e, t = ">") {
3312
3412
  n += i;
3313
3413
  }
3314
3414
  }
3315
- function ie(r, e, t, s) {
3415
+ function le(r, e, t, s) {
3316
3416
  const n = r.indexOf(e, t);
3317
3417
  if (n === -1)
3318
3418
  throw new Error(s);
3319
3419
  return n + e.length - 1;
3320
3420
  }
3321
3421
  function we(r, e, t, s = ">") {
3322
- const n = Dr(r, e + 1, s);
3422
+ const n = en(r, e + 1, s);
3323
3423
  if (!n) return;
3324
3424
  let o = n.data;
3325
3425
  const i = n.index, u = o.search(/\s/);
3326
3426
  let a = o, l = !0;
3327
3427
  u !== -1 && (a = o.substring(0, u), o = o.substring(u + 1).trimStart());
3328
- const h = a;
3428
+ const p = a;
3329
3429
  if (t) {
3330
- const f = a.indexOf(":");
3331
- f !== -1 && (a = a.substr(f + 1), l = a !== n.data.substr(f + 1));
3430
+ const h = a.indexOf(":");
3431
+ h !== -1 && (a = a.substr(h + 1), l = a !== n.data.substr(h + 1));
3332
3432
  }
3333
3433
  return {
3334
3434
  tagName: a,
3335
3435
  tagExp: o,
3336
3436
  closeIndex: i,
3337
3437
  attrExpPresent: l,
3338
- rawTagName: h
3438
+ rawTagName: p
3339
3439
  };
3340
3440
  }
3341
- function Jr(r, e, t) {
3441
+ function tn(r, e, t) {
3342
3442
  const s = t;
3343
3443
  let n = 1;
3344
3444
  for (; t < r.length; t++)
3345
3445
  if (r[t] === "<")
3346
3446
  if (r[t + 1] === "/") {
3347
- const o = ie(r, ">", t, `${e} is not closed`);
3447
+ const o = le(r, ">", t, `${e} is not closed`);
3348
3448
  if (r.substring(t + 2, o).trim() === e && (n--, n === 0))
3349
3449
  return {
3350
3450
  tagContent: r.substring(s, t),
@@ -3352,11 +3452,11 @@ function Jr(r, e, t) {
3352
3452
  };
3353
3453
  t = o;
3354
3454
  } else if (r[t + 1] === "?")
3355
- t = ie(r, "?>", t + 1, "StopNode is not closed.");
3455
+ t = le(r, "?>", t + 1, "StopNode is not closed.");
3356
3456
  else if (r.substr(t + 1, 3) === "!--")
3357
- t = ie(r, "-->", t + 3, "StopNode is not closed.");
3457
+ t = le(r, "-->", t + 3, "StopNode is not closed.");
3358
3458
  else if (r.substr(t + 1, 2) === "![")
3359
- t = ie(r, "]]>", t, "StopNode is not closed.") - 2;
3459
+ t = le(r, "]]>", t, "StopNode is not closed.") - 2;
3360
3460
  else {
3361
3461
  const o = we(r, t, ">");
3362
3462
  o && ((o && o.tagName) === e && o.tagExp[o.tagExp.length - 1] !== "/" && n++, t = o.closeIndex);
@@ -3365,19 +3465,19 @@ function Jr(r, e, t) {
3365
3465
  function Ce(r, e, t) {
3366
3466
  if (e && typeof r == "string") {
3367
3467
  const s = r.trim();
3368
- return s === "true" ? !0 : s === "false" ? !1 : Lr(r, t);
3468
+ return s === "true" ? !0 : s === "false" ? !1 : Rr(r, t);
3369
3469
  } else
3370
- return Er(r) ? r : "";
3470
+ return xr(r) ? r : "";
3371
3471
  }
3372
- const ke = oe.getMetaDataSymbol();
3373
- function en(r, e) {
3374
- return Ge(r, e);
3472
+ const Ne = ae.getMetaDataSymbol();
3473
+ function rn(r, e) {
3474
+ return Ye(r, e);
3375
3475
  }
3376
- function Ge(r, e, t) {
3476
+ function Ye(r, e, t) {
3377
3477
  let s;
3378
3478
  const n = {};
3379
3479
  for (let o = 0; o < r.length; o++) {
3380
- const i = r[o], u = tn(i);
3480
+ const i = r[o], u = nn(i);
3381
3481
  let a = "";
3382
3482
  if (t === void 0 ? a = u : a = t + "." + u, u === e.textNodeName)
3383
3483
  s === void 0 ? s = i[u] : s += "" + i[u];
@@ -3385,22 +3485,22 @@ function Ge(r, e, t) {
3385
3485
  if (u === void 0)
3386
3486
  continue;
3387
3487
  if (i[u]) {
3388
- let l = Ge(i[u], e, a);
3389
- const h = nn(l, e);
3390
- i[ke] !== void 0 && (l[ke] = i[ke]), i[":@"] ? rn(l, i[":@"], a, e) : Object.keys(l).length === 1 && l[e.textNodeName] !== void 0 && !e.alwaysCreateTextNode ? l = l[e.textNodeName] : Object.keys(l).length === 0 && (e.alwaysCreateTextNode ? l[e.textNodeName] = "" : l = ""), n[u] !== void 0 && n.hasOwnProperty(u) ? (Array.isArray(n[u]) || (n[u] = [n[u]]), n[u].push(l)) : e.isArray(u, a, h) ? n[u] = [l] : n[u] = l;
3488
+ let l = Ye(i[u], e, a);
3489
+ const p = on(l, e);
3490
+ i[Ne] !== void 0 && (l[Ne] = i[Ne]), i[":@"] ? sn(l, i[":@"], a, e) : Object.keys(l).length === 1 && l[e.textNodeName] !== void 0 && !e.alwaysCreateTextNode ? l = l[e.textNodeName] : Object.keys(l).length === 0 && (e.alwaysCreateTextNode ? l[e.textNodeName] = "" : l = ""), n[u] !== void 0 && n.hasOwnProperty(u) ? (Array.isArray(n[u]) || (n[u] = [n[u]]), n[u].push(l)) : e.isArray(u, a, p) ? n[u] = [l] : n[u] = l;
3391
3491
  }
3392
3492
  }
3393
3493
  }
3394
3494
  return typeof s == "string" ? s.length > 0 && (n[e.textNodeName] = s) : s !== void 0 && (n[e.textNodeName] = s), n;
3395
3495
  }
3396
- function tn(r) {
3496
+ function nn(r) {
3397
3497
  const e = Object.keys(r);
3398
3498
  for (let t = 0; t < e.length; t++) {
3399
3499
  const s = e[t];
3400
3500
  if (s !== ":@") return s;
3401
3501
  }
3402
3502
  }
3403
- function rn(r, e, t, s) {
3503
+ function sn(r, e, t, s) {
3404
3504
  if (e) {
3405
3505
  const n = Object.keys(e), o = n.length;
3406
3506
  for (let i = 0; i < o; i++) {
@@ -3409,13 +3509,13 @@ function rn(r, e, t, s) {
3409
3509
  }
3410
3510
  }
3411
3511
  }
3412
- function nn(r, e) {
3512
+ function on(r, e) {
3413
3513
  const { textNodeName: t } = e, s = Object.keys(r).length;
3414
3514
  return !!(s === 0 || s === 1 && (r[t] || typeof r[t] == "boolean" || r[t] === 0));
3415
3515
  }
3416
- class sn {
3516
+ class an {
3417
3517
  constructor(e) {
3418
- this.externalEntities = {}, this.options = $r(e);
3518
+ this.externalEntities = {}, this.options = Br(e);
3419
3519
  }
3420
3520
  /**
3421
3521
  * Parse XML dats to JS object
@@ -3433,10 +3533,10 @@ class sn {
3433
3533
  if (o !== !0)
3434
3534
  throw Error(`${o.err.msg}:${o.err.line}:${o.err.col}`);
3435
3535
  }
3436
- const s = new Fr(this.options);
3536
+ const s = new Hr(this.options);
3437
3537
  s.addExternalEntities(this.externalEntities);
3438
3538
  const n = s.parseXml(e);
3439
- return this.options.preserveOrder || n === void 0 ? n : en(n, this.options);
3539
+ return this.options.preserveOrder || n === void 0 ? n : rn(n, this.options);
3440
3540
  }
3441
3541
  /**
3442
3542
  * Add Entity which is not by default supported by this library
@@ -3463,24 +3563,24 @@ class sn {
3463
3563
  * is true in the options.
3464
3564
  */
3465
3565
  static getMetaDataSymbol() {
3466
- return oe.getMetaDataSymbol();
3566
+ return ae.getMetaDataSymbol();
3467
3567
  }
3468
3568
  }
3469
- const on = `
3569
+ const ln = `
3470
3570
  `;
3471
- function an(r, e) {
3571
+ function un(r, e) {
3472
3572
  let t = "";
3473
- return e.format && e.indentBy.length > 0 && (t = on), Ze(r, e, "", t);
3573
+ return e.format && e.indentBy.length > 0 && (t = ln), Ge(r, e, "", t);
3474
3574
  }
3475
- function Ze(r, e, t, s) {
3575
+ function Ge(r, e, t, s) {
3476
3576
  let n = "", o = !1;
3477
3577
  for (let i = 0; i < r.length; i++) {
3478
- const u = r[i], a = ln(u);
3578
+ const u = r[i], a = cn(u);
3479
3579
  if (a === void 0) continue;
3480
3580
  let l = "";
3481
3581
  if (t.length === 0 ? l = a : l = `${t}.${a}`, a === e.textNodeName) {
3482
- let w = u[a];
3483
- un(l, e) || (w = e.tagValueProcessor(a, w), w = ze(w, e)), o && (n += s), n += w, o = !1;
3582
+ let A = u[a];
3583
+ dn(l, e) || (A = e.tagValueProcessor(a, A), A = Ze(A, e)), o && (n += s), n += A, o = !1;
3484
3584
  continue;
3485
3585
  } else if (a === e.cdataPropName) {
3486
3586
  o && (n += s), n += `<![CDATA[${u[a][0][e.textNodeName]}]]>`, o = !1;
@@ -3489,19 +3589,19 @@ function Ze(r, e, t, s) {
3489
3589
  n += s + `<!--${u[a][0][e.textNodeName]}-->`, o = !0;
3490
3590
  continue;
3491
3591
  } else if (a[0] === "?") {
3492
- const w = Me(u[":@"], e), S = a === "?xml" ? "" : s;
3493
- let _ = u[a][0][e.textNodeName];
3494
- _ = _.length !== 0 ? " " + _ : "", n += S + `<${a}${_}${w}?>`, o = !0;
3592
+ const A = Re(u[":@"], e), P = a === "?xml" ? "" : s;
3593
+ let k = u[a][0][e.textNodeName];
3594
+ k = k.length !== 0 ? " " + k : "", n += P + `<${a}${k}${A}?>`, o = !0;
3495
3595
  continue;
3496
3596
  }
3497
- let h = s;
3498
- h !== "" && (h += e.indentBy);
3499
- const f = Me(u[":@"], e), b = s + `<${a}${f}`, m = Ze(u[a], e, l, h);
3500
- e.unpairedTags.indexOf(a) !== -1 ? e.suppressUnpairedNode ? n += b + ">" : n += b + "/>" : (!m || m.length === 0) && e.suppressEmptyNode ? n += b + "/>" : m && m.endsWith(">") ? n += b + `>${m}${s}</${a}>` : (n += b + ">", m && s !== "" && (m.includes("/>") || m.includes("</")) ? n += s + e.indentBy + m + s : n += m, n += `</${a}>`), o = !0;
3597
+ let p = s;
3598
+ p !== "" && (p += e.indentBy);
3599
+ const h = Re(u[":@"], e), v = s + `<${a}${h}`, b = Ge(u[a], e, l, p);
3600
+ e.unpairedTags.indexOf(a) !== -1 ? e.suppressUnpairedNode ? n += v + ">" : n += v + "/>" : (!b || b.length === 0) && e.suppressEmptyNode ? n += v + "/>" : b && b.endsWith(">") ? n += v + `>${b}${s}</${a}>` : (n += v + ">", b && s !== "" && (b.includes("/>") || b.includes("</")) ? n += s + e.indentBy + b + s : n += b, n += `</${a}>`), o = !0;
3501
3601
  }
3502
3602
  return n;
3503
3603
  }
3504
- function ln(r) {
3604
+ function cn(r) {
3505
3605
  const e = Object.keys(r);
3506
3606
  for (let t = 0; t < e.length; t++) {
3507
3607
  const s = e[t];
@@ -3509,24 +3609,24 @@ function ln(r) {
3509
3609
  return s;
3510
3610
  }
3511
3611
  }
3512
- function Me(r, e) {
3612
+ function Re(r, e) {
3513
3613
  let t = "";
3514
3614
  if (r && !e.ignoreAttributes)
3515
3615
  for (let s in r) {
3516
3616
  if (!r.hasOwnProperty(s)) continue;
3517
3617
  let n = e.attributeValueProcessor(s, r[s]);
3518
- n = ze(n, e), n === !0 && e.suppressBooleanAttributes ? t += ` ${s.substr(e.attributeNamePrefix.length)}` : t += ` ${s.substr(e.attributeNamePrefix.length)}="${n}"`;
3618
+ n = Ze(n, e), n === !0 && e.suppressBooleanAttributes ? t += ` ${s.substr(e.attributeNamePrefix.length)}` : t += ` ${s.substr(e.attributeNamePrefix.length)}="${n}"`;
3519
3619
  }
3520
3620
  return t;
3521
3621
  }
3522
- function un(r, e) {
3622
+ function dn(r, e) {
3523
3623
  r = r.substr(0, r.length - e.textNodeName.length - 1);
3524
3624
  let t = r.substr(r.lastIndexOf(".") + 1);
3525
3625
  for (let s in e.stopNodes)
3526
3626
  if (e.stopNodes[s] === r || e.stopNodes[s] === "*." + t) return !0;
3527
3627
  return !1;
3528
3628
  }
3529
- function ze(r, e) {
3629
+ function Ze(r, e) {
3530
3630
  if (r && r.length > 0 && e.processEntities)
3531
3631
  for (let t = 0; t < e.entities.length; t++) {
3532
3632
  const s = e.entities[t];
@@ -3534,7 +3634,7 @@ function ze(r, e) {
3534
3634
  }
3535
3635
  return r;
3536
3636
  }
3537
- const cn = {
3637
+ const fn = {
3538
3638
  attributeNamePrefix: "@_",
3539
3639
  attributesGroupName: !1,
3540
3640
  textNodeName: "#text",
@@ -3568,21 +3668,21 @@ const cn = {
3568
3668
  // transformAttributeName: false,
3569
3669
  oneListGroup: !1
3570
3670
  };
3571
- function ne(r) {
3572
- this.options = Object.assign({}, cn, r), this.options.ignoreAttributes === !0 || this.options.attributesGroupName ? this.isAttribute = function() {
3671
+ function se(r) {
3672
+ this.options = Object.assign({}, fn, r), this.options.ignoreAttributes === !0 || this.options.attributesGroupName ? this.isAttribute = function() {
3573
3673
  return !1;
3574
- } : (this.ignoreAttributesFn = We(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = hn), this.processTextOrObjNode = dn, this.options.format ? (this.indentate = fn, this.tagEndChar = `>
3674
+ } : (this.ignoreAttributesFn = We(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = gn), this.processTextOrObjNode = hn, this.options.format ? (this.indentate = pn, this.tagEndChar = `>
3575
3675
  `, this.newLine = `
3576
3676
  `) : (this.indentate = function() {
3577
3677
  return "";
3578
3678
  }, this.tagEndChar = ">", this.newLine = "");
3579
3679
  }
3580
- ne.prototype.build = function(r) {
3581
- return this.options.preserveOrder ? an(r, this.options) : (Array.isArray(r) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (r = {
3680
+ se.prototype.build = function(r) {
3681
+ return this.options.preserveOrder ? un(r, this.options) : (Array.isArray(r) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (r = {
3582
3682
  [this.options.arrayNodeName]: r
3583
3683
  }), this.j2x(r, 0, []).val);
3584
3684
  };
3585
- ne.prototype.j2x = function(r, e, t) {
3685
+ se.prototype.j2x = function(r, e, t) {
3586
3686
  let s = "", n = "";
3587
3687
  const o = t.join(".");
3588
3688
  for (let i in r)
@@ -3606,21 +3706,21 @@ ne.prototype.j2x = function(r, e, t) {
3606
3706
  } else if (Array.isArray(r[i])) {
3607
3707
  const u = r[i].length;
3608
3708
  let a = "", l = "";
3609
- for (let h = 0; h < u; h++) {
3610
- const f = r[i][h];
3611
- if (!(typeof f > "u")) if (f === null)
3709
+ for (let p = 0; p < u; p++) {
3710
+ const h = r[i][p];
3711
+ if (!(typeof h > "u")) if (h === null)
3612
3712
  i[0] === "?" ? n += this.indentate(e) + "<" + i + "?" + this.tagEndChar : n += this.indentate(e) + "<" + i + "/" + this.tagEndChar;
3613
- else if (typeof f == "object")
3713
+ else if (typeof h == "object")
3614
3714
  if (this.options.oneListGroup) {
3615
- const b = this.j2x(f, e + 1, t.concat(i));
3616
- a += b.val, this.options.attributesGroupName && f.hasOwnProperty(this.options.attributesGroupName) && (l += b.attrStr);
3715
+ const v = this.j2x(h, e + 1, t.concat(i));
3716
+ a += v.val, this.options.attributesGroupName && h.hasOwnProperty(this.options.attributesGroupName) && (l += v.attrStr);
3617
3717
  } else
3618
- a += this.processTextOrObjNode(f, i, e, t);
3718
+ a += this.processTextOrObjNode(h, i, e, t);
3619
3719
  else if (this.options.oneListGroup) {
3620
- let b = this.options.tagValueProcessor(i, f);
3621
- b = this.replaceEntitiesValue(b), a += b;
3720
+ let v = this.options.tagValueProcessor(i, h);
3721
+ v = this.replaceEntitiesValue(v), a += v;
3622
3722
  } else
3623
- a += this.buildTextValNode(f, i, "", e);
3723
+ a += this.buildTextValNode(h, i, "", e);
3624
3724
  }
3625
3725
  this.options.oneListGroup && (a = this.buildObjectNode(a, i, l, e)), n += a;
3626
3726
  } else if (this.options.attributesGroupName && i === this.options.attributesGroupName) {
@@ -3631,14 +3731,14 @@ ne.prototype.j2x = function(r, e, t) {
3631
3731
  n += this.processTextOrObjNode(r[i], i, e, t);
3632
3732
  return { attrStr: s, val: n };
3633
3733
  };
3634
- ne.prototype.buildAttrPairStr = function(r, e) {
3734
+ se.prototype.buildAttrPairStr = function(r, e) {
3635
3735
  return e = this.options.attributeValueProcessor(r, "" + e), e = this.replaceEntitiesValue(e), this.options.suppressBooleanAttributes && e === "true" ? " " + r : " " + r + '="' + e + '"';
3636
3736
  };
3637
- function dn(r, e, t, s) {
3737
+ function hn(r, e, t, s) {
3638
3738
  const n = this.j2x(r, t + 1, s.concat(e));
3639
3739
  return r[this.options.textNodeName] !== void 0 && Object.keys(r).length === 1 ? this.buildTextValNode(r[this.options.textNodeName], e, n.attrStr, t) : this.buildObjectNode(n.val, e, n.attrStr, t);
3640
3740
  }
3641
- ne.prototype.buildObjectNode = function(r, e, t, s) {
3741
+ se.prototype.buildObjectNode = function(r, e, t, s) {
3642
3742
  if (r === "")
3643
3743
  return e[0] === "?" ? this.indentate(s) + "<" + e + t + "?" + this.tagEndChar : this.indentate(s) + "<" + e + t + this.closeTag(e) + this.tagEndChar;
3644
3744
  {
@@ -3646,11 +3746,11 @@ ne.prototype.buildObjectNode = function(r, e, t, s) {
3646
3746
  return e[0] === "?" && (o = "?", n = ""), (t || t === "") && r.indexOf("<") === -1 ? this.indentate(s) + "<" + e + t + o + ">" + r + n : this.options.commentPropName !== !1 && e === this.options.commentPropName && o.length === 0 ? this.indentate(s) + `<!--${r}-->` + this.newLine : this.indentate(s) + "<" + e + t + o + this.tagEndChar + r + this.indentate(s) + n;
3647
3747
  }
3648
3748
  };
3649
- ne.prototype.closeTag = function(r) {
3749
+ se.prototype.closeTag = function(r) {
3650
3750
  let e = "";
3651
3751
  return this.options.unpairedTags.indexOf(r) !== -1 ? this.options.suppressUnpairedNode || (e = "/") : this.options.suppressEmptyNode ? e = "/" : e = `></${r}`, e;
3652
3752
  };
3653
- ne.prototype.buildTextValNode = function(r, e, t, s) {
3753
+ se.prototype.buildTextValNode = function(r, e, t, s) {
3654
3754
  if (this.options.cdataPropName !== !1 && e === this.options.cdataPropName)
3655
3755
  return this.indentate(s) + `<![CDATA[${r}]]>` + this.newLine;
3656
3756
  if (this.options.commentPropName !== !1 && e === this.options.commentPropName)
@@ -3662,7 +3762,7 @@ ne.prototype.buildTextValNode = function(r, e, t, s) {
3662
3762
  return n = this.replaceEntitiesValue(n), n === "" ? this.indentate(s) + "<" + e + t + this.closeTag(e) + this.tagEndChar : this.indentate(s) + "<" + e + t + ">" + n + "</" + e + this.tagEndChar;
3663
3763
  }
3664
3764
  };
3665
- ne.prototype.replaceEntitiesValue = function(r) {
3765
+ se.prototype.replaceEntitiesValue = function(r) {
3666
3766
  if (r && r.length > 0 && this.options.processEntities)
3667
3767
  for (let e = 0; e < this.options.entities.length; e++) {
3668
3768
  const t = this.options.entities[e];
@@ -3670,15 +3770,15 @@ ne.prototype.replaceEntitiesValue = function(r) {
3670
3770
  }
3671
3771
  return r;
3672
3772
  };
3673
- function fn(r) {
3773
+ function pn(r) {
3674
3774
  return this.options.indentBy.repeat(r);
3675
3775
  }
3676
- function hn(r) {
3776
+ function gn(r) {
3677
3777
  return r.startsWith(this.options.attributeNamePrefix) && r !== this.options.textNodeName ? r.substr(this.attrPrefixLen) : !1;
3678
3778
  }
3679
- const pn = {
3779
+ const mn = {
3680
3780
  validate: Qe
3681
- }, gn = {
3781
+ }, yn = {
3682
3782
  ignoreAttributes: !1,
3683
3783
  // 保留属性
3684
3784
  attributeNamePrefix: "@_",
@@ -3713,7 +3813,7 @@ const pn = {
3713
3813
  // 停止解析的节点
3714
3814
  alwaysCreateTextNode: !1
3715
3815
  // 仅在有文本时创建文本节点
3716
- }, mn = {
3816
+ }, bn = {
3717
3817
  ignoreAttributes: !1,
3718
3818
  attributeNamePrefix: "@_",
3719
3819
  textNodeName: "#text",
@@ -3725,9 +3825,9 @@ const pn = {
3725
3825
  // 不抑制空节点
3726
3826
  suppressBooleanAttributes: !1,
3727
3827
  suppressUnpairedNode: !1
3728
- }, yn = (r) => {
3828
+ }, vn = (r) => {
3729
3829
  try {
3730
- const e = pn.validate(r, {
3830
+ const e = mn.validate(r, {
3731
3831
  allowBooleanAttributes: !0
3732
3832
  });
3733
3833
  return e === !0 ? { valid: !0 } : {
@@ -3740,10 +3840,10 @@ const pn = {
3740
3840
  error: e instanceof Error ? e.message : "Unknown validation error"
3741
3841
  };
3742
3842
  }
3743
- }, De = (r, e) => {
3843
+ }, ze = (r, e) => {
3744
3844
  try {
3745
- return new sn({
3746
- ...gn,
3845
+ return new an({
3846
+ ...yn,
3747
3847
  ...e
3748
3848
  }).parse(r);
3749
3849
  } catch (t) {
@@ -3753,8 +3853,8 @@ const pn = {
3753
3853
  }
3754
3854
  }, Pe = (r, e) => {
3755
3855
  try {
3756
- let s = new ne({
3757
- ...mn,
3856
+ let s = new se({
3857
+ ...bn,
3758
3858
  format: e?.format ?? !0,
3759
3859
  indentBy: e?.indentBy ?? " "
3760
3860
  }).build(r);
@@ -3765,66 +3865,66 @@ const pn = {
3765
3865
  `XML 构建失败: ${t instanceof Error ? t.message : "Unknown error"}`
3766
3866
  );
3767
3867
  }
3768
- }, bn = (r) => Array.isArray(r) ? Ee(r, { format: !1 }) : Pe(r, { format: !1, showDeclaration: !1 }), vn = (r, e) => {
3769
- const t = De(r);
3770
- return Array.isArray(t) ? Ee(t, {
3868
+ }, _n = (r) => Array.isArray(r) ? _e(r, { format: !1 }) : Pe(r, { format: !1, showDeclaration: !1 }), En = (r, e) => {
3869
+ const t = ze(r);
3870
+ return Array.isArray(t) ? _e(t, {
3771
3871
  indent: e?.indentBy
3772
3872
  }) : Pe(t, e);
3773
- }, Ee = (r, e = {}) => {
3873
+ }, _e = (r, e = {}) => {
3774
3874
  const t = e.indent !== void 0 ? e.indent : " ", s = e.level || 0, n = e.format !== !1, o = n ? t.repeat(s) : "", i = n ? `
3775
3875
  ` : "";
3776
3876
  let u = "";
3777
3877
  for (const a of r) {
3778
3878
  if (a["?xml"]) {
3779
- const _ = a[":@"] || {}, j = Object.entries(_).map(([H, p]) => `${H.startsWith("@_") ? H.substring(2) : H}="${p}"`).join(" ");
3780
- u += `<?xml ${j}?>${i}`;
3879
+ const k = a[":@"] || {}, S = Object.entries(k).map(([F, Z]) => `${F.startsWith("@_") ? F.substring(2) : F}="${Z}"`).join(" ");
3880
+ u += `<?xml ${S}?>${i}`;
3781
3881
  continue;
3782
3882
  }
3783
3883
  if (a["#comment"]) {
3784
- const _ = a["#comment"];
3785
- if (Array.isArray(_) && _.length > 0) {
3786
- const j = _[0]["#text"] || _[0];
3787
- u += `${o}<!--${j}-->${i}`;
3884
+ const k = a["#comment"];
3885
+ if (Array.isArray(k) && k.length > 0) {
3886
+ const S = k[0]["#text"] || k[0];
3887
+ u += `${o}<!--${S}-->${i}`;
3788
3888
  }
3789
3889
  continue;
3790
3890
  }
3791
- const l = Object.keys(a).find((_) => !_.startsWith(":") && !_.startsWith("#") && !_.startsWith("__"));
3891
+ const l = Object.keys(a).find((k) => !k.startsWith(":") && !k.startsWith("#") && !k.startsWith("__"));
3792
3892
  if (!l) continue;
3793
- const h = a[l], f = a[":@"] || {}, b = Object.entries(f).map(([_, j]) => `${_.startsWith("@_") ? _.substring(2) : _}="${j}"`).join(" "), m = b ? " " + b : "";
3794
- if (!Array.isArray(h) || h.length === 0) {
3795
- u += `${o}<${l}${m}/>${i}`;
3893
+ const p = a[l], h = a[":@"] || {}, v = Object.entries(h).map(([k, S]) => `${k.startsWith("@_") ? k.substring(2) : k}="${S}"`).join(" "), b = v ? " " + v : "";
3894
+ if (!Array.isArray(p) || p.length === 0) {
3895
+ u += `${o}<${l}${b}/>${i}`;
3796
3896
  continue;
3797
3897
  }
3798
- const w = h.length === 1 && h[0]["#text"] !== void 0;
3799
- if (h.some((_) => _.__cdata)) {
3800
- const _ = h.find((j) => j.__cdata);
3801
- if (_) {
3802
- const j = _.__cdata[0]["#text"] || "";
3803
- u += `${o}<${l}${m}><![CDATA[${j}]]></${l}>${i}`;
3898
+ const A = p.length === 1 && p[0]["#text"] !== void 0;
3899
+ if (p.some((k) => k.__cdata)) {
3900
+ const k = p.find((S) => S.__cdata);
3901
+ if (k) {
3902
+ const S = k.__cdata[0]["#text"] || "";
3903
+ u += `${o}<${l}${b}><![CDATA[${S}]]></${l}>${i}`;
3804
3904
  }
3805
- } else if (w) {
3806
- const _ = h[0]["#text"];
3807
- u += `${o}<${l}${m}>${_}</${l}>${i}`;
3905
+ } else if (A) {
3906
+ const k = p[0]["#text"];
3907
+ u += `${o}<${l}${b}>${k}</${l}>${i}`;
3808
3908
  } else
3809
- u += `${o}<${l}${m}>${i}`, u += Ee(h, { indent: t, level: s + 1, format: n }), u += `${o}</${l}>${i}`;
3909
+ u += `${o}<${l}${b}>${i}`, u += _e(p, { indent: t, level: s + 1, format: n }), u += `${o}</${l}>${i}`;
3810
3910
  }
3811
3911
  return u;
3812
- }, En = {
3912
+ }, xn = {
3813
3913
  key: 0,
3814
3914
  class: "xml-format__toolbar"
3815
- }, _n = { class: "xml-format__actions" }, xn = ["disabled"], Nn = ["disabled"], kn = ["disabled"], An = ["disabled"], wn = ["disabled"], Cn = { class: "xml-format__info" }, On = {
3915
+ }, kn = { class: "xml-format__actions" }, Nn = ["disabled"], An = ["disabled"], wn = ["disabled"], Cn = ["disabled"], On = ["disabled"], Tn = { class: "xml-format__info" }, Pn = {
3816
3916
  key: 0,
3817
3917
  class: "xml-format__status xml-format__status--success"
3818
- }, Tn = {
3918
+ }, $n = {
3819
3919
  key: 1,
3820
3920
  class: "xml-format__status xml-format__status--error"
3821
- }, Pn = { class: "xml-format__content" }, $n = {
3921
+ }, Sn = { class: "xml-format__content" }, Bn = {
3822
3922
  key: 0,
3823
3923
  class: "xml-format__error"
3824
- }, Sn = {
3924
+ }, In = {
3825
3925
  key: 1,
3826
3926
  class: "xml-format__viewer"
3827
- }, In = /* @__PURE__ */ ye({
3927
+ }, Vn = /* @__PURE__ */ ye({
3828
3928
  __name: "index",
3829
3929
  props: {
3830
3930
  modelValue: { default: "" },
@@ -3838,7 +3938,7 @@ const pn = {
3838
3938
  },
3839
3939
  emits: ["update:modelValue", "copy-success", "copy-error", "expand-all", "collapse-all", "compress", "format"],
3840
3940
  setup(r, { expose: e, emit: t }) {
3841
- Oe((E) => ({
3941
+ Oe((m) => ({
3842
3942
  "0db40539": l.value.colors.border,
3843
3943
  bd72d08a: l.value.colors.background,
3844
3944
  "1738b57a": l.value.colors.text,
@@ -3854,182 +3954,182 @@ const pn = {
3854
3954
  "61df294a": l.value.colors.error,
3855
3955
  "3307322e": l.value.colors.errorBackground
3856
3956
  }));
3857
- const s = r, n = t, o = z(null), i = z(""), u = z(/* @__PURE__ */ new Set()), a = V(() => i.value === ""), l = V(() => mr(s.theme)), h = V(() => !o.value || !Array.isArray(o.value) ? [] : o.value.filter((E) => !E["?xml"])), f = V(() => {
3957
+ const s = r, n = t, o = Y(null), i = Y(""), u = Y(/* @__PURE__ */ new Set()), a = V(() => i.value === ""), l = V(() => br(s.theme)), p = V(() => !o.value || !Array.isArray(o.value) ? [] : o.value.filter((m) => !m["?xml"])), h = V(() => {
3858
3958
  if (!o.value || !Array.isArray(o.value)) return null;
3859
- const E = o.value.find((X) => X["?xml"]);
3860
- if (!E || !E[":@"]) return null;
3861
- const O = E[":@"], I = [];
3862
- return O["@_version"] && I.push(`version="${O["@_version"]}"`), O["@_encoding"] && I.push(`encoding="${O["@_encoding"]}"`), O["@_standalone"] && I.push(`standalone="${O["@_standalone"]}"`), I.length > 0 ? `<?xml ${I.join(" ")}?>` : null;
3863
- }), b = V(() => h.value), m = (E) => {
3864
- if (!E || !E.trim()) {
3959
+ const m = o.value.find((j) => j["?xml"]);
3960
+ if (!m || !m[":@"]) return null;
3961
+ const O = m[":@"], $ = [];
3962
+ return O["@_version"] && $.push(`version="${O["@_version"]}"`), O["@_encoding"] && $.push(`encoding="${O["@_encoding"]}"`), O["@_standalone"] && $.push(`standalone="${O["@_standalone"]}"`), $.length > 0 ? `<?xml ${$.join(" ")}?>` : null;
3963
+ }), v = V(() => p.value), b = (m) => {
3964
+ if (!m || !m.trim()) {
3865
3965
  i.value = "", o.value = null;
3866
3966
  return;
3867
3967
  }
3868
3968
  try {
3869
- const O = yn(E);
3969
+ const O = vn(m);
3870
3970
  if (!O.valid) {
3871
3971
  i.value = O.error || "Invalid XML", o.value = null;
3872
3972
  return;
3873
3973
  }
3874
- o.value = De(E), i.value = "", he(() => {
3875
- S();
3974
+ o.value = ze(m), i.value = "", he(() => {
3975
+ P();
3876
3976
  });
3877
3977
  } catch (O) {
3878
3978
  i.value = O instanceof Error ? O.message : "Unknown parse error", o.value = null;
3879
3979
  }
3880
- }, w = (E) => {
3881
- u.value.has(E) ? u.value.delete(E) : u.value.add(E);
3882
- }, S = () => {
3883
- const E = /* @__PURE__ */ new Set(), O = (I, X = "") => {
3884
- Array.isArray(I) && I.forEach((Z, Y) => {
3885
- const Q = Object.keys(Z).find((y) => !y.startsWith(":") && !y.startsWith("#"));
3886
- if (!Q) return;
3887
- const ee = X ? `${X}[${Y}]` : `${Q}[${Y}]`;
3888
- E.add(ee);
3889
- const ae = Z[Q];
3890
- Array.isArray(ae) && O(ae, ee + "." + Q);
3980
+ }, A = (m) => {
3981
+ u.value.has(m) ? u.value.delete(m) : u.value.add(m);
3982
+ }, P = () => {
3983
+ const m = /* @__PURE__ */ new Set(), O = ($, j = "") => {
3984
+ Array.isArray($) && $.forEach((H, G) => {
3985
+ const K = Object.keys(H).find((ue) => !ue.startsWith(":") && !ue.startsWith("#"));
3986
+ if (!K) return;
3987
+ const ee = j ? `${j}[${G}]` : `${K}[${G}]`;
3988
+ m.add(ee);
3989
+ const te = H[K];
3990
+ Array.isArray(te) && O(te, ee + "." + K);
3891
3991
  });
3892
3992
  };
3893
- h.value.forEach((I, X) => {
3894
- const Z = Object.keys(I).find((Y) => !Y.startsWith(":") && !Y.startsWith("#"));
3895
- if (Z) {
3896
- const Y = `${Z}[${X}]`;
3897
- E.add(Y);
3898
- const Q = I[Z];
3899
- Array.isArray(Q) && O(Q, Y + "." + Z);
3993
+ p.value.forEach(($, j) => {
3994
+ const H = Object.keys($).find((G) => !G.startsWith(":") && !G.startsWith("#"));
3995
+ if (H) {
3996
+ const G = `${H}[${j}]`;
3997
+ m.add(G);
3998
+ const K = $[H];
3999
+ Array.isArray(K) && O(K, G + "." + H);
3900
4000
  }
3901
- }), u.value = E, n("expand-all");
3902
- }, _ = () => {
4001
+ }), u.value = m, n("expand-all");
4002
+ }, k = () => {
3903
4003
  u.value.clear(), n("collapse-all");
3904
- }, j = async () => {
4004
+ }, S = async () => {
3905
4005
  if (!(!a.value || !o.value))
3906
4006
  try {
3907
- const E = Array.isArray(o.value) ? Ee(o.value, { indent: " " }) : Pe(o.value, { format: !0, indentBy: " " });
3908
- await navigator.clipboard.writeText(E), n("copy-success", E);
3909
- } catch (E) {
3910
- const O = E instanceof Error ? E : new Error("Copy failed");
3911
- n("copy-error", O), console.error("Failed to copy XML:", E);
4007
+ const m = Array.isArray(o.value) ? _e(o.value, { indent: " " }) : Pe(o.value, { format: !0, indentBy: " " });
4008
+ await navigator.clipboard.writeText(m), n("copy-success", m);
4009
+ } catch (m) {
4010
+ const O = m instanceof Error ? m : new Error("Copy failed");
4011
+ n("copy-error", O), console.error("Failed to copy XML:", m);
3912
4012
  }
3913
- }, H = () => {
4013
+ }, F = () => {
3914
4014
  if (!(!a.value || !o.value))
3915
4015
  try {
3916
- const E = bn(o.value);
3917
- n("update:modelValue", E), n("compress", E);
3918
- } catch (E) {
3919
- console.error("Failed to compress XML:", E);
4016
+ const m = _n(o.value);
4017
+ n("update:modelValue", m), n("compress", m);
4018
+ } catch (m) {
4019
+ console.error("Failed to compress XML:", m);
3920
4020
  }
3921
- }, p = () => {
4021
+ }, Z = () => {
3922
4022
  if (a.value)
3923
4023
  try {
3924
- const E = vn(s.modelValue, {
4024
+ const m = En(s.modelValue, {
3925
4025
  format: !0,
3926
4026
  indentBy: " "
3927
4027
  });
3928
- n("update:modelValue", E), n("format", E);
3929
- } catch (E) {
3930
- console.error("Failed to format XML:", E);
4028
+ n("update:modelValue", m), n("format", m);
4029
+ } catch (m) {
4030
+ console.error("Failed to format XML:", m);
3931
4031
  }
3932
- }, $ = async (E) => {
4032
+ }, g = async (m) => {
3933
4033
  try {
3934
- const O = typeof E == "string" ? E : JSON.stringify(E, null, 2);
4034
+ const O = typeof m == "string" ? m : JSON.stringify(m, null, 2);
3935
4035
  await navigator.clipboard.writeText(O), n("copy-success", O);
3936
4036
  } catch (O) {
3937
- const I = O instanceof Error ? O : new Error("Copy failed");
3938
- n("copy-error", I), console.error("Failed to copy value:", O);
4037
+ const $ = O instanceof Error ? O : new Error("Copy failed");
4038
+ n("copy-error", $), console.error("Failed to copy value:", O);
3939
4039
  }
3940
4040
  };
3941
- return Xe(() => s.modelValue, (E) => {
3942
- m(E);
4041
+ return Fe(() => s.modelValue, (m) => {
4042
+ b(m);
3943
4043
  }, { immediate: !0 }), e({
3944
4044
  // 核心操作方法
3945
- copyXml: j,
3946
- compressSource: H,
3947
- formatSource: p,
3948
- expandAll: S,
3949
- collapseAll: _,
3950
- toggleExpand: w,
4045
+ copyXml: S,
4046
+ compressSource: F,
4047
+ formatSource: Z,
4048
+ expandAll: P,
4049
+ collapseAll: k,
4050
+ toggleExpand: A,
3951
4051
  // 状态访问方法
3952
4052
  isValidXml: () => a.value,
3953
4053
  getParsedXml: () => o.value,
3954
4054
  getExpandedNodes: () => u.value,
3955
4055
  getParseError: () => i.value,
3956
4056
  // 工具方法
3957
- parseXmlString: (E) => m(E),
3958
- copyValue: (E) => $(E)
3959
- }), (E, O) => (x(), k("div", {
4057
+ parseXmlString: (m) => b(m),
4058
+ copyValue: (m) => g(m)
4059
+ }), (m, O) => (_(), x("div", {
3960
4060
  class: Te(["xml-format", `xml-format--${l.value.name}`])
3961
4061
  }, [
3962
- E.showToolbar ? (x(), k("div", En, [
3963
- v("div", _n, [
3964
- v("button", {
4062
+ m.showToolbar ? (_(), x("div", xn, [
4063
+ y("div", kn, [
4064
+ y("button", {
3965
4065
  class: "xml-format__btn xml-format__btn--primary",
3966
- onClick: j,
4066
+ onClick: S,
3967
4067
  disabled: !a.value,
3968
4068
  title: "Copy XML"
3969
- }, " 📋 Copy ", 8, xn),
3970
- v("button", {
4069
+ }, " 📋 Copy ", 8, Nn),
4070
+ y("button", {
3971
4071
  class: "xml-format__btn xml-format__btn--secondary",
3972
- onClick: S,
4072
+ onClick: P,
3973
4073
  disabled: !a.value,
3974
4074
  title: "Expand All"
3975
- }, " ⬇️ Expand All ", 8, Nn),
3976
- v("button", {
4075
+ }, " ⬇️ Expand All ", 8, An),
4076
+ y("button", {
3977
4077
  class: "xml-format__btn xml-format__btn--secondary",
3978
- onClick: _,
4078
+ onClick: k,
3979
4079
  disabled: !a.value,
3980
4080
  title: "Collapse All"
3981
- }, " ➡️ Collapse All ", 8, kn),
3982
- v("button", {
4081
+ }, " ➡️ Collapse All ", 8, wn),
4082
+ y("button", {
3983
4083
  class: "xml-format__btn xml-format__btn--secondary",
3984
- onClick: H,
4084
+ onClick: F,
3985
4085
  disabled: !a.value,
3986
4086
  title: "Compress XML"
3987
- }, " 📦 Compress ", 8, An),
3988
- v("button", {
4087
+ }, " 📦 Compress ", 8, Cn),
4088
+ y("button", {
3989
4089
  class: "xml-format__btn xml-format__btn--secondary",
3990
- onClick: p,
4090
+ onClick: Z,
3991
4091
  disabled: !a.value,
3992
4092
  title: "Format XML"
3993
- }, " ✨ Format ", 8, wn)
4093
+ }, " ✨ Format ", 8, On)
3994
4094
  ]),
3995
- v("div", Cn, [
3996
- a.value ? (x(), k("span", On, " ✅ Valid XML ")) : (x(), k("span", Tn, " ❌ Invalid XML "))
4095
+ y("div", Tn, [
4096
+ a.value ? (_(), x("span", Pn, " ✅ Valid XML ")) : (_(), x("span", $n, " ❌ Invalid XML "))
3997
4097
  ])
3998
- ])) : F("", !0),
3999
- v("div", Pn, [
4000
- a.value ? (x(), k("div", Sn, [
4001
- f.value ? (x(), k("div", {
4098
+ ])) : U("", !0),
4099
+ y("div", Sn, [
4100
+ a.value ? (_(), x("div", In, [
4101
+ h.value ? (_(), x("div", {
4002
4102
  key: 0,
4003
4103
  class: "xml-declaration",
4004
- style: P({ color: l.value.colors.xmlDeclaration })
4005
- }, R(f.value), 5)) : F("", !0),
4006
- (x(!0), k(de, null, fe(b.value, (I, X) => (x(), He(dr, {
4007
- key: X,
4008
- node: I,
4009
- index: X,
4104
+ style: N({ color: l.value.colors.xmlDeclaration })
4105
+ }, B(h.value), 5)) : U("", !0),
4106
+ (_(!0), x(ne, null, ie(v.value, ($, j) => (_(), Xe(hr, {
4107
+ key: j,
4108
+ node: $,
4109
+ index: j,
4010
4110
  level: 0,
4011
4111
  expanded: u.value,
4012
4112
  theme: l.value,
4013
- onToggleExpand: w,
4014
- onCopy: $
4113
+ onToggleExpand: A,
4114
+ onCopy: g
4015
4115
  }, null, 8, ["node", "index", "expanded", "theme"]))), 128))
4016
- ])) : (x(), k("div", $n, [
4017
- O[0] || (O[0] = v("h4", null, "XML Parse Error:", -1)),
4018
- v("pre", null, R(i.value), 1)
4116
+ ])) : (_(), x("div", Bn, [
4117
+ O[0] || (O[0] = y("h4", null, "XML Parse Error:", -1)),
4118
+ y("pre", null, B(i.value), 1)
4019
4119
  ]))
4020
4120
  ])
4021
4121
  ], 2));
4022
4122
  }
4023
- }), jn = /* @__PURE__ */ be(In, [["__scopeId", "data-v-f9125514"]]), Bn = [Zt], Vn = (r) => {
4024
- Bn.forEach((e) => {
4123
+ }), Un = /* @__PURE__ */ be(Vn, [["__scopeId", "data-v-f9125514"]]), Ln = [Zt], jn = (r) => {
4124
+ Ln.forEach((e) => {
4025
4125
  const t = e.name || e.__name || "UnknownComponent";
4026
4126
  r.component(t, e);
4027
4127
  });
4028
- }, Mn = {
4029
- install: Vn
4128
+ }, Fn = {
4129
+ install: jn
4030
4130
  };
4031
4131
  export {
4032
4132
  Zt as JsonFormat,
4033
- jn as XmlFormat,
4034
- Mn as default
4133
+ Un as XmlFormat,
4134
+ Fn as default
4035
4135
  };