admindb 2.1.1 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/README.md +41 -12
  2. package/dist/app.js +230 -1
  3. package/dist/auth/config.js +121 -1
  4. package/dist/auth/crypto.js +108 -1
  5. package/dist/auth/index.js +21 -1
  6. package/dist/auth/middleware.js +85 -1
  7. package/dist/auth/routes.js +70 -1
  8. package/dist/auth/types.js +7 -1
  9. package/dist/cli/args.js +320 -1
  10. package/dist/cli/config.js +128 -1
  11. package/dist/cli/index.js +20 -1
  12. package/dist/cli/runner.js +211 -1
  13. package/dist/cli.js +4 -1
  14. package/dist/data/chain.d.ts +1 -0
  15. package/dist/data/chain.js +707 -0
  16. package/dist/data/datasets.js +129 -1
  17. package/dist/data/detector.d.ts +1 -1
  18. package/dist/data/detector.js +511 -1
  19. package/dist/data/engine.d.ts +1 -1
  20. package/dist/data/engine.js +245 -1
  21. package/dist/data/index.d.ts +1 -1
  22. package/dist/data/index.js +22 -1
  23. package/dist/data/strategies.d.ts +1 -1
  24. package/dist/data/strategies.js +339 -1
  25. package/dist/data/types.d.ts +1 -1
  26. package/dist/data/types.js +5 -1
  27. package/dist/db/database.d.ts +1 -1
  28. package/dist/db/database.js +477 -1
  29. package/dist/db/export.d.ts +1 -1
  30. package/dist/db/export.js +90 -1
  31. package/dist/db/filters.js +142 -1
  32. package/dist/db/index.js +24 -1
  33. package/dist/db/introspection.js +167 -1
  34. package/dist/db/manager.js +351 -1
  35. package/dist/db/migrations.js +107 -1
  36. package/dist/db/postgres.d.ts +1 -1
  37. package/dist/db/postgres.js +735 -1
  38. package/dist/db/types.d.ts +1 -1
  39. package/dist/db/types.js +6 -1
  40. package/dist/index.js +52 -1
  41. package/dist/public/css/app.css +1 -1
  42. package/dist/public/js/api.js +1 -1
  43. package/dist/public/js/browse.js +1 -1
  44. package/dist/public/js/common.js +1 -0
  45. package/dist/public/js/databases.js +1 -1
  46. package/dist/public/js/designer.js +1 -1
  47. package/dist/public/js/forms.js +1 -1
  48. package/dist/public/js/home.js +1 -0
  49. package/dist/public/js/inspector.js +1 -1
  50. package/dist/public/js/query.js +1 -1
  51. package/dist/public/js/schema.js +1 -1
  52. package/dist/public/js/seed.js +1 -1
  53. package/dist/routes/api/erd.d.ts +1 -0
  54. package/dist/routes/api/erd.js +50 -0
  55. package/dist/routes/api/helpers.d.ts +1 -1
  56. package/dist/routes/api/helpers.js +163 -1
  57. package/dist/routes/api/import-export.js +83 -1
  58. package/dist/routes/api/index.js +48 -1
  59. package/dist/routes/api/query.js +78 -1
  60. package/dist/routes/api/rows.js +362 -1
  61. package/dist/routes/api/seed.js +153 -1
  62. package/dist/routes/api/tables.js +231 -1
  63. package/dist/routes/databases.js +228 -1
  64. package/dist/routes/index.js +19 -1
  65. package/dist/routes/pages.js +397 -1
  66. package/dist/serverless.js +174 -1
  67. package/dist/sql/classifier.js +24 -1
  68. package/dist/sql/error-analyzer.d.ts +1 -0
  69. package/dist/sql/error-analyzer.js +550 -0
  70. package/dist/sql/generator.js +319 -1
  71. package/dist/sql/index.js +18 -1
  72. package/dist/types/api.js +2 -1
  73. package/dist/utils/colors.js +54 -1
  74. package/dist/utils/common.d.ts +1 -1
  75. package/dist/utils/common.js +225 -1
  76. package/dist/utils/csv.js +67 -1
  77. package/dist/utils/datatype.js +181 -1
  78. package/dist/utils/icons.js +81 -1
  79. package/dist/utils/index.js +20 -1
  80. package/dist/utils/logger.js +36 -1
  81. package/dist/views/layouts/main.hbs +14 -1
  82. package/dist/views/pages/erd.hbs +1241 -0
  83. package/dist/views/pages/home.hbs +98 -2
  84. package/dist/views/pages/info.hbs +107 -0
  85. package/dist/views/pages/query.hbs +54 -12
  86. package/dist/views/pages/seed.hbs +435 -171
  87. package/dist/views/partials/sidebar.hbs +12 -0
  88. package/docs/API.md +6 -1
  89. package/docs/EXAMPLES.md +3 -0
  90. package/package.json +5 -4
  91. package/dist/public/js/icons.js +0 -1
package/dist/utils/csv.js CHANGED
@@ -1 +1,67 @@
1
- function csvEscape(value){const s=null==value?"":String(value);return/[",\r\n]/.test(s)?`"${s.replace(/"/g,'""')}"`:s}Object.defineProperty(exports,"__esModule",{value:!0}),exports.csvEscape=csvEscape,exports.toCsv=function(rows,columns){const header=columns.map(csvEscape).join(","),body=rows.map(row=>columns.map(c=>csvEscape(row[c])).join(","));return[header,...body].join("\r\n")},exports.toJson=function(rows){return JSON.stringify(rows,null,2)},exports.parseCsv=function(text){const rows=[];let row=[],field="",inQuotes=!1;const src=String(text??"");for(let i=0;i<src.length;i++){const ch=src[i];inQuotes?'"'===ch?'"'===src[i+1]?(field+='"',i++):inQuotes=!1:field+=ch:'"'===ch?inQuotes=!0:","===ch?(row.push(field),field=""):"\n"===ch?(row.push(field),field="",(row.length>1||""!==row[0])&&rows.push(row),row=[]):"\r"===ch||(field+=ch)}row.push(field),(row.length>1||""!==row[0])&&rows.push(row);return rows};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.csvEscape = csvEscape;
4
+ exports.toCsv = toCsv;
5
+ exports.toJson = toJson;
6
+ exports.parseCsv = parseCsv;
7
+ function csvEscape(value) {
8
+ const s = value === null || value === undefined ? '' : String(value);
9
+ if (/[",\r\n]/.test(s))
10
+ return `"${s.replace(/"/g, '""')}"`;
11
+ return s;
12
+ }
13
+ function toCsv(rows, columns) {
14
+ const header = columns.map(csvEscape).join(',');
15
+ const body = rows.map((row) => columns.map((c) => csvEscape(row[c])).join(','));
16
+ return [header, ...body].join('\r\n');
17
+ }
18
+ function toJson(rows) {
19
+ return JSON.stringify(rows, null, 2);
20
+ }
21
+ function parseCsv(text) {
22
+ const rows = [];
23
+ let row = [];
24
+ let field = '';
25
+ let inQuotes = false;
26
+ const src = String(text ?? '');
27
+ for (let i = 0; i < src.length; i++) {
28
+ const ch = src[i];
29
+ if (inQuotes) {
30
+ if (ch === '"') {
31
+ if (src[i + 1] === '"') {
32
+ field += '"';
33
+ i++;
34
+ }
35
+ else {
36
+ inQuotes = false;
37
+ }
38
+ }
39
+ else {
40
+ field += ch;
41
+ }
42
+ }
43
+ else if (ch === '"') {
44
+ inQuotes = true;
45
+ }
46
+ else if (ch === ',') {
47
+ row.push(field);
48
+ field = '';
49
+ }
50
+ else if (ch === '\n') {
51
+ row.push(field);
52
+ field = '';
53
+ if (row.length > 1 || row[0] !== '')
54
+ rows.push(row);
55
+ row = [];
56
+ }
57
+ else if (ch === '\r') {
58
+ }
59
+ else {
60
+ field += ch;
61
+ }
62
+ }
63
+ row.push(field);
64
+ if (row.length > 1 || row[0] !== '')
65
+ rows.push(row);
66
+ return rows;
67
+ }
@@ -1 +1,181 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.sniffMimeType=sniffMimeType,exports.generateHexDump=generateHexDump,exports.analyzeBlob=function(data){let buf;buf="string"==typeof data?data.startsWith("0x")||data.startsWith("0X")?Buffer.from(data.slice(2),"hex"):Buffer.from(data,"utf8"):Buffer.isBuffer(data)?data:Buffer.from(data);const analysis=sniffMimeType(buf);let textPreview=null;if(analysis.isText||buf.length<2048)try{const txt=buf.toString("utf8");/[\x00-\x08\x0E-\x1F]/.test(txt.slice(0,512))||(textPreview=txt.slice(0,4e3))}catch{}return{...analysis,size:buf.length,sizeFormatted:(0,common_js_1.formatBytes)(buf.length),hexDump:generateHexDump(buf),textPreview:textPreview}},exports.isJsonString=function(value){if("string"!=typeof value)return!1;const trimmed=value.trim();if(!trimmed)return!1;if(trimmed.startsWith("{")&&trimmed.endsWith("}")||trimmed.startsWith("[")&&trimmed.endsWith("]"))try{return JSON.parse(trimmed),!0}catch{return!1}return!1},exports.formatJsonSafely=function(value,indent=2){if(null==value)return null;if("object"==typeof value)try{return JSON.stringify(value,null,indent)}catch{return null}if("string"==typeof value)try{const parsed=JSON.parse(value);return JSON.stringify(parsed,null,indent)}catch{return null}return null};const common_js_1=require("./common.js");function sniffMimeType(buf){const len=buf.length;if(0===len)return{mime:"application/octet-stream",ext:"bin",isImage:!1,isText:!1,isPdf:!1,isAudio:!1,isVideo:!1};if(len>=8&&137===buf[0]&&80===buf[1]&&78===buf[2]&&71===buf[3]&&13===buf[4]&&10===buf[5]&&26===buf[6]&&10===buf[7])return{mime:"image/png",ext:"png",isImage:!0,isText:!1,isPdf:!1,isAudio:!1,isVideo:!1};if(len>=3&&255===buf[0]&&216===buf[1]&&255===buf[2])return{mime:"image/jpeg",ext:"jpg",isImage:!0,isText:!1,isPdf:!1,isAudio:!1,isVideo:!1};if(len>=6&&71===buf[0]&&73===buf[1]&&70===buf[2]&&56===buf[3]&&(55===buf[4]||57===buf[4])&&97===buf[5])return{mime:"image/gif",ext:"gif",isImage:!0,isText:!1,isPdf:!1,isAudio:!1,isVideo:!1};if(len>=12&&82===buf[0]&&73===buf[1]&&70===buf[2]&&70===buf[3]&&87===buf[8]&&69===buf[9]&&66===buf[10]&&80===buf[11])return{mime:"image/webp",ext:"webp",isImage:!0,isText:!1,isPdf:!1,isAudio:!1,isVideo:!1};if(len>=2&&66===buf[0]&&77===buf[1])return{mime:"image/bmp",ext:"bmp",isImage:!0,isText:!1,isPdf:!1,isAudio:!1,isVideo:!1};if(len>=4&&0===buf[0]&&0===buf[1]&&1===buf[2]&&0===buf[3])return{mime:"image/x-icon",ext:"ico",isImage:!0,isText:!1,isPdf:!1,isAudio:!1,isVideo:!1};if(len>=4&&37===buf[0]&&80===buf[1]&&68===buf[2]&&70===buf[3])return{mime:"application/pdf",ext:"pdf",isImage:!1,isText:!1,isPdf:!0,isAudio:!1,isVideo:!1};if(len>=3&&73===buf[0]&&68===buf[1]&&51===buf[2])return{mime:"audio/mpeg",ext:"mp3",isImage:!1,isText:!1,isPdf:!1,isAudio:!0,isVideo:!1};if(len>=2&&255===buf[0]&&!(224&~buf[1]))return{mime:"audio/mpeg",ext:"mp3",isImage:!1,isText:!1,isPdf:!1,isAudio:!0,isVideo:!1};if(len>=12&&82===buf[0]&&73===buf[1]&&70===buf[2]&&70===buf[3]&&87===buf[8]&&65===buf[9]&&86===buf[10]&&69===buf[11])return{mime:"audio/wav",ext:"wav",isImage:!1,isText:!1,isPdf:!1,isAudio:!0,isVideo:!1};if(len>=4&&79===buf[0]&&103===buf[1]&&103===buf[2]&&83===buf[3])return{mime:"audio/ogg",ext:"ogg",isImage:!1,isText:!1,isPdf:!1,isAudio:!0,isVideo:!1};if(len>=8&&102===buf[4]&&116===buf[5]&&121===buf[6]&&112===buf[7])return{mime:"video/mp4",ext:"mp4",isImage:!1,isText:!1,isPdf:!1,isAudio:!1,isVideo:!0};if(len>=4&&26===buf[0]&&69===buf[1]&&223===buf[2]&&163===buf[3])return{mime:"video/webm",ext:"webm",isImage:!1,isText:!1,isPdf:!1,isAudio:!1,isVideo:!0};const sampleLen=Math.min(len,1024),sample=Buffer.from(buf.subarray(0,sampleLen)).toString("utf8"),trimmed=sample.trim();if(trimmed.startsWith("<svg")||trimmed.startsWith("<?xml")&&trimmed.includes("<svg"))return{mime:"image/svg+xml",ext:"svg",isImage:!0,isText:!0,isPdf:!1,isAudio:!1,isVideo:!1};if(trimmed.startsWith("{")&&trimmed.endsWith("}")||trimmed.startsWith("[")&&trimmed.endsWith("]"))try{return JSON.parse(sample),{mime:"application/json",ext:"json",isImage:!1,isText:!0,isPdf:!1,isAudio:!1,isVideo:!1}}catch{}let nonPrintable=0;for(let i=0;i<sampleLen;i++){const byte=buf[i];(0===byte||byte<7&&9!==byte&&10!==byte&&13!==byte)&&nonPrintable++}return 0===nonPrintable?{mime:"text/plain; charset=utf-8",ext:"txt",isImage:!1,isText:!0,isPdf:!1,isAudio:!1,isVideo:!1}:{mime:"application/octet-stream",ext:"bin",isImage:!1,isText:!1,isPdf:!1,isAudio:!1,isVideo:!1}}function generateHexDump(buf,maxBytes=4096,bytesPerLine=16){const totalBytes=buf.length,limit=Math.min(totalBytes,maxBytes),truncated=totalBytes>maxBytes,lines=[];for(let i=0;i<limit;i+=bytesPerLine){const offset=i.toString(16).padStart(8,"0"),chunk=buf.subarray(i,Math.min(i+bytesPerLine,limit)),hexParts=[];let asciiPart="";for(let j=0;j<bytesPerLine;j++)if(j<chunk.length){const byte=chunk[j];hexParts.push(byte.toString(16).padStart(2,"0")),asciiPart+=byte>=32&&byte<=126?String.fromCharCode(byte):"."}else hexParts.push(" "),asciiPart+=" ";const mid=Math.floor(bytesPerLine/2),hexFormatted=hexParts.slice(0,mid).join(" ")+" "+hexParts.slice(mid).join(" ");lines.push({offset:offset,hex:hexFormatted,ascii:asciiPart})}return{lines:lines,totalBytes:totalBytes,truncated:truncated}}
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sniffMimeType = sniffMimeType;
4
+ exports.generateHexDump = generateHexDump;
5
+ exports.analyzeBlob = analyzeBlob;
6
+ exports.isJsonString = isJsonString;
7
+ exports.formatJsonSafely = formatJsonSafely;
8
+ const common_js_1 = require("./common.js");
9
+ function sniffMimeType(buf) {
10
+ const len = buf.length;
11
+ if (len === 0) {
12
+ return { mime: 'application/octet-stream', ext: 'bin', isImage: false, isText: false, isPdf: false, isAudio: false, isVideo: false };
13
+ }
14
+ if (len >= 8 && buf[0] === 0x89 && buf[1] === 0x50 && buf[2] === 0x4e && buf[3] === 0x47 && buf[4] === 0x0d && buf[5] === 0x0a && buf[6] === 0x1a && buf[7] === 0x0a) {
15
+ return { mime: 'image/png', ext: 'png', isImage: true, isText: false, isPdf: false, isAudio: false, isVideo: false };
16
+ }
17
+ if (len >= 3 && buf[0] === 0xff && buf[1] === 0xd8 && buf[2] === 0xff) {
18
+ return { mime: 'image/jpeg', ext: 'jpg', isImage: true, isText: false, isPdf: false, isAudio: false, isVideo: false };
19
+ }
20
+ if (len >= 6 && buf[0] === 0x47 && buf[1] === 0x49 && buf[2] === 0x46 && buf[3] === 0x38 && (buf[4] === 0x37 || buf[4] === 0x39) && buf[5] === 0x61) {
21
+ return { mime: 'image/gif', ext: 'gif', isImage: true, isText: false, isPdf: false, isAudio: false, isVideo: false };
22
+ }
23
+ if (len >= 12 && buf[0] === 0x52 && buf[1] === 0x49 && buf[2] === 0x46 && buf[3] === 0x46 && buf[8] === 0x57 && buf[9] === 0x45 && buf[10] === 0x42 && buf[11] === 0x50) {
24
+ return { mime: 'image/webp', ext: 'webp', isImage: true, isText: false, isPdf: false, isAudio: false, isVideo: false };
25
+ }
26
+ if (len >= 2 && buf[0] === 0x42 && buf[1] === 0x4d) {
27
+ return { mime: 'image/bmp', ext: 'bmp', isImage: true, isText: false, isPdf: false, isAudio: false, isVideo: false };
28
+ }
29
+ if (len >= 4 && buf[0] === 0x00 && buf[1] === 0x00 && buf[2] === 0x01 && buf[3] === 0x00) {
30
+ return { mime: 'image/x-icon', ext: 'ico', isImage: true, isText: false, isPdf: false, isAudio: false, isVideo: false };
31
+ }
32
+ if (len >= 4 && buf[0] === 0x25 && buf[1] === 0x50 && buf[2] === 0x44 && buf[3] === 0x46) {
33
+ return { mime: 'application/pdf', ext: 'pdf', isImage: false, isText: false, isPdf: true, isAudio: false, isVideo: false };
34
+ }
35
+ if (len >= 3 && buf[0] === 0x49 && buf[1] === 0x44 && buf[2] === 0x33) {
36
+ return { mime: 'audio/mpeg', ext: 'mp3', isImage: false, isText: false, isPdf: false, isAudio: true, isVideo: false };
37
+ }
38
+ if (len >= 2 && buf[0] === 0xff && (buf[1] & 0xe0) === 0xe0) {
39
+ return { mime: 'audio/mpeg', ext: 'mp3', isImage: false, isText: false, isPdf: false, isAudio: true, isVideo: false };
40
+ }
41
+ if (len >= 12 && buf[0] === 0x52 && buf[1] === 0x49 && buf[2] === 0x46 && buf[3] === 0x46 && buf[8] === 0x57 && buf[9] === 0x41 && buf[10] === 0x56 && buf[11] === 0x45) {
42
+ return { mime: 'audio/wav', ext: 'wav', isImage: false, isText: false, isPdf: false, isAudio: true, isVideo: false };
43
+ }
44
+ if (len >= 4 && buf[0] === 0x4f && buf[1] === 0x67 && buf[2] === 0x67 && buf[3] === 0x53) {
45
+ return { mime: 'audio/ogg', ext: 'ogg', isImage: false, isText: false, isPdf: false, isAudio: true, isVideo: false };
46
+ }
47
+ if (len >= 8 && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70) {
48
+ return { mime: 'video/mp4', ext: 'mp4', isImage: false, isText: false, isPdf: false, isAudio: false, isVideo: true };
49
+ }
50
+ if (len >= 4 && buf[0] === 0x1a && buf[1] === 0x45 && buf[2] === 0xdf && buf[3] === 0xa3) {
51
+ return { mime: 'video/webm', ext: 'webm', isImage: false, isText: false, isPdf: false, isAudio: false, isVideo: true };
52
+ }
53
+ const sampleLen = Math.min(len, 1024);
54
+ const sample = Buffer.from(buf.subarray(0, sampleLen)).toString('utf8');
55
+ const trimmed = sample.trim();
56
+ if (trimmed.startsWith('<svg') || (trimmed.startsWith('<?xml') && trimmed.includes('<svg'))) {
57
+ return { mime: 'image/svg+xml', ext: 'svg', isImage: true, isText: true, isPdf: false, isAudio: false, isVideo: false };
58
+ }
59
+ if ((trimmed.startsWith('{') && trimmed.endsWith('}')) || (trimmed.startsWith('[') && trimmed.endsWith(']'))) {
60
+ try {
61
+ JSON.parse(sample);
62
+ return { mime: 'application/json', ext: 'json', isImage: false, isText: true, isPdf: false, isAudio: false, isVideo: false };
63
+ }
64
+ catch {
65
+ }
66
+ }
67
+ let nonPrintable = 0;
68
+ for (let i = 0; i < sampleLen; i++) {
69
+ const byte = buf[i];
70
+ if (byte === 0 || (byte < 7 && byte !== 9 && byte !== 10 && byte !== 13)) {
71
+ nonPrintable++;
72
+ }
73
+ }
74
+ if (nonPrintable === 0) {
75
+ return { mime: 'text/plain; charset=utf-8', ext: 'txt', isImage: false, isText: true, isPdf: false, isAudio: false, isVideo: false };
76
+ }
77
+ return { mime: 'application/octet-stream', ext: 'bin', isImage: false, isText: false, isPdf: false, isAudio: false, isVideo: false };
78
+ }
79
+ function generateHexDump(buf, maxBytes = 4096, bytesPerLine = 16) {
80
+ const totalBytes = buf.length;
81
+ const limit = Math.min(totalBytes, maxBytes);
82
+ const truncated = totalBytes > maxBytes;
83
+ const lines = [];
84
+ for (let i = 0; i < limit; i += bytesPerLine) {
85
+ const offset = i.toString(16).padStart(8, '0');
86
+ const chunk = buf.subarray(i, Math.min(i + bytesPerLine, limit));
87
+ const hexParts = [];
88
+ let asciiPart = '';
89
+ for (let j = 0; j < bytesPerLine; j++) {
90
+ if (j < chunk.length) {
91
+ const byte = chunk[j];
92
+ hexParts.push(byte.toString(16).padStart(2, '0'));
93
+ asciiPart += (byte >= 32 && byte <= 126) ? String.fromCharCode(byte) : '.';
94
+ }
95
+ else {
96
+ hexParts.push(' ');
97
+ asciiPart += ' ';
98
+ }
99
+ }
100
+ const mid = Math.floor(bytesPerLine / 2);
101
+ const hexFormatted = hexParts.slice(0, mid).join(' ') + ' ' + hexParts.slice(mid).join(' ');
102
+ lines.push({
103
+ offset,
104
+ hex: hexFormatted,
105
+ ascii: asciiPart,
106
+ });
107
+ }
108
+ return { lines, totalBytes, truncated };
109
+ }
110
+ function analyzeBlob(data) {
111
+ let buf;
112
+ if (typeof data === 'string') {
113
+ if (data.startsWith('0x') || data.startsWith('0X')) {
114
+ buf = Buffer.from(data.slice(2), 'hex');
115
+ }
116
+ else {
117
+ buf = Buffer.from(data, 'utf8');
118
+ }
119
+ }
120
+ else {
121
+ buf = Buffer.isBuffer(data) ? data : Buffer.from(data);
122
+ }
123
+ const analysis = sniffMimeType(buf);
124
+ let textPreview = null;
125
+ if (analysis.isText || buf.length < 2048) {
126
+ try {
127
+ const txt = buf.toString('utf8');
128
+ if (!/[\x00-\x08\x0E-\x1F]/.test(txt.slice(0, 512))) {
129
+ textPreview = txt.slice(0, 4000);
130
+ }
131
+ }
132
+ catch {
133
+ }
134
+ }
135
+ return {
136
+ ...analysis,
137
+ size: buf.length,
138
+ sizeFormatted: (0, common_js_1.formatBytes)(buf.length),
139
+ hexDump: generateHexDump(buf),
140
+ textPreview,
141
+ };
142
+ }
143
+ function isJsonString(value) {
144
+ if (typeof value !== 'string')
145
+ return false;
146
+ const trimmed = value.trim();
147
+ if (!trimmed)
148
+ return false;
149
+ if ((trimmed.startsWith('{') && trimmed.endsWith('}')) || (trimmed.startsWith('[') && trimmed.endsWith(']'))) {
150
+ try {
151
+ JSON.parse(trimmed);
152
+ return true;
153
+ }
154
+ catch {
155
+ return false;
156
+ }
157
+ }
158
+ return false;
159
+ }
160
+ function formatJsonSafely(value, indent = 2) {
161
+ if (value === null || value === undefined)
162
+ return null;
163
+ if (typeof value === 'object') {
164
+ try {
165
+ return JSON.stringify(value, null, indent);
166
+ }
167
+ catch {
168
+ return null;
169
+ }
170
+ }
171
+ if (typeof value === 'string') {
172
+ try {
173
+ const parsed = JSON.parse(value);
174
+ return JSON.stringify(parsed, null, indent);
175
+ }
176
+ catch {
177
+ return null;
178
+ }
179
+ }
180
+ return null;
181
+ }
@@ -1 +1,81 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.ICONS=void 0,exports.renderIcon=function(name,customClass){const svg=exports.ICONS[name];if(!svg)return"";if(!customClass)return svg;if(svg.includes('class="'))return svg.replace(/class="[^"]*"/,`class="${customClass}"`);return svg.replace("<svg",`<svg class="${customClass}"`)},exports.ICONS={menu:'<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 6h16M4 12h16M4 18h16" /></svg>',home:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" /></svg>',database:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 7v10c0 1.1.9 2 2 2h12a2 2 0 002-2V7M4 7c0-1.1.9-2 2-2h12a2 2 0 012 2M4 7c0 1.1.9 2 2 2h12a2 2 0 002-2" /></svg>',table:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M3 10h18M3 14h18m-9-4v8m-7 0h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z" /></svg>',query:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M13 10V3L4 14h7v7l9-11h-7z" /></svg>',designer:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4v16m8-8H4" /></svg>',plus:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4v16m8-8H4" /></svg>',book:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253" /></svg>',schema:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" /><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /></svg>',search:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" /></svg>',filter:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414A1 1 0 0014 15.414V20a1 1 0 01-1 1h-2a1 1 0 01-1-1v-4.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z" /></svg>',export:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" /></svg>',import:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12" /></svg>',seed:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z" /></svg>',edit:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" /></svg>',trash:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" /></svg>',copy:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" /></svg>',duplicate:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2" /></svg>',save:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4" /></svg>',run:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z" /><path stroke-linecap="round" stroke-linejoin="round" d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>',inspect:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/><path stroke-linecap="round" stroke-linejoin="round" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"/></svg>',sql:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" /></svg>',chevronDown:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M19 9l-7 7-7-7" /></svg>',chevronUp:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M5 15l7-7 7 7" /></svg>',chevronLeft:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M15 19l-7-7 7-7" /></svg>',chevronRight:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7" /></svg>',arrowLeft:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M10 19l-7-7m0 0l7-7m-7 7h18" /></svg>',arrowRight:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M13 7l5 5m0 0l-5 5m5-5H6" /></svg>',arrowUp:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M3 10h13M3 10l4-4m-4 4l4 4" /></svg>',check:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" /></svg>',x:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" /></svg>',warning:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" /></svg>',stats:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M9 17v-2m3 2v-4m3 4v-6m2 10H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /></svg>',key:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" /></svg>',dotsHorizontal:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z" /></svg>',dotsVertical:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z" /></svg>',user:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" /></svg>',logout:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" /></svg>',lock:'<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" /></svg>'};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ICONS = void 0;
4
+ exports.renderIcon = renderIcon;
5
+ exports.ICONS = {
6
+ menu: '<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 6h16M4 12h16M4 18h16" /></svg>',
7
+ home: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" /></svg>',
8
+ database: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 7v10c0 1.1.9 2 2 2h12a2 2 0 002-2V7M4 7c0-1.1.9-2 2-2h12a2 2 0 012 2M4 7c0 1.1.9 2 2 2h12a2 2 0 002-2" /></svg>',
9
+ table: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M3 10h18M3 14h18m-9-4v8m-7 0h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z" /></svg>',
10
+ query: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M13 10V3L4 14h7v7l9-11h-7z" /></svg>',
11
+ designer: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4v16m8-8H4" /></svg>',
12
+ plus: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 4v16m8-8H4" /></svg>',
13
+ book: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253" /></svg>',
14
+ schema: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" /><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /></svg>',
15
+ diagram: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><rect x="2" y="3" width="6" height="5" rx="1" stroke-linecap="round" stroke-linejoin="round"/><rect x="16" y="3" width="6" height="5" rx="1" stroke-linecap="round" stroke-linejoin="round"/><rect x="9" y="16" width="6" height="5" rx="1" stroke-linecap="round" stroke-linejoin="round"/><path stroke-linecap="round" stroke-linejoin="round" d="M5 8v4h14V8M12 12v4"/></svg>',
16
+ search: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" /></svg>',
17
+ filter: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414A1 1 0 0014 15.414V20a1 1 0 01-1 1h-2a1 1 0 01-1-1v-4.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z" /></svg>',
18
+ export: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" /></svg>',
19
+ import: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12" /></svg>',
20
+ seed: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z" /></svg>',
21
+ edit: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" /></svg>',
22
+ trash: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" /></svg>',
23
+ copy: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" /></svg>',
24
+ duplicate: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M8 7v8a2 2 0 002 2h6M8 7V5a2 2 0 012-2h4.586a1 1 0 01.707.293l4.414 4.414a1 1 0 01.293.707V15a2 2 0 01-2 2h-2M8 7H6a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2v-2" /></svg>',
25
+ save: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4" /></svg>',
26
+ run: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z" /><path stroke-linecap="round" stroke-linejoin="round" d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>',
27
+ inspect: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/><path stroke-linecap="round" stroke-linejoin="round" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"/></svg>',
28
+ sql: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" /></svg>',
29
+ settings: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" /><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /></svg>',
30
+ chevronDown: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M19 9l-7 7-7-7" /></svg>',
31
+ chevronUp: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M5 15l7-7 7 7" /></svg>',
32
+ chevronLeft: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M15 19l-7-7 7-7" /></svg>',
33
+ chevronRight: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M9 5l7 7-7 7" /></svg>',
34
+ arrowLeft: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M10 19l-7-7m0 0l7-7m-7 7h18" /></svg>',
35
+ arrowRight: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M13 7l5 5m0 0l-5 5m5-5H6" /></svg>',
36
+ arrowUp: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M3 10h13M3 10l4-4m-4 4l4 4" /></svg>',
37
+ refresh: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" /></svg>',
38
+ compact: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 8h16M4 16h16"/></svg>',
39
+ fit: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l5-5M4 16v4m0 0h4m-4 0l5-5m11 5v-4m0 0h-4m4 0l-5-5"/></svg>',
40
+ layoutForce: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"/><circle cx="4" cy="5" r="2"/><circle cx="20" cy="5" r="2"/><circle cx="4" cy="19" r="2"/><circle cx="20" cy="19" r="2"/><path stroke-linecap="round" d="M6 6.5l4.5 4M17.5 6.5l-4 4M6 17.5l4.5-4M17.5 17.5l-4-4"/></svg>',
41
+ layoutHierarchy: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><rect x="2" y="9" width="5" height="6" rx="1"/><rect x="9" y="4" width="5" height="6" rx="1"/><rect x="9" y="14" width="5" height="6" rx="1"/><rect x="17" y="9" width="5" height="6" rx="1"/><path stroke-linecap="round" d="M7 12h2M14 7h1l2 5-2 5h-1"/></svg>',
42
+ layoutCircle: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="9"/><circle cx="12" cy="3" r="1.5" fill="currentColor" stroke="none"/><circle cx="20.2" cy="7.5" r="1.5" fill="currentColor" stroke="none"/><circle cx="20.2" cy="16.5" r="1.5" fill="currentColor" stroke="none"/><circle cx="12" cy="21" r="1.5" fill="currentColor" stroke="none"/><circle cx="3.8" cy="16.5" r="1.5" fill="currentColor" stroke="none"/><circle cx="3.8" cy="7.5" r="1.5" fill="currentColor" stroke="none"/></svg>',
43
+ minus: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M20 12H4"/></svg>',
44
+ focus: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><path stroke-linecap="round" stroke-linejoin="round" d="M21 21l-4.35-4.35M11 8v6m-3-3h6"/></svg>',
45
+ spinner: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg>',
46
+ terminal: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/></svg>',
47
+ format: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 6h16M4 12h10M4 18h14"/></svg>',
48
+ check: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" /></svg>',
49
+ x: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" /></svg>',
50
+ warning: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" /></svg>',
51
+ stats: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M9 17v-2m3 2v-4m3 4v-6m2 10H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /></svg>',
52
+ key: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" /></svg>',
53
+ dotsHorizontal: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z" /></svg>',
54
+ dotsVertical: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z" /></svg>',
55
+ user: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z" /></svg>',
56
+ logout: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" /></svg>',
57
+ lock: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" /></svg>',
58
+ error: '<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" /></svg>',
59
+ success: '<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" /></svg>',
60
+ info: '<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>',
61
+ sun: '<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z" /></svg>',
62
+ moon: '<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z" /></svg>',
63
+ calendar: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" /></svg>',
64
+ folder: '<svg xmlns="http://www.w3.org/2000/svg" class="h-3.5 w-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2V7z" /></svg>',
65
+ download: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4" /></svg>',
66
+ upload: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12" /></svg>',
67
+ checkSm: '<svg xmlns="http://www.w3.org/2000/svg" class="h-3.5 w-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" /></svg>',
68
+ inspectSm: '<svg xmlns="http://www.w3.org/2000/svg" class="h-3.5 w-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"/></svg>',
69
+ checkMd: '<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" /></svg>',
70
+ };
71
+ function renderIcon(name, customClass) {
72
+ const svg = exports.ICONS[name];
73
+ if (!svg)
74
+ return '';
75
+ if (!customClass)
76
+ return svg;
77
+ if (svg.includes('class="')) {
78
+ return svg.replace(/class="[^"]*"/, `class="${customClass}"`);
79
+ }
80
+ return svg.replace('<svg', `<svg class="${customClass}"`);
81
+ }
@@ -1 +1,20 @@
1
- var __createBinding=this&&this.__createBinding||(Object.create?function(o,m,k,k2){void 0===k2&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);desc&&!("get"in desc?!m.__esModule:desc.writable||desc.configurable)||(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}:function(o,m,k,k2){void 0===k2&&(k2=k),o[k2]=m[k]}),__exportStar=this&&this.__exportStar||function(m,exports){for(var p in m)"default"===p||Object.prototype.hasOwnProperty.call(exports,p)||__createBinding(exports,m,p)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./common"),exports),__exportStar(require("./csv"),exports),__exportStar(require("./logger"),exports),__exportStar(require("./colors"),exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./common"), exports);
18
+ __exportStar(require("./csv"), exports);
19
+ __exportStar(require("./logger"), exports);
20
+ __exportStar(require("./colors"), exports);
@@ -1 +1,36 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.createLogger=function createLogger(level="info",scope="admindb"){const threshold=LEVELS[level]??LEVELS.info,cleanScope="admindb"===scope||"app"===scope?"":scope.replace(/^admindb:/,""),scopeTag=cleanScope?colors_1.c.dim(colors_1.c.cyan(`[${cleanScope}]`)):"",write=(lv,args)=>{if(LEVELS[lv]<threshold)return;const prefix=[colors_1.c.gray(function(){const d=new Date,pad=n=>String(n).padStart(2,"0");return`${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`}()),BADGES[lv],scopeTag].filter(Boolean).join(" ");console.log(prefix,...args)};return{debug:(...args)=>write("debug",args),info:(...args)=>write("info",args),warn:(...args)=>write("warn",args),error:(...args)=>write("error",args),child:s=>createLogger(level,cleanScope?`${cleanScope}:${s}`:s)}};const colors_1=require("./colors"),LEVELS={debug:10,info:20,warn:30,error:40};const BADGES={debug:colors_1.c.magenta("[debug]"),info:colors_1.c.cyan("[info]"),warn:colors_1.c.yellow("[warn]"),error:colors_1.c.red(colors_1.c.bold("[error]"))};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createLogger = createLogger;
4
+ const colors_1 = require("./colors");
5
+ const LEVELS = { debug: 10, info: 20, warn: 30, error: 40 };
6
+ function formatTime() {
7
+ const d = new Date();
8
+ const pad = (n) => String(n).padStart(2, '0');
9
+ return `${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`;
10
+ }
11
+ const BADGES = {
12
+ debug: colors_1.c.magenta('[debug]'),
13
+ info: colors_1.c.cyan('[info]'),
14
+ warn: colors_1.c.yellow('[warn]'),
15
+ error: colors_1.c.red(colors_1.c.bold('[error]')),
16
+ };
17
+ function createLogger(level = 'info', scope = 'admindb') {
18
+ const threshold = LEVELS[level] ?? LEVELS.info;
19
+ const cleanScope = scope === 'admindb' || scope === 'app' ? '' : scope.replace(/^admindb:/, '');
20
+ const scopeTag = cleanScope ? colors_1.c.dim(colors_1.c.cyan(`[${cleanScope}]`)) : '';
21
+ const write = (lv, args) => {
22
+ if (LEVELS[lv] < threshold)
23
+ return;
24
+ const time = colors_1.c.gray(formatTime());
25
+ const badge = BADGES[lv];
26
+ const prefix = [time, badge, scopeTag].filter(Boolean).join(' ');
27
+ console.log(prefix, ...args);
28
+ };
29
+ return {
30
+ debug: (...args) => write('debug', args),
31
+ info: (...args) => write('info', args),
32
+ warn: (...args) => write('warn', args),
33
+ error: (...args) => write('error', args),
34
+ child: (s) => createLogger(level, cleanScope ? `${cleanScope}:${s}` : s),
35
+ };
36
+ }
@@ -25,7 +25,20 @@
25
25
  } catch (e) {}
26
26
  })();
27
27
  </script>
28
- <script src="{{basePath}}/js/icons.js" defer></script>
28
+ <script>
29
+ window.AdminIcons = {
30
+ map: {{{json icons}}},
31
+ get: function(name, customClass) {
32
+ var svg = this.map[name] || '';
33
+ if (!svg || !customClass) return svg;
34
+ if (svg.indexOf('class="') !== -1) {
35
+ return svg.replace(/class="[^"]*"/, 'class="' + customClass + '"');
36
+ }
37
+ return svg.replace('<svg', '<svg class="' + customClass + '"');
38
+ }
39
+ };
40
+ </script>
41
+ <script src="{{basePath}}/js/common.js" defer></script>
29
42
  <script src="{{basePath}}/js/api.js" defer></script>
30
43
  <script src="{{basePath}}/js/app.js" defer></script>
31
44
  <script src="{{basePath}}/js/inspector.js" defer></script>