lone-format 0.14.0 → 0.15.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,7 +1,7 @@
1
- import { defineComponent as H, computed as q, resolveComponent as Q, createElementBlock as S, openBlock as N, createElementVNode as _, createCommentVNode as G, normalizeClass as $, Fragment as A, renderList as P, createBlock as W, useCssVars as z, ref as R, watch as V, toDisplayString as Y } from "vue";
2
- import { format as D } from "sql-formatter";
3
- import { _ as F } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- const X = {
1
+ import { defineComponent as H, computed as _, resolveComponent as z, createElementBlock as N, openBlock as C, createElementVNode as q, createCommentVNode as Y, normalizeClass as $, Fragment as U, renderList as D, createBlock as W, useCssVars as X, ref as R, watch as P, toDisplayString as Z } from "vue";
2
+ import { format as F, supportedDialects as ee } from "sql-formatter";
3
+ import { _ as K } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ const te = {
5
5
  name: "github-light",
6
6
  colors: {
7
7
  // 背景色
@@ -51,7 +51,7 @@ const X = {
51
51
  indentLine: "#d0d7de"
52
52
  // 对齐线 - 灰色
53
53
  }
54
- }, Z = {
54
+ }, se = {
55
55
  name: "github-dark",
56
56
  colors: {
57
57
  // 背景色
@@ -101,7 +101,7 @@ const X = {
101
101
  indentLine: "#30363d"
102
102
  // 对齐线 - 灰色
103
103
  }
104
- }, ee = {
104
+ }, ne = {
105
105
  name: "min-light",
106
106
  colors: {
107
107
  // 背景色 - 纯白简洁
@@ -151,7 +151,7 @@ const X = {
151
151
  indentLine: "#e5e7eb"
152
152
  // 对齐线 - 灰色
153
153
  }
154
- }, te = {
154
+ }, re = {
155
155
  name: "slack-ochin",
156
156
  colors: {
157
157
  // 背景色
@@ -202,11 +202,11 @@ const X = {
202
202
  // 对齐线 - 灰色
203
203
  }
204
204
  }, M = {
205
- "github-light": X,
206
- "github-dark": Z,
207
- "min-light": ee,
208
- "slack-ochin": te
209
- }, se = (o) => M[o] || M["github-light"], K = [
205
+ "github-light": te,
206
+ "github-dark": se,
207
+ "min-light": ne,
208
+ "slack-ochin": re
209
+ }, le = (o) => M[o] || M["github-light"], j = [
210
210
  "SELECT",
211
211
  "FROM",
212
212
  "WHERE",
@@ -254,7 +254,7 @@ const X = {
254
254
  "THEN",
255
255
  "ELSE",
256
256
  "END"
257
- ], ne = [
257
+ ], oe = [
258
258
  "WITH",
259
259
  "SELECT",
260
260
  "FROM",
@@ -281,321 +281,299 @@ const X = {
281
281
  "UNION",
282
282
  "INTERSECT",
283
283
  "EXCEPT"
284
- ], re = (o) => {
284
+ ], A = "sql", ae = new Set(ee), Q = (o = A) => {
285
+ const t = String(o).trim().toLowerCase();
286
+ if (!ae.has(t))
287
+ throw new Error(`Unsupported SQL dialect: ${o}`);
288
+ return t;
289
+ }, ce = (o, t = A) => {
285
290
  try {
286
291
  if (!o || !o.trim())
287
292
  return { valid: !1, error: "SQL string is empty" };
288
- const s = o.toUpperCase().trim();
289
- if (!K.some((t) => new RegExp(`\\b${t}\\b`).test(s)))
293
+ const e = o.toUpperCase().trim();
294
+ if (!j.some((h) => new RegExp(`\\b${h}\\b`).test(e)))
290
295
  return { valid: !1, error: "No valid SQL keywords found" };
291
- let d = 0, n = !1, u = "";
292
- for (let t = 0; t < o.length; t++) {
293
- const i = o[t], m = t > 0 ? o[t - 1] : "";
294
- if ((i === "'" || i === '"') && m !== "\\" && (n ? i === u && (n = !1, u = "") : (n = !0, u = i)), !n && (i === "(" && d++, i === ")" && d--, d < 0))
296
+ let s = 0, u = !1, n = "";
297
+ for (let h = 0; h < o.length; h++) {
298
+ const r = o[h], d = h > 0 ? o[h - 1] : "";
299
+ if ((r === "'" || r === '"') && d !== "\\" && (u ? r === n && (u = !1, n = "") : (u = !0, n = r)), !u && (r === "(" && s++, r === ")" && s--, s < 0))
295
300
  return { valid: !1, error: "Mismatched parentheses: unexpected closing parenthesis" };
296
301
  }
297
- if (d !== 0)
298
- return { valid: !1, error: `Mismatched parentheses: ${d} unclosed opening parenthesis` };
299
- try {
300
- return D(o, { language: "sql" }), { valid: !0 };
301
- } catch (t) {
302
- return {
303
- valid: !1,
304
- error: t instanceof Error ? t.message : "SQL syntax error"
305
- };
306
- }
307
- } catch (s) {
302
+ if (s !== 0)
303
+ return { valid: !1, error: `Mismatched parentheses: ${s} unclosed opening parenthesis` };
304
+ const i = Q(t);
305
+ return F(o, { language: i }), { valid: !0 };
306
+ } catch (e) {
308
307
  return {
309
308
  valid: !1,
310
- error: s instanceof Error ? s.message : "Unknown validation error"
309
+ error: e instanceof Error ? e.message : "Unknown validation error"
311
310
  };
312
311
  }
313
- }, le = (o, s) => {
312
+ }, ie = (o, t) => {
314
313
  const e = o.match(/\bVALUES\s*/i);
315
314
  if (!e || e.index === void 0) return o;
316
- const d = o.slice(0, e.index + e[0].length), n = o.slice(e.index + e[0].length), u = [];
317
- let t = 0, i = "", m = !1, r = "", f = 0;
318
- for (; f < n.length; ) {
319
- const l = n[f], y = f > 0 ? n[f - 1] : "";
320
- if ((l === "'" || l === '"') && y !== "\\" && (m ? l === r && (m = !1) : (m = !0, r = l)), m)
321
- t > 0 && (i += l);
315
+ const f = o.slice(0, e.index + e[0].length), s = o.slice(e.index + e[0].length), u = [];
316
+ let n = 0, i = "", h = !1, r = "", d = 0;
317
+ for (; d < s.length; ) {
318
+ const l = s[d], E = d > 0 ? s[d - 1] : "";
319
+ if ((l === "'" || l === '"') && E !== "\\" && (h ? l === r && (h = !1) : (h = !0, r = l)), h)
320
+ n > 0 && (i += l);
322
321
  else if (l === "(")
323
- t === 0 ? i = l : i += l, t++;
322
+ n === 0 ? i = l : i += l, n++;
324
323
  else if (l === ")")
325
- i += l, t--, t === 0 && i.trim() && (u.push(i.trim()), i = "");
324
+ i += l, n--, n === 0 && i.trim() && (u.push(i.trim()), i = "");
326
325
  else {
327
- if (l === ";" && t === 0)
326
+ if (l === ";" && n === 0)
328
327
  break;
329
- t > 0 && (i += l);
328
+ n > 0 && (i += l);
330
329
  }
331
- f++;
330
+ d++;
332
331
  }
333
332
  if (u.length === 0)
334
333
  return o;
335
- const g = " ".repeat(s), v = u.map((l) => {
336
- const y = l.slice(1, -1), E = [];
337
- let T = "", I = 0, O = !1, x = "";
338
- for (let c = 0; c < y.length; c++) {
339
- const b = y[c], k = c > 0 ? y[c - 1] : "";
340
- if ((b === "'" || b === '"') && k !== "\\" && (O ? b === x && (O = !1) : (O = !0, x = b)), !O && (b === "(" && I++, b === ")" && I--, b === "," && I === 0)) {
341
- E.push(T.trim()), T = "";
334
+ const g = " ".repeat(t), v = u.map((l) => {
335
+ const E = l.slice(1, -1), y = [];
336
+ let S = "", I = 0, L = !1, x = "";
337
+ for (let c = 0; c < E.length; c++) {
338
+ const b = E[c], k = c > 0 ? E[c - 1] : "";
339
+ if ((b === "'" || b === '"') && k !== "\\" && (L ? b === x && (L = !1) : (L = !0, x = b)), !L && (b === "(" && I++, b === ")" && I--, b === "," && I === 0)) {
340
+ y.push(S.trim()), S = "";
342
341
  continue;
343
342
  }
344
- T += b;
343
+ S += b;
345
344
  }
346
- T.trim() && E.push(T.trim());
347
- const L = E.map((c, b) => {
348
- const k = b < E.length - 1 ? "," : "";
345
+ S.trim() && y.push(S.trim());
346
+ const O = y.map((c, b) => {
347
+ const k = b < y.length - 1 ? "," : "";
349
348
  return `${g}${g}${c}${k}`;
350
349
  }).join(`
351
350
  `);
352
351
  return `${g}(
353
- ${L}
352
+ ${O}
354
353
  ${g})`;
355
- }), h = v.map((l, y) => {
356
- const E = y < v.length - 1 ? "," : ";";
357
- return l + E;
354
+ }), m = v.map((l, E) => {
355
+ const y = E < v.length - 1 ? "," : ";";
356
+ return l + y;
358
357
  }).join(`
359
358
  `);
360
- let a = f;
361
- a < n.length && n[a] === ";" && a++;
362
- const p = n.slice(a);
363
- return d.trimEnd() + `
364
- ` + h + p;
365
- }, U = (o, s) => {
359
+ let a = d;
360
+ a < s.length && s[a] === ";" && a++;
361
+ const p = s.slice(a);
362
+ return f.trimEnd() + `
363
+ ` + m + p;
364
+ }, V = (o, t) => {
366
365
  try {
367
- const e = s?.dialect || "sql", d = s?.tabWidth || 2, n = s?.keywordCase || "upper", u = s?.useTabs || !1, t = s?.linesBetweenQueries || 1, m = {
368
- sql: "sql",
369
- mysql: "mysql",
370
- postgresql: "postgresql",
371
- sqlite: "sqlite",
372
- plsql: "plsql",
373
- tsql: "tsql"
374
- }[e] || "sql";
375
- let r = D(o, {
376
- language: m,
377
- tabWidth: d,
378
- keywordCase: n,
366
+ const e = Q(t?.dialect ?? A), f = t?.tabWidth || 2, s = t?.keywordCase || "upper", u = t?.useTabs || !1, n = t?.linesBetweenQueries || 1;
367
+ let i = F(o, {
368
+ language: e,
369
+ tabWidth: f,
370
+ keywordCase: s,
379
371
  useTabs: u,
380
- linesBetweenQueries: t,
372
+ linesBetweenQueries: n,
381
373
  // 其他默认配置
382
374
  indentStyle: "standard"
383
375
  });
384
- return /\bINSERT\s+INTO\b/i.test(r) && /\bVALUES\b/i.test(r) && (r = le(r, d)), r;
376
+ return /\bINSERT\s+INTO\b/i.test(i) && /\bVALUES\b/i.test(i) && (i = ie(i, f)), i;
385
377
  } catch (e) {
386
- return console.error("SQL formatting error:", e), o;
378
+ const f = e instanceof Error ? e.message : "Unknown formatting error";
379
+ throw new Error(`SQL formatting error: ${f}`);
387
380
  }
388
- }, oe = (o) => {
381
+ }, ue = (o) => {
389
382
  try {
390
- const s = [];
391
- let e = o.replace(/(["'])(?:(?=(\\?))\2.)*?\1/g, (d) => (s.push(d), `__STR_${s.length - 1}__`));
392
- return e = e.replace(/--[^\n]*/g, "").replace(/\/\*[\s\S]*?\*\//g, ""), e = e.replace(/\s+/g, " ").trim(), s.forEach((d, n) => {
393
- e = e.replace(`__STR_${n}__`, d);
383
+ const t = [];
384
+ let e = o.replace(/(["'])(?:(?=(\\?))\2.)*?\1/g, (f) => (t.push(f), `__STR_${t.length - 1}__`));
385
+ return e = e.replace(/--[^\n]*/g, "").replace(/\/\*[\s\S]*?\*\//g, ""), e = e.replace(/\s+/g, " ").trim(), t.forEach((f, s) => {
386
+ e = e.replace(`__STR_${s}__`, f);
394
387
  }), e;
395
- } catch (s) {
396
- return console.error("SQL compression error:", s), o;
388
+ } catch (t) {
389
+ return console.error("SQL compression error:", t), o;
397
390
  }
398
- }, ae = (o, s) => {
399
- const e = [], d = o.match(/^(.*?\bVALUES\b)/is);
400
- if (!d) return [];
401
- const n = d[1].trim();
391
+ }, de = (o, t) => {
392
+ const e = [], f = o.match(/^(.*?\bVALUES\b)/is);
393
+ if (!f) return [];
394
+ const s = f[1].trim();
402
395
  e.push({
403
396
  type: "VALUES",
404
- content: n,
405
- raw: n,
397
+ content: s,
398
+ raw: s,
406
399
  collapsible: !1,
407
- path: `clause-${s}`
400
+ path: `clause-${t}`
408
401
  });
409
- let t = o.slice(d[1].length).trim(), i = 0, m = 0, r = "", f = !1, g = "";
410
- for (let v = 0; v < t.length; v++) {
411
- const h = t[v], a = v > 0 ? t[v - 1] : "";
412
- if ((h === "'" || h === '"') && a !== "\\" && (f ? h === g && (f = !1) : (f = !0, g = h)), f)
413
- m > 0 && (r += h);
414
- else if (h === "(" && m === 0)
415
- m++, r = h;
416
- else if (h === "(")
417
- m++, r += h;
418
- else if (h === ")") {
419
- if (r += h, m--, m === 0) {
402
+ let n = o.slice(f[1].length).trim(), i = 0, h = 0, r = "", d = !1, g = "";
403
+ for (let v = 0; v < n.length; v++) {
404
+ const m = n[v], a = v > 0 ? n[v - 1] : "";
405
+ if ((m === "'" || m === '"') && a !== "\\" && (d ? m === g && (d = !1) : (d = !0, g = m)), d)
406
+ h > 0 && (r += m);
407
+ else if (m === "(" && h === 0)
408
+ h++, r = m;
409
+ else if (m === "(")
410
+ h++, r += m;
411
+ else if (m === ")") {
412
+ if (r += m, h--, h === 0) {
420
413
  let p = v + 1, l = "";
421
- for (; p < t.length; ) {
422
- const E = t[p];
423
- if (E === "," || E === ";") {
424
- l = E;
414
+ for (; p < n.length; ) {
415
+ const y = n[p];
416
+ if (y === "," || y === ";") {
417
+ l = y;
425
418
  break;
426
- } else if (!/\s/.test(E))
419
+ } else if (!/\s/.test(y))
427
420
  break;
428
421
  p++;
429
422
  }
430
- const y = r.trim();
431
- y && (e.push({
423
+ const E = r.trim();
424
+ E && (e.push({
432
425
  type: "VALUE_TUPLE",
433
- content: y + l,
434
- raw: y + l,
426
+ content: E + l,
427
+ raw: E + l,
435
428
  collapsible: !0,
436
- path: `clause-${s}-value-${i}`
429
+ path: `clause-${t}-value-${i}`
437
430
  }), i++), r = "", l && (v = p);
438
431
  }
439
- } else m > 0 && (r += h);
432
+ } else h > 0 && (r += m);
440
433
  }
441
434
  return e;
442
- }, ce = (o, s) => /\n\s*ON\b/i.test(s) ? s : s.replace(
435
+ }, fe = (o, t) => /\n\s*ON\b/i.test(t) ? t : t.replace(
443
436
  /^(\s*)((?:INNER|LEFT|RIGHT|FULL|CROSS|OUTER)?\s*JOIN\b[^\n]*?)\s+ON\b\s*/gim,
444
437
  `$1$2
445
438
  $1ON `
446
- ), ie = (o) => {
447
- let s = 0, e = !1, d = "";
448
- for (let n = 0; n < o.length; n++) {
449
- const u = o[n], t = n > 0 ? o[n - 1] : "";
450
- if ((u === "'" || u === '"') && t !== "\\") {
451
- e ? u === d && (e = !1, d = "") : (e = !0, d = u);
439
+ ), pe = (o) => {
440
+ let t = 0, e = !1, f = "";
441
+ for (let s = 0; s < o.length; s++) {
442
+ const u = o[s], n = s > 0 ? o[s - 1] : "";
443
+ if ((u === "'" || u === '"') && n !== "\\") {
444
+ e ? u === f && (e = !1, f = "") : (e = !0, f = u);
452
445
  continue;
453
446
  }
454
- e || (u === "(" && s++, u === ")" && s--);
447
+ e || (u === "(" && t++, u === ")" && t--);
455
448
  }
456
- return s;
457
- }, ue = (o) => {
458
- const s = [];
459
- let e = 0, d = -1, n = !1, u = "";
460
- for (let t = 0; t < o.length; t++) {
461
- const i = o[t], m = t > 0 ? o[t - 1] : "";
462
- if ((i === "'" || i === '"') && m !== "\\") {
463
- n ? i === u && (n = !1, u = "") : (n = !0, u = i);
449
+ return t;
450
+ }, he = (o) => {
451
+ const t = [];
452
+ let e = 0, f = -1, s = !1, u = "";
453
+ for (let n = 0; n < o.length; n++) {
454
+ const i = o[n], h = n > 0 ? o[n - 1] : "";
455
+ if ((i === "'" || i === '"') && h !== "\\") {
456
+ s ? i === u && (s = !1, u = "") : (s = !0, u = i);
464
457
  continue;
465
458
  }
466
- n || (i === "(" ? (e === 0 && (d = t), e++) : i === ")" && (e--, e === 0 && d >= 0 && (s.push({ open: d, close: t }), d = -1)));
459
+ s || (i === "(" ? (e === 0 && (f = n), e++) : i === ")" && (e--, e === 0 && f >= 0 && (t.push({ open: f, close: n }), f = -1)));
467
460
  }
468
- return s;
469
- }, de = (o) => {
470
- const s = o.trim();
471
- return s ? /^(SELECT|WITH)\b/i.test(s) ? !0 : /\n\s*(SELECT|FROM|WHERE|JOIN|UNION|INTERSECT|EXCEPT)\b/i.test(o) : !1;
472
- }, fe = (o) => {
473
- const s = o.content.split(`
461
+ return t;
462
+ }, me = (o) => {
463
+ const t = o.trim();
464
+ return t ? /^(SELECT|WITH)\b/i.test(t) ? !0 : /\n\s*(SELECT|FROM|WHERE|JOIN|UNION|INTERSECT|EXCEPT)\b/i.test(o) : !1;
465
+ }, ge = (o) => {
466
+ const t = o.content.split(`
474
467
  `);
475
468
  let e = -1;
476
- for (let r = 0; r < s.length; r++)
477
- if (s[r].trim()) {
469
+ for (let r = 0; r < t.length; r++)
470
+ if (t[r].trim()) {
478
471
  e = r;
479
472
  break;
480
473
  }
481
474
  if (e < 0) return;
482
- const d = s.slice(e + 1).join(`
475
+ const f = t.slice(e + 1).join(`
483
476
  `);
484
- if (!d) return;
485
- const u = ue(d).filter(
486
- (r) => de(d.slice(r.open + 1, r.close))
477
+ if (!f) return;
478
+ const u = he(f).filter(
479
+ (r) => me(f.slice(r.open + 1, r.close))
487
480
  );
488
481
  if (u.length === 0) return;
489
- const t = [];
482
+ const n = [];
490
483
  let i = 0;
491
- const m = o.path || "clause";
492
- u.forEach((r, f) => {
493
- r.open + 1 > i && t.push({ kind: "text", text: d.slice(i, r.open + 1) });
494
- const g = d.lastIndexOf(`
495
- `, r.close - 1) + 1, v = g > r.open, h = v ? g - 1 : r.close, a = d.slice(r.open + 1, h), p = j(a, `${m}-sub${f}-`);
484
+ const h = o.path || "clause";
485
+ u.forEach((r, d) => {
486
+ r.open + 1 > i && n.push({ kind: "text", text: f.slice(i, r.open + 1) });
487
+ const g = f.lastIndexOf(`
488
+ `, r.close - 1) + 1, v = g > r.open, m = v ? g - 1 : r.close, a = f.slice(r.open + 1, m), p = J(a, `${h}-sub${d}-`);
496
489
  for (const l of p)
497
- t.push({ kind: "clause", clause: l });
490
+ n.push({ kind: "clause", clause: l });
498
491
  i = v ? g : r.close;
499
- }), i < d.length && t.push({ kind: "text", text: d.slice(i) }), o.body = t;
500
- }, j = (o, s) => {
501
- const e = [], d = o.split(`
492
+ }), i < f.length && n.push({ kind: "text", text: f.slice(i) }), o.body = n;
493
+ }, J = (o, t) => {
494
+ const e = [], f = o.split(`
502
495
  `);
503
- let n = null, u = [], t = [], i = 0;
504
- const m = [...ne].sort((f, g) => g.length - f.length), r = () => {
505
- if (!n || u.length === 0) return;
506
- let f = u.join(`
496
+ let s = null, u = [], n = [], i = 0;
497
+ const h = [...oe].sort((d, g) => g.length - d.length), r = () => {
498
+ if (!s || u.length === 0) return;
499
+ let d = u.join(`
507
500
  `);
508
- if (f = ce(n.type, f), n.content = f, n.raw = f, n.type === "INSERT INTO" && /\bVALUES\b/i.test(f)) {
509
- const g = f.match(/^(.*?\bINSERT\s+INTO\s+[^(]+\s*\([^)]+\))/is);
501
+ if (d = fe(s.type, d), s.content = d, s.raw = d, s.type === "INSERT INTO" && /\bVALUES\b/i.test(d)) {
502
+ const g = d.match(/^(.*?\bINSERT\s+INTO\s+[^(]+\s*\([^)]+\))/is);
510
503
  if (g) {
511
504
  const v = {
512
505
  type: "INSERT INTO",
513
506
  content: g[1].trim(),
514
507
  raw: g[1].trim(),
515
508
  collapsible: !0,
516
- path: `${s}clause-${e.length}`
509
+ path: `${t}clause-${e.length}`
517
510
  };
518
511
  e.push(v);
519
- const h = f.slice(g[1].length).trim(), a = e.length, p = ae(h, a);
512
+ const m = d.slice(g[1].length).trim(), a = e.length, p = de(m, a);
520
513
  for (let l = 0; l < p.length; l++)
521
- p[l].path = `${s}clause-${a + l}`;
514
+ p[l].path = `${t}clause-${a + l}`;
522
515
  e.push(...p);
523
516
  return;
524
517
  }
525
518
  }
526
- fe(n), e.push(n);
519
+ ge(s), e.push(s);
527
520
  };
528
- for (const f of d) {
529
- const g = f.trim();
521
+ for (const d of f) {
522
+ const g = d.trim();
530
523
  if (!g) {
531
- n && u.push(f);
524
+ s && u.push(d);
532
525
  continue;
533
526
  }
534
527
  if (g.startsWith("--") || g.startsWith("/*")) {
535
- n ? u.push(f) : t.push(f);
528
+ s ? u.push(d) : n.push(d);
536
529
  continue;
537
530
  }
538
- let h = !1, a = "UNKNOWN";
531
+ let m = !1, a = "UNKNOWN";
539
532
  if (i === 0) {
540
- for (const p of m)
533
+ for (const p of h)
541
534
  if (new RegExp(`^${p}\\b`, "i").test(g)) {
542
- h = !0, a = p.toUpperCase();
535
+ m = !0, a = p.toUpperCase();
543
536
  break;
544
537
  }
545
538
  }
546
- h ? (r(), t.length > 0 && (e.push({
539
+ m ? (r(), n.length > 0 && (e.push({
547
540
  type: "UNKNOWN",
548
- content: t.join(`
541
+ content: n.join(`
549
542
  `),
550
- raw: t.join(`
543
+ raw: n.join(`
551
544
  `),
552
545
  collapsible: !1,
553
- path: `${s}clause-${e.length}`
554
- }), t = []), u = [f], n = {
546
+ path: `${t}clause-${e.length}`
547
+ }), n = []), u = [d], s = {
555
548
  type: a,
556
549
  content: "",
557
550
  raw: "",
558
551
  collapsible: !0,
559
- path: `${s}clause-${e.length}`
560
- }) : n ? u.push(f) : (u = [...t, f], t = [], n = {
552
+ path: `${t}clause-${e.length}`
553
+ }) : s ? u.push(d) : (u = [...n, d], n = [], s = {
561
554
  type: "UNKNOWN",
562
555
  content: "",
563
556
  raw: "",
564
557
  collapsible: !1,
565
- path: `${s}clause-${e.length}`
566
- }), i = Math.max(0, i + ie(f));
558
+ path: `${t}clause-${e.length}`
559
+ }), i = Math.max(0, i + pe(d));
567
560
  }
568
- return r(), t.length > 0 && e.push({
561
+ return r(), n.length > 0 && e.push({
569
562
  type: "UNKNOWN",
570
- content: t.join(`
563
+ content: n.join(`
571
564
  `),
572
- raw: t.join(`
565
+ raw: n.join(`
573
566
  `),
574
567
  collapsible: !1,
575
- path: `${s}clause-${e.length}`
568
+ path: `${t}clause-${e.length}`
576
569
  }), e;
577
- }, pe = (o) => {
578
- try {
579
- const s = U(o, { keywordCase: "upper" });
580
- return { clauses: j(s, ""), raw: o };
581
- } catch {
582
- return {
583
- clauses: [
584
- {
585
- type: "UNKNOWN",
586
- content: o,
587
- raw: o,
588
- collapsible: !1,
589
- path: "clause-0"
590
- }
591
- ],
592
- raw: o
593
- };
594
- }
595
- }, J = (o) => {
596
- const s = [];
570
+ }, be = (o, t = A) => {
571
+ const e = V(o, { dialect: t, keywordCase: "upper" });
572
+ return { clauses: J(e, ""), raw: o };
573
+ }, G = (o) => {
574
+ const t = [];
597
575
  let e = o;
598
- const d = [
576
+ const f = [
599
577
  "COUNT",
600
578
  "SUM",
601
579
  "AVG",
@@ -619,59 +597,59 @@ $1ON `
619
597
  "ABS",
620
598
  "FLOOR",
621
599
  "CEIL"
622
- ], n = ["=", "!=", "<>", "<", ">", "<=", ">=", "+", "-", "*", "/", "%", "||"], u = ["(", ")", ",", ";", "."];
600
+ ], s = ["=", "!=", "<>", "<", ">", "<=", ">=", "+", "-", "*", "/", "%", "||"], u = ["(", ")", ",", ";", "."];
623
601
  for (; e.length > 0; ) {
624
- let t = !1;
602
+ let n = !1;
625
603
  const i = e.match(/^(\s+)/);
626
604
  if (i) {
627
- s.push({ type: "whitespace", value: i[1] }), e = e.slice(i[1].length);
605
+ t.push({ type: "whitespace", value: i[1] }), e = e.slice(i[1].length);
628
606
  continue;
629
607
  }
630
- const m = e.match(/^(--[^\n]*)/);
631
- if (m) {
632
- s.push({ type: "comment", value: m[1] }), e = e.slice(m[1].length);
608
+ const h = e.match(/^(--[^\n]*)/);
609
+ if (h) {
610
+ t.push({ type: "comment", value: h[1] }), e = e.slice(h[1].length);
633
611
  continue;
634
612
  }
635
613
  const r = e.match(/^(\/\*[\s\S]*?\*\/)/);
636
614
  if (r) {
637
- s.push({ type: "comment", value: r[1] }), e = e.slice(r[1].length);
615
+ t.push({ type: "comment", value: r[1] }), e = e.slice(r[1].length);
638
616
  continue;
639
617
  }
640
- const f = e.match(/^(["'])(?:(?=(\\?))\2.)*?\1/);
641
- if (f) {
642
- s.push({ type: "string", value: f[0] }), e = e.slice(f[0].length);
618
+ const d = e.match(/^(["'])(?:(?=(\\?))\2.)*?\1/);
619
+ if (d) {
620
+ t.push({ type: "string", value: d[0] }), e = e.slice(d[0].length);
643
621
  continue;
644
622
  }
645
623
  const g = e.match(/^(\d+\.?\d*|\.\d+)/);
646
624
  if (g) {
647
- s.push({ type: "number", value: g[1] }), e = e.slice(g[1].length);
625
+ t.push({ type: "number", value: g[1] }), e = e.slice(g[1].length);
648
626
  continue;
649
627
  }
650
- for (const h of n)
651
- if (e.startsWith(h)) {
652
- s.push({ type: "operator", value: h }), e = e.slice(h.length), t = !0;
628
+ for (const m of s)
629
+ if (e.startsWith(m)) {
630
+ t.push({ type: "operator", value: m }), e = e.slice(m.length), n = !0;
653
631
  break;
654
632
  }
655
- if (t) continue;
656
- for (const h of u)
657
- if (e.startsWith(h)) {
658
- s.push({ type: "punctuation", value: h }), e = e.slice(h.length), t = !0;
633
+ if (n) continue;
634
+ for (const m of u)
635
+ if (e.startsWith(m)) {
636
+ t.push({ type: "punctuation", value: m }), e = e.slice(m.length), n = !0;
659
637
  break;
660
638
  }
661
- if (t) continue;
639
+ if (n) continue;
662
640
  const v = e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)/);
663
641
  if (v) {
664
- const h = v[1], a = h.toUpperCase();
665
- K.includes(a) ? s.push({ type: "keyword", value: h }) : d.includes(a) ? s.push({ type: "function", value: h }) : s.push({ type: "identifier", value: h }), e = e.slice(h.length);
642
+ const m = v[1], a = m.toUpperCase();
643
+ j.includes(a) ? t.push({ type: "keyword", value: m }) : f.includes(a) ? t.push({ type: "function", value: m }) : t.push({ type: "identifier", value: m }), e = e.slice(m.length);
666
644
  continue;
667
645
  }
668
- s.push({ type: "punctuation", value: e[0] }), e = e.slice(1);
646
+ t.push({ type: "punctuation", value: e[0] }), e = e.slice(1);
669
647
  }
670
- return s;
671
- }, he = { class: "sql-clause-node" }, me = ["title"], ge = { class: "sql-clause-node__code" }, be = ["innerHTML"], ve = {
648
+ return t;
649
+ }, ve = { class: "sql-clause-node" }, Ee = ["title"], ye = { class: "sql-clause-node__code" }, ke = ["innerHTML"], Se = {
672
650
  key: 0,
673
651
  class: "sql-clause-node__body"
674
- }, ye = ["title"], Ee = ["innerHTML"], ke = ["title"], Te = ["innerHTML"], Ce = /* @__PURE__ */ H({
652
+ }, Te = ["title"], Ce = ["innerHTML"], Ne = ["title"], _e = ["innerHTML"], qe = /* @__PURE__ */ H({
675
653
  __name: "SqlClauseNode",
676
654
  props: {
677
655
  clause: {},
@@ -679,14 +657,14 @@ $1ON `
679
657
  theme: {}
680
658
  },
681
659
  emits: ["toggle"],
682
- setup(o, { emit: s }) {
683
- const e = o, d = s, n = q(() => e.clause.path || ""), u = q(() => e.expandedClauses.has(n.value)), t = q(() => {
660
+ setup(o, { emit: t }) {
661
+ const e = o, f = t, s = _(() => e.clause.path || ""), u = _(() => e.expandedClauses.has(s.value)), n = _(() => {
684
662
  const a = e.clause.content.split(`
685
663
  `);
686
664
  for (const p of a)
687
665
  if (p.trim()) return p;
688
666
  return "";
689
- }), i = q(() => {
667
+ }), i = _(() => {
690
668
  const a = e.clause.content.split(`
691
669
  `);
692
670
  if (a.length <= 1) return "";
@@ -698,43 +676,43 @@ $1ON `
698
676
  }
699
677
  return a.slice(p + 1).join(`
700
678
  `);
701
- }), m = q(() => e.clause.body && e.clause.body.length > 0 ? !0 : !!i.value), r = (a) => {
702
- const p = J(a), l = e.theme.colors;
703
- return p.map((y) => {
704
- let E = l.text;
705
- switch (y.type) {
679
+ }), h = _(() => e.clause.body && e.clause.body.length > 0 ? !0 : !!i.value), r = (a) => {
680
+ const p = G(a), l = e.theme.colors;
681
+ return p.map((E) => {
682
+ let y = l.text;
683
+ switch (E.type) {
706
684
  case "keyword":
707
- E = l.sqlKeyword;
685
+ y = l.sqlKeyword;
708
686
  break;
709
687
  case "function":
710
- E = l.sqlFunction;
688
+ y = l.sqlFunction;
711
689
  break;
712
690
  case "string":
713
- E = l.sqlString;
691
+ y = l.sqlString;
714
692
  break;
715
693
  case "number":
716
- E = l.sqlNumber;
694
+ y = l.sqlNumber;
717
695
  break;
718
696
  case "comment":
719
- E = l.sqlComment;
697
+ y = l.sqlComment;
720
698
  break;
721
699
  case "operator":
722
- E = l.sqlOperator;
700
+ y = l.sqlOperator;
723
701
  break;
724
702
  case "identifier":
725
- E = l.sqlIdentifier;
703
+ y = l.sqlIdentifier;
726
704
  break;
727
705
  case "punctuation":
728
- E = l.sqlPunctuation;
706
+ y = l.sqlPunctuation;
729
707
  break;
730
708
  case "whitespace":
731
- return y.value.replace(/ /g, "&nbsp;").replace(/\n/g, `
709
+ return E.value.replace(/ /g, "&nbsp;").replace(/\n/g, `
732
710
  `);
733
711
  }
734
- const T = y.value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
735
- return `<span style="color: ${E}">${T}</span>`;
712
+ const S = E.value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
713
+ return `<span style="color: ${y}">${S}</span>`;
736
714
  }).join("");
737
- }, f = q(() => {
715
+ }, d = _(() => {
738
716
  const a = e.clause.body;
739
717
  if (!a || a.length === 0) return null;
740
718
  let p = "", l = !1;
@@ -749,96 +727,96 @@ $1ON `
749
727
  } else
750
728
  return null;
751
729
  if (!l) return null;
752
- let y = "";
730
+ let E = "";
753
731
  for (let c = a.length - 1; c >= 0; c--) {
754
732
  const b = a[c];
755
733
  if (b.kind === "text") {
756
734
  const k = b.text.lastIndexOf(")");
757
735
  if (k >= 0) {
758
- y = b.text.slice(k + 1) + y;
736
+ E = b.text.slice(k + 1) + E;
759
737
  break;
760
738
  }
761
- y = b.text + y;
739
+ E = b.text + E;
762
740
  } else
763
741
  break;
764
742
  }
765
- const E = p.replace(/\s+/g, " ").trim(), T = y.replace(/\s+/g, " ").trim(), I = t.value, O = (I.match(/^\s*/) || [""])[0], L = [I.trimStart()];
766
- return E && L.push(E), L.push("(...)"), T && L.push(T), `${O}${L.join(" ")}`;
767
- }), g = q(() => {
768
- if (e.clause.collapsible && !u.value && m.value) {
769
- const a = f.value;
743
+ const y = p.replace(/\s+/g, " ").trim(), S = E.replace(/\s+/g, " ").trim(), I = n.value, L = (I.match(/^\s*/) || [""])[0], O = [I.trimStart()];
744
+ return y && O.push(y), O.push("(...)"), S && O.push(S), `${L}${O.join(" ")}`;
745
+ }), g = _(() => {
746
+ if (e.clause.collapsible && !u.value && h.value) {
747
+ const a = d.value;
770
748
  if (a)
771
749
  return r(a);
772
- const p = r(t.value), l = e.theme.colors.textSecondary;
750
+ const p = r(n.value), l = e.theme.colors.textSecondary;
773
751
  return `${p}<span style="color: ${l}; opacity: 0.6; font-style: italic; margin-left: 4px;"> ...</span>`;
774
752
  }
775
- return r(t.value);
753
+ return r(n.value);
776
754
  }), v = () => {
777
- e.clause.collapsible && d("toggle", n.value);
778
- }, h = (a) => {
755
+ e.clause.collapsible && f("toggle", s.value);
756
+ }, m = (a) => {
779
757
  if (!e.clause.collapsible) return;
780
758
  const p = a.target;
781
759
  if (!p) return;
782
760
  const l = (p.textContent || "").trim();
783
- (l === "(" || l === ")") && d("toggle", n.value);
761
+ (l === "(" || l === ")") && f("toggle", s.value);
784
762
  };
785
763
  return (a, p) => {
786
- const l = Q("SqlClauseNode", !0);
787
- return N(), S("div", he, [
788
- _("div", {
764
+ const l = z("SqlClauseNode", !0);
765
+ return C(), N("div", ve, [
766
+ q("div", {
789
767
  class: $(["sql-clause-node__header", { "sql-clause-node__header--collapsible": a.clause.collapsible }]),
790
768
  title: a.clause.collapsible ? u.value ? "Click to collapse" : "Click to expand" : "",
791
769
  onClick: v
792
770
  }, [
793
- _("pre", ge, [
794
- _("code", { innerHTML: g.value }, null, 8, be)
771
+ q("pre", ye, [
772
+ q("code", { innerHTML: g.value }, null, 8, ke)
795
773
  ])
796
- ], 10, me),
797
- u.value && m.value ? (N(), S("div", ve, [
798
- a.clause.body && a.clause.body.length > 0 ? (N(!0), S(A, { key: 0 }, P(a.clause.body, (y, E) => (N(), S(A, { key: E }, [
799
- y.kind === "text" ? (N(), S("pre", {
774
+ ], 10, Ee),
775
+ u.value && h.value ? (C(), N("div", Se, [
776
+ a.clause.body && a.clause.body.length > 0 ? (C(!0), N(U, { key: 0 }, D(a.clause.body, (E, y) => (C(), N(U, { key: y }, [
777
+ E.kind === "text" ? (C(), N("pre", {
800
778
  key: 0,
801
779
  class: $(["sql-clause-node__code sql-clause-node__text-segment", { "sql-clause-node__text-segment--clickable": a.clause.collapsible }]),
802
780
  title: a.clause.collapsible ? "Click ( or ) to collapse" : "",
803
- onClick: p[0] || (p[0] = (T) => h(T))
781
+ onClick: p[0] || (p[0] = (S) => m(S))
804
782
  }, [
805
- _("code", {
806
- innerHTML: r(y.text)
807
- }, null, 8, Ee)
808
- ], 10, ye)) : (N(), W(l, {
783
+ q("code", {
784
+ innerHTML: r(E.text)
785
+ }, null, 8, Ce)
786
+ ], 10, Te)) : (C(), W(l, {
809
787
  key: 1,
810
- clause: y.clause,
788
+ clause: E.clause,
811
789
  "expanded-clauses": a.expandedClauses,
812
790
  theme: a.theme,
813
- onToggle: p[1] || (p[1] = (T) => a.$emit("toggle", T))
791
+ onToggle: p[1] || (p[1] = (S) => a.$emit("toggle", S))
814
792
  }, null, 8, ["clause", "expanded-clauses", "theme"]))
815
- ], 64))), 128)) : (N(), S("pre", {
793
+ ], 64))), 128)) : (C(), N("pre", {
816
794
  key: 1,
817
795
  class: $(["sql-clause-node__code sql-clause-node__rest", { "sql-clause-node__rest--clickable": a.clause.collapsible }]),
818
796
  title: a.clause.collapsible ? "Click ( or ) to collapse" : "",
819
- onClick: p[2] || (p[2] = (y) => h(y))
797
+ onClick: p[2] || (p[2] = (E) => m(E))
820
798
  }, [
821
- _("code", {
799
+ q("code", {
822
800
  innerHTML: r(i.value)
823
- }, null, 8, Te)
824
- ], 10, ke))
825
- ])) : G("", !0)
801
+ }, null, 8, _e)
802
+ ], 10, Ne))
803
+ ])) : Y("", !0)
826
804
  ]);
827
805
  };
828
806
  }
829
- }), Ne = /* @__PURE__ */ F(Ce, [["__scopeId", "data-v-8b9383dc"]]), Se = { class: "sql-format__content" }, qe = {
807
+ }), Ie = /* @__PURE__ */ K(qe, [["__scopeId", "data-v-8b9383dc"]]), Le = { class: "sql-format__content" }, Oe = {
830
808
  key: 0,
831
809
  class: "sql-format__error"
832
- }, _e = {
810
+ }, xe = {
833
811
  key: 1,
834
812
  class: "sql-format__viewer"
835
- }, Ie = {
813
+ }, we = {
836
814
  key: 0,
837
815
  class: "sql-format__clauses"
838
- }, Oe = {
816
+ }, Re = {
839
817
  key: 1,
840
818
  class: "sql-format__code"
841
- }, Le = ["innerHTML"], xe = /* @__PURE__ */ H({
819
+ }, Be = ["innerHTML"], $e = /* @__PURE__ */ H({
842
820
  __name: "index",
843
821
  props: {
844
822
  modelValue: { default: "" },
@@ -848,86 +826,86 @@ $1ON `
848
826
  tabWidth: { default: 2 }
849
827
  },
850
828
  emits: ["update:modelValue", "copy-success", "copy-error", "expand-all", "collapse-all", "compress", "format"],
851
- setup(o, { expose: s, emit: e }) {
852
- z((c) => ({
853
- "45d5acb0": v.value.colors.background,
854
- "4623e62f": v.value.colors.text,
855
- f365b9d8: v.value.colors.errorBackground,
856
- "7d8b5146": v.value.colors.error
829
+ setup(o, { expose: t, emit: e }) {
830
+ X((c) => ({
831
+ eb378acc: v.value.colors.background,
832
+ f6f4a8ce: v.value.colors.text,
833
+ "151cb76a": v.value.colors.errorBackground,
834
+ "0b62391c": v.value.colors.error
857
835
  }));
858
- const d = (c) => {
836
+ const f = (c) => {
859
837
  const b = [], k = (w) => {
860
- for (const C of w)
861
- if (C.path && b.push(C.path), C.body)
862
- for (const B of C.body)
838
+ for (const T of w)
839
+ if (T.path && b.push(T.path), T.body)
840
+ for (const B of T.body)
863
841
  B.kind === "clause" && k([B.clause]);
864
842
  };
865
843
  return k(c), b;
866
- }, n = o, u = e, t = R(""), i = R(n.dialect), m = R([]), r = R(/* @__PURE__ */ new Set()), f = R(""), g = q(() => t.value === ""), v = q(() => se(n.theme)), h = (c) => {
844
+ }, s = o, u = e, n = R(""), i = R(s.dialect), h = R([]), r = R(/* @__PURE__ */ new Set()), d = R(""), g = _(() => n.value === ""), v = _(() => le(s.theme)), m = (c) => {
867
845
  if (!c || !c.trim()) {
868
- t.value = "", m.value = [], r.value.clear();
846
+ n.value = "", h.value = [], r.value.clear();
869
847
  return;
870
848
  }
871
849
  try {
872
- const b = re(c);
850
+ const b = ce(c, i.value);
873
851
  if (!b.valid) {
874
- t.value = b.error || "Invalid SQL", m.value = [], f.value = "";
852
+ n.value = b.error || "Invalid SQL", h.value = [], d.value = "";
875
853
  return;
876
854
  }
877
- const k = pe(c);
878
- m.value = k.clauses, f.value = U(c, {
855
+ const k = be(c, i.value);
856
+ h.value = k.clauses, d.value = V(c, {
879
857
  dialect: i.value,
880
- tabWidth: n.tabWidth
881
- }), r.value = new Set(d(k.clauses)), t.value = "";
858
+ tabWidth: s.tabWidth
859
+ }), r.value = new Set(f(k.clauses)), n.value = "";
882
860
  } catch (b) {
883
- t.value = b instanceof Error ? b.message : "Unknown parse error", m.value = [], f.value = "";
861
+ n.value = b instanceof Error ? b.message : "Unknown parse error", h.value = [], d.value = "";
884
862
  }
885
863
  }, a = (c) => {
886
- const b = J(c), k = v.value.colors;
864
+ const b = G(c), k = v.value.colors;
887
865
  return b.map((w) => {
888
- let C = k.text;
866
+ let T = k.text;
889
867
  switch (w.type) {
890
868
  case "keyword":
891
- C = k.sqlKeyword;
869
+ T = k.sqlKeyword;
892
870
  break;
893
871
  case "function":
894
- C = k.sqlFunction;
872
+ T = k.sqlFunction;
895
873
  break;
896
874
  case "string":
897
- C = k.sqlString;
875
+ T = k.sqlString;
898
876
  break;
899
877
  case "number":
900
- C = k.sqlNumber;
878
+ T = k.sqlNumber;
901
879
  break;
902
880
  case "comment":
903
- C = k.sqlComment;
881
+ T = k.sqlComment;
904
882
  break;
905
883
  case "operator":
906
- C = k.sqlOperator;
884
+ T = k.sqlOperator;
907
885
  break;
908
886
  case "identifier":
909
- C = k.sqlIdentifier;
887
+ T = k.sqlIdentifier;
910
888
  break;
911
889
  case "punctuation":
912
- C = k.sqlPunctuation;
890
+ T = k.sqlPunctuation;
913
891
  break;
914
892
  case "whitespace":
915
893
  return w.value.replace(/ /g, "&nbsp;").replace(/\n/g, `
916
894
  `);
917
895
  }
918
896
  const B = w.value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
919
- return `<span style="color: ${C}">${B}</span>`;
897
+ return `<span style="color: ${T}">${B}</span>`;
920
898
  }).join("");
921
899
  }, p = (c) => {
922
900
  r.value.has(c) ? r.value.delete(c) : r.value.add(c), r.value = new Set(r.value);
923
901
  }, l = () => {
924
- r.value = new Set(d(m.value)), u("expand-all");
925
- }, y = () => {
902
+ r.value = new Set(f(h.value)), u("expand-all");
903
+ }, E = () => {
926
904
  r.value = /* @__PURE__ */ new Set(), u("collapse-all");
927
- }, E = () => f.value || n.modelValue, T = async () => {
905
+ }, y = () => d.value || s.modelValue, S = async () => {
928
906
  if (g.value)
929
907
  try {
930
- const c = E();
908
+ const c = y();
931
909
  await navigator.clipboard.writeText(c), u("copy-success", c);
932
910
  } catch (c) {
933
911
  const b = c instanceof Error ? c : new Error("Failed to copy");
@@ -936,71 +914,71 @@ $1ON `
936
914
  }, I = () => {
937
915
  if (g.value)
938
916
  try {
939
- const c = U(n.modelValue, {
917
+ const c = V(s.modelValue, {
940
918
  dialect: i.value,
941
- tabWidth: n.tabWidth
919
+ tabWidth: s.tabWidth
942
920
  });
943
921
  u("update:modelValue", c), u("format", c);
944
922
  } catch (c) {
945
923
  console.error("Format error:", c);
946
924
  }
947
- }, O = () => {
925
+ }, L = () => {
948
926
  if (g.value)
949
927
  try {
950
- const c = oe(n.modelValue);
928
+ const c = ue(s.modelValue);
951
929
  u("update:modelValue", c), u("compress", c);
952
930
  } catch (c) {
953
931
  console.error("Compress error:", c);
954
932
  }
955
- }, x = () => null, L = () => t.value;
956
- return V(
957
- () => n.modelValue,
933
+ }, x = () => null, O = () => n.value;
934
+ return P(
935
+ () => s.modelValue,
958
936
  (c) => {
959
- h(c);
937
+ m(c);
960
938
  },
961
939
  { immediate: !0 }
962
- ), V(
963
- () => n.dialect,
940
+ ), P(
941
+ () => s.dialect,
964
942
  (c) => {
965
- i.value = c;
943
+ i.value = c, m(s.modelValue);
966
944
  }
967
- ), s({
968
- copySql: T,
945
+ ), t({
946
+ copySql: S,
969
947
  formatSource: I,
970
- compressSource: O,
948
+ compressSource: L,
971
949
  expandAll: l,
972
- collapseAll: y,
950
+ collapseAll: E,
973
951
  toggleExpand: p,
974
952
  isValidSql: () => g.value,
975
953
  getParsedSql: x,
976
- getParseError: L,
977
- getValue: E
978
- }), (c, b) => (N(), S("div", {
954
+ getParseError: O,
955
+ getValue: y
956
+ }), (c, b) => (C(), N("div", {
979
957
  class: $(["sql-format", `sql-format--${v.value.name}`])
980
958
  }, [
981
- _("div", Se, [
982
- g.value ? (N(), S("div", _e, [
983
- m.value.length > 0 ? (N(), S("div", Ie, [
984
- (N(!0), S(A, null, P(m.value, (k) => (N(), W(Ne, {
959
+ q("div", Le, [
960
+ g.value ? (C(), N("div", xe, [
961
+ h.value.length > 0 ? (C(), N("div", we, [
962
+ (C(!0), N(U, null, D(h.value, (k) => (C(), W(Ie, {
985
963
  key: k.path,
986
964
  clause: k,
987
965
  "expanded-clauses": r.value,
988
966
  theme: v.value,
989
967
  onToggle: p
990
968
  }, null, 8, ["clause", "expanded-clauses", "theme"]))), 128))
991
- ])) : (N(), S("pre", Oe, [
992
- _("code", {
993
- innerHTML: a(n.modelValue)
994
- }, null, 8, Le)
969
+ ])) : (C(), N("pre", Re, [
970
+ q("code", {
971
+ innerHTML: a(s.modelValue)
972
+ }, null, 8, Be)
995
973
  ]))
996
- ])) : (N(), S("div", qe, [
997
- b[0] || (b[0] = _("h4", null, "SQL Parse Error:", -1)),
998
- _("pre", null, Y(t.value), 1)
974
+ ])) : (C(), N("div", Oe, [
975
+ b[0] || (b[0] = q("h4", null, "SQL Parse Error:", -1)),
976
+ q("pre", null, Z(n.value), 1)
999
977
  ]))
1000
978
  ])
1001
979
  ], 2));
1002
980
  }
1003
- }), $e = /* @__PURE__ */ F(xe, [["__scopeId", "data-v-8445135b"]]);
981
+ }), Pe = /* @__PURE__ */ K($e, [["__scopeId", "data-v-d9005677"]]);
1004
982
  export {
1005
- $e as S
983
+ Pe as S
1006
984
  };