@eternalheart/vue-file-preview 1.6.12 → 1.6.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +2 -0
  2. package/README.zh-CN.md +2 -0
  3. package/lib/FilePreviewContent.vue.d.ts +9 -1
  4. package/lib/FilePreviewEmbed.vue.d.ts +4 -1
  5. package/lib/FilePreviewModal.vue.d.ts +4 -1
  6. package/lib/chunks/EmptyState.vue_vue_type_script_setup_true_lang-C7qk6wj0.mjs +20 -0
  7. package/lib/chunks/RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs +32 -0
  8. package/lib/chunks/{avifLoader-CAUzjn-d-CTy7cevh.mjs → avifLoader-CAUzjn-d-C0KRpetN.mjs} +1 -1
  9. package/lib/chunks/{heicLoader-D_9PukkA-DdDu94xL.mjs → heicLoader-D_9PukkA-Czof_5FJ.mjs} +1 -1
  10. package/lib/chunks/{index-CLM9sOKN.mjs → index--612Smof.mjs} +112 -112
  11. package/lib/chunks/{index-De-oaCgN.mjs → index-8Vpbg2kS.mjs} +2 -2
  12. package/lib/chunks/{index-2VQLB2Mi.mjs → index-B21EAyWz.mjs} +53 -49
  13. package/lib/chunks/{index-DmEMePjL.mjs → index-BASg1cr4.mjs} +2 -2
  14. package/lib/chunks/index-BB0i4QqI.mjs +117 -0
  15. package/lib/chunks/{index-Bmqn45d_.mjs → index-BVdrGK3Q.mjs} +72 -72
  16. package/lib/chunks/index-BlrFFeqc.mjs +330 -0
  17. package/lib/chunks/index-Bp9CuvMZ.mjs +157 -0
  18. package/lib/chunks/{index-i-KacQvS.mjs → index-BuqPb5mP.mjs} +3 -3
  19. package/lib/chunks/{index-DVG1fZAv.mjs → index-BvBqDq3O.mjs} +2 -2
  20. package/lib/chunks/{index-D6te_qaB.mjs → index-Bxpf9v5j.mjs} +26 -26
  21. package/lib/chunks/{index-D9z6lQat.mjs → index-C9mAajbD.mjs} +225 -220
  22. package/lib/chunks/{index-CM11hSQu.mjs → index-CDg6vIbT.mjs} +11 -11
  23. package/lib/chunks/{index-BxmX005K.mjs → index-CWE-hKSs.mjs} +11 -11
  24. package/lib/chunks/{index-BPmyF7Wr.mjs → index-CY3xzGgt.mjs} +18 -18
  25. package/lib/chunks/{index-t9kSzzMg.mjs → index-CxKZKUJj.mjs} +521 -523
  26. package/lib/chunks/{index-CuiEjR23.mjs → index-D30L8tm9.mjs} +15 -15
  27. package/lib/chunks/{index-DOAOk6m5.mjs → index-DN4Ui0Gh.mjs} +11 -11
  28. package/lib/chunks/{index-CEk6FKm3.mjs → index-DZZN3kYi.mjs} +551 -531
  29. package/lib/chunks/{index-D6Pjjxi0.mjs → index-Dkro_8Fy.mjs} +20 -20
  30. package/lib/chunks/{index-CiGUKdlt.mjs → index-VdzIFJJW.mjs} +23 -23
  31. package/lib/chunks/{index-WcAnJA2t.mjs → index-aoXgVLBb.mjs} +14 -14
  32. package/lib/chunks/{jp2Loader-Dig19xyo-BBR3tcPW.mjs → jp2Loader-Dig19xyo-CKUaGhPl.mjs} +1 -1
  33. package/lib/chunks/{psdLoader-C0tKUXXl-DGOmJwkQ.mjs → psdLoader-C0tKUXXl-CYWoQis5.mjs} +1 -1
  34. package/lib/chunks/{rawLoader-C-tPeFAB-CrCtXMup.mjs → rawLoader-C-tPeFAB-C35zC8nZ.mjs} +1 -1
  35. package/lib/chunks/{tiffLoader-BlhByX8w-jsxHlbyu.mjs → tiffLoader-BlhByX8w-BOxg_Du5.mjs} +1 -1
  36. package/lib/chunks/{useShikiHighlight-BdhPCj48.mjs → useShikiHighlight-BPmcxA-h.mjs} +1 -1
  37. package/lib/index.cjs +59 -59
  38. package/lib/index.css +1 -1
  39. package/lib/index.d.ts +1 -1
  40. package/lib/index.mjs +4 -4
  41. package/lib/renderers/EmptyState.vue.d.ts +2 -0
  42. package/lib/renderers/Json/index.vue.d.ts +5 -0
  43. package/lib/renderers/Pptx/index.vue.d.ts +3 -0
  44. package/lib/renderers/Text/index.vue.d.ts +3 -0
  45. package/lib/renderers/Xlsx/index.vue.d.ts +3 -0
  46. package/lib/renderers/registry.d.ts +3 -1
  47. package/package.json +1 -1
  48. package/lib/chunks/RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs +0 -30
  49. package/lib/chunks/index-Bfg5zM8l.mjs +0 -141
  50. package/lib/chunks/index-Cud9j9Xy.mjs +0 -322
  51. package/lib/chunks/index-D4jhvs5m.mjs +0 -113
@@ -1,13 +1,14 @@
1
- import { defineComponent as J, ref as U, watch as x, openBlock as $, createElementBlock as H, createElementVNode as d, toDisplayString as C, unref as Q, createBlock as ee, createVNode as ne, h as g, inject as le, computed as W } from "vue";
2
- import { u as te, b as ie, T as ue, i as oe, j as fe, h as se } from "./index-CEk6FKm3.mjs";
3
- import { _ as ce } from "./RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs";
4
- import { ChevronDown as pe, ChevronRight as ke } from "lucide-vue-next";
5
- function ge(e, o = !1) {
1
+ import { defineComponent as J, ref as U, watch as C, openBlock as j, createElementBlock as d, createElementVNode as R, toDisplayString as ee, unref as Q, createBlock as W, createVNode as ne, h as g, inject as le, computed as X } from "vue";
2
+ import { u as te, c as ie, l as ue, X as oe, w as se, i as fe, j as ce, g as pe } from "./index-DZZN3kYi.mjs";
3
+ import { _ as ke } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
4
+ import { _ as ge } from "./EmptyState.vue_vue_type_script_setup_true_lang-C7qk6wj0.mjs";
5
+ import { ChevronDown as re, ChevronRight as ae } from "lucide-vue-next";
6
+ function me(e, o = !1) {
6
7
  const c = e.length;
7
- let n = 0, t = "", f = 0, i = 16, a = 0, p = 0, w = 0, b = 0, r = 0;
8
- function _(l, T) {
9
- let v = 0, k = 0;
10
- for (; v < l; ) {
8
+ let n = 0, i = "", s = 0, t = 16, m = 0, p = 0, O = 0, w = 0, a = 0;
9
+ function v(l, b) {
10
+ let T = 0, k = 0;
11
+ for (; T < l; ) {
11
12
  let u = e.charCodeAt(n);
12
13
  if (u >= 48 && u <= 57)
13
14
  k = k * 16 + u - 48;
@@ -17,14 +18,14 @@ function ge(e, o = !1) {
17
18
  k = k * 16 + u - 97 + 10;
18
19
  else
19
20
  break;
20
- n++, v++;
21
+ n++, T++;
21
22
  }
22
- return v < l && (k = -1), k;
23
+ return T < l && (k = -1), k;
23
24
  }
24
- function O(l) {
25
- n = l, t = "", f = 0, i = 16, r = 0;
25
+ function y(l) {
26
+ n = l, i = "", s = 0, t = 16, a = 0;
26
27
  }
27
- function y() {
28
+ function _() {
28
29
  let l = n;
29
30
  if (e.charCodeAt(n) === 48)
30
31
  n++;
@@ -36,32 +37,32 @@ function ge(e, o = !1) {
36
37
  for (n++; n < e.length && B(e.charCodeAt(n)); )
37
38
  n++;
38
39
  else
39
- return r = 3, e.substring(l, n);
40
- let T = n;
40
+ return a = 3, e.substring(l, n);
41
+ let b = n;
41
42
  if (n < e.length && (e.charCodeAt(n) === 69 || e.charCodeAt(n) === 101))
42
43
  if (n++, (n < e.length && e.charCodeAt(n) === 43 || e.charCodeAt(n) === 45) && n++, n < e.length && B(e.charCodeAt(n))) {
43
44
  for (n++; n < e.length && B(e.charCodeAt(n)); )
44
45
  n++;
45
- T = n;
46
+ b = n;
46
47
  } else
47
- r = 3;
48
- return e.substring(l, T);
48
+ a = 3;
49
+ return e.substring(l, b);
49
50
  }
50
51
  function L() {
51
- let l = "", T = n;
52
+ let l = "", b = n;
52
53
  for (; ; ) {
53
54
  if (n >= c) {
54
- l += e.substring(T, n), r = 2;
55
+ l += e.substring(b, n), a = 2;
55
56
  break;
56
57
  }
57
- const v = e.charCodeAt(n);
58
- if (v === 34) {
59
- l += e.substring(T, n), n++;
58
+ const T = e.charCodeAt(n);
59
+ if (T === 34) {
60
+ l += e.substring(b, n), n++;
60
61
  break;
61
62
  }
62
- if (v === 92) {
63
- if (l += e.substring(T, n), n++, n >= c) {
64
- r = 2;
63
+ if (T === 92) {
64
+ if (l += e.substring(b, n), n++, n >= c) {
65
+ a = 2;
65
66
  break;
66
67
  }
67
68
  switch (e.charCodeAt(n++)) {
@@ -91,78 +92,78 @@ function ge(e, o = !1) {
91
92
  l += " ";
92
93
  break;
93
94
  case 117:
94
- const u = _(4);
95
- u >= 0 ? l += String.fromCharCode(u) : r = 4;
95
+ const u = v(4);
96
+ u >= 0 ? l += String.fromCharCode(u) : a = 4;
96
97
  break;
97
98
  default:
98
- r = 5;
99
+ a = 5;
99
100
  }
100
- T = n;
101
+ b = n;
101
102
  continue;
102
103
  }
103
- if (v >= 0 && v <= 31)
104
- if (j(v)) {
105
- l += e.substring(T, n), r = 2;
104
+ if (T >= 0 && T <= 31)
105
+ if (E(T)) {
106
+ l += e.substring(b, n), a = 2;
106
107
  break;
107
108
  } else
108
- r = 6;
109
+ a = 6;
109
110
  n++;
110
111
  }
111
112
  return l;
112
113
  }
113
114
  function A() {
114
- if (t = "", r = 0, f = n, p = a, b = w, n >= c)
115
- return f = c, i = 17;
115
+ if (i = "", a = 0, s = n, p = m, w = O, n >= c)
116
+ return s = c, t = 17;
116
117
  let l = e.charCodeAt(n);
117
- if (R(l)) {
118
+ if (D(l)) {
118
119
  do
119
- n++, t += String.fromCharCode(l), l = e.charCodeAt(n);
120
- while (R(l));
121
- return i = 15;
120
+ n++, i += String.fromCharCode(l), l = e.charCodeAt(n);
121
+ while (D(l));
122
+ return t = 15;
122
123
  }
123
- if (j(l))
124
- return n++, t += String.fromCharCode(l), l === 13 && e.charCodeAt(n) === 10 && (n++, t += `
125
- `), a++, w = n, i = 14;
124
+ if (E(l))
125
+ return n++, i += String.fromCharCode(l), l === 13 && e.charCodeAt(n) === 10 && (n++, i += `
126
+ `), m++, O = n, t = 14;
126
127
  switch (l) {
127
128
  case 123:
128
- return n++, i = 1;
129
+ return n++, t = 1;
129
130
  case 125:
130
- return n++, i = 2;
131
+ return n++, t = 2;
131
132
  case 91:
132
- return n++, i = 3;
133
+ return n++, t = 3;
133
134
  case 93:
134
- return n++, i = 4;
135
+ return n++, t = 4;
135
136
  case 58:
136
- return n++, i = 6;
137
+ return n++, t = 6;
137
138
  case 44:
138
- return n++, i = 5;
139
+ return n++, t = 5;
139
140
  case 34:
140
- return n++, t = L(), i = 10;
141
+ return n++, i = L(), t = 10;
141
142
  case 47:
142
- const T = n - 1;
143
+ const b = n - 1;
143
144
  if (e.charCodeAt(n + 1) === 47) {
144
- for (n += 2; n < c && !j(e.charCodeAt(n)); )
145
+ for (n += 2; n < c && !E(e.charCodeAt(n)); )
145
146
  n++;
146
- return t = e.substring(T, n), i = 12;
147
+ return i = e.substring(b, n), t = 12;
147
148
  }
148
149
  if (e.charCodeAt(n + 1) === 42) {
149
150
  n += 2;
150
- const v = c - 1;
151
+ const T = c - 1;
151
152
  let k = !1;
152
- for (; n < v; ) {
153
+ for (; n < T; ) {
153
154
  const u = e.charCodeAt(n);
154
155
  if (u === 42 && e.charCodeAt(n + 1) === 47) {
155
156
  n += 2, k = !0;
156
157
  break;
157
158
  }
158
- n++, j(u) && (u === 13 && e.charCodeAt(n) === 10 && n++, a++, w = n);
159
+ n++, E(u) && (u === 13 && e.charCodeAt(n) === 10 && n++, m++, O = n);
159
160
  }
160
- return k || (n++, r = 1), t = e.substring(T, n), i = 13;
161
+ return k || (n++, a = 1), i = e.substring(b, n), t = 13;
161
162
  }
162
- return t += String.fromCharCode(l), n++, i = 16;
163
+ return i += String.fromCharCode(l), n++, t = 16;
163
164
  case 45:
164
- if (t += String.fromCharCode(l), n++, n === c || !B(e.charCodeAt(n)))
165
- return i = 16;
165
+ if (i += String.fromCharCode(l), n++, n === c || !B(e.charCodeAt(n)))
166
+ return t = 16;
166
167
  case 48:
167
168
  case 49:
168
169
  case 50:
@@ -173,26 +174,26 @@ function ge(e, o = !1) {
173
174
  case 55:
174
175
  case 56:
175
176
  case 57:
176
- return t += y(), i = 11;
177
+ return i += _(), t = 11;
177
178
  default:
178
179
  for (; n < c && N(l); )
179
180
  n++, l = e.charCodeAt(n);
180
- if (f !== n) {
181
- switch (t = e.substring(f, n), t) {
181
+ if (s !== n) {
182
+ switch (i = e.substring(s, n), i) {
182
183
  case "true":
183
- return i = 8;
184
+ return t = 8;
184
185
  case "false":
185
- return i = 9;
186
+ return t = 9;
186
187
  case "null":
187
- return i = 7;
188
+ return t = 7;
188
189
  }
189
- return i = 16;
190
+ return t = 16;
190
191
  }
191
- return t += String.fromCharCode(l), n++, i = 16;
192
+ return i += String.fromCharCode(l), n++, t = 16;
192
193
  }
193
194
  }
194
195
  function N(l) {
195
- if (R(l) || j(l))
196
+ if (D(l) || E(l))
196
197
  return !1;
197
198
  switch (l) {
198
199
  case 125:
@@ -207,7 +208,7 @@ function ge(e, o = !1) {
207
208
  }
208
209
  return !0;
209
210
  }
210
- function V() {
211
+ function F() {
211
212
  let l;
212
213
  do
213
214
  l = A();
@@ -215,22 +216,22 @@ function ge(e, o = !1) {
215
216
  return l;
216
217
  }
217
218
  return {
218
- setPosition: O,
219
+ setPosition: y,
219
220
  getPosition: () => n,
220
- scan: o ? V : A,
221
- getToken: () => i,
222
- getTokenValue: () => t,
223
- getTokenOffset: () => f,
224
- getTokenLength: () => n - f,
221
+ scan: o ? F : A,
222
+ getToken: () => t,
223
+ getTokenValue: () => i,
224
+ getTokenOffset: () => s,
225
+ getTokenLength: () => n - s,
225
226
  getTokenStartLine: () => p,
226
- getTokenStartCharacter: () => f - b,
227
- getTokenError: () => r
227
+ getTokenStartCharacter: () => s - w,
228
+ getTokenError: () => a
228
229
  };
229
230
  }
230
- function R(e) {
231
+ function D(e) {
231
232
  return e === 32 || e === 9;
232
233
  }
233
- function j(e) {
234
+ function E(e) {
234
235
  return e === 10 || e === 13;
235
236
  }
236
237
  function B(e) {
@@ -240,68 +241,68 @@ var Y;
240
241
  (function(e) {
241
242
  e[e.lineFeed = 10] = "lineFeed", e[e.carriageReturn = 13] = "carriageReturn", e[e.space = 32] = "space", e[e._0 = 48] = "_0", e[e._1 = 49] = "_1", e[e._2 = 50] = "_2", e[e._3 = 51] = "_3", e[e._4 = 52] = "_4", e[e._5 = 53] = "_5", e[e._6 = 54] = "_6", e[e._7 = 55] = "_7", e[e._8 = 56] = "_8", e[e._9 = 57] = "_9", e[e.a = 97] = "a", e[e.b = 98] = "b", e[e.c = 99] = "c", e[e.d = 100] = "d", e[e.e = 101] = "e", e[e.f = 102] = "f", e[e.g = 103] = "g", e[e.h = 104] = "h", e[e.i = 105] = "i", e[e.j = 106] = "j", e[e.k = 107] = "k", e[e.l = 108] = "l", e[e.m = 109] = "m", e[e.n = 110] = "n", e[e.o = 111] = "o", e[e.p = 112] = "p", e[e.q = 113] = "q", e[e.r = 114] = "r", e[e.s = 115] = "s", e[e.t = 116] = "t", e[e.u = 117] = "u", e[e.v = 118] = "v", e[e.w = 119] = "w", e[e.x = 120] = "x", e[e.y = 121] = "y", e[e.z = 122] = "z", e[e.A = 65] = "A", e[e.B = 66] = "B", e[e.C = 67] = "C", e[e.D = 68] = "D", e[e.E = 69] = "E", e[e.F = 70] = "F", e[e.G = 71] = "G", e[e.H = 72] = "H", e[e.I = 73] = "I", e[e.J = 74] = "J", e[e.K = 75] = "K", e[e.L = 76] = "L", e[e.M = 77] = "M", e[e.N = 78] = "N", e[e.O = 79] = "O", e[e.P = 80] = "P", e[e.Q = 81] = "Q", e[e.R = 82] = "R", e[e.S = 83] = "S", e[e.T = 84] = "T", e[e.U = 85] = "U", e[e.V = 86] = "V", e[e.W = 87] = "W", e[e.X = 88] = "X", e[e.Y = 89] = "Y", e[e.Z = 90] = "Z", e[e.asterisk = 42] = "asterisk", e[e.backslash = 92] = "backslash", e[e.closeBrace = 125] = "closeBrace", e[e.closeBracket = 93] = "closeBracket", e[e.colon = 58] = "colon", e[e.comma = 44] = "comma", e[e.dot = 46] = "dot", e[e.doubleQuote = 34] = "doubleQuote", e[e.minus = 45] = "minus", e[e.openBrace = 123] = "openBrace", e[e.openBracket = 91] = "openBracket", e[e.plus = 43] = "plus", e[e.slash = 47] = "slash", e[e.formFeed = 12] = "formFeed", e[e.tab = 9] = "tab";
242
243
  })(Y || (Y = {}));
243
- var I;
244
+ var V;
244
245
  (function(e) {
245
246
  e.DEFAULT = {
246
247
  allowTrailingComma: !1
247
248
  };
248
- })(I || (I = {}));
249
- function re(e, o = [], c = I.DEFAULT) {
250
- let n = null, t = [];
251
- const f = [];
252
- function i(p) {
253
- Array.isArray(t) ? t.push(p) : n !== null && (t[n] = p);
249
+ })(V || (V = {}));
250
+ function be(e, o = [], c = V.DEFAULT) {
251
+ let n = null, i = [];
252
+ const s = [];
253
+ function t(p) {
254
+ Array.isArray(i) ? i.push(p) : n !== null && (i[n] = p);
254
255
  }
255
- return me(e, {
256
+ return Te(e, {
256
257
  onObjectBegin: () => {
257
258
  const p = {};
258
- i(p), f.push(t), t = p, n = null;
259
+ t(p), s.push(i), i = p, n = null;
259
260
  },
260
261
  onObjectProperty: (p) => {
261
262
  n = p;
262
263
  },
263
264
  onObjectEnd: () => {
264
- t = f.pop();
265
+ i = s.pop();
265
266
  },
266
267
  onArrayBegin: () => {
267
268
  const p = [];
268
- i(p), f.push(t), t = p, n = null;
269
+ t(p), s.push(i), i = p, n = null;
269
270
  },
270
271
  onArrayEnd: () => {
271
- t = f.pop();
272
+ i = s.pop();
272
273
  },
273
- onLiteralValue: i,
274
- onError: (p, w, b) => {
275
- o.push({ error: p, offset: w, length: b });
274
+ onLiteralValue: t,
275
+ onError: (p, O, w) => {
276
+ o.push({ error: p, offset: O, length: w });
276
277
  }
277
- }, c), t[0];
278
+ }, c), i[0];
278
279
  }
279
- function me(e, o, c = I.DEFAULT) {
280
- const n = ge(e, !1), t = [];
281
- let f = 0;
282
- function i(s) {
283
- return s ? () => f === 0 && s(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter()) : () => !0;
280
+ function Te(e, o, c = V.DEFAULT) {
281
+ const n = me(e, !1), i = [];
282
+ let s = 0;
283
+ function t(f) {
284
+ return f ? () => s === 0 && f(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter()) : () => !0;
284
285
  }
285
- function a(s) {
286
- return s ? (m) => f === 0 && s(m, n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter()) : () => !0;
286
+ function m(f) {
287
+ return f ? (r) => s === 0 && f(r, n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter()) : () => !0;
287
288
  }
288
- function p(s) {
289
- return s ? (m) => f === 0 && s(m, n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter(), () => t.slice()) : () => !0;
289
+ function p(f) {
290
+ return f ? (r) => s === 0 && f(r, n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter(), () => i.slice()) : () => !0;
290
291
  }
291
- function w(s) {
292
- return s ? () => {
293
- f > 0 ? f++ : s(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter(), () => t.slice()) === !1 && (f = 1);
292
+ function O(f) {
293
+ return f ? () => {
294
+ s > 0 ? s++ : f(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter(), () => i.slice()) === !1 && (s = 1);
294
295
  } : () => !0;
295
296
  }
296
- function b(s) {
297
- return s ? () => {
298
- f > 0 && f--, f === 0 && s(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter());
297
+ function w(f) {
298
+ return f ? () => {
299
+ s > 0 && s--, s === 0 && f(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter());
299
300
  } : () => !0;
300
301
  }
301
- const r = w(o.onObjectBegin), _ = p(o.onObjectProperty), O = b(o.onObjectEnd), y = w(o.onArrayBegin), L = b(o.onArrayEnd), A = p(o.onLiteralValue), N = a(o.onSeparator), V = i(o.onComment), l = a(o.onError), T = c && c.disallowComments, v = c && c.allowTrailingComma;
302
+ const a = O(o.onObjectBegin), v = p(o.onObjectProperty), y = w(o.onObjectEnd), _ = O(o.onArrayBegin), L = w(o.onArrayEnd), A = p(o.onLiteralValue), N = m(o.onSeparator), F = t(o.onComment), l = m(o.onError), b = c && c.disallowComments, T = c && c.allowTrailingComma;
302
303
  function k() {
303
304
  for (; ; ) {
304
- const s = n.scan();
305
+ const f = n.scan();
305
306
  switch (n.getTokenError()) {
306
307
  case 4:
307
308
  u(
@@ -322,7 +323,7 @@ function me(e, o, c = I.DEFAULT) {
322
323
  );
323
324
  break;
324
325
  case 1:
325
- T || u(
326
+ b || u(
326
327
  11
327
328
  /* ParseErrorCode.UnexpectedEndOfComment */
328
329
  );
@@ -340,13 +341,13 @@ function me(e, o, c = I.DEFAULT) {
340
341
  );
341
342
  break;
342
343
  }
343
- switch (s) {
344
+ switch (f) {
344
345
  case 12:
345
346
  case 13:
346
- T ? u(
347
+ b ? u(
347
348
  10
348
349
  /* ParseErrorCode.InvalidCommentToken */
349
- ) : V();
350
+ ) : F();
350
351
  break;
351
352
  case 16:
352
353
  u(
@@ -358,36 +359,36 @@ function me(e, o, c = I.DEFAULT) {
358
359
  case 14:
359
360
  break;
360
361
  default:
361
- return s;
362
+ return f;
362
363
  }
363
364
  }
364
365
  }
365
- function u(s, m = [], q = []) {
366
- if (l(s), m.length + q.length > 0) {
367
- let E = n.getToken();
368
- for (; E !== 17; ) {
369
- if (m.indexOf(E) !== -1) {
366
+ function u(f, r = [], q = []) {
367
+ if (l(f), r.length + q.length > 0) {
368
+ let I = n.getToken();
369
+ for (; I !== 17; ) {
370
+ if (r.indexOf(I) !== -1) {
370
371
  k();
371
372
  break;
372
- } else if (q.indexOf(E) !== -1)
373
+ } else if (q.indexOf(I) !== -1)
373
374
  break;
374
- E = k();
375
+ I = k();
375
376
  }
376
377
  }
377
378
  }
378
- function G(s) {
379
- const m = n.getTokenValue();
380
- return s ? A(m) : (_(m), t.push(m)), k(), !0;
379
+ function G(f) {
380
+ const r = n.getTokenValue();
381
+ return f ? A(r) : (v(r), i.push(r)), k(), !0;
381
382
  }
382
- function S() {
383
+ function P() {
383
384
  switch (n.getToken()) {
384
385
  case 11:
385
- const s = n.getTokenValue();
386
- let m = Number(s);
387
- isNaN(m) && (u(
386
+ const f = n.getTokenValue();
387
+ let r = Number(f);
388
+ isNaN(r) && (u(
388
389
  2
389
390
  /* ParseErrorCode.InvalidNumberFormat */
390
- ), m = 0), A(m);
391
+ ), r = 0), A(r);
391
392
  break;
392
393
  case 7:
393
394
  A(null);
@@ -403,12 +404,12 @@ function me(e, o, c = I.DEFAULT) {
403
404
  }
404
405
  return k(), !0;
405
406
  }
406
- function P() {
407
+ function h() {
407
408
  return n.getToken() !== 10 ? (u(3, [], [
408
409
  2,
409
410
  5
410
411
  /* SyntaxKind.CommaToken */
411
- ]), !1) : (G(!1), n.getToken() === 6 ? (N(":"), k(), F() || u(4, [], [
412
+ ]), !1) : (G(!1), n.getToken() === 6 ? (N(":"), k(), $() || u(4, [], [
412
413
  2,
413
414
  5
414
415
  /* SyntaxKind.CommaToken */
@@ -416,59 +417,59 @@ function me(e, o, c = I.DEFAULT) {
416
417
  2,
417
418
  5
418
419
  /* SyntaxKind.CommaToken */
419
- ]), t.pop(), !0);
420
+ ]), i.pop(), !0);
420
421
  }
421
- function h() {
422
- r(), k();
423
- let s = !1;
422
+ function x() {
423
+ a(), k();
424
+ let f = !1;
424
425
  for (; n.getToken() !== 2 && n.getToken() !== 17; ) {
425
426
  if (n.getToken() === 5) {
426
- if (s || u(4, [], []), N(","), k(), n.getToken() === 2 && v)
427
+ if (f || u(4, [], []), N(","), k(), n.getToken() === 2 && T)
427
428
  break;
428
- } else s && u(6, [], []);
429
- P() || u(4, [], [
429
+ } else f && u(6, [], []);
430
+ h() || u(4, [], [
430
431
  2,
431
432
  5
432
433
  /* SyntaxKind.CommaToken */
433
- ]), s = !0;
434
+ ]), f = !0;
434
435
  }
435
- return O(), n.getToken() !== 2 ? u(7, [
436
+ return y(), n.getToken() !== 2 ? u(7, [
436
437
  2
437
438
  /* SyntaxKind.CloseBraceToken */
438
439
  ], []) : k(), !0;
439
440
  }
440
441
  function K() {
441
- y(), k();
442
- let s = !0, m = !1;
442
+ _(), k();
443
+ let f = !0, r = !1;
443
444
  for (; n.getToken() !== 4 && n.getToken() !== 17; ) {
444
445
  if (n.getToken() === 5) {
445
- if (m || u(4, [], []), N(","), k(), n.getToken() === 4 && v)
446
+ if (r || u(4, [], []), N(","), k(), n.getToken() === 4 && T)
446
447
  break;
447
- } else m && u(6, [], []);
448
- s ? (t.push(0), s = !1) : t[t.length - 1]++, F() || u(4, [], [
448
+ } else r && u(6, [], []);
449
+ f ? (i.push(0), f = !1) : i[i.length - 1]++, $() || u(4, [], [
449
450
  4,
450
451
  5
451
452
  /* SyntaxKind.CommaToken */
452
- ]), m = !0;
453
+ ]), r = !0;
453
454
  }
454
- return L(), s || t.pop(), n.getToken() !== 4 ? u(8, [
455
+ return L(), f || i.pop(), n.getToken() !== 4 ? u(8, [
455
456
  4
456
457
  /* SyntaxKind.CloseBracketToken */
457
458
  ], []) : k(), !0;
458
459
  }
459
- function F() {
460
+ function $() {
460
461
  switch (n.getToken()) {
461
462
  case 3:
462
463
  return K();
463
464
  case 1:
464
- return h();
465
+ return x();
465
466
  case 10:
466
467
  return G(!0);
467
468
  default:
468
- return S();
469
+ return P();
469
470
  }
470
471
  }
471
- return k(), n.getToken() === 17 ? c.allowEmptyContent ? !0 : (u(4, [], []), !1) : F() ? (n.getToken() !== 17 && u(9, [], []), !0) : (u(4, [], []), !1);
472
+ return k(), n.getToken() === 17 ? c.allowEmptyContent ? !0 : (u(4, [], []), !1) : $() ? (n.getToken() !== 17 && u(9, [], []), !0) : (u(4, [], []), !1);
472
473
  }
473
474
  var z;
474
475
  (function(e) {
@@ -478,18 +479,21 @@ var M;
478
479
  (function(e) {
479
480
  e[e.OpenBraceToken = 1] = "OpenBraceToken", e[e.CloseBraceToken = 2] = "CloseBraceToken", e[e.OpenBracketToken = 3] = "OpenBracketToken", e[e.CloseBracketToken = 4] = "CloseBracketToken", e[e.CommaToken = 5] = "CommaToken", e[e.ColonToken = 6] = "ColonToken", e[e.NullKeyword = 7] = "NullKeyword", e[e.TrueKeyword = 8] = "TrueKeyword", e[e.FalseKeyword = 9] = "FalseKeyword", e[e.StringLiteral = 10] = "StringLiteral", e[e.NumericLiteral = 11] = "NumericLiteral", e[e.LineCommentTrivia = 12] = "LineCommentTrivia", e[e.BlockCommentTrivia = 13] = "BlockCommentTrivia", e[e.LineBreakTrivia = 14] = "LineBreakTrivia", e[e.Trivia = 15] = "Trivia", e[e.Unknown = 16] = "Unknown", e[e.EOF = 17] = "EOF";
480
481
  })(M || (M = {}));
481
- const ae = re;
482
- var X;
482
+ const ve = be;
483
+ var Z;
483
484
  (function(e) {
484
485
  e[e.InvalidSymbol = 1] = "InvalidSymbol", e[e.InvalidNumberFormat = 2] = "InvalidNumberFormat", e[e.PropertyNameExpected = 3] = "PropertyNameExpected", e[e.ValueExpected = 4] = "ValueExpected", e[e.ColonExpected = 5] = "ColonExpected", e[e.CommaExpected = 6] = "CommaExpected", e[e.CloseBraceExpected = 7] = "CloseBraceExpected", e[e.CloseBracketExpected = 8] = "CloseBracketExpected", e[e.EndOfFileExpected = 9] = "EndOfFileExpected", e[e.InvalidCommentToken = 10] = "InvalidCommentToken", e[e.UnexpectedEndOfComment = 11] = "UnexpectedEndOfComment", e[e.UnexpectedEndOfString = 12] = "UnexpectedEndOfString", e[e.UnexpectedEndOfNumber = 13] = "UnexpectedEndOfNumber", e[e.InvalidUnicode = 14] = "InvalidUnicode", e[e.InvalidEscapeCharacter = 15] = "InvalidEscapeCharacter", e[e.InvalidCharacter = 16] = "InvalidCharacter";
485
- })(X || (X = {}));
486
- const be = {
486
+ })(Z || (Z = {}));
487
+ const we = {
487
488
  key: 0,
488
489
  class: "vfp-renderer-loading"
489
- }, Te = { class: "vfp-renderer-loading-content" }, ve = { class: "vfp-renderer-loading-text" }, we = {
490
- key: 2,
490
+ }, ye = { class: "vfp-renderer-loading-content" }, Oe = { class: "vfp-renderer-loading-text" }, _e = {
491
+ key: 3,
492
+ class: "vfp-w-full vfp-h-full vfp-bg-code-bg"
493
+ }, Ae = {
494
+ key: 4,
491
495
  class: "vfp-w-full vfp-h-full vfp-overflow-auto vfp-bg-code-bg vfp-py-6 vfp-px-4"
492
- }, Oe = J({ name: "JsonRenderer" }), ye = {
496
+ }, Le = J({ name: "JsonRenderer" }), Be = {
493
497
  key: "#9cdcfe",
494
498
  string: "#ce9178",
495
499
  number: "#b5cea8",
@@ -498,7 +502,7 @@ const be = {
498
502
  colon: "rgb(255 255 255 / 0.6)",
499
503
  collapsed: "rgb(255 255 255 / 0.4)",
500
504
  arrow: "rgb(255 255 255 / 0.5)"
501
- }, Ae = {
505
+ }, Ne = {
502
506
  key: "#005cc5",
503
507
  string: "#032f62",
504
508
  number: "#005cc5",
@@ -508,23 +512,23 @@ const be = {
508
512
  collapsed: "rgb(23 23 23 / 0.45)",
509
513
  arrow: "rgb(23 23 23 / 0.55)"
510
514
  };
511
- function _e(e) {
512
- return e === "light" ? Ae : ye;
515
+ function je(e) {
516
+ return e === "light" ? Ne : Be;
513
517
  }
514
- function Le(e, o) {
518
+ function Ee(e, o) {
515
519
  return e === null ? g("span", { class: "json-null", style: { color: o.keyword } }, "null") : e === void 0 ? g("span", { class: "json-null", style: { color: o.keyword } }, "undefined") : typeof e == "boolean" ? g("span", { style: { color: o.keyword } }, String(e)) : typeof e == "number" ? g("span", { style: { color: o.number } }, String(e)) : typeof e == "string" ? g("span", { style: { color: o.string } }, `"${e}"`) : g("span", { style: { color: o.bracket } }, String(e));
516
520
  }
517
- function Z(e, o, c, n, t) {
521
+ function S(e, o, c, n, i) {
518
522
  return g("div", { class: "json-row", style: { paddingLeft: `${c}px` } }, [
519
523
  g("span", { class: "json-arrow-placeholder" }),
520
524
  e !== void 0 ? g("span", { class: "json-key", style: { color: n.key } }, [
521
525
  `"${e}"`,
522
526
  g("span", { style: { color: n.colon } }, ": ")
523
527
  ]) : null,
524
- t ? g("span", { style: { color: n.bracket } }, t) : Le(o, n)
528
+ i ? g("span", { style: { color: n.bracket } }, i) : Ee(o, n)
525
529
  ]);
526
530
  }
527
- const D = J({
531
+ const H = J({
528
532
  name: "JsonNode",
529
533
  props: {
530
534
  keyName: { type: String, default: void 0 },
@@ -535,81 +539,82 @@ const D = J({
535
539
  setup(e) {
536
540
  const o = U(e.defaultExpanded), c = () => {
537
541
  o.value = !o.value;
538
- }, n = le(oe, null), t = W(() => (n == null ? void 0 : n.t.value) ?? fe({ locale: "en-US" })), f = se(), i = W(() => _e(f.value));
539
- return { expanded: o, toggle: c, tFunc: t, colors: i };
542
+ }, n = le(fe, null), i = X(() => (n == null ? void 0 : n.t.value) ?? ce({ locale: "en-US" })), s = pe(), t = X(() => je(s.value));
543
+ return { expanded: o, toggle: c, tFunc: i, colors: t };
540
544
  },
541
545
  render() {
542
- const { keyName: e, value: o, depth: c, expanded: n, toggle: t, tFunc: f, colors: i } = this, a = c * 20;
546
+ const { keyName: e, value: o, depth: c, expanded: n, toggle: i, tFunc: s, colors: t } = this, m = c * 20;
543
547
  if (o == null || typeof o != "object")
544
- return Z(e, o, a, i);
545
- const p = Array.isArray(o), b = (p ? o : Object.entries(o)).length, r = p ? "[" : "{", _ = p ? "]" : "}";
546
- if (b === 0)
547
- return Z(e, null, a, i, `${r}${_}`);
548
- const O = [];
549
- return O.push(
548
+ return S(e, o, m, t);
549
+ const p = Array.isArray(o), w = (p ? o : Object.entries(o)).length, a = p ? "[" : "{", v = p ? "]" : "}";
550
+ if (w === 0)
551
+ return S(e, null, m, t, `${a}${v}`);
552
+ const y = [];
553
+ return y.push(
550
554
  g("div", {
551
555
  class: "json-row json-toggle",
552
- style: { paddingLeft: `${a}px` },
553
- onClick: t
556
+ style: { paddingLeft: `${m}px` },
557
+ onClick: i
554
558
  }, [
555
- g("span", { class: "json-arrow", style: { color: i.arrow } }, [
556
- g(n ? pe : ke, { class: "vfp-w-3.5 vfp-h-3.5" })
559
+ g("span", { class: "json-arrow", style: { color: t.arrow } }, [
560
+ g(n ? re : ae, { class: "vfp-w-3.5 vfp-h-3.5" })
557
561
  ]),
558
- e !== void 0 ? g("span", { class: "json-key", style: { color: i.key } }, [
562
+ e !== void 0 ? g("span", { class: "json-key", style: { color: t.key } }, [
559
563
  `"${e}"`,
560
- g("span", { style: { color: i.colon } }, ": ")
564
+ g("span", { style: { color: t.colon } }, ": ")
561
565
  ]) : null,
562
- g("span", { style: { color: i.bracket } }, r),
563
- n ? null : g("span", { class: "json-collapsed", style: { color: i.collapsed } }, [
564
- p ? `${b} ${f("json.items")}` : `${b} ${f("json.keys")}`,
565
- g("span", { style: { color: i.bracket } }, ` ${_}`)
566
+ g("span", { style: { color: t.bracket } }, a),
567
+ n ? null : g("span", { class: "json-collapsed", style: { color: t.collapsed } }, [
568
+ p ? `${w} ${s("json.items")}` : `${w} ${s("json.keys")}`,
569
+ g("span", { style: { color: t.bracket } }, ` ${v}`)
566
570
  ])
567
571
  ])
568
- ), n && (p ? o.forEach((y, L) => {
569
- O.push(
570
- g(D, { key: L, value: y, depth: c + 1, defaultExpanded: c < 1 })
572
+ ), n && (p ? o.forEach((_, L) => {
573
+ y.push(
574
+ g(H, { key: L, value: _, depth: c + 1, defaultExpanded: c < 1 })
571
575
  );
572
- }) : Object.entries(o).forEach(([y, L]) => {
573
- O.push(
574
- g(D, { key: y, keyName: y, value: L, depth: c + 1, defaultExpanded: c < 1 })
576
+ }) : Object.entries(o).forEach(([_, L]) => {
577
+ y.push(
578
+ g(H, { key: _, keyName: _, value: L, depth: c + 1, defaultExpanded: c < 1 })
575
579
  );
576
- }), O.push(
577
- g("div", { class: "json-row", style: { paddingLeft: `${a + 20}px` } }, [
578
- g("span", { style: { color: i.bracket } }, _)
580
+ }), y.push(
581
+ g("div", { class: "json-row", style: { paddingLeft: `${m + 20}px` } }, [
582
+ g("span", { style: { color: t.bracket } }, v)
579
583
  ])
580
- )), g("div", null, O);
584
+ )), g("div", null, y);
581
585
  }
582
- }), Ue = /* @__PURE__ */ J({
583
- ...Oe,
586
+ }), de = /* @__PURE__ */ J({
587
+ ...Le,
584
588
  props: {
585
589
  url: {},
586
- fileName: {}
590
+ fileName: {},
591
+ emptyHint: {}
587
592
  },
588
593
  setup(e, { expose: o }) {
589
- const c = e, { t: n } = te(), t = ie(), f = U(null), i = U(!0), a = U(null);
590
- return x(() => c.url, async () => {
591
- i.value = !0, a.value = null;
594
+ const c = e, { t: n } = te(), i = ie(), s = U(null), t = U(!1), m = U(!0), p = U(null), O = () => ue(c.emptyHint, "textual");
595
+ return C(() => c.url, async () => {
596
+ m.value = !0, p.value = null;
592
597
  try {
593
- const b = await ue(c.url, { fetcher: t.value });
594
- f.value = ae(b);
595
- } catch (b) {
596
- console.error(b), a.value = n.value("json.load_failed");
598
+ const v = await oe(c.url, { fetcher: i.value });
599
+ t.value = se(v), s.value = t.value ? null : ve(v);
600
+ } catch (v) {
601
+ console.error(v), p.value = n.value("json.load_failed");
597
602
  } finally {
598
- i.value = !1;
603
+ m.value = !1;
599
604
  }
600
605
  }, { immediate: !0 }), o({
601
606
  getToolbarGroups: () => []
602
- }), (b, r) => i.value ? ($(), H("div", be, [
603
- d("div", Te, [
604
- r[0] || (r[0] = d("div", { class: "vfp-renderer-spinner" }, null, -1)),
605
- d("span", ve, C(Q(n)("common.loading")), 1)
607
+ }), (v, y) => m.value ? (j(), d("div", we, [
608
+ R("div", ye, [
609
+ y[0] || (y[0] = R("div", { class: "vfp-renderer-spinner" }, null, -1)),
610
+ R("span", Oe, ee(Q(n)("common.loading")), 1)
606
611
  ])
607
- ])) : a.value ? ($(), ee(ce, {
612
+ ])) : p.value ? (j(), W(ke, {
608
613
  key: 1,
609
- message: a.value
610
- }, null, 8, ["message"])) : ($(), H("div", we, [
611
- ne(Q(D), {
612
- value: f.value,
614
+ message: p.value
615
+ }, null, 8, ["message"])) : t.value && O() ? (j(), W(ge, { key: 2 })) : t.value ? (j(), d("div", _e)) : (j(), d("div", Ae, [
616
+ ne(Q(H), {
617
+ value: s.value,
613
618
  depth: 0,
614
619
  "default-expanded": !0
615
620
  }, null, 8, ["value"])
@@ -617,5 +622,5 @@ const D = J({
617
622
  }
618
623
  });
619
624
  export {
620
- Ue as default
625
+ de as default
621
626
  };