tekivex-ui 3.5.0 → 3.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +146 -33
  3. package/dist/agent.cjs +1 -0
  4. package/dist/agent.js +17 -0
  5. package/dist/charts.cjs +1 -1
  6. package/dist/charts.js +41 -22
  7. package/dist/experimental.cjs +1 -0
  8. package/dist/experimental.js +39 -0
  9. package/dist/headless.cjs +1 -1
  10. package/dist/headless.js +55 -1
  11. package/dist/i18n.cjs +1 -1
  12. package/dist/i18n.js +1 -1
  13. package/dist/index.cjs +1 -1
  14. package/dist/index.d.ts +29 -6
  15. package/dist/index.js +694 -586
  16. package/dist/quantum.cjs +1 -1
  17. package/dist/quantum.js +59 -74
  18. package/dist/realtime.cjs +1 -1
  19. package/dist/realtime.js +1 -1
  20. package/dist/src/agent/a2a/A2AClient.d.ts +32 -0
  21. package/dist/src/agent/a2a/a2aTool.d.ts +11 -0
  22. package/dist/src/agent/a2a/createA2ARoute.d.ts +5 -0
  23. package/dist/src/agent/bindings/solid.d.ts +12 -0
  24. package/dist/src/agent/bindings/svelte.d.ts +10 -0
  25. package/dist/src/agent/bindings/vanilla.d.ts +17 -0
  26. package/dist/src/agent/bindings/vue.d.ts +15 -0
  27. package/dist/src/agent/components/TkxAgentMessage.d.ts +15 -0
  28. package/dist/src/agent/components/TkxReasoningTrace.d.ts +9 -0
  29. package/dist/src/agent/components/TkxToolCallCard.d.ts +12 -0
  30. package/dist/src/agent/content/helpers.d.ts +17 -0
  31. package/dist/src/agent/core/Agent.d.ts +29 -0
  32. package/dist/src/agent/core/Memory.d.ts +12 -0
  33. package/dist/src/agent/core/Middleware.d.ts +10 -0
  34. package/dist/src/agent/core/Provider.d.ts +44 -0
  35. package/dist/src/agent/core/Sanitizer.d.ts +4 -0
  36. package/dist/src/agent/core/Tool.d.ts +13 -0
  37. package/dist/src/agent/core/Transport.d.ts +18 -0
  38. package/dist/src/agent/core/events.d.ts +19 -0
  39. package/dist/src/agent/core/sse.d.ts +6 -0
  40. package/dist/src/agent/core/types.d.ts +39 -0
  41. package/dist/src/agent/devtools/DevToolsPanel.d.ts +8 -0
  42. package/dist/src/agent/devtools/useEventCollector.d.ts +8 -0
  43. package/dist/src/agent/eval/runEval.d.ts +31 -0
  44. package/dist/src/agent/index.d.ts +54 -0
  45. package/dist/src/agent/mcp/MCPClient.d.ts +33 -0
  46. package/dist/src/agent/mcp/mcpAdapter.d.ts +3 -0
  47. package/dist/src/agent/memory/SlidingWindowMemory.d.ts +10 -0
  48. package/dist/src/agent/memory/SummarizingMemory.d.ts +16 -0
  49. package/dist/src/agent/memory/VectorMemory.d.ts +17 -0
  50. package/dist/src/agent/middleware/guardrails.d.ts +20 -0
  51. package/dist/src/agent/middleware/otel.d.ts +13 -0
  52. package/dist/src/agent/middleware/retry.d.ts +11 -0
  53. package/dist/src/agent/middleware/tokenUsage.d.ts +27 -0
  54. package/dist/src/agent/multi/agentAsTool.d.ts +11 -0
  55. package/dist/src/agent/providers/anthropic.d.ts +16 -0
  56. package/dist/src/agent/providers/gemini.d.ts +16 -0
  57. package/dist/src/agent/providers/ollama.d.ts +14 -0
  58. package/dist/src/agent/providers/openai.d.ts +16 -0
  59. package/dist/src/agent/rag/Retriever.d.ts +13 -0
  60. package/dist/src/agent/rag/retrievalTool.d.ts +11 -0
  61. package/dist/src/agent/react/useAgent.d.ts +12 -0
  62. package/dist/src/agent/replay/ReplayProvider.d.ts +13 -0
  63. package/dist/src/agent/replay/recorder.d.ts +16 -0
  64. package/dist/src/agent/research/DeepResearch.d.ts +37 -0
  65. package/dist/src/agent/research/citations.d.ts +10 -0
  66. package/dist/src/agent/server/createAgentClient.d.ts +11 -0
  67. package/dist/src/agent/server/createAgentRoute.d.ts +10 -0
  68. package/dist/src/agent/structured/generateObject.d.ts +19 -0
  69. package/dist/src/agent/tools/cancellable.d.ts +6 -0
  70. package/dist/src/charts/TkxDataExplorer.d.ts +17 -0
  71. package/dist/src/charts/index.d.ts +2 -0
  72. package/dist/src/components/TkxAppBar.d.ts +2 -1
  73. package/dist/src/components/TkxButton.d.ts +1 -0
  74. package/dist/src/components/TkxCommandPalette.d.ts +32 -0
  75. package/dist/src/components/TkxDataGrid.d.ts +37 -1
  76. package/dist/src/components/TkxFlowChart.d.ts +52 -0
  77. package/dist/src/components/TkxFormBuilder.d.ts +34 -0
  78. package/dist/src/components/TkxFormulaBar.d.ts +19 -0
  79. package/dist/src/components/TkxFunnelChart.d.ts +21 -0
  80. package/dist/src/components/TkxGantt.d.ts +29 -0
  81. package/dist/src/components/TkxGauge.d.ts +21 -0
  82. package/dist/src/components/TkxHeatmap.d.ts +25 -0
  83. package/dist/src/components/TkxHolographic.d.ts +2 -0
  84. package/dist/src/components/TkxHolographicAdvanced.d.ts +48 -0
  85. package/dist/src/components/TkxMindMap.d.ts +22 -0
  86. package/dist/src/components/TkxPivotTable.d.ts +21 -0
  87. package/dist/src/components/TkxSparkline.d.ts +15 -0
  88. package/dist/src/components/TkxSpreadsheet.d.ts +33 -0
  89. package/dist/src/components/TkxTreemap.d.ts +21 -0
  90. package/dist/src/components/TkxTypography.d.ts +1 -1
  91. package/dist/src/components/index.d.ts +5 -3
  92. package/dist/src/engine/security.d.ts +3 -0
  93. package/dist/src/experimental/index.d.ts +8 -0
  94. package/dist/src/headless/index.d.ts +6 -0
  95. package/dist/src/headless/rhfBindings.d.ts +59 -0
  96. package/dist/src/headless/useFormState.d.ts +12 -2
  97. package/dist/src/headless/valibotResolver.d.ts +25 -0
  98. package/dist/src/headless/zodResolver.d.ts +25 -0
  99. package/dist/src/i18n/index.d.ts +20 -0
  100. package/dist/src/i18n/plurals.d.ts +4 -0
  101. package/dist/src/quantum/index.d.ts +0 -2
  102. package/dist/src/themes/index.d.ts +7 -1
  103. package/dist/themes.cjs +1 -0
  104. package/dist/themes.js +1 -0
  105. package/package.json +32 -8
  106. package/dist/chunk-BHX35YDv.js +0 -1
  107. package/dist/chunk-BpuJ3-K8.js +0 -1
  108. package/dist/chunk-Bze40nDX.js +0 -1
  109. package/dist/chunk-C8Wy8P59.js +0 -1
  110. package/dist/chunk-D7-yknXg.js +0 -1
  111. package/dist/chunk-DTO-RrPx.js +0 -3
  112. package/dist/chunk-DcVMayoM.js +0 -1
  113. package/dist/chunk-DdHSYetV.js +0 -1
  114. package/dist/chunk-DmRB1Blb.js +0 -1
package/dist/charts.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("./chunk-DmRB1Blb.js");const e=require("./chunk-BpuJ3-K8.js"),t=require("./chunk-C8Wy8P59.js");let i=require("react"),r=require("react/jsx-runtime"),a=require("recharts");function o(e){return[e.primary,e.secondary,e.info,e.success,e.warning,e.danger,e.primary+"aa",e.secondary+"aa",e.info+"aa",e.success+"aa"]}var n={top:10,right:30,bottom:10,left:0};function l(e){return{contentStyle:{backgroundColor:e.surface,border:`1px solid ${e.border}`,borderRadius:8,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",color:e.text,fontSize:13},labelStyle:{color:e.textMuted,fontWeight:600,marginBottom:4},itemStyle:{color:e.text},cursor:{fill:`${e.primary}15`}}}exports.TkxAreaChart=function({data:t,series:i,xKey:c,height:s=300,margin:d=n,showGrid:h=!0,showLegend:y=!0,showTooltip:m=!0,smooth:k=!0,xTickFormatter:u,yTickFormatter:g,yDomain:p,ariaLabel:f="Area chart"}){const S=e.useTheme(),b=o(S),w=l(S),L={fill:S.textMuted,fontSize:12};return(0,r.jsx)("div",{role:"img","aria-label":f,style:{width:"100%",height:s},children:(0,r.jsx)(a.ResponsiveContainer,{width:"100%",height:"100%",children:(0,r.jsxs)(a.AreaChart,{data:t,margin:d,children:[h&&(0,r.jsx)(a.CartesianGrid,{strokeDasharray:"3 3",stroke:S.border,vertical:!1}),(0,r.jsx)(a.XAxis,{dataKey:c,tick:L,axisLine:{stroke:S.border},tickLine:!1,tickFormatter:u}),(0,r.jsx)(a.YAxis,{tick:L,axisLine:!1,tickLine:!1,tickFormatter:g,domain:p}),m&&(0,r.jsx)(a.Tooltip,{contentStyle:w.contentStyle,labelStyle:w.labelStyle,itemStyle:w.itemStyle,cursor:w.cursor}),y&&(0,r.jsx)(a.Legend,{wrapperStyle:{fontSize:13,color:S.textMuted,paddingTop:8}}),i.map((e,t)=>{const i=e.color??b[t%b.length];return(0,r.jsx)(a.Area,{type:k?"monotone":"linear",dataKey:e.key,name:e.label??e.key,stroke:i,strokeWidth:2,fill:i,fillOpacity:e.fillOpacity??.2,stackId:e.stacked?"stack":void 0,dot:!1,activeDot:{r:5,strokeWidth:0}},e.key)})]})})})},exports.TkxBarChart=function({data:t,series:i,xKey:c,height:s=300,margin:d=n,showGrid:h=!0,showLegend:y=!0,showTooltip:m=!0,layout:k="horizontal",barSize:u,xTickFormatter:g,yTickFormatter:p,ariaLabel:f="Bar chart"}){const S=e.useTheme(),b=o(S),w=l(S),L={fill:S.textMuted,fontSize:12},x="vertical"===k;return(0,r.jsx)("div",{role:"img","aria-label":f,style:{width:"100%",height:s},children:(0,r.jsx)(a.ResponsiveContainer,{width:"100%",height:"100%",children:(0,r.jsxs)(a.BarChart,{data:t,margin:d,layout:k,children:[h&&(0,r.jsx)(a.CartesianGrid,{strokeDasharray:"3 3",stroke:S.border,vertical:x,horizontal:!x}),x?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.YAxis,{dataKey:c,type:"category",tick:L,axisLine:!1,tickLine:!1,tickFormatter:g,width:100}),(0,r.jsx)(a.XAxis,{type:"number",tick:L,axisLine:{stroke:S.border},tickLine:!1,tickFormatter:p})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.XAxis,{dataKey:c,tick:L,axisLine:{stroke:S.border},tickLine:!1,tickFormatter:g}),(0,r.jsx)(a.YAxis,{tick:L,axisLine:!1,tickLine:!1,tickFormatter:p})]}),m&&(0,r.jsx)(a.Tooltip,{contentStyle:w.contentStyle,labelStyle:w.labelStyle,itemStyle:w.itemStyle,cursor:{fill:`${S.surfaceAlt}`}}),y&&(0,r.jsx)(a.Legend,{wrapperStyle:{fontSize:13,color:S.textMuted,paddingTop:8}}),i.map((e,t)=>{const i=e.color??b[t%b.length];return(0,r.jsx)(a.Bar,{dataKey:e.key,name:e.label??e.key,fill:i,stackId:e.stackId,maxBarSize:u??40,radius:e.radius??[4,4,0,0]},e.key)})]})})})},exports.TkxDonutChart=function({data:n,height:c=300,showLegend:s=!0,showTooltip:d=!0,centerLabel:h,centerSublabel:y,innerRadius:m="55%",outerRadius:k="75%",startAngle:u=90,ariaLabel:g="Donut chart"}){const p=e.useTheme(),f=t.useReducedMotion(),S=o(p),b=l(p),[w,L]=(0,i.useState)(f);return(0,i.useEffect)(()=>{if(f)return void L(!0);const e=requestAnimationFrame(()=>L(!0));return()=>cancelAnimationFrame(e)},[f]),(0,r.jsxs)("div",{role:"img","aria-label":g,style:{width:"100%",minWidth:240,height:c,position:"relative"},children:[w&&(0,r.jsx)(a.ResponsiveContainer,{width:"100%",height:"100%",debounce:50,children:(0,r.jsxs)(a.PieChart,{children:[d&&(0,r.jsx)(a.Tooltip,{contentStyle:b.contentStyle,labelStyle:b.labelStyle,itemStyle:b.itemStyle}),s&&(0,r.jsx)(a.Legend,{wrapperStyle:{fontSize:13,color:p.textMuted}}),(0,r.jsx)(a.Pie,{data:n,dataKey:"value",nameKey:"name",innerRadius:m,outerRadius:k,startAngle:u,endAngle:u-360,strokeWidth:3,stroke:p.bg,label:!1,labelLine:!1,children:n.map((e,t)=>(0,r.jsx)(a.Cell,{fill:e.color??S[t%S.length]},e.name))}),(h||y)&&(0,r.jsx)("text",{})]})}),(h||y)&&(0,r.jsxs)("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",pointerEvents:"none",marginTop:s?-24:0},children:[h&&(0,r.jsx)("span",{style:{fontSize:22,fontWeight:700,color:p.text,lineHeight:1},children:h}),y&&(0,r.jsx)("span",{style:{fontSize:13,color:p.textMuted,marginTop:4},children:y})]})]})},exports.TkxLineChart=function({data:t,series:i,xKey:c,height:s=300,margin:d=n,showGrid:h=!0,showLegend:y=!0,showTooltip:m=!0,smooth:k=!0,referenceLines:u=[],xTickFormatter:g,yTickFormatter:p,yDomain:f,connectNulls:S=!1,ariaLabel:b="Line chart"}){const w=e.useTheme(),L=o(w),x=l(w),v={fill:w.textMuted,fontSize:12};return(0,r.jsx)("div",{role:"img","aria-label":b,style:{width:"100%",height:s},children:(0,r.jsx)(a.ResponsiveContainer,{width:"100%",height:"100%",children:(0,r.jsxs)(a.LineChart,{data:t,margin:d,children:[h&&(0,r.jsx)(a.CartesianGrid,{strokeDasharray:"3 3",stroke:w.border,vertical:!1}),(0,r.jsx)(a.XAxis,{dataKey:c,tick:v,axisLine:{stroke:w.border},tickLine:!1,tickFormatter:g}),(0,r.jsx)(a.YAxis,{tick:v,axisLine:!1,tickLine:!1,tickFormatter:p,domain:f}),m&&(0,r.jsx)(a.Tooltip,{contentStyle:x.contentStyle,labelStyle:x.labelStyle,itemStyle:x.itemStyle,cursor:{stroke:w.border,strokeWidth:1}}),y&&(0,r.jsx)(a.Legend,{wrapperStyle:{fontSize:13,color:w.textMuted,paddingTop:8}}),u.map((e,t)=>(0,r.jsx)(a.ReferenceLine,{y:e.y,x:e.x,label:e.label?{value:e.label,fill:w.textMuted,fontSize:11}:void 0,stroke:e.color??w.border,strokeDasharray:e.dashed?"4 4":void 0},t)),i.map((e,t)=>{const i=e.color??L[t%L.length];return(0,r.jsx)(a.Line,{type:k?"monotone":"linear",dataKey:e.key,name:e.label??e.key,stroke:i,strokeWidth:e.strokeWidth??2,strokeDasharray:e.dashed?"6 3":void 0,dot:e.dot??!1,activeDot:{r:5,strokeWidth:0,fill:i},connectNulls:S},e.key)})]})})})},exports.TkxPieChart=function({data:n,height:c=300,showLegend:s=!0,showTooltip:d=!0,showLabels:h=!1,outerRadius:y="70%",startAngle:m=90,ariaLabel:k="Pie chart"}){const u=e.useTheme(),g=t.useReducedMotion(),p=o(u),f=l(u),[S,b]=(0,i.useState)(g);return(0,i.useEffect)(()=>{if(g)return void b(!0);const e=requestAnimationFrame(()=>b(!0));return()=>cancelAnimationFrame(e)},[g]),(0,r.jsx)("div",{role:"img","aria-label":k,style:{width:"100%",minWidth:240,height:c,position:"relative"},children:S&&(0,r.jsx)(a.ResponsiveContainer,{width:"100%",height:"100%",debounce:50,children:(0,r.jsxs)(a.PieChart,{children:[d&&(0,r.jsx)(a.Tooltip,{contentStyle:f.contentStyle,labelStyle:f.labelStyle,itemStyle:f.itemStyle}),s&&(0,r.jsx)(a.Legend,{wrapperStyle:{fontSize:13,color:u.textMuted}}),(0,r.jsx)(a.Pie,{data:n,dataKey:"value",nameKey:"name",outerRadius:y,startAngle:m,endAngle:m-360,label:h?({name:e,percent:t})=>`${e} (${(100*(t??0)).toFixed(0)}%)`:void 0,labelLine:h,strokeWidth:2,stroke:u.bg,children:n.map((e,t)=>(0,r.jsx)(a.Cell,{fill:e.color??p[t%p.length]},e.name))})]})})})},exports.TkxRadarChart=function({data:t,series:i,angleKey:n,height:c=300,showLegend:s=!0,showTooltip:d=!0,outerRadius:h="70%",ariaLabel:y="Radar chart"}){const m=e.useTheme(),k=o(m),u=l(m);return(0,r.jsx)("div",{role:"img","aria-label":y,style:{width:"100%",height:c},children:(0,r.jsx)(a.ResponsiveContainer,{width:"100%",height:"100%",children:(0,r.jsxs)(a.RadarChart,{data:t,outerRadius:h,children:[(0,r.jsx)(a.PolarGrid,{stroke:m.border}),(0,r.jsx)(a.PolarAngleAxis,{dataKey:n,tick:{fill:m.textMuted,fontSize:12}}),(0,r.jsx)(a.PolarRadiusAxis,{tick:{fill:m.textMuted,fontSize:10},axisLine:!1,tickLine:!1}),d&&(0,r.jsx)(a.Tooltip,{contentStyle:u.contentStyle,labelStyle:u.labelStyle,itemStyle:u.itemStyle}),s&&(0,r.jsx)(a.Legend,{wrapperStyle:{fontSize:13,color:m.textMuted}}),i.map((e,t)=>{const i=e.color??k[t%k.length];return(0,r.jsx)(a.Radar,{name:e.label??e.key,dataKey:e.key,stroke:i,fill:i,fillOpacity:e.fillOpacity??.2,strokeWidth:2},e.key)})]})})})},exports.TkxScatterChart=function({series:t,height:i=300,margin:c=n,showGrid:s=!0,showLegend:d=!0,showTooltip:h=!0,xTickFormatter:y,yTickFormatter:m,zRange:k=[20,400],ariaLabel:u="Scatter chart"}){const g=e.useTheme(),p=o(g),f=l(g),S={fill:g.textMuted,fontSize:12};return(0,r.jsx)("div",{role:"img","aria-label":u,style:{width:"100%",height:i},children:(0,r.jsx)(a.ResponsiveContainer,{width:"100%",height:"100%",children:(0,r.jsxs)(a.ScatterChart,{margin:c,children:[s&&(0,r.jsx)(a.CartesianGrid,{strokeDasharray:"3 3",stroke:g.border}),(0,r.jsx)(a.XAxis,{type:"number",dataKey:"x",tick:S,axisLine:{stroke:g.border},tickLine:!1,tickFormatter:y}),(0,r.jsx)(a.YAxis,{type:"number",dataKey:"y",tick:S,axisLine:!1,tickLine:!1,tickFormatter:m}),(0,r.jsx)(a.ZAxis,{type:"number",dataKey:"z",range:k}),h&&(0,r.jsx)(a.Tooltip,{contentStyle:f.contentStyle,labelStyle:f.labelStyle,itemStyle:f.itemStyle,cursor:{strokeDasharray:"3 3"}}),d&&(0,r.jsx)(a.Legend,{wrapperStyle:{fontSize:13,color:g.textMuted,paddingTop:8}}),t.map((e,t)=>(0,r.jsx)(a.Scatter,{name:e.name,data:e.data,fill:e.color??p[t%p.length],fillOpacity:.8},e.name??t))]})})})};
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let e=require("recharts"),t=require("react"),r=require("react/jsx-runtime");["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])',"details > summary"].join(", ");var i=(0,t.createContext)({bg:"#0a0a0f",surface:"#12121a",surfaceAlt:"#1a1a2e",border:"#2a2a3e",text:"#e8e8f4",textMuted:"#8888aa",primary:"#00f5d4",secondary:"#7b2ff7",danger:"#f72585",warning:"#ffbe0b",success:"#06d6a0",info:"#3a86ff"});function a(){return(0,t.useContext)(i)}function o(e){return[e.primary,e.secondary,e.info,e.success,e.warning,e.danger,e.primary+"aa",e.secondary+"aa",e.info+"aa",e.success+"aa"]}var n={top:10,right:30,bottom:10,left:0};function l(e){return{contentStyle:{backgroundColor:e.surface,border:`1px solid ${e.border}`,borderRadius:8,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",color:e.text,fontSize:13},labelStyle:{color:e.textMuted,fontWeight:600,marginBottom:4},itemStyle:{color:e.text},cursor:{fill:`${e.primary}15`}}}function d({data:t,series:i,xKey:d,height:s=300,margin:c=n,showGrid:h=!0,showLegend:u=!0,showTooltip:p=!0,smooth:f=!0,xTickFormatter:b,yTickFormatter:g,yDomain:y,ariaLabel:m="Area chart"}){const x=a(),k=o(x),v=l(x),S={fill:x.textMuted,fontSize:12};return(0,r.jsx)("div",{role:"img","aria-label":m,style:{width:"100%",height:s},children:(0,r.jsx)(e.ResponsiveContainer,{width:"100%",height:"100%",children:(0,r.jsxs)(e.AreaChart,{data:t,margin:c,children:[h&&(0,r.jsx)(e.CartesianGrid,{strokeDasharray:"3 3",stroke:x.border,vertical:!1}),(0,r.jsx)(e.XAxis,{dataKey:d,tick:S,axisLine:{stroke:x.border},tickLine:!1,tickFormatter:b}),(0,r.jsx)(e.YAxis,{tick:S,axisLine:!1,tickLine:!1,tickFormatter:g,domain:y}),p&&(0,r.jsx)(e.Tooltip,{contentStyle:v.contentStyle,labelStyle:v.labelStyle,itemStyle:v.itemStyle,cursor:v.cursor}),u&&(0,r.jsx)(e.Legend,{wrapperStyle:{fontSize:13,color:x.textMuted,paddingTop:8}}),i.map((t,i)=>{const a=t.color??k[i%k.length];return(0,r.jsx)(e.Area,{type:f?"monotone":"linear",dataKey:t.key,name:t.label??t.key,stroke:a,strokeWidth:2,fill:a,fillOpacity:t.fillOpacity??.2,stackId:t.stacked?"stack":void 0,dot:!1,activeDot:{r:5,strokeWidth:0}},t.key)})]})})})}function s({data:t,series:i,xKey:d,height:s=300,margin:c=n,showGrid:h=!0,showLegend:u=!0,showTooltip:p=!0,layout:f="horizontal",barSize:b,xTickFormatter:g,yTickFormatter:y,ariaLabel:m="Bar chart"}){const x=a(),k=o(x),v=l(x),S={fill:x.textMuted,fontSize:12},w="vertical"===f;return(0,r.jsx)("div",{role:"img","aria-label":m,style:{width:"100%",height:s},children:(0,r.jsx)(e.ResponsiveContainer,{width:"100%",height:"100%",children:(0,r.jsxs)(e.BarChart,{data:t,margin:c,layout:f,children:[h&&(0,r.jsx)(e.CartesianGrid,{strokeDasharray:"3 3",stroke:x.border,vertical:w,horizontal:!w}),w?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(e.YAxis,{dataKey:d,type:"category",tick:S,axisLine:!1,tickLine:!1,tickFormatter:g,width:100}),(0,r.jsx)(e.XAxis,{type:"number",tick:S,axisLine:{stroke:x.border},tickLine:!1,tickFormatter:y})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(e.XAxis,{dataKey:d,tick:S,axisLine:{stroke:x.border},tickLine:!1,tickFormatter:g}),(0,r.jsx)(e.YAxis,{tick:S,axisLine:!1,tickLine:!1,tickFormatter:y})]}),p&&(0,r.jsx)(e.Tooltip,{contentStyle:v.contentStyle,labelStyle:v.labelStyle,itemStyle:v.itemStyle,cursor:{fill:`${x.surfaceAlt}`}}),u&&(0,r.jsx)(e.Legend,{wrapperStyle:{fontSize:13,color:x.textMuted,paddingTop:8}}),i.map((t,i)=>{const a=t.color??k[i%k.length];return(0,r.jsx)(e.Bar,{dataKey:t.key,name:t.label??t.key,fill:a,stackId:t.stackId,maxBarSize:b??40,radius:t.radius??[4,4,0,0]},t.key)})]})})})}function c({data:t,series:i,xKey:d,height:s=300,margin:c=n,showGrid:h=!0,showLegend:u=!0,showTooltip:p=!0,smooth:f=!0,referenceLines:b=[],xTickFormatter:g,yTickFormatter:y,yDomain:m,connectNulls:x=!1,ariaLabel:k="Line chart"}){const v=a(),S=o(v),w=l(v),L={fill:v.textMuted,fontSize:12};return(0,r.jsx)("div",{role:"img","aria-label":k,style:{width:"100%",height:s},children:(0,r.jsx)(e.ResponsiveContainer,{width:"100%",height:"100%",children:(0,r.jsxs)(e.LineChart,{data:t,margin:c,children:[h&&(0,r.jsx)(e.CartesianGrid,{strokeDasharray:"3 3",stroke:v.border,vertical:!1}),(0,r.jsx)(e.XAxis,{dataKey:d,tick:L,axisLine:{stroke:v.border},tickLine:!1,tickFormatter:g}),(0,r.jsx)(e.YAxis,{tick:L,axisLine:!1,tickLine:!1,tickFormatter:y,domain:m}),p&&(0,r.jsx)(e.Tooltip,{contentStyle:w.contentStyle,labelStyle:w.labelStyle,itemStyle:w.itemStyle,cursor:{stroke:v.border,strokeWidth:1}}),u&&(0,r.jsx)(e.Legend,{wrapperStyle:{fontSize:13,color:v.textMuted,paddingTop:8}}),b.map((t,i)=>(0,r.jsx)(e.ReferenceLine,{y:t.y,x:t.x,label:t.label?{value:t.label,fill:v.textMuted,fontSize:11}:void 0,stroke:t.color??v.border,strokeDasharray:t.dashed?"4 4":void 0},i)),i.map((t,i)=>{const a=t.color??S[i%S.length];return(0,r.jsx)(e.Line,{type:f?"monotone":"linear",dataKey:t.key,name:t.label??t.key,stroke:a,strokeWidth:t.strokeWidth??2,strokeDasharray:t.dashed?"6 3":void 0,dot:t.dot??!1,activeDot:{r:5,strokeWidth:0,fill:a},connectNulls:x},t.key)})]})})})}function h(){const[e,r]=(0,t.useState)(()=>"undefined"!=typeof window&&"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches);return(0,t.useEffect)(()=>{if("undefined"==typeof window)return;const e=window.matchMedia("(prefers-reduced-motion: reduce)"),t=e=>r(e.matches);return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]),e}function u({data:i,height:n=300,showLegend:d=!0,showTooltip:s=!0,showLabels:c=!1,outerRadius:u="70%",startAngle:p=90,ariaLabel:f="Pie chart"}){const b=a(),g=h(),y=o(b),m=l(b),[x,k]=(0,t.useState)(g);return(0,t.useEffect)(()=>{if(g)return void k(!0);const e=requestAnimationFrame(()=>k(!0));return()=>cancelAnimationFrame(e)},[g]),(0,r.jsx)("div",{role:"img","aria-label":f,style:{width:"100%",minWidth:240,height:n,position:"relative"},children:x&&(0,r.jsx)(e.ResponsiveContainer,{width:"100%",height:"100%",debounce:50,children:(0,r.jsxs)(e.PieChart,{children:[s&&(0,r.jsx)(e.Tooltip,{contentStyle:m.contentStyle,labelStyle:m.labelStyle,itemStyle:m.itemStyle}),d&&(0,r.jsx)(e.Legend,{wrapperStyle:{fontSize:13,color:b.textMuted}}),(0,r.jsx)(e.Pie,{data:i,dataKey:"value",nameKey:"name",outerRadius:u,startAngle:p,endAngle:p-360,label:c?({name:e,percent:t})=>`${e} (${(100*(t??0)).toFixed(0)}%)`:void 0,labelLine:c,strokeWidth:2,stroke:b.bg,children:i.map((t,i)=>(0,r.jsx)(e.Cell,{fill:t.color??y[i%y.length]},t.name))})]})})})}function p({series:t,height:i=300,margin:d=n,showGrid:s=!0,showLegend:c=!0,showTooltip:h=!0,xTickFormatter:u,yTickFormatter:p,zRange:f=[20,400],ariaLabel:b="Scatter chart"}){const g=a(),y=o(g),m=l(g),x={fill:g.textMuted,fontSize:12};return(0,r.jsx)("div",{role:"img","aria-label":b,style:{width:"100%",height:i},children:(0,r.jsx)(e.ResponsiveContainer,{width:"100%",height:"100%",children:(0,r.jsxs)(e.ScatterChart,{margin:d,children:[s&&(0,r.jsx)(e.CartesianGrid,{strokeDasharray:"3 3",stroke:g.border}),(0,r.jsx)(e.XAxis,{type:"number",dataKey:"x",tick:x,axisLine:{stroke:g.border},tickLine:!1,tickFormatter:u}),(0,r.jsx)(e.YAxis,{type:"number",dataKey:"y",tick:x,axisLine:!1,tickLine:!1,tickFormatter:p}),(0,r.jsx)(e.ZAxis,{type:"number",dataKey:"z",range:f}),h&&(0,r.jsx)(e.Tooltip,{contentStyle:m.contentStyle,labelStyle:m.labelStyle,itemStyle:m.itemStyle,cursor:{strokeDasharray:"3 3"}}),c&&(0,r.jsx)(e.Legend,{wrapperStyle:{fontSize:13,color:g.textMuted,paddingTop:8}}),t.map((t,i)=>(0,r.jsx)(e.Scatter,{name:t.name,data:t.data,fill:t.color??y[i%y.length],fillOpacity:.8},t.name??i))]})})})}function f(e){const t=[];let r=[],i="",a=!1,o=0;const n=e.length;for(;o<n;){const n=e[o];if(a){if('"'===n){if('"'===e[o+1]){i+='"',o+=2;continue}a=!1,o++;continue}i+=n,o++}else'"'!==n?","!==n?"\r"!==n?"\n"!==n?(i+=n,o++):(r.push(i),t.push(r),r=[],i="",o++):o++:(r.push(i),i="",o++):(a=!0,o++)}return(i.length>0||r.length>0)&&(r.push(i),t.push(r)),t}function b(e){if(e.length<2)return[];const t=e[0].map(e=>e.trim()||"_"),r=[];for(let i=1;i<e.length;i++){if(1===e[i].length&&""===e[i][0])continue;const a={};for(let r=0;r<t.length;r++){const o=(e[i][r]??"").trim();if(""===o)a[t[r]]=null;else{const e=Number(o);a[t[r]]=Number.isFinite(e)&&""!==o&&/^-?\d/.test(o)?e:o}}r.push(a)}return r}function g(e){const t={};if(0===e.length)return t;const r=Object.keys(e[0]);for(const i of r){let r=!1,a=!1;for(const t of e){const e=t[i];if(null!=e&&("number"==typeof e?r=!0:a=!0,r&&a))break}t[i]=r&&a?"mixed":r?"number":"string"}return t}var y=["bar","line","area","pie","scatter"],m={bar:"📊 Bar",line:"📈 Line",area:"⛰️ Area",pie:"🥧 Pie",scatter:"✨ Scatter"};function x({label:e,value:t,onChange:i,options:a,testId:o}){return(0,r.jsxs)("label",{style:{display:"flex",flexDirection:"column",gap:4},children:[(0,r.jsx)("span",{style:{fontSize:11,fontWeight:700,color:"#888",textTransform:"uppercase"},children:e}),(0,r.jsx)("select",{value:t,onChange:e=>i(e.target.value),"data-testid":o,style:{padding:"8px 10px",minHeight:36,borderRadius:6,border:"1px solid var(--tkx-border, #2a2a3e)",background:"var(--tkx-bg-subtle, #0d0d14)",color:"var(--tkx-fg, #e8e8f4)",fontSize:13,fontFamily:"inherit"},children:a.map(e=>(0,r.jsx)("option",{value:e,children:e},e))})]})}exports.TkxAreaChart=d,exports.TkxBarChart=s,exports.TkxDataExplorer=function({initialData:e,allowedCharts:i=y,previewRows:a=5,chartHeight:o=320,onDataLoad:n,style:l,className:h}){const[k,v]=(0,t.useState)(e??[]),[S,w]=(0,t.useState)(null),[L,z]=(0,t.useState)(i[0]),T=(0,t.useMemo)(()=>{if(!e||0===e.length)return{x:"",y:[]};const t=g(e),r=Object.keys(e[0]),i=r.find(e=>"string"===t[e]||"mixed"===t[e])??r[0]??"",a=r.find(e=>"number"===t[e]);return{x:i,y:a?[a]:[]}},[]),[F,W]=(0,t.useState)(T.x),[K,R]=(0,t.useState)(T.y),[D,C]=(0,t.useState)(!1),N=(0,t.useRef)(null),[A,O]=(0,t.useState)(""),j=(0,t.useMemo)(()=>g(k),[k]),B=(0,t.useMemo)(()=>k[0]?Object.keys(k[0]):[],[k]),I=(0,t.useMemo)(()=>B.filter(e=>"number"===j[e]),[B,j]);(0,t.useMemo)(()=>B.filter(e=>"string"===j[e]||"mixed"===j[e]),[B,j]);const $=(0,t.useCallback)(e=>{v(e);const t=g(e),r=e[0]?Object.keys(e[0]):[],i=r.find(e=>"string"===t[e]||"mixed"===t[e]),a=r.find(e=>"number"===t[e]);W(i??r[0]??""),R(a?[a]:[]),w(null),n?.(e)},[n]),H=(0,t.useCallback)((e,t)=>{try{const r=e.trim();if(!r)return void w("Nothing to parse");if("json"===t||"["===r[0]||"{"===r[0]){const e=JSON.parse(r),t=Array.isArray(e)?e:Array.isArray(e.data)?e.data:null;return t?0===t.length?void w("No rows in JSON"):void $(t):void w("JSON must be an array of records or { data: [...] }")}const i=b(f(r));if(0===i.length)return void w("No rows after the header");$(i)}catch(r){w(`Parse failed: ${r instanceof Error?r.message:String(r)}`)}},[$]),J=(0,t.useCallback)(e=>{const t=new FileReader;t.onload=()=>{H(String(t.result??""),e.name.toLowerCase().endsWith(".json")?"json":e.name.toLowerCase().endsWith(".csv")?"csv":void 0)},t.onerror=()=>w("Could not read file"),t.readAsText(e)},[H]),q=k,G=K.map(e=>({key:e,label:e}));let P=null;if(k.length>0&&F&&K.length>0)switch(L){case"bar":P=(0,r.jsx)(s,{data:q,xKey:F,series:G,height:o});break;case"line":P=(0,r.jsx)(c,{data:q,xKey:F,series:G,height:o});break;case"area":P=(0,r.jsx)(d,{data:q,xKey:F,series:G,height:o});break;case"pie":P=(0,r.jsx)(u,{data:q.map(e=>({name:String(e[F]??""),value:Number(e[K[0]])||0})),height:o});break;case"scatter":P=(0,r.jsx)(p,{series:[{name:K[0],data:q.map(e=>({x:Number(e[F]),y:Number(e[K[0]])})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}],height:o})}const V={padding:16,borderBottom:"1px solid var(--tkx-border, #2a2a3e)"};return(0,r.jsxs)("div",{className:h,"data-testid":"tkx-data-explorer",style:{border:"1px solid var(--tkx-border, #2a2a3e)",borderRadius:12,background:"var(--tkx-bg, #0a0a0f)",color:"var(--tkx-fg, #e8e8f4)",overflow:"hidden",...l},children:[(0,r.jsxs)("div",{style:V,children:[(0,r.jsxs)("div",{role:"button",tabIndex:0,"aria-label":"Drop a CSV or JSON file","data-testid":"upload-zone",onDragOver:e=>{e.preventDefault(),C(!0)},onDragLeave:()=>C(!1),onDrop:e=>{e.preventDefault(),C(!1);const t=e.dataTransfer.files?.[0];t&&J(t)},onClick:()=>N.current?.click(),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),N.current?.click())},style:{border:"2px dashed "+(D?"var(--tkx-accent, #00f5d4)":"var(--tkx-border, #2a2a3e)"),borderRadius:10,padding:20,textAlign:"center",cursor:"pointer",background:D?"rgba(0,245,212,0.04)":"var(--tkx-bg-subtle, #0d0d14)",transition:"border-color 0.15s, background 0.15s",outline:"none"},children:[(0,r.jsx)("div",{style:{fontSize:32,marginBottom:8},"aria-hidden":"true",children:"📁"}),(0,r.jsx)("div",{style:{fontWeight:600,marginBottom:4},children:"Drop a CSV or JSON file here, or click to choose"}),(0,r.jsx)("div",{style:{fontSize:12,color:"#888"},children:"Files are parsed in-browser — nothing is uploaded."})]}),(0,r.jsx)("input",{ref:N,type:"file",accept:".csv,.json,text/csv,application/json",onChange:e=>{const t=e.target.files?.[0];t&&J(t),N.current&&(N.current.value="")},"data-testid":"file-input",style:{display:"none"}}),(0,r.jsxs)("details",{style:{marginTop:12},children:[(0,r.jsx)("summary",{style:{cursor:"pointer",fontSize:13,color:"#aaa"},children:"…or paste raw CSV / JSON"}),(0,r.jsx)("textarea",{"data-testid":"paste-area",value:A,onChange:e=>O(e.target.value),placeholder:"name,score\nAda,99\nGrace,95",rows:6,style:{width:"100%",marginTop:8,padding:10,background:"var(--tkx-bg-subtle, #0d0d14)",border:"1px solid var(--tkx-border, #2a2a3e)",borderRadius:6,color:"var(--tkx-fg, #e8e8f4)",fontFamily:"ui-monospace, monospace",fontSize:12,resize:"vertical",boxSizing:"border-box"}}),(0,r.jsx)("button",{type:"button","data-testid":"parse-button",onClick:()=>H(A),style:{marginTop:8,padding:"8px 14px",minHeight:36,border:"none",borderRadius:6,background:"var(--tkx-accent, #00f5d4)",color:"#0a0a0f",fontWeight:700,cursor:"pointer"},children:"Parse"})]}),S&&(0,r.jsx)("div",{role:"alert","data-testid":"parse-error",style:{marginTop:12,padding:10,borderRadius:6,background:"rgba(255,0,110,0.1)",border:"1px solid #ff006e",color:"#ff7eaf",fontSize:13},children:S})]}),k.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{style:V,children:(0,r.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:16,alignItems:"flex-end"},children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"tkx-de-chart",style:{display:"block",fontSize:11,fontWeight:700,color:"#888",marginBottom:4,textTransform:"uppercase"},children:"Chart"}),(0,r.jsx)("div",{role:"tablist",style:{display:"flex",gap:4,flexWrap:"wrap"},children:i.map(e=>(0,r.jsx)("button",{type:"button",role:"tab","aria-selected":L===e,"data-testid":`chart-${e}`,onClick:()=>z(e),style:{padding:"8px 12px",minHeight:36,borderRadius:6,border:"1px solid "+(L===e?"var(--tkx-accent, #00f5d4)":"var(--tkx-border, #2a2a3e)"),background:L===e?"rgba(0,245,212,0.12)":"transparent",color:L===e?"var(--tkx-accent, #00f5d4)":"var(--tkx-fg, #e8e8f4)",fontSize:13,fontWeight:600,cursor:"pointer"},children:m[e]},e))})]}),(0,r.jsx)(x,{label:"pie"===L?"Category":"scatter"===L?"X (numeric)":"X axis",value:F,onChange:W,options:"scatter"===L?I:B,testId:"x-field"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{style:{fontSize:11,fontWeight:700,color:"#888",marginBottom:4,textTransform:"uppercase"},children:"pie"===L||"scatter"===L?"Value":"Y series"}),(0,r.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:[I.map(e=>{const t=K.includes(e),i="pie"===L||"scatter"===L;return(0,r.jsx)("button",{type:"button","data-testid":`y-${e}`,"aria-pressed":t,onClick:()=>{R(i?[e]:t?K.filter(t=>t!==e):[...K,e])},style:{padding:"6px 10px",minHeight:32,borderRadius:6,border:"1px solid "+(t?"var(--tkx-accent, #00f5d4)":"var(--tkx-border, #2a2a3e)"),background:t?"rgba(0,245,212,0.12)":"transparent",color:t?"var(--tkx-accent, #00f5d4)":"#aaa",fontSize:12,fontWeight:600,cursor:"pointer",fontFamily:"inherit"},children:e},e)}),0===I.length&&(0,r.jsx)("span",{style:{fontSize:12,color:"#888"},children:"No numeric columns detected."})]})]}),(0,r.jsx)("button",{type:"button","data-testid":"clear-data",onClick:()=>{v([]),w(null),W(""),R([])},style:{marginLeft:"auto",padding:"8px 12px",minHeight:36,borderRadius:6,border:"1px solid var(--tkx-border, #2a2a3e)",background:"transparent",color:"#aaa",cursor:"pointer",fontSize:12,fontWeight:600},children:"Clear data"})]})}),(0,r.jsxs)("div",{style:V,children:[(0,r.jsxs)("div",{style:{fontSize:11,fontWeight:700,color:"#888",marginBottom:8,textTransform:"uppercase",display:"flex",alignItems:"baseline",gap:8,flexWrap:"wrap"},children:[(0,r.jsxs)("span",{children:["Data · ",k.length," row",1===k.length?"":"s"]}),k.length>a&&(0,r.jsx)("span",{style:{fontSize:10,color:"#c4a8ff",fontWeight:600,letterSpacing:"0.04em"},children:"scroll for more ↓"})]}),(0,r.jsx)("div",{"data-testid":"preview-table-scroll",style:{overflowX:"auto",overflowY:"auto",maxHeight:26*a+36,border:"1px solid var(--tkx-border, #2a2a3e)",borderRadius:6},children:(0,r.jsxs)("table",{role:"table",style:{borderCollapse:"collapse",fontSize:12,fontFamily:"ui-monospace, monospace",width:"100%"},children:[(0,r.jsx)("thead",{children:(0,r.jsx)("tr",{children:B.map(e=>(0,r.jsxs)("th",{scope:"col",style:{padding:"6px 10px",textAlign:"left",borderBottom:"1px solid var(--tkx-border, #2a2a3e)",color:"number"===j[e]?"var(--tkx-accent, #00f5d4)":"#ccc",fontWeight:700,position:"sticky",top:0,background:"var(--tkx-bg-subtle, #0d0d14)",zIndex:1},children:[(0,r.jsx)("div",{children:e}),(0,r.jsx)("div",{style:{fontSize:10,fontWeight:400,color:"#666",textTransform:"uppercase"},children:j[e]})]},e))})}),(0,r.jsx)("tbody",{children:k.map((e,t)=>(0,r.jsx)("tr",{"data-testid":`preview-row-${t}`,children:B.map(t=>(0,r.jsx)("td",{style:{padding:"6px 10px",borderBottom:"1px solid var(--tkx-border-soft, #1a1a25)",color:null===e[t]?"#555":"var(--tkx-fg, #e8e8f4)"},children:null===e[t]?"—":String(e[t])},t))},t))})]})})]}),(0,r.jsx)("div",{style:{padding:16},"data-testid":"chart-container",children:P||(0,r.jsx)("div",{style:{padding:32,textAlign:"center",color:"#888",fontSize:13,border:"1px dashed var(--tkx-border, #2a2a3e)",borderRadius:8},children:"Pick at least one numeric Y series above to render the chart."})})]})]})},exports.TkxDonutChart=function({data:i,height:n=300,showLegend:d=!0,showTooltip:s=!0,centerLabel:c,centerSublabel:u,innerRadius:p="55%",outerRadius:f="75%",startAngle:b=90,ariaLabel:g="Donut chart"}){const y=a(),m=h(),x=o(y),k=l(y),[v,S]=(0,t.useState)(m);return(0,t.useEffect)(()=>{if(m)return void S(!0);const e=requestAnimationFrame(()=>S(!0));return()=>cancelAnimationFrame(e)},[m]),(0,r.jsxs)("div",{role:"img","aria-label":g,style:{width:"100%",minWidth:240,height:n,position:"relative"},children:[v&&(0,r.jsx)(e.ResponsiveContainer,{width:"100%",height:"100%",debounce:50,children:(0,r.jsxs)(e.PieChart,{children:[s&&(0,r.jsx)(e.Tooltip,{contentStyle:k.contentStyle,labelStyle:k.labelStyle,itemStyle:k.itemStyle}),d&&(0,r.jsx)(e.Legend,{wrapperStyle:{fontSize:13,color:y.textMuted}}),(0,r.jsx)(e.Pie,{data:i,dataKey:"value",nameKey:"name",innerRadius:p,outerRadius:f,startAngle:b,endAngle:b-360,strokeWidth:3,stroke:y.bg,label:!1,labelLine:!1,children:i.map((t,i)=>(0,r.jsx)(e.Cell,{fill:t.color??x[i%x.length]},t.name))}),(c||u)&&(0,r.jsx)("text",{})]})}),(c||u)&&(0,r.jsxs)("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",pointerEvents:"none",marginTop:d?-24:0},children:[c&&(0,r.jsx)("span",{style:{fontSize:22,fontWeight:700,color:y.text,lineHeight:1},children:c}),u&&(0,r.jsx)("span",{style:{fontSize:13,color:y.textMuted,marginTop:4},children:u})]})]})},exports.TkxLineChart=c,exports.TkxPieChart=u,exports.TkxRadarChart=function({data:t,series:i,angleKey:n,height:d=300,showLegend:s=!0,showTooltip:c=!0,outerRadius:h="70%",ariaLabel:u="Radar chart"}){const p=a(),f=o(p),b=l(p);return(0,r.jsx)("div",{role:"img","aria-label":u,style:{width:"100%",height:d},children:(0,r.jsx)(e.ResponsiveContainer,{width:"100%",height:"100%",children:(0,r.jsxs)(e.RadarChart,{data:t,outerRadius:h,children:[(0,r.jsx)(e.PolarGrid,{stroke:p.border}),(0,r.jsx)(e.PolarAngleAxis,{dataKey:n,tick:{fill:p.textMuted,fontSize:12}}),(0,r.jsx)(e.PolarRadiusAxis,{tick:{fill:p.textMuted,fontSize:10},axisLine:!1,tickLine:!1}),c&&(0,r.jsx)(e.Tooltip,{contentStyle:b.contentStyle,labelStyle:b.labelStyle,itemStyle:b.itemStyle}),s&&(0,r.jsx)(e.Legend,{wrapperStyle:{fontSize:13,color:p.textMuted}}),i.map((t,i)=>{const a=t.color??f[i%f.length];return(0,r.jsx)(e.Radar,{name:t.label??t.key,dataKey:t.key,stroke:a,fill:a,fillOpacity:t.fillOpacity??.2,strokeWidth:2},t.key)})]})})})},exports.TkxScatterChart=p,exports.csvToRecords=b,exports.inferColumnTypes=g,exports.parseCSV=f;
package/dist/charts.js CHANGED
@@ -1,22 +1,41 @@
1
- import{p as e}from"./chunk-DdHSYetV.js";import{o as t}from"./chunk-BHX35YDv.js";import{useEffect as i,useState as r}from"react";import{Fragment as a,jsx as o,jsxs as n}from"react/jsx-runtime";import{Area as l,AreaChart as c,Bar as s,BarChart as d,CartesianGrid as h,Cell as m,Legend as y,Line as k,LineChart as u,Pie as g,PieChart as p,PolarAngleAxis as f,PolarGrid as S,PolarRadiusAxis as b,Radar as w,RadarChart as L,ReferenceLine as x,ResponsiveContainer as v,Scatter as z,ScatterChart as F,Tooltip as T,XAxis as K,YAxis as D,ZAxis as W}from"recharts";function A(e){return[e.primary,e.secondary,e.info,e.success,e.warning,e.danger,e.primary+"aa",e.secondary+"aa",e.info+"aa",e.success+"aa"]}var R={top:10,right:30,bottom:10,left:0};function $(e){return{contentStyle:{backgroundColor:e.surface,border:`1px solid ${e.border}`,borderRadius:8,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",color:e.text,fontSize:13},labelStyle:{color:e.textMuted,fontWeight:600,marginBottom:4},itemStyle:{color:e.text},cursor:{fill:`${e.primary}15`}}}function j({data:t,series:i,xKey:r,height:a=300,margin:s=R,showGrid:d=!0,showLegend:m=!0,showTooltip:k=!0,smooth:u=!0,xTickFormatter:g,yTickFormatter:p,yDomain:f,ariaLabel:S="Area chart"}){const b=e(),w=A(b),L=$(b),x={fill:b.textMuted,fontSize:12};/* @__PURE__ */
2
- return o("div",{role:"img","aria-label":S,style:{width:"100%",height:a},children:/* @__PURE__ */o(v,{width:"100%",height:"100%",children:/* @__PURE__ */n(c,{data:t,margin:s,children:[d&&/* @__PURE__ */o(h,{strokeDasharray:"3 3",stroke:b.border,vertical:!1}),
3
- /* @__PURE__ */o(K,{dataKey:r,tick:x,axisLine:{stroke:b.border},tickLine:!1,tickFormatter:g}),
4
- /* @__PURE__ */o(D,{tick:x,axisLine:!1,tickLine:!1,tickFormatter:p,domain:f}),k&&/* @__PURE__ */o(T,{contentStyle:L.contentStyle,labelStyle:L.labelStyle,itemStyle:L.itemStyle,cursor:L.cursor}),m&&/* @__PURE__ */o(y,{wrapperStyle:{fontSize:13,color:b.textMuted,paddingTop:8}}),i.map((e,t)=>{const i=e.color??w[t%w.length];/* @__PURE__ */
5
- return o(l,{type:u?"monotone":"linear",dataKey:e.key,name:e.label??e.key,stroke:i,strokeWidth:2,fill:i,fillOpacity:e.fillOpacity??.2,stackId:e.stacked?"stack":void 0,dot:!1,activeDot:{r:5,strokeWidth:0}},e.key)})]})})})}function G({data:t,series:i,xKey:r,height:l=300,margin:c=R,showGrid:m=!0,showLegend:k=!0,showTooltip:u=!0,layout:g="horizontal",barSize:p,xTickFormatter:f,yTickFormatter:S,ariaLabel:b="Bar chart"}){const w=e(),L=A(w),x=$(w),z={fill:w.textMuted,fontSize:12},F="vertical"===g;/* @__PURE__ */
6
- return o("div",{role:"img","aria-label":b,style:{width:"100%",height:l},children:/* @__PURE__ */o(v,{width:"100%",height:"100%",children:/* @__PURE__ */n(d,{data:t,margin:c,layout:g,children:[m&&/* @__PURE__ */o(h,{strokeDasharray:"3 3",stroke:w.border,vertical:F,horizontal:!F}),/* @__PURE__ */n(a,F?{children:[/* @__PURE__ */o(D,{dataKey:r,type:"category",tick:z,axisLine:!1,tickLine:!1,tickFormatter:f,width:100}),/* @__PURE__ */o(K,{type:"number",tick:z,axisLine:{stroke:w.border},tickLine:!1,tickFormatter:S})]}:{children:[/* @__PURE__ */o(K,{dataKey:r,tick:z,axisLine:{stroke:w.border},tickLine:!1,tickFormatter:f}),/* @__PURE__ */o(D,{tick:z,axisLine:!1,tickLine:!1,tickFormatter:S})]}),u&&/* @__PURE__ */o(T,{contentStyle:x.contentStyle,labelStyle:x.labelStyle,itemStyle:x.itemStyle,cursor:{fill:`${w.surfaceAlt}`}}),k&&/* @__PURE__ */o(y,{wrapperStyle:{fontSize:13,color:w.textMuted,paddingTop:8}}),i.map((e,t)=>{const i=e.color??L[t%L.length];/* @__PURE__ */
7
- return o(s,{dataKey:e.key,name:e.label??e.key,fill:i,stackId:e.stackId,maxBarSize:p??40,radius:e.radius??[4,4,0,0]},e.key)})]})})})}function B({data:t,series:i,xKey:r,height:a=300,margin:l=R,showGrid:c=!0,showLegend:s=!0,showTooltip:d=!0,smooth:m=!0,referenceLines:g=[],xTickFormatter:p,yTickFormatter:f,yDomain:S,connectNulls:b=!1,ariaLabel:w="Line chart"}){const L=e(),z=A(L),F=$(L),W={fill:L.textMuted,fontSize:12};/* @__PURE__ */
8
- return o("div",{role:"img","aria-label":w,style:{width:"100%",height:a},children:/* @__PURE__ */o(v,{width:"100%",height:"100%",children:/* @__PURE__ */n(u,{data:t,margin:l,children:[c&&/* @__PURE__ */o(h,{strokeDasharray:"3 3",stroke:L.border,vertical:!1}),
9
- /* @__PURE__ */o(K,{dataKey:r,tick:W,axisLine:{stroke:L.border},tickLine:!1,tickFormatter:p}),
10
- /* @__PURE__ */o(D,{tick:W,axisLine:!1,tickLine:!1,tickFormatter:f,domain:S}),d&&/* @__PURE__ */o(T,{contentStyle:F.contentStyle,labelStyle:F.labelStyle,itemStyle:F.itemStyle,cursor:{stroke:L.border,strokeWidth:1}}),s&&/* @__PURE__ */o(y,{wrapperStyle:{fontSize:13,color:L.textMuted,paddingTop:8}}),g.map((e,t)=>/* @__PURE__ */o(x,{y:e.y,x:e.x,label:e.label?{value:e.label,fill:L.textMuted,fontSize:11}:void 0,stroke:e.color??L.border,strokeDasharray:e.dashed?"4 4":void 0},t)),i.map((e,t)=>{const i=e.color??z[t%z.length];/* @__PURE__ */
11
- return o(k,{type:m?"monotone":"linear",dataKey:e.key,name:e.label??e.key,stroke:i,strokeWidth:e.strokeWidth??2,strokeDasharray:e.dashed?"6 3":void 0,dot:e.dot??!1,activeDot:{r:5,strokeWidth:0,fill:i},connectNulls:b},e.key)})]})})})}function I({data:a,height:l=300,showLegend:c=!0,showTooltip:s=!0,showLabels:d=!1,outerRadius:h="70%",startAngle:k=90,ariaLabel:u="Pie chart"}){const f=e(),S=t(),b=A(f),w=$(f),[L,x]=r(S);return i(()=>{if(S)return void x(!0);const e=requestAnimationFrame(()=>x(!0));return()=>cancelAnimationFrame(e)},[S]),/* @__PURE__ */o("div",{role:"img","aria-label":u,style:{width:"100%",minWidth:240,height:l,position:"relative"},children:L&&/* @__PURE__ */o(v,{width:"100%",height:"100%",debounce:50,children:/* @__PURE__ */n(p,{children:[s&&/* @__PURE__ */o(T,{contentStyle:w.contentStyle,labelStyle:w.labelStyle,itemStyle:w.itemStyle}),c&&/* @__PURE__ */o(y,{wrapperStyle:{fontSize:13,color:f.textMuted}}),
12
- /* @__PURE__ */o(g,{data:a,dataKey:"value",nameKey:"name",outerRadius:h,startAngle:k,endAngle:k-360,label:d?({name:e,percent:t})=>`${e} (${(100*(t??0)).toFixed(0)}%)`:void 0,labelLine:d,strokeWidth:2,stroke:f.bg,children:a.map((e,t)=>/* @__PURE__ */o(m,{fill:e.color??b[t%b.length]},e.name))})]})})})}function O({data:a,height:l=300,showLegend:c=!0,showTooltip:s=!0,centerLabel:d,centerSublabel:h,innerRadius:k="55%",outerRadius:u="75%",startAngle:f=90,ariaLabel:S="Donut chart"}){const b=e(),w=t(),L=A(b),x=$(b),[z,F]=r(w);return i(()=>{if(w)return void F(!0);const e=requestAnimationFrame(()=>F(!0));return()=>cancelAnimationFrame(e)},[w]),/* @__PURE__ */n("div",{role:"img","aria-label":S,style:{width:"100%",minWidth:240,height:l,position:"relative"},children:[z&&/* @__PURE__ */o(v,{width:"100%",height:"100%",debounce:50,children:/* @__PURE__ */n(p,{children:[s&&/* @__PURE__ */o(T,{contentStyle:x.contentStyle,labelStyle:x.labelStyle,itemStyle:x.itemStyle}),c&&/* @__PURE__ */o(y,{wrapperStyle:{fontSize:13,color:b.textMuted}}),
13
- /* @__PURE__ */o(g,{data:a,dataKey:"value",nameKey:"name",innerRadius:k,outerRadius:u,startAngle:f,endAngle:f-360,strokeWidth:3,stroke:b.bg,label:!1,labelLine:!1,children:a.map((e,t)=>/* @__PURE__ */o(m,{fill:e.color??L[t%L.length]},e.name))}),(d||h)&&/* @__PURE__ */o("text",{})]})}),(d||h)&&/* @__PURE__ */n("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",pointerEvents:"none",marginTop:c?-24:0},children:[d&&/* @__PURE__ */o("span",{style:{fontSize:22,fontWeight:700,color:b.text,lineHeight:1},children:d}),h&&/* @__PURE__ */o("span",{style:{fontSize:13,color:b.textMuted,marginTop:4},children:h})]})]})}function q({series:t,height:i=300,margin:r=R,showGrid:a=!0,showLegend:l=!0,showTooltip:c=!0,xTickFormatter:s,yTickFormatter:d,zRange:m=[20,400],ariaLabel:k="Scatter chart"}){const u=e(),g=A(u),p=$(u),f={fill:u.textMuted,fontSize:12};/* @__PURE__ */
14
- return o("div",{role:"img","aria-label":k,style:{width:"100%",height:i},children:/* @__PURE__ */o(v,{width:"100%",height:"100%",children:/* @__PURE__ */n(F,{margin:r,children:[a&&/* @__PURE__ */o(h,{strokeDasharray:"3 3",stroke:u.border}),
15
- /* @__PURE__ */o(K,{type:"number",dataKey:"x",tick:f,axisLine:{stroke:u.border},tickLine:!1,tickFormatter:s}),
16
- /* @__PURE__ */o(D,{type:"number",dataKey:"y",tick:f,axisLine:!1,tickLine:!1,tickFormatter:d}),
17
- /* @__PURE__ */o(W,{type:"number",dataKey:"z",range:m}),c&&/* @__PURE__ */o(T,{contentStyle:p.contentStyle,labelStyle:p.labelStyle,itemStyle:p.itemStyle,cursor:{strokeDasharray:"3 3"}}),l&&/* @__PURE__ */o(y,{wrapperStyle:{fontSize:13,color:u.textMuted,paddingTop:8}}),t.map((e,t)=>/* @__PURE__ */o(z,{name:e.name,data:e.data,fill:e.color??g[t%g.length],fillOpacity:.8},e.name??t))]})})})}function C({data:t,series:i,angleKey:r,height:a=300,showLegend:l=!0,showTooltip:c=!0,outerRadius:s="70%",ariaLabel:d="Radar chart"}){const h=e(),m=A(h),k=$(h);/* @__PURE__ */
18
- return o("div",{role:"img","aria-label":d,style:{width:"100%",height:a},children:/* @__PURE__ */o(v,{width:"100%",height:"100%",children:/* @__PURE__ */n(L,{data:t,outerRadius:s,children:[
19
- /* @__PURE__ */o(S,{stroke:h.border}),
20
- /* @__PURE__ */o(f,{dataKey:r,tick:{fill:h.textMuted,fontSize:12}}),
21
- /* @__PURE__ */o(b,{tick:{fill:h.textMuted,fontSize:10},axisLine:!1,tickLine:!1}),c&&/* @__PURE__ */o(T,{contentStyle:k.contentStyle,labelStyle:k.labelStyle,itemStyle:k.itemStyle}),l&&/* @__PURE__ */o(y,{wrapperStyle:{fontSize:13,color:h.textMuted}}),i.map((e,t)=>{const i=e.color??m[t%m.length];/* @__PURE__ */
22
- return o(w,{name:e.label??e.key,dataKey:e.key,stroke:i,fill:i,fillOpacity:e.fillOpacity??.2,strokeWidth:2},e.key)})]})})})}export{j as TkxAreaChart,G as TkxBarChart,O as TkxDonutChart,B as TkxLineChart,I as TkxPieChart,C as TkxRadarChart,q as TkxScatterChart};
1
+ import{Area as e,AreaChart as t,Bar as r,BarChart as i,CartesianGrid as a,Cell as o,Legend as n,Line as l,LineChart as d,Pie as s,PieChart as c,PolarAngleAxis as h,PolarGrid as u,PolarRadiusAxis as f,Radar as p,RadarChart as b,ReferenceLine as g,ResponsiveContainer as y,Scatter as m,ScatterChart as k,Tooltip as x,XAxis as v,YAxis as S,ZAxis as w}from"recharts";import{createContext as L,useCallback as z,useContext as T,useEffect as F,useMemo as W,useRef as K,useState as R}from"react";import{Fragment as D,jsx as C,jsxs as N}from"react/jsx-runtime";["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])',"details > summary"].join(", ");var A=L({bg:"#0a0a0f",surface:"#12121a",surfaceAlt:"#1a1a2e",border:"#2a2a3e",text:"#e8e8f4",textMuted:"#8888aa",primary:"#00f5d4",secondary:"#7b2ff7",danger:"#f72585",warning:"#ffbe0b",success:"#06d6a0",info:"#3a86ff"});function O(){return T(A)}function B(e){return[e.primary,e.secondary,e.info,e.success,e.warning,e.danger,e.primary+"aa",e.secondary+"aa",e.info+"aa",e.success+"aa"]}var j={top:10,right:30,bottom:10,left:0};function I(e){return{contentStyle:{backgroundColor:e.surface,border:`1px solid ${e.border}`,borderRadius:8,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",color:e.text,fontSize:13},labelStyle:{color:e.textMuted,fontWeight:600,marginBottom:4},itemStyle:{color:e.text},cursor:{fill:`${e.primary}15`}}}function $({data:r,series:i,xKey:o,height:l=300,margin:d=j,showGrid:s=!0,showLegend:c=!0,showTooltip:h=!0,smooth:u=!0,xTickFormatter:f,yTickFormatter:p,yDomain:b,ariaLabel:g="Area chart"}){const m=O(),k=B(m),w=I(m),L={fill:m.textMuted,fontSize:12};/* @__PURE__ */
2
+ return C("div",{role:"img","aria-label":g,style:{width:"100%",height:l},children:/* @__PURE__ */C(y,{width:"100%",height:"100%",children:/* @__PURE__ */N(t,{data:r,margin:d,children:[s&&/* @__PURE__ */C(a,{strokeDasharray:"3 3",stroke:m.border,vertical:!1}),
3
+ /* @__PURE__ */C(v,{dataKey:o,tick:L,axisLine:{stroke:m.border},tickLine:!1,tickFormatter:f}),
4
+ /* @__PURE__ */C(S,{tick:L,axisLine:!1,tickLine:!1,tickFormatter:p,domain:b}),h&&/* @__PURE__ */C(x,{contentStyle:w.contentStyle,labelStyle:w.labelStyle,itemStyle:w.itemStyle,cursor:w.cursor}),c&&/* @__PURE__ */C(n,{wrapperStyle:{fontSize:13,color:m.textMuted,paddingTop:8}}),i.map((t,r)=>{const i=t.color??k[r%k.length];/* @__PURE__ */
5
+ return C(e,{type:u?"monotone":"linear",dataKey:t.key,name:t.label??t.key,stroke:i,strokeWidth:2,fill:i,fillOpacity:t.fillOpacity??.2,stackId:t.stacked?"stack":void 0,dot:!1,activeDot:{r:5,strokeWidth:0}},t.key)})]})})})}function H({data:e,series:t,xKey:o,height:l=300,margin:d=j,showGrid:s=!0,showLegend:c=!0,showTooltip:h=!0,layout:u="horizontal",barSize:f,xTickFormatter:p,yTickFormatter:b,ariaLabel:g="Bar chart"}){const m=O(),k=B(m),w=I(m),L={fill:m.textMuted,fontSize:12},z="vertical"===u;/* @__PURE__ */
6
+ return C("div",{role:"img","aria-label":g,style:{width:"100%",height:l},children:/* @__PURE__ */C(y,{width:"100%",height:"100%",children:/* @__PURE__ */N(i,{data:e,margin:d,layout:u,children:[s&&/* @__PURE__ */C(a,{strokeDasharray:"3 3",stroke:m.border,vertical:z,horizontal:!z}),/* @__PURE__ */N(D,z?{children:[/* @__PURE__ */C(S,{dataKey:o,type:"category",tick:L,axisLine:!1,tickLine:!1,tickFormatter:p,width:100}),/* @__PURE__ */C(v,{type:"number",tick:L,axisLine:{stroke:m.border},tickLine:!1,tickFormatter:b})]}:{children:[/* @__PURE__ */C(v,{dataKey:o,tick:L,axisLine:{stroke:m.border},tickLine:!1,tickFormatter:p}),/* @__PURE__ */C(S,{tick:L,axisLine:!1,tickLine:!1,tickFormatter:b})]}),h&&/* @__PURE__ */C(x,{contentStyle:w.contentStyle,labelStyle:w.labelStyle,itemStyle:w.itemStyle,cursor:{fill:`${m.surfaceAlt}`}}),c&&/* @__PURE__ */C(n,{wrapperStyle:{fontSize:13,color:m.textMuted,paddingTop:8}}),t.map((e,t)=>{const i=e.color??k[t%k.length];/* @__PURE__ */
7
+ return C(r,{dataKey:e.key,name:e.label??e.key,fill:i,stackId:e.stackId,maxBarSize:f??40,radius:e.radius??[4,4,0,0]},e.key)})]})})})}function J({data:e,series:t,xKey:r,height:i=300,margin:o=j,showGrid:s=!0,showLegend:c=!0,showTooltip:h=!0,smooth:u=!0,referenceLines:f=[],xTickFormatter:p,yTickFormatter:b,yDomain:m,connectNulls:k=!1,ariaLabel:w="Line chart"}){const L=O(),z=B(L),T=I(L),F={fill:L.textMuted,fontSize:12};/* @__PURE__ */
8
+ return C("div",{role:"img","aria-label":w,style:{width:"100%",height:i},children:/* @__PURE__ */C(y,{width:"100%",height:"100%",children:/* @__PURE__ */N(d,{data:e,margin:o,children:[s&&/* @__PURE__ */C(a,{strokeDasharray:"3 3",stroke:L.border,vertical:!1}),
9
+ /* @__PURE__ */C(v,{dataKey:r,tick:F,axisLine:{stroke:L.border},tickLine:!1,tickFormatter:p}),
10
+ /* @__PURE__ */C(S,{tick:F,axisLine:!1,tickLine:!1,tickFormatter:b,domain:m}),h&&/* @__PURE__ */C(x,{contentStyle:T.contentStyle,labelStyle:T.labelStyle,itemStyle:T.itemStyle,cursor:{stroke:L.border,strokeWidth:1}}),c&&/* @__PURE__ */C(n,{wrapperStyle:{fontSize:13,color:L.textMuted,paddingTop:8}}),f.map((e,t)=>/* @__PURE__ */C(g,{y:e.y,x:e.x,label:e.label?{value:e.label,fill:L.textMuted,fontSize:11}:void 0,stroke:e.color??L.border,strokeDasharray:e.dashed?"4 4":void 0},t)),t.map((e,t)=>{const r=e.color??z[t%z.length];/* @__PURE__ */
11
+ return C(l,{type:u?"monotone":"linear",dataKey:e.key,name:e.label??e.key,stroke:r,strokeWidth:e.strokeWidth??2,strokeDasharray:e.dashed?"6 3":void 0,dot:e.dot??!1,activeDot:{r:5,strokeWidth:0,fill:r},connectNulls:k},e.key)})]})})})}function G(){const[e,t]=R(()=>"undefined"!=typeof window&&"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches);return F(()=>{if("undefined"==typeof window)return;const e=window.matchMedia("(prefers-reduced-motion: reduce)"),r=e=>t(e.matches);return e.addEventListener("change",r),()=>e.removeEventListener("change",r)},[]),e}function P({data:e,height:t=300,showLegend:r=!0,showTooltip:i=!0,showLabels:a=!1,outerRadius:l="70%",startAngle:d=90,ariaLabel:h="Pie chart"}){const u=O(),f=G(),p=B(u),b=I(u),[g,m]=R(f);return F(()=>{if(f)return void m(!0);const e=requestAnimationFrame(()=>m(!0));return()=>cancelAnimationFrame(e)},[f]),/* @__PURE__ */C("div",{role:"img","aria-label":h,style:{width:"100%",minWidth:240,height:t,position:"relative"},children:g&&/* @__PURE__ */C(y,{width:"100%",height:"100%",debounce:50,children:/* @__PURE__ */N(c,{children:[i&&/* @__PURE__ */C(x,{contentStyle:b.contentStyle,labelStyle:b.labelStyle,itemStyle:b.itemStyle}),r&&/* @__PURE__ */C(n,{wrapperStyle:{fontSize:13,color:u.textMuted}}),
12
+ /* @__PURE__ */C(s,{data:e,dataKey:"value",nameKey:"name",outerRadius:l,startAngle:d,endAngle:d-360,label:a?({name:e,percent:t})=>`${e} (${(100*(t??0)).toFixed(0)}%)`:void 0,labelLine:a,strokeWidth:2,stroke:u.bg,children:e.map((e,t)=>/* @__PURE__ */C(o,{fill:e.color??p[t%p.length]},e.name))})]})})})}function V({data:e,height:t=300,showLegend:r=!0,showTooltip:i=!0,centerLabel:a,centerSublabel:l,innerRadius:d="55%",outerRadius:h="75%",startAngle:u=90,ariaLabel:f="Donut chart"}){const p=O(),b=G(),g=B(p),m=I(p),[k,v]=R(b);return F(()=>{if(b)return void v(!0);const e=requestAnimationFrame(()=>v(!0));return()=>cancelAnimationFrame(e)},[b]),/* @__PURE__ */N("div",{role:"img","aria-label":f,style:{width:"100%",minWidth:240,height:t,position:"relative"},children:[k&&/* @__PURE__ */C(y,{width:"100%",height:"100%",debounce:50,children:/* @__PURE__ */N(c,{children:[i&&/* @__PURE__ */C(x,{contentStyle:m.contentStyle,labelStyle:m.labelStyle,itemStyle:m.itemStyle}),r&&/* @__PURE__ */C(n,{wrapperStyle:{fontSize:13,color:p.textMuted}}),
13
+ /* @__PURE__ */C(s,{data:e,dataKey:"value",nameKey:"name",innerRadius:d,outerRadius:h,startAngle:u,endAngle:u-360,strokeWidth:3,stroke:p.bg,label:!1,labelLine:!1,children:e.map((e,t)=>/* @__PURE__ */C(o,{fill:e.color??g[t%g.length]},e.name))}),(a||l)&&/* @__PURE__ */C("text",{})]})}),(a||l)&&/* @__PURE__ */N("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",pointerEvents:"none",marginTop:r?-24:0},children:[a&&/* @__PURE__ */C("span",{style:{fontSize:22,fontWeight:700,color:p.text,lineHeight:1},children:a}),l&&/* @__PURE__ */C("span",{style:{fontSize:13,color:p.textMuted,marginTop:4},children:l})]})]})}function E({series:e,height:t=300,margin:r=j,showGrid:i=!0,showLegend:o=!0,showTooltip:l=!0,xTickFormatter:d,yTickFormatter:s,zRange:c=[20,400],ariaLabel:h="Scatter chart"}){const u=O(),f=B(u),p=I(u),b={fill:u.textMuted,fontSize:12};/* @__PURE__ */
14
+ return C("div",{role:"img","aria-label":h,style:{width:"100%",height:t},children:/* @__PURE__ */C(y,{width:"100%",height:"100%",children:/* @__PURE__ */N(k,{margin:r,children:[i&&/* @__PURE__ */C(a,{strokeDasharray:"3 3",stroke:u.border}),
15
+ /* @__PURE__ */C(v,{type:"number",dataKey:"x",tick:b,axisLine:{stroke:u.border},tickLine:!1,tickFormatter:d}),
16
+ /* @__PURE__ */C(S,{type:"number",dataKey:"y",tick:b,axisLine:!1,tickLine:!1,tickFormatter:s}),
17
+ /* @__PURE__ */C(w,{type:"number",dataKey:"z",range:c}),l&&/* @__PURE__ */C(x,{contentStyle:p.contentStyle,labelStyle:p.labelStyle,itemStyle:p.itemStyle,cursor:{strokeDasharray:"3 3"}}),o&&/* @__PURE__ */C(n,{wrapperStyle:{fontSize:13,color:u.textMuted,paddingTop:8}}),e.map((e,t)=>/* @__PURE__ */C(m,{name:e.name,data:e.data,fill:e.color??f[t%f.length],fillOpacity:.8},e.name??t))]})})})}function X({data:e,series:t,angleKey:r,height:i=300,showLegend:a=!0,showTooltip:o=!0,outerRadius:l="70%",ariaLabel:d="Radar chart"}){const s=O(),c=B(s),g=I(s);/* @__PURE__ */
18
+ return C("div",{role:"img","aria-label":d,style:{width:"100%",height:i},children:/* @__PURE__ */C(y,{width:"100%",height:"100%",children:/* @__PURE__ */N(b,{data:e,outerRadius:l,children:[
19
+ /* @__PURE__ */C(u,{stroke:s.border}),
20
+ /* @__PURE__ */C(h,{dataKey:r,tick:{fill:s.textMuted,fontSize:12}}),
21
+ /* @__PURE__ */C(f,{tick:{fill:s.textMuted,fontSize:10},axisLine:!1,tickLine:!1}),o&&/* @__PURE__ */C(x,{contentStyle:g.contentStyle,labelStyle:g.labelStyle,itemStyle:g.itemStyle}),a&&/* @__PURE__ */C(n,{wrapperStyle:{fontSize:13,color:s.textMuted}}),t.map((e,t)=>{const r=e.color??c[t%c.length];/* @__PURE__ */
22
+ return C(p,{name:e.label??e.key,dataKey:e.key,stroke:r,fill:r,fillOpacity:e.fillOpacity??.2,strokeWidth:2},e.key)})]})})})}function Y(e){const t=[];let r=[],i="",a=!1,o=0;const n=e.length;for(;o<n;){const n=e[o];if(a){if('"'===n){if('"'===e[o+1]){i+='"',o+=2;continue}a=!1,o++;continue}i+=n,o++}else'"'!==n?","!==n?"\r"!==n?"\n"!==n?(i+=n,o++):(r.push(i),t.push(r),r=[],i="",o++):o++:(r.push(i),i="",o++):(a=!0,o++)}return(i.length>0||r.length>0)&&(r.push(i),t.push(r)),t}function q(e){if(e.length<2)return[];const t=e[0].map(e=>e.trim()||"_"),r=[];for(let i=1;i<e.length;i++){if(1===e[i].length&&""===e[i][0])continue;const a={};for(let r=0;r<t.length;r++){const o=(e[i][r]??"").trim();if(""===o)a[t[r]]=null;else{const e=Number(o);a[t[r]]=Number.isFinite(e)&&""!==o&&/^-?\d/.test(o)?e:o}}r.push(a)}return r}function M(e){const t={};if(0===e.length)return t;const r=Object.keys(e[0]);for(const i of r){let r=!1,a=!1;for(const t of e){const e=t[i];if(null!=e&&("number"==typeof e?r=!0:a=!0,r&&a))break}t[i]=r&&a?"mixed":r?"number":"string"}return t}var _=["bar","line","area","pie","scatter"],Q={bar:"📊 Bar",line:"📈 Line",area:"⛰️ Area",pie:"🥧 Pie",scatter:"✨ Scatter"};function U({initialData:e,allowedCharts:t=_,previewRows:r=5,chartHeight:i=320,onDataLoad:a,style:o,className:n}){const[l,d]=R(e??[]),[s,c]=R(null),[h,u]=R(t[0]),f=W(()=>{if(!e||0===e.length)return{x:"",y:[]};const t=M(e),r=Object.keys(e[0]),i=r.find(e=>"string"===t[e]||"mixed"===t[e])??r[0]??"",a=r.find(e=>"number"===t[e]);return{x:i,y:a?[a]:[]}},[]),[p,b]=R(f.x),[g,y]=R(f.y),[m,k]=R(!1),x=K(null),[v,S]=R(""),w=W(()=>M(l),[l]),L=W(()=>l[0]?Object.keys(l[0]):[],[l]),T=W(()=>L.filter(e=>"number"===w[e]),[L,w]);W(()=>L.filter(e=>"string"===w[e]||"mixed"===w[e]),[L,w]);const F=z(e=>{d(e);const t=M(e),r=e[0]?Object.keys(e[0]):[],i=r.find(e=>"string"===t[e]||"mixed"===t[e]),o=r.find(e=>"number"===t[e]);b(i??r[0]??""),y(o?[o]:[]),c(null),a?.(e)},[a]),A=z((e,t)=>{try{const r=e.trim();if(!r)return void c("Nothing to parse");if("json"===t||"["===r[0]||"{"===r[0]){const e=JSON.parse(r),t=Array.isArray(e)?e:Array.isArray(e.data)?e.data:null;return t?0===t.length?void c("No rows in JSON"):void F(t):void c("JSON must be an array of records or { data: [...] }")}const i=q(Y(r));if(0===i.length)return void c("No rows after the header");F(i)}catch(r){c(`Parse failed: ${r instanceof Error?r.message:String(r)}`)}},[F]),O=z(e=>{const t=new FileReader;t.onload=()=>{A(String(t.result??""),e.name.toLowerCase().endsWith(".json")?"json":e.name.toLowerCase().endsWith(".csv")?"csv":void 0)},t.onerror=()=>c("Could not read file"),t.readAsText(e)},[A]),B=l,j=g.map(e=>({key:e,label:e}));let I=null;if(l.length>0&&p&&g.length>0)switch(h){case"bar":I=/* @__PURE__ */C(H,{data:B,xKey:p,series:j,height:i});break;case"line":I=/* @__PURE__ */C(J,{data:B,xKey:p,series:j,height:i});break;case"area":I=/* @__PURE__ */C($,{data:B,xKey:p,series:j,height:i});break;case"pie":I=/* @__PURE__ */C(P,{data:B.map(e=>({name:String(e[p]??""),value:Number(e[g[0]])||0})),height:i});break;case"scatter":I=/* @__PURE__ */C(E,{series:[{name:g[0],data:B.map(e=>({x:Number(e[p]),y:Number(e[g[0]])})).filter(e=>Number.isFinite(e.x)&&Number.isFinite(e.y))}],height:i})}const G={padding:16,borderBottom:"1px solid var(--tkx-border, #2a2a3e)"};/* @__PURE__ */
23
+ return N("div",{className:n,"data-testid":"tkx-data-explorer",style:{border:"1px solid var(--tkx-border, #2a2a3e)",borderRadius:12,background:"var(--tkx-bg, #0a0a0f)",color:"var(--tkx-fg, #e8e8f4)",overflow:"hidden",...o},children:[/* @__PURE__ */N("div",{style:G,children:[
24
+ /* @__PURE__ */N("div",{role:"button",tabIndex:0,"aria-label":"Drop a CSV or JSON file","data-testid":"upload-zone",onDragOver:e=>{e.preventDefault(),k(!0)},onDragLeave:()=>k(!1),onDrop:e=>{e.preventDefault(),k(!1);const t=e.dataTransfer.files?.[0];t&&O(t)},onClick:()=>x.current?.click(),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),x.current?.click())},style:{border:"2px dashed "+(m?"var(--tkx-accent, #00f5d4)":"var(--tkx-border, #2a2a3e)"),borderRadius:10,padding:20,textAlign:"center",cursor:"pointer",background:m?"rgba(0,245,212,0.04)":"var(--tkx-bg-subtle, #0d0d14)",transition:"border-color 0.15s, background 0.15s",outline:"none"},children:[
25
+ /* @__PURE__ */C("div",{style:{fontSize:32,marginBottom:8},"aria-hidden":"true",children:"📁"}),
26
+ /* @__PURE__ */C("div",{style:{fontWeight:600,marginBottom:4},children:"Drop a CSV or JSON file here, or click to choose"}),
27
+ /* @__PURE__ */C("div",{style:{fontSize:12,color:"#888"},children:"Files are parsed in-browser — nothing is uploaded."})]}),
28
+ /* @__PURE__ */C("input",{ref:x,type:"file",accept:".csv,.json,text/csv,application/json",onChange:e=>{const t=e.target.files?.[0];t&&O(t),x.current&&(x.current.value="")},"data-testid":"file-input",style:{display:"none"}}),
29
+ /* @__PURE__ */N("details",{style:{marginTop:12},children:[
30
+ /* @__PURE__ */C("summary",{style:{cursor:"pointer",fontSize:13,color:"#aaa"},children:"…or paste raw CSV / JSON"}),
31
+ /* @__PURE__ */C("textarea",{"data-testid":"paste-area",value:v,onChange:e=>S(e.target.value),placeholder:"name,score\nAda,99\nGrace,95",rows:6,style:{width:"100%",marginTop:8,padding:10,background:"var(--tkx-bg-subtle, #0d0d14)",border:"1px solid var(--tkx-border, #2a2a3e)",borderRadius:6,color:"var(--tkx-fg, #e8e8f4)",fontFamily:"ui-monospace, monospace",fontSize:12,resize:"vertical",boxSizing:"border-box"}}),
32
+ /* @__PURE__ */C("button",{type:"button","data-testid":"parse-button",onClick:()=>A(v),style:{marginTop:8,padding:"8px 14px",minHeight:36,border:"none",borderRadius:6,background:"var(--tkx-accent, #00f5d4)",color:"#0a0a0f",fontWeight:700,cursor:"pointer"},children:"Parse"})]}),s&&/* @__PURE__ */C("div",{role:"alert","data-testid":"parse-error",style:{marginTop:12,padding:10,borderRadius:6,background:"rgba(255,0,110,0.1)",border:"1px solid #ff006e",color:"#ff7eaf",fontSize:13},children:s})]}),l.length>0&&/* @__PURE__ */N(D,{children:[
33
+ /* @__PURE__ */C("div",{style:G,children:/* @__PURE__ */N("div",{style:{display:"flex",flexWrap:"wrap",gap:16,alignItems:"flex-end"},children:[
34
+ /* @__PURE__ */N("div",{children:[/* @__PURE__ */C("label",{htmlFor:"tkx-de-chart",style:{display:"block",fontSize:11,fontWeight:700,color:"#888",marginBottom:4,textTransform:"uppercase"},children:"Chart"}),/* @__PURE__ */C("div",{role:"tablist",style:{display:"flex",gap:4,flexWrap:"wrap"},children:t.map(e=>/* @__PURE__ */C("button",{type:"button",role:"tab","aria-selected":h===e,"data-testid":`chart-${e}`,onClick:()=>u(e),style:{padding:"8px 12px",minHeight:36,borderRadius:6,border:"1px solid "+(h===e?"var(--tkx-accent, #00f5d4)":"var(--tkx-border, #2a2a3e)"),background:h===e?"rgba(0,245,212,0.12)":"transparent",color:h===e?"var(--tkx-accent, #00f5d4)":"var(--tkx-fg, #e8e8f4)",fontSize:13,fontWeight:600,cursor:"pointer"},children:Q[e]},e))})]}),
35
+ /* @__PURE__ */C(Z,{label:"pie"===h?"Category":"scatter"===h?"X (numeric)":"X axis",value:p,onChange:b,options:"scatter"===h?T:L,testId:"x-field"}),
36
+ /* @__PURE__ */N("div",{children:[/* @__PURE__ */C("div",{style:{fontSize:11,fontWeight:700,color:"#888",marginBottom:4,textTransform:"uppercase"},children:"pie"===h||"scatter"===h?"Value":"Y series"}),/* @__PURE__ */N("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:[T.map(e=>{const t=g.includes(e),r="pie"===h||"scatter"===h;/* @__PURE__ */
37
+ return C("button",{type:"button","data-testid":`y-${e}`,"aria-pressed":t,onClick:()=>{y(r?[e]:t?g.filter(t=>t!==e):[...g,e])},style:{padding:"6px 10px",minHeight:32,borderRadius:6,border:"1px solid "+(t?"var(--tkx-accent, #00f5d4)":"var(--tkx-border, #2a2a3e)"),background:t?"rgba(0,245,212,0.12)":"transparent",color:t?"var(--tkx-accent, #00f5d4)":"#aaa",fontSize:12,fontWeight:600,cursor:"pointer",fontFamily:"inherit"},children:e},e)}),0===T.length&&/* @__PURE__ */C("span",{style:{fontSize:12,color:"#888"},children:"No numeric columns detected."})]})]}),
38
+ /* @__PURE__ */C("button",{type:"button","data-testid":"clear-data",onClick:()=>{d([]),c(null),b(""),y([])},style:{marginLeft:"auto",padding:"8px 12px",minHeight:36,borderRadius:6,border:"1px solid var(--tkx-border, #2a2a3e)",background:"transparent",color:"#aaa",cursor:"pointer",fontSize:12,fontWeight:600},children:"Clear data"})]})}),
39
+ /* @__PURE__ */N("div",{style:G,children:[/* @__PURE__ */N("div",{style:{fontSize:11,fontWeight:700,color:"#888",marginBottom:8,textTransform:"uppercase",display:"flex",alignItems:"baseline",gap:8,flexWrap:"wrap"},children:[/* @__PURE__ */N("span",{children:["Data · ",l.length," row",1===l.length?"":"s"]}),l.length>r&&/* @__PURE__ */C("span",{style:{fontSize:10,color:"#c4a8ff",fontWeight:600,letterSpacing:"0.04em"},children:"scroll for more ↓"})]}),/* @__PURE__ */C("div",{"data-testid":"preview-table-scroll",style:{overflowX:"auto",overflowY:"auto",maxHeight:26*r+36,border:"1px solid var(--tkx-border, #2a2a3e)",borderRadius:6},children:/* @__PURE__ */N("table",{role:"table",style:{borderCollapse:"collapse",fontSize:12,fontFamily:"ui-monospace, monospace",width:"100%"},children:[/* @__PURE__ */C("thead",{children:/* @__PURE__ */C("tr",{children:L.map(e=>/* @__PURE__ */N("th",{scope:"col",style:{padding:"6px 10px",textAlign:"left",borderBottom:"1px solid var(--tkx-border, #2a2a3e)",color:"number"===w[e]?"var(--tkx-accent, #00f5d4)":"#ccc",fontWeight:700,position:"sticky",top:0,background:"var(--tkx-bg-subtle, #0d0d14)",zIndex:1},children:[/* @__PURE__ */C("div",{children:e}),/* @__PURE__ */C("div",{style:{fontSize:10,fontWeight:400,color:"#666",textTransform:"uppercase"},children:w[e]})]},e))})}),/* @__PURE__ */C("tbody",{children:l.map((e,t)=>/* @__PURE__ */C("tr",{"data-testid":`preview-row-${t}`,children:L.map(t=>/* @__PURE__ */C("td",{style:{padding:"6px 10px",borderBottom:"1px solid var(--tkx-border-soft, #1a1a25)",color:null===e[t]?"#555":"var(--tkx-fg, #e8e8f4)"},children:null===e[t]?"—":String(e[t])},t))},t))})]})})]}),
40
+ /* @__PURE__ */C("div",{style:{padding:16},"data-testid":"chart-container",children:I||/* @__PURE__ */C("div",{style:{padding:32,textAlign:"center",color:"#888",fontSize:13,border:"1px dashed var(--tkx-border, #2a2a3e)",borderRadius:8},children:"Pick at least one numeric Y series above to render the chart."})})]})]})}function Z({label:e,value:t,onChange:r,options:i,testId:a}){/* @__PURE__ */
41
+ return N("label",{style:{display:"flex",flexDirection:"column",gap:4},children:[/* @__PURE__ */C("span",{style:{fontSize:11,fontWeight:700,color:"#888",textTransform:"uppercase"},children:e}),/* @__PURE__ */C("select",{value:t,onChange:e=>r(e.target.value),"data-testid":a,style:{padding:"8px 10px",minHeight:36,borderRadius:6,border:"1px solid var(--tkx-border, #2a2a3e)",background:"var(--tkx-bg-subtle, #0d0d14)",color:"var(--tkx-fg, #e8e8f4)",fontSize:13,fontFamily:"inherit"},children:i.map(e=>/* @__PURE__ */C("option",{value:e,children:e},e))})]})}export{$ as TkxAreaChart,H as TkxBarChart,U as TkxDataExplorer,V as TkxDonutChart,J as TkxLineChart,P as TkxPieChart,X as TkxRadarChart,E as TkxScatterChart,q as csvToRecords,M as inferColumnTypes,Y as parseCSV};
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let e=require("react"),t=require("react/jsx-runtime");new class{constructor(e=512){this.cache=new Map,this.hits=0,this.misses=0,this.ceiling=Math.min(e,512)}get(e){if(!this.cache.has(e))return void this.misses++;this.hits++;const t=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,t),t}set(e,t){this.cache.has(e)?this.cache.delete(e):this.cache.size>=this.ceiling&&this.cache.delete(this.cache.keys().next().value),this.cache.set(e,t)}has(e){return this.cache.has(e)}invalidate(e){void 0!==e?this.cache.delete(e):this.cache.clear()}get size(){return this.cache.size}get cacheHitRate(){const e=this.hits+this.misses;return 0===e?0:this.hits/e*100}}(512);var r=(0,e.createContext)({bg:"#0a0a0f",surface:"#12121a",surfaceAlt:"#1a1a2e",border:"#2a2a3e",text:"#e8e8f4",textMuted:"#8888aa",primary:"#00f5d4",secondary:"#7b2ff7",danger:"#f72585",warning:"#ffbe0b",success:"#06d6a0",info:"#3a86ff"});function n(){return(0,e.useContext)(r)}var i=class{amplify(e,t,r=.5){const n=e.length;if(0===n)return[];const i=e.map(t),o=i.filter(e=>e>r).length,a=Math.max(1,o);let s=Array(n).fill(1/Math.sqrt(n));const l=Math.max(1,Math.floor(Math.PI/4*Math.sqrt(n/a)));for(let c=0;c<l;c++){for(let t=0;t<n;t++)i[t]>r&&(s[t]=-s[t]);const e=s.reduce((e,t)=>e+t,0)/n;s=s.map(t=>2*e-t)}return e.map((e,t)=>({index:t,amplitude:s[t],probability:s[t]*s[t],classicalSimilarity:i[t],combined:s[t]*s[t]*.6+.4*i[t]})).sort((e,t)=>t.combined-e.combined)}},o=[{keywords:["email","e-mail","mail"],type:"email",validations:[{rule:"required",message:"Email is required"},{rule:"pattern",value:"^[^@]+@[^@]+\\.[^@]+$",message:"Enter a valid email address"},{rule:"maxLength",value:254,message:"Email too long"}],placeholder:"you@example.com",label:"Email Address",confidence:.98},{keywords:["password","passwd","pwd","pass"],type:"password",validations:[{rule:"required",message:"Password is required"},{rule:"minLength",value:8,message:"Password must be at least 8 characters"},{rule:"pattern",value:"(?=.*[A-Z])(?=.*[0-9])",message:"Include uppercase and a number"}],placeholder:"••••••••",label:"Password",confidence:.97},{keywords:["confirm_password","confirmpassword","confirm_pass","repassword","password2","repeat_password"],type:"password",validations:[{rule:"required",message:"Please confirm your password"},{rule:"match",value:"password",message:"Passwords do not match"}],placeholder:"••••••••",label:"Confirm Password",confidence:.95},{keywords:["phone","mobile","cell","tel","telephone","contact_number"],type:"tel",validations:[{rule:"pattern",value:"^[+]?[(]?[0-9]{3}[)]?[-\\s.]?[0-9]{3}[-\\s.]?[0-9]{4,6}$",message:"Enter a valid phone number"}],placeholder:"+1 (555) 000-0000",label:"Phone Number",confidence:.93},{keywords:["age"],type:"number",validations:[{rule:"min",value:0,message:"Age cannot be negative"},{rule:"max",value:150,message:"Enter a valid age"},{rule:"integer",message:"Age must be a whole number"}],placeholder:"25",label:"Age",confidence:.9},{keywords:["price","amount","cost","fee","payment","salary","wage","total"],type:"number",validations:[{rule:"min",value:0,message:"Amount cannot be negative"},{rule:"pattern",value:"^\\d+(\\.\\d{1,2})?$",message:"Enter a valid amount (e.g. 9.99)"}],placeholder:"0.00",label:"Amount",confidence:.88},{keywords:["url","website","site","link","homepage","web"],type:"url",validations:[{rule:"pattern",value:"https?://.+",message:"Enter a valid URL starting with http:// or https://"}],placeholder:"https://example.com",label:"Website URL",confidence:.92},{keywords:["zip","zipcode","postal","postcode","pin_code"],type:"text",validations:[{rule:"pattern",value:"^[0-9]{5}(-[0-9]{4})?$",message:"Enter a valid ZIP code (e.g. 12345)"}],placeholder:"12345",label:"ZIP / Postal Code",confidence:.91},{keywords:["date","dob","birthday","birth_date","birthdate","born"],type:"date",validations:[{rule:"required",message:"Date is required"}],placeholder:"YYYY-MM-DD",label:"Date of Birth",confidence:.89},{keywords:["first_name","firstname","fname","given_name"],type:"text",validations:[{rule:"minLength",value:2,message:"First name too short"},{rule:"maxLength",value:50,message:"First name too long"}],placeholder:"Jane",label:"First Name",confidence:.9},{keywords:["last_name","lastname","lname","surname","family_name"],type:"text",validations:[{rule:"minLength",value:2,message:"Last name too short"},{rule:"maxLength",value:50,message:"Last name too long"}],placeholder:"Doe",label:"Last Name",confidence:.9},{keywords:["name","full_name","fullname","display_name"],type:"text",validations:[{rule:"minLength",value:2,message:"Name too short"},{rule:"maxLength",value:100,message:"Name too long"}],placeholder:"Jane Doe",label:"Full Name",confidence:.85},{keywords:["username","user_name","handle","login","loginname"],type:"text",validations:[{rule:"minLength",value:3,message:"Username must be at least 3 characters"},{rule:"maxLength",value:32,message:"Username too long"},{rule:"pattern",value:"^[a-zA-Z0-9_.-]+$",message:"Only letters, numbers, _, - and . allowed"}],placeholder:"cooluser42",label:"Username",confidence:.94},{keywords:["bio","biography","about","description","summary","details"],type:"textarea",validations:[{rule:"maxLength",value:500,message:"Bio must be under 500 characters"}],placeholder:"Tell us about yourself...",label:"Bio",confidence:.87},{keywords:["message","comment","feedback","note","notes","remarks","body"],type:"textarea",validations:[{rule:"minLength",value:10,message:"Message too short"},{rule:"maxLength",value:2e3,message:"Message too long"}],placeholder:"Write your message here...",label:"Message",confidence:.86},{keywords:["search","query","q","keyword","find"],type:"search",validations:[],placeholder:"Search...",label:"Search",confidence:.9},{keywords:["otp","one_time_password","verification_code","pin","code"],type:"text",validations:[{rule:"minLength",value:4,message:"Code too short"},{rule:"maxLength",value:8,message:"Code too long"},{rule:"pattern",value:"^[0-9]+$",message:"Code must be numeric"}],placeholder:"123456",label:"Verification Code",confidence:.92},{keywords:["color","colour","hex_color","brand_color"],type:"color",validations:[],placeholder:"#3b82f6",label:"Color",confidence:.95},{keywords:["address","street","street_address","addr"],type:"text",validations:[{rule:"maxLength",value:200,message:"Address too long"}],placeholder:"123 Main Street",label:"Street Address",confidence:.87},{keywords:["city","town","municipality"],type:"text",validations:[{rule:"maxLength",value:100,message:"City name too long"}],placeholder:"San Francisco",label:"City",confidence:.89},{keywords:["country","nation","country_code"],type:"text",validations:[],placeholder:"United States",label:"Country",confidence:.88},{keywords:["company","organization","org","employer","company_name"],type:"text",validations:[{rule:"maxLength",value:200,message:"Company name too long"}],placeholder:"Acme Inc.",label:"Company",confidence:.87}],a={0:"0",px:"1px",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px",auto:"auto",full:"100%",screen:"100vw",svh:"100svh",dvh:"100dvh",fit:"fit-content",max:"max-content",min:"min-content"},s={...a,screen:"100vh"},l={"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","5/6":"83.333333%","1/12":"8.333333%","5/12":"41.666667%","7/12":"58.333333%","11/12":"91.666667%"},c={none:"0",sm:"2px","":"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px",full:"9999px"},d={sm:"0 1px 2px 0 rgba(0,0,0,.05)","":"0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1)",md:"0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1)",lg:"0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1)",xl:"0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1)","2xl":"0 25px 50px -12px rgba(0,0,0,.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,.05)",none:"none"},u={xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},f={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},p={none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},m={tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},g={none:"0",sm:"4px","":"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},h=Object.fromEntries([0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100].map(e=>[String(e),String(e/100)])),b=new Set(["bg","surface","surfaceAlt","border","text","textMuted","primary","secondary","danger","warning","success","info"]),x={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},y=/javascript\s*:|vbscript\s*:|data\s*:\s*text\/html|data\s*:\s*text\/javascript|expression\s*\(|[\r\n\x00]/i,w=new Set(["behavior","-moz-binding","-webkit-binding","src"]),v=new Set(["width","min-width","max-width","height","min-height","max-height","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","position","top","right","bottom","left","z-index","inset","flex","flex-grow","flex-shrink","flex-basis","flex-direction","flex-wrap","align-items","align-self","align-content","justify-content","justify-items","justify-self","gap","row-gap","column-gap","grid-template-columns","grid-template-rows","grid-column","grid-row","grid-area","grid-template-areas","font-size","font-weight","font-family","font-style","line-height","letter-spacing","text-align","text-decoration","text-transform","text-overflow","white-space","word-break","word-wrap","overflow-wrap","color","background","background-color","background-image","background-position","background-size","background-repeat","opacity","border","border-top","border-right","border-bottom","border-left","border-width","border-style","border-color","border-radius","outline","outline-offset","box-shadow","text-shadow","filter","backdrop-filter","transform","transition","animation","display","overflow","overflow-x","overflow-y","visibility","pointer-events","cursor","user-select","aspect-ratio","object-fit","object-position","list-style","vertical-align","float","clear","resize","scroll-behavior","content"]);function k(e){return y.test(e)||e.includes("}")||e.includes("{")||e.includes("<")||e.includes(">")?null:e}function $(e){const t=e.match(/^\[(.+)]$/);return t?k(t[1]):null}function z(e){return b.has(e)?`var(--tkx-${e})`:"transparent"===e?"transparent":"current"===e?"currentColor":"white"===e?"#ffffff":"black"===e?"#000000":"inherit"===e?"inherit":$(e)||(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e),e)}function S(e){const t=e.match(/^\[(--[a-zA-Z0-9_-]+):(.+)]$/);if(t){const e=k(t[2]);return e?{[t[1]]:e}:null}const r=e.match(/^\[([a-zA-Z-]+):(.+)]$/);if(r){const e=function(e){const t=e.toLowerCase().trim();return w.has(t)?null:v.has(t)?t:null}(r[1]),t=k(r[2]);return e&&t?{[e]:t}:null}const n={flex:"flex","inline-flex":"inline-flex",grid:"grid","inline-grid":"inline-grid",block:"block","inline-block":"inline-block",inline:"inline",hidden:"none",contents:"contents","flow-root":"flow-root",table:"table","table-row":"table-row","table-cell":"table-cell","table-caption":"table-caption","list-item":"list-item"};if(n[e])return{display:n[e]};const i={"flex-row":"row","flex-col":"column","flex-row-reverse":"row-reverse","flex-col-reverse":"column-reverse"};if(i[e])return{"flex-direction":i[e]};const o={"flex-wrap":"wrap","flex-nowrap":"nowrap","flex-wrap-reverse":"wrap-reverse"};if(o[e])return{"flex-wrap":o[e]};const x={"flex-1":"1 1 0%","flex-auto":"1 1 auto","flex-none":"none","flex-initial":"0 1 auto"};if(x[e])return{flex:x[e]};if("grow"===e||"flex-grow"===e)return{"flex-grow":"1"};if("grow-0"===e)return{"flex-grow":"0"};if("shrink"===e||"flex-shrink"===e)return{"flex-shrink":"1"};if("shrink-0"===e||"flex-shrink-0"===e)return{"flex-shrink":"0"};const y={"items-start":"flex-start","items-end":"flex-end","items-center":"center","items-stretch":"stretch","items-baseline":"baseline"};if(y[e])return{"align-items":y[e]};const S={"justify-start":"flex-start","justify-end":"flex-end","justify-center":"center","justify-between":"space-between","justify-around":"space-around","justify-evenly":"space-evenly","justify-stretch":"stretch","justify-normal":"normal"};if(S[e])return{"justify-content":S[e]};const j={"self-auto":"auto","self-start":"flex-start","self-end":"flex-end","self-center":"center","self-stretch":"stretch","self-baseline":"baseline"};if(j[e])return{"align-self":j[e]};const C={"content-start":"flex-start","content-end":"flex-end","content-center":"center","content-between":"space-between","content-around":"space-around","content-evenly":"space-evenly","content-stretch":"stretch"};if(C[e])return{"align-content":C[e]};let A;if(A=e.match(/^grid-cols-(\d+|none|subgrid)$/))return{"grid-template-columns":"none"===A[1]?"none":"subgrid"===A[1]?"subgrid":`repeat(${A[1]},minmax(0,1fr))`};if(A=e.match(/^grid-rows-(\d+|none|subgrid)$/))return{"grid-template-rows":"none"===A[1]?"none":"subgrid"===A[1]?"subgrid":`repeat(${A[1]},minmax(0,1fr))`};if(A=e.match(/^col-span-(full|\d+)$/))return{"grid-column":"full"===A[1]?"1 / -1":`span ${A[1]} / span ${A[1]}`};if(A=e.match(/^col-start-(\d+|auto)$/))return{"grid-column-start":A[1]};if(A=e.match(/^col-end-(\d+|auto)$/))return{"grid-column-end":A[1]};if(A=e.match(/^row-span-(full|\d+)$/))return{"grid-row":"full"===A[1]?"1 / -1":`span ${A[1]} / span ${A[1]}`};if(A=e.match(/^row-start-(\d+|auto)$/))return{"grid-row-start":A[1]};if(A=e.match(/^row-end-(\d+|auto)$/))return{"grid-row-end":A[1]};if("grid-flow-row"===e)return{"grid-auto-flow":"row"};if("grid-flow-col"===e)return{"grid-auto-flow":"column"};if("grid-flow-dense"===e)return{"grid-auto-flow":"dense"};if("grid-flow-row-dense"===e)return{"grid-auto-flow":"row dense"};if("grid-flow-col-dense"===e)return{"grid-auto-flow":"column dense"};if(A=e.match(/^p-(.+)$/)){const e=a[A[1]]??$(A[1]);if(e)return{padding:e}}if(A=e.match(/^px-(.+)$/)){const e=a[A[1]]??$(A[1]);if(e)return{"padding-left":e,"padding-right":e}}if(A=e.match(/^py-(.+)$/)){const e=a[A[1]]??$(A[1]);if(e)return{"padding-top":e,"padding-bottom":e}}if(A=e.match(/^pt-(.+)$/)){const e=a[A[1]]??$(A[1]);if(e)return{"padding-top":e}}if(A=e.match(/^pr-(.+)$/)){const e=a[A[1]]??$(A[1]);if(e)return{"padding-right":e}}if(A=e.match(/^pb-(.+)$/)){const e=a[A[1]]??$(A[1]);if(e)return{"padding-bottom":e}}if(A=e.match(/^pl-(.+)$/)){const e=a[A[1]]??$(A[1]);if(e)return{"padding-left":e}}if(A=e.match(/^-?m-(.+)$/)){const t=e.startsWith("-"),r=a[A[1]]??$(A[1]);if(r)return{margin:t&&"0"!==r?`-${r}`:r}}if(A=e.match(/^-?mx-(.+)$/)){const t=e.startsWith("-"),r=a[A[1]]??$(A[1]);if(r){const e=t&&"0"!==r?`-${r}`:r;return{"margin-left":e,"margin-right":e}}}if(A=e.match(/^-?my-(.+)$/)){const t=e.startsWith("-"),r=a[A[1]]??$(A[1]);if(r){const e=t&&"0"!==r?`-${r}`:r;return{"margin-top":e,"margin-bottom":e}}}if(A=e.match(/^-?mt-(.+)$/)){const t=e.startsWith("-"),r=a[A[1]]??$(A[1]);if(r)return{"margin-top":t&&"0"!==r?`-${r}`:r}}if(A=e.match(/^-?mr-(.+)$/)){const t=e.startsWith("-"),r=a[A[1]]??$(A[1]);if(r)return{"margin-right":t&&"0"!==r?`-${r}`:r}}if(A=e.match(/^-?mb-(.+)$/)){const t=e.startsWith("-"),r=a[A[1]]??$(A[1]);if(r)return{"margin-bottom":t&&"0"!==r?`-${r}`:r}}if(A=e.match(/^-?ml-(.+)$/)){const t=e.startsWith("-"),r=a[A[1]]??$(A[1]);if(r)return{"margin-left":t&&"0"!==r?`-${r}`:r}}if("mx-auto"===e)return{"margin-left":"auto","margin-right":"auto"};if("my-auto"===e)return{"margin-top":"auto","margin-bottom":"auto"};if(A=e.match(/^gap-(.+)$/)){const e=a[A[1]]??$(A[1]);if(e)return{gap:e}}if(A=e.match(/^gap-x-(.+)$/)){const e=a[A[1]]??$(A[1]);if(e)return{"column-gap":e}}if(A=e.match(/^gap-y-(.+)$/)){const e=a[A[1]]??$(A[1]);if(e)return{"row-gap":e}}if(A=e.match(/^w-(.+)$/)){const e=A[1],t=a[e]??l[e]??$(e);if(t)return{width:t}}if(A=e.match(/^min-w-(.+)$/)){const e=a[A[1]]??$(A[1]);if(e)return{"min-width":e}}if(A=e.match(/^max-w-(.+)$/)){const e={none:"none",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",screen:"100vw",min:"min-content",max:"max-content",fit:"fit-content"}[A[1]]??a[A[1]]??$(A[1]);if(e)return{"max-width":e}}if(A=e.match(/^h-(.+)$/)){const e=A[1],t=s[e]??l[e]??$(e);if(t)return{height:t}}if(A=e.match(/^min-h-(.+)$/)){const e={0:"0",full:"100%",screen:"100vh",svh:"100svh",dvh:"100dvh"}[A[1]]??a[A[1]]??$(A[1]);if(e)return{"min-height":e}}if(A=e.match(/^max-h-(.+)$/)){const e=s[A[1]]??$(A[1]);if(e)return{"max-height":e}}if(A=e.match(/^size-(.+)$/)){const e=a[A[1]]??l[A[1]]??$(A[1]);if(e)return{width:e,height:e}}if(A=e.match(/^text-(xs|sm|base|lg|[2-9]xl|\d+xl)$/)){const[e,t]=u[A[1]]??["1rem","1.5rem"];return{"font-size":e,"line-height":t}}if(A=e.match(/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black|\d+)$/))return{"font-weight":f[A[1]]??A[1]};if(A=e.match(/^leading-(.+)$/)){const e=p[A[1]]??$(A[1]);if(e)return{"line-height":e}}if(A=e.match(/^tracking-(.+)$/)){const e=m[A[1]]??$(A[1]);if(e)return{"letter-spacing":e}}const M={"text-left":"left","text-center":"center","text-right":"right","text-justify":"justify","text-start":"start","text-end":"end"};if(M[e])return{"text-align":M[e]};if("italic"===e)return{"font-style":"italic"};if("not-italic"===e)return{"font-style":"normal"};if("uppercase"===e)return{"text-transform":"uppercase"};if("lowercase"===e)return{"text-transform":"lowercase"};if("capitalize"===e)return{"text-transform":"capitalize"};if("normal-case"===e)return{"text-transform":"none"};if("underline"===e)return{"text-decoration-line":"underline"};if("overline"===e)return{"text-decoration-line":"overline"};if("line-through"===e)return{"text-decoration-line":"line-through"};if("no-underline"===e)return{"text-decoration-line":"none"};if("truncate"===e)return{overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"};if("text-ellipsis"===e)return{"text-overflow":"ellipsis"};if("text-clip"===e)return{"text-overflow":"clip"};if("whitespace-normal"===e)return{"white-space":"normal"};if("whitespace-nowrap"===e)return{"white-space":"nowrap"};if("whitespace-pre"===e)return{"white-space":"pre"};if("whitespace-pre-wrap"===e)return{"white-space":"pre-wrap"};if("whitespace-pre-line"===e)return{"white-space":"pre-line"};if("break-words"===e)return{"overflow-wrap":"break-word"};if("break-all"===e)return{"word-break":"break-all"};if("break-keep"===e)return{"word-break":"keep-all"};if("font-mono"===e)return{"font-family":"var(--tkx-font-mono,monospace)"};if("font-sans"===e)return{"font-family":"var(--tkx-font-family,system-ui,sans-serif)"};if("font-serif"===e)return{"font-family":"ui-serif,Georgia,serif"};if("antialiased"===e)return{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale"};if(A=e.match(/^indent-(.+)$/)){const e=a[A[1]]??$(A[1]);if(e)return{"text-indent":e}}if(A=e.match(/^line-clamp-(\d+)$/))return{overflow:"hidden",display:"-webkit-box","-webkit-line-clamp":A[1],"-webkit-box-orient":"vertical"};if(A=e.match(/^text-(.+)$/)){const[e,t]=A[1].split("/"),r=z(e);if(!["left","center","right","justify","start","end","xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","9xl"].includes(e)){if(t){const e=parseInt(t)/100;return{color:r,opacity:String(e)}}return{color:r}}}if(A=e.match(/^bg-(.+)$/)){const[e,t]=A[1].split("/"),r=z(e);return t?{"background-color":r,opacity:String(parseInt(t)/100)}:"none"===e?{background:"none"}:{"background-color":r}}if(A=e.match(/^border-color-(.+)$/))return{"border-color":z(A[1])};if(A=e.match(/^fill-(.+)$/))return{fill:z(A[1])};if(A=e.match(/^stroke-(.+)$/))return{stroke:z(A[1])};if(A=e.match(/^shadow-color-(.+)$/))return{"--tkx-shadow-color":z(A[1])};if(A=e.match(/^ring-color-(.+)$/))return{"--tkx-ring-color":z(A[1])};if(A=e.match(/^accent-(.+)$/))return{"accent-color":z(A[1])};if(A=e.match(/^caret-(.+)$/))return{"caret-color":z(A[1])};if(A=e.match(/^outline-color-(.+)$/))return{"outline-color":z(A[1])};if("border"===e)return{"border-width":"1px"};if(A=e.match(/^border-(\d+)$/))return{"border-width":`${A[1]}px`};if("border-t"===e)return{"border-top-width":"1px"};if(A=e.match(/^border-t-(\d+)$/))return{"border-top-width":`${A[1]}px`};if("border-r"===e)return{"border-right-width":"1px"};if(A=e.match(/^border-r-(\d+)$/))return{"border-right-width":`${A[1]}px`};if("border-b"===e)return{"border-bottom-width":"1px"};if(A=e.match(/^border-b-(\d+)$/))return{"border-bottom-width":`${A[1]}px`};if("border-l"===e)return{"border-left-width":"1px"};if(A=e.match(/^border-l-(\d+)$/))return{"border-left-width":`${A[1]}px`};if("border-x"===e)return{"border-left-width":"1px","border-right-width":"1px"};if("border-y"===e)return{"border-top-width":"1px","border-bottom-width":"1px"};if("border-none"===e)return{"border-style":"none"};if("border-solid"===e)return{"border-style":"solid"};if("border-dashed"===e)return{"border-style":"dashed"};if("border-dotted"===e)return{"border-style":"dotted"};if("border-double"===e)return{"border-style":"double"};if((A=e.match(/^border-([a-zA-Z].*)$/))&&b.has(A[1]))return{"border-color":`var(--tkx-${A[1]})`};if(A=e.match(/^border-\[(.+)]$/))return{"border-color":A[1]};if("border-0"===e)return{"border-width":"0"};if("rounded"===e)return{"border-radius":c[""]};if(A=e.match(/^rounded-(none|sm|md|lg|xl|2xl|3xl|full|\[.+])$/))return{"border-radius":c[A[1]]??$(A[1])??A[1]};if(A=e.match(/^rounded-(t|r|b|l|tl|tr|br|bl)(?:-(none|sm|md|lg|xl|2xl|3xl|full))?$/)){const e=A[1],t=c[A[2]??""]??c[""];return{t:{"border-top-left-radius":t,"border-top-right-radius":t},r:{"border-top-right-radius":t,"border-bottom-right-radius":t},b:{"border-bottom-left-radius":t,"border-bottom-right-radius":t},l:{"border-top-left-radius":t,"border-bottom-left-radius":t},tl:{"border-top-left-radius":t},tr:{"border-top-right-radius":t},br:{"border-bottom-right-radius":t},bl:{"border-bottom-left-radius":t}}[e]??{}}const _={0:"0",1:"1px",2:"2px",ring:"3px",4:"4px",8:"8px"};if("ring"===e)return{"box-shadow":"0 0 0 3px var(--tkx-ring-color,var(--tkx-primary))"};if((A=e.match(/^ring-(\d+)$/))&&_[A[1]])return{"box-shadow":`0 0 0 ${_[A[1]]} var(--tkx-ring-color,var(--tkx-primary))`};if("ring-inset"===e)return{"--tkx-ring-offset":"inset"};if(A=e.match(/^ring-offset-(\d+)$/))return{"--tkx-ring-offset-width":`${A[1]}px`,"box-shadow":`0 0 0 ${A[1]}px var(--tkx-bg)`};if("shadow"===e)return{"box-shadow":d[""]};if(A=e.match(/^shadow-(sm|md|lg|xl|2xl|inner|none)$/))return{"box-shadow":d[A[1]]};if(A=e.match(/^opacity-(\d+)$/)){const e=h[A[1]];if(void 0!==e)return{opacity:e}}if("bg-none"===e)return{background:"none"};const I={"bg-auto":"auto","bg-cover":"cover","bg-contain":"contain"};if(I[e])return{"background-size":I[e]};const L={"bg-center":"center","bg-top":"top","bg-bottom":"bottom","bg-left":"left","bg-right":"right"};if(L[e])return{"background-position":L[e]};const F={"bg-repeat":"repeat","bg-no-repeat":"no-repeat","bg-repeat-x":"repeat-x","bg-repeat-y":"repeat-y"};if(F[e])return{"background-repeat":F[e]};if("backdrop-blur"===e)return{"backdrop-filter":`blur(${g[""]})`};if(A=e.match(/^backdrop-blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{"backdrop-filter":`blur(${g[A[1]]})`};if("blur"===e)return{filter:`blur(${g[""]})`};if(A=e.match(/^blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{filter:`blur(${g[A[1]]})`};if("grayscale"===e)return{filter:"grayscale(100%)"};if("grayscale-0"===e)return{filter:"grayscale(0)"};if("invert"===e)return{filter:"invert(100%)"};if("invert-0"===e)return{filter:"invert(0)"};const R={static:"static",relative:"relative",absolute:"absolute",fixed:"fixed",sticky:"sticky"};if(R[e])return{position:R[e]};if("inset-0"===e)return{top:"0",right:"0",bottom:"0",left:"0"};if("inset-auto"===e)return{top:"auto",right:"auto",bottom:"auto",left:"auto"};if("inset-full"===e)return{top:"100%",right:"100%",bottom:"100%",left:"100%"};if("inset-x-0"===e)return{left:"0",right:"0"};if("inset-y-0"===e)return{top:"0",bottom:"0"};if(A=e.match(/^-?top-(.+)$/)){const t=e.startsWith("-"),r=a[A[1]]??l[A[1]]??$(A[1]);if(r)return{top:t&&"0"!==r?`-${r}`:r}}if(A=e.match(/^-?right-(.+)$/)){const t=e.startsWith("-"),r=a[A[1]]??l[A[1]]??$(A[1]);if(r)return{right:t&&"0"!==r?`-${r}`:r}}if(A=e.match(/^-?bottom-(.+)$/)){const t=e.startsWith("-"),r=a[A[1]]??l[A[1]]??$(A[1]);if(r)return{bottom:t&&"0"!==r?`-${r}`:r}}if(A=e.match(/^-?left-(.+)$/)){const t=e.startsWith("-"),r=a[A[1]]??l[A[1]]??$(A[1]);if(r)return{left:t&&"0"!==r?`-${r}`:r}}const q={0:"0",10:"10",20:"20",30:"30",40:"40",50:"50",100:"100",1e3:"1000",9e3:"9000",auto:"auto"};if(A=e.match(/^z-(.+)$/)){const e=q[A[1]]??$(A[1]);if(e)return{"z-index":e}}const O={"overflow-auto":"auto","overflow-hidden":"hidden","overflow-visible":"visible","overflow-scroll":"scroll","overflow-clip":"clip"};if(O[e])return{overflow:O[e]};if(A=e.match(/^overflow-(x|y)-(auto|hidden|visible|scroll|clip)$/))return{[`overflow-${A[1]}`]:A[2]};if("scrollbar-hide"===e)return{"-ms-overflow-style":"none","scrollbar-width":"none"};if("visible"===e)return{visibility:"visible"};if("invisible"===e)return{visibility:"hidden"};if("collapse"===e)return{visibility:"collapse"};const W={"cursor-auto":"auto","cursor-default":"default","cursor-pointer":"pointer","cursor-wait":"wait","cursor-text":"text","cursor-move":"move","cursor-help":"help","cursor-not-allowed":"not-allowed","cursor-none":"none","cursor-grab":"grab","cursor-grabbing":"grabbing","cursor-zoom-in":"zoom-in","cursor-zoom-out":"zoom-out","cursor-crosshair":"crosshair"};if(W[e])return{cursor:W[e]};if("select-none"===e)return{"user-select":"none"};if("select-text"===e)return{"user-select":"text"};if("select-all"===e)return{"user-select":"all"};if("select-auto"===e)return{"user-select":"auto"};if("pointer-events-none"===e)return{"pointer-events":"none"};if("pointer-events-auto"===e)return{"pointer-events":"auto"};const D={0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5"};if(A=e.match(/^scale-(.+)$/)){const e=D[A[1]]??$(A[1]);if(e)return{transform:`scale(${e})`}}if(A=e.match(/^scale-x-(.+)$/)){const e=D[A[1]]??$(A[1]);if(e)return{transform:`scaleX(${e})`}}if(A=e.match(/^scale-y-(.+)$/)){const e=D[A[1]]??$(A[1]);if(e)return{transform:`scaleY(${e})`}}const B={0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"};if(A=e.match(/^-?rotate-(.+)$/)){const t=e.startsWith("-"),r=B[A[1]]??$(A[1]);if(r)return{transform:t?`rotate(-${r})`:`rotate(${r})`}}if(A=e.match(/^-?translate-x-(.+)$/)){const t=e.startsWith("-"),r=a[A[1]]??l[A[1]]??$(A[1]);if(r)return{transform:`translateX(${t&&"0"!==r?`-${r}`:r})`}}if(A=e.match(/^-?translate-y-(.+)$/)){const t=e.startsWith("-"),r=a[A[1]]??l[A[1]]??$(A[1]);if(r)return{transform:`translateY(${t&&"0"!==r?`-${r}`:r})`}}if(A=e.match(/^-?skew-x-(.+)$/)){const t=e.startsWith("-"),r=$(A[1])??`${A[1]}deg`;return{transform:t?`skewX(-${r})`:`skewX(${r})`}}if(A=e.match(/^-?skew-y-(.+)$/)){const t=e.startsWith("-"),r=$(A[1])??`${A[1]}deg`;return{transform:t?`skewY(-${r})`:`skewY(${r})`}}const T={"origin-center":"center","origin-top":"top","origin-top-right":"top right","origin-right":"right","origin-bottom-right":"bottom right","origin-bottom":"bottom","origin-bottom-left":"bottom left","origin-left":"left","origin-top-left":"top left"};if(T[e])return{"transform-origin":T[e]};const P={transition:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter","transition-all":"all","transition-colors":"color,background-color,border-color,text-decoration-color,fill,stroke","transition-opacity":"opacity","transition-shadow":"box-shadow","transition-transform":"transform","transition-none":"none"};if(P[e])return{"transition-property":P[e],"transition-timing-function":"cubic-bezier(0.4,0,0.2,1)","transition-duration":"150ms"};const E={75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"};if(A=e.match(/^duration-(.+)$/)){const e=E[A[1]]??$(A[1]);if(e)return{"transition-duration":e}}if(A=e.match(/^delay-(.+)$/)){const e=E[A[1]]??$(A[1]);if(e)return{"transition-delay":e}}const Z={"ease-linear":"linear","ease-in":"cubic-bezier(0.4,0,1,1)","ease-out":"cubic-bezier(0,0,0.2,1)","ease-in-out":"cubic-bezier(0.4,0,0.2,1)"};if(Z[e])return{"transition-timing-function":Z[e]};const Y={"animate-none":"none","animate-spin":"tkx-spin 1s linear infinite","animate-ping":"tkx-ping 1s cubic-bezier(0,0,0.2,1) infinite","animate-pulse":"tkx-pulse 2s cubic-bezier(0.4,0,0.6,1) infinite","animate-bounce":"tkx-bounce 1s infinite","animate-fade-in":"tkx-fade-in 200ms ease both","animate-slide-up":"tkx-slide-up 200ms ease both","animate-shimmer":"tkx-shimmer 1.5s infinite"};if(Y[e])return{animation:Y[e]};const U={"object-contain":"contain","object-cover":"cover","object-fill":"fill","object-none":"none","object-scale-down":"scale-down"};return U[e]?{"object-fit":U[e]}:"aspect-square"===e?{"aspect-ratio":"1 / 1"}:"aspect-video"===e?{"aspect-ratio":"16 / 9"}:"aspect-auto"===e?{"aspect-ratio":"auto"}:(A=e.match(/^aspect-\[(.+)]$/))?{"aspect-ratio":A[1]}:"list-none"===e?{"list-style-type":"none"}:"list-disc"===e?{"list-style-type":"disc"}:"list-decimal"===e?{"list-style-type":"decimal"}:"list-inside"===e?{"list-style-position":"inside"}:"list-outside"===e?{"list-style-position":"outside"}:(A=e.match(/^columns-(\d+)$/))?{columns:A[1]}:"resize"===e?{resize:"both"}:"resize-none"===e?{resize:"none"}:"resize-x"===e?{resize:"horizontal"}:"resize-y"===e?{resize:"vertical"}:"sr-only"===e?{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)","white-space":"nowrap",border:"0"}:"not-sr-only"===e?{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",clip:"auto","white-space":"normal"}:"focus-ring"===e?{outline:"2px solid var(--tkx-primary)","outline-offset":"2px","border-radius":"2px"}:"appearance-none"===e?{appearance:"none"}:"outline-none"===e?{outline:"none"}:"outline"===e?{outline:"2px solid currentColor","outline-offset":"2px"}:"float-left"===e?{float:"left"}:"float-right"===e?{float:"right"}:"float-none"===e?{float:"none"}:"clear-both"===e?{clear:"both"}:"isolate"===e?{isolation:"isolate"}:"isolation-auto"===e?{isolation:"auto"}:(A=e.match(/^will-change-(.+)$/))?{"will-change":A[1]}:"touch-manipulation"===e?{"touch-action":"manipulation"}:"touch-none"===e?{"touch-action":"none"}:"touch-pan-x"===e?{"touch-action":"pan-x"}:"touch-pan-y"===e?{"touch-action":"pan-y"}:"scroll-smooth"===e?{"scroll-behavior":"smooth"}:"scroll-auto"===e?{"scroll-behavior":"auto"}:(A=e.match(/^\[(--[a-zA-Z0-9-]+):(.+)]$/))?{[A[1]]:A[2]}:function(e){for(const t of N.values())if(t[e])return t[e];return null}(e)||null}function j(e){let t=0,r=-1;for(let n=0;n<e.length;n++)if("["===e[n])t++;else if("]"===e[n])t--;else if(":"===e[n]&&0===t){r=n;break}return-1===r?{variant:null,utility:e}:{variant:e.slice(0,r),utility:e.slice(r+1)}}function C(e,t){for(const[r,n]of Object.entries(t))e[r]=n}function A(e){return Object.entries(e).map(([e,t])=>`${e}:${t}`).join(";")}var M=new Map,_=null,I=null;function L(){return _&&_.isConnected||(_=document.getElementById("tkx-atomic"))||((_=document.createElement("style")).id="tkx-atomic",document.head.appendChild(_)),_}function F(e){const t=[];for(const r of e)if(r)if("string"==typeof r)t.push(...r.split(/\s+/).filter(Boolean));else if(Array.isArray(r))t.push(...F(r));else if("object"==typeof r)for(const[e,n]of Object.entries(r))n&&t.push(e);return t}function R(...e){const t=F(e);if(0===t.length)return"";const r={base:{},variants:{}};for(const s of t){const{variant:e,utility:t}=j(s),n=S(t);n&&(e?(r.variants[e]||(r.variants[e]={}),C(r.variants[e],n)):C(r.base,n))}const n=[],i=A(r.base),o=function(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619)>>>0;return t.toString(16).padStart(8,"0")}([i,...Object.entries(r.variants).map(([e,t])=>`${e}{${A(t)}}`)].join("|")),a=`tkx-${o}`;i&&n.push(`.${a}{${i}}`);for(const[s,l]of Object.entries(r.variants)){const e=A(l);if(e)if(s.startsWith("@")){const t=x[s.slice(1)];t&&n.push(`@media(min-width:${t}){.${a}{${e}}}`)}else if("motion-safe"===s)n.push(`@media(prefers-reduced-motion:no-preference){.${a}{${e}}}`);else if("motion-reduce"===s)n.push(`@media(prefers-reduced-motion:reduce){.${a}{${e}}}`);else if("contrast-more"===s)n.push(`@media(prefers-contrast:more){.${a}{${e}}}`);else if("forced-colors"===s)n.push(`@media(forced-colors:active){.${a}{${e}}}`);else if("dark"===s)n.push(`@media(prefers-color-scheme:dark){.${a}{${e}}}`);else if("print"===s)n.push(`@media print{.${a}{${e}}}`);else if("group-hover"===s)n.push(`.group:hover .${a}{${e}}`);else if("group-focus"===s)n.push(`.group:focus-within .${a}{${e}}`);else if("peer-hover"===s)n.push(`.peer:hover~.${a}{${e}}`);else{const t={hover:":hover",focus:":focus","focus-visible":":focus-visible","focus-within":":focus-within",active:":active",disabled:":disabled",checked:":checked",required:":required",valid:":valid",invalid:":invalid",first:":first-child",last:":last-child",odd:":nth-child(odd)",even:":nth-child(even)","first-of-type":":first-of-type","last-of-type":":last-of-type","only-child":":only-child","only-of-type":":only-of-type",empty:":empty",visited:":visited",target:":target","placeholder-shown":":placeholder-shown","read-only":":read-only",before:"::before",after:"::after",placeholder:"::placeholder",selection:"::selection","file-selector":"::file-selector-button",marker:"::marker"}[s]??`:${s}`;n.push(`.${a}${t}{${e}}`)}}return n.length>0&&function(e,t){if(M.has(e))return;if(M.set(e,t),"undefined"==typeof document)return;const r=function(){if(I)return I;try{const e=new CSSStyleSheet;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,e],I=e,e}catch{return null}}();if(r){const e=function(e){const t=[];let r=0,n=0;for(let i=0;i<e.length;i++)if("{"===e[i])r++;else if("}"===e[i]&&(r--,0===r)){const r=e.slice(n,i+1).trim();r&&t.push(r),n=i+1}return t}(t);for(const t of e)try{r.insertRule(t,r.cssRules.length)}catch{L().textContent+=t+"\n"}}else L().textContent+=t+"\n"}(o,n.join("")),a}function q(...e){return e.filter(Boolean).join(" ")}var N=new Map;new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);var O={"<":"&lt;",">":"&gt;","&":"&amp;","'":"&#39;",'"':"&quot;","`":"&#96;"};function W(e){if(null==e)return"";let t=String(e);return t=t.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g,""),t.replace(/[<>&'"`]/g,e=>O[e]??e)}function D(e){if("string"!=typeof e)return null;const t=e.trim();if(!t)return null;const r=t.replace(/[\u0000-\u001F\u007F]/g,"");return/^javascript:/i.test(r)||/^vbscript:/i.test(r)||/^data:/i.test(r)&&!/^data:image\//i.test(r)||/^file:/i.test(r)?null:r}var B=new Set(["a","abbr","b","blockquote","br","code","del","div","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","pre","q","s","samp","small","span","strong","sub","sup","table","tbody","td","tfoot","th","thead","tr","u","ul"]),T={a:new Set(["href","title","target","rel"]),img:new Set(["src","alt","title","width","height","loading","decoding"]),th:new Set(["scope","colspan","rowspan","align"]),td:new Set(["colspan","rowspan","align"]),"*":new Set(["id","class","lang","dir","title"])},P=new Set(["constructor","prototype","__proto__","submit","reset","action","method","enctype","target","elements","children","firstChild","nextSibling","parentNode","ownerDocument","cookie","domain","location","documentElement","body","head","title","contentWindow","contentDocument"]);function E(e){if("string"!=typeof e)return"";if("undefined"==typeof DOMParser)return W(e);const t=(new DOMParser).parseFromString(`<div>${e}</div>`,"text/html").body.firstElementChild;return t?(Z(t),t.innerHTML):""}function Z(e){const t=Array.from(e.children);for(const r of t){const e=r.tagName.toLowerCase();if(B.has(e)){for(const t of Array.from(r.attributes)){const n=t.name.toLowerCase();if(n.startsWith("on"))r.removeAttribute(t.name);else if(P.has(n))r.removeAttribute(t.name);else if("style"!==n)if((T[e]??new Set).has(n)||T["*"].has(n)){if(("href"===n||"src"===n)&&"string"==typeof t.value){const e=D(t.value);null===e?r.removeAttribute(t.name):r.setAttribute(t.name,e)}"name"!==n&&"id"!==n||!P.has(t.value.toLowerCase())||r.removeAttribute(t.name)}else r.removeAttribute(t.name);else r.setAttribute("style",Y(t.value))}Z(r)}else r.remove()}}function Y(e){if("string"!=typeof e)return"";let t=e;return t=t.replace(/expression\s*\([^)]*\)/gi,""),t=t.replace(/url\s*\(\s*['"]?\s*(javascript|vbscript|data)\s*:[^)]*\)/gi,"url(#)"),t=t.replace(/@import[^;]*;?/gi,""),t=t.replace(/behavior\s*:[^;]*;?/gi,""),t=t.replace(/-moz-binding[^;]*;?/gi,""),t=t.replace(/[<>]/g,""),t=t.replace(/[\u0000-\u001F\u007F]/g,""),t.trim()}var U=new Set(["__proto__","constructor","prototype"]);function H(e){if(Array.isArray(e))return e.map(H);if(e&&"object"==typeof e){const t={};for(const[r,n]of Object.entries(e))U.has(r)||(t[r]=H(n));return t}return e}function Q(){if("undefined"==typeof window)return!1;try{return window.top!==window.self}catch{return!0}}var V=[{name:"ssn",re:/\b\d{3}-\d{2}-\d{4}\b/g,repl:"[redacted-ssn]"},{name:"credit",re:/\b(?:\d[ -]?){13,19}\b/g,repl:e=>{const t=e.replace(/[ -]/g,"");return t.length<13||t.length>19?e:function(e){let t=0,r=!1;for(let n=e.length-1;n>=0;n--){let i=e.charCodeAt(n)-48;if(i<0||i>9)return!1;r&&(i*=2,i>9&&(i-=9)),t+=i,r=!r}return t>0&&t%10==0}(t)?"[redacted-card]":e}},{name:"email",re:/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/gi,repl:"[redacted-email]"},{name:"phone",re:/\b(\+?\d{1,3}[ -])?\(?\d{3}\)?[ -]?\d{3}[ -]?\d{4}\b/g,repl:"[redacted-phone]"},{name:"apikey",re:/\b(sk|pk|rk)-[A-Za-z0-9]{20,}\b/g,repl:"[redacted-key]"}];function J(e,t,r,n){const i=r.trim();switch(e){case"required":return""!==i;case"email":case"pattern":if("string"==typeof t)try{return""===i||new RegExp(t).test(i)}catch{return!0}return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i);case"phone":return""===i||/^\+?[\d\s\-()]{7,15}$/.test(i);case"url":return""===i||/^https?:\/\/.+/.test(i);case"minLength":case"min":{const e=Number(t??0);return""===i||(isNaN(Number(i))?i.length>=e:Number(i)>=e)}case"maxLength":case"max":{const e=Number(t??1/0);return""===i||(isNaN(Number(i))?i.length<=e:Number(i)<=e)}case"integer":return""===i||/^\d+$/.test(i);case"alphanumeric":return""===i||/^[a-zA-Z0-9]+$/.test(i);case"match":return i===(n["string"==typeof t?t:"password"]??"");default:return!0}}function X({phase:e,collapsed:r,primaryColor:n,borderColor:i}){const o=12,a=r?0:e,s=r?0:1.618*e,l=o+10*Math.sin(a)*Math.cos(s),c=12-10*Math.cos(a);return(0,t.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24","aria-hidden":"true",style:{flexShrink:0,opacity:r?.4:1,transition:"opacity 0.6s"},children:[(0,t.jsx)("circle",{cx:o,cy:12,r:10,fill:"none",stroke:i,strokeWidth:"0.8"}),(0,t.jsx)("ellipse",{cx:o,cy:12,rx:10,ry:3,fill:"none",stroke:i,strokeWidth:"0.5",strokeDasharray:"2 2"}),(0,t.jsx)("line",{x1:o,y1:2,x2:o,y2:22,stroke:i,strokeWidth:"0.5"}),(0,t.jsx)("line",{x1:o,y1:12,x2:l,y2:c,stroke:n,strokeWidth:"1.5",style:{transition:r?"all 0.6s ease-out":"none"}}),(0,t.jsx)("circle",{cx:l,cy:c,r:"2",fill:n,style:{transition:r?"all 0.6s ease-out":"none"}})]})}function G({confidence:e,theme:r}){const n=Math.round(100*e),i=n>=80?r.success:n>=60?r.warning:r.danger;return(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:"2px",fontSize:"10px",fontWeight:600,padding:"1px 5px",borderRadius:"999px",backgroundColor:`${i}22`,color:i,border:`1px solid ${i}44`,marginLeft:"6px",verticalAlign:"middle",letterSpacing:"0.03em"},children:["⚛ ",n,"%"]})}function K({config:e,intel:r,qubitPhase:n,value:i,error:o,touched:a,showConfidence:s,showQuantumState:l,collapsed:c,onChange:d,onBlur:u,theme:f,mounted:p,index:m}){const g=e.type??r.type,h=e.label??r.label,b=e.placeholder??r.placeholder,x=void 0!==e.required?e.required:r.validations.some(e=>"required"===e.rule),y=W(h),w="textarea"===g,v=a&&""!==o,k=`qf-${e.name}`,$={width:"100%",padding:"9px 12px",border:`1.5px solid ${v?f.danger:f.border}`,borderRadius:"8px",backgroundColor:f.surface,color:f.text,fontSize:"14px",fontFamily:"inherit",outline:"none",boxSizing:"border-box",transition:"border-color 0.15s, box-shadow 0.15s",resize:w?"vertical":void 0,minHeight:w?"80px":void 0};return(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"4px",opacity:p?1:0,transform:p?"scaleY(1)":"scaleY(0.92)",transition:`opacity 0.35s ease ${60*m}ms, transform 0.35s ease ${60*m}ms`,transformOrigin:"top"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[l&&(0,t.jsx)(X,{phase:n,collapsed:c,primaryColor:f.primary,borderColor:f.border}),(0,t.jsxs)("label",{htmlFor:k,style:{fontSize:"13px",fontWeight:500,color:f.text,cursor:"pointer"},children:[y,x&&(0,t.jsx)("span",{"aria-hidden":"true",style:{color:f.danger,marginLeft:"3px"},children:"*"})]}),s&&(0,t.jsx)(G,{confidence:r.confidence,theme:f})]}),w?(0,t.jsx)("textarea",{id:k,value:i,onChange:e=>d(e.target.value),onBlur:u,placeholder:b,"aria-invalid":v,"aria-required":x,style:$}):(0,t.jsx)("input",{id:k,type:g,value:i,onChange:e=>d(e.target.value),onBlur:u,placeholder:b,"aria-invalid":v,"aria-required":x,style:$}),v&&(0,t.jsxs)("span",{role:"alert",style:{fontSize:"12px",color:f.danger,display:"flex",alignItems:"center",gap:"4px"},children:[(0,t.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,t.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),W(o)]})]})}function ee(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619)>>>0;return(65535&t)/65535*Math.PI*2}function te({fields:r,onSubmit:a,submitLabel:s="Submit",layout:l="vertical",showConfidence:c=!0,showQuantumState:d=!1}){const u=n(),f=r.map(e=>function(e){const t=e.toLowerCase().replace(/[\s-]/g,"_"),r=(new i).amplify(o,e=>{let r=0;for(const n of e.keywords)t===n?r=Math.max(r,1):t.includes(n)||n.includes(t)?r=Math.max(r,.8):n.split("_").some(e=>t.includes(e))&&(r=Math.max(r,.5));return r},.3);if(r.length>0&&r[0].combined>.1){const e=o[r[0].index];return{type:e.type,validations:e.validations,placeholder:e.placeholder,confidence:Math.min(e.confidence*r[0].combined*2,.99),label:e.label}}return{type:"text",validations:[{rule:"maxLength",value:255,message:"Input too long"}],placeholder:e.replace(/_/g," "),confidence:.3,label:e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}}(e.name)),[p,m]=(0,e.useState)(()=>Object.fromEntries(r.map(e=>[e.name,""]))),[g,h]=(0,e.useState)({}),[b,x]=(0,e.useState)({}),[y,w]=(0,e.useState)(!1),[v,k]=(0,e.useState)(!1),[$,z]=(0,e.useState)(!1);(0,e.useEffect)(()=>{const e=requestAnimationFrame(()=>k(!0));return()=>cancelAnimationFrame(e)},[]);const S=(0,e.useCallback)((e,t)=>{const n=r.find(t=>t.name===e),i=f[r.findIndex(t=>t.name===e)];if(!n||!i)return"";const o=t[e]??"";for(const{rule:r,value:a,message:s}of i.validations)if(("required"!==r||!1!==n.required)&&!J(r,a,o,t))return s;return""},[r]),j=(0,e.useCallback)(e=>{const t={};for(const n of r){const r=S(n.name,e);r&&(t[n.name]=r)}return t},[r,S]),C=(0,e.useCallback)((e,t)=>{m(n=>{const i={...n,[e]:t};if(b[e]&&(h(t=>({...t,[e]:S(e,i)})),"password"===e)){const e=r.find(e=>["confirmpassword","confirm_password","passwordconfirm"].includes(e.name.toLowerCase().replace(/[\s_-]/g,"")))?.name;e&&b[e]&&h(t=>({...t,[e]:S(e,i)}))}return i}),z(!0)},[r,b,S]),A=(0,e.useCallback)(e=>{x(t=>({...t,[e]:!0})),h(t=>({...t,[e]:S(e,p)}))},[p,S]),M=(0,e.useCallback)(async e=>{e.preventDefault(),x(Object.fromEntries(r.map(e=>[e.name,!0])));const t=j(p);if(h(t),!(Object.keys(t).length>0)){w(!0);try{await a(p)}finally{w(!1)}}},[r,p,j,a]),_=f.length>0?Math.round(f.reduce((e,t)=>e+t.confidence,0)/f.length*100):0,I=_>=80?u.success:_>=60?u.warning:u.danger,L="horizontal"===l;return(0,t.jsxs)("form",{onSubmit:M,noValidate:!0,className:R("w-full"),style:{backgroundColor:u.surface,border:`1px solid ${u.border}`,borderRadius:"12px",padding:"24px",position:"relative",boxSizing:"border-box"},children:[(0,t.jsx)("span",{"aria-label":"Powered by Quantum AI",style:{position:"absolute",top:"16px",right:"16px",fontSize:"10px",fontWeight:700,padding:"3px 8px",borderRadius:"999px",backgroundColor:`${u.primary}20`,color:u.primary,border:`1px solid ${u.primary}44`,letterSpacing:"0.04em",userSelect:"none"},children:"⚛ Quantum AI"}),c&&(0,t.jsxs)("div",{style:{marginBottom:"20px",paddingRight:"100px"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"4px"},children:[(0,t.jsx)("span",{style:{fontSize:"11px",color:u.textMuted,fontWeight:500},children:"Form Intelligence Confidence"}),(0,t.jsxs)("span",{style:{fontSize:"11px",fontWeight:700,color:I},children:[_,"%"]})]}),(0,t.jsx)("div",{style:{height:"4px",borderRadius:"4px",backgroundColor:u.border,overflow:"hidden"},children:(0,t.jsx)("div",{style:{height:"100%",width:`${_}%`,backgroundColor:I,borderRadius:"4px",transition:"width 0.8s ease"}})})]}),(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:L?"repeat(auto-fill, minmax(260px, 1fr))":"1fr",gap:"16px",marginBottom:"20px"},children:r.map((e,r)=>(0,t.jsx)(K,{config:e,intel:f[r],qubitPhase:ee(e.name),value:p[e.name]??"",error:g[e.name]??"",touched:b[e.name]??!1,showConfidence:c,showQuantumState:d,collapsed:$,onChange:t=>C(e.name,t),onBlur:()=>A(e.name),theme:u,mounted:v,index:r},e.name))}),(0,t.jsx)("button",{type:"submit",disabled:y,style:{width:"100%",padding:"10px 20px",borderRadius:"8px",border:"none",backgroundColor:y?`${u.primary}88`:u.primary,color:u.bg,fontSize:"14px",fontWeight:700,fontFamily:"inherit",cursor:y?"not-allowed":"pointer",transition:"background-color 0.15s, opacity 0.15s",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:y?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",style:{animation:"qf-spin 0.8s linear infinite"},"aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"10",strokeOpacity:"0.25"}),(0,t.jsx)("path",{d:"M12 2a10 10 0 0 1 10 10"})]}),"Processing…"]}):W(s)}),(0,t.jsx)("style",{children:"@keyframes qf-spin { to { transform: rotate(360deg); } }"})]})}Object.freeze({sanitizeString:W,sanitizeHref:D,sanitizeHTML:E,sanitizeCSS:Y,sanitizeJSON:function(e){try{return H(JSON.parse(e,(e,t)=>{if(!U.has(e))return t}))}catch{return null}},sanitizeUnicode:function(e){return"string"!=typeof e?"":e.replace(/[\u200B-\u200F\u202A-\u202E\u2060-\u206F\uFEFF\u00AD]/g,"")},isSafeAttrName:function(e){return!("string"!=typeof e||!e||/[\u0000-\u001F\u007F<>"]/.test(e)||P.has(e.toLowerCase()))},buildTkxCSP:function(e={}){const{allowInlineStyles:t=!0,imgHosts:r=[],connectHosts:n=[],fontHosts:i=[],scriptNonce:o,reportUri:a}=e,s=["default-src 'self'","script-src "+(o?`'self' 'nonce-${o}'`:"'self'"),"style-src "+(t?"'self' 'unsafe-inline'":"'self'"),`img-src ${["'self'","data:","https:",...r].join(" ")}`,`font-src ${["'self'","https:","data:",...i].join(" ")}`,`connect-src ${["'self'",...n].join(" ")}`,"frame-ancestors 'none'","form-action 'self'","base-uri 'self'","object-src 'none'","upgrade-insecure-requests"];return a&&s.push(`report-uri ${a}`),s.join("; ")},installTrustedTypes:function(){if("undefined"==typeof window)return;const e=window.trustedTypes;if(e)try{e.createPolicy("tkx",{createHTML:E,createScriptURL:e=>D(e)??"",createScript:()=>{throw new Error("TekiVex: inline script creation forbidden")}})}catch{}},isFramed:Q,installFrameBuster:function(e){if("undefined"!=typeof window&&Q())if(e)e();else try{window.top.location.href=window.self.location.href}catch{}},createRateLimiter:function(e,t){let r=e,n=Date.now();return{check(){const i=Date.now(),o=i-n,a=Math.floor(o/t);return a>0&&(r=Math.min(e,r+a),n=i),!(r<=0||(r-=1,0))},reset(){r=e,n=Date.now()}}},sniffMimeType:async function(e){const t=new Uint8Array(await e.slice(0,12).arrayBuffer()),r=(...e)=>e.every((e,r)=>t[r]===e);return r(137,80,78,71)?"image/png":r(255,216,255)?"image/jpeg":r(71,73,70,56)?"image/gif":r(66,77)?"image/bmp":r(82,73,70,70)&&87===t[8]&&69===t[9]&&66===t[10]&&80===t[11]?"image/webp":r(37,80,68,70)?"application/pdf":r(80,75,3,4)?"application/zip":123===t[0]||91===t[0]?"application/json":[...t].includes(0)?null:"text/plain"},scrubPII:function(e){if("string"!=typeof e)return"";let t=e;for(const{re:r,repl:n}of V)t=t.replace(r,n);return t},deepFreeze:function e(t){if(t&&"object"==typeof t&&!Object.isFrozen(t)){for(const r of Object.keys(t))e(t[r]);Object.freeze(t)}return t},__brand:"TekiVex SecurityCore v2.6.0 © 007krcs"}),te.displayName="TkxQuantumForm";var re={sm:4,md:8,lg:12};function ne({color:e}){return(0,t.jsx)("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[0,1,2].map(r=>(0,t.jsx)("div",{style:{width:7,height:7,borderRadius:"50%",background:e,animation:`tkx-thinking-dot 1.2s ease-in-out ${.18*r}s infinite`}},r))})}function ie({color:e}){return(0,t.jsxs)("div",{style:{position:"relative",width:24,height:24},children:[(0,t.jsx)("div",{style:{position:"absolute",inset:0,borderRadius:"50%",background:e,opacity:.15,animation:"tkx-thinking-pulse 1.5s ease-out infinite"}}),(0,t.jsx)("div",{style:{position:"absolute",inset:4,borderRadius:"50%",background:e,opacity:.6,animation:"tkx-thinking-pulse 1.5s ease-out 0.3s infinite"}}),(0,t.jsx)("div",{style:{position:"absolute",inset:8,borderRadius:"50%",background:e}})]})}function oe({color:e}){return(0,t.jsx)("div",{style:{display:"flex",gap:3,alignItems:"center",height:20},children:[0,1,2,3,4].map(r=>(0,t.jsx)("div",{style:{width:3,borderRadius:3,background:e,animation:`tkx-thinking-wave 1s ease-in-out ${.1*r}s infinite`}},r))})}function ae({color:e}){return(0,t.jsxs)("div",{style:{position:"relative",width:28,height:28},children:[(0,t.jsx)("div",{style:{position:"absolute",inset:0,borderRadius:"50%",border:`2px solid ${e}33`}}),(0,t.jsx)("div",{style:{position:"absolute",inset:0,borderRadius:"50%",border:"2px solid transparent",borderTopColor:e,animation:"tkx-thinking-orbit 0.8s linear infinite"}}),(0,t.jsx)("div",{style:{position:"absolute",inset:"38%",borderRadius:"50%",background:e,opacity:.8}})]})}var se={sm:12,md:14,lg:16};function le({src:e,name:r,size:i=32}){const o=n(),a=r?r.split(" ").map(e=>e[0]).join("").slice(0,2).toUpperCase():"?";return e?(0,t.jsx)("img",{src:e,alt:r??"avatar",width:i,height:i,style:{borderRadius:"50%",objectFit:"cover",flexShrink:0}}):(0,t.jsx)("div",{style:{width:i,height:i,borderRadius:"50%",flexShrink:0,background:`${o.primary}22`,border:`1px solid ${o.primary}44`,display:"flex",alignItems:"center",justifyContent:"center",fontSize:.35*i,fontWeight:700,color:o.primary},children:a})}exports.TkxAIChatBubble=function({role:r,content:i,avatar:o,name:a,timestamp:s,streaming:l=!1,confidence:c,copyable:d=!1,className:u,style:f}){const p=n(),m="user"===r,g="system"===r,h="string"==typeof i?W(i):"",[b,x]=(0,e.useState)(l?"":h),[y,w]=(0,e.useState)(!1),[v,k]=(0,e.useState)(l?"":h),$=(0,e.useRef)(0),z=(0,e.useRef)(null);if((0,e.useEffect)(()=>{if(!l||"string"!=typeof i)return void k(h);$.current=0,x(""),k("");const e=setInterval(()=>{$.current++;const t=h.slice(0,$.current);x(t),z.current&&clearTimeout(z.current),z.current=setTimeout(()=>k(t),350),$.current>=h.length&&(clearInterval(e),z.current&&clearTimeout(z.current),k(h))},18);return()=>{clearInterval(e),z.current&&clearTimeout(z.current)}},[h,l,i]),g)return(0,t.jsx)("div",{style:{display:"flex",justifyContent:"center",padding:"8px 0"},children:(0,t.jsx)("div",{style:{padding:"6px 16px",borderRadius:999,fontSize:12,background:`${p.border}`,color:p.textMuted,fontStyle:"italic"},children:"string"==typeof i?W(i):i})});const S={maxWidth:"75%",padding:"12px 16px",borderRadius:m?"18px 18px 4px 18px":"18px 18px 18px 4px",background:m?`linear-gradient(135deg, ${p.primary}, ${p.primary}cc)`:`${p.surface}`,border:m?"none":`1px solid ${p.border}`,color:m?"#fff":p.text,fontSize:14,lineHeight:1.65,boxShadow:m?`0 4px 16px -4px ${p.primary}55`:"0 2px 8px -2px rgba(0,0,0,0.2)",position:"relative",wordBreak:"break-word"};return(0,t.jsxs)("div",{className:q(R("flex gap-2"),u),style:{flexDirection:m?"row-reverse":"row",alignItems:"flex-end",...f},children:[(0,t.jsx)(le,{src:o,name:a??(m?"You":"AI")}),(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4,alignItems:m?"flex-end":"flex-start"},children:[(a||s)&&(0,t.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",paddingInline:4},children:[a&&(0,t.jsx)("span",{style:{fontSize:11,fontWeight:700,color:p.textMuted},children:a}),s&&(0,t.jsx)("span",{style:{fontSize:10,color:p.textMuted},children:s})]}),(0,t.jsxs)("div",{style:S,role:"article","aria-label":m?"Your message":"Assistant message",children:["string"==typeof i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{"aria-hidden":l?"true":void 0,children:l?b:W(i)}),l&&b.length<h.length&&(0,t.jsx)("span",{"aria-hidden":"true",style:{display:"inline-block",width:2,height:14,background:m?"#fff":p.primary,marginLeft:2,animation:"tkx-blink 1s step-end infinite",verticalAlign:"text-bottom"}}),l&&(0,t.jsx)("span",{"aria-live":"polite","aria-atomic":"false",style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0},children:v})]}):i,d&&!m&&(0,t.jsx)("button",{onClick:()=>{navigator.clipboard?.writeText(h),w(!0),setTimeout(()=>w(!1),2e3)},title:"Copy message",style:{position:"absolute",top:8,right:8,background:"none",border:"none",cursor:"pointer",fontSize:13,color:y?"#10b981":p.textMuted,padding:"2px 4px",borderRadius:4,transition:"color 0.2s"},children:y?"✓":"⎘"})]}),!m&&void 0!==c&&(0,t.jsx)("div",{style:{paddingInline:4,width:"100%",maxWidth:240},children:(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,t.jsx)("div",{style:{flex:1,height:3,borderRadius:3,background:p.border,overflow:"hidden"},children:(0,t.jsx)("div",{style:{height:"100%",width:`${c}%`,background:(j=c,C=p.primary,j>=80?"#10b981":j>=55?C:j>=30?"#f59e0b":"#ef4444"),borderRadius:3,transition:"width 0.8s ease"}})}),(0,t.jsxs)("span",{style:{fontSize:10,color:p.textMuted,whiteSpace:"nowrap"},children:[c,"% confident"]})]})})]}),(0,t.jsx)("style",{children:"\n @keyframes tkx-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }\n "})]});var j,C},exports.TkxAIConfidenceBar=function({value:r,label:i,showLabel:o=!0,size:a="md",animate:s=!0,className:l,style:c}){const d=n(),u=(0,e.useRef)(null),f=Math.max(0,Math.min(100,r)),p=function(e,t){return e>=80?"#10b981":e>=55?t:e>=30?"#f59e0b":"#ef4444"}(f,d.primary),m=re[a];(0,e.useEffect)(()=>{if(!s||!u.current)return;const e=u.current;e.style.width="0%";const t=requestAnimationFrame(()=>{e.style.transition="width 0.9s cubic-bezier(0.4, 0, 0.2, 1)",e.style.width=`${f}%`});return()=>cancelAnimationFrame(t)},[f,s]);const g="number"==typeof f?`${f.toFixed(0)}% AI confidence${i?` for ${i}`:""}`:i;return(0,t.jsxs)("div",{className:q(R("flex flex-col gap-1"),l),style:c,role:"meter","aria-valuenow":f,"aria-valuemin":0,"aria-valuemax":100,"aria-label":g,children:[(i||o)&&(0,t.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[i&&(0,t.jsx)("span",{style:{fontSize:12,fontWeight:600,color:d.textMuted},children:i}),o&&(0,t.jsxs)("span",{style:{fontSize:12,fontWeight:700,color:p,marginLeft:"auto"},children:[f.toFixed(0),"%"]})]}),(0,t.jsxs)("div",{style:{height:m,borderRadius:m,background:`${d.border}`,overflow:"hidden",position:"relative"},children:[(0,t.jsx)("div",{style:{position:"absolute",inset:0,background:"linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%)",backgroundSize:"200% 100%",animation:"tkx-ai-shimmer 2s linear infinite",pointerEvents:"none",zIndex:1}}),(0,t.jsx)("div",{ref:u,style:{height:"100%",width:s?"0%":`${f}%`,background:`linear-gradient(90deg, ${p}cc, ${p})`,borderRadius:m,boxShadow:`0 0 8px ${p}66`,transition:s?void 0:"width 0.3s ease"}})]}),(0,t.jsxs)("div",{style:{fontSize:10,color:d.textMuted,marginTop:2,display:"flex",gap:4,alignItems:"center"},children:[(0,t.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:p,display:"inline-block",flexShrink:0}}),f>=80?"High confidence":f>=55?"Moderate confidence":f>=30?"Low confidence":"Very low — review manually"]}),(0,t.jsx)("style",{children:"\n @keyframes tkx-ai-shimmer {\n 0% { background-position: -200% 0; }\n 100% { background-position: 200% 0; }\n }\n "})]})},exports.TkxAIThinking=function({label:r="Thinking…",steps:i,size:o="md",variant:a="dots",active:s=!0,className:l,style:c}){const d=n(),[u,f]=(0,e.useState)(0);(0,e.useEffect)(()=>{if(!i?.length||!s)return;const e=setInterval(()=>{f(e=>(e+1)%i.length)},1800);return()=>clearInterval(e)},[i,s]);const p=d.primary,m=se[o],g={dots:(0,t.jsx)(ne,{color:p}),pulse:(0,t.jsx)(ie,{color:p}),wave:(0,t.jsx)(oe,{color:p}),orbit:(0,t.jsx)(ae,{color:p})}[a];return(0,t.jsxs)("div",{className:q(R("inline-flex flex-col gap-2"),l),style:c,role:"status","aria-live":"polite","aria-label":s?r:"Done thinking",children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,t.jsx)("div",{style:{opacity:s?1:.35,transition:"opacity 0.3s"},children:s?g:(0,t.jsx)("div",{style:{width:20,height:20,borderRadius:"50%",background:"#10b981",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,t.jsx)("span",{style:{color:"#fff",fontSize:11,fontWeight:900},children:"✓"})})}),(0,t.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[(0,t.jsx)("span",{style:{fontSize:m,fontWeight:600,color:s?d.text:d.textMuted,transition:"color 0.3s"},children:s?i?i[u]:r:"Done"}),s&&(0,t.jsx)("span",{style:{fontSize:m-2,color:d.textMuted},children:"⚛ Quantum AI · Amplitude Amplification"})]})]}),i&&i.length>1&&(0,t.jsx)("div",{style:{display:"flex",gap:4,paddingLeft:2},children:i.map((e,r)=>(0,t.jsx)("div",{style:{width:r===u?16:6,height:4,borderRadius:4,background:r===u?p:`${p}44`,transition:"all 0.3s ease"}},r))}),(0,t.jsx)("style",{children:"\n @keyframes tkx-thinking-dot {\n 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }\n 40% { transform: scale(1); opacity: 1; }\n }\n @keyframes tkx-thinking-pulse {\n 0% { transform: scale(0.6); opacity: 0.8; }\n 100% { transform: scale(2); opacity: 0; }\n }\n @keyframes tkx-thinking-wave {\n 0%, 100% { height: 6px; }\n 50% { height: 18px; }\n }\n @keyframes tkx-thinking-orbit {\n to { transform: rotate(360deg); }\n }\n "})]})},exports.TkxQuantumForm=te;