modscape 0.1.2 → 0.2.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.
- package/README.md +89 -21
- package/package.json +2 -1
- package/src/export.js +193 -0
- package/src/index.js +11 -1
- package/visualizer/README.md +73 -0
- package/visualizer/package.json +44 -0
- package/visualizer/public/favicon.svg +24 -0
- package/visualizer-dist/assets/{index-CLmFaRYF.js → index-kTZGkKzj.js} +1 -1
- package/visualizer-dist/index.html +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
# <img src="./visualizer
|
|
1
|
+
# <img src="./visualizer/public/favicon.svg" width="32" height="32" align="center" /> Modscape
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/modscape)
|
|
4
|
+
[](https://www.npmjs.com/package/modscape)
|
|
5
|
+
[](https://github.com/yujikawa/modscape/actions/workflows/deploy.yml)
|
|
6
|
+
[](https://github.com/yujikawa/modscape/actions/workflows/publish.yml)
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
2
8
|
|
|
3
9
|
Modscape is a YAML-driven data modeling visualizer. It helps data engineers and architects bridge the gap between conceptual, logical, and physical data models while maintaining sample data "stories".
|
|
4
10
|
|
|
@@ -11,6 +17,7 @@ Modscape is a YAML-driven data modeling visualizer. It helps data engineers and
|
|
|
11
17
|
- **Sample Data "Stories"**: Attach sample data to entities to explain the data's purpose.
|
|
12
18
|
- **Interactive Layout**: Arrange entities via drag-and-drop; positions are saved directly back to your YAML.
|
|
13
19
|
- **Multi-file Support**: Manage multiple models in a single directory and switch between them seamlessly.
|
|
20
|
+
- **Documentation Export**: Generate Mermaid-compatible Markdown documentation including ER diagrams and domain catalogs.
|
|
14
21
|
- **AI-Agent Ready**: Scaffolding for Gemini, Claude, and Codex to help you model via AI.
|
|
15
22
|
|
|
16
23
|
## Installation
|
|
@@ -21,29 +28,79 @@ Install Modscape globally via npm:
|
|
|
21
28
|
npm install -g modscape
|
|
22
29
|
```
|
|
23
30
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Getting Started
|
|
34
|
+
|
|
35
|
+
Choose the path that fits your workflow.
|
|
36
|
+
|
|
37
|
+
### Path A: AI-Driven Modeling (Recommended)
|
|
38
|
+
Best if you use AI coding assistants (Gemini CLI, Claude Code, Cursor/Codex).
|
|
39
|
+
|
|
40
|
+
1. **Initialize**: Scaffold modeling rules and AI agent instructions.
|
|
41
|
+
```bash
|
|
42
|
+
modscape init
|
|
43
|
+
```
|
|
44
|
+
2. **Start Dev**: Launch the visualizer on your model.
|
|
45
|
+
```bash
|
|
46
|
+
modscape dev model.yaml
|
|
47
|
+
```
|
|
48
|
+
3. **Prompt Your AI**: Tell your agent to use the rules in `.modscape/rules.md` to add tables or columns to your `model.yaml`.
|
|
49
|
+
|
|
50
|
+
### Path B: Manual Modeling
|
|
51
|
+
Best for direct YAML editing and architectural control.
|
|
52
|
+
|
|
53
|
+
1. **Create YAML**: Create a file named `model.yaml` (see [Defining Your Model](#defining-your-model-yaml)).
|
|
54
|
+
2. **Start Dev**: Launch the visualizer.
|
|
55
|
+
```bash
|
|
56
|
+
modscape dev model.yaml
|
|
57
|
+
```
|
|
58
|
+
3. **Explore Samples**: Try it out with our built-in samples:
|
|
59
|
+
```bash
|
|
60
|
+
# Clone the repo or download the samples directory
|
|
61
|
+
modscape dev samples/
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Defining Your Model (YAML)
|
|
67
|
+
|
|
68
|
+
Modscape uses a human-readable YAML schema. While you can write it manually, we **highly recommend using an AI coding assistant** (like Gemini, Claude, or Cursor) to handle the boilerplate.
|
|
69
|
+
|
|
70
|
+
### Manual Definition Reference
|
|
71
|
+
Here is the basic structure for your `model.yaml`:
|
|
72
|
+
|
|
73
|
+
```yaml
|
|
74
|
+
tables:
|
|
75
|
+
- id: users
|
|
76
|
+
name: USERS
|
|
77
|
+
appearance:
|
|
78
|
+
type: dimension # dimension | fact | hub | link | satellite
|
|
79
|
+
icon: 👤
|
|
80
|
+
columns:
|
|
81
|
+
- id: user_id
|
|
82
|
+
logical: { name: USER_ID, type: UUID, isPrimaryKey: true }
|
|
83
|
+
- id: email
|
|
84
|
+
logical: { name: EMAIL, type: String }
|
|
85
|
+
|
|
86
|
+
# Data Vault Example
|
|
87
|
+
- id: hub_customer
|
|
88
|
+
name: HUB_CUSTOMER
|
|
89
|
+
appearance: { type: hub, icon: 🔑 }
|
|
90
|
+
columns:
|
|
91
|
+
- id: hk_customer
|
|
92
|
+
logical: { name: HK_CUSTOMER, type: Binary, isPrimaryKey: true }
|
|
93
|
+
- id: customer_id
|
|
94
|
+
logical: { name: CUSTOMER_ID, type: String }
|
|
31
95
|
```
|
|
32
96
|
|
|
33
|
-
|
|
34
|
-
|
|
97
|
+
- **Appearance Types**:
|
|
98
|
+
- `dimension` / `fact`: For Star Schema / Dimensional modeling.
|
|
99
|
+
- `hub` / `link` / `satellite`: For Data Vault 2.0 modeling.
|
|
100
|
+
- **IDs**: Use lowercase, snake_case for `id` fields (used for internal linking).
|
|
101
|
+
- **Layout**: Don't worry about the `layout:` section. Modscape will automatically add and update coordinates when you drag entities in the browser.
|
|
35
102
|
|
|
36
|
-
|
|
37
|
-
# Clone the repo or download the samples directory to try this:
|
|
38
|
-
modscape dev samples/
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### 3. Start Modeling
|
|
42
|
-
Create a `model.yaml` and launch the interactive visualizer.
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
modscape dev model.yaml
|
|
46
|
-
```
|
|
103
|
+
---
|
|
47
104
|
|
|
48
105
|
## Usage
|
|
49
106
|
|
|
@@ -68,6 +125,17 @@ Generate a standalone static website to share your documentation (perfect for Gi
|
|
|
68
125
|
modscape build models/ -o dist-site
|
|
69
126
|
```
|
|
70
127
|
|
|
128
|
+
### Export Mode (Static Documentation)
|
|
129
|
+
Generate a comprehensive Markdown document with embedded Mermaid diagrams.
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# Print to stdout
|
|
133
|
+
modscape export models/ecommerce.yaml
|
|
134
|
+
|
|
135
|
+
# Save to a file
|
|
136
|
+
modscape export models/ -o docs/
|
|
137
|
+
```
|
|
138
|
+
|
|
71
139
|
## AI Agent Integration
|
|
72
140
|
|
|
73
141
|
Modscape is designed to work alongside AI coding assistants. By running `modscape init`, you get:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "modscape",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Modscape: A YAML-driven data modeling visualizer CLI",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"files": [
|
|
14
14
|
"src",
|
|
15
15
|
"visualizer-dist",
|
|
16
|
+
"visualizer/public/favicon.svg",
|
|
16
17
|
"package.json",
|
|
17
18
|
"README.md"
|
|
18
19
|
],
|
package/src/export.js
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import yaml from 'js-yaml';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Normalizes the schema data to ensure it's in a consistent format.
|
|
7
|
+
* Similar to visualizer/src/lib/parser.ts but for the CLI side.
|
|
8
|
+
*/
|
|
9
|
+
function normalizeSchema(data) {
|
|
10
|
+
if (!data || typeof data !== 'object') {
|
|
11
|
+
throw new Error('Invalid YAML: Root must be an object');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const schema = {
|
|
15
|
+
tables: Array.isArray(data.tables) ? data.tables : [],
|
|
16
|
+
relationships: Array.isArray(data.relationships) ? data.relationships : [],
|
|
17
|
+
domains: Array.isArray(data.domains) ? data.domains : [],
|
|
18
|
+
layout: data.layout || {}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
schema.tables = schema.tables.map(table => ({
|
|
22
|
+
...table,
|
|
23
|
+
id: table.id || 'unknown',
|
|
24
|
+
name: table.name || table.id || 'Unnamed Table',
|
|
25
|
+
columns: Array.isArray(table.columns) ? table.columns : []
|
|
26
|
+
}));
|
|
27
|
+
|
|
28
|
+
return schema;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Sanitizes a string for use as a Mermaid entity name.
|
|
33
|
+
* Spaces and hyphens are replaced with underscores.
|
|
34
|
+
*/
|
|
35
|
+
function sanitize(str) {
|
|
36
|
+
return str.replace(/[^a-zA-Z0-9_]/g, '_');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Generates Mermaid ER diagram syntax.
|
|
41
|
+
*/
|
|
42
|
+
function generateMermaidER(schema) {
|
|
43
|
+
let mermaid = 'erDiagram\n';
|
|
44
|
+
|
|
45
|
+
// Tables (Entities)
|
|
46
|
+
schema.tables.forEach(table => {
|
|
47
|
+
const tableName = sanitize(table.name);
|
|
48
|
+
mermaid += ` ${tableName} {\n`;
|
|
49
|
+
table.columns.forEach(col => {
|
|
50
|
+
const colName = sanitize(col.logical?.name || col.id);
|
|
51
|
+
const colType = sanitize(col.logical?.type || 'string');
|
|
52
|
+
let markers = '';
|
|
53
|
+
if (col.logical?.isPrimaryKey) markers += ' PK';
|
|
54
|
+
if (col.logical?.isForeignKey) markers += ' FK';
|
|
55
|
+
mermaid += ` ${colType} ${colName}${markers}\n`;
|
|
56
|
+
});
|
|
57
|
+
mermaid += ' }\n';
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// Relationships
|
|
61
|
+
schema.relationships.forEach(rel => {
|
|
62
|
+
const fromTable = sanitize(schema.tables.find(t => t.id === rel.from.table)?.name || rel.from.table);
|
|
63
|
+
const toTable = sanitize(schema.tables.find(t => t.id === rel.to.table)?.name || rel.to.table);
|
|
64
|
+
|
|
65
|
+
// Default to one-to-many if type is missing
|
|
66
|
+
let connector = '||--o{';
|
|
67
|
+
if (rel.type === 'one-to-one') connector = '||--||';
|
|
68
|
+
if (rel.type === 'many-to-many') connector = '}|--|{';
|
|
69
|
+
if (rel.type === 'one-to-many') connector = '||--o{';
|
|
70
|
+
|
|
71
|
+
mermaid += ` ${fromTable} ${connector} ${toTable} : ""\n`;
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
return mermaid;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Generates the full Markdown document.
|
|
79
|
+
*/
|
|
80
|
+
export function generateMarkdown(schema, modelName) {
|
|
81
|
+
let md = `# ${modelName} Data Model Definition\n\n`;
|
|
82
|
+
|
|
83
|
+
// Mermaid ER Diagram
|
|
84
|
+
md += '## ER Diagram\n\n';
|
|
85
|
+
md += '```mermaid\n';
|
|
86
|
+
md += generateMermaidER(schema);
|
|
87
|
+
md += '```\n\n';
|
|
88
|
+
|
|
89
|
+
// Domains
|
|
90
|
+
if (schema.domains && schema.domains.length > 0) {
|
|
91
|
+
md += '## Domains\n\n';
|
|
92
|
+
schema.domains.forEach(domain => {
|
|
93
|
+
md += `### ${domain.name}\n`;
|
|
94
|
+
if (domain.description) md += `${domain.description}\n\n`;
|
|
95
|
+
md += 'Associated Tables:\n';
|
|
96
|
+
domain.tables.forEach(tableId => {
|
|
97
|
+
const table = schema.tables.find(t => t.id === tableId);
|
|
98
|
+
md += `- ${table?.name || tableId}\n`;
|
|
99
|
+
});
|
|
100
|
+
md += '\n';
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Table Catalog
|
|
105
|
+
md += '## Table Catalog\n\n';
|
|
106
|
+
schema.tables.forEach(table => {
|
|
107
|
+
md += `### ${table.name} ${table.appearance?.icon || ''}\n`;
|
|
108
|
+
if (table.conceptual?.description) {
|
|
109
|
+
md += `**Description**: ${table.conceptual.description}\n\n`;
|
|
110
|
+
}
|
|
111
|
+
if (table.appearance?.type) {
|
|
112
|
+
md += `**Type**: ${table.appearance.type}\n\n`;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Columns Table
|
|
116
|
+
if (table.columns && table.columns.length > 0) {
|
|
117
|
+
md += '#### Column Definitions\n\n';
|
|
118
|
+
md += '| ID | Logical Name | Type | Key | Description |\n';
|
|
119
|
+
md += '| --- | --- | --- | --- | --- |\n';
|
|
120
|
+
table.columns.forEach(col => {
|
|
121
|
+
const key = [
|
|
122
|
+
col.logical?.isPrimaryKey ? 'PK' : '',
|
|
123
|
+
col.logical?.isForeignKey ? 'FK' : ''
|
|
124
|
+
].filter(Boolean).join(', ');
|
|
125
|
+
md += `| ${col.id} | ${col.logical?.name || '-'} | ${col.logical?.type || '-'} | ${key || '-'} | ${col.logical?.description || '-'} |\n`;
|
|
126
|
+
});
|
|
127
|
+
md += '\n';
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Sample Data
|
|
131
|
+
if (table.sampleData && table.sampleData.rows && table.sampleData.rows.length > 0) {
|
|
132
|
+
md += '#### Sample Data\n\n';
|
|
133
|
+
md += '| ' + table.sampleData.columns.join(' | ') + ' |\n';
|
|
134
|
+
md += '| ' + table.sampleData.columns.map(() => '---').join(' | ') + ' |\n';
|
|
135
|
+
table.sampleData.rows.slice(0, 5).forEach(row => {
|
|
136
|
+
md += '| ' + row.join(' | ') + ' |\n';
|
|
137
|
+
});
|
|
138
|
+
if (table.sampleData.rows.length > 5) {
|
|
139
|
+
md += `\n*(Showing 5 of ${table.sampleData.rows.length} rows)*\n`;
|
|
140
|
+
}
|
|
141
|
+
md += '\n';
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
return md;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Main export function called by the CLI
|
|
150
|
+
*/
|
|
151
|
+
export async function exportModel(paths, options) {
|
|
152
|
+
for (const inputPath of paths) {
|
|
153
|
+
const absolutePath = path.resolve(process.cwd(), inputPath);
|
|
154
|
+
if (!fs.existsSync(absolutePath)) {
|
|
155
|
+
console.warn(` ⚠️ Warning: Path not found: ${inputPath}`);
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const stats = fs.statSync(absolutePath);
|
|
160
|
+
const files = stats.isDirectory()
|
|
161
|
+
? fs.readdirSync(absolutePath).filter(f => f.endsWith('.yaml') || f.endsWith('.yml')).map(f => path.join(absolutePath, f))
|
|
162
|
+
: [absolutePath];
|
|
163
|
+
|
|
164
|
+
for (const file of files) {
|
|
165
|
+
try {
|
|
166
|
+
const content = fs.readFileSync(file, 'utf8');
|
|
167
|
+
const data = yaml.load(content);
|
|
168
|
+
const schema = normalizeSchema(data);
|
|
169
|
+
const modelName = path.parse(file).name.charAt(0).toUpperCase() + path.parse(file).name.slice(1).replace(/[-_]/g, ' ');
|
|
170
|
+
const markdown = generateMarkdown(schema, modelName);
|
|
171
|
+
|
|
172
|
+
if (options.output) {
|
|
173
|
+
// If output is specified, we either append or use it as a directory/base
|
|
174
|
+
// For now, let's just write to the specified output file if it's one file,
|
|
175
|
+
// or treat as a directory if multiple.
|
|
176
|
+
let outputPath = options.output;
|
|
177
|
+
if (files.length > 1 || stats.isDirectory()) {
|
|
178
|
+
// ensure directory exists
|
|
179
|
+
if (!fs.existsSync(outputPath)) fs.mkdirSync(outputPath, { recursive: true });
|
|
180
|
+
outputPath = path.join(outputPath, `${path.parse(file).name}.md`);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
fs.writeFileSync(outputPath, markdown, 'utf8');
|
|
184
|
+
console.log(` ✅ Exported: ${path.relative(process.cwd(), file)} -> ${outputPath}`);
|
|
185
|
+
} else {
|
|
186
|
+
process.stdout.write(markdown + '\n');
|
|
187
|
+
}
|
|
188
|
+
} catch (e) {
|
|
189
|
+
console.error(` ❌ Error exporting ${file}: ${e.message}`);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
package/src/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { fileURLToPath } from 'url';
|
|
|
6
6
|
import { startDevServer } from './dev.js';
|
|
7
7
|
import { build } from './build.js';
|
|
8
8
|
import { initProject } from './init.js';
|
|
9
|
+
import { exportModel } from './export.js';
|
|
9
10
|
|
|
10
11
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
11
12
|
const VISUALIZER_PATH = path.resolve(__dirname, '../visualizer');
|
|
@@ -14,7 +15,7 @@ const program = new Command();
|
|
|
14
15
|
program
|
|
15
16
|
.name('modscape')
|
|
16
17
|
.description('A YAML-driven data modeling visualizer CLI')
|
|
17
|
-
.version('0.
|
|
18
|
+
.version('0.2.0');
|
|
18
19
|
|
|
19
20
|
program
|
|
20
21
|
.command('init')
|
|
@@ -44,4 +45,13 @@ program
|
|
|
44
45
|
build(paths, VISUALIZER_PATH, options.output);
|
|
45
46
|
});
|
|
46
47
|
|
|
48
|
+
program
|
|
49
|
+
.command('export')
|
|
50
|
+
.description('Export YAML models to Mermaid-compatible Markdown documentation')
|
|
51
|
+
.argument('<paths...>', 'paths to YAML model files or directories')
|
|
52
|
+
.option('-o, --output <path>', 'output file or directory')
|
|
53
|
+
.action((paths, options) => {
|
|
54
|
+
exportModel(paths, options);
|
|
55
|
+
});
|
|
56
|
+
|
|
47
57
|
program.parse();
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# React + TypeScript + Vite
|
|
2
|
+
|
|
3
|
+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
|
+
|
|
5
|
+
Currently, two official plugins are available:
|
|
6
|
+
|
|
7
|
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
|
|
8
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
9
|
+
|
|
10
|
+
## React Compiler
|
|
11
|
+
|
|
12
|
+
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
|
|
13
|
+
|
|
14
|
+
## Expanding the ESLint configuration
|
|
15
|
+
|
|
16
|
+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
export default defineConfig([
|
|
20
|
+
globalIgnores(['dist']),
|
|
21
|
+
{
|
|
22
|
+
files: ['**/*.{ts,tsx}'],
|
|
23
|
+
extends: [
|
|
24
|
+
// Other configs...
|
|
25
|
+
|
|
26
|
+
// Remove tseslint.configs.recommended and replace with this
|
|
27
|
+
tseslint.configs.recommendedTypeChecked,
|
|
28
|
+
// Alternatively, use this for stricter rules
|
|
29
|
+
tseslint.configs.strictTypeChecked,
|
|
30
|
+
// Optionally, add this for stylistic rules
|
|
31
|
+
tseslint.configs.stylisticTypeChecked,
|
|
32
|
+
|
|
33
|
+
// Other configs...
|
|
34
|
+
],
|
|
35
|
+
languageOptions: {
|
|
36
|
+
parserOptions: {
|
|
37
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
38
|
+
tsconfigRootDir: import.meta.dirname,
|
|
39
|
+
},
|
|
40
|
+
// other options...
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
])
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
// eslint.config.js
|
|
50
|
+
import reactX from 'eslint-plugin-react-x'
|
|
51
|
+
import reactDom from 'eslint-plugin-react-dom'
|
|
52
|
+
|
|
53
|
+
export default defineConfig([
|
|
54
|
+
globalIgnores(['dist']),
|
|
55
|
+
{
|
|
56
|
+
files: ['**/*.{ts,tsx}'],
|
|
57
|
+
extends: [
|
|
58
|
+
// Other configs...
|
|
59
|
+
// Enable lint rules for React
|
|
60
|
+
reactX.configs['recommended-typescript'],
|
|
61
|
+
// Enable lint rules for React DOM
|
|
62
|
+
reactDom.configs.recommended,
|
|
63
|
+
],
|
|
64
|
+
languageOptions: {
|
|
65
|
+
parserOptions: {
|
|
66
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
67
|
+
tsconfigRootDir: import.meta.dirname,
|
|
68
|
+
},
|
|
69
|
+
// other options...
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
])
|
|
73
|
+
```
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "visualizer",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.2.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "tsc -b && vite build",
|
|
9
|
+
"lint": "eslint .",
|
|
10
|
+
"preview": "vite preview"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
14
|
+
"@radix-ui/react-slot": "^1.2.4",
|
|
15
|
+
"@radix-ui/react-tabs": "^1.1.13",
|
|
16
|
+
"class-variance-authority": "^0.7.1",
|
|
17
|
+
"clsx": "^2.1.1",
|
|
18
|
+
"js-yaml": "^4.1.1",
|
|
19
|
+
"lucide-react": "^0.575.0",
|
|
20
|
+
"react": "^19.2.0",
|
|
21
|
+
"react-dom": "^19.2.0",
|
|
22
|
+
"reactflow": "^11.11.4",
|
|
23
|
+
"tailwind-merge": "^3.5.0",
|
|
24
|
+
"zustand": "^5.0.11"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@eslint/js": "^9.39.1",
|
|
28
|
+
"@types/js-yaml": "^4.0.9",
|
|
29
|
+
"@types/node": "^24.10.1",
|
|
30
|
+
"@types/react": "^19.2.7",
|
|
31
|
+
"@types/react-dom": "^19.2.3",
|
|
32
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
33
|
+
"autoprefixer": "^10.4.27",
|
|
34
|
+
"eslint": "^9.39.1",
|
|
35
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
36
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
37
|
+
"globals": "^16.5.0",
|
|
38
|
+
"postcss": "^8.5.6",
|
|
39
|
+
"tailwindcss": "^3.4.19",
|
|
40
|
+
"typescript": "~5.9.3",
|
|
41
|
+
"typescript-eslint": "^8.48.0",
|
|
42
|
+
"vite": "^7.3.1"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<!-- Background Round Rect -->
|
|
3
|
+
<rect width="512" height="512" rx="112" fill="#FFFFFF"/>
|
|
4
|
+
|
|
5
|
+
<!-- Relationship Lines (Connecting in M-shape) -->
|
|
6
|
+
<path d="M120 350 L120 160 L256 310 L392 160 L392 350"
|
|
7
|
+
stroke="#CBD5E1" stroke-width="24" stroke-linecap="round" stroke-linejoin="round"/>
|
|
8
|
+
|
|
9
|
+
<!-- Colorful Rounded Rect Nodes -->
|
|
10
|
+
<!-- Left Bottom (Satellite) -->
|
|
11
|
+
<rect x="80" y="310" width="80" height="80" rx="16" fill="#8b5cf6"/>
|
|
12
|
+
|
|
13
|
+
<!-- Left Top (Hub) -->
|
|
14
|
+
<rect x="80" y="120" width="80" height="80" rx="16" fill="#f59e0b"/>
|
|
15
|
+
|
|
16
|
+
<!-- Center "V" (Fact) -->
|
|
17
|
+
<rect x="216" y="270" width="80" height="80" rx="16" fill="#ef4444"/>
|
|
18
|
+
|
|
19
|
+
<!-- Right Top (Link) -->
|
|
20
|
+
<rect x="352" y="120" width="80" height="80" rx="16" fill="#10b981"/>
|
|
21
|
+
|
|
22
|
+
<!-- Right Bottom (Dimension) -->
|
|
23
|
+
<rect x="352" y="310" width="80" height="80" rx="16" fill="#3b82f6"/>
|
|
24
|
+
</svg>
|
|
@@ -37,4 +37,4 @@ Error generating stack: `+o.message+`
|
|
|
37
37
|
`+t.slice(u,f),u=f+1),s=h;return m+=`
|
|
38
38
|
`,t.length-u>i&&s>u?m+=t.slice(u,s)+`
|
|
39
39
|
`+t.slice(s+1):m+=t.slice(u),m.slice(1)}function QN(t){for(var i="",a=0,r,u=0;u<t.length;a>=65536?u+=2:u++)a=Lo(t,u),r=Rt[a],!r&&$o(a)?(i+=t[u],a>=65536&&(i+=t[u+1])):i+=r||jN(a);return i}function $N(t,i,a){var r="",u=t.tag,f,s,h;for(f=0,s=a.length;f<s;f+=1)h=a[f],t.replacer&&(h=t.replacer.call(a,String(f),h)),(hl(t,i,h,!1,!1)||typeof h>"u"&&hl(t,i,null,!1,!1))&&(r!==""&&(r+=","+(t.condenseFlow?"":" ")),r+=t.dump);t.tag=u,t.dump="["+r+"]"}function Pg(t,i,a,r){var u="",f=t.tag,s,h,m;for(s=0,h=a.length;s<h;s+=1)m=a[s],t.replacer&&(m=t.replacer.call(a,String(s),m)),(hl(t,i+1,m,!0,!0,!1,!0)||typeof m>"u"&&hl(t,i+1,null,!0,!0,!1,!0))&&((!r||u!=="")&&(u+=dd(t,i)),t.dump&&Zo===t.dump.charCodeAt(0)?u+="-":u+="- ",u+=t.dump);t.tag=f,t.dump=u||"[]"}function KN(t,i,a){var r="",u=t.tag,f=Object.keys(a),s,h,m,p,g;for(s=0,h=f.length;s<h;s+=1)g="",r!==""&&(g+=", "),t.condenseFlow&&(g+='"'),m=f[s],p=a[m],t.replacer&&(p=t.replacer.call(a,m,p)),hl(t,i,m,!1,!1)&&(t.dump.length>1024&&(g+="? "),g+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),hl(t,i,p,!1,!1)&&(g+=t.dump,r+=g));t.tag=u,t.dump="{"+r+"}"}function FN(t,i,a,r){var u="",f=t.tag,s=Object.keys(a),h,m,p,g,v,x;if(t.sortKeys===!0)s.sort();else if(typeof t.sortKeys=="function")s.sort(t.sortKeys);else if(t.sortKeys)throw new jt("sortKeys must be a boolean or a function");for(h=0,m=s.length;h<m;h+=1)x="",(!r||u!=="")&&(x+=dd(t,i)),p=s[h],g=a[p],t.replacer&&(g=t.replacer.call(a,p,g)),hl(t,i+1,p,!0,!0,!0)&&(v=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,v&&(t.dump&&Zo===t.dump.charCodeAt(0)?x+="?":x+="? "),x+=t.dump,v&&(x+=dd(t,i)),hl(t,i+1,g,!0,v)&&(t.dump&&Zo===t.dump.charCodeAt(0)?x+=":":x+=": ",x+=t.dump,u+=x));t.tag=f,t.dump=u||"{}"}function ey(t,i,a){var r,u,f,s,h,m;for(u=a?t.explicitTypes:t.implicitTypes,f=0,s=u.length;f<s;f+=1)if(h=u[f],(h.instanceOf||h.predicate)&&(!h.instanceOf||typeof i=="object"&&i instanceof h.instanceOf)&&(!h.predicate||h.predicate(i))){if(a?h.multi&&h.representName?t.tag=h.representName(i):t.tag=h.tag:t.tag="?",h.represent){if(m=t.styleMap[h.tag]||h.defaultStyle,x1.call(h.represent)==="[object Function]")r=h.represent(i,m);else if(b1.call(h.represent,m))r=h.represent[m](i,m);else throw new jt("!<"+h.tag+'> tag resolver accepts not "'+m+'" style');t.dump=r}return!0}return!1}function hl(t,i,a,r,u,f,s){t.tag=null,t.dump=a,ey(t,a,!1)||ey(t,a,!0);var h=x1.call(t.dump),m=r,p;r&&(r=t.flowLevel<0||t.flowLevel>i);var g=h==="[object Object]"||h==="[object Array]",v,x;if(g&&(v=t.duplicates.indexOf(a),x=v!==-1),(t.tag!==null&&t.tag!=="?"||x||t.indent!==2&&i>0)&&(u=!1),x&&t.usedDuplicates[v])t.dump="*ref_"+v;else{if(g&&x&&!t.usedDuplicates[v]&&(t.usedDuplicates[v]=!0),h==="[object Object]")r&&Object.keys(t.dump).length!==0?(FN(t,i,t.dump,u),x&&(t.dump="&ref_"+v+t.dump)):(KN(t,i,t.dump),x&&(t.dump="&ref_"+v+" "+t.dump));else if(h==="[object Array]")r&&t.dump.length!==0?(t.noArrayIndent&&!s&&i>0?Pg(t,i-1,t.dump,u):Pg(t,i,t.dump,u),x&&(t.dump="&ref_"+v+t.dump)):($N(t,i,t.dump),x&&(t.dump="&ref_"+v+" "+t.dump));else if(h==="[object String]")t.tag!=="?"&&XN(t,t.dump,i,f,m);else{if(h==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new jt("unacceptable kind of an object to dump "+h)}t.tag!==null&&t.tag!=="?"&&(p=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?p="!"+p:p.slice(0,18)==="tag:yaml.org,2002:"?p="!!"+p.slice(18):p="!<"+p+">",t.dump=p+" "+t.dump)}return!0}function IN(t,i){var a=[],r=[],u,f;for(md(t,a,r),u=0,f=r.length;u<f;u+=1)i.duplicates.push(a[r[u]]);i.usedDuplicates=new Array(f)}function md(t,i,a){var r,u,f;if(t!==null&&typeof t=="object")if(u=i.indexOf(t),u!==-1)a.indexOf(u)===-1&&a.push(u);else if(i.push(t),Array.isArray(t))for(u=0,f=t.length;u<f;u+=1)md(t[u],i,a);else for(r=Object.keys(t),u=0,f=r.length;u<f;u+=1)md(t[r[u]],i,a)}function JN(t,i){i=i||{};var a=new BN(i);a.noRefs||IN(t,a);var r=t;return a.replacer&&(r=a.replacer.call({"":r},"",r)),hl(a,0,r,!0,!0)?a.dump+`
|
|
40
|
-
`:""}var WN=JN,PN={dump:WN};function qd(t,i){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+i+" instead, which is now safe by default.")}}var z1=Ct,O1=Xv,R1=Kv,D1=Pv,H1=e1,U1=kd,L1=v1.load,j1=v1.loadAll,k1=PN.dump,B1=jt,Y1={binary:a1,float:Wv,map:$v,null:Fv,pairs:r1,set:u1,timestamp:l1,bool:Iv,int:Jv,merge:i1,omap:o1,seq:Qv,str:Zv},V1=qd("safeLoad","load"),q1=qd("safeLoadAll","loadAll"),G1=qd("safeDump","dump"),X1={Type:z1,Schema:O1,FAILSAFE_SCHEMA:R1,JSON_SCHEMA:D1,CORE_SCHEMA:H1,DEFAULT_SCHEMA:U1,load:L1,loadAll:j1,dump:k1,YAMLException:B1,types:Y1,safeLoad:V1,safeLoadAll:q1,safeDump:G1};const eT=Object.freeze(Object.defineProperty({__proto__:null,CORE_SCHEMA:H1,DEFAULT_SCHEMA:U1,FAILSAFE_SCHEMA:R1,JSON_SCHEMA:D1,Schema:O1,Type:z1,YAMLException:B1,default:X1,dump:k1,load:L1,loadAll:j1,safeDump:G1,safeLoad:V1,safeLoadAll:q1,types:Y1},Symbol.toStringTag,{value:"Module"}));function ku(t){if(!t||typeof t!="object")throw new Error("Invalid YAML: Root must be an object");const i={tables:Array.isArray(t.tables)?t.tables:[],relationships:Array.isArray(t.relationships)?t.relationships:[],domains:Array.isArray(t.domains)?t.domains:[],layout:t.layout||{}};return i.tables=i.tables.map(a=>({...a,id:a.id||"unknown",name:a.name||a.id||"Unnamed Table",appearance:a.appearance||void 0,columns:Array.isArray(a.columns)?a.columns:[]})),i}function tT(t){try{const i=X1.load(t);return ku(i)}catch(i){throw new Error(`YAML Parsing Error: ${i.message}`)}}const Nn=K3((t,i)=>({schema:null,selectedTableId:null,hoveredColumnId:null,error:null,isCliMode:typeof window<"u"&&window.MODSCAPE_CLI_MODE===!0,availableFiles:[],currentModelSlug:null,isSidebarOpen:!0,activeTab:"editor",focusNodeId:null,setSchema:a=>{try{const r=ku(a);t({schema:r,error:null})}catch(r){t({error:r.message})}},setSelectedTableId:a=>t({selectedTableId:a}),setHoveredColumnId:a=>t({hoveredColumnId:a}),setIsCliMode:a=>t({isCliMode:a}),setIsSidebarOpen:a=>t({isSidebarOpen:a}),setActiveTab:a=>t({activeTab:a}),setFocusNodeId:a=>t({focusNodeId:a}),fetchAvailableFiles:async()=>{const a=window.__MODSCAPE_DATA__;if(a&&a.models){const r=a.models.map(u=>({slug:u.slug,name:u.name,path:""}));t({availableFiles:r});return}try{const u=await(await fetch("/api/files")).json();t({availableFiles:u})}catch(r){console.error("Failed to fetch files:",r)}},setCurrentModel:async a=>{const r=window.__MODSCAPE_DATA__;if(r&&r.models){const u=r.models.find(f=>f.slug===a);if(u){t({currentModelSlug:a,schema:ku(u.schema),selectedTableId:null,error:null});const f=new URLSearchParams(window.location.search);f.set("model",a);const s=window.location.pathname+"?"+f.toString();window.history.pushState(null,"",s)}return}try{const u=`/api/model?model=${a}`,s=await(await fetch(u)).json();t({currentModelSlug:a,schema:ku(s),selectedTableId:null,error:null});const h=new URLSearchParams(window.location.search);h.set("model",a);const m=window.location.pathname+"?"+h.toString();window.history.pushState(null,"",m)}catch(u){console.error("Failed to fetch model:",u)}},parseAndSetSchema:a=>{try{const r=tT(a);t({schema:r,error:null})}catch(r){t({error:r.message})}},updateNodePosition:(a,r,u)=>{const f=i().schema;if(!f)return;const s=f.layout?.[a]||{x:0,y:0},h={...f.layout||{},[a]:{...s,x:Math.round(r),y:Math.round(u)}};t({schema:{...f,layout:h}})},updateNodeDimensions:(a,r,u)=>{const f=i().schema;if(!f)return;const s=f.layout?.[a]||{x:0,y:0},h={...f.layout||{},[a]:{...s,width:Math.round(r),height:Math.round(u)}};t({schema:{...f,layout:h}})},saveLayout:async()=>{const{schema:a,currentModelSlug:r}=i();if(!(!a||!a.layout))try{const u=r?`/api/layout?model=${r}`:"/api/layout";await fetch(u,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a.layout)})}catch(u){console.error("Failed to save layout:",u)}},getSelectedTable:()=>{const{schema:a,selectedTableId:r}=i();return!a||!r?null:a.tables.find(u=>u.id===r)||null}})),nT={fact:{color:"#f87171",icon:"📊",label:"FACT"},dimension:{color:"#60a5fa",icon:"🏷️",label:"DIM"},hub:{color:"#fbbf24",icon:"🌐",label:"HUB"},link:{color:"#34d399",icon:"🔗",label:"LINK"},satellite:{color:"#a78bfa",icon:"🛰️",label:"SAT"}},lT=({data:t,selected:i})=>{const{table:a}=t,r=Nn(p=>p.hoveredColumnId),u=a.columns&&a.columns.length>0,f=a.appearance?.type?nT[a.appearance.type]:null,s=a.appearance?.color||f?.color||"#334155",h=a.appearance?.icon||f?.icon||"",m=f?.label||"";return R.jsxs("div",{style:{minWidth:"220px",maxWidth:"550px",backgroundColor:"#1e293b",borderLeft:`2px solid ${i?"#3b82f6":"#334155"}`,borderRight:`2px solid ${i?"#3b82f6":"#334155"}`,borderBottom:`2px solid ${i?"#3b82f6":"#334155"}`,borderTop:`4px solid ${s}`,borderRadius:"8px",overflow:"hidden",color:"#f1f5f9",boxShadow:i?"0 0 0 4px rgba(59, 130, 246, 0.2)":"0 4px 6px -1px rgba(0, 0, 0, 0.1)",fontFamily:"sans-serif"},children:[R.jsx(Ca,{type:"target",position:ve.Top,style:{background:"#94a3b8",width:"8px",height:"8px"}}),R.jsxs("div",{style:{padding:"12px",backgroundColor:"rgba(15, 23, 42, 0.8)",borderBottom:u?"1px solid #334155":"none"},children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",minWidth:0},children:[h&&R.jsx("span",{style:{fontSize:"14px",flexShrink:0},children:h}),R.jsx("div",{style:{fontSize:"14px",fontWeight:"bold",color:"#ffffff",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a.name})]}),m&&R.jsx("div",{style:{fontSize:"9px",fontWeight:800,padding:"2px 6px",borderRadius:"4px",backgroundColor:`${s}20`,color:s,border:`1px solid ${s}40`,flexShrink:0,marginLeft:"8px"},children:m})]}),R.jsx("div",{style:{fontSize:"10px",color:"#94a3b8",textTransform:"uppercase",marginTop:"2px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a.id})]}),u&&R.jsx("div",{style:{padding:"0"},children:R.jsx("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"11px"},children:R.jsx("tbody",{children:a.columns.map(p=>R.jsxs("tr",{style:{borderBottom:"1px solid #334155",backgroundColor:r===p.id?"rgba(30, 58, 138, 0.6)":"transparent"},children:[R.jsx("td",{style:{padding:"6px 12px",fontWeight:500,color:"#e2e8f0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"350px"},children:R.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[p.logical?.isPrimaryKey&&R.jsx("span",{style:{color:"#eab308",marginRight:"4px"},children:"🔑"}),p.logical?.isForeignKey&&R.jsx("span",{style:{marginRight:"4px"},children:"🔩"}),p.logical?.isPartitionKey&&R.jsx("span",{style:{marginRight:"4px"},children:"📂"}),R.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:p.logical?.name||p.id})]})}),R.jsx("td",{style:{padding:"6px 12px",textAlign:"right",fontStyle:"italic",color:"#94a3b8",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"150px"},children:p.logical?.type||"Unknown"})]},p.id))})})}),R.jsx(Ca,{type:"source",position:ve.Bottom,style:{background:"#94a3b8",width:"8px",height:"8px"}})]})},iT=T.memo(lT),aT=({id:t,data:i,selected:a})=>{const{updateNodeDimensions:r,saveLayout:u}=Nn(),f=(s,h)=>{r(t,h.width,h.height),u()};return R.jsxs("div",{style:{width:"100%",height:"100%",backgroundColor:i.color||"rgba(30, 41, 59, 0.1)",border:`2px dashed ${a?"#3b82f6":"#334155"}`,borderRadius:"12px",padding:"10px",position:"relative",color:"#94a3b8",pointerEvents:"none"},children:[R.jsx(X3,{color:"#3b82f6",isVisible:a,minWidth:200,minHeight:150,onResizeEnd:f}),R.jsx("div",{style:{position:"absolute",top:"-25px",left:"0",fontSize:"14px",fontWeight:"bold",color:"#f1f5f9",whiteSpace:"nowrap",pointerEvents:"all"},children:i.label})]})},oT=T.memo(aT);const Z1=(...t)=>t.filter((i,a,r)=>!!i&&i.trim()!==""&&r.indexOf(i)===a).join(" ").trim();const rT=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const uT=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,a,r)=>r?r.toUpperCase():a.toLowerCase());const ty=t=>{const i=uT(t);return i.charAt(0).toUpperCase()+i.slice(1)};var cT={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const sT=t=>{for(const i in t)if(i.startsWith("aria-")||i==="role"||i==="title")return!0;return!1};const fT=T.forwardRef(({color:t="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:u="",children:f,iconNode:s,...h},m)=>T.createElement("svg",{ref:m,...cT,width:i,height:i,stroke:t,strokeWidth:r?Number(a)*24/Number(i):a,className:Z1("lucide",u),...!f&&!sT(h)&&{"aria-hidden":"true"},...h},[...s.map(([p,g])=>T.createElement(p,g)),...Array.isArray(f)?f:[f]]));const Kt=(t,i)=>{const a=T.forwardRef(({className:r,...u},f)=>T.createElement(fT,{ref:f,iconNode:i,className:Z1(`lucide-${rT(ty(t))}`,`lucide-${t}`,r),...u}));return a.displayName=ty(t),a};const dT=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],ny=Kt("arrow-up-right",dT);const hT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],mT=Kt("chevron-down",hT);const pT=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],gT=Kt("chevron-left",pT);const yT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],vT=Kt("chevron-right",yT);const xT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],ly=Kt("circle-alert",xT);const bT=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],ST=Kt("database",bT);const ET=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],_T=Kt("hash",ET);const wT=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],AT=Kt("layers",wT);const CT=[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]],NT=Kt("list-tree",CT);const TT=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],MT=Kt("pen-line",TT);const zT=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],OT=Kt("play",zT);const RT=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],DT=Kt("save",RT);const HT=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],UT=Kt("search",HT);const LT=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],jT=Kt("x",LT),kT=({table:t,sampleData:i})=>{const a=Nn(u=>u.setHoveredColumnId),r=u=>t.columns?.find(s=>s.id===u)?.logical?.name||u;return R.jsx("div",{style:{border:"1px solid #1e293b",borderRadius:"6px",overflow:"hidden",backgroundColor:"#0f172a"},children:R.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px"},children:[R.jsx("thead",{style:{backgroundColor:"#020617",borderBottom:"1px solid #1e293b",position:"sticky",top:0,zIndex:10},children:R.jsx("tr",{children:i.columns.map(u=>R.jsx("th",{onMouseEnter:()=>a(u),onMouseLeave:()=>a(null),style:{padding:"12px 16px",fontWeight:"bold",color:"#f1f5f9",borderRight:"1px solid #1e293b",textAlign:"left",cursor:"default",whiteSpace:"nowrap"},children:r(u)},u))})}),R.jsx("tbody",{children:i.rows.map((u,f)=>R.jsx(BT,{row:u,borderStyle:"1px solid #1e293b"},f))})]})})},BT=({row:t,borderStyle:i})=>R.jsx("tr",{style:{borderBottom:i},children:t.map((a,r)=>R.jsx("td",{style:{padding:"8px 16px",borderRight:i,color:"#d1d5db",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"monospace",fontSize:"12px"},children:String(a)},r))}),YT={fact:{color:"#f87171",icon:"📊",label:"FACT"},dimension:{color:"#60a5fa",icon:"🏷️",label:"DIM"},hub:{color:"#fbbf24",icon:"🌐",label:"HUB"},link:{color:"#34d399",icon:"🔗",label:"LINK"},satellite:{color:"#a78bfa",icon:"🛰️",label:"SAT"}},VT=()=>{const{selectedTableId:t,getSelectedTable:i,setSelectedTableId:a}=Nn(),r=i(),[u,f]=T.useState("conceptual");if(!t||!r)return null;const s=[{id:"conceptual",label:"Conceptual"},{id:"logical",label:"Logical"},{id:"physical",label:"Physical"},{id:"sample",label:"Sample Data"}],h=r.columns&&r.columns.length>0,m=r.appearance?.type?YT[r.appearance.type]:null,p=r.appearance?.color||m?.color||"#334155",g=r.appearance?.icon||m?.icon||"",v=m?.label||"";return R.jsxs("div",{className:"bg-slate-900 border-t border-slate-800 shadow-2xl z-50 flex flex-col text-slate-100",style:{height:"35vh",maxHeight:"400px",minHeight:"200px",backgroundColor:"#0f172a",borderTop:`2px solid ${p}`,display:"flex",flexDirection:"column",color:"#f1f5f9",boxShadow:"0 -10px 25px -5px rgba(0, 0, 0, 0.3)",fontFamily:"sans-serif"},children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 20px",borderBottom:"1px solid #1e293b",backgroundColor:"#020617"},children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[g&&R.jsx("span",{style:{fontSize:"18px"},children:g}),R.jsxs("div",{children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[R.jsx("h2",{style:{fontSize:"16px",fontWeight:"bold",color:"#ffffff",margin:0},children:r.name}),v&&R.jsx("span",{style:{fontSize:"9px",fontWeight:800,padding:"1px 5px",borderRadius:"3px",backgroundColor:`${p}20`,color:p,border:`1px solid ${p}40`,textTransform:"uppercase"},children:v})]}),R.jsx("p",{style:{fontSize:"11px",color:"#94a3b8",textTransform:"uppercase",margin:0},children:r.id})]})]}),R.jsx("button",{onClick:x=>{x.stopPropagation(),a(null)},style:{padding:"6px",backgroundColor:"transparent",border:"none",color:"#94a3b8",cursor:"pointer",borderRadius:"50%"},children:R.jsx(jT,{size:18})})]}),R.jsx("div",{style:{display:"flex",gap:"24px",padding:"0 20px",borderBottom:"1px solid #1e293b",backgroundColor:"#0f172a"},children:s.map(x=>R.jsx("button",{onClick:()=>f(x.id),style:{padding:"10px 0",backgroundColor:"transparent",border:"none",borderBottom:u===x.id?"2px solid #3b82f6":"2px solid transparent",color:u===x.id?"#60a5fa":"#94a3b8",fontSize:"13px",fontWeight:500,cursor:"pointer",transition:"all 0.2s"},children:x.label},x.id))}),R.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"15px 20px"},children:[u==="conceptual"&&R.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"15px"},children:[R.jsxs("section",{children:[R.jsx("h3",{style:{fontSize:"13px",fontWeight:600,color:"#e2e8f0",marginBottom:"6px"},children:"Description"}),R.jsx("p",{style:{fontSize:"13px",color:"#94a3b8",lineHeight:1.6},children:r.conceptual?.description||"No description provided."})]}),r.conceptual?.tags&&r.conceptual.tags.length>0&&R.jsxs("section",{children:[R.jsx("h3",{style:{fontSize:"13px",fontWeight:600,color:"#e2e8f0",marginBottom:"6px"},children:"Tags"}),R.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:r.conceptual.tags.map(x=>R.jsx("span",{style:{padding:"2px 10px",backgroundColor:"rgba(30, 58, 138, 0.3)",color:"#93c5fd",fontSize:"10px",borderRadius:"4px",border:"1px solid rgba(30, 58, 138, 0.5)",textTransform:"uppercase"},children:x},x))})]})]}),u==="logical"&&R.jsx("div",{children:h?R.jsx("div",{style:{border:"1px solid #1e293b",borderRadius:"8px",overflow:"hidden"},children:R.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px"},children:[R.jsx("thead",{style:{backgroundColor:"#020617",borderBottom:"1px solid #1e293b",textAlign:"left"},children:R.jsxs("tr",{children:[R.jsx("th",{style:{padding:"8px 16px",fontWeight:600,color:"#e2e8f0"},children:"Name"}),R.jsx("th",{style:{padding:"8px 16px",fontWeight:600,color:"#e2e8f0"},children:"Type"}),R.jsx("th",{style:{padding:"8px 16px",fontWeight:600,color:"#e2e8f0"},children:"Description"})]})}),R.jsx("tbody",{children:r.columns.map(x=>R.jsxs("tr",{style:{borderBottom:"1px solid #1e293b"},children:[R.jsx("td",{style:{padding:"8px 16px",fontWeight:500,color:"#e2e8f0"},children:R.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[x.logical?.isPrimaryKey&&R.jsx("span",{style:{marginRight:"6px"},children:"🔑"}),x.logical?.isForeignKey&&R.jsx("span",{style:{marginRight:"6px"},children:"🔩"}),x.logical?.isPartitionKey&&R.jsx("span",{style:{marginRight:"6px"},children:"📂"}),R.jsx("span",{children:x.logical?.name||x.id})]})}),R.jsx("td",{style:{padding:"8px 16px",color:"#94a3b8",fontStyle:"italic",fontFamily:"monospace",fontSize:"11px"},children:x.logical?.type||"Unknown"}),R.jsx("td",{style:{padding:"8px 16px",color:"#64748b",fontSize:"11px"},children:x.logical?.description||"-"})]},x.id))})]})}):R.jsx("div",{style:{fontSize:"13px",color:"#64748b",fontStyle:"italic"},children:"No logical columns defined yet."})}),u==="physical"&&R.jsx("div",{children:h?R.jsx("div",{style:{border:"1px solid #1e293b",borderRadius:"8px",overflow:"hidden"},children:R.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px"},children:[R.jsx("thead",{style:{backgroundColor:"#020617",borderBottom:"1px solid #1e293b",textAlign:"left"},children:R.jsxs("tr",{children:[R.jsx("th",{style:{padding:"8px 16px",fontWeight:600,color:"#e2e8f0"},children:"Physical Name"}),R.jsx("th",{style:{padding:"8px 16px",fontWeight:600,color:"#e2e8f0"},children:"DB Type"}),R.jsx("th",{style:{padding:"8px 16px",fontWeight:600,color:"#e2e8f0"},children:"Constraints"})]})}),R.jsx("tbody",{children:r.columns.map(x=>R.jsxs("tr",{style:{borderBottom:"1px solid #1e293b"},children:[R.jsx("td",{style:{padding:"8px 16px",fontFamily:"monospace",fontSize:"11px",color:"#e2e8f0"},children:x.physical?.name||x.logical?.name.toLowerCase().replace(/ /g,"_")||x.id}),R.jsx("td",{style:{padding:"8px 16px",color:"#94a3b8",fontFamily:"monospace",fontSize:"11px",textTransform:"uppercase"},children:x.physical?.type||x.logical?.type||"Unknown"}),R.jsx("td",{style:{padding:"8px 16px",color:"#64748b",fontSize:"11px"},children:x.physical?.constraints?.join(", ")||"-"})]},x.id))})]})}):R.jsx("div",{style:{fontSize:"13px",color:"#64748b",fontStyle:"italic"},children:"No physical columns defined yet."})}),u==="sample"&&R.jsx("div",{children:r.sampleData?R.jsx(kT,{table:r,sampleData:r.sampleData}):R.jsx("div",{style:{fontSize:"13px",color:"#64748b",fontStyle:"italic"},children:"No sample data available for this table."})})]})]})};function sl(t,i,{checkForDefaultPrevented:a=!0}={}){return function(u){if(t?.(u),a===!1||!u.defaultPrevented)return i?.(u)}}function Gd(t,i=[]){let a=[];function r(f,s){const h=T.createContext(s),m=a.length;a=[...a,s];const p=v=>{const{scope:x,children:S,...N}=v,w=x?.[t]?.[m]||h,C=T.useMemo(()=>N,Object.values(N));return R.jsx(w.Provider,{value:C,children:S})};p.displayName=f+"Provider";function g(v,x){const S=x?.[t]?.[m]||h,N=T.useContext(S);if(N)return N;if(s!==void 0)return s;throw new Error(`\`${v}\` must be used within \`${f}\``)}return[p,g]}const u=()=>{const f=a.map(s=>T.createContext(s));return function(h){const m=h?.[t]||f;return T.useMemo(()=>({[`__scope${t}`]:{...h,[t]:m}}),[h,m])}};return u.scopeName=t,[r,qT(u,...i)]}function qT(...t){const i=t[0];if(t.length===1)return i;const a=()=>{const r=t.map(u=>({useScope:u(),scopeName:u.scopeName}));return function(f){const s=r.reduce((h,{useScope:m,scopeName:p})=>{const v=m(f)[`__scope${p}`];return{...h,...v}},{});return T.useMemo(()=>({[`__scope${i.scopeName}`]:s}),[s])}};return a.scopeName=i.scopeName,a}function iy(t,i){if(typeof t=="function")return t(i);t!=null&&(t.current=i)}function Xd(...t){return i=>{let a=!1;const r=t.map(u=>{const f=iy(u,i);return!a&&typeof f=="function"&&(a=!0),f});if(a)return()=>{for(let u=0;u<r.length;u++){const f=r[u];typeof f=="function"?f():iy(t[u],null)}}}}function Pu(...t){return T.useCallback(Xd(...t),t)}function ay(t){const i=GT(t),a=T.forwardRef((r,u)=>{const{children:f,...s}=r,h=T.Children.toArray(f),m=h.find(ZT);if(m){const p=m.props.children,g=h.map(v=>v===m?T.Children.count(p)>1?T.Children.only(null):T.isValidElement(p)?p.props.children:null:v);return R.jsx(i,{...s,ref:u,children:T.isValidElement(p)?T.cloneElement(p,void 0,g):null})}return R.jsx(i,{...s,ref:u,children:f})});return a.displayName=`${t}.Slot`,a}function GT(t){const i=T.forwardRef((a,r)=>{const{children:u,...f}=a;if(T.isValidElement(u)){const s=$T(u),h=QT(f,u.props);return u.type!==T.Fragment&&(h.ref=r?Xd(r,s):s),T.cloneElement(u,h)}return T.Children.count(u)>1?T.Children.only(null):null});return i.displayName=`${t}.SlotClone`,i}var XT=Symbol("radix.slottable");function ZT(t){return T.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===XT}function QT(t,i){const a={...i};for(const r in i){const u=t[r],f=i[r];/^on[A-Z]/.test(r)?u&&f?a[r]=(...h)=>{const m=f(...h);return u(...h),m}:u&&(a[r]=u):r==="style"?a[r]={...u,...f}:r==="className"&&(a[r]=[u,f].filter(Boolean).join(" "))}return{...t,...a}}function $T(t){let i=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,a=i&&"isReactWarning"in i&&i.isReactWarning;return a?t.ref:(i=Object.getOwnPropertyDescriptor(t,"ref")?.get,a=i&&"isReactWarning"in i&&i.isReactWarning,a?t.props.ref:t.props.ref||t.ref)}function KT(t){const i=t+"CollectionProvider",[a,r]=Gd(i),[u,f]=a(i,{collectionRef:{current:null},itemMap:new Map}),s=w=>{const{scope:C,children:M}=w,H=J.useRef(null),j=J.useRef(new Map).current;return R.jsx(u,{scope:C,itemMap:j,collectionRef:H,children:M})};s.displayName=i;const h=t+"CollectionSlot",m=ay(h),p=J.forwardRef((w,C)=>{const{scope:M,children:H}=w,j=f(h,M),O=Pu(C,j.collectionRef);return R.jsx(m,{ref:O,children:H})});p.displayName=h;const g=t+"CollectionItemSlot",v="data-radix-collection-item",x=ay(g),S=J.forwardRef((w,C)=>{const{scope:M,children:H,...j}=w,O=J.useRef(null),X=Pu(C,O),K=f(g,M);return J.useEffect(()=>(K.itemMap.set(O,{ref:O,...j}),()=>{K.itemMap.delete(O)})),R.jsx(x,{[v]:"",ref:X,children:H})});S.displayName=g;function N(w){const C=f(t+"CollectionConsumer",w);return J.useCallback(()=>{const H=C.collectionRef.current;if(!H)return[];const j=Array.from(H.querySelectorAll(`[${v}]`));return Array.from(C.itemMap.values()).sort((K,W)=>j.indexOf(K.ref.current)-j.indexOf(W.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:s,Slot:p,ItemSlot:S},N,r]}var ec=globalThis?.document?T.useLayoutEffect:()=>{},FT=my[" useId ".trim().toString()]||(()=>{}),IT=0;function Q1(t){const[i,a]=T.useState(FT());return ec(()=>{a(r=>r??String(IT++))},[t]),i?`radix-${i}`:""}function JT(t){const i=WT(t),a=T.forwardRef((r,u)=>{const{children:f,...s}=r,h=T.Children.toArray(f),m=h.find(eM);if(m){const p=m.props.children,g=h.map(v=>v===m?T.Children.count(p)>1?T.Children.only(null):T.isValidElement(p)?p.props.children:null:v);return R.jsx(i,{...s,ref:u,children:T.isValidElement(p)?T.cloneElement(p,void 0,g):null})}return R.jsx(i,{...s,ref:u,children:f})});return a.displayName=`${t}.Slot`,a}function WT(t){const i=T.forwardRef((a,r)=>{const{children:u,...f}=a;if(T.isValidElement(u)){const s=nM(u),h=tM(f,u.props);return u.type!==T.Fragment&&(h.ref=r?Xd(r,s):s),T.cloneElement(u,h)}return T.Children.count(u)>1?T.Children.only(null):null});return i.displayName=`${t}.SlotClone`,i}var PT=Symbol("radix.slottable");function eM(t){return T.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===PT}function tM(t,i){const a={...i};for(const r in i){const u=t[r],f=i[r];/^on[A-Z]/.test(r)?u&&f?a[r]=(...h)=>{const m=f(...h);return u(...h),m}:u&&(a[r]=u):r==="style"?a[r]={...u,...f}:r==="className"&&(a[r]=[u,f].filter(Boolean).join(" "))}return{...t,...a}}function nM(t){let i=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,a=i&&"isReactWarning"in i&&i.isReactWarning;return a?t.ref:(i=Object.getOwnPropertyDescriptor(t,"ref")?.get,a=i&&"isReactWarning"in i&&i.isReactWarning,a?t.props.ref:t.props.ref||t.ref)}var lM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ta=lM.reduce((t,i)=>{const a=JT(`Primitive.${i}`),r=T.forwardRef((u,f)=>{const{asChild:s,...h}=u,m=s?a:i;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),R.jsx(m,{...h,ref:f})});return r.displayName=`Primitive.${i}`,{...t,[i]:r}},{});function iM(t){const i=T.useRef(t);return T.useEffect(()=>{i.current=t}),T.useMemo(()=>(...a)=>i.current?.(...a),[])}var aM=my[" useInsertionEffect ".trim().toString()]||ec;function $1({prop:t,defaultProp:i,onChange:a=()=>{},caller:r}){const[u,f,s]=oM({defaultProp:i,onChange:a}),h=t!==void 0,m=h?t:u;{const g=T.useRef(t!==void 0);T.useEffect(()=>{const v=g.current;v!==h&&console.warn(`${r} is changing from ${v?"controlled":"uncontrolled"} to ${h?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=h},[h,r])}const p=T.useCallback(g=>{if(h){const v=rM(g)?g(t):g;v!==t&&s.current?.(v)}else f(g)},[h,t,f,s]);return[m,p]}function oM({defaultProp:t,onChange:i}){const[a,r]=T.useState(t),u=T.useRef(a),f=T.useRef(i);return aM(()=>{f.current=i},[i]),T.useEffect(()=>{u.current!==a&&(f.current?.(a),u.current=a)},[a,u]),[a,r,f]}function rM(t){return typeof t=="function"}var uM=T.createContext(void 0);function K1(t){const i=T.useContext(uM);return t||i||"ltr"}var Qf="rovingFocusGroup.onEntryFocus",cM={bubbles:!1,cancelable:!0},Wo="RovingFocusGroup",[pd,F1,sM]=KT(Wo),[fM,I1]=Gd(Wo,[sM]),[dM,hM]=fM(Wo),J1=T.forwardRef((t,i)=>R.jsx(pd.Provider,{scope:t.__scopeRovingFocusGroup,children:R.jsx(pd.Slot,{scope:t.__scopeRovingFocusGroup,children:R.jsx(mM,{...t,ref:i})})}));J1.displayName=Wo;var mM=T.forwardRef((t,i)=>{const{__scopeRovingFocusGroup:a,orientation:r,loop:u=!1,dir:f,currentTabStopId:s,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:m,onEntryFocus:p,preventScrollOnEntryFocus:g=!1,...v}=t,x=T.useRef(null),S=Pu(i,x),N=K1(f),[w,C]=$1({prop:s,defaultProp:h??null,onChange:m,caller:Wo}),[M,H]=T.useState(!1),j=iM(p),O=F1(a),X=T.useRef(!1),[K,W]=T.useState(0);return T.useEffect(()=>{const V=x.current;if(V)return V.addEventListener(Qf,j),()=>V.removeEventListener(Qf,j)},[j]),R.jsx(dM,{scope:a,orientation:r,dir:N,loop:u,currentTabStopId:w,onItemFocus:T.useCallback(V=>C(V),[C]),onItemShiftTab:T.useCallback(()=>H(!0),[]),onFocusableItemAdd:T.useCallback(()=>W(V=>V+1),[]),onFocusableItemRemove:T.useCallback(()=>W(V=>V-1),[]),children:R.jsx(Ta.div,{tabIndex:M||K===0?-1:0,"data-orientation":r,...v,ref:S,style:{outline:"none",...t.style},onMouseDown:sl(t.onMouseDown,()=>{X.current=!0}),onFocus:sl(t.onFocus,V=>{const te=!X.current;if(V.target===V.currentTarget&&te&&!M){const ue=new CustomEvent(Qf,cM);if(V.currentTarget.dispatchEvent(ue),!ue.defaultPrevented){const ae=O().filter(E=>E.focusable),re=ae.find(E=>E.active),oe=ae.find(E=>E.id===w),Q=[re,oe,...ae].filter(Boolean).map(E=>E.ref.current);ex(Q,g)}}X.current=!1}),onBlur:sl(t.onBlur,()=>H(!1))})})}),W1="RovingFocusGroupItem",P1=T.forwardRef((t,i)=>{const{__scopeRovingFocusGroup:a,focusable:r=!0,active:u=!1,tabStopId:f,children:s,...h}=t,m=Q1(),p=f||m,g=hM(W1,a),v=g.currentTabStopId===p,x=F1(a),{onFocusableItemAdd:S,onFocusableItemRemove:N,currentTabStopId:w}=g;return T.useEffect(()=>{if(r)return S(),()=>N()},[r,S,N]),R.jsx(pd.ItemSlot,{scope:a,id:p,focusable:r,active:u,children:R.jsx(Ta.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...h,ref:i,onMouseDown:sl(t.onMouseDown,C=>{r?g.onItemFocus(p):C.preventDefault()}),onFocus:sl(t.onFocus,()=>g.onItemFocus(p)),onKeyDown:sl(t.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){g.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const M=yM(C,g.orientation,g.dir);if(M!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let j=x().filter(O=>O.focusable).map(O=>O.ref.current);if(M==="last")j.reverse();else if(M==="prev"||M==="next"){M==="prev"&&j.reverse();const O=j.indexOf(C.currentTarget);j=g.loop?vM(j,O+1):j.slice(O+1)}setTimeout(()=>ex(j))}}),children:typeof s=="function"?s({isCurrentTabStop:v,hasTabStop:w!=null}):s})})});P1.displayName=W1;var pM={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function gM(t,i){return i!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function yM(t,i,a){const r=gM(t.key,a);if(!(i==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(i==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return pM[r]}function ex(t,i=!1){const a=document.activeElement;for(const r of t)if(r===a||(r.focus({preventScroll:i}),document.activeElement!==a))return}function vM(t,i){return t.map((a,r)=>t[(i+r)%t.length])}var xM=J1,bM=P1;function SM(t,i){return T.useReducer((a,r)=>i[a][r]??a,t)}var tx=t=>{const{present:i,children:a}=t,r=EM(i),u=typeof a=="function"?a({present:r.isPresent}):T.Children.only(a),f=Pu(r.ref,_M(u));return typeof a=="function"||r.isPresent?T.cloneElement(u,{ref:f}):null};tx.displayName="Presence";function EM(t){const[i,a]=T.useState(),r=T.useRef(null),u=T.useRef(t),f=T.useRef("none"),s=t?"mounted":"unmounted",[h,m]=SM(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return T.useEffect(()=>{const p=Ou(r.current);f.current=h==="mounted"?p:"none"},[h]),ec(()=>{const p=r.current,g=u.current;if(g!==t){const x=f.current,S=Ou(p);t?m("MOUNT"):S==="none"||p?.display==="none"?m("UNMOUNT"):m(g&&x!==S?"ANIMATION_OUT":"UNMOUNT"),u.current=t}},[t,m]),ec(()=>{if(i){let p;const g=i.ownerDocument.defaultView??window,v=S=>{const w=Ou(r.current).includes(CSS.escape(S.animationName));if(S.target===i&&w&&(m("ANIMATION_END"),!u.current)){const C=i.style.animationFillMode;i.style.animationFillMode="forwards",p=g.setTimeout(()=>{i.style.animationFillMode==="forwards"&&(i.style.animationFillMode=C)})}},x=S=>{S.target===i&&(f.current=Ou(r.current))};return i.addEventListener("animationstart",x),i.addEventListener("animationcancel",v),i.addEventListener("animationend",v),()=>{g.clearTimeout(p),i.removeEventListener("animationstart",x),i.removeEventListener("animationcancel",v),i.removeEventListener("animationend",v)}}else m("ANIMATION_END")},[i,m]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:T.useCallback(p=>{r.current=p?getComputedStyle(p):null,a(p)},[])}}function Ou(t){return t?.animationName||"none"}function _M(t){let i=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,a=i&&"isReactWarning"in i&&i.isReactWarning;return a?t.ref:(i=Object.getOwnPropertyDescriptor(t,"ref")?.get,a=i&&"isReactWarning"in i&&i.isReactWarning,a?t.props.ref:t.props.ref||t.ref)}var sc="Tabs",[wM]=Gd(sc,[I1]),nx=I1(),[AM,Zd]=wM(sc),lx=T.forwardRef((t,i)=>{const{__scopeTabs:a,value:r,onValueChange:u,defaultValue:f,orientation:s="horizontal",dir:h,activationMode:m="automatic",...p}=t,g=K1(h),[v,x]=$1({prop:r,onChange:u,defaultProp:f??"",caller:sc});return R.jsx(AM,{scope:a,baseId:Q1(),value:v,onValueChange:x,orientation:s,dir:g,activationMode:m,children:R.jsx(Ta.div,{dir:g,"data-orientation":s,...p,ref:i})})});lx.displayName=sc;var ix="TabsList",ax=T.forwardRef((t,i)=>{const{__scopeTabs:a,loop:r=!0,...u}=t,f=Zd(ix,a),s=nx(a);return R.jsx(xM,{asChild:!0,...s,orientation:f.orientation,dir:f.dir,loop:r,children:R.jsx(Ta.div,{role:"tablist","aria-orientation":f.orientation,...u,ref:i})})});ax.displayName=ix;var ox="TabsTrigger",rx=T.forwardRef((t,i)=>{const{__scopeTabs:a,value:r,disabled:u=!1,...f}=t,s=Zd(ox,a),h=nx(a),m=sx(s.baseId,r),p=fx(s.baseId,r),g=r===s.value;return R.jsx(bM,{asChild:!0,...h,focusable:!u,active:g,children:R.jsx(Ta.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":p,"data-state":g?"active":"inactive","data-disabled":u?"":void 0,disabled:u,id:m,...f,ref:i,onMouseDown:sl(t.onMouseDown,v=>{!u&&v.button===0&&v.ctrlKey===!1?s.onValueChange(r):v.preventDefault()}),onKeyDown:sl(t.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&s.onValueChange(r)}),onFocus:sl(t.onFocus,()=>{const v=s.activationMode!=="manual";!g&&!u&&v&&s.onValueChange(r)})})})});rx.displayName=ox;var ux="TabsContent",cx=T.forwardRef((t,i)=>{const{__scopeTabs:a,value:r,forceMount:u,children:f,...s}=t,h=Zd(ux,a),m=sx(h.baseId,r),p=fx(h.baseId,r),g=r===h.value,v=T.useRef(g);return T.useEffect(()=>{const x=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(x)},[]),R.jsx(tx,{present:u||g,children:({present:x})=>R.jsx(Ta.div,{"data-state":g?"active":"inactive","data-orientation":h.orientation,role:"tabpanel","aria-labelledby":m,hidden:!x,id:p,tabIndex:0,...s,ref:i,style:{...t.style,animationDuration:v.current?"0s":void 0},children:x&&f})})});cx.displayName=ux;function sx(t,i){return`${t}-trigger-${i}`}function fx(t,i){return`${t}-content-${i}`}var CM=lx,dx=ax,hx=rx,mx=cx;function px(t){var i,a,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var u=t.length;for(i=0;i<u;i++)t[i]&&(a=px(t[i]))&&(r&&(r+=" "),r+=a)}else for(a in t)t[a]&&(r&&(r+=" "),r+=a);return r}function NM(){for(var t,i,a=0,r="",u=arguments.length;a<u;a++)(t=arguments[a])&&(i=px(t))&&(r&&(r+=" "),r+=i);return r}const TM=(t,i)=>{const a=new Array(t.length+i.length);for(let r=0;r<t.length;r++)a[r]=t[r];for(let r=0;r<i.length;r++)a[t.length+r]=i[r];return a},MM=(t,i)=>({classGroupId:t,validator:i}),gx=(t=new Map,i=null,a)=>({nextPart:t,validators:i,classGroupId:a}),tc="-",oy=[],zM="arbitrary..",OM=t=>{const i=DM(t),{conflictingClassGroups:a,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return RM(s);const h=s.split(tc),m=h[0]===""&&h.length>1?1:0;return yx(h,m,i)},getConflictingClassGroupIds:(s,h)=>{if(h){const m=r[s],p=a[s];return m?p?TM(p,m):m:p||oy}return a[s]||oy}}},yx=(t,i,a)=>{if(t.length-i===0)return a.classGroupId;const u=t[i],f=a.nextPart.get(u);if(f){const p=yx(t,i+1,f);if(p)return p}const s=a.validators;if(s===null)return;const h=i===0?t.join(tc):t.slice(i).join(tc),m=s.length;for(let p=0;p<m;p++){const g=s[p];if(g.validator(h))return g.classGroupId}},RM=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const i=t.slice(1,-1),a=i.indexOf(":"),r=i.slice(0,a);return r?zM+r:void 0})(),DM=t=>{const{theme:i,classGroups:a}=t;return HM(a,i)},HM=(t,i)=>{const a=gx();for(const r in t){const u=t[r];Qd(u,a,r,i)}return a},Qd=(t,i,a,r)=>{const u=t.length;for(let f=0;f<u;f++){const s=t[f];UM(s,i,a,r)}},UM=(t,i,a,r)=>{if(typeof t=="string"){LM(t,i,a);return}if(typeof t=="function"){jM(t,i,a,r);return}kM(t,i,a,r)},LM=(t,i,a)=>{const r=t===""?i:vx(i,t);r.classGroupId=a},jM=(t,i,a,r)=>{if(BM(t)){Qd(t(r),i,a,r);return}i.validators===null&&(i.validators=[]),i.validators.push(MM(a,t))},kM=(t,i,a,r)=>{const u=Object.entries(t),f=u.length;for(let s=0;s<f;s++){const[h,m]=u[s];Qd(m,vx(i,h),a,r)}},vx=(t,i)=>{let a=t;const r=i.split(tc),u=r.length;for(let f=0;f<u;f++){const s=r[f];let h=a.nextPart.get(s);h||(h=gx(),a.nextPart.set(s,h)),a=h}return a},BM=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,YM=t=>{if(t<1)return{get:()=>{},set:()=>{}};let i=0,a=Object.create(null),r=Object.create(null);const u=(f,s)=>{a[f]=s,i++,i>t&&(i=0,r=a,a=Object.create(null))};return{get(f){let s=a[f];if(s!==void 0)return s;if((s=r[f])!==void 0)return u(f,s),s},set(f,s){f in a?a[f]=s:u(f,s)}}},gd="!",ry=":",VM=[],uy=(t,i,a,r,u)=>({modifiers:t,hasImportantModifier:i,baseClassName:a,maybePostfixModifierPosition:r,isExternal:u}),qM=t=>{const{prefix:i,experimentalParseClassName:a}=t;let r=u=>{const f=[];let s=0,h=0,m=0,p;const g=u.length;for(let w=0;w<g;w++){const C=u[w];if(s===0&&h===0){if(C===ry){f.push(u.slice(m,w)),m=w+1;continue}if(C==="/"){p=w;continue}}C==="["?s++:C==="]"?s--:C==="("?h++:C===")"&&h--}const v=f.length===0?u:u.slice(m);let x=v,S=!1;v.endsWith(gd)?(x=v.slice(0,-1),S=!0):v.startsWith(gd)&&(x=v.slice(1),S=!0);const N=p&&p>m?p-m:void 0;return uy(f,S,x,N)};if(i){const u=i+ry,f=r;r=s=>s.startsWith(u)?f(s.slice(u.length)):uy(VM,!1,s,void 0,!0)}if(a){const u=r;r=f=>a({className:f,parseClassName:u})}return r},GM=t=>{const i=new Map;return t.orderSensitiveModifiers.forEach((a,r)=>{i.set(a,1e6+r)}),a=>{const r=[];let u=[];for(let f=0;f<a.length;f++){const s=a[f],h=s[0]==="[",m=i.has(s);h||m?(u.length>0&&(u.sort(),r.push(...u),u=[]),r.push(s)):u.push(s)}return u.length>0&&(u.sort(),r.push(...u)),r}},XM=t=>({cache:YM(t.cacheSize),parseClassName:qM(t),sortModifiers:GM(t),...OM(t)}),ZM=/\s+/,QM=(t,i)=>{const{parseClassName:a,getClassGroupId:r,getConflictingClassGroupIds:u,sortModifiers:f}=i,s=[],h=t.trim().split(ZM);let m="";for(let p=h.length-1;p>=0;p-=1){const g=h[p],{isExternal:v,modifiers:x,hasImportantModifier:S,baseClassName:N,maybePostfixModifierPosition:w}=a(g);if(v){m=g+(m.length>0?" "+m:m);continue}let C=!!w,M=r(C?N.substring(0,w):N);if(!M){if(!C){m=g+(m.length>0?" "+m:m);continue}if(M=r(N),!M){m=g+(m.length>0?" "+m:m);continue}C=!1}const H=x.length===0?"":x.length===1?x[0]:f(x).join(":"),j=S?H+gd:H,O=j+M;if(s.indexOf(O)>-1)continue;s.push(O);const X=u(M,C);for(let K=0;K<X.length;++K){const W=X[K];s.push(j+W)}m=g+(m.length>0?" "+m:m)}return m},$M=(...t)=>{let i=0,a,r,u="";for(;i<t.length;)(a=t[i++])&&(r=xx(a))&&(u&&(u+=" "),u+=r);return u},xx=t=>{if(typeof t=="string")return t;let i,a="";for(let r=0;r<t.length;r++)t[r]&&(i=xx(t[r]))&&(a&&(a+=" "),a+=i);return a},KM=(t,...i)=>{let a,r,u,f;const s=m=>{const p=i.reduce((g,v)=>v(g),t());return a=XM(p),r=a.cache.get,u=a.cache.set,f=h,h(m)},h=m=>{const p=r(m);if(p)return p;const g=QM(m,a);return u(m,g),g};return f=s,(...m)=>f($M(...m))},FM=[],pt=t=>{const i=a=>a[t]||FM;return i.isThemeGetter=!0,i},bx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Sx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,IM=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,JM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,WM=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,PM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ez=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Gl=t=>IM.test(t),Ae=t=>!!t&&!Number.isNaN(Number(t)),Xl=t=>!!t&&Number.isInteger(Number(t)),$f=t=>t.endsWith("%")&&Ae(t.slice(0,-1)),ul=t=>JM.test(t),Ex=()=>!0,nz=t=>WM.test(t)&&!PM.test(t),$d=()=>!1,lz=t=>ez.test(t),iz=t=>tz.test(t),az=t=>!me(t)&&!pe(t),oz=t=>Pl(t,Ax,$d),me=t=>bx.test(t),Si=t=>Pl(t,Cx,nz),cy=t=>Pl(t,mz,Ae),rz=t=>Pl(t,Tx,Ex),uz=t=>Pl(t,Nx,$d),sy=t=>Pl(t,_x,$d),cz=t=>Pl(t,wx,iz),Ru=t=>Pl(t,Mx,lz),pe=t=>Sx.test(t),Ro=t=>Mi(t,Cx),sz=t=>Mi(t,Nx),fy=t=>Mi(t,_x),fz=t=>Mi(t,Ax),dz=t=>Mi(t,wx),Du=t=>Mi(t,Mx,!0),hz=t=>Mi(t,Tx,!0),Pl=(t,i,a)=>{const r=bx.exec(t);return r?r[1]?i(r[1]):a(r[2]):!1},Mi=(t,i,a=!1)=>{const r=Sx.exec(t);return r?r[1]?i(r[1]):a:!1},_x=t=>t==="position"||t==="percentage",wx=t=>t==="image"||t==="url",Ax=t=>t==="length"||t==="size"||t==="bg-size",Cx=t=>t==="length",mz=t=>t==="number",Nx=t=>t==="family-name",Tx=t=>t==="number"||t==="weight",Mx=t=>t==="shadow",pz=()=>{const t=pt("color"),i=pt("font"),a=pt("text"),r=pt("font-weight"),u=pt("tracking"),f=pt("leading"),s=pt("breakpoint"),h=pt("container"),m=pt("spacing"),p=pt("radius"),g=pt("shadow"),v=pt("inset-shadow"),x=pt("text-shadow"),S=pt("drop-shadow"),N=pt("blur"),w=pt("perspective"),C=pt("aspect"),M=pt("ease"),H=pt("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],X=()=>[...O(),pe,me],K=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto","contain","none"],V=()=>[pe,me,m],te=()=>[Gl,"full","auto",...V()],ue=()=>[Xl,"none","subgrid",pe,me],ae=()=>["auto",{span:["full",Xl,pe,me]},Xl,pe,me],re=()=>[Xl,"auto",pe,me],oe=()=>["auto","min","max","fr",pe,me],A=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],E=()=>["auto",...V()],L=()=>[Gl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...V()],$=()=>[Gl,"screen","full","dvw","lvw","svw","min","max","fit",...V()],k=()=>[Gl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...V()],Y=()=>[t,pe,me],_=()=>[...O(),fy,sy,{position:[pe,me]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",fz,oz,{size:[pe,me]}],P=()=>[$f,Ro,Si],ie=()=>["","none","full",p,pe,me],ce=()=>["",Ae,Ro,Si],fe=()=>["solid","dashed","dotted","double"],Se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],de=()=>[Ae,$f,fy,sy],Ne=()=>["","none",N,pe,me],je=()=>["none",Ae,pe,me],Fe=()=>["none",Ae,pe,me],lt=()=>[Ae,pe,me],Ve=()=>[Gl,"full",...V()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ul],breakpoint:[ul],color:[Ex],container:[ul],"drop-shadow":[ul],ease:["in","out","in-out"],font:[az],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ul],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ul],shadow:[ul],spacing:["px",Ae],text:[ul],"text-shadow":[ul],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Gl,me,pe,C]}],container:["container"],columns:[{columns:[Ae,me,pe,h]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:X()}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:te()}],"inset-x":[{"inset-x":te()}],"inset-y":[{"inset-y":te()}],start:[{"inset-s":te(),start:te()}],end:[{"inset-e":te(),end:te()}],"inset-bs":[{"inset-bs":te()}],"inset-be":[{"inset-be":te()}],top:[{top:te()}],right:[{right:te()}],bottom:[{bottom:te()}],left:[{left:te()}],visibility:["visible","invisible","collapse"],z:[{z:[Xl,"auto",pe,me]}],basis:[{basis:[Gl,"full","auto",h,...V()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ae,Gl,"auto","initial","none",me]}],grow:[{grow:["",Ae,pe,me]}],shrink:[{shrink:["",Ae,pe,me]}],order:[{order:[Xl,"first","last","none",pe,me]}],"grid-cols":[{"grid-cols":ue()}],"col-start-end":[{col:ae()}],"col-start":[{"col-start":re()}],"col-end":[{"col-end":re()}],"grid-rows":[{"grid-rows":ue()}],"row-start-end":[{row:ae()}],"row-start":[{"row-start":re()}],"row-end":[{"row-end":re()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":oe()}],"auto-rows":[{"auto-rows":oe()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...A(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...A()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:V()}],px:[{px:V()}],py:[{py:V()}],ps:[{ps:V()}],pe:[{pe:V()}],pbs:[{pbs:V()}],pbe:[{pbe:V()}],pt:[{pt:V()}],pr:[{pr:V()}],pb:[{pb:V()}],pl:[{pl:V()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mbs:[{mbs:E()}],mbe:[{mbe:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":V()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":V()}],"space-y-reverse":["space-y-reverse"],size:[{size:L()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...k()]}],"min-block-size":[{"min-block":["auto",...k()]}],"max-block-size":[{"max-block":["none",...k()]}],w:[{w:[h,"screen",...L()]}],"min-w":[{"min-w":[h,"screen","none",...L()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[s]},...L()]}],h:[{h:["screen","lh",...L()]}],"min-h":[{"min-h":["screen","lh","none",...L()]}],"max-h":[{"max-h":["screen","lh",...L()]}],"font-size":[{text:["base",a,Ro,Si]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,hz,rz]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$f,me]}],"font-family":[{font:[sz,uz,i]}],"font-features":[{"font-features":[me]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[u,pe,me]}],"line-clamp":[{"line-clamp":[Ae,"none",pe,cy]}],leading:[{leading:[f,...V()]}],"list-image":[{"list-image":["none",pe,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pe,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Y()}],"text-color":[{text:Y()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ae,"from-font","auto",pe,Si]}],"text-decoration-color":[{decoration:Y()}],"underline-offset":[{"underline-offset":[Ae,"auto",pe,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe,me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",pe,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:_()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Xl,pe,me],radial:["",pe,me],conic:[Xl,pe,me]},dz,cz]}],"bg-color":[{bg:Y()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:Y()}],"gradient-via":[{via:Y()}],"gradient-to":[{to:Y()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:Y()}],"border-color-x":[{"border-x":Y()}],"border-color-y":[{"border-y":Y()}],"border-color-s":[{"border-s":Y()}],"border-color-e":[{"border-e":Y()}],"border-color-bs":[{"border-bs":Y()}],"border-color-be":[{"border-be":Y()}],"border-color-t":[{"border-t":Y()}],"border-color-r":[{"border-r":Y()}],"border-color-b":[{"border-b":Y()}],"border-color-l":[{"border-l":Y()}],"divide-color":[{divide:Y()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ae,pe,me]}],"outline-w":[{outline:["",Ae,Ro,Si]}],"outline-color":[{outline:Y()}],shadow:[{shadow:["","none",g,Du,Ru]}],"shadow-color":[{shadow:Y()}],"inset-shadow":[{"inset-shadow":["none",v,Du,Ru]}],"inset-shadow-color":[{"inset-shadow":Y()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Y()}],"ring-offset-w":[{"ring-offset":[Ae,Si]}],"ring-offset-color":[{"ring-offset":Y()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":Y()}],"text-shadow":[{"text-shadow":["none",x,Du,Ru]}],"text-shadow-color":[{"text-shadow":Y()}],opacity:[{opacity:[Ae,pe,me]}],"mix-blend":[{"mix-blend":[...Se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Se()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ae]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":Y()}],"mask-image-linear-to-color":[{"mask-linear-to":Y()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":Y()}],"mask-image-t-to-color":[{"mask-t-to":Y()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":Y()}],"mask-image-r-to-color":[{"mask-r-to":Y()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":Y()}],"mask-image-b-to-color":[{"mask-b-to":Y()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":Y()}],"mask-image-l-to-color":[{"mask-l-to":Y()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":Y()}],"mask-image-x-to-color":[{"mask-x-to":Y()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":Y()}],"mask-image-y-to-color":[{"mask-y-to":Y()}],"mask-image-radial":[{"mask-radial":[pe,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":Y()}],"mask-image-radial-to-color":[{"mask-radial-to":Y()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[Ae]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":Y()}],"mask-image-conic-to-color":[{"mask-conic-to":Y()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:_()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pe,me]}],filter:[{filter:["","none",pe,me]}],blur:[{blur:Ne()}],brightness:[{brightness:[Ae,pe,me]}],contrast:[{contrast:[Ae,pe,me]}],"drop-shadow":[{"drop-shadow":["","none",S,Du,Ru]}],"drop-shadow-color":[{"drop-shadow":Y()}],grayscale:[{grayscale:["",Ae,pe,me]}],"hue-rotate":[{"hue-rotate":[Ae,pe,me]}],invert:[{invert:["",Ae,pe,me]}],saturate:[{saturate:[Ae,pe,me]}],sepia:[{sepia:["",Ae,pe,me]}],"backdrop-filter":[{"backdrop-filter":["","none",pe,me]}],"backdrop-blur":[{"backdrop-blur":Ne()}],"backdrop-brightness":[{"backdrop-brightness":[Ae,pe,me]}],"backdrop-contrast":[{"backdrop-contrast":[Ae,pe,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ae,pe,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ae,pe,me]}],"backdrop-invert":[{"backdrop-invert":["",Ae,pe,me]}],"backdrop-opacity":[{"backdrop-opacity":[Ae,pe,me]}],"backdrop-saturate":[{"backdrop-saturate":[Ae,pe,me]}],"backdrop-sepia":[{"backdrop-sepia":["",Ae,pe,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":V()}],"border-spacing-x":[{"border-spacing-x":V()}],"border-spacing-y":[{"border-spacing-y":V()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pe,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ae,"initial",pe,me]}],ease:[{ease:["linear","initial",M,pe,me]}],delay:[{delay:[Ae,pe,me]}],animate:[{animate:["none",H,pe,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,pe,me]}],"perspective-origin":[{"perspective-origin":X()}],rotate:[{rotate:je()}],"rotate-x":[{"rotate-x":je()}],"rotate-y":[{"rotate-y":je()}],"rotate-z":[{"rotate-z":je()}],scale:[{scale:Fe()}],"scale-x":[{"scale-x":Fe()}],"scale-y":[{"scale-y":Fe()}],"scale-z":[{"scale-z":Fe()}],"scale-3d":["scale-3d"],skew:[{skew:lt()}],"skew-x":[{"skew-x":lt()}],"skew-y":[{"skew-y":lt()}],transform:[{transform:[pe,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:X()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ve()}],"translate-x":[{"translate-x":Ve()}],"translate-y":[{"translate-y":Ve()}],"translate-z":[{"translate-z":Ve()}],"translate-none":["translate-none"],accent:[{accent:Y()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Y()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",pe,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mbs":[{"scroll-mbs":V()}],"scroll-mbe":[{"scroll-mbe":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pbs":[{"scroll-pbs":V()}],"scroll-pbe":[{"scroll-pbe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",pe,me]}],fill:[{fill:["none",...Y()]}],"stroke-w":[{stroke:[Ae,Ro,Si,cy]}],stroke:[{stroke:["none",...Y()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},gz=KM(pz);function Kd(...t){return gz(NM(t))}const yz=CM,zx=T.forwardRef(({className:t,...i},a)=>R.jsx(dx,{ref:a,className:Kd("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...i}));zx.displayName=dx.displayName;const yd=T.forwardRef(({className:t,...i},a)=>R.jsx(hx,{ref:a,className:Kd("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",t),...i}));yd.displayName=hx.displayName;const vd=T.forwardRef(({className:t,...i},a)=>R.jsx(mx,{ref:a,className:Kd("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...i}));vd.displayName=mx.displayName;const vz="modulepreload",xz=function(t,i){return new URL(t,i).href},dy={},bz=function(i,a,r){let u=Promise.resolve();if(a&&a.length>0){let p=function(g){return Promise.all(g.map(v=>Promise.resolve(v).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};const s=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),m=h?.nonce||h?.getAttribute("nonce");u=p(a.map(g=>{if(g=xz(g,r),g in dy)return;dy[g]=!0;const v=g.endsWith(".css"),x=v?'[rel="stylesheet"]':"";if(r)for(let N=s.length-1;N>=0;N--){const w=s[N];if(w.href===g&&(!v||w.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${g}"]${x}`))return;const S=document.createElement("link");if(S.rel=v?"stylesheet":vz,v||(S.as="script"),S.crossOrigin="",S.href=g,m&&S.setAttribute("nonce",m),document.head.appendChild(S),v)return new Promise((N,w)=>{S.addEventListener("load",N),S.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${g}`)))})}))}function f(s){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=s,window.dispatchEvent(h),!h.defaultPrevented)throw s}return u.then(s=>{for(const h of s||[])h.status==="rejected"&&f(h.reason);return i().catch(f)})},Sz=()=>{const{schema:t,error:i,isCliMode:a,currentModelSlug:r,parseAndSetSchema:u}=Nn(),[f,s]=T.useState("");T.useEffect(()=>{t&&bz(()=>Promise.resolve().then(()=>eT),void 0,import.meta.url).then(m=>{s(m.dump(t,{indent:2}))})},[t]);const h=async()=>{if(u(f),a)try{const m=r?`/api/save-yaml?model=${r}`:"/api/save-yaml";await fetch(m,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({yaml:f})})}catch(m){console.error("Failed to save YAML to file:",m)}};return R.jsxs("div",{className:"flex-1 flex flex-col gap-3 overflow-hidden p-4 pt-2 h-full",children:[!a&&R.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-blue-500/10 border border-blue-500/30 rounded-md shrink-0",children:[R.jsx(ly,{size:14,className:"text-blue-400"}),R.jsx("span",{className:"text-[11px] text-blue-300 font-medium",children:"Sandbox Mode (Temporary)"})]}),R.jsxs("div",{className:"relative flex-1 flex flex-col min-h-0",children:[R.jsx("textarea",{className:"flex-1 w-full p-4 bg-slate-800/50 text-slate-100 border border-slate-700 rounded-md font-mono text-sm focus:outline-none focus:ring-1 focus:ring-blue-500/50 transition-all resize-none shadow-inner",placeholder:"tables: ...",value:f,onChange:m=>s(m.target.value)}),i&&R.jsxs("div",{className:"mt-2 p-3 bg-red-500/10 border border-red-500/30 rounded-md text-red-400 text-xs flex gap-2 items-start shrink-0",children:[R.jsx(ly,{size:14,className:"shrink-0 mt-0.5"}),R.jsx("span",{children:i})]})]}),R.jsxs("div",{className:"flex justify-between items-center pt-1 shrink-0",children:[R.jsx("div",{className:"text-[10px] text-slate-500 italic",children:a?"Saves to local file":"Changes reset on reload"}),R.jsxs("button",{onClick:h,className:`flex items-center gap-2 px-4 py-2 rounded-md font-medium text-sm transition-all shadow-lg shrink-0 ${a?"bg-blue-600 hover:bg-blue-700 text-white":"bg-emerald-600 hover:bg-emerald-700 text-white"}`,children:[a?R.jsx(DT,{size:16}):R.jsx(OT,{size:16}),a?"Save & Update":"Apply Changes"]})]})]})},Ez=()=>{const{schema:t,setSelectedTableId:i,setFocusNodeId:a}=Nn(),[r,u]=T.useState("");if(!t)return null;const f=t.tables.filter(m=>m.name.toLowerCase().includes(r.toLowerCase())||m.id.toLowerCase().includes(r.toLowerCase())),s=t.domains?.filter(m=>m.name.toLowerCase().includes(r.toLowerCase())||m.id.toLowerCase().includes(r.toLowerCase()))||[],h=m=>{i(m),a(m)};return R.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden p-4 pt-2",children:[R.jsxs("div",{className:"relative mb-4 shrink-0",children:[R.jsx(UT,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),R.jsx("input",{type:"text",value:r,onChange:m=>u(m.target.value),placeholder:"Search entities...",className:"w-full pl-9 pr-4 py-2 bg-slate-800 border border-slate-700 rounded-md text-sm text-slate-100 focus:outline-none focus:ring-1 focus:ring-blue-500/50 transition-all shadow-sm"})]}),R.jsxs("div",{className:"flex-1 space-y-6 overflow-auto pr-1",children:[s.length>0&&R.jsxs("section",{children:[R.jsxs("div",{className:"flex items-center gap-2 mb-2 px-1",children:[R.jsx(AT,{size:12,className:"text-slate-500"}),R.jsx("h3",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-500",children:"Domains"})]}),R.jsx("div",{className:"space-y-1",children:s.map(m=>R.jsxs("button",{onClick:()=>h(m.id),className:"w-full flex items-center justify-between group p-2 text-sm rounded border border-transparent hover:bg-slate-800/50 hover:border-slate-700/50 text-slate-300 transition-all text-left",children:[R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:m.color||"#3b82f6"}}),R.jsx("span",{className:"font-medium group-hover:text-blue-400",children:m.name})]}),R.jsx(ny,{size:12,className:"opacity-0 group-hover:opacity-100 text-slate-500 transition-opacity"})]},m.id))})]}),R.jsxs("section",{children:[R.jsxs("div",{className:"flex items-center gap-2 mb-2 px-1",children:[R.jsx(_T,{size:12,className:"text-slate-500"}),R.jsx("h3",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-500",children:"Tables"})]}),R.jsx("div",{className:"space-y-1",children:f.map(m=>R.jsxs("button",{onClick:()=>h(m.id),className:"w-full flex items-center justify-between group p-2 text-sm rounded border border-transparent hover:bg-slate-800/50 hover:border-slate-700/50 text-slate-300 transition-all text-left",children:[R.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[R.jsx("span",{className:"truncate font-medium group-hover:text-blue-400",children:m.name}),R.jsxs("span",{className:"text-[10px] text-slate-500 shrink-0",children:["(",m.columns?.length||0,")"]})]}),R.jsx(ny,{size:12,className:"opacity-0 group-hover:opacity-100 text-slate-500 transition-opacity"})]},m.id))})]}),f.length===0&&s.length===0&&R.jsx("div",{className:"text-center py-10",children:R.jsxs("p",{className:"text-sm text-slate-500 italic",children:['No entities found for "',r,'"']})})]})]})},_z=()=>{const{isSidebarOpen:t,setIsSidebarOpen:i}=Nn();return R.jsx("button",{onClick:()=>i(!t),className:"absolute -right-3.5 top-1/2 -translate-y-1/2 z-[60] flex h-7 w-7 items-center justify-center rounded-full border border-slate-700 bg-slate-900 text-slate-400 hover:text-white hover:bg-slate-800 transition-all shadow-xl","aria-label":t?"Collapse sidebar":"Expand sidebar",children:t?R.jsx(gT,{size:16}):R.jsx(vT,{size:16})})},wz=()=>{const{availableFiles:t,currentModelSlug:i,setCurrentModel:a,isSidebarOpen:r}=Nn();if(!r||t.length<=1)return null;const u=i||t[0]?.slug;return R.jsxs("div",{className:"px-4 mb-4",children:[R.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-500 mb-1.5 px-1",children:"Current Model"}),R.jsxs("div",{className:"relative group",children:[R.jsx("select",{value:u,onChange:f=>a(f.target.value),className:"w-full pl-9 pr-8 py-2 bg-slate-800 border border-slate-700 rounded-md text-sm text-slate-100 appearance-none focus:outline-none focus:ring-1 focus:ring-blue-500/50 transition-all shadow-sm cursor-pointer hover:bg-slate-750",children:t.map(f=>R.jsx("option",{value:f.slug,children:f.name},f.slug))}),R.jsx(ST,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-blue-400 pointer-events-none"}),R.jsx(mT,{size:14,className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none group-hover:text-slate-300"})]})]})},Az=""+new URL("../favicon.svg",import.meta.url).href,Cz=()=>{const{isSidebarOpen:t,activeTab:i,setActiveTab:a,isCliMode:r}=Nn();return R.jsxs("div",{className:`relative h-full flex flex-col border-r border-slate-800 bg-slate-900 transition-all duration-300 ease-in-out shadow-2xl z-50 ${t?"w-[400px]":"w-[50px]"}`,children:[R.jsx(_z,{}),R.jsxs("div",{className:`p-4 border-b border-slate-800 flex items-center justify-between ${!t&&"hidden"}`,children:[R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx("img",{src:Az,alt:"Modscape Logo",className:"w-5 h-5 rounded-md"}),R.jsx("h1",{className:"text-base font-bold text-white tracking-tight",children:"Modscape"})]}),r&&R.jsx("span",{className:"px-1.5 py-0.5 bg-emerald-500/10 border border-emerald-500/30 text-emerald-400 text-[10px] font-bold rounded uppercase",children:"Live"})]}),R.jsx("div",{className:"mt-4",children:t&&R.jsx(wz,{})}),R.jsxs(yz,{value:i,onValueChange:u=>a(u),className:`flex-1 flex flex-col overflow-hidden ${!t&&"items-center py-4"}`,children:[R.jsx("div",{className:`px-4 pt-4 ${!t&&"px-0"}`,children:R.jsxs(zx,{className:`w-full bg-slate-800/50 p-1 border border-slate-700/50 ${!t&&"flex-col h-auto w-10 gap-2 p-0 bg-transparent border-none"}`,children:[R.jsxs(yd,{value:"editor",className:`flex-1 gap-2 ${!t&&"w-9 h-9 p-0 rounded-md bg-slate-800/50 hover:bg-slate-800 text-slate-400 data-[state=active]:bg-blue-600 data-[state=active]:text-white shadow-sm transition-all"}`,title:"Editor",children:[R.jsx(MT,{size:14}),t&&R.jsx("span",{children:"Editor"})]}),R.jsxs(yd,{value:"entities",className:`flex-1 gap-2 ${!t&&"w-9 h-9 p-0 rounded-md bg-slate-800/50 hover:bg-slate-800 text-slate-400 data-[state=active]:bg-blue-600 data-[state=active]:text-white shadow-sm transition-all"}`,title:"Entities",children:[R.jsx(NT,{size:14}),t&&R.jsx("span",{children:"Entities"})]})]})}),t&&R.jsxs("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:[R.jsx(vd,{value:"editor",className:"flex-1 flex flex-col min-h-0 mt-0 data-[state=inactive]:hidden",children:R.jsx(Sz,{})}),R.jsx(vd,{value:"entities",className:"flex-1 flex flex-col min-h-0 mt-0 data-[state=inactive]:hidden",children:R.jsx(Ez,{})})]})]}),t&&R.jsx("div",{className:"p-3 border-t border-slate-800 bg-slate-950/20",children:R.jsx("p",{className:"text-[10px] text-slate-500 text-center font-medium",children:"Modscape v0.1.2"})})]})},Nz={table:iT,domain:oT},Tz={stroke:"#4ade80",strokeWidth:3},Mz={stroke:"#334155",strokeWidth:1};function zz(){const{schema:t,setSelectedTableId:i,selectedTableId:a,updateNodePosition:r,saveLayout:u,isCliMode:f,focusNodeId:s,setFocusNodeId:h}=Nn(),[m,p,g]=E3([]),[v,x,S]=_3([]),{setCenter:N,getNode:w}=uc();T.useEffect(()=>{if(s){const j=w(s);if(j){const O=j.position.x+(j.width||0)/2,X=j.position.y+(j.height||0)/2;N(O,X,{zoom:1.2,duration:800})}h(null)}},[s,w,N,h]),T.useEffect(()=>{if(!t)return;const j=[];t.domains&&t.domains.forEach(O=>{const X=t.layout?.[O.id]||{x:0,y:0,width:600,height:400};j.push({id:O.id,type:"domain",position:{x:X.x,y:X.y},style:{width:X.width||600,height:X.height||400},data:{label:O.name,color:O.color}})}),t.tables.forEach((O,X)=>{const K=t.domains?.find(V=>V.tables.includes(O.id)),W=t.layout?.[O.id]||{x:X*300,y:100};j.push({id:O.id,type:"table",position:{x:W.x,y:W.y},data:{table:O},parentNode:K?.id,extent:K?"parent":void 0})}),p(j)},[t,p]);const C=T.useMemo(()=>!t||!t.relationships?[]:t.relationships.map((j,O)=>{const X=a===j.from.table||a===j.to.table;return{id:`e-${O}`,source:j.from.table,target:j.to.table,label:X?j.type:void 0,animated:X,style:X?Tz:Mz,zIndex:X?10:1}}),[t,a]);T.useEffect(()=>{x(C)},[C,x]);const M=T.useCallback(j=>x(O=>nv(j,O)),[x]),H=T.useCallback((j,O)=>{f&&(r(O.id,O.position.x,O.position.y),u())},[f,r,u]);return R.jsx("div",{className:"flex-1 relative h-full",children:R.jsxs(jv,{nodes:m,edges:v,onNodesChange:g,onEdgesChange:S,onNodeDragStop:H,onConnect:M,nodeTypes:Nz,onNodeClick:(j,O)=>i(O.id),onPaneClick:()=>i(null),fitView:!0,children:[R.jsx(k3,{color:"#334155",gap:20}),R.jsx(O3,{})]})})}function Oz(){const{isCliMode:t,fetchAvailableFiles:i,setCurrentModel:a,setSchema:r}=Nn(),u=!!window.__MODSCAPE_DATA__;return T.useEffect(()=>{if(t){i().then(()=>{const s=new URLSearchParams(window.location.search).get("model");s?a(s):fetch("/api/model").then(h=>h.json()).then(h=>r(h))});return}if(u){const f=window.__MODSCAPE_DATA__;f&&f.isMultiFile&&f.models?i().then(()=>{const h=new URLSearchParams(window.location.search).get("model");h?a(h):(r(f.models[0].schema),a(f.models[0].slug))}):f&&f.schema?r(f.schema):r(f)}},[t,u,i,a,r]),R.jsx(Ld,{children:R.jsxs("div",{className:"flex h-screen w-screen overflow-hidden bg-slate-950 text-slate-100 font-sans",children:[R.jsx(Cz,{}),R.jsxs("div",{className:"flex-1 flex flex-col h-full overflow-hidden relative",children:[R.jsx(zz,{}),R.jsx(VT,{})]})]})})}$S.createRoot(document.getElementById("root")).render(R.jsx(T.StrictMode,{children:R.jsx(Oz,{})}));
|
|
40
|
+
`:""}var WN=JN,PN={dump:WN};function qd(t,i){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+i+" instead, which is now safe by default.")}}var z1=Ct,O1=Xv,R1=Kv,D1=Pv,H1=e1,U1=kd,L1=v1.load,j1=v1.loadAll,k1=PN.dump,B1=jt,Y1={binary:a1,float:Wv,map:$v,null:Fv,pairs:r1,set:u1,timestamp:l1,bool:Iv,int:Jv,merge:i1,omap:o1,seq:Qv,str:Zv},V1=qd("safeLoad","load"),q1=qd("safeLoadAll","loadAll"),G1=qd("safeDump","dump"),X1={Type:z1,Schema:O1,FAILSAFE_SCHEMA:R1,JSON_SCHEMA:D1,CORE_SCHEMA:H1,DEFAULT_SCHEMA:U1,load:L1,loadAll:j1,dump:k1,YAMLException:B1,types:Y1,safeLoad:V1,safeLoadAll:q1,safeDump:G1};const eT=Object.freeze(Object.defineProperty({__proto__:null,CORE_SCHEMA:H1,DEFAULT_SCHEMA:U1,FAILSAFE_SCHEMA:R1,JSON_SCHEMA:D1,Schema:O1,Type:z1,YAMLException:B1,default:X1,dump:k1,load:L1,loadAll:j1,safeDump:G1,safeLoad:V1,safeLoadAll:q1,types:Y1},Symbol.toStringTag,{value:"Module"}));function ku(t){if(!t||typeof t!="object")throw new Error("Invalid YAML: Root must be an object");const i={tables:Array.isArray(t.tables)?t.tables:[],relationships:Array.isArray(t.relationships)?t.relationships:[],domains:Array.isArray(t.domains)?t.domains:[],layout:t.layout||{}};return i.tables=i.tables.map(a=>({...a,id:a.id||"unknown",name:a.name||a.id||"Unnamed Table",appearance:a.appearance||void 0,columns:Array.isArray(a.columns)?a.columns:[]})),i}function tT(t){try{const i=X1.load(t);return ku(i)}catch(i){throw new Error(`YAML Parsing Error: ${i.message}`)}}const Nn=K3((t,i)=>({schema:null,selectedTableId:null,hoveredColumnId:null,error:null,isCliMode:typeof window<"u"&&window.MODSCAPE_CLI_MODE===!0,availableFiles:[],currentModelSlug:null,isSidebarOpen:!0,activeTab:"editor",focusNodeId:null,setSchema:a=>{try{const r=ku(a);t({schema:r,error:null})}catch(r){t({error:r.message})}},setSelectedTableId:a=>t({selectedTableId:a}),setHoveredColumnId:a=>t({hoveredColumnId:a}),setIsCliMode:a=>t({isCliMode:a}),setIsSidebarOpen:a=>t({isSidebarOpen:a}),setActiveTab:a=>t({activeTab:a}),setFocusNodeId:a=>t({focusNodeId:a}),fetchAvailableFiles:async()=>{const a=window.__MODSCAPE_DATA__;if(a&&a.models){const r=a.models.map(u=>({slug:u.slug,name:u.name,path:""}));t({availableFiles:r});return}try{const u=await(await fetch("/api/files")).json();t({availableFiles:u})}catch(r){console.error("Failed to fetch files:",r)}},setCurrentModel:async a=>{const r=window.__MODSCAPE_DATA__;if(r&&r.models){const u=r.models.find(f=>f.slug===a);if(u){t({currentModelSlug:a,schema:ku(u.schema),selectedTableId:null,error:null});const f=new URLSearchParams(window.location.search);f.set("model",a);const s=window.location.pathname+"?"+f.toString();window.history.pushState(null,"",s)}return}try{const u=`/api/model?model=${a}`,s=await(await fetch(u)).json();t({currentModelSlug:a,schema:ku(s),selectedTableId:null,error:null});const h=new URLSearchParams(window.location.search);h.set("model",a);const m=window.location.pathname+"?"+h.toString();window.history.pushState(null,"",m)}catch(u){console.error("Failed to fetch model:",u)}},parseAndSetSchema:a=>{try{const r=tT(a);t({schema:r,error:null})}catch(r){t({error:r.message})}},updateNodePosition:(a,r,u)=>{const f=i().schema;if(!f)return;const s=f.layout?.[a]||{x:0,y:0},h={...f.layout||{},[a]:{...s,x:Math.round(r),y:Math.round(u)}};t({schema:{...f,layout:h}})},updateNodeDimensions:(a,r,u)=>{const f=i().schema;if(!f)return;const s=f.layout?.[a]||{x:0,y:0},h={...f.layout||{},[a]:{...s,width:Math.round(r),height:Math.round(u)}};t({schema:{...f,layout:h}})},saveLayout:async()=>{const{schema:a,currentModelSlug:r}=i();if(!(!a||!a.layout))try{const u=r?`/api/layout?model=${r}`:"/api/layout";await fetch(u,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a.layout)})}catch(u){console.error("Failed to save layout:",u)}},getSelectedTable:()=>{const{schema:a,selectedTableId:r}=i();return!a||!r?null:a.tables.find(u=>u.id===r)||null}})),nT={fact:{color:"#f87171",icon:"📊",label:"FACT"},dimension:{color:"#60a5fa",icon:"🏷️",label:"DIM"},hub:{color:"#fbbf24",icon:"🌐",label:"HUB"},link:{color:"#34d399",icon:"🔗",label:"LINK"},satellite:{color:"#a78bfa",icon:"🛰️",label:"SAT"}},lT=({data:t,selected:i})=>{const{table:a}=t,r=Nn(p=>p.hoveredColumnId),u=a.columns&&a.columns.length>0,f=a.appearance?.type?nT[a.appearance.type]:null,s=a.appearance?.color||f?.color||"#334155",h=a.appearance?.icon||f?.icon||"",m=f?.label||"";return R.jsxs("div",{style:{minWidth:"220px",maxWidth:"550px",backgroundColor:"#1e293b",borderLeft:`2px solid ${i?"#3b82f6":"#334155"}`,borderRight:`2px solid ${i?"#3b82f6":"#334155"}`,borderBottom:`2px solid ${i?"#3b82f6":"#334155"}`,borderTop:`4px solid ${s}`,borderRadius:"8px",overflow:"hidden",color:"#f1f5f9",boxShadow:i?"0 0 0 4px rgba(59, 130, 246, 0.2)":"0 4px 6px -1px rgba(0, 0, 0, 0.1)",fontFamily:"sans-serif"},children:[R.jsx(Ca,{type:"target",position:ve.Top,style:{background:"#94a3b8",width:"8px",height:"8px"}}),R.jsxs("div",{style:{padding:"12px",backgroundColor:"rgba(15, 23, 42, 0.8)",borderBottom:u?"1px solid #334155":"none"},children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",minWidth:0},children:[h&&R.jsx("span",{style:{fontSize:"14px",flexShrink:0},children:h}),R.jsx("div",{style:{fontSize:"14px",fontWeight:"bold",color:"#ffffff",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a.name})]}),m&&R.jsx("div",{style:{fontSize:"9px",fontWeight:800,padding:"2px 6px",borderRadius:"4px",backgroundColor:`${s}20`,color:s,border:`1px solid ${s}40`,flexShrink:0,marginLeft:"8px"},children:m})]}),R.jsx("div",{style:{fontSize:"10px",color:"#94a3b8",textTransform:"uppercase",marginTop:"2px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a.id})]}),u&&R.jsx("div",{style:{padding:"0"},children:R.jsx("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"11px"},children:R.jsx("tbody",{children:a.columns.map(p=>R.jsxs("tr",{style:{borderBottom:"1px solid #334155",backgroundColor:r===p.id?"rgba(30, 58, 138, 0.6)":"transparent"},children:[R.jsx("td",{style:{padding:"6px 12px",fontWeight:500,color:"#e2e8f0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"350px"},children:R.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[p.logical?.isPrimaryKey&&R.jsx("span",{style:{color:"#eab308",marginRight:"4px"},children:"🔑"}),p.logical?.isForeignKey&&R.jsx("span",{style:{marginRight:"4px"},children:"🔩"}),p.logical?.isPartitionKey&&R.jsx("span",{style:{marginRight:"4px"},children:"📂"}),R.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:p.logical?.name||p.id})]})}),R.jsx("td",{style:{padding:"6px 12px",textAlign:"right",fontStyle:"italic",color:"#94a3b8",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"150px"},children:p.logical?.type||"Unknown"})]},p.id))})})}),R.jsx(Ca,{type:"source",position:ve.Bottom,style:{background:"#94a3b8",width:"8px",height:"8px"}})]})},iT=T.memo(lT),aT=({id:t,data:i,selected:a})=>{const{updateNodeDimensions:r,saveLayout:u}=Nn(),f=(s,h)=>{r(t,h.width,h.height),u()};return R.jsxs("div",{style:{width:"100%",height:"100%",backgroundColor:i.color||"rgba(30, 41, 59, 0.1)",border:`2px dashed ${a?"#3b82f6":"#334155"}`,borderRadius:"12px",padding:"10px",position:"relative",color:"#94a3b8",pointerEvents:"none"},children:[R.jsx(X3,{color:"#3b82f6",isVisible:a,minWidth:200,minHeight:150,onResizeEnd:f}),R.jsx("div",{style:{position:"absolute",top:"-25px",left:"0",fontSize:"14px",fontWeight:"bold",color:"#f1f5f9",whiteSpace:"nowrap",pointerEvents:"all"},children:i.label})]})},oT=T.memo(aT);const Z1=(...t)=>t.filter((i,a,r)=>!!i&&i.trim()!==""&&r.indexOf(i)===a).join(" ").trim();const rT=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const uT=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,a,r)=>r?r.toUpperCase():a.toLowerCase());const ty=t=>{const i=uT(t);return i.charAt(0).toUpperCase()+i.slice(1)};var cT={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const sT=t=>{for(const i in t)if(i.startsWith("aria-")||i==="role"||i==="title")return!0;return!1};const fT=T.forwardRef(({color:t="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:r,className:u="",children:f,iconNode:s,...h},m)=>T.createElement("svg",{ref:m,...cT,width:i,height:i,stroke:t,strokeWidth:r?Number(a)*24/Number(i):a,className:Z1("lucide",u),...!f&&!sT(h)&&{"aria-hidden":"true"},...h},[...s.map(([p,g])=>T.createElement(p,g)),...Array.isArray(f)?f:[f]]));const Kt=(t,i)=>{const a=T.forwardRef(({className:r,...u},f)=>T.createElement(fT,{ref:f,iconNode:i,className:Z1(`lucide-${rT(ty(t))}`,`lucide-${t}`,r),...u}));return a.displayName=ty(t),a};const dT=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],ny=Kt("arrow-up-right",dT);const hT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],mT=Kt("chevron-down",hT);const pT=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],gT=Kt("chevron-left",pT);const yT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],vT=Kt("chevron-right",yT);const xT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],ly=Kt("circle-alert",xT);const bT=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],ST=Kt("database",bT);const ET=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],_T=Kt("hash",ET);const wT=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],AT=Kt("layers",wT);const CT=[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]],NT=Kt("list-tree",CT);const TT=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],MT=Kt("pen-line",TT);const zT=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],OT=Kt("play",zT);const RT=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],DT=Kt("save",RT);const HT=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],UT=Kt("search",HT);const LT=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],jT=Kt("x",LT),kT=({table:t,sampleData:i})=>{const a=Nn(u=>u.setHoveredColumnId),r=u=>t.columns?.find(s=>s.id===u)?.logical?.name||u;return R.jsx("div",{style:{border:"1px solid #1e293b",borderRadius:"6px",overflow:"hidden",backgroundColor:"#0f172a"},children:R.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px"},children:[R.jsx("thead",{style:{backgroundColor:"#020617",borderBottom:"1px solid #1e293b",position:"sticky",top:0,zIndex:10},children:R.jsx("tr",{children:i.columns.map(u=>R.jsx("th",{onMouseEnter:()=>a(u),onMouseLeave:()=>a(null),style:{padding:"12px 16px",fontWeight:"bold",color:"#f1f5f9",borderRight:"1px solid #1e293b",textAlign:"left",cursor:"default",whiteSpace:"nowrap"},children:r(u)},u))})}),R.jsx("tbody",{children:i.rows.map((u,f)=>R.jsx(BT,{row:u,borderStyle:"1px solid #1e293b"},f))})]})})},BT=({row:t,borderStyle:i})=>R.jsx("tr",{style:{borderBottom:i},children:t.map((a,r)=>R.jsx("td",{style:{padding:"8px 16px",borderRight:i,color:"#d1d5db",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"monospace",fontSize:"12px"},children:String(a)},r))}),YT={fact:{color:"#f87171",icon:"📊",label:"FACT"},dimension:{color:"#60a5fa",icon:"🏷️",label:"DIM"},hub:{color:"#fbbf24",icon:"🌐",label:"HUB"},link:{color:"#34d399",icon:"🔗",label:"LINK"},satellite:{color:"#a78bfa",icon:"🛰️",label:"SAT"}},VT=()=>{const{selectedTableId:t,getSelectedTable:i,setSelectedTableId:a}=Nn(),r=i(),[u,f]=T.useState("conceptual");if(!t||!r)return null;const s=[{id:"conceptual",label:"Conceptual"},{id:"logical",label:"Logical"},{id:"physical",label:"Physical"},{id:"sample",label:"Sample Data"}],h=r.columns&&r.columns.length>0,m=r.appearance?.type?YT[r.appearance.type]:null,p=r.appearance?.color||m?.color||"#334155",g=r.appearance?.icon||m?.icon||"",v=m?.label||"";return R.jsxs("div",{className:"bg-slate-900 border-t border-slate-800 shadow-2xl z-50 flex flex-col text-slate-100",style:{height:"35vh",maxHeight:"400px",minHeight:"200px",backgroundColor:"#0f172a",borderTop:`2px solid ${p}`,display:"flex",flexDirection:"column",color:"#f1f5f9",boxShadow:"0 -10px 25px -5px rgba(0, 0, 0, 0.3)",fontFamily:"sans-serif"},children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 20px",borderBottom:"1px solid #1e293b",backgroundColor:"#020617"},children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[g&&R.jsx("span",{style:{fontSize:"18px"},children:g}),R.jsxs("div",{children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[R.jsx("h2",{style:{fontSize:"16px",fontWeight:"bold",color:"#ffffff",margin:0},children:r.name}),v&&R.jsx("span",{style:{fontSize:"9px",fontWeight:800,padding:"1px 5px",borderRadius:"3px",backgroundColor:`${p}20`,color:p,border:`1px solid ${p}40`,textTransform:"uppercase"},children:v})]}),R.jsx("p",{style:{fontSize:"11px",color:"#94a3b8",textTransform:"uppercase",margin:0},children:r.id})]})]}),R.jsx("button",{onClick:x=>{x.stopPropagation(),a(null)},style:{padding:"6px",backgroundColor:"transparent",border:"none",color:"#94a3b8",cursor:"pointer",borderRadius:"50%"},children:R.jsx(jT,{size:18})})]}),R.jsx("div",{style:{display:"flex",gap:"24px",padding:"0 20px",borderBottom:"1px solid #1e293b",backgroundColor:"#0f172a"},children:s.map(x=>R.jsx("button",{onClick:()=>f(x.id),style:{padding:"10px 0",backgroundColor:"transparent",border:"none",borderBottom:u===x.id?"2px solid #3b82f6":"2px solid transparent",color:u===x.id?"#60a5fa":"#94a3b8",fontSize:"13px",fontWeight:500,cursor:"pointer",transition:"all 0.2s"},children:x.label},x.id))}),R.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"15px 20px"},children:[u==="conceptual"&&R.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"15px"},children:[R.jsxs("section",{children:[R.jsx("h3",{style:{fontSize:"13px",fontWeight:600,color:"#e2e8f0",marginBottom:"6px"},children:"Description"}),R.jsx("p",{style:{fontSize:"13px",color:"#94a3b8",lineHeight:1.6},children:r.conceptual?.description||"No description provided."})]}),r.conceptual?.tags&&r.conceptual.tags.length>0&&R.jsxs("section",{children:[R.jsx("h3",{style:{fontSize:"13px",fontWeight:600,color:"#e2e8f0",marginBottom:"6px"},children:"Tags"}),R.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:r.conceptual.tags.map(x=>R.jsx("span",{style:{padding:"2px 10px",backgroundColor:"rgba(30, 58, 138, 0.3)",color:"#93c5fd",fontSize:"10px",borderRadius:"4px",border:"1px solid rgba(30, 58, 138, 0.5)",textTransform:"uppercase"},children:x},x))})]})]}),u==="logical"&&R.jsx("div",{children:h?R.jsx("div",{style:{border:"1px solid #1e293b",borderRadius:"8px",overflow:"hidden"},children:R.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px"},children:[R.jsx("thead",{style:{backgroundColor:"#020617",borderBottom:"1px solid #1e293b",textAlign:"left"},children:R.jsxs("tr",{children:[R.jsx("th",{style:{padding:"8px 16px",fontWeight:600,color:"#e2e8f0"},children:"Name"}),R.jsx("th",{style:{padding:"8px 16px",fontWeight:600,color:"#e2e8f0"},children:"Type"}),R.jsx("th",{style:{padding:"8px 16px",fontWeight:600,color:"#e2e8f0"},children:"Description"})]})}),R.jsx("tbody",{children:r.columns.map(x=>R.jsxs("tr",{style:{borderBottom:"1px solid #1e293b"},children:[R.jsx("td",{style:{padding:"8px 16px",fontWeight:500,color:"#e2e8f0"},children:R.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[x.logical?.isPrimaryKey&&R.jsx("span",{style:{marginRight:"6px"},children:"🔑"}),x.logical?.isForeignKey&&R.jsx("span",{style:{marginRight:"6px"},children:"🔩"}),x.logical?.isPartitionKey&&R.jsx("span",{style:{marginRight:"6px"},children:"📂"}),R.jsx("span",{children:x.logical?.name||x.id})]})}),R.jsx("td",{style:{padding:"8px 16px",color:"#94a3b8",fontStyle:"italic",fontFamily:"monospace",fontSize:"11px"},children:x.logical?.type||"Unknown"}),R.jsx("td",{style:{padding:"8px 16px",color:"#64748b",fontSize:"11px"},children:x.logical?.description||"-"})]},x.id))})]})}):R.jsx("div",{style:{fontSize:"13px",color:"#64748b",fontStyle:"italic"},children:"No logical columns defined yet."})}),u==="physical"&&R.jsx("div",{children:h?R.jsx("div",{style:{border:"1px solid #1e293b",borderRadius:"8px",overflow:"hidden"},children:R.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px"},children:[R.jsx("thead",{style:{backgroundColor:"#020617",borderBottom:"1px solid #1e293b",textAlign:"left"},children:R.jsxs("tr",{children:[R.jsx("th",{style:{padding:"8px 16px",fontWeight:600,color:"#e2e8f0"},children:"Physical Name"}),R.jsx("th",{style:{padding:"8px 16px",fontWeight:600,color:"#e2e8f0"},children:"DB Type"}),R.jsx("th",{style:{padding:"8px 16px",fontWeight:600,color:"#e2e8f0"},children:"Constraints"})]})}),R.jsx("tbody",{children:r.columns.map(x=>R.jsxs("tr",{style:{borderBottom:"1px solid #1e293b"},children:[R.jsx("td",{style:{padding:"8px 16px",fontFamily:"monospace",fontSize:"11px",color:"#e2e8f0"},children:x.physical?.name||x.logical?.name.toLowerCase().replace(/ /g,"_")||x.id}),R.jsx("td",{style:{padding:"8px 16px",color:"#94a3b8",fontFamily:"monospace",fontSize:"11px",textTransform:"uppercase"},children:x.physical?.type||x.logical?.type||"Unknown"}),R.jsx("td",{style:{padding:"8px 16px",color:"#64748b",fontSize:"11px"},children:x.physical?.constraints?.join(", ")||"-"})]},x.id))})]})}):R.jsx("div",{style:{fontSize:"13px",color:"#64748b",fontStyle:"italic"},children:"No physical columns defined yet."})}),u==="sample"&&R.jsx("div",{children:r.sampleData?R.jsx(kT,{table:r,sampleData:r.sampleData}):R.jsx("div",{style:{fontSize:"13px",color:"#64748b",fontStyle:"italic"},children:"No sample data available for this table."})})]})]})};function sl(t,i,{checkForDefaultPrevented:a=!0}={}){return function(u){if(t?.(u),a===!1||!u.defaultPrevented)return i?.(u)}}function Gd(t,i=[]){let a=[];function r(f,s){const h=T.createContext(s),m=a.length;a=[...a,s];const p=v=>{const{scope:x,children:S,...N}=v,w=x?.[t]?.[m]||h,C=T.useMemo(()=>N,Object.values(N));return R.jsx(w.Provider,{value:C,children:S})};p.displayName=f+"Provider";function g(v,x){const S=x?.[t]?.[m]||h,N=T.useContext(S);if(N)return N;if(s!==void 0)return s;throw new Error(`\`${v}\` must be used within \`${f}\``)}return[p,g]}const u=()=>{const f=a.map(s=>T.createContext(s));return function(h){const m=h?.[t]||f;return T.useMemo(()=>({[`__scope${t}`]:{...h,[t]:m}}),[h,m])}};return u.scopeName=t,[r,qT(u,...i)]}function qT(...t){const i=t[0];if(t.length===1)return i;const a=()=>{const r=t.map(u=>({useScope:u(),scopeName:u.scopeName}));return function(f){const s=r.reduce((h,{useScope:m,scopeName:p})=>{const v=m(f)[`__scope${p}`];return{...h,...v}},{});return T.useMemo(()=>({[`__scope${i.scopeName}`]:s}),[s])}};return a.scopeName=i.scopeName,a}function iy(t,i){if(typeof t=="function")return t(i);t!=null&&(t.current=i)}function Xd(...t){return i=>{let a=!1;const r=t.map(u=>{const f=iy(u,i);return!a&&typeof f=="function"&&(a=!0),f});if(a)return()=>{for(let u=0;u<r.length;u++){const f=r[u];typeof f=="function"?f():iy(t[u],null)}}}}function Pu(...t){return T.useCallback(Xd(...t),t)}function ay(t){const i=GT(t),a=T.forwardRef((r,u)=>{const{children:f,...s}=r,h=T.Children.toArray(f),m=h.find(ZT);if(m){const p=m.props.children,g=h.map(v=>v===m?T.Children.count(p)>1?T.Children.only(null):T.isValidElement(p)?p.props.children:null:v);return R.jsx(i,{...s,ref:u,children:T.isValidElement(p)?T.cloneElement(p,void 0,g):null})}return R.jsx(i,{...s,ref:u,children:f})});return a.displayName=`${t}.Slot`,a}function GT(t){const i=T.forwardRef((a,r)=>{const{children:u,...f}=a;if(T.isValidElement(u)){const s=$T(u),h=QT(f,u.props);return u.type!==T.Fragment&&(h.ref=r?Xd(r,s):s),T.cloneElement(u,h)}return T.Children.count(u)>1?T.Children.only(null):null});return i.displayName=`${t}.SlotClone`,i}var XT=Symbol("radix.slottable");function ZT(t){return T.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===XT}function QT(t,i){const a={...i};for(const r in i){const u=t[r],f=i[r];/^on[A-Z]/.test(r)?u&&f?a[r]=(...h)=>{const m=f(...h);return u(...h),m}:u&&(a[r]=u):r==="style"?a[r]={...u,...f}:r==="className"&&(a[r]=[u,f].filter(Boolean).join(" "))}return{...t,...a}}function $T(t){let i=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,a=i&&"isReactWarning"in i&&i.isReactWarning;return a?t.ref:(i=Object.getOwnPropertyDescriptor(t,"ref")?.get,a=i&&"isReactWarning"in i&&i.isReactWarning,a?t.props.ref:t.props.ref||t.ref)}function KT(t){const i=t+"CollectionProvider",[a,r]=Gd(i),[u,f]=a(i,{collectionRef:{current:null},itemMap:new Map}),s=w=>{const{scope:C,children:M}=w,H=J.useRef(null),j=J.useRef(new Map).current;return R.jsx(u,{scope:C,itemMap:j,collectionRef:H,children:M})};s.displayName=i;const h=t+"CollectionSlot",m=ay(h),p=J.forwardRef((w,C)=>{const{scope:M,children:H}=w,j=f(h,M),O=Pu(C,j.collectionRef);return R.jsx(m,{ref:O,children:H})});p.displayName=h;const g=t+"CollectionItemSlot",v="data-radix-collection-item",x=ay(g),S=J.forwardRef((w,C)=>{const{scope:M,children:H,...j}=w,O=J.useRef(null),X=Pu(C,O),K=f(g,M);return J.useEffect(()=>(K.itemMap.set(O,{ref:O,...j}),()=>{K.itemMap.delete(O)})),R.jsx(x,{[v]:"",ref:X,children:H})});S.displayName=g;function N(w){const C=f(t+"CollectionConsumer",w);return J.useCallback(()=>{const H=C.collectionRef.current;if(!H)return[];const j=Array.from(H.querySelectorAll(`[${v}]`));return Array.from(C.itemMap.values()).sort((K,W)=>j.indexOf(K.ref.current)-j.indexOf(W.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:s,Slot:p,ItemSlot:S},N,r]}var ec=globalThis?.document?T.useLayoutEffect:()=>{},FT=my[" useId ".trim().toString()]||(()=>{}),IT=0;function Q1(t){const[i,a]=T.useState(FT());return ec(()=>{a(r=>r??String(IT++))},[t]),i?`radix-${i}`:""}function JT(t){const i=WT(t),a=T.forwardRef((r,u)=>{const{children:f,...s}=r,h=T.Children.toArray(f),m=h.find(eM);if(m){const p=m.props.children,g=h.map(v=>v===m?T.Children.count(p)>1?T.Children.only(null):T.isValidElement(p)?p.props.children:null:v);return R.jsx(i,{...s,ref:u,children:T.isValidElement(p)?T.cloneElement(p,void 0,g):null})}return R.jsx(i,{...s,ref:u,children:f})});return a.displayName=`${t}.Slot`,a}function WT(t){const i=T.forwardRef((a,r)=>{const{children:u,...f}=a;if(T.isValidElement(u)){const s=nM(u),h=tM(f,u.props);return u.type!==T.Fragment&&(h.ref=r?Xd(r,s):s),T.cloneElement(u,h)}return T.Children.count(u)>1?T.Children.only(null):null});return i.displayName=`${t}.SlotClone`,i}var PT=Symbol("radix.slottable");function eM(t){return T.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===PT}function tM(t,i){const a={...i};for(const r in i){const u=t[r],f=i[r];/^on[A-Z]/.test(r)?u&&f?a[r]=(...h)=>{const m=f(...h);return u(...h),m}:u&&(a[r]=u):r==="style"?a[r]={...u,...f}:r==="className"&&(a[r]=[u,f].filter(Boolean).join(" "))}return{...t,...a}}function nM(t){let i=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,a=i&&"isReactWarning"in i&&i.isReactWarning;return a?t.ref:(i=Object.getOwnPropertyDescriptor(t,"ref")?.get,a=i&&"isReactWarning"in i&&i.isReactWarning,a?t.props.ref:t.props.ref||t.ref)}var lM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ta=lM.reduce((t,i)=>{const a=JT(`Primitive.${i}`),r=T.forwardRef((u,f)=>{const{asChild:s,...h}=u,m=s?a:i;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),R.jsx(m,{...h,ref:f})});return r.displayName=`Primitive.${i}`,{...t,[i]:r}},{});function iM(t){const i=T.useRef(t);return T.useEffect(()=>{i.current=t}),T.useMemo(()=>(...a)=>i.current?.(...a),[])}var aM=my[" useInsertionEffect ".trim().toString()]||ec;function $1({prop:t,defaultProp:i,onChange:a=()=>{},caller:r}){const[u,f,s]=oM({defaultProp:i,onChange:a}),h=t!==void 0,m=h?t:u;{const g=T.useRef(t!==void 0);T.useEffect(()=>{const v=g.current;v!==h&&console.warn(`${r} is changing from ${v?"controlled":"uncontrolled"} to ${h?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=h},[h,r])}const p=T.useCallback(g=>{if(h){const v=rM(g)?g(t):g;v!==t&&s.current?.(v)}else f(g)},[h,t,f,s]);return[m,p]}function oM({defaultProp:t,onChange:i}){const[a,r]=T.useState(t),u=T.useRef(a),f=T.useRef(i);return aM(()=>{f.current=i},[i]),T.useEffect(()=>{u.current!==a&&(f.current?.(a),u.current=a)},[a,u]),[a,r,f]}function rM(t){return typeof t=="function"}var uM=T.createContext(void 0);function K1(t){const i=T.useContext(uM);return t||i||"ltr"}var Qf="rovingFocusGroup.onEntryFocus",cM={bubbles:!1,cancelable:!0},Wo="RovingFocusGroup",[pd,F1,sM]=KT(Wo),[fM,I1]=Gd(Wo,[sM]),[dM,hM]=fM(Wo),J1=T.forwardRef((t,i)=>R.jsx(pd.Provider,{scope:t.__scopeRovingFocusGroup,children:R.jsx(pd.Slot,{scope:t.__scopeRovingFocusGroup,children:R.jsx(mM,{...t,ref:i})})}));J1.displayName=Wo;var mM=T.forwardRef((t,i)=>{const{__scopeRovingFocusGroup:a,orientation:r,loop:u=!1,dir:f,currentTabStopId:s,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:m,onEntryFocus:p,preventScrollOnEntryFocus:g=!1,...v}=t,x=T.useRef(null),S=Pu(i,x),N=K1(f),[w,C]=$1({prop:s,defaultProp:h??null,onChange:m,caller:Wo}),[M,H]=T.useState(!1),j=iM(p),O=F1(a),X=T.useRef(!1),[K,W]=T.useState(0);return T.useEffect(()=>{const V=x.current;if(V)return V.addEventListener(Qf,j),()=>V.removeEventListener(Qf,j)},[j]),R.jsx(dM,{scope:a,orientation:r,dir:N,loop:u,currentTabStopId:w,onItemFocus:T.useCallback(V=>C(V),[C]),onItemShiftTab:T.useCallback(()=>H(!0),[]),onFocusableItemAdd:T.useCallback(()=>W(V=>V+1),[]),onFocusableItemRemove:T.useCallback(()=>W(V=>V-1),[]),children:R.jsx(Ta.div,{tabIndex:M||K===0?-1:0,"data-orientation":r,...v,ref:S,style:{outline:"none",...t.style},onMouseDown:sl(t.onMouseDown,()=>{X.current=!0}),onFocus:sl(t.onFocus,V=>{const te=!X.current;if(V.target===V.currentTarget&&te&&!M){const ue=new CustomEvent(Qf,cM);if(V.currentTarget.dispatchEvent(ue),!ue.defaultPrevented){const ae=O().filter(E=>E.focusable),re=ae.find(E=>E.active),oe=ae.find(E=>E.id===w),Q=[re,oe,...ae].filter(Boolean).map(E=>E.ref.current);ex(Q,g)}}X.current=!1}),onBlur:sl(t.onBlur,()=>H(!1))})})}),W1="RovingFocusGroupItem",P1=T.forwardRef((t,i)=>{const{__scopeRovingFocusGroup:a,focusable:r=!0,active:u=!1,tabStopId:f,children:s,...h}=t,m=Q1(),p=f||m,g=hM(W1,a),v=g.currentTabStopId===p,x=F1(a),{onFocusableItemAdd:S,onFocusableItemRemove:N,currentTabStopId:w}=g;return T.useEffect(()=>{if(r)return S(),()=>N()},[r,S,N]),R.jsx(pd.ItemSlot,{scope:a,id:p,focusable:r,active:u,children:R.jsx(Ta.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...h,ref:i,onMouseDown:sl(t.onMouseDown,C=>{r?g.onItemFocus(p):C.preventDefault()}),onFocus:sl(t.onFocus,()=>g.onItemFocus(p)),onKeyDown:sl(t.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){g.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const M=yM(C,g.orientation,g.dir);if(M!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let j=x().filter(O=>O.focusable).map(O=>O.ref.current);if(M==="last")j.reverse();else if(M==="prev"||M==="next"){M==="prev"&&j.reverse();const O=j.indexOf(C.currentTarget);j=g.loop?vM(j,O+1):j.slice(O+1)}setTimeout(()=>ex(j))}}),children:typeof s=="function"?s({isCurrentTabStop:v,hasTabStop:w!=null}):s})})});P1.displayName=W1;var pM={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function gM(t,i){return i!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function yM(t,i,a){const r=gM(t.key,a);if(!(i==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(i==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return pM[r]}function ex(t,i=!1){const a=document.activeElement;for(const r of t)if(r===a||(r.focus({preventScroll:i}),document.activeElement!==a))return}function vM(t,i){return t.map((a,r)=>t[(i+r)%t.length])}var xM=J1,bM=P1;function SM(t,i){return T.useReducer((a,r)=>i[a][r]??a,t)}var tx=t=>{const{present:i,children:a}=t,r=EM(i),u=typeof a=="function"?a({present:r.isPresent}):T.Children.only(a),f=Pu(r.ref,_M(u));return typeof a=="function"||r.isPresent?T.cloneElement(u,{ref:f}):null};tx.displayName="Presence";function EM(t){const[i,a]=T.useState(),r=T.useRef(null),u=T.useRef(t),f=T.useRef("none"),s=t?"mounted":"unmounted",[h,m]=SM(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return T.useEffect(()=>{const p=Ou(r.current);f.current=h==="mounted"?p:"none"},[h]),ec(()=>{const p=r.current,g=u.current;if(g!==t){const x=f.current,S=Ou(p);t?m("MOUNT"):S==="none"||p?.display==="none"?m("UNMOUNT"):m(g&&x!==S?"ANIMATION_OUT":"UNMOUNT"),u.current=t}},[t,m]),ec(()=>{if(i){let p;const g=i.ownerDocument.defaultView??window,v=S=>{const w=Ou(r.current).includes(CSS.escape(S.animationName));if(S.target===i&&w&&(m("ANIMATION_END"),!u.current)){const C=i.style.animationFillMode;i.style.animationFillMode="forwards",p=g.setTimeout(()=>{i.style.animationFillMode==="forwards"&&(i.style.animationFillMode=C)})}},x=S=>{S.target===i&&(f.current=Ou(r.current))};return i.addEventListener("animationstart",x),i.addEventListener("animationcancel",v),i.addEventListener("animationend",v),()=>{g.clearTimeout(p),i.removeEventListener("animationstart",x),i.removeEventListener("animationcancel",v),i.removeEventListener("animationend",v)}}else m("ANIMATION_END")},[i,m]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:T.useCallback(p=>{r.current=p?getComputedStyle(p):null,a(p)},[])}}function Ou(t){return t?.animationName||"none"}function _M(t){let i=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,a=i&&"isReactWarning"in i&&i.isReactWarning;return a?t.ref:(i=Object.getOwnPropertyDescriptor(t,"ref")?.get,a=i&&"isReactWarning"in i&&i.isReactWarning,a?t.props.ref:t.props.ref||t.ref)}var sc="Tabs",[wM]=Gd(sc,[I1]),nx=I1(),[AM,Zd]=wM(sc),lx=T.forwardRef((t,i)=>{const{__scopeTabs:a,value:r,onValueChange:u,defaultValue:f,orientation:s="horizontal",dir:h,activationMode:m="automatic",...p}=t,g=K1(h),[v,x]=$1({prop:r,onChange:u,defaultProp:f??"",caller:sc});return R.jsx(AM,{scope:a,baseId:Q1(),value:v,onValueChange:x,orientation:s,dir:g,activationMode:m,children:R.jsx(Ta.div,{dir:g,"data-orientation":s,...p,ref:i})})});lx.displayName=sc;var ix="TabsList",ax=T.forwardRef((t,i)=>{const{__scopeTabs:a,loop:r=!0,...u}=t,f=Zd(ix,a),s=nx(a);return R.jsx(xM,{asChild:!0,...s,orientation:f.orientation,dir:f.dir,loop:r,children:R.jsx(Ta.div,{role:"tablist","aria-orientation":f.orientation,...u,ref:i})})});ax.displayName=ix;var ox="TabsTrigger",rx=T.forwardRef((t,i)=>{const{__scopeTabs:a,value:r,disabled:u=!1,...f}=t,s=Zd(ox,a),h=nx(a),m=sx(s.baseId,r),p=fx(s.baseId,r),g=r===s.value;return R.jsx(bM,{asChild:!0,...h,focusable:!u,active:g,children:R.jsx(Ta.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":p,"data-state":g?"active":"inactive","data-disabled":u?"":void 0,disabled:u,id:m,...f,ref:i,onMouseDown:sl(t.onMouseDown,v=>{!u&&v.button===0&&v.ctrlKey===!1?s.onValueChange(r):v.preventDefault()}),onKeyDown:sl(t.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&s.onValueChange(r)}),onFocus:sl(t.onFocus,()=>{const v=s.activationMode!=="manual";!g&&!u&&v&&s.onValueChange(r)})})})});rx.displayName=ox;var ux="TabsContent",cx=T.forwardRef((t,i)=>{const{__scopeTabs:a,value:r,forceMount:u,children:f,...s}=t,h=Zd(ux,a),m=sx(h.baseId,r),p=fx(h.baseId,r),g=r===h.value,v=T.useRef(g);return T.useEffect(()=>{const x=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(x)},[]),R.jsx(tx,{present:u||g,children:({present:x})=>R.jsx(Ta.div,{"data-state":g?"active":"inactive","data-orientation":h.orientation,role:"tabpanel","aria-labelledby":m,hidden:!x,id:p,tabIndex:0,...s,ref:i,style:{...t.style,animationDuration:v.current?"0s":void 0},children:x&&f})})});cx.displayName=ux;function sx(t,i){return`${t}-trigger-${i}`}function fx(t,i){return`${t}-content-${i}`}var CM=lx,dx=ax,hx=rx,mx=cx;function px(t){var i,a,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var u=t.length;for(i=0;i<u;i++)t[i]&&(a=px(t[i]))&&(r&&(r+=" "),r+=a)}else for(a in t)t[a]&&(r&&(r+=" "),r+=a);return r}function NM(){for(var t,i,a=0,r="",u=arguments.length;a<u;a++)(t=arguments[a])&&(i=px(t))&&(r&&(r+=" "),r+=i);return r}const TM=(t,i)=>{const a=new Array(t.length+i.length);for(let r=0;r<t.length;r++)a[r]=t[r];for(let r=0;r<i.length;r++)a[t.length+r]=i[r];return a},MM=(t,i)=>({classGroupId:t,validator:i}),gx=(t=new Map,i=null,a)=>({nextPart:t,validators:i,classGroupId:a}),tc="-",oy=[],zM="arbitrary..",OM=t=>{const i=DM(t),{conflictingClassGroups:a,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return RM(s);const h=s.split(tc),m=h[0]===""&&h.length>1?1:0;return yx(h,m,i)},getConflictingClassGroupIds:(s,h)=>{if(h){const m=r[s],p=a[s];return m?p?TM(p,m):m:p||oy}return a[s]||oy}}},yx=(t,i,a)=>{if(t.length-i===0)return a.classGroupId;const u=t[i],f=a.nextPart.get(u);if(f){const p=yx(t,i+1,f);if(p)return p}const s=a.validators;if(s===null)return;const h=i===0?t.join(tc):t.slice(i).join(tc),m=s.length;for(let p=0;p<m;p++){const g=s[p];if(g.validator(h))return g.classGroupId}},RM=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const i=t.slice(1,-1),a=i.indexOf(":"),r=i.slice(0,a);return r?zM+r:void 0})(),DM=t=>{const{theme:i,classGroups:a}=t;return HM(a,i)},HM=(t,i)=>{const a=gx();for(const r in t){const u=t[r];Qd(u,a,r,i)}return a},Qd=(t,i,a,r)=>{const u=t.length;for(let f=0;f<u;f++){const s=t[f];UM(s,i,a,r)}},UM=(t,i,a,r)=>{if(typeof t=="string"){LM(t,i,a);return}if(typeof t=="function"){jM(t,i,a,r);return}kM(t,i,a,r)},LM=(t,i,a)=>{const r=t===""?i:vx(i,t);r.classGroupId=a},jM=(t,i,a,r)=>{if(BM(t)){Qd(t(r),i,a,r);return}i.validators===null&&(i.validators=[]),i.validators.push(MM(a,t))},kM=(t,i,a,r)=>{const u=Object.entries(t),f=u.length;for(let s=0;s<f;s++){const[h,m]=u[s];Qd(m,vx(i,h),a,r)}},vx=(t,i)=>{let a=t;const r=i.split(tc),u=r.length;for(let f=0;f<u;f++){const s=r[f];let h=a.nextPart.get(s);h||(h=gx(),a.nextPart.set(s,h)),a=h}return a},BM=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,YM=t=>{if(t<1)return{get:()=>{},set:()=>{}};let i=0,a=Object.create(null),r=Object.create(null);const u=(f,s)=>{a[f]=s,i++,i>t&&(i=0,r=a,a=Object.create(null))};return{get(f){let s=a[f];if(s!==void 0)return s;if((s=r[f])!==void 0)return u(f,s),s},set(f,s){f in a?a[f]=s:u(f,s)}}},gd="!",ry=":",VM=[],uy=(t,i,a,r,u)=>({modifiers:t,hasImportantModifier:i,baseClassName:a,maybePostfixModifierPosition:r,isExternal:u}),qM=t=>{const{prefix:i,experimentalParseClassName:a}=t;let r=u=>{const f=[];let s=0,h=0,m=0,p;const g=u.length;for(let w=0;w<g;w++){const C=u[w];if(s===0&&h===0){if(C===ry){f.push(u.slice(m,w)),m=w+1;continue}if(C==="/"){p=w;continue}}C==="["?s++:C==="]"?s--:C==="("?h++:C===")"&&h--}const v=f.length===0?u:u.slice(m);let x=v,S=!1;v.endsWith(gd)?(x=v.slice(0,-1),S=!0):v.startsWith(gd)&&(x=v.slice(1),S=!0);const N=p&&p>m?p-m:void 0;return uy(f,S,x,N)};if(i){const u=i+ry,f=r;r=s=>s.startsWith(u)?f(s.slice(u.length)):uy(VM,!1,s,void 0,!0)}if(a){const u=r;r=f=>a({className:f,parseClassName:u})}return r},GM=t=>{const i=new Map;return t.orderSensitiveModifiers.forEach((a,r)=>{i.set(a,1e6+r)}),a=>{const r=[];let u=[];for(let f=0;f<a.length;f++){const s=a[f],h=s[0]==="[",m=i.has(s);h||m?(u.length>0&&(u.sort(),r.push(...u),u=[]),r.push(s)):u.push(s)}return u.length>0&&(u.sort(),r.push(...u)),r}},XM=t=>({cache:YM(t.cacheSize),parseClassName:qM(t),sortModifiers:GM(t),...OM(t)}),ZM=/\s+/,QM=(t,i)=>{const{parseClassName:a,getClassGroupId:r,getConflictingClassGroupIds:u,sortModifiers:f}=i,s=[],h=t.trim().split(ZM);let m="";for(let p=h.length-1;p>=0;p-=1){const g=h[p],{isExternal:v,modifiers:x,hasImportantModifier:S,baseClassName:N,maybePostfixModifierPosition:w}=a(g);if(v){m=g+(m.length>0?" "+m:m);continue}let C=!!w,M=r(C?N.substring(0,w):N);if(!M){if(!C){m=g+(m.length>0?" "+m:m);continue}if(M=r(N),!M){m=g+(m.length>0?" "+m:m);continue}C=!1}const H=x.length===0?"":x.length===1?x[0]:f(x).join(":"),j=S?H+gd:H,O=j+M;if(s.indexOf(O)>-1)continue;s.push(O);const X=u(M,C);for(let K=0;K<X.length;++K){const W=X[K];s.push(j+W)}m=g+(m.length>0?" "+m:m)}return m},$M=(...t)=>{let i=0,a,r,u="";for(;i<t.length;)(a=t[i++])&&(r=xx(a))&&(u&&(u+=" "),u+=r);return u},xx=t=>{if(typeof t=="string")return t;let i,a="";for(let r=0;r<t.length;r++)t[r]&&(i=xx(t[r]))&&(a&&(a+=" "),a+=i);return a},KM=(t,...i)=>{let a,r,u,f;const s=m=>{const p=i.reduce((g,v)=>v(g),t());return a=XM(p),r=a.cache.get,u=a.cache.set,f=h,h(m)},h=m=>{const p=r(m);if(p)return p;const g=QM(m,a);return u(m,g),g};return f=s,(...m)=>f($M(...m))},FM=[],pt=t=>{const i=a=>a[t]||FM;return i.isThemeGetter=!0,i},bx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Sx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,IM=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,JM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,WM=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,PM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ez=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tz=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Gl=t=>IM.test(t),Ae=t=>!!t&&!Number.isNaN(Number(t)),Xl=t=>!!t&&Number.isInteger(Number(t)),$f=t=>t.endsWith("%")&&Ae(t.slice(0,-1)),ul=t=>JM.test(t),Ex=()=>!0,nz=t=>WM.test(t)&&!PM.test(t),$d=()=>!1,lz=t=>ez.test(t),iz=t=>tz.test(t),az=t=>!me(t)&&!pe(t),oz=t=>Pl(t,Ax,$d),me=t=>bx.test(t),Si=t=>Pl(t,Cx,nz),cy=t=>Pl(t,mz,Ae),rz=t=>Pl(t,Tx,Ex),uz=t=>Pl(t,Nx,$d),sy=t=>Pl(t,_x,$d),cz=t=>Pl(t,wx,iz),Ru=t=>Pl(t,Mx,lz),pe=t=>Sx.test(t),Ro=t=>Mi(t,Cx),sz=t=>Mi(t,Nx),fy=t=>Mi(t,_x),fz=t=>Mi(t,Ax),dz=t=>Mi(t,wx),Du=t=>Mi(t,Mx,!0),hz=t=>Mi(t,Tx,!0),Pl=(t,i,a)=>{const r=bx.exec(t);return r?r[1]?i(r[1]):a(r[2]):!1},Mi=(t,i,a=!1)=>{const r=Sx.exec(t);return r?r[1]?i(r[1]):a:!1},_x=t=>t==="position"||t==="percentage",wx=t=>t==="image"||t==="url",Ax=t=>t==="length"||t==="size"||t==="bg-size",Cx=t=>t==="length",mz=t=>t==="number",Nx=t=>t==="family-name",Tx=t=>t==="number"||t==="weight",Mx=t=>t==="shadow",pz=()=>{const t=pt("color"),i=pt("font"),a=pt("text"),r=pt("font-weight"),u=pt("tracking"),f=pt("leading"),s=pt("breakpoint"),h=pt("container"),m=pt("spacing"),p=pt("radius"),g=pt("shadow"),v=pt("inset-shadow"),x=pt("text-shadow"),S=pt("drop-shadow"),N=pt("blur"),w=pt("perspective"),C=pt("aspect"),M=pt("ease"),H=pt("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],X=()=>[...O(),pe,me],K=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto","contain","none"],V=()=>[pe,me,m],te=()=>[Gl,"full","auto",...V()],ue=()=>[Xl,"none","subgrid",pe,me],ae=()=>["auto",{span:["full",Xl,pe,me]},Xl,pe,me],re=()=>[Xl,"auto",pe,me],oe=()=>["auto","min","max","fr",pe,me],A=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],E=()=>["auto",...V()],L=()=>[Gl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...V()],$=()=>[Gl,"screen","full","dvw","lvw","svw","min","max","fit",...V()],k=()=>[Gl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...V()],Y=()=>[t,pe,me],_=()=>[...O(),fy,sy,{position:[pe,me]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",fz,oz,{size:[pe,me]}],P=()=>[$f,Ro,Si],ie=()=>["","none","full",p,pe,me],ce=()=>["",Ae,Ro,Si],fe=()=>["solid","dashed","dotted","double"],Se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],de=()=>[Ae,$f,fy,sy],Ne=()=>["","none",N,pe,me],je=()=>["none",Ae,pe,me],Fe=()=>["none",Ae,pe,me],lt=()=>[Ae,pe,me],Ve=()=>[Gl,"full",...V()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ul],breakpoint:[ul],color:[Ex],container:[ul],"drop-shadow":[ul],ease:["in","out","in-out"],font:[az],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ul],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ul],shadow:[ul],spacing:["px",Ae],text:[ul],"text-shadow":[ul],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Gl,me,pe,C]}],container:["container"],columns:[{columns:[Ae,me,pe,h]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:X()}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:te()}],"inset-x":[{"inset-x":te()}],"inset-y":[{"inset-y":te()}],start:[{"inset-s":te(),start:te()}],end:[{"inset-e":te(),end:te()}],"inset-bs":[{"inset-bs":te()}],"inset-be":[{"inset-be":te()}],top:[{top:te()}],right:[{right:te()}],bottom:[{bottom:te()}],left:[{left:te()}],visibility:["visible","invisible","collapse"],z:[{z:[Xl,"auto",pe,me]}],basis:[{basis:[Gl,"full","auto",h,...V()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ae,Gl,"auto","initial","none",me]}],grow:[{grow:["",Ae,pe,me]}],shrink:[{shrink:["",Ae,pe,me]}],order:[{order:[Xl,"first","last","none",pe,me]}],"grid-cols":[{"grid-cols":ue()}],"col-start-end":[{col:ae()}],"col-start":[{"col-start":re()}],"col-end":[{"col-end":re()}],"grid-rows":[{"grid-rows":ue()}],"row-start-end":[{row:ae()}],"row-start":[{"row-start":re()}],"row-end":[{"row-end":re()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":oe()}],"auto-rows":[{"auto-rows":oe()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...A(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...A()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:V()}],px:[{px:V()}],py:[{py:V()}],ps:[{ps:V()}],pe:[{pe:V()}],pbs:[{pbs:V()}],pbe:[{pbe:V()}],pt:[{pt:V()}],pr:[{pr:V()}],pb:[{pb:V()}],pl:[{pl:V()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mbs:[{mbs:E()}],mbe:[{mbe:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":V()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":V()}],"space-y-reverse":["space-y-reverse"],size:[{size:L()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...k()]}],"min-block-size":[{"min-block":["auto",...k()]}],"max-block-size":[{"max-block":["none",...k()]}],w:[{w:[h,"screen",...L()]}],"min-w":[{"min-w":[h,"screen","none",...L()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[s]},...L()]}],h:[{h:["screen","lh",...L()]}],"min-h":[{"min-h":["screen","lh","none",...L()]}],"max-h":[{"max-h":["screen","lh",...L()]}],"font-size":[{text:["base",a,Ro,Si]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,hz,rz]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$f,me]}],"font-family":[{font:[sz,uz,i]}],"font-features":[{"font-features":[me]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[u,pe,me]}],"line-clamp":[{"line-clamp":[Ae,"none",pe,cy]}],leading:[{leading:[f,...V()]}],"list-image":[{"list-image":["none",pe,me]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",pe,me]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Y()}],"text-color":[{text:Y()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ae,"from-font","auto",pe,Si]}],"text-decoration-color":[{decoration:Y()}],"underline-offset":[{"underline-offset":[Ae,"auto",pe,me]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe,me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",pe,me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:_()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Xl,pe,me],radial:["",pe,me],conic:[Xl,pe,me]},dz,cz]}],"bg-color":[{bg:Y()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:Y()}],"gradient-via":[{via:Y()}],"gradient-to":[{to:Y()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:Y()}],"border-color-x":[{"border-x":Y()}],"border-color-y":[{"border-y":Y()}],"border-color-s":[{"border-s":Y()}],"border-color-e":[{"border-e":Y()}],"border-color-bs":[{"border-bs":Y()}],"border-color-be":[{"border-be":Y()}],"border-color-t":[{"border-t":Y()}],"border-color-r":[{"border-r":Y()}],"border-color-b":[{"border-b":Y()}],"border-color-l":[{"border-l":Y()}],"divide-color":[{divide:Y()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ae,pe,me]}],"outline-w":[{outline:["",Ae,Ro,Si]}],"outline-color":[{outline:Y()}],shadow:[{shadow:["","none",g,Du,Ru]}],"shadow-color":[{shadow:Y()}],"inset-shadow":[{"inset-shadow":["none",v,Du,Ru]}],"inset-shadow-color":[{"inset-shadow":Y()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Y()}],"ring-offset-w":[{"ring-offset":[Ae,Si]}],"ring-offset-color":[{"ring-offset":Y()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":Y()}],"text-shadow":[{"text-shadow":["none",x,Du,Ru]}],"text-shadow-color":[{"text-shadow":Y()}],opacity:[{opacity:[Ae,pe,me]}],"mix-blend":[{"mix-blend":[...Se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Se()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ae]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":Y()}],"mask-image-linear-to-color":[{"mask-linear-to":Y()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":Y()}],"mask-image-t-to-color":[{"mask-t-to":Y()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":Y()}],"mask-image-r-to-color":[{"mask-r-to":Y()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":Y()}],"mask-image-b-to-color":[{"mask-b-to":Y()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":Y()}],"mask-image-l-to-color":[{"mask-l-to":Y()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":Y()}],"mask-image-x-to-color":[{"mask-x-to":Y()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":Y()}],"mask-image-y-to-color":[{"mask-y-to":Y()}],"mask-image-radial":[{"mask-radial":[pe,me]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":Y()}],"mask-image-radial-to-color":[{"mask-radial-to":Y()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[Ae]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":Y()}],"mask-image-conic-to-color":[{"mask-conic-to":Y()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:_()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",pe,me]}],filter:[{filter:["","none",pe,me]}],blur:[{blur:Ne()}],brightness:[{brightness:[Ae,pe,me]}],contrast:[{contrast:[Ae,pe,me]}],"drop-shadow":[{"drop-shadow":["","none",S,Du,Ru]}],"drop-shadow-color":[{"drop-shadow":Y()}],grayscale:[{grayscale:["",Ae,pe,me]}],"hue-rotate":[{"hue-rotate":[Ae,pe,me]}],invert:[{invert:["",Ae,pe,me]}],saturate:[{saturate:[Ae,pe,me]}],sepia:[{sepia:["",Ae,pe,me]}],"backdrop-filter":[{"backdrop-filter":["","none",pe,me]}],"backdrop-blur":[{"backdrop-blur":Ne()}],"backdrop-brightness":[{"backdrop-brightness":[Ae,pe,me]}],"backdrop-contrast":[{"backdrop-contrast":[Ae,pe,me]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ae,pe,me]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ae,pe,me]}],"backdrop-invert":[{"backdrop-invert":["",Ae,pe,me]}],"backdrop-opacity":[{"backdrop-opacity":[Ae,pe,me]}],"backdrop-saturate":[{"backdrop-saturate":[Ae,pe,me]}],"backdrop-sepia":[{"backdrop-sepia":["",Ae,pe,me]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":V()}],"border-spacing-x":[{"border-spacing-x":V()}],"border-spacing-y":[{"border-spacing-y":V()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",pe,me]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ae,"initial",pe,me]}],ease:[{ease:["linear","initial",M,pe,me]}],delay:[{delay:[Ae,pe,me]}],animate:[{animate:["none",H,pe,me]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,pe,me]}],"perspective-origin":[{"perspective-origin":X()}],rotate:[{rotate:je()}],"rotate-x":[{"rotate-x":je()}],"rotate-y":[{"rotate-y":je()}],"rotate-z":[{"rotate-z":je()}],scale:[{scale:Fe()}],"scale-x":[{"scale-x":Fe()}],"scale-y":[{"scale-y":Fe()}],"scale-z":[{"scale-z":Fe()}],"scale-3d":["scale-3d"],skew:[{skew:lt()}],"skew-x":[{"skew-x":lt()}],"skew-y":[{"skew-y":lt()}],transform:[{transform:[pe,me,"","none","gpu","cpu"]}],"transform-origin":[{origin:X()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ve()}],"translate-x":[{"translate-x":Ve()}],"translate-y":[{"translate-y":Ve()}],"translate-z":[{"translate-z":Ve()}],"translate-none":["translate-none"],accent:[{accent:Y()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Y()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",pe,me]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mbs":[{"scroll-mbs":V()}],"scroll-mbe":[{"scroll-mbe":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pbs":[{"scroll-pbs":V()}],"scroll-pbe":[{"scroll-pbe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",pe,me]}],fill:[{fill:["none",...Y()]}],"stroke-w":[{stroke:[Ae,Ro,Si,cy]}],stroke:[{stroke:["none",...Y()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},gz=KM(pz);function Kd(...t){return gz(NM(t))}const yz=CM,zx=T.forwardRef(({className:t,...i},a)=>R.jsx(dx,{ref:a,className:Kd("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...i}));zx.displayName=dx.displayName;const yd=T.forwardRef(({className:t,...i},a)=>R.jsx(hx,{ref:a,className:Kd("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",t),...i}));yd.displayName=hx.displayName;const vd=T.forwardRef(({className:t,...i},a)=>R.jsx(mx,{ref:a,className:Kd("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...i}));vd.displayName=mx.displayName;const vz="modulepreload",xz=function(t,i){return new URL(t,i).href},dy={},bz=function(i,a,r){let u=Promise.resolve();if(a&&a.length>0){let p=function(g){return Promise.all(g.map(v=>Promise.resolve(v).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};const s=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),m=h?.nonce||h?.getAttribute("nonce");u=p(a.map(g=>{if(g=xz(g,r),g in dy)return;dy[g]=!0;const v=g.endsWith(".css"),x=v?'[rel="stylesheet"]':"";if(r)for(let N=s.length-1;N>=0;N--){const w=s[N];if(w.href===g&&(!v||w.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${g}"]${x}`))return;const S=document.createElement("link");if(S.rel=v?"stylesheet":vz,v||(S.as="script"),S.crossOrigin="",S.href=g,m&&S.setAttribute("nonce",m),document.head.appendChild(S),v)return new Promise((N,w)=>{S.addEventListener("load",N),S.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${g}`)))})}))}function f(s){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=s,window.dispatchEvent(h),!h.defaultPrevented)throw s}return u.then(s=>{for(const h of s||[])h.status==="rejected"&&f(h.reason);return i().catch(f)})},Sz=()=>{const{schema:t,error:i,isCliMode:a,currentModelSlug:r,parseAndSetSchema:u}=Nn(),[f,s]=T.useState("");T.useEffect(()=>{t&&bz(()=>Promise.resolve().then(()=>eT),void 0,import.meta.url).then(m=>{s(m.dump(t,{indent:2}))})},[t]);const h=async()=>{if(u(f),a)try{const m=r?`/api/save-yaml?model=${r}`:"/api/save-yaml";await fetch(m,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({yaml:f})})}catch(m){console.error("Failed to save YAML to file:",m)}};return R.jsxs("div",{className:"flex-1 flex flex-col gap-3 overflow-hidden p-4 pt-2 h-full",children:[!a&&R.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-blue-500/10 border border-blue-500/30 rounded-md shrink-0",children:[R.jsx(ly,{size:14,className:"text-blue-400"}),R.jsx("span",{className:"text-[11px] text-blue-300 font-medium",children:"Sandbox Mode (Temporary)"})]}),R.jsxs("div",{className:"relative flex-1 flex flex-col min-h-0",children:[R.jsx("textarea",{className:"flex-1 w-full p-4 bg-slate-800/50 text-slate-100 border border-slate-700 rounded-md font-mono text-sm focus:outline-none focus:ring-1 focus:ring-blue-500/50 transition-all resize-none shadow-inner",placeholder:"tables: ...",value:f,onChange:m=>s(m.target.value)}),i&&R.jsxs("div",{className:"mt-2 p-3 bg-red-500/10 border border-red-500/30 rounded-md text-red-400 text-xs flex gap-2 items-start shrink-0",children:[R.jsx(ly,{size:14,className:"shrink-0 mt-0.5"}),R.jsx("span",{children:i})]})]}),R.jsxs("div",{className:"flex justify-between items-center pt-1 shrink-0",children:[R.jsx("div",{className:"text-[10px] text-slate-500 italic",children:a?"Saves to local file":"Changes reset on reload"}),R.jsxs("button",{onClick:h,className:`flex items-center gap-2 px-4 py-2 rounded-md font-medium text-sm transition-all shadow-lg shrink-0 ${a?"bg-blue-600 hover:bg-blue-700 text-white":"bg-emerald-600 hover:bg-emerald-700 text-white"}`,children:[a?R.jsx(DT,{size:16}):R.jsx(OT,{size:16}),a?"Save & Update":"Apply Changes"]})]})]})},Ez=()=>{const{schema:t,setSelectedTableId:i,setFocusNodeId:a}=Nn(),[r,u]=T.useState("");if(!t)return null;const f=t.tables.filter(m=>m.name.toLowerCase().includes(r.toLowerCase())||m.id.toLowerCase().includes(r.toLowerCase())),s=t.domains?.filter(m=>m.name.toLowerCase().includes(r.toLowerCase())||m.id.toLowerCase().includes(r.toLowerCase()))||[],h=m=>{i(m),a(m)};return R.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden p-4 pt-2",children:[R.jsxs("div",{className:"relative mb-4 shrink-0",children:[R.jsx(UT,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500"}),R.jsx("input",{type:"text",value:r,onChange:m=>u(m.target.value),placeholder:"Search entities...",className:"w-full pl-9 pr-4 py-2 bg-slate-800 border border-slate-700 rounded-md text-sm text-slate-100 focus:outline-none focus:ring-1 focus:ring-blue-500/50 transition-all shadow-sm"})]}),R.jsxs("div",{className:"flex-1 space-y-6 overflow-auto pr-1",children:[s.length>0&&R.jsxs("section",{children:[R.jsxs("div",{className:"flex items-center gap-2 mb-2 px-1",children:[R.jsx(AT,{size:12,className:"text-slate-500"}),R.jsx("h3",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-500",children:"Domains"})]}),R.jsx("div",{className:"space-y-1",children:s.map(m=>R.jsxs("button",{onClick:()=>h(m.id),className:"w-full flex items-center justify-between group p-2 text-sm rounded border border-transparent hover:bg-slate-800/50 hover:border-slate-700/50 text-slate-300 transition-all text-left",children:[R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:m.color||"#3b82f6"}}),R.jsx("span",{className:"font-medium group-hover:text-blue-400",children:m.name})]}),R.jsx(ny,{size:12,className:"opacity-0 group-hover:opacity-100 text-slate-500 transition-opacity"})]},m.id))})]}),R.jsxs("section",{children:[R.jsxs("div",{className:"flex items-center gap-2 mb-2 px-1",children:[R.jsx(_T,{size:12,className:"text-slate-500"}),R.jsx("h3",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-500",children:"Tables"})]}),R.jsx("div",{className:"space-y-1",children:f.map(m=>R.jsxs("button",{onClick:()=>h(m.id),className:"w-full flex items-center justify-between group p-2 text-sm rounded border border-transparent hover:bg-slate-800/50 hover:border-slate-700/50 text-slate-300 transition-all text-left",children:[R.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[R.jsx("span",{className:"truncate font-medium group-hover:text-blue-400",children:m.name}),R.jsxs("span",{className:"text-[10px] text-slate-500 shrink-0",children:["(",m.columns?.length||0,")"]})]}),R.jsx(ny,{size:12,className:"opacity-0 group-hover:opacity-100 text-slate-500 transition-opacity"})]},m.id))})]}),f.length===0&&s.length===0&&R.jsx("div",{className:"text-center py-10",children:R.jsxs("p",{className:"text-sm text-slate-500 italic",children:['No entities found for "',r,'"']})})]})]})},_z=()=>{const{isSidebarOpen:t,setIsSidebarOpen:i}=Nn();return R.jsx("button",{onClick:()=>i(!t),className:"absolute -right-3.5 top-1/2 -translate-y-1/2 z-[60] flex h-7 w-7 items-center justify-center rounded-full border border-slate-700 bg-slate-900 text-slate-400 hover:text-white hover:bg-slate-800 transition-all shadow-xl","aria-label":t?"Collapse sidebar":"Expand sidebar",children:t?R.jsx(gT,{size:16}):R.jsx(vT,{size:16})})},wz=()=>{const{availableFiles:t,currentModelSlug:i,setCurrentModel:a,isSidebarOpen:r}=Nn();if(!r||t.length<=1)return null;const u=i||t[0]?.slug;return R.jsxs("div",{className:"px-4 mb-4",children:[R.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-slate-500 mb-1.5 px-1",children:"Current Model"}),R.jsxs("div",{className:"relative group",children:[R.jsx("select",{value:u,onChange:f=>a(f.target.value),className:"w-full pl-9 pr-8 py-2 bg-slate-800 border border-slate-700 rounded-md text-sm text-slate-100 appearance-none focus:outline-none focus:ring-1 focus:ring-blue-500/50 transition-all shadow-sm cursor-pointer hover:bg-slate-750",children:t.map(f=>R.jsx("option",{value:f.slug,children:f.name},f.slug))}),R.jsx(ST,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-blue-400 pointer-events-none"}),R.jsx(mT,{size:14,className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 pointer-events-none group-hover:text-slate-300"})]})]})},Az=""+new URL("../favicon.svg",import.meta.url).href,Cz=()=>{const{isSidebarOpen:t,activeTab:i,setActiveTab:a,isCliMode:r}=Nn();return R.jsxs("div",{className:`relative h-full flex flex-col border-r border-slate-800 bg-slate-900 transition-all duration-300 ease-in-out shadow-2xl z-50 ${t?"w-[400px]":"w-[50px]"}`,children:[R.jsx(_z,{}),R.jsxs("div",{className:`p-4 border-b border-slate-800 flex items-center justify-between ${!t&&"hidden"}`,children:[R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx("img",{src:Az,alt:"Modscape Logo",className:"w-5 h-5 rounded-md"}),R.jsx("h1",{className:"text-base font-bold text-white tracking-tight",children:"Modscape"})]}),r&&R.jsx("span",{className:"px-1.5 py-0.5 bg-emerald-500/10 border border-emerald-500/30 text-emerald-400 text-[10px] font-bold rounded uppercase",children:"Live"})]}),R.jsx("div",{className:"mt-4",children:t&&R.jsx(wz,{})}),R.jsxs(yz,{value:i,onValueChange:u=>a(u),className:`flex-1 flex flex-col overflow-hidden ${!t&&"items-center py-4"}`,children:[R.jsx("div",{className:`px-4 pt-4 ${!t&&"px-0"}`,children:R.jsxs(zx,{className:`w-full bg-slate-800/50 p-1 border border-slate-700/50 ${!t&&"flex-col h-auto w-10 gap-2 p-0 bg-transparent border-none"}`,children:[R.jsxs(yd,{value:"editor",className:`flex-1 gap-2 ${!t&&"w-9 h-9 p-0 rounded-md bg-slate-800/50 hover:bg-slate-800 text-slate-400 data-[state=active]:bg-blue-600 data-[state=active]:text-white shadow-sm transition-all"}`,title:"Editor",children:[R.jsx(MT,{size:14}),t&&R.jsx("span",{children:"Editor"})]}),R.jsxs(yd,{value:"entities",className:`flex-1 gap-2 ${!t&&"w-9 h-9 p-0 rounded-md bg-slate-800/50 hover:bg-slate-800 text-slate-400 data-[state=active]:bg-blue-600 data-[state=active]:text-white shadow-sm transition-all"}`,title:"Entities",children:[R.jsx(NT,{size:14}),t&&R.jsx("span",{children:"Entities"})]})]})}),t&&R.jsxs("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:[R.jsx(vd,{value:"editor",className:"flex-1 flex flex-col min-h-0 mt-0 data-[state=inactive]:hidden",children:R.jsx(Sz,{})}),R.jsx(vd,{value:"entities",className:"flex-1 flex flex-col min-h-0 mt-0 data-[state=inactive]:hidden",children:R.jsx(Ez,{})})]})]}),t&&R.jsx("div",{className:"p-3 border-t border-slate-800 bg-slate-950/20",children:R.jsx("p",{className:"text-[10px] text-slate-500 text-center font-medium",children:"Modscape v0.2.0"})})]})},Nz={table:iT,domain:oT},Tz={stroke:"#4ade80",strokeWidth:3},Mz={stroke:"#334155",strokeWidth:1};function zz(){const{schema:t,setSelectedTableId:i,selectedTableId:a,updateNodePosition:r,saveLayout:u,isCliMode:f,focusNodeId:s,setFocusNodeId:h}=Nn(),[m,p,g]=E3([]),[v,x,S]=_3([]),{setCenter:N,getNode:w}=uc();T.useEffect(()=>{if(s){const j=w(s);if(j){const O=j.position.x+(j.width||0)/2,X=j.position.y+(j.height||0)/2;N(O,X,{zoom:1.2,duration:800})}h(null)}},[s,w,N,h]),T.useEffect(()=>{if(!t)return;const j=[];t.domains&&t.domains.forEach(O=>{const X=t.layout?.[O.id]||{x:0,y:0,width:600,height:400};j.push({id:O.id,type:"domain",position:{x:X.x,y:X.y},style:{width:X.width||600,height:X.height||400},data:{label:O.name,color:O.color}})}),t.tables.forEach((O,X)=>{const K=t.domains?.find(V=>V.tables.includes(O.id)),W=t.layout?.[O.id]||{x:X*300,y:100};j.push({id:O.id,type:"table",position:{x:W.x,y:W.y},data:{table:O},parentNode:K?.id,extent:K?"parent":void 0})}),p(j)},[t,p]);const C=T.useMemo(()=>!t||!t.relationships?[]:t.relationships.map((j,O)=>{const X=a===j.from.table||a===j.to.table;return{id:`e-${O}`,source:j.from.table,target:j.to.table,label:X?j.type:void 0,animated:X,style:X?Tz:Mz,zIndex:X?10:1}}),[t,a]);T.useEffect(()=>{x(C)},[C,x]);const M=T.useCallback(j=>x(O=>nv(j,O)),[x]),H=T.useCallback((j,O)=>{f&&(r(O.id,O.position.x,O.position.y),u())},[f,r,u]);return R.jsx("div",{className:"flex-1 relative h-full",children:R.jsxs(jv,{nodes:m,edges:v,onNodesChange:g,onEdgesChange:S,onNodeDragStop:H,onConnect:M,nodeTypes:Nz,onNodeClick:(j,O)=>i(O.id),onPaneClick:()=>i(null),fitView:!0,children:[R.jsx(k3,{color:"#334155",gap:20}),R.jsx(O3,{})]})})}function Oz(){const{isCliMode:t,fetchAvailableFiles:i,setCurrentModel:a,setSchema:r}=Nn(),u=!!window.__MODSCAPE_DATA__;return T.useEffect(()=>{if(t){i().then(()=>{const s=new URLSearchParams(window.location.search).get("model");s?a(s):fetch("/api/model").then(h=>h.json()).then(h=>r(h))});return}if(u){const f=window.__MODSCAPE_DATA__;f&&f.isMultiFile&&f.models?i().then(()=>{const h=new URLSearchParams(window.location.search).get("model");h?a(h):(r(f.models[0].schema),a(f.models[0].slug))}):f&&f.schema?r(f.schema):r(f)}},[t,u,i,a,r]),R.jsx(Ld,{children:R.jsxs("div",{className:"flex h-screen w-screen overflow-hidden bg-slate-950 text-slate-100 font-sans",children:[R.jsx(Cz,{}),R.jsxs("div",{className:"flex-1 flex flex-col h-full overflow-hidden relative",children:[R.jsx(zz,{}),R.jsx(VT,{})]})]})})}$S.createRoot(document.getElementById("root")).render(R.jsx(T.StrictMode,{children:R.jsx(Oz,{})}));
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="./favicon.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>Modscape</title>
|
|
8
|
-
<script type="module" crossorigin src="./assets/index-
|
|
8
|
+
<script type="module" crossorigin src="./assets/index-kTZGkKzj.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="./assets/index-B6WXUgSk.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|