lone-format 0.5.1 → 0.6.0

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