modscape 0.4.1 → 0.4.3
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/package.json +1 -1
- package/src/index.js +1 -1
- package/src/init.js +2 -5
- package/src/templates/codex/{prompt.md → SKILL.md} +5 -0
- package/src/templates/gemini/SKILL.md +5 -0
- package/visualizer/package.json +1 -1
- package/visualizer-dist/assets/{index-y_xP2lzJ.js → index-COjAsZp4.js} +1 -1
- package/visualizer-dist/index.html +1 -1
- package/src/templates/gemini/command.toml +0 -14
package/package.json
CHANGED
package/src/index.js
CHANGED
package/src/init.js
CHANGED
|
@@ -73,14 +73,11 @@ export async function initProject(options = {}) {
|
|
|
73
73
|
if (agents.includes('gemini')) {
|
|
74
74
|
const skillTemplate = fs.readFileSync(path.join(__dirname, 'templates/gemini/SKILL.md'), 'utf8');
|
|
75
75
|
await safeWriteFile('.gemini/skills/modscape/SKILL.md', skillTemplate);
|
|
76
|
-
|
|
77
|
-
const commandTemplate = fs.readFileSync(path.join(__dirname, 'templates/gemini/command.toml'), 'utf8');
|
|
78
|
-
await safeWriteFile('.gemini/commands/modscape/modeling.toml', commandTemplate);
|
|
79
76
|
}
|
|
80
77
|
|
|
81
78
|
if (agents.includes('codex')) {
|
|
82
|
-
const
|
|
83
|
-
await safeWriteFile('.codex/
|
|
79
|
+
const skillTemplate = fs.readFileSync(path.join(__dirname, 'templates/codex/SKILL.md'), 'utf8');
|
|
80
|
+
await safeWriteFile('.codex/skills/modscape-modeling/SKILL.md', skillTemplate);
|
|
84
81
|
}
|
|
85
82
|
|
|
86
83
|
if (agents.includes('claude')) {
|
package/visualizer/package.json
CHANGED
|
@@ -37,4 +37,4 @@ Error generating stack: `+o.message+`
|
|
|
37
37
|
`+t.slice(u,f),u=f+1),s=h;return p+=`
|
|
38
38
|
`,t.length-u>i&&s>u?p+=t.slice(u,s)+`
|
|
39
39
|
`+t.slice(s+1):p+=t.slice(u),p.slice(1)}function QC(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||jC(a);return i}function $C(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,p;for(s=0,h=a.length;s<h;s+=1)p=a[s],t.replacer&&(p=t.replacer.call(a,String(s),p)),(hl(t,i+1,p,!0,!0,!1,!0)||typeof p>"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 KC(t,i,a){var r="",u=t.tag,f=Object.keys(a),s,h,p,m,g;for(s=0,h=f.length;s<h;s+=1)g="",r!==""&&(g+=", "),t.condenseFlow&&(g+='"'),p=f[s],m=a[p],t.replacer&&(m=t.replacer.call(a,p,m)),hl(t,i,p,!1,!1)&&(t.dump.length>1024&&(g+="? "),g+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),hl(t,i,m,!1,!1)&&(g+=t.dump,r+=g));t.tag=u,t.dump="{"+r+"}"}function FC(t,i,a,r){var u="",f=t.tag,s=Object.keys(a),h,p,m,g,v,b;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,p=s.length;h<p;h+=1)b="",(!r||u!=="")&&(b+=dd(t,i)),m=s[h],g=a[m],t.replacer&&(g=t.replacer.call(a,m,g)),hl(t,i+1,m,!0,!0,!0)&&(v=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,v&&(t.dump&&Zo===t.dump.charCodeAt(0)?b+="?":b+="? "),b+=t.dump,v&&(b+=dd(t,i)),hl(t,i+1,g,!0,v)&&(t.dump&&Zo===t.dump.charCodeAt(0)?b+=":":b+=": ",b+=t.dump,u+=b));t.tag=f,t.dump=u||"{}"}function ey(t,i,a){var r,u,f,s,h,p;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(p=t.styleMap[h.tag]||h.defaultStyle,b1.call(h.represent)==="[object Function]")r=h.represent(i,p);else if(x1.call(h.represent,p))r=h.represent[p](i,p);else throw new jt("!<"+h.tag+'> tag resolver accepts not "'+p+'" 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=b1.call(t.dump),p=r,m;r&&(r=t.flowLevel<0||t.flowLevel>i);var g=h==="[object Object]"||h==="[object Array]",v,b;if(g&&(v=t.duplicates.indexOf(a),b=v!==-1),(t.tag!==null&&t.tag!=="?"||b||t.indent!==2&&i>0)&&(u=!1),b&&t.usedDuplicates[v])t.dump="*ref_"+v;else{if(g&&b&&!t.usedDuplicates[v]&&(t.usedDuplicates[v]=!0),h==="[object Object]")r&&Object.keys(t.dump).length!==0?(FC(t,i,t.dump,u),b&&(t.dump="&ref_"+v+t.dump)):(KC(t,i,t.dump),b&&(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),b&&(t.dump="&ref_"+v+t.dump)):($C(t,i,t.dump),b&&(t.dump="&ref_"+v+" "+t.dump));else if(h==="[object String]")t.tag!=="?"&&XC(t,t.dump,i,f,p);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!=="?"&&(m=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?m="!"+m:m.slice(0,18)==="tag:yaml.org,2002:"?m="!!"+m.slice(18):m="!<"+m+">",t.dump=m+" "+t.dump)}return!0}function IC(t,i){var a=[],r=[],u,f;for(pd(t,a,r),u=0,f=r.length;u<f;u+=1)i.duplicates.push(a[r[u]]);i.usedDuplicates=new Array(f)}function pd(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)pd(t[u],i,a);else for(r=Object.keys(t),u=0,f=r.length;u<f;u+=1)pd(t[r[u]],i,a)}function JC(t,i){i=i||{};var a=new BC(i);a.noRefs||IC(t,a);var r=t;return a.replacer&&(r=a.replacer.call({"":r},"",r)),hl(a,0,r,!0,!0)?a.dump+`
|
|
40
|
-
`:""}var WC=JC,PC={dump:WC};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=Nt,O1=Xv,R1=Kv,D1=Pv,H1=e1,U1=kd,L1=v1.load,j1=v1.loadAll,k1=PC.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 Cn=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 p=window.location.pathname+"?"+h.toString();window.history.pushState(null,"",p)}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=Cn(m=>m.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||"",p=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(Na,{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})]}),p&&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:p})]}),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(m=>R.jsxs("tr",{style:{borderBottom:"1px solid #334155",backgroundColor:r===m.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:[m.logical?.isPrimaryKey&&R.jsx("span",{style:{color:"#eab308",marginRight:"4px"},children:"🔑"}),m.logical?.isForeignKey&&R.jsx("span",{style:{marginRight:"4px"},children:"🔩"}),m.logical?.isPartitionKey&&R.jsx("span",{style:{marginRight:"4px"},children:"📂"}),R.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:m.logical?.name||m.id})]})}),R.jsx("td",{style:{padding:"6px 12px",textAlign:"right",fontStyle:"italic",color:"#94a3b8",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"150px"},children:m.logical?.type||"Unknown"})]},m.id))})})}),R.jsx(Na,{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}=Cn(),f=i.color||"#1e293b",h=f.startsWith("rgba")||f.startsWith("hsla")||f.startsWith("#")&&f.length>7?1:.5,p=(m,g)=>{r(t,g.width,g.height),u()};return R.jsxs("div",{style:{width:"100%",height:"100%",border:`2px dashed ${a?"#3b82f6":"#334155"}`,borderRadius:"12px",padding:"10px",position:"relative",color:"#94a3b8",pointerEvents:"none"},children:[R.jsx("div",{style:{position:"absolute",inset:0,backgroundColor:f,opacity:h,borderRadius:"10px",zIndex:-1}}),R.jsx(X3,{color:"#3b82f6",isVisible:a,minWidth:200,minHeight:150,onResizeEnd:p}),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},p)=>T.createElement("svg",{ref:p,...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(([m,g])=>T.createElement(m,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"}]],pT=Kt("chevron-down",hT);const mT=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],gT=Kt("chevron-left",mT);const yT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],vT=Kt("chevron-right",yT);const bT=[["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",bT);const xT=[["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",xT);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 NT=[["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"}]],CT=Kt("list-tree",NT);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=Cn(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}=Cn(),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,p=r.appearance?.type?YT[r.appearance.type]:null,m=r.appearance?.color||p?.color||"#334155",g=r.appearance?.icon||p?.icon||"",v=p?.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 ${m}`,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:`${m}20`,color:m,border:`1px solid ${m}40`,textTransform:"uppercase"},children:v})]}),R.jsx("p",{style:{fontSize:"11px",color:"#94a3b8",textTransform:"uppercase",margin:0},children:r.id})]})]}),R.jsx("button",{onClick:b=>{b.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(b=>R.jsx("button",{onClick:()=>f(b.id),style:{padding:"10px 0",backgroundColor:"transparent",border:"none",borderBottom:u===b.id?"2px solid #3b82f6":"2px solid transparent",color:u===b.id?"#60a5fa":"#94a3b8",fontSize:"13px",fontWeight:500,cursor:"pointer",transition:"all 0.2s"},children:b.label},b.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(b=>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:b},b))})]})]}),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(b=>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:[b.logical?.isPrimaryKey&&R.jsx("span",{style:{marginRight:"6px"},children:"🔑"}),b.logical?.isForeignKey&&R.jsx("span",{style:{marginRight:"6px"},children:"🔩"}),b.logical?.isPartitionKey&&R.jsx("span",{style:{marginRight:"6px"},children:"📂"}),R.jsx("span",{children:b.logical?.name||b.id})]})}),R.jsx("td",{style:{padding:"8px 16px",color:"#94a3b8",fontStyle:"italic",fontFamily:"monospace",fontSize:"11px"},children:b.logical?.type||"Unknown"}),R.jsx("td",{style:{padding:"8px 16px",color:"#64748b",fontSize:"11px"},children:b.logical?.description||"-"})]},b.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(b=>R.jsxs("tr",{style:{borderBottom:"1px solid #1e293b"},children:[R.jsx("td",{style:{padding:"8px 16px",fontFamily:"monospace",fontSize:"11px",color:"#e2e8f0"},children:b.physical?.name||b.logical?.name.toLowerCase().replace(/ /g,"_")||b.id}),R.jsx("td",{style:{padding:"8px 16px",color:"#94a3b8",fontFamily:"monospace",fontSize:"11px",textTransform:"uppercase"},children:b.physical?.type||b.logical?.type||"Unknown"}),R.jsx("td",{style:{padding:"8px 16px",color:"#64748b",fontSize:"11px"},children:b.physical?.constraints?.join(", ")||"-"})]},b.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),p=a.length;a=[...a,s];const m=v=>{const{scope:b,children:S,...C}=v,A=b?.[t]?.[p]||h,N=T.useMemo(()=>C,Object.values(C));return R.jsx(A.Provider,{value:N,children:S})};m.displayName=f+"Provider";function g(v,b){const S=b?.[t]?.[p]||h,C=T.useContext(S);if(C)return C;if(s!==void 0)return s;throw new Error(`\`${v}\` must be used within \`${f}\``)}return[m,g]}const u=()=>{const f=a.map(s=>T.createContext(s));return function(h){const p=h?.[t]||f;return T.useMemo(()=>({[`__scope${t}`]:{...h,[t]:p}}),[h,p])}};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:p,scopeName:m})=>{const v=p(f)[`__scope${m}`];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),p=h.find(ZT);if(p){const m=p.props.children,g=h.map(v=>v===p?T.Children.count(m)>1?T.Children.only(null):T.isValidElement(m)?m.props.children:null:v);return R.jsx(i,{...s,ref:u,children:T.isValidElement(m)?T.cloneElement(m,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 p=f(...h);return u(...h),p}: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=A=>{const{scope:N,children:M}=A,H=J.useRef(null),k=J.useRef(new Map).current;return R.jsx(u,{scope:N,itemMap:k,collectionRef:H,children:M})};s.displayName=i;const h=t+"CollectionSlot",p=ay(h),m=J.forwardRef((A,N)=>{const{scope:M,children:H}=A,k=f(h,M),O=Pu(N,k.collectionRef);return R.jsx(p,{ref:O,children:H})});m.displayName=h;const g=t+"CollectionItemSlot",v="data-radix-collection-item",b=ay(g),S=J.forwardRef((A,N)=>{const{scope:M,children:H,...k}=A,O=J.useRef(null),Q=Pu(N,O),K=f(g,M);return J.useEffect(()=>(K.itemMap.set(O,{ref:O,...k}),()=>{K.itemMap.delete(O)})),R.jsx(b,{[v]:"",ref:Q,children:H})});S.displayName=g;function C(A){const N=f(t+"CollectionConsumer",A);return J.useCallback(()=>{const H=N.collectionRef.current;if(!H)return[];const k=Array.from(H.querySelectorAll(`[${v}]`));return Array.from(N.itemMap.values()).sort((K,W)=>k.indexOf(K.ref.current)-k.indexOf(W.ref.current))},[N.collectionRef,N.itemMap])}return[{Provider:s,Slot:m,ItemSlot:S},C,r]}var ec=globalThis?.document?T.useLayoutEffect:()=>{},FT=py[" 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),p=h.find(eM);if(p){const m=p.props.children,g=h.map(v=>v===p?T.Children.count(m)>1?T.Children.only(null):T.isValidElement(m)?m.props.children:null:v);return R.jsx(i,{...s,ref:u,children:T.isValidElement(m)?T.cloneElement(m,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 p=f(...h);return u(...h),p}: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,p=s?a:i;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),R.jsx(p,{...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=py[" 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,p=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 m=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[p,m]}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",[md,F1,sM]=KT(Wo),[fM,I1]=Gd(Wo,[sM]),[dM,hM]=fM(Wo),J1=T.forwardRef((t,i)=>R.jsx(md.Provider,{scope:t.__scopeRovingFocusGroup,children:R.jsx(md.Slot,{scope:t.__scopeRovingFocusGroup,children:R.jsx(pM,{...t,ref:i})})}));J1.displayName=Wo;var pM=T.forwardRef((t,i)=>{const{__scopeRovingFocusGroup:a,orientation:r,loop:u=!1,dir:f,currentTabStopId:s,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:p,onEntryFocus:m,preventScrollOnEntryFocus:g=!1,...v}=t,b=T.useRef(null),S=Pu(i,b),C=K1(f),[A,N]=$1({prop:s,defaultProp:h??null,onChange:p,caller:Wo}),[M,H]=T.useState(!1),k=iM(m),O=F1(a),Q=T.useRef(!1),[K,W]=T.useState(0);return T.useEffect(()=>{const V=b.current;if(V)return V.addEventListener(Qf,k),()=>V.removeEventListener(Qf,k)},[k]),R.jsx(dM,{scope:a,orientation:r,dir:C,loop:u,currentTabStopId:A,onItemFocus:T.useCallback(V=>N(V),[N]),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,()=>{Q.current=!0}),onFocus:sl(t.onFocus,V=>{const te=!Q.current;if(V.target===V.currentTarget&&te&&!M){const oe=new CustomEvent(Qf,cM);if(V.currentTarget.dispatchEvent(oe),!oe.defaultPrevented){const re=O().filter(E=>E.focusable),ue=re.find(E=>E.active),ae=re.find(E=>E.id===A),X=[ue,ae,...re].filter(Boolean).map(E=>E.ref.current);eb(X,g)}}Q.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,p=Q1(),m=f||p,g=hM(W1,a),v=g.currentTabStopId===m,b=F1(a),{onFocusableItemAdd:S,onFocusableItemRemove:C,currentTabStopId:A}=g;return T.useEffect(()=>{if(r)return S(),()=>C()},[r,S,C]),R.jsx(md.ItemSlot,{scope:a,id:m,focusable:r,active:u,children:R.jsx(Ta.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...h,ref:i,onMouseDown:sl(t.onMouseDown,N=>{r?g.onItemFocus(m):N.preventDefault()}),onFocus:sl(t.onFocus,()=>g.onItemFocus(m)),onKeyDown:sl(t.onKeyDown,N=>{if(N.key==="Tab"&&N.shiftKey){g.onItemShiftTab();return}if(N.target!==N.currentTarget)return;const M=yM(N,g.orientation,g.dir);if(M!==void 0){if(N.metaKey||N.ctrlKey||N.altKey||N.shiftKey)return;N.preventDefault();let k=b().filter(O=>O.focusable).map(O=>O.ref.current);if(M==="last")k.reverse();else if(M==="prev"||M==="next"){M==="prev"&&k.reverse();const O=k.indexOf(N.currentTarget);k=g.loop?vM(k,O+1):k.slice(O+1)}setTimeout(()=>eb(k))}}),children:typeof s=="function"?s({isCurrentTabStop:v,hasTabStop:A!=null}):s})})});P1.displayName=W1;var mM={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 mM[r]}function eb(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 bM=J1,xM=P1;function SM(t,i){return T.useReducer((a,r)=>i[a][r]??a,t)}var tb=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};tb.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,p]=SM(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return T.useEffect(()=>{const m=Ou(r.current);f.current=h==="mounted"?m:"none"},[h]),ec(()=>{const m=r.current,g=u.current;if(g!==t){const b=f.current,S=Ou(m);t?p("MOUNT"):S==="none"||m?.display==="none"?p("UNMOUNT"):p(g&&b!==S?"ANIMATION_OUT":"UNMOUNT"),u.current=t}},[t,p]),ec(()=>{if(i){let m;const g=i.ownerDocument.defaultView??window,v=S=>{const A=Ou(r.current).includes(CSS.escape(S.animationName));if(S.target===i&&A&&(p("ANIMATION_END"),!u.current)){const N=i.style.animationFillMode;i.style.animationFillMode="forwards",m=g.setTimeout(()=>{i.style.animationFillMode==="forwards"&&(i.style.animationFillMode=N)})}},b=S=>{S.target===i&&(f.current=Ou(r.current))};return i.addEventListener("animationstart",b),i.addEventListener("animationcancel",v),i.addEventListener("animationend",v),()=>{g.clearTimeout(m),i.removeEventListener("animationstart",b),i.removeEventListener("animationcancel",v),i.removeEventListener("animationend",v)}}else p("ANIMATION_END")},[i,p]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:T.useCallback(m=>{r.current=m?getComputedStyle(m):null,a(m)},[])}}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]),nb=I1(),[AM,Zd]=wM(sc),lb=T.forwardRef((t,i)=>{const{__scopeTabs:a,value:r,onValueChange:u,defaultValue:f,orientation:s="horizontal",dir:h,activationMode:p="automatic",...m}=t,g=K1(h),[v,b]=$1({prop:r,onChange:u,defaultProp:f??"",caller:sc});return R.jsx(AM,{scope:a,baseId:Q1(),value:v,onValueChange:b,orientation:s,dir:g,activationMode:p,children:R.jsx(Ta.div,{dir:g,"data-orientation":s,...m,ref:i})})});lb.displayName=sc;var ib="TabsList",ab=T.forwardRef((t,i)=>{const{__scopeTabs:a,loop:r=!0,...u}=t,f=Zd(ib,a),s=nb(a);return R.jsx(bM,{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})})});ab.displayName=ib;var ob="TabsTrigger",rb=T.forwardRef((t,i)=>{const{__scopeTabs:a,value:r,disabled:u=!1,...f}=t,s=Zd(ob,a),h=nb(a),p=sb(s.baseId,r),m=fb(s.baseId,r),g=r===s.value;return R.jsx(xM,{asChild:!0,...h,focusable:!u,active:g,children:R.jsx(Ta.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":m,"data-state":g?"active":"inactive","data-disabled":u?"":void 0,disabled:u,id:p,...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)})})})});rb.displayName=ob;var ub="TabsContent",cb=T.forwardRef((t,i)=>{const{__scopeTabs:a,value:r,forceMount:u,children:f,...s}=t,h=Zd(ub,a),p=sb(h.baseId,r),m=fb(h.baseId,r),g=r===h.value,v=T.useRef(g);return T.useEffect(()=>{const b=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(b)},[]),R.jsx(tb,{present:u||g,children:({present:b})=>R.jsx(Ta.div,{"data-state":g?"active":"inactive","data-orientation":h.orientation,role:"tabpanel","aria-labelledby":p,hidden:!b,id:m,tabIndex:0,...s,ref:i,style:{...t.style,animationDuration:v.current?"0s":void 0},children:b&&f})})});cb.displayName=ub;function sb(t,i){return`${t}-trigger-${i}`}function fb(t,i){return`${t}-content-${i}`}var NM=lb,db=ab,hb=rb,pb=cb;function mb(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=mb(t[i]))&&(r&&(r+=" "),r+=a)}else for(a in t)t[a]&&(r&&(r+=" "),r+=a);return r}function CM(){for(var t,i,a=0,r="",u=arguments.length;a<u;a++)(t=arguments[a])&&(i=mb(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}),gb=(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),p=h[0]===""&&h.length>1?1:0;return yb(h,p,i)},getConflictingClassGroupIds:(s,h)=>{if(h){const p=r[s],m=a[s];return p?m?TM(m,p):p:m||oy}return a[s]||oy}}},yb=(t,i,a)=>{if(t.length-i===0)return a.classGroupId;const u=t[i],f=a.nextPart.get(u);if(f){const m=yb(t,i+1,f);if(m)return m}const s=a.validators;if(s===null)return;const h=i===0?t.join(tc):t.slice(i).join(tc),p=s.length;for(let m=0;m<p;m++){const g=s[m];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=gb();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:vb(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,p]=u[s];Qd(p,vb(i,h),a,r)}},vb=(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=gb(),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,p=0,m;const g=u.length;for(let A=0;A<g;A++){const N=u[A];if(s===0&&h===0){if(N===ry){f.push(u.slice(p,A)),p=A+1;continue}if(N==="/"){m=A;continue}}N==="["?s++:N==="]"?s--:N==="("?h++:N===")"&&h--}const v=f.length===0?u:u.slice(p);let b=v,S=!1;v.endsWith(gd)?(b=v.slice(0,-1),S=!0):v.startsWith(gd)&&(b=v.slice(1),S=!0);const C=m&&m>p?m-p:void 0;return uy(f,S,b,C)};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]==="[",p=i.has(s);h||p?(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 p="";for(let m=h.length-1;m>=0;m-=1){const g=h[m],{isExternal:v,modifiers:b,hasImportantModifier:S,baseClassName:C,maybePostfixModifierPosition:A}=a(g);if(v){p=g+(p.length>0?" "+p:p);continue}let N=!!A,M=r(N?C.substring(0,A):C);if(!M){if(!N){p=g+(p.length>0?" "+p:p);continue}if(M=r(C),!M){p=g+(p.length>0?" "+p:p);continue}N=!1}const H=b.length===0?"":b.length===1?b[0]:f(b).join(":"),k=S?H+gd:H,O=k+M;if(s.indexOf(O)>-1)continue;s.push(O);const Q=u(M,N);for(let K=0;K<Q.length;++K){const W=Q[K];s.push(k+W)}p=g+(p.length>0?" "+p:p)}return p},$M=(...t)=>{let i=0,a,r,u="";for(;i<t.length;)(a=t[i++])&&(r=bb(a))&&(u&&(u+=" "),u+=r);return u},bb=t=>{if(typeof t=="string")return t;let i,a="";for(let r=0;r<t.length;r++)t[r]&&(i=bb(t[r]))&&(a&&(a+=" "),a+=i);return a},KM=(t,...i)=>{let a,r,u,f;const s=p=>{const m=i.reduce((g,v)=>v(g),t());return a=XM(m),r=a.cache.get,u=a.cache.set,f=h,h(p)},h=p=>{const m=r(p);if(m)return m;const g=QM(p,a);return u(p,g),g};return f=s,(...p)=>f($M(...p))},FM=[],mt=t=>{const i=a=>a[t]||FM;return i.isThemeGetter=!0,i},xb=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Sb=/^\((?:(\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),Ne=t=>!!t&&!Number.isNaN(Number(t)),Xl=t=>!!t&&Number.isInteger(Number(t)),$f=t=>t.endsWith("%")&&Ne(t.slice(0,-1)),ul=t=>JM.test(t),Eb=()=>!0,nz=t=>WM.test(t)&&!PM.test(t),$d=()=>!1,lz=t=>ez.test(t),iz=t=>tz.test(t),az=t=>!pe(t)&&!me(t),oz=t=>Pl(t,Ab,$d),pe=t=>xb.test(t),Si=t=>Pl(t,Nb,nz),cy=t=>Pl(t,pz,Ne),rz=t=>Pl(t,Tb,Eb),uz=t=>Pl(t,Cb,$d),sy=t=>Pl(t,_b,$d),cz=t=>Pl(t,wb,iz),Ru=t=>Pl(t,Mb,lz),me=t=>Sb.test(t),Ro=t=>Mi(t,Nb),sz=t=>Mi(t,Cb),fy=t=>Mi(t,_b),fz=t=>Mi(t,Ab),dz=t=>Mi(t,wb),Du=t=>Mi(t,Mb,!0),hz=t=>Mi(t,Tb,!0),Pl=(t,i,a)=>{const r=xb.exec(t);return r?r[1]?i(r[1]):a(r[2]):!1},Mi=(t,i,a=!1)=>{const r=Sb.exec(t);return r?r[1]?i(r[1]):a:!1},_b=t=>t==="position"||t==="percentage",wb=t=>t==="image"||t==="url",Ab=t=>t==="length"||t==="size"||t==="bg-size",Nb=t=>t==="length",pz=t=>t==="number",Cb=t=>t==="family-name",Tb=t=>t==="number"||t==="weight",Mb=t=>t==="shadow",mz=()=>{const t=mt("color"),i=mt("font"),a=mt("text"),r=mt("font-weight"),u=mt("tracking"),f=mt("leading"),s=mt("breakpoint"),h=mt("container"),p=mt("spacing"),m=mt("radius"),g=mt("shadow"),v=mt("inset-shadow"),b=mt("text-shadow"),S=mt("drop-shadow"),C=mt("blur"),A=mt("perspective"),N=mt("aspect"),M=mt("ease"),H=mt("animate"),k=()=>["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"],Q=()=>[...O(),me,pe],K=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto","contain","none"],V=()=>[me,pe,p],te=()=>[Gl,"full","auto",...V()],oe=()=>[Xl,"none","subgrid",me,pe],re=()=>["auto",{span:["full",Xl,me,pe]},Xl,me,pe],ue=()=>[Xl,"auto",me,pe],ae=()=>["auto","min","max","fr",me,pe],w=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["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()],j=()=>[Gl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...V()],B=()=>[t,me,pe],_=()=>[...O(),fy,sy,{position:[me,pe]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],F=()=>["auto","cover","contain",fz,oz,{size:[me,pe]}],P=()=>[$f,Ro,Si],ie=()=>["","none","full",m,me,pe],ce=()=>["",Ne,Ro,Si],fe=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[Ne,$f,fy,sy],Ae=()=>["","none",C,me,pe],De=()=>["none",Ne,me,pe],Qe=()=>["none",Ne,me,pe],Pe=()=>[Ne,me,pe],ke=()=>[Gl,"full",...V()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ul],breakpoint:[ul],color:[Eb],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",Ne],text:[ul],"text-shadow":[ul],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Gl,pe,me,N]}],container:["container"],columns:[{columns:[Ne,pe,me,h]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"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:Q()}],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",me,pe]}],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:[Ne,Gl,"auto","initial","none",pe]}],grow:[{grow:["",Ne,me,pe]}],shrink:[{shrink:["",Ne,me,pe]}],order:[{order:[Xl,"first","last","none",me,pe]}],"grid-cols":[{"grid-cols":oe()}],"col-start-end":[{col:re()}],"col-start":[{"col-start":ue()}],"col-end":[{"col-end":ue()}],"grid-rows":[{"grid-rows":oe()}],"row-start-end":[{row:re()}],"row-start":[{"row-start":ue()}],"row-end":[{"row-end":ue()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ae()}],"auto-rows":[{"auto-rows":ae()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...w(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...w()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":w()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],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",...j()]}],"min-block-size":[{"min-block":["auto",...j()]}],"max-block-size":[{"max-block":["none",...j()]}],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,pe]}],"font-family":[{font:[sz,uz,i]}],"font-features":[{"font-features":[pe]}],"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,me,pe]}],"line-clamp":[{"line-clamp":[Ne,"none",me,cy]}],leading:[{leading:[f,...V()]}],"list-image":[{"list-image":["none",me,pe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",me,pe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ne,"from-font","auto",me,Si]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[Ne,"auto",me,pe]}],"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",me,pe]}],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",me,pe]}],"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:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Xl,me,pe],radial:["",me,pe],conic:[Xl,me,pe]},dz,cz]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],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:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-bs":[{"border-bs":B()}],"border-color-be":[{"border-be":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ne,me,pe]}],"outline-w":[{outline:["",Ne,Ro,Si]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",g,Du,Ru]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",v,Du,Ru]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[Ne,Si]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",b,Du,Ru]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[Ne,me,pe]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"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":[Ne]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[me,pe]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"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":[Ne]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"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:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",me,pe]}],filter:[{filter:["","none",me,pe]}],blur:[{blur:Ae()}],brightness:[{brightness:[Ne,me,pe]}],contrast:[{contrast:[Ne,me,pe]}],"drop-shadow":[{"drop-shadow":["","none",S,Du,Ru]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",Ne,me,pe]}],"hue-rotate":[{"hue-rotate":[Ne,me,pe]}],invert:[{invert:["",Ne,me,pe]}],saturate:[{saturate:[Ne,me,pe]}],sepia:[{sepia:["",Ne,me,pe]}],"backdrop-filter":[{"backdrop-filter":["","none",me,pe]}],"backdrop-blur":[{"backdrop-blur":Ae()}],"backdrop-brightness":[{"backdrop-brightness":[Ne,me,pe]}],"backdrop-contrast":[{"backdrop-contrast":[Ne,me,pe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ne,me,pe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ne,me,pe]}],"backdrop-invert":[{"backdrop-invert":["",Ne,me,pe]}],"backdrop-opacity":[{"backdrop-opacity":[Ne,me,pe]}],"backdrop-saturate":[{"backdrop-saturate":[Ne,me,pe]}],"backdrop-sepia":[{"backdrop-sepia":["",Ne,me,pe]}],"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",me,pe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ne,"initial",me,pe]}],ease:[{ease:["linear","initial",M,me,pe]}],delay:[{delay:[Ne,me,pe]}],animate:[{animate:["none",H,me,pe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[A,me,pe]}],"perspective-origin":[{"perspective-origin":Q()}],rotate:[{rotate:De()}],"rotate-x":[{"rotate-x":De()}],"rotate-y":[{"rotate-y":De()}],"rotate-z":[{"rotate-z":De()}],scale:[{scale:Qe()}],"scale-x":[{"scale-x":Qe()}],"scale-y":[{"scale-y":Qe()}],"scale-z":[{"scale-z":Qe()}],"scale-3d":["scale-3d"],skew:[{skew:Pe()}],"skew-x":[{"skew-x":Pe()}],"skew-y":[{"skew-y":Pe()}],transform:[{transform:[me,pe,"","none","gpu","cpu"]}],"transform-origin":[{origin:Q()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ke()}],"translate-x":[{"translate-x":ke()}],"translate-y":[{"translate-y":ke()}],"translate-z":[{"translate-z":ke()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"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",me,pe]}],"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",me,pe]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[Ne,Ro,Si,cy]}],stroke:[{stroke:["none",...B()]}],"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(mz);function Kd(...t){return gz(CM(t))}const yz=NM,zb=T.forwardRef(({className:t,...i},a)=>R.jsx(db,{ref:a,className:Kd("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...i}));zb.displayName=db.displayName;const yd=T.forwardRef(({className:t,...i},a)=>R.jsx(hb,{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=hb.displayName;const vd=T.forwardRef(({className:t,...i},a)=>R.jsx(pb,{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=pb.displayName;const vz="modulepreload",bz=function(t,i){return new URL(t,i).href},dy={},xz=function(i,a,r){let u=Promise.resolve();if(a&&a.length>0){let m=function(g){return Promise.all(g.map(v=>Promise.resolve(v).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};const s=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),p=h?.nonce||h?.getAttribute("nonce");u=m(a.map(g=>{if(g=bz(g,r),g in dy)return;dy[g]=!0;const v=g.endsWith(".css"),b=v?'[rel="stylesheet"]':"";if(r)for(let C=s.length-1;C>=0;C--){const A=s[C];if(A.href===g&&(!v||A.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${g}"]${b}`))return;const S=document.createElement("link");if(S.rel=v?"stylesheet":vz,v||(S.as="script"),S.crossOrigin="",S.href=g,p&&S.setAttribute("nonce",p),document.head.appendChild(S),v)return new Promise((C,A)=>{S.addEventListener("load",C),S.addEventListener("error",()=>A(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}=Cn(),[f,s]=T.useState("");T.useEffect(()=>{t&&xz(()=>Promise.resolve().then(()=>eT),void 0,import.meta.url).then(p=>{s(p.dump(t,{indent:2}))})},[t]);const h=async()=>{if(u(f),a)try{const p=r?`/api/save-yaml?model=${r}`:"/api/save-yaml";await fetch(p,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({yaml:f})})}catch(p){console.error("Failed to save YAML to file:",p)}};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:p=>s(p.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}=Cn(),[r,u]=T.useState("");if(!t)return null;const f=t.tables.filter(p=>p.name.toLowerCase().includes(r.toLowerCase())||p.id.toLowerCase().includes(r.toLowerCase())),s=t.domains?.filter(p=>p.name.toLowerCase().includes(r.toLowerCase())||p.id.toLowerCase().includes(r.toLowerCase()))||[],h=p=>{i(p),a(p)};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:p=>u(p.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(p=>R.jsxs("button",{onClick:()=>h(p.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:p.color||"#3b82f6"}}),R.jsx("span",{className:"font-medium group-hover:text-blue-400",children:p.name})]}),R.jsx(ny,{size:12,className:"opacity-0 group-hover:opacity-100 text-slate-500 transition-opacity"})]},p.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(p=>R.jsxs("button",{onClick:()=>h(p.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:p.name}),R.jsxs("span",{className:"text-[10px] text-slate-500 shrink-0",children:["(",p.columns?.length||0,")"]})]}),R.jsx(ny,{size:12,className:"opacity-0 group-hover:opacity-100 text-slate-500 transition-opacity"})]},p.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}=Cn();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}=Cn();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(pT,{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,Nz=()=>{const{isSidebarOpen:t,activeTab:i,setActiveTab:a,isCliMode:r}=Cn();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(zb,{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(CT,{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.4.1"})})]})},Cz={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}=Cn(),[p,m,g]=E3([]),[v,b,S]=_3([]),{setCenter:C,getNode:A}=uc();T.useEffect(()=>{if(s){const k=A(s);if(k){const O=k.position.x+(k.width||0)/2,Q=k.position.y+(k.height||0)/2;C(O,Q,{zoom:1.2,duration:800})}h(null)}},[s,A,C,h]),T.useEffect(()=>{if(!t)return;const k=[],O=320,Q=250,K=60,W=3;t.domains&&t.domains.forEach((ae,w)=>{const X=ae.tables.length,E=Math.ceil(X/W),L=Math.min(X,W),$=Math.max(2,L)*O+K,j=Math.max(1.5,E)*Q+K,B=t.layout?.[ae.id],_=Math.floor(w/2),U=w%2,F=B?.x??U*1600,P=B?.y??_*1200,ie=B?.width??$,ce=B?.height??j;k.push({id:ae.id,type:"domain",position:{x:F,y:P},style:{width:ie,height:ce},data:{label:ae.name,color:ae.color}}),ae.tables.forEach((fe,xe)=>{const se=t.tables.find(qe=>qe.id===fe);if(!se)return;const Ae=Math.floor(xe/W),De=xe%W,Qe=t.layout?.[se.id],Pe=Qe?.x??De*O+K/2,ke=Qe?.y??Ae*Q+K/2;k.push({id:se.id,type:"table",position:{x:Pe,y:ke},data:{table:se},parentNode:ae.id,extent:"parent"})})});const V=new Set(t.domains?.flatMap(oe=>oe.tables)||[]);t.tables.filter(oe=>!V.has(oe.id)).forEach((oe,re)=>{const ue=t.layout?.[oe.id]||{x:re*300,y:100};k.push({id:oe.id,type:"table",position:{x:ue.x,y:ue.y},data:{table:oe}})}),m(k)},[t,m]);const N=T.useMemo(()=>!t||!t.relationships?[]:t.relationships.map((k,O)=>{const Q=a===k.from.table||a===k.to.table;return{id:`e-${O}`,source:k.from.table,target:k.to.table,label:Q?k.type:void 0,animated:Q,style:Q?Tz:Mz,zIndex:Q?10:1}}),[t,a]);T.useEffect(()=>{b(N)},[N,b]);const M=T.useCallback(k=>b(O=>nv(k,O)),[b]),H=T.useCallback((k,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:p,edges:v,onNodesChange:g,onEdgesChange:S,onNodeDragStop:H,onConnect:M,nodeTypes:Cz,onNodeClick:(k,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}=Cn(),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(Nz,{}),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 WC=JC,PC={dump:WC};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=Nt,O1=Xv,R1=Kv,D1=Pv,H1=e1,U1=kd,L1=v1.load,j1=v1.loadAll,k1=PC.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 Cn=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 p=window.location.pathname+"?"+h.toString();window.history.pushState(null,"",p)}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=Cn(m=>m.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||"",p=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(Na,{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})]}),p&&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:p})]}),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(m=>R.jsxs("tr",{style:{borderBottom:"1px solid #334155",backgroundColor:r===m.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:[m.logical?.isPrimaryKey&&R.jsx("span",{style:{color:"#eab308",marginRight:"4px"},children:"🔑"}),m.logical?.isForeignKey&&R.jsx("span",{style:{marginRight:"4px"},children:"🔩"}),m.logical?.isPartitionKey&&R.jsx("span",{style:{marginRight:"4px"},children:"📂"}),R.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},children:m.logical?.name||m.id})]})}),R.jsx("td",{style:{padding:"6px 12px",textAlign:"right",fontStyle:"italic",color:"#94a3b8",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"150px"},children:m.logical?.type||"Unknown"})]},m.id))})})}),R.jsx(Na,{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}=Cn(),f=i.color||"#1e293b",h=f.startsWith("rgba")||f.startsWith("hsla")||f.startsWith("#")&&f.length>7?1:.5,p=(m,g)=>{r(t,g.width,g.height),u()};return R.jsxs("div",{style:{width:"100%",height:"100%",border:`2px dashed ${a?"#3b82f6":"#334155"}`,borderRadius:"12px",padding:"10px",position:"relative",color:"#94a3b8",pointerEvents:"none"},children:[R.jsx("div",{style:{position:"absolute",inset:0,backgroundColor:f,opacity:h,borderRadius:"10px",zIndex:-1}}),R.jsx(X3,{color:"#3b82f6",isVisible:a,minWidth:200,minHeight:150,onResizeEnd:p}),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},p)=>T.createElement("svg",{ref:p,...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(([m,g])=>T.createElement(m,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"}]],pT=Kt("chevron-down",hT);const mT=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],gT=Kt("chevron-left",mT);const yT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],vT=Kt("chevron-right",yT);const bT=[["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",bT);const xT=[["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",xT);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 NT=[["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"}]],CT=Kt("list-tree",NT);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=Cn(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}=Cn(),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,p=r.appearance?.type?YT[r.appearance.type]:null,m=r.appearance?.color||p?.color||"#334155",g=r.appearance?.icon||p?.icon||"",v=p?.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 ${m}`,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:`${m}20`,color:m,border:`1px solid ${m}40`,textTransform:"uppercase"},children:v})]}),R.jsx("p",{style:{fontSize:"11px",color:"#94a3b8",textTransform:"uppercase",margin:0},children:r.id})]})]}),R.jsx("button",{onClick:b=>{b.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(b=>R.jsx("button",{onClick:()=>f(b.id),style:{padding:"10px 0",backgroundColor:"transparent",border:"none",borderBottom:u===b.id?"2px solid #3b82f6":"2px solid transparent",color:u===b.id?"#60a5fa":"#94a3b8",fontSize:"13px",fontWeight:500,cursor:"pointer",transition:"all 0.2s"},children:b.label},b.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(b=>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:b},b))})]})]}),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(b=>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:[b.logical?.isPrimaryKey&&R.jsx("span",{style:{marginRight:"6px"},children:"🔑"}),b.logical?.isForeignKey&&R.jsx("span",{style:{marginRight:"6px"},children:"🔩"}),b.logical?.isPartitionKey&&R.jsx("span",{style:{marginRight:"6px"},children:"📂"}),R.jsx("span",{children:b.logical?.name||b.id})]})}),R.jsx("td",{style:{padding:"8px 16px",color:"#94a3b8",fontStyle:"italic",fontFamily:"monospace",fontSize:"11px"},children:b.logical?.type||"Unknown"}),R.jsx("td",{style:{padding:"8px 16px",color:"#64748b",fontSize:"11px"},children:b.logical?.description||"-"})]},b.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(b=>R.jsxs("tr",{style:{borderBottom:"1px solid #1e293b"},children:[R.jsx("td",{style:{padding:"8px 16px",fontFamily:"monospace",fontSize:"11px",color:"#e2e8f0"},children:b.physical?.name||b.logical?.name.toLowerCase().replace(/ /g,"_")||b.id}),R.jsx("td",{style:{padding:"8px 16px",color:"#94a3b8",fontFamily:"monospace",fontSize:"11px",textTransform:"uppercase"},children:b.physical?.type||b.logical?.type||"Unknown"}),R.jsx("td",{style:{padding:"8px 16px",color:"#64748b",fontSize:"11px"},children:b.physical?.constraints?.join(", ")||"-"})]},b.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),p=a.length;a=[...a,s];const m=v=>{const{scope:b,children:S,...C}=v,A=b?.[t]?.[p]||h,N=T.useMemo(()=>C,Object.values(C));return R.jsx(A.Provider,{value:N,children:S})};m.displayName=f+"Provider";function g(v,b){const S=b?.[t]?.[p]||h,C=T.useContext(S);if(C)return C;if(s!==void 0)return s;throw new Error(`\`${v}\` must be used within \`${f}\``)}return[m,g]}const u=()=>{const f=a.map(s=>T.createContext(s));return function(h){const p=h?.[t]||f;return T.useMemo(()=>({[`__scope${t}`]:{...h,[t]:p}}),[h,p])}};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:p,scopeName:m})=>{const v=p(f)[`__scope${m}`];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),p=h.find(ZT);if(p){const m=p.props.children,g=h.map(v=>v===p?T.Children.count(m)>1?T.Children.only(null):T.isValidElement(m)?m.props.children:null:v);return R.jsx(i,{...s,ref:u,children:T.isValidElement(m)?T.cloneElement(m,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 p=f(...h);return u(...h),p}: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=A=>{const{scope:N,children:M}=A,H=J.useRef(null),k=J.useRef(new Map).current;return R.jsx(u,{scope:N,itemMap:k,collectionRef:H,children:M})};s.displayName=i;const h=t+"CollectionSlot",p=ay(h),m=J.forwardRef((A,N)=>{const{scope:M,children:H}=A,k=f(h,M),O=Pu(N,k.collectionRef);return R.jsx(p,{ref:O,children:H})});m.displayName=h;const g=t+"CollectionItemSlot",v="data-radix-collection-item",b=ay(g),S=J.forwardRef((A,N)=>{const{scope:M,children:H,...k}=A,O=J.useRef(null),Q=Pu(N,O),K=f(g,M);return J.useEffect(()=>(K.itemMap.set(O,{ref:O,...k}),()=>{K.itemMap.delete(O)})),R.jsx(b,{[v]:"",ref:Q,children:H})});S.displayName=g;function C(A){const N=f(t+"CollectionConsumer",A);return J.useCallback(()=>{const H=N.collectionRef.current;if(!H)return[];const k=Array.from(H.querySelectorAll(`[${v}]`));return Array.from(N.itemMap.values()).sort((K,W)=>k.indexOf(K.ref.current)-k.indexOf(W.ref.current))},[N.collectionRef,N.itemMap])}return[{Provider:s,Slot:m,ItemSlot:S},C,r]}var ec=globalThis?.document?T.useLayoutEffect:()=>{},FT=py[" 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),p=h.find(eM);if(p){const m=p.props.children,g=h.map(v=>v===p?T.Children.count(m)>1?T.Children.only(null):T.isValidElement(m)?m.props.children:null:v);return R.jsx(i,{...s,ref:u,children:T.isValidElement(m)?T.cloneElement(m,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 p=f(...h);return u(...h),p}: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,p=s?a:i;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),R.jsx(p,{...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=py[" 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,p=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 m=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[p,m]}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",[md,F1,sM]=KT(Wo),[fM,I1]=Gd(Wo,[sM]),[dM,hM]=fM(Wo),J1=T.forwardRef((t,i)=>R.jsx(md.Provider,{scope:t.__scopeRovingFocusGroup,children:R.jsx(md.Slot,{scope:t.__scopeRovingFocusGroup,children:R.jsx(pM,{...t,ref:i})})}));J1.displayName=Wo;var pM=T.forwardRef((t,i)=>{const{__scopeRovingFocusGroup:a,orientation:r,loop:u=!1,dir:f,currentTabStopId:s,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:p,onEntryFocus:m,preventScrollOnEntryFocus:g=!1,...v}=t,b=T.useRef(null),S=Pu(i,b),C=K1(f),[A,N]=$1({prop:s,defaultProp:h??null,onChange:p,caller:Wo}),[M,H]=T.useState(!1),k=iM(m),O=F1(a),Q=T.useRef(!1),[K,W]=T.useState(0);return T.useEffect(()=>{const V=b.current;if(V)return V.addEventListener(Qf,k),()=>V.removeEventListener(Qf,k)},[k]),R.jsx(dM,{scope:a,orientation:r,dir:C,loop:u,currentTabStopId:A,onItemFocus:T.useCallback(V=>N(V),[N]),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,()=>{Q.current=!0}),onFocus:sl(t.onFocus,V=>{const te=!Q.current;if(V.target===V.currentTarget&&te&&!M){const oe=new CustomEvent(Qf,cM);if(V.currentTarget.dispatchEvent(oe),!oe.defaultPrevented){const re=O().filter(E=>E.focusable),ue=re.find(E=>E.active),ae=re.find(E=>E.id===A),X=[ue,ae,...re].filter(Boolean).map(E=>E.ref.current);eb(X,g)}}Q.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,p=Q1(),m=f||p,g=hM(W1,a),v=g.currentTabStopId===m,b=F1(a),{onFocusableItemAdd:S,onFocusableItemRemove:C,currentTabStopId:A}=g;return T.useEffect(()=>{if(r)return S(),()=>C()},[r,S,C]),R.jsx(md.ItemSlot,{scope:a,id:m,focusable:r,active:u,children:R.jsx(Ta.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...h,ref:i,onMouseDown:sl(t.onMouseDown,N=>{r?g.onItemFocus(m):N.preventDefault()}),onFocus:sl(t.onFocus,()=>g.onItemFocus(m)),onKeyDown:sl(t.onKeyDown,N=>{if(N.key==="Tab"&&N.shiftKey){g.onItemShiftTab();return}if(N.target!==N.currentTarget)return;const M=yM(N,g.orientation,g.dir);if(M!==void 0){if(N.metaKey||N.ctrlKey||N.altKey||N.shiftKey)return;N.preventDefault();let k=b().filter(O=>O.focusable).map(O=>O.ref.current);if(M==="last")k.reverse();else if(M==="prev"||M==="next"){M==="prev"&&k.reverse();const O=k.indexOf(N.currentTarget);k=g.loop?vM(k,O+1):k.slice(O+1)}setTimeout(()=>eb(k))}}),children:typeof s=="function"?s({isCurrentTabStop:v,hasTabStop:A!=null}):s})})});P1.displayName=W1;var mM={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 mM[r]}function eb(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 bM=J1,xM=P1;function SM(t,i){return T.useReducer((a,r)=>i[a][r]??a,t)}var tb=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};tb.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,p]=SM(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return T.useEffect(()=>{const m=Ou(r.current);f.current=h==="mounted"?m:"none"},[h]),ec(()=>{const m=r.current,g=u.current;if(g!==t){const b=f.current,S=Ou(m);t?p("MOUNT"):S==="none"||m?.display==="none"?p("UNMOUNT"):p(g&&b!==S?"ANIMATION_OUT":"UNMOUNT"),u.current=t}},[t,p]),ec(()=>{if(i){let m;const g=i.ownerDocument.defaultView??window,v=S=>{const A=Ou(r.current).includes(CSS.escape(S.animationName));if(S.target===i&&A&&(p("ANIMATION_END"),!u.current)){const N=i.style.animationFillMode;i.style.animationFillMode="forwards",m=g.setTimeout(()=>{i.style.animationFillMode==="forwards"&&(i.style.animationFillMode=N)})}},b=S=>{S.target===i&&(f.current=Ou(r.current))};return i.addEventListener("animationstart",b),i.addEventListener("animationcancel",v),i.addEventListener("animationend",v),()=>{g.clearTimeout(m),i.removeEventListener("animationstart",b),i.removeEventListener("animationcancel",v),i.removeEventListener("animationend",v)}}else p("ANIMATION_END")},[i,p]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:T.useCallback(m=>{r.current=m?getComputedStyle(m):null,a(m)},[])}}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]),nb=I1(),[AM,Zd]=wM(sc),lb=T.forwardRef((t,i)=>{const{__scopeTabs:a,value:r,onValueChange:u,defaultValue:f,orientation:s="horizontal",dir:h,activationMode:p="automatic",...m}=t,g=K1(h),[v,b]=$1({prop:r,onChange:u,defaultProp:f??"",caller:sc});return R.jsx(AM,{scope:a,baseId:Q1(),value:v,onValueChange:b,orientation:s,dir:g,activationMode:p,children:R.jsx(Ta.div,{dir:g,"data-orientation":s,...m,ref:i})})});lb.displayName=sc;var ib="TabsList",ab=T.forwardRef((t,i)=>{const{__scopeTabs:a,loop:r=!0,...u}=t,f=Zd(ib,a),s=nb(a);return R.jsx(bM,{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})})});ab.displayName=ib;var ob="TabsTrigger",rb=T.forwardRef((t,i)=>{const{__scopeTabs:a,value:r,disabled:u=!1,...f}=t,s=Zd(ob,a),h=nb(a),p=sb(s.baseId,r),m=fb(s.baseId,r),g=r===s.value;return R.jsx(xM,{asChild:!0,...h,focusable:!u,active:g,children:R.jsx(Ta.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":m,"data-state":g?"active":"inactive","data-disabled":u?"":void 0,disabled:u,id:p,...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)})})})});rb.displayName=ob;var ub="TabsContent",cb=T.forwardRef((t,i)=>{const{__scopeTabs:a,value:r,forceMount:u,children:f,...s}=t,h=Zd(ub,a),p=sb(h.baseId,r),m=fb(h.baseId,r),g=r===h.value,v=T.useRef(g);return T.useEffect(()=>{const b=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(b)},[]),R.jsx(tb,{present:u||g,children:({present:b})=>R.jsx(Ta.div,{"data-state":g?"active":"inactive","data-orientation":h.orientation,role:"tabpanel","aria-labelledby":p,hidden:!b,id:m,tabIndex:0,...s,ref:i,style:{...t.style,animationDuration:v.current?"0s":void 0},children:b&&f})})});cb.displayName=ub;function sb(t,i){return`${t}-trigger-${i}`}function fb(t,i){return`${t}-content-${i}`}var NM=lb,db=ab,hb=rb,pb=cb;function mb(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=mb(t[i]))&&(r&&(r+=" "),r+=a)}else for(a in t)t[a]&&(r&&(r+=" "),r+=a);return r}function CM(){for(var t,i,a=0,r="",u=arguments.length;a<u;a++)(t=arguments[a])&&(i=mb(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}),gb=(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),p=h[0]===""&&h.length>1?1:0;return yb(h,p,i)},getConflictingClassGroupIds:(s,h)=>{if(h){const p=r[s],m=a[s];return p?m?TM(m,p):p:m||oy}return a[s]||oy}}},yb=(t,i,a)=>{if(t.length-i===0)return a.classGroupId;const u=t[i],f=a.nextPart.get(u);if(f){const m=yb(t,i+1,f);if(m)return m}const s=a.validators;if(s===null)return;const h=i===0?t.join(tc):t.slice(i).join(tc),p=s.length;for(let m=0;m<p;m++){const g=s[m];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=gb();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:vb(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,p]=u[s];Qd(p,vb(i,h),a,r)}},vb=(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=gb(),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,p=0,m;const g=u.length;for(let A=0;A<g;A++){const N=u[A];if(s===0&&h===0){if(N===ry){f.push(u.slice(p,A)),p=A+1;continue}if(N==="/"){m=A;continue}}N==="["?s++:N==="]"?s--:N==="("?h++:N===")"&&h--}const v=f.length===0?u:u.slice(p);let b=v,S=!1;v.endsWith(gd)?(b=v.slice(0,-1),S=!0):v.startsWith(gd)&&(b=v.slice(1),S=!0);const C=m&&m>p?m-p:void 0;return uy(f,S,b,C)};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]==="[",p=i.has(s);h||p?(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 p="";for(let m=h.length-1;m>=0;m-=1){const g=h[m],{isExternal:v,modifiers:b,hasImportantModifier:S,baseClassName:C,maybePostfixModifierPosition:A}=a(g);if(v){p=g+(p.length>0?" "+p:p);continue}let N=!!A,M=r(N?C.substring(0,A):C);if(!M){if(!N){p=g+(p.length>0?" "+p:p);continue}if(M=r(C),!M){p=g+(p.length>0?" "+p:p);continue}N=!1}const H=b.length===0?"":b.length===1?b[0]:f(b).join(":"),k=S?H+gd:H,O=k+M;if(s.indexOf(O)>-1)continue;s.push(O);const Q=u(M,N);for(let K=0;K<Q.length;++K){const W=Q[K];s.push(k+W)}p=g+(p.length>0?" "+p:p)}return p},$M=(...t)=>{let i=0,a,r,u="";for(;i<t.length;)(a=t[i++])&&(r=bb(a))&&(u&&(u+=" "),u+=r);return u},bb=t=>{if(typeof t=="string")return t;let i,a="";for(let r=0;r<t.length;r++)t[r]&&(i=bb(t[r]))&&(a&&(a+=" "),a+=i);return a},KM=(t,...i)=>{let a,r,u,f;const s=p=>{const m=i.reduce((g,v)=>v(g),t());return a=XM(m),r=a.cache.get,u=a.cache.set,f=h,h(p)},h=p=>{const m=r(p);if(m)return m;const g=QM(p,a);return u(p,g),g};return f=s,(...p)=>f($M(...p))},FM=[],mt=t=>{const i=a=>a[t]||FM;return i.isThemeGetter=!0,i},xb=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Sb=/^\((?:(\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),Ne=t=>!!t&&!Number.isNaN(Number(t)),Xl=t=>!!t&&Number.isInteger(Number(t)),$f=t=>t.endsWith("%")&&Ne(t.slice(0,-1)),ul=t=>JM.test(t),Eb=()=>!0,nz=t=>WM.test(t)&&!PM.test(t),$d=()=>!1,lz=t=>ez.test(t),iz=t=>tz.test(t),az=t=>!pe(t)&&!me(t),oz=t=>Pl(t,Ab,$d),pe=t=>xb.test(t),Si=t=>Pl(t,Nb,nz),cy=t=>Pl(t,pz,Ne),rz=t=>Pl(t,Tb,Eb),uz=t=>Pl(t,Cb,$d),sy=t=>Pl(t,_b,$d),cz=t=>Pl(t,wb,iz),Ru=t=>Pl(t,Mb,lz),me=t=>Sb.test(t),Ro=t=>Mi(t,Nb),sz=t=>Mi(t,Cb),fy=t=>Mi(t,_b),fz=t=>Mi(t,Ab),dz=t=>Mi(t,wb),Du=t=>Mi(t,Mb,!0),hz=t=>Mi(t,Tb,!0),Pl=(t,i,a)=>{const r=xb.exec(t);return r?r[1]?i(r[1]):a(r[2]):!1},Mi=(t,i,a=!1)=>{const r=Sb.exec(t);return r?r[1]?i(r[1]):a:!1},_b=t=>t==="position"||t==="percentage",wb=t=>t==="image"||t==="url",Ab=t=>t==="length"||t==="size"||t==="bg-size",Nb=t=>t==="length",pz=t=>t==="number",Cb=t=>t==="family-name",Tb=t=>t==="number"||t==="weight",Mb=t=>t==="shadow",mz=()=>{const t=mt("color"),i=mt("font"),a=mt("text"),r=mt("font-weight"),u=mt("tracking"),f=mt("leading"),s=mt("breakpoint"),h=mt("container"),p=mt("spacing"),m=mt("radius"),g=mt("shadow"),v=mt("inset-shadow"),b=mt("text-shadow"),S=mt("drop-shadow"),C=mt("blur"),A=mt("perspective"),N=mt("aspect"),M=mt("ease"),H=mt("animate"),k=()=>["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"],Q=()=>[...O(),me,pe],K=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto","contain","none"],V=()=>[me,pe,p],te=()=>[Gl,"full","auto",...V()],oe=()=>[Xl,"none","subgrid",me,pe],re=()=>["auto",{span:["full",Xl,me,pe]},Xl,me,pe],ue=()=>[Xl,"auto",me,pe],ae=()=>["auto","min","max","fr",me,pe],w=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["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()],j=()=>[Gl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...V()],B=()=>[t,me,pe],_=()=>[...O(),fy,sy,{position:[me,pe]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],F=()=>["auto","cover","contain",fz,oz,{size:[me,pe]}],P=()=>[$f,Ro,Si],ie=()=>["","none","full",m,me,pe],ce=()=>["",Ne,Ro,Si],fe=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>[Ne,$f,fy,sy],Ae=()=>["","none",C,me,pe],De=()=>["none",Ne,me,pe],Qe=()=>["none",Ne,me,pe],Pe=()=>[Ne,me,pe],ke=()=>[Gl,"full",...V()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ul],breakpoint:[ul],color:[Eb],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",Ne],text:[ul],"text-shadow":[ul],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Gl,pe,me,N]}],container:["container"],columns:[{columns:[Ne,pe,me,h]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"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:Q()}],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",me,pe]}],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:[Ne,Gl,"auto","initial","none",pe]}],grow:[{grow:["",Ne,me,pe]}],shrink:[{shrink:["",Ne,me,pe]}],order:[{order:[Xl,"first","last","none",me,pe]}],"grid-cols":[{"grid-cols":oe()}],"col-start-end":[{col:re()}],"col-start":[{"col-start":ue()}],"col-end":[{"col-end":ue()}],"grid-rows":[{"grid-rows":oe()}],"row-start-end":[{row:re()}],"row-start":[{"row-start":ue()}],"row-end":[{"row-end":ue()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ae()}],"auto-rows":[{"auto-rows":ae()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...w(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...w()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":w()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],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",...j()]}],"min-block-size":[{"min-block":["auto",...j()]}],"max-block-size":[{"max-block":["none",...j()]}],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,pe]}],"font-family":[{font:[sz,uz,i]}],"font-features":[{"font-features":[pe]}],"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,me,pe]}],"line-clamp":[{"line-clamp":[Ne,"none",me,cy]}],leading:[{leading:[f,...V()]}],"list-image":[{"list-image":["none",me,pe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",me,pe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ne,"from-font","auto",me,Si]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[Ne,"auto",me,pe]}],"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",me,pe]}],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",me,pe]}],"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:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Xl,me,pe],radial:["",me,pe],conic:[Xl,me,pe]},dz,cz]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],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:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-bs":[{"border-bs":B()}],"border-color-be":[{"border-be":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ne,me,pe]}],"outline-w":[{outline:["",Ne,Ro,Si]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",g,Du,Ru]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",v,Du,Ru]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[Ne,Si]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",b,Du,Ru]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[Ne,me,pe]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"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":[Ne]}],"mask-image-linear-from-pos":[{"mask-linear-from":se()}],"mask-image-linear-to-pos":[{"mask-linear-to":se()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":se()}],"mask-image-t-to-pos":[{"mask-t-to":se()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":se()}],"mask-image-r-to-pos":[{"mask-r-to":se()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":se()}],"mask-image-b-to-pos":[{"mask-b-to":se()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":se()}],"mask-image-l-to-pos":[{"mask-l-to":se()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":se()}],"mask-image-x-to-pos":[{"mask-x-to":se()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":se()}],"mask-image-y-to-pos":[{"mask-y-to":se()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[me,pe]}],"mask-image-radial-from-pos":[{"mask-radial-from":se()}],"mask-image-radial-to-pos":[{"mask-radial-to":se()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"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":[Ne]}],"mask-image-conic-from-pos":[{"mask-conic-from":se()}],"mask-image-conic-to-pos":[{"mask-conic-to":se()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"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:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",me,pe]}],filter:[{filter:["","none",me,pe]}],blur:[{blur:Ae()}],brightness:[{brightness:[Ne,me,pe]}],contrast:[{contrast:[Ne,me,pe]}],"drop-shadow":[{"drop-shadow":["","none",S,Du,Ru]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",Ne,me,pe]}],"hue-rotate":[{"hue-rotate":[Ne,me,pe]}],invert:[{invert:["",Ne,me,pe]}],saturate:[{saturate:[Ne,me,pe]}],sepia:[{sepia:["",Ne,me,pe]}],"backdrop-filter":[{"backdrop-filter":["","none",me,pe]}],"backdrop-blur":[{"backdrop-blur":Ae()}],"backdrop-brightness":[{"backdrop-brightness":[Ne,me,pe]}],"backdrop-contrast":[{"backdrop-contrast":[Ne,me,pe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ne,me,pe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ne,me,pe]}],"backdrop-invert":[{"backdrop-invert":["",Ne,me,pe]}],"backdrop-opacity":[{"backdrop-opacity":[Ne,me,pe]}],"backdrop-saturate":[{"backdrop-saturate":[Ne,me,pe]}],"backdrop-sepia":[{"backdrop-sepia":["",Ne,me,pe]}],"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",me,pe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ne,"initial",me,pe]}],ease:[{ease:["linear","initial",M,me,pe]}],delay:[{delay:[Ne,me,pe]}],animate:[{animate:["none",H,me,pe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[A,me,pe]}],"perspective-origin":[{"perspective-origin":Q()}],rotate:[{rotate:De()}],"rotate-x":[{"rotate-x":De()}],"rotate-y":[{"rotate-y":De()}],"rotate-z":[{"rotate-z":De()}],scale:[{scale:Qe()}],"scale-x":[{"scale-x":Qe()}],"scale-y":[{"scale-y":Qe()}],"scale-z":[{"scale-z":Qe()}],"scale-3d":["scale-3d"],skew:[{skew:Pe()}],"skew-x":[{"skew-x":Pe()}],"skew-y":[{"skew-y":Pe()}],transform:[{transform:[me,pe,"","none","gpu","cpu"]}],"transform-origin":[{origin:Q()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ke()}],"translate-x":[{"translate-x":ke()}],"translate-y":[{"translate-y":ke()}],"translate-z":[{"translate-z":ke()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"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",me,pe]}],"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",me,pe]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[Ne,Ro,Si,cy]}],stroke:[{stroke:["none",...B()]}],"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(mz);function Kd(...t){return gz(CM(t))}const yz=NM,zb=T.forwardRef(({className:t,...i},a)=>R.jsx(db,{ref:a,className:Kd("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...i}));zb.displayName=db.displayName;const yd=T.forwardRef(({className:t,...i},a)=>R.jsx(hb,{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=hb.displayName;const vd=T.forwardRef(({className:t,...i},a)=>R.jsx(pb,{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=pb.displayName;const vz="modulepreload",bz=function(t,i){return new URL(t,i).href},dy={},xz=function(i,a,r){let u=Promise.resolve();if(a&&a.length>0){let m=function(g){return Promise.all(g.map(v=>Promise.resolve(v).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};const s=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),p=h?.nonce||h?.getAttribute("nonce");u=m(a.map(g=>{if(g=bz(g,r),g in dy)return;dy[g]=!0;const v=g.endsWith(".css"),b=v?'[rel="stylesheet"]':"";if(r)for(let C=s.length-1;C>=0;C--){const A=s[C];if(A.href===g&&(!v||A.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${g}"]${b}`))return;const S=document.createElement("link");if(S.rel=v?"stylesheet":vz,v||(S.as="script"),S.crossOrigin="",S.href=g,p&&S.setAttribute("nonce",p),document.head.appendChild(S),v)return new Promise((C,A)=>{S.addEventListener("load",C),S.addEventListener("error",()=>A(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}=Cn(),[f,s]=T.useState("");T.useEffect(()=>{t&&xz(()=>Promise.resolve().then(()=>eT),void 0,import.meta.url).then(p=>{s(p.dump(t,{indent:2}))})},[t]);const h=async()=>{if(u(f),a)try{const p=r?`/api/save-yaml?model=${r}`:"/api/save-yaml";await fetch(p,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({yaml:f})})}catch(p){console.error("Failed to save YAML to file:",p)}};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:p=>s(p.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}=Cn(),[r,u]=T.useState("");if(!t)return null;const f=t.tables.filter(p=>p.name.toLowerCase().includes(r.toLowerCase())||p.id.toLowerCase().includes(r.toLowerCase())),s=t.domains?.filter(p=>p.name.toLowerCase().includes(r.toLowerCase())||p.id.toLowerCase().includes(r.toLowerCase()))||[],h=p=>{i(p),a(p)};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:p=>u(p.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(p=>R.jsxs("button",{onClick:()=>h(p.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:p.color||"#3b82f6"}}),R.jsx("span",{className:"font-medium group-hover:text-blue-400",children:p.name})]}),R.jsx(ny,{size:12,className:"opacity-0 group-hover:opacity-100 text-slate-500 transition-opacity"})]},p.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(p=>R.jsxs("button",{onClick:()=>h(p.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:p.name}),R.jsxs("span",{className:"text-[10px] text-slate-500 shrink-0",children:["(",p.columns?.length||0,")"]})]}),R.jsx(ny,{size:12,className:"opacity-0 group-hover:opacity-100 text-slate-500 transition-opacity"})]},p.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}=Cn();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}=Cn();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(pT,{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,Nz=()=>{const{isSidebarOpen:t,activeTab:i,setActiveTab:a,isCliMode:r}=Cn();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(zb,{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(CT,{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.4.3"})})]})},Cz={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}=Cn(),[p,m,g]=E3([]),[v,b,S]=_3([]),{setCenter:C,getNode:A}=uc();T.useEffect(()=>{if(s){const k=A(s);if(k){const O=k.position.x+(k.width||0)/2,Q=k.position.y+(k.height||0)/2;C(O,Q,{zoom:1.2,duration:800})}h(null)}},[s,A,C,h]),T.useEffect(()=>{if(!t)return;const k=[],O=320,Q=250,K=60,W=3;t.domains&&t.domains.forEach((ae,w)=>{const X=ae.tables.length,E=Math.ceil(X/W),L=Math.min(X,W),$=Math.max(2,L)*O+K,j=Math.max(1.5,E)*Q+K,B=t.layout?.[ae.id],_=Math.floor(w/2),U=w%2,F=B?.x??U*1600,P=B?.y??_*1200,ie=B?.width??$,ce=B?.height??j;k.push({id:ae.id,type:"domain",position:{x:F,y:P},style:{width:ie,height:ce},data:{label:ae.name,color:ae.color}}),ae.tables.forEach((fe,xe)=>{const se=t.tables.find(qe=>qe.id===fe);if(!se)return;const Ae=Math.floor(xe/W),De=xe%W,Qe=t.layout?.[se.id],Pe=Qe?.x??De*O+K/2,ke=Qe?.y??Ae*Q+K/2;k.push({id:se.id,type:"table",position:{x:Pe,y:ke},data:{table:se},parentNode:ae.id,extent:"parent"})})});const V=new Set(t.domains?.flatMap(oe=>oe.tables)||[]);t.tables.filter(oe=>!V.has(oe.id)).forEach((oe,re)=>{const ue=t.layout?.[oe.id]||{x:re*300,y:100};k.push({id:oe.id,type:"table",position:{x:ue.x,y:ue.y},data:{table:oe}})}),m(k)},[t,m]);const N=T.useMemo(()=>!t||!t.relationships?[]:t.relationships.map((k,O)=>{const Q=a===k.from.table||a===k.to.table;return{id:`e-${O}`,source:k.from.table,target:k.to.table,label:Q?k.type:void 0,animated:Q,style:Q?Tz:Mz,zIndex:Q?10:1}}),[t,a]);T.useEffect(()=>{b(N)},[N,b]);const M=T.useCallback(k=>b(O=>nv(k,O)),[b]),H=T.useCallback((k,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:p,edges:v,onNodesChange:g,onEdgesChange:S,onNodeDragStop:H,onConnect:M,nodeTypes:Cz,onNodeClick:(k,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}=Cn(),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(Nz,{}),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-COjAsZp4.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="./assets/index-B6WXUgSk.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# /modscape:modeling command definition
|
|
2
|
-
|
|
3
|
-
description = "Start an interactive data modeling session using project rules"
|
|
4
|
-
|
|
5
|
-
[prompt]
|
|
6
|
-
instruction = """
|
|
7
|
-
You are now in **Modscape Modeling Mode**.
|
|
8
|
-
|
|
9
|
-
1. FIRST, read `.modscape/rules.md` to understand the project strategy, naming conventions, and YAML schema.
|
|
10
|
-
2. SECOND, analyze the existing `model.yaml` if it exists.
|
|
11
|
-
3. Listen to the user's requirements and propose/apply changes to `model.yaml` strictly following the rules.
|
|
12
|
-
|
|
13
|
-
Stay in this mode until the task is complete. Always prioritize consistency and project-specific standards.
|
|
14
|
-
"""
|