tekivex-ui 3.4.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 (115) 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 +31 -6
  15. package/dist/index.js +694 -571
  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/TkxAccessibilityChecker.d.ts +12 -0
  73. package/dist/src/components/TkxAppBar.d.ts +2 -1
  74. package/dist/src/components/TkxButton.d.ts +1 -0
  75. package/dist/src/components/TkxCommandPalette.d.ts +32 -0
  76. package/dist/src/components/TkxDataGrid.d.ts +37 -1
  77. package/dist/src/components/TkxFlowChart.d.ts +52 -0
  78. package/dist/src/components/TkxFormBuilder.d.ts +34 -0
  79. package/dist/src/components/TkxFormulaBar.d.ts +19 -0
  80. package/dist/src/components/TkxFunnelChart.d.ts +21 -0
  81. package/dist/src/components/TkxGantt.d.ts +29 -0
  82. package/dist/src/components/TkxGauge.d.ts +21 -0
  83. package/dist/src/components/TkxHeatmap.d.ts +25 -0
  84. package/dist/src/components/TkxHolographic.d.ts +2 -0
  85. package/dist/src/components/TkxHolographicAdvanced.d.ts +48 -0
  86. package/dist/src/components/TkxMindMap.d.ts +22 -0
  87. package/dist/src/components/TkxPivotTable.d.ts +21 -0
  88. package/dist/src/components/TkxSparkline.d.ts +15 -0
  89. package/dist/src/components/TkxSpreadsheet.d.ts +33 -0
  90. package/dist/src/components/TkxTreemap.d.ts +21 -0
  91. package/dist/src/components/TkxTypography.d.ts +1 -1
  92. package/dist/src/components/index.d.ts +5 -3
  93. package/dist/src/engine/security.d.ts +3 -0
  94. package/dist/src/experimental/index.d.ts +8 -0
  95. package/dist/src/headless/index.d.ts +6 -0
  96. package/dist/src/headless/rhfBindings.d.ts +59 -0
  97. package/dist/src/headless/useFormState.d.ts +12 -2
  98. package/dist/src/headless/valibotResolver.d.ts +25 -0
  99. package/dist/src/headless/zodResolver.d.ts +25 -0
  100. package/dist/src/i18n/index.d.ts +20 -0
  101. package/dist/src/i18n/plurals.d.ts +4 -0
  102. package/dist/src/quantum/index.d.ts +0 -2
  103. package/dist/src/themes/index.d.ts +7 -1
  104. package/dist/themes.cjs +1 -0
  105. package/dist/themes.js +1 -0
  106. package/package.json +32 -8
  107. package/dist/chunk-BHX35YDv.js +0 -1
  108. package/dist/chunk-BpuJ3-K8.js +0 -1
  109. package/dist/chunk-Bze40nDX.js +0 -1
  110. package/dist/chunk-C8Wy8P59.js +0 -1
  111. package/dist/chunk-D7-yknXg.js +0 -1
  112. package/dist/chunk-DTO-RrPx.js +0 -3
  113. package/dist/chunk-DcVMayoM.js +0 -1
  114. package/dist/chunk-DdHSYetV.js +0 -1
  115. package/dist/chunk-DmRB1Blb.js +0 -1
package/dist/quantum.js CHANGED
@@ -1,74 +1,59 @@
1
- import{p as e}from"./chunk-DdHSYetV.js";import{E as t,a as n}from"./chunk-DcVMayoM.js";import r,{useCallback as o,useEffect as i,useRef as a,useState as l}from"react";import{Fragment as s,jsx as d,jsxs as c}from"react/jsx-runtime";var p=class e{constructor(e,t){this.re=e,this.im=t}add(t){return new e(this.re+t.re,this.im+t.im)}sub(t){return new e(this.re-t.re,this.im-t.im)}mul(t){return new e(this.re*t.re-this.im*t.im,this.re*t.im+this.im*t.re)}scale(t){return new e(this.re*t,this.im*t)}conjugate(){return new e(this.re,-this.im)}magnitudeSquared(){return this.re*this.re+this.im*this.im}magnitude(){return Math.sqrt(this.magnitudeSquared())}static fromPolar(t,n){return new e(t*Math.cos(n),t*Math.sin(n))}static zero(){return new e(0,0)}static one(){return new e(1,0)}},h=class e{constructor(e=p.one(),t=p.zero()){this.alpha=e,this.beta=t,this.normalize()}normalize(){const e=Math.sqrt(this.alpha.magnitudeSquared()+this.beta.magnitudeSquared());e>0&&(this.alpha=this.alpha.scale(1/e),this.beta=this.beta.scale(1/e))}hadamard(){const t=1/Math.SQRT2;return new e(this.alpha.add(this.beta).scale(t),this.alpha.sub(this.beta).scale(t))}ry(t){const n=Math.cos(t/2),r=Math.sin(t/2);return new e(this.alpha.scale(n).sub(this.beta.scale(r)),this.alpha.scale(r).add(this.beta.scale(n)))}phase(t){const n=p.fromPolar(1,t);return new e(this.alpha,this.beta.mul(n))}measure(){const e=this.beta.magnitudeSquared();return Math.random()<e?1:0}expectation(){return this.beta.magnitudeSquared()}getAlpha(){return this.alpha}getBeta(){return this.beta}},u=class{constructor(e){this.qubits=Array.from({length:e},()=>new h)}get size(){return this.qubits.length}getQubit(e){return this.qubits[e]}superpose(){this.qubits=this.qubits.map(e=>e.hadamard())}cnot(e,t){const n=this.qubits[e],r=this.qubits[t],o=n.expectation();this.qubits[t]=r.ry(Math.PI*o)}rotate(e,t){this.qubits[e]=this.qubits[e].ry(t)}measure(){return this.qubits.map(e=>e.measure())}probs(){return this.qubits.map(e=>e.expectation())}},g=class{constructor(e=1,t=.995,n=.3,r=1e-6){this.temperature=e,this.coolingRate=t,this.tunnelingStrength=n,this.minTemp=r}anneal(e,t,n,r=1e3){let o=e,i=t(o),a=o,l=i,s=this.temperature,d=0,c=0;for(let p=0;p<r&&s>this.minTemp;p++){const e=n(o),r=t(e),p=r-i;let h=!1;if(p<=0)h=!0;else{const e=Math.exp(-p/s),t=Math.sqrt(2*Math.abs(p)),n=Math.abs(p),r=Math.exp(-2*t*Math.sqrt(n)*this.tunnelingStrength);Math.random()<e+r&&(h=!0,Math.random()<r/(e+r+1e-10)&&c++)}h&&(o=e,i=r,d++,i<l&&(a=o,l=i)),s*=this.coolingRate}return{state:a,energy:l,iterations:r,accepted:d,tunnels:c}}},m=class{constructor(e,t){const n=Math.sqrt(2/(e+t));this.weights=Array.from({length:e},()=>Array.from({length:t},()=>(2*Math.random()-1)*n)),this.visibleBias=Array.from({length:e},()=>0),this.hiddenBias=Array.from({length:t},()=>0)}sigmoid(e){const t=.1*(Math.random()-.5);return 1/(1+Math.exp(-(e+t)))}sample(e){return Math.random()<e?1:0}energy(e,t){const n=this.visibleBias.reduce((t,n,r)=>t+n*e[r],0),r=this.hiddenBias.reduce((e,n,r)=>e+n*t[r],0);let o=0;for(let i=0;i<e.length;i++)for(let n=0;n<t.length;n++)o+=e[i]*this.weights[i][n]*t[n];return-(n+r+o)}hiddenProbs(e){return this.hiddenBias.map((t,n)=>{const r=t+e.reduce((e,t,r)=>e+this.weights[r][n]*t,0);return this.sigmoid(r)})}visibleProbs(e){return this.visibleBias.map((t,n)=>{const r=t+e.reduce((e,t,r)=>e+this.weights[n][r]*t,0);return this.sigmoid(r)})}gibbs(e,t=1){let n=[...e],r=[];for(let o=0;o<t;o++)r=this.hiddenProbs(n).map(e=>this.sample(e)),n=this.visibleProbs(r).map(e=>this.sample(e));return{visible:n,hidden:r}}trainCD1(e,t=.01){const n=this.visibleBias.length,r=this.hiddenBias.length,o=Array.from({length:n},()=>Array(r).fill(0)),i=Array(n).fill(0),a=Array(r).fill(0);for(const s of e){const e=this.hiddenProbs(s),t=e.map(e=>this.sample(e)),l=this.visibleProbs(t).map(e=>this.sample(e)),d=this.hiddenProbs(l);for(let a=0;a<n;a++){for(let t=0;t<r;t++)o[a][t]+=s[a]*e[t]-l[a]*d[t];i[a]+=s[a]-l[a]}for(let n=0;n<r;n++)a[n]+=e[n]-d[n]}const l=e.length;for(let s=0;s<n;s++){for(let e=0;e<r;e++)this.weights[s][e]+=t*o[s][e]/l;this.visibleBias[s]+=t*i[s]/l}for(let s=0;s<r;s++)this.hiddenBias[s]+=t*a[s]/l}infer(e){const t=this.hiddenProbs(e),n=t.map(e=>this.sample(e));return{hidden:t,visible:this.visibleProbs(n),energy:this.energy(e,n),iterations:1}}},f=class{amplify(e,t,n=.5){const r=e.length;if(0===r)return[];const o=e.map(t),i=o.filter(e=>e>n).length,a=Math.max(1,i);let l=Array(r).fill(1/Math.sqrt(r));const s=Math.max(1,Math.floor(Math.PI/4*Math.sqrt(r/a)));for(let d=0;d<s;d++){for(let t=0;t<r;t++)o[t]>n&&(l[t]=-l[t]);const e=l.reduce((e,t)=>e+t,0)/r;l=l.map(t=>2*e-t)}return e.map((e,t)=>({index:t,amplitude:l[t],probability:l[t]*l[t],classicalSimilarity:o[t],combined:l[t]*l[t]*.6+.4*o[t]})).sort((e,t)=>t.combined-e.combined)}},y=[{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}];function x(e){const t=e.toLowerCase().replace(/[\s-]/g,"_"),n=(new f).amplify(y,e=>{let n=0;for(const r of e.keywords)t===r?n=Math.max(n,1):t.includes(r)||r.includes(t)?n=Math.max(n,.8):r.split("_").some(e=>t.includes(e))&&(n=Math.max(n,.5));return n},.3);if(n.length>0&&n[0].combined>.1){const e=y[n[0].index];return{type:e.type,validations:e.validations,placeholder:e.placeholder,confidence:Math.min(e.confidence*n[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())}}function b(e,t,n){const r=n/100,o=t/100*Math.min(r,1-r),i=t=>{const n=(t+e/30)%12,i=r-o*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*i).toString(16).padStart(2,"0")};return`#${i(0)}${i(8)}${i(4)}`}function v(e){const[t,n,r]=function(e){const t=e.replace("#",""),n=3===t.length?t.split("").map(e=>e+e).join(""):t;return[parseInt(n.slice(0,2),16),parseInt(n.slice(2,4),16),parseInt(n.slice(4,6),16)]}(e).map(e=>{const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return.2126*t+.7152*n+.0722*r}function k(e,t){const n=v(e),r=v(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function w(e,t,n){return Math.max(t,Math.min(n,e))}function S(e,t,n=800){const r=t?{primary:{h:e,s:70,l:55},secondary:{h:(e+137.5)%360,s:65,l:50},bg:{h:e,s:10,l:8},surface:{h:e,s:10,l:13},text:{h:e,s:15,l:90},border:{h:e,s:15,l:22},accent:{h:(e+120)%360,s:75,l:60}}:{primary:{h:e,s:65,l:40},secondary:{h:(e+137.5)%360,s:55,l:38},bg:{h:e,s:15,l:97},surface:{h:e,s:12,l:100},text:{h:e,s:15,l:12},border:{h:e,s:12,l:85},accent:{h:(e+120)%360,s:70,l:42}};return function(e,t){const n=e=>b(e.h,e.s,e.l),r=t?e.text.l-20:e.text.l+15;return{primary:n(e.primary),secondary:n(e.secondary),background:n(e.bg),surface:n(e.surface),text:n(e.text),textMuted:b(e.text.h,Math.max(0,e.text.s-10),Math.max(20,Math.min(85,r))),border:n(e.border),error:t?"#f87171":"#dc2626",warning:t?"#fbbf24":"#d97706",success:t?"#34d399":"#059669",accent:n(e.accent)}}(new g(1.5,.994,.35,1e-5).anneal(r,e=>function(e,t){let n=0;const r=e=>b(e.h,e.s,e.l),o=r(e.text),i=r(e.bg),a=r(e.surface),l=r(e.primary),s=k(o,i),d=k(o,a),c=k(l,i);s<4.5&&(n+=10*(4.5-s)),d<4.5&&(n+=8*(4.5-d)),c<3&&(n+=5*(3-c)),n+=.05*Math.abs((e.secondary.h-e.primary.h+360)%360-137.508),n+=.03*Math.abs((e.accent.h-e.primary.h+360)%360-120);const p=(e.primary.s+e.secondary.s)/2;p<20&&(n+=.5*(20-p)),p>90&&(n+=.5*(p-90));const h=e.bg.l;t?(h>25&&(n+=2*(h-25)),h<3&&(n+=2*(3-h)),e.text.l<70&&(n+=1.5*(70-e.text.l))):(h<90&&(n+=2*(90-h)),h>100&&(n+=2*(h-100)),e.text.l>30&&(n+=1.5*(e.text.l-30)));const u=Math.abs(e.surface.l-e.bg.l);return u<2&&(n+=2*(2-u)),u>12&&(n+=1*(u-12)),n}(e,t),e=>{const t=["primary","secondary","bg","surface","text","border","accent"],n=t[Math.floor(Math.random()*t.length)],r=["h","s","l"],o=r[Math.floor(Math.random()*r.length)],i=(Math.random()-.5)*("h"===o?30:15),a={...e,[n]:{...e[n]}};return a[n]="h"===o?{...a[n],h:(e[n].h+i+360)%360}:"s"===o?{...a[n],s:w(e[n].s+i,0,100)}:{...a[n],l:w(e[n].l+i,0,100)},a},n).state,t)}var C={qubit:()=>new h,register:e=>new u(e),annealer:(e,t,n)=>new g(e,t,n),qbm:(e,t)=>new m(e,t),amplifier:()=>new f,inferField:x,optimizeTheme:S,contrast:k,hslToHex:b};function M(e,t,n,r){const o=n.trim();switch(e){case"required":return""!==o;case"email":case"pattern":if("string"==typeof t)try{return""===o||new RegExp(t).test(o)}catch{return!0}return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o);case"phone":return""===o||/^\+?[\d\s\-()]{7,15}$/.test(o);case"url":return""===o||/^https?:\/\/.+/.test(o);case"minLength":case"min":{const e=Number(t??0);return""===o||(isNaN(Number(o))?o.length>=e:Number(o)>=e)}case"maxLength":case"max":{const e=Number(t??1/0);return""===o||(isNaN(Number(o))?o.length<=e:Number(o)<=e)}case"integer":return""===o||/^\d+$/.test(o);case"alphanumeric":return""===o||/^[a-zA-Z0-9]+$/.test(o);case"match":return o===(r["string"==typeof t?t:"password"]??"");default:return!0}}function z({phase:e,collapsed:t,primaryColor:n,borderColor:r}){const o=12,i=t?0:e,a=t?0:1.618*e,l=o+10*Math.sin(i)*Math.cos(a),s=12-10*Math.cos(i);/* @__PURE__ */
2
- return c("svg",{width:"24",height:"24",viewBox:"0 0 24 24","aria-hidden":"true",style:{flexShrink:0,opacity:t?.4:1,transition:"opacity 0.6s"},children:[
3
- /* @__PURE__ */d("circle",{cx:o,cy:12,r:10,fill:"none",stroke:r,strokeWidth:"0.8"}),
4
- /* @__PURE__ */d("ellipse",{cx:o,cy:12,rx:10,ry:3,fill:"none",stroke:r,strokeWidth:"0.5",strokeDasharray:"2 2"}),
5
- /* @__PURE__ */d("line",{x1:o,y1:2,x2:o,y2:22,stroke:r,strokeWidth:"0.5"}),
6
- /* @__PURE__ */d("line",{x1:o,y1:12,x2:l,y2:s,stroke:n,strokeWidth:"1.5",style:{transition:t?"all 0.6s ease-out":"none"}}),
7
- /* @__PURE__ */d("circle",{cx:l,cy:s,r:"2",fill:n,style:{transition:t?"all 0.6s ease-out":"none"}})]})}function T({confidence:e,theme:t}){const n=Math.round(100*e),r=n>=80?t.success:n>=60?t.warning:t.danger;/* @__PURE__ */
8
- return c("span",{style:{display:"inline-flex",alignItems:"center",gap:"2px",fontSize:"10px",fontWeight:600,padding:"1px 5px",borderRadius:"999px",backgroundColor:`${r}22`,color:r,border:`1px solid ${r}44`,marginLeft:"6px",verticalAlign:"middle",letterSpacing:"0.03em"},children:["⚛ ",n,"%"]})}function $({config:e,intel:n,qubitPhase:r,value:o,error:i,touched:a,showConfidence:l,showQuantumState:s,collapsed:p,onChange:h,onBlur:u,theme:g,mounted:m,index:f}){const y=e.type??n.type,x=e.label??n.label,b=e.placeholder??n.placeholder,v=void 0!==e.required?e.required:n.validations.some(e=>"required"===e.rule),k=t(x),w="textarea"===y,S=a&&""!==i,C=`qf-${e.name}`,M={width:"100%",padding:"9px 12px",border:`1.5px solid ${S?g.danger:g.border}`,borderRadius:"8px",backgroundColor:g.surface,color:g.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};/* @__PURE__ */
9
- return c("div",{style:{display:"flex",flexDirection:"column",gap:"4px",opacity:m?1:0,transform:m?"scaleY(1)":"scaleY(0.92)",transition:`opacity 0.35s ease ${60*f}ms, transform 0.35s ease ${60*f}ms`,transformOrigin:"top"},children:[
10
- /* @__PURE__ */c("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[s&&/* @__PURE__ */d(z,{phase:r,collapsed:p,primaryColor:g.primary,borderColor:g.border}),
11
- /* @__PURE__ */c("label",{htmlFor:C,style:{fontSize:"13px",fontWeight:500,color:g.text,cursor:"pointer"},children:[k,v&&/* @__PURE__ */d("span",{"aria-hidden":"true",style:{color:g.danger,marginLeft:"3px"},children:"*"})]}),l&&/* @__PURE__ */d(T,{confidence:n.confidence,theme:g})]}),w?/* @__PURE__ */d("textarea",{id:C,value:o,onChange:e=>h(e.target.value),onBlur:u,placeholder:b,"aria-invalid":S,"aria-required":v,style:M}):/* @__PURE__ */d("input",{id:C,type:y,value:o,onChange:e=>h(e.target.value),onBlur:u,placeholder:b,"aria-invalid":S,"aria-required":v,style:M}),S&&/* @__PURE__ */c("span",{role:"alert",style:{fontSize:"12px",color:g.danger,display:"flex",alignItems:"center",gap:"4px"},children:[/* @__PURE__ */d("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */d("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"})}),t(i)]})]})}function A(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return(65535&t)/65535*Math.PI*2}function W({fields:r,onSubmit:a,submitLabel:p="Submit",layout:h="vertical",showConfidence:u=!0,showQuantumState:g=!1}){const m=e(),f=r.map(e=>x(e.name)),[y,b]=l(()=>Object.fromEntries(r.map(e=>[e.name,""]))),[v,k]=l({}),[w,S]=l({}),[C,z]=l(!1),[T,W]=l(!1),[R,B]=l(!1);i(()=>{const e=requestAnimationFrame(()=>W(!0));return()=>cancelAnimationFrame(e)},[]);const F=o((e,t)=>{const n=r.find(t=>t.name===e),o=f[r.findIndex(t=>t.name===e)];if(!n||!o)return"";const i=t[e]??"";for(const{rule:r,value:a,message:l}of o.validations)if(("required"!==r||!1!==n.required)&&!M(r,a,i,t))return l;return""},[r]),L=o(e=>{const t={};for(const n of r){const r=F(n.name,e);r&&(t[n.name]=r)}return t},[r,F]),I=o((e,t)=>{b(n=>{const o={...n,[e]:t};if(w[e]&&(k(t=>({...t,[e]:F(e,o)})),"password"===e)){const e=r.find(e=>["confirmpassword","confirm_password","passwordconfirm"].includes(e.name.toLowerCase().replace(/[\s_-]/g,"")))?.name;e&&w[e]&&k(t=>({...t,[e]:F(e,o)}))}return o}),B(!0)},[r,w,F]),P=o(e=>{S(t=>({...t,[e]:!0})),k(t=>({...t,[e]:F(e,y)}))},[y,F]),E=o(async e=>{e.preventDefault(),S(Object.fromEntries(r.map(e=>[e.name,!0])));const t=L(y);if(k(t),!(Object.keys(t).length>0)){z(!0);try{await a(y)}finally{z(!1)}}},[r,y,L,a]),_=f.length>0?Math.round(f.reduce((e,t)=>e+t.confidence,0)/f.length*100):0,q=_>=80?m.success:_>=60?m.warning:m.danger,D="horizontal"===h;/* @__PURE__ */
12
- return c("form",{onSubmit:E,noValidate:!0,className:n("w-full"),style:{backgroundColor:m.surface,border:`1px solid ${m.border}`,borderRadius:"12px",padding:"24px",position:"relative",boxSizing:"border-box"},children:[
13
- /* @__PURE__ */d("span",{"aria-label":"Powered by Quantum AI",style:{position:"absolute",top:"16px",right:"16px",fontSize:"10px",fontWeight:700,padding:"3px 8px",borderRadius:"999px",backgroundColor:`${m.primary}20`,color:m.primary,border:`1px solid ${m.primary}44`,letterSpacing:"0.04em",userSelect:"none"},children:"⚛ Quantum AI"}),u&&/* @__PURE__ */c("div",{style:{marginBottom:"20px",paddingRight:"100px"},children:[/* @__PURE__ */c("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"4px"},children:[/* @__PURE__ */d("span",{style:{fontSize:"11px",color:m.textMuted,fontWeight:500},children:"Form Intelligence Confidence"}),/* @__PURE__ */c("span",{style:{fontSize:"11px",fontWeight:700,color:q},children:[_,"%"]})]}),/* @__PURE__ */d("div",{style:{height:"4px",borderRadius:"4px",backgroundColor:m.border,overflow:"hidden"},children:/* @__PURE__ */d("div",{style:{height:"100%",width:`${_}%`,backgroundColor:q,borderRadius:"4px",transition:"width 0.8s ease"}})})]}),
14
- /* @__PURE__ */d("div",{style:{display:"grid",gridTemplateColumns:D?"repeat(auto-fill, minmax(260px, 1fr))":"1fr",gap:"16px",marginBottom:"20px"},children:r.map((e,t)=>/* @__PURE__ */d($,{config:e,intel:f[t],qubitPhase:A(e.name),value:y[e.name]??"",error:v[e.name]??"",touched:w[e.name]??!1,showConfidence:u,showQuantumState:g,collapsed:R,onChange:t=>I(e.name,t),onBlur:()=>P(e.name),theme:m,mounted:T,index:t},e.name))}),
15
- /* @__PURE__ */d("button",{type:"submit",disabled:C,style:{width:"100%",padding:"10px 20px",borderRadius:"8px",border:"none",backgroundColor:C?`${m.primary}88`:m.primary,color:m.bg,fontSize:"14px",fontWeight:700,fontFamily:"inherit",cursor:C?"not-allowed":"pointer",transition:"background-color 0.15s, opacity 0.15s",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:C?/* @__PURE__ */c(s,{children:[/* @__PURE__ */c("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:[/* @__PURE__ */d("circle",{cx:"12",cy:"12",r:"10",strokeOpacity:"0.25"}),/* @__PURE__ */d("path",{d:"M12 2a10 10 0 0 1 10 10"})]}),"Processing…"]}):t(p)}),
16
- /* @__PURE__ */d("style",{children:"@keyframes qf-spin { to { transform: rotate(360deg); } }"})]})}function R(e){return e?{primary:"#00f5d4",secondary:"#7b2ff7",background:"#0a0a0f",surface:"#12121a",text:"#e8e8f4",textMuted:"#8888aa",border:"#2a2a3e",error:"#f87171",warning:"#fbbf24",success:"#34d399",accent:"#ff6b6b"}:{primary:"#0d7c5f",secondary:"#6930c3",background:"#f8f6f1",surface:"#ffffff",text:"#1a1815",textMuted:"#6b6560",border:"#ddd8cc",error:"#dc2626",warning:"#d97706",success:"#059669",accent:"#e05a00"}}function B({points:e,primary:t}){if(e.length<2)/* @__PURE__ */return d("div",{style:{height:48,display:"flex",alignItems:"center",justifyContent:"center",color:"#888",fontSize:12},children:"Waiting for data..."});const n=Math.max(...e.map(e=>e.energy)),r=Math.min(...e.map(e=>e.energy)),o=n-r||1,i=e[e.length-1].iteration||1;/* @__PURE__ */
17
- return c("svg",{width:280,height:48,style:{display:"block"},children:[
18
- /* @__PURE__ */d("polyline",{points:e.map(e=>{const t=e.iteration/i*280,n=48-(e.energy-r)/o*44-2;return`${t.toFixed(1)},${n.toFixed(1)}`}).join(" "),fill:"none",stroke:t,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",opacity:.9}),
19
- /* @__PURE__ */c("text",{x:2,y:10,fontSize:9,fill:"#888",children:["E=",n.toFixed(1)]}),
20
- /* @__PURE__ */c("text",{x:2,y:46,fontSize:9,fill:"#888",children:["E=",r.toFixed(1)]})]})}function F({label:e,value:t,onChange:n,text:r,border:o}){/* @__PURE__ */
21
- return c("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[
22
- /* @__PURE__ */d("input",{type:"color",value:t,onChange:e=>n(e.target.value),style:{width:32,height:32,border:`1px solid ${o}`,borderRadius:6,padding:2,cursor:"pointer",background:"transparent"}}),
23
- /* @__PURE__ */d("div",{style:{width:60,height:28,borderRadius:6,background:t,border:`1px solid ${o}`}}),
24
- /* @__PURE__ */d("span",{style:{flex:1,fontSize:13,color:r,fontFamily:"monospace"},children:e}),
25
- /* @__PURE__ */d("code",{style:{fontSize:12,color:r,opacity:.7,fontFamily:"monospace"},children:t})]})}function L({label:e,ratio:t}){const n=t>=4.5,r=t>=4.5,o=t>=7;/* @__PURE__ */
26
- return c("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[
27
- /* @__PURE__ */d("span",{style:{fontSize:11,opacity:.8,minWidth:140},children:e}),
28
- /* @__PURE__ */c("span",{style:{fontSize:12,fontWeight:600},children:[t.toFixed(2),":1"]}),
29
- /* @__PURE__ */d("span",{style:{fontSize:11,color:r?"#22c55e":"#ef4444"},children:r?" AA":"✗ AA"}),
30
- /* @__PURE__ */d("span",{style:{fontSize:11,color:o?"#22c55e":"#888"},children:o?" AAA":"— AAA"}),
31
- /* @__PURE__ */d("span",{style:{fontSize:13},children:n?"✅":"❌"})]})}function I({onThemeChange:t,initialHue:r=210,initialMode:i="dark"}){const s=e(),[p,h]=l(i),[u,g]=l(r),[m,f]=l(()=>R("dark"===i)),[y,x]=l(!1),[b,v]=l([]),[k,w]=l(!1),S=a(null),M="dark"===p,z=o((e,n)=>{f(r=>{const o={...r,[e]:n};return t?.(o),o})},[t]),T=o(()=>{if(y)return;x(!0),v([]);let e=0;const n=[],r=()=>{e+=60,C.optimizeTheme(u,M,e);const o=e/600,i=50*(1-o)+2,a=8*(Math.random()-.5)*(1-.8*o);if(n.push({iteration:e,energy:Math.max(0,i+a)}),v([...n]),e<600)S.current=window.setTimeout(r,40);else{const e=C.optimizeTheme(u,M,1e3);f(e),t?.(e),x(!1)}};S.current=window.setTimeout(r,16)},[u,M,y,t]),$=o(()=>{const e="dark"===p?"light":"dark";h(e);const n=R("dark"===e);f(n),t?.(n)},[p,t]),A=o(()=>{const e=`export const myTheme = {\n${Object.entries(m).map(([e,t])=>` ${e}: '${t}',`).join("\n")}\n};`;"undefined"!=typeof navigator&&navigator.clipboard&&navigator.clipboard.writeText(e).then(()=>{w(!0),setTimeout(()=>w(!1),2e3)})},[m]),W=[{label:"Text on Background",fg:m.text,bg:m.background},{label:"Text on Surface",fg:m.text,bg:m.surface},{label:"Primary on Background",fg:m.primary,bg:m.background},{label:"TextMuted on Background",fg:m.textMuted,bg:m.background}],I="linear-gradient(to right,"+["hsl(0,80%,55%)","hsl(30,80%,55%)","hsl(60,80%,55%)","hsl(90,80%,55%)","hsl(120,80%,55%)","hsl(150,80%,55%)","hsl(180,80%,55%)","hsl(210,80%,55%)","hsl(240,80%,55%)","hsl(270,80%,55%)","hsl(300,80%,55%)","hsl(330,80%,55%)","hsl(360,80%,55%)"].join(",")+")",P={fontFamily:"system-ui, -apple-system, sans-serif",background:m.background,color:m.text,border:`1px solid ${m.border}`,borderRadius:12,padding:20,maxWidth:900,display:"grid",gridTemplateColumns:"1fr 1fr",gap:20},E={background:m.surface,border:`1px solid ${m.border}`,borderRadius:8,padding:16},_={fontSize:13,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.08em",color:m.primary,marginBottom:12,marginTop:0},q={padding:"8px 16px",borderRadius:8,border:"none",cursor:"pointer",fontWeight:600,fontSize:13,transition:"opacity 0.15s"},D=n;/* @__PURE__ */
32
- return c("div",{style:P,children:[
33
- /* @__PURE__ */c("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[
34
- /* @__PURE__ */c("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gridColumn:"1/-1"},children:[/* @__PURE__ */c("div",{children:[/* @__PURE__ */d("h2",{style:{margin:0,fontSize:18,fontWeight:700},children:"Theme Builder"}),/* @__PURE__ */d("p",{style:{margin:"2px 0 0",fontSize:12,color:m.textMuted},children:"Quantum-powered color optimization"})]}),/* @__PURE__ */d("button",{onClick:$,style:{...q,background:m.surface,color:m.text,border:`1px solid ${m.border}`},children:M?"☀ Light":"🌙 Dark"})]}),
35
- /* @__PURE__ */c("div",{style:E,children:[/* @__PURE__ */d("p",{style:_,children:"Base Hue"}),/* @__PURE__ */c("div",{style:{display:"flex",alignItems:"center",gap:10},children:[
36
- /* @__PURE__ */d("div",{style:{width:24,height:24,borderRadius:"50%",background:`hsl(${u},70%,55%)`,border:`2px solid ${m.border}`,flexShrink:0}}),
37
- /* @__PURE__ */d("input",{type:"range",min:0,max:360,value:u,onChange:e=>g(Number(e.target.value)),style:{flex:1,height:16,borderRadius:8,background:I,outline:"none",border:"none",cursor:"pointer",appearance:"none",WebkitAppearance:"none"}}),
38
- /* @__PURE__ */c("span",{style:{fontSize:13,fontFamily:"monospace",minWidth:32},children:[u,"°"]})]})]}),
39
- /* @__PURE__ */c("div",{style:E,children:[/* @__PURE__ */c("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:10},children:[/* @__PURE__ */d("button",{onClick:T,disabled:y,style:{...q,background:y?m.border:m.primary,color:M?"#000":"#fff",opacity:y?.7:1,flex:1},children:y?"⟳ Optimizing...":"⚛ Generate with Quantum Annealing"}),/* @__PURE__ */d("div",{style:{padding:"3px 8px",background:m.primary+"22",border:`1px solid ${m.primary}44`,borderRadius:20,fontSize:10,color:m.primary,fontWeight:700,whiteSpace:"nowrap"},children:"⚛ Quantum Annealing"})]}),(y||b.length>0)&&/* @__PURE__ */c("div",{children:[/* @__PURE__ */d("p",{style:{fontSize:11,color:m.textMuted,margin:"0 0 4px"},children:"Energy landscape (lower = better palette)"}),/* @__PURE__ */d(B,{points:b,primary:m.primary})]})]}),
40
- /* @__PURE__ */c("div",{style:E,children:[/* @__PURE__ */d("p",{style:_,children:"Color Tokens"}),Object.keys(m).map(e=>/* @__PURE__ */d(F,{label:e,value:m[e],onChange:t=>z(e,t),text:m.text,border:m.border},e))]}),
41
- /* @__PURE__ */d("button",{onClick:A,style:{...q,background:m.accent,color:"#fff",width:"100%"},children:k?"✓ Copied to Clipboard!":"⬇ Export Theme"})]}),
42
- /* @__PURE__ */c("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[
43
- /* @__PURE__ */c("div",{style:E,children:[
44
- /* @__PURE__ */d("p",{style:_,children:"Live Preview"}),
45
- /* @__PURE__ */c("div",{style:{marginBottom:12},children:[/* @__PURE__ */d("p",{style:{fontSize:11,color:m.textMuted,margin:"0 0 6px"},children:"Buttons"}),/* @__PURE__ */c("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[
46
- /* @__PURE__ */d("button",{style:{padding:"8px 16px",borderRadius:8,border:"none",background:m.primary,color:M?"#000":"#fff",fontWeight:600,fontSize:13,cursor:"pointer"},children:"Primary"}),
47
- /* @__PURE__ */d("button",{style:{padding:"8px 16px",borderRadius:8,border:"none",background:m.secondary,color:"#fff",fontWeight:600,fontSize:13,cursor:"pointer"},children:"Secondary"}),
48
- /* @__PURE__ */d("button",{style:{padding:"8px 16px",borderRadius:8,border:`1px solid ${m.border}`,background:"transparent",color:m.text,fontWeight:600,fontSize:13,cursor:"pointer"},children:"Outline"})]})]}),
49
- /* @__PURE__ */c("div",{style:{marginBottom:12},children:[/* @__PURE__ */d("p",{style:{fontSize:11,color:m.textMuted,margin:"0 0 6px"},children:"Card"}),/* @__PURE__ */c("div",{style:{background:m.surface,border:`1px solid ${m.border}`,borderRadius:8,padding:12},children:[
50
- /* @__PURE__ */d("div",{style:{fontSize:14,fontWeight:700,marginBottom:4},children:"Card Title"}),
51
- /* @__PURE__ */d("div",{style:{fontSize:12,color:m.textMuted,lineHeight:1.4},children:"Sample card with surface background and muted text content."}),
52
- /* @__PURE__ */c("div",{style:{marginTop:8,display:"flex",gap:6},children:[/* @__PURE__ */d("span",{style:{padding:"2px 8px",borderRadius:20,background:m.primary+"33",color:m.primary,fontSize:11,fontWeight:600},children:"Tag"}),/* @__PURE__ */d("span",{style:{padding:"2px 8px",borderRadius:20,background:m.accent+"33",color:m.accent,fontSize:11,fontWeight:600},children:"Accent"})]})]})]}),
53
- /* @__PURE__ */c("div",{style:{marginBottom:12},children:[/* @__PURE__ */d("p",{style:{fontSize:11,color:m.textMuted,margin:"0 0 6px"},children:"Input"}),/* @__PURE__ */d("input",{type:"text",placeholder:"Type something...",readOnly:!0,style:{width:"100%",padding:"8px 12px",borderRadius:8,border:`1px solid ${m.border}`,background:m.background,color:m.text,fontSize:13,outline:"none",boxSizing:"border-box"}})]}),
54
- /* @__PURE__ */c("div",{style:{marginBottom:12},children:[/* @__PURE__ */d("p",{style:{fontSize:11,color:m.textMuted,margin:"0 0 6px"},children:"Progress"}),/* @__PURE__ */d("div",{style:{height:8,borderRadius:4,background:m.border,overflow:"hidden"},children:/* @__PURE__ */d("div",{style:{height:"100%",width:"68%",background:`linear-gradient(to right, ${m.primary}, ${m.accent})`,borderRadius:4,transition:"width 0.4s ease"}})})]}),
55
- /* @__PURE__ */c("div",{children:[/* @__PURE__ */d("p",{style:{fontSize:11,color:m.textMuted,margin:"0 0 6px"},children:"Status Badges"}),/* @__PURE__ */d("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[{label:"Error",color:m.error},{label:"Warning",color:m.warning},{label:"Success",color:m.success}].map(({label:e,color:t})=>/* @__PURE__ */d("span",{style:{padding:"3px 10px",borderRadius:4,background:t+"22",color:t,border:`1px solid ${t}44`,fontSize:11,fontWeight:700},children:e},e))})]})]}),
56
- /* @__PURE__ */c("div",{style:E,children:[
57
- /* @__PURE__ */d("p",{style:_,children:"WCAG Contrast Check"}),W.map(e=>/* @__PURE__ */d(L,{label:e.label,ratio:C.contrast(e.fg,e.bg)},e.label)),
58
- /* @__PURE__ */d("p",{style:{fontSize:10,color:m.textMuted,marginTop:8,marginBottom:0},children:"AA requires 4.5:1 (normal text). AAA requires 7:1."})]}),
59
- /* @__PURE__ */c("div",{style:E,children:[/* @__PURE__ */d("p",{style:_,children:"Color Palette"}),/* @__PURE__ */d("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:Object.entries(m).map(([e,t])=>/* @__PURE__ */d("div",{title:`${e}: ${t}`,style:{width:36,height:36,borderRadius:6,background:t,border:`2px solid ${m.border}`,cursor:"default",flexShrink:0}},e))})]})]}),"function"==typeof D&&null,"string"==typeof s.bg&&null]})}W.displayName="TkxQuantumForm";var P=["fetch(","XMLHttpRequest","navigator.sendBeacon","document.cookie","localStorage","sessionStorage","indexedDB","WebSocket","EventSource","import(","eval(","new Function(","postMessage","window.open","location.href","location.replace","location.assign","document.write","crypto.subtle"],E=[{label:"Hello World",code:"<div style={{ padding: 24, fontFamily: 'sans-serif', color: '#e8e8f4' }}>\n <h2 style={{ margin: 0 }}>👋 Hello, TkxPlayground!</h2>\n <p style={{ marginTop: 8, opacity: 0.7 }}>Edit the code on the left to see live updates.</p>\n</div>"},{label:"Button Styles",code:"<div style={{ display: 'flex', gap: 12, flexWrap: 'wrap', padding: 24 }}>\n {['primary', 'success', 'danger', 'warning', 'info'].map(color => (\n <button\n key={color}\n style={{\n padding: '8px 18px',\n borderRadius: 8,\n border: 'none',\n background: color === 'primary' ? '#00f5d4' : color === 'success' ? '#06d6a0' : color === 'danger' ? '#f72585' : color === 'warning' ? '#ffbe0b' : '#3a86ff',\n color: '#0a0a0f',\n fontWeight: 700,\n cursor: 'pointer',\n textTransform: 'capitalize',\n }}\n >\n {color}\n </button>\n ))}\n</div>"},{label:"Card Grid",code:"<div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 16, padding: 24 }}>\n {['Alpha', 'Beta', 'Gamma', 'Delta', 'Epsilon', 'Zeta'].map(name => (\n <div key={name} style={{\n background: '#1a1a2e',\n borderRadius: 10,\n border: '1px solid #2a2a3e',\n padding: '16px',\n }}>\n <div style={{ fontWeight: 700, color: '#00f5d4', marginBottom: 4 }}>{name}</div>\n <div style={{ fontSize: 12, color: '#8888aa' }}>Quantum module {name.toLowerCase()}</div>\n </div>\n ))}\n</div>"},{label:"Animated Counter",code:"(() => {\n const [count, setCount] = React.useState(0);\n return (\n <div style={{ padding: 32, textAlign: 'center', fontFamily: 'sans-serif' }}>\n <div style={{ fontSize: 64, fontWeight: 900, color: '#00f5d4', marginBottom: 16 }}>\n {count}\n </div>\n <div style={{ display: 'flex', gap: 12, justifyContent: 'center' }}>\n <button onClick={() => setCount(c => c - 1)} style={{ padding: '8px 20px', borderRadius: 8, border: '1px solid #2a2a3e', background: '#1a1a2e', color: '#e8e8f4', fontSize: 20, cursor: 'pointer' }}>−</button>\n <button onClick={() => setCount(0)} style={{ padding: '8px 20px', borderRadius: 8, border: '1px solid #2a2a3e', background: '#1a1a2e', color: '#8888aa', cursor: 'pointer' }}>Reset</button>\n <button onClick={() => setCount(c => c + 1)} style={{ padding: '8px 20px', borderRadius: 8, border: '1px solid #2a2a3e', background: '#1a1a2e', color: '#e8e8f4', fontSize: 20, cursor: 'pointer' }}>+</button>\n </div>\n </div>\n );\n})()"},{label:"Data Table",code:"(() => {\n const rows = [\n { id: 1, name: 'Hydrogen', symbol: 'H', mass: 1.008 },\n { id: 2, name: 'Helium', symbol: 'He', mass: 4.003 },\n { id: 3, name: 'Lithium', symbol: 'Li', mass: 6.941 },\n { id: 4, name: 'Carbon', symbol: 'C', mass: 12.011 },\n { id: 5, name: 'Nitrogen', symbol: 'N', mass: 14.007 },\n ];\n const cell = { padding: '8px 14px', borderBottom: '1px solid #2a2a3e', color: '#e8e8f4', fontSize: 13 };\n const hcell = { ...cell, color: '#8888aa', fontWeight: 600, fontSize: 11, textTransform: 'uppercase', letterSpacing: '0.06em' };\n return (\n <div style={{ padding: 16 }}>\n <table style={{ width: '100%', borderCollapse: 'collapse', fontFamily: 'sans-serif' }}>\n <thead>\n <tr>{['ID','Element','Symbol','Atomic Mass'].map(h => <th key={h} style={hcell}>{h}</th>)}</tr>\n </thead>\n <tbody>\n {rows.map(r => (\n <tr key={r.id} style={{ transition: 'background 0.15s' }}>\n <td style={cell}>{r.id}</td>\n <td style={cell}>{r.name}</td>\n <td style={{ ...cell, color: '#00f5d4', fontWeight: 700 }}>{r.symbol}</td>\n <td style={cell}>{r.mass}</td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n})()"}],_=class extends r.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){this.props.onError(e.message)}componentDidUpdate(e){e.children!==this.props.children&&this.state.hasError&&this.setState({hasError:!1})}render(){return this.state.hasError?null:this.props.children}};function q({code:e,lineHeight:t}){const n=e.split("\n");/* @__PURE__ */
60
- return d("div",{"aria-hidden":"true",style:{position:"absolute",top:0,left:0,width:"36px",padding:"12px 0",textAlign:"right",paddingRight:"8px",userSelect:"none",pointerEvents:"none",fontSize:"12px",lineHeight:`${t}px`,color:"#555577",fontFamily:'"Fira Code", "Cascadia Code", "Consolas", monospace',boxSizing:"border-box"},children:n.map((e,t)=>/* @__PURE__ */d("div",{children:t+1},t))})}var D=["TkxButton","TkxInput","TkxCard","TkxModal","TkxTable","TkxSelect","TkxCheckbox","TkxRadio","TkxSwitch","TkxSlider","TkxBadge","TkxAlert","TkxToast","TkxTooltip","TkxPopover","TkxTabs","TkxAccordion","TkxDrawer","TkxDropdown","TkxMenu","TkxForm","TkxDataGrid","TkxChart","TkxSpinner","TkxSkeleton","TkxAvatar","TkxTag","TkxDivider","TkxProgress","TkxStatistic","TkxQuantumForm","TkxPlayground"],N=new f;function j(e){const t=e.match(/([A-Z][a-zA-Z0-9]*)$/);return t?t[1]:""}function H({defaultCode:t,examples:n,height:s=480,imports:p={},strictMode:h=!0,forbiddenTokens:u}){const g=e(),m=[...E,...n??[]],f=t??E[0].code,[y,x]=l(f),[b,v]=l({element:null,error:null,renderMs:0}),[k,w]=l(null),[S,C]=l([]),[M,z]=l(!1),[T,$]=l(0),A=a(null),W=a(null),R=o(e=>{w(null),v(function(e,t,n){const o=performance.now();try{const i=e.trim();if(!1!==n?.strictMode){const e=function(e,t){const n=[...P,...t??[]],r=e.toLowerCase();for(const o of n)if(r.includes(o.toLowerCase()))return o;return null}(i,n?.forbiddenTokens);if(e)return{element:null,error:`Blocked by playground strictMode: code contains "${e}". This token is disallowed because playground snippets run in the page's JavaScript context. If you trust the source, pass strictMode={false} to <TkxPlayground>.`,renderMs:parseFloat((performance.now()-o).toFixed(2))}}let a=`\n function PlaygroundRoot() {\n ${i.startsWith("<")||i.startsWith("(")?`return (${i});`:i}\n }\n `;const l="undefined"==typeof window?null:window.Babel??null;l&&(a=l.transform(a,{presets:["react"],filename:"playground.jsx"}).code??a);const s=new Function("React","imports",`\n "use strict";\n const { ${Object.keys(t).join(", ")} } = imports;\n ${a}\n return PlaygroundRoot;\n `)(r,t);return{element:r.createElement(s),error:null,renderMs:parseFloat((performance.now()-o).toFixed(2))}}catch(i){const e=parseFloat((performance.now()-o).toFixed(2));return{element:null,error:i instanceof Error?i.message:String(i),renderMs:e}}}(e,p,{strictMode:h,forbiddenTokens:u}))},[p,h,u]);i(()=>(W.current&&clearTimeout(W.current),W.current=setTimeout(()=>R(y),300),()=>{W.current&&clearTimeout(W.current)}),[y,R]),i(()=>{R(f)},[]);const B=o(e=>{const t=e.target.value;x(t);const n=j(t);n.length>=2?C(function(e,t=4){if(!e||e.length<2)return[];const n=e.toLowerCase();return N.amplify(D,e=>{const t=e.toLowerCase();if(t.startsWith(n))return 1;if(t.includes(n))return.7;let r=0;for(let o=0;o<n.length-1;o++)t.includes(n.slice(o,o+2))&&(r+=.15);return Math.min(r,.5)},.1).slice(0,t).map(e=>({name:D[e.index]??"",amplitude:parseFloat(e.combined.toFixed(3))})).filter(e=>""!==e.name)}(n,4)):C([])},[]),F=o(e=>{const t=m[e];t&&($(e),x(t.code),C([]))},[m]),L=o(async()=>{try{await navigator.clipboard.writeText(y),z(!0),setTimeout(()=>z(!1),1500)}catch{}},[y]),I=o(()=>{x(f),$(0),C([])},[f]),H=o(e=>{const t=j(y);t&&x(n=>n.slice(0,n.lastIndexOf(t))+e),C([])},[y]),O=null!==b.error||null!==k,Q=b.error??k??"",Z=g.bg,U=g.surfaceAlt,Y=g.border,G=g.surface,J={width:"50%",display:"flex",flexDirection:"column",borderRight:`1px solid ${Y}`,position:"relative"},V={display:"flex",alignItems:"center",gap:"6px",padding:"6px 10px",borderBottom:`1px solid ${Y}`,backgroundColor:g.surface,flexWrap:"wrap"},X={padding:"3px 10px",borderRadius:"6px",border:`1px solid ${Y}`,backgroundColor:"transparent",color:g.textMuted,fontSize:"11px",fontWeight:600,cursor:"pointer",fontFamily:"inherit",transition:"color 0.15s, border-color 0.15s"};/* @__PURE__ */
61
- return c("div",{style:{display:"flex",flexDirection:"column",border:`1px solid ${Y}`,borderRadius:"12px",overflow:"hidden",backgroundColor:Z,fontFamily:"inherit",boxSizing:"border-box",position:"relative"},children:[
62
- /* @__PURE__ */c("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 14px",borderBottom:`1px solid ${Y}`,backgroundColor:g.surface},children:[/* @__PURE__ */d("span",{style:{fontSize:"12px",fontWeight:700,color:g.primary,letterSpacing:"0.05em"},children:"⚛ TkxPlayground"}),/* @__PURE__ */d("span",{style:{fontSize:"10px",color:g.textMuted},children:"Live JSX Preview"})]}),
63
- /* @__PURE__ */d("div",{style:{display:"flex",gap:"4px",padding:"6px 10px",borderBottom:`1px solid ${Y}`,backgroundColor:g.surface,overflowX:"auto"},children:m.map((e,t)=>/* @__PURE__ */d("button",{onClick:()=>F(t),style:{padding:"3px 10px",borderRadius:"6px",border:`1px solid ${t===T?g.primary:Y}`,backgroundColor:t===T?`${g.primary}20`:"transparent",color:t===T?g.primary:g.textMuted,fontSize:"11px",fontWeight:t===T?700:400,cursor:"pointer",whiteSpace:"nowrap",fontFamily:"inherit",transition:"all 0.15s"},children:e.label},t))}),
64
- /* @__PURE__ */c("div",{style:{display:"flex",height:`${s}px`},children:[/* @__PURE__ */c("div",{style:J,children:[
65
- /* @__PURE__ */c("div",{style:V,children:[
66
- /* @__PURE__ */d("span",{style:{fontSize:"11px",color:g.textMuted,marginRight:"auto"},children:"editor.tsx"}),
67
- /* @__PURE__ */d("button",{onClick:L,style:X,title:"Copy code",children:M?"✓ Copied":"⎘ Copy"}),
68
- /* @__PURE__ */d("button",{onClick:I,style:X,title:"Reset to default",children:"↺ Reset"})]}),
69
- /* @__PURE__ */c("div",{style:{position:"relative",flex:1,overflow:"hidden"},children:[/* @__PURE__ */d(q,{code:y,lineHeight:18}),/* @__PURE__ */d("textarea",{ref:A,value:y,onChange:B,spellCheck:!1,autoCorrect:"off",autoCapitalize:"off",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",padding:"12px 12px 12px 44px",margin:0,border:"none",outline:"none",resize:"none",backgroundColor:Z,color:g.text,fontSize:"12px",lineHeight:"18px",fontFamily:'"Fira Code", "Cascadia Code", "Consolas", "Courier New", monospace',boxSizing:"border-box",overflowY:"auto",tabSize:2}})]}),S.length>0&&/* @__PURE__ */c("div",{style:{position:"absolute",bottom:"40px",left:"44px",zIndex:10,backgroundColor:g.surface,border:`1px solid ${g.primary}44`,borderRadius:"8px",overflow:"hidden",boxShadow:"0 4px 16px rgba(0,0,0,0.3)",minWidth:"180px"},children:[/* @__PURE__ */d("div",{style:{padding:"4px 10px 4px",fontSize:"10px",color:g.primary,fontWeight:700,borderBottom:`1px solid ${Y}`,letterSpacing:"0.05em"},children:"⚛ Quantum Suggestions"}),S.map(e=>/* @__PURE__ */c("button",{onClick:()=>H(e.name),style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"6px 10px",border:"none",backgroundColor:"transparent",color:g.text,fontSize:"12px",fontFamily:'"Fira Code", monospace',cursor:"pointer",textAlign:"left",gap:"12px"},children:[/* @__PURE__ */d("span",{children:e.name}),/* @__PURE__ */c("span",{style:{fontSize:"10px",color:g.textMuted,flexShrink:0},children:[Math.round(100*e.amplitude),"%"]})]},e.name))]})]}),/* @__PURE__ */c("div",{style:{width:"50%",display:"flex",flexDirection:"column"},children:[/* @__PURE__ */d("div",{style:{padding:"6px 10px",borderBottom:`1px solid ${Y}`,backgroundColor:g.surface,fontSize:"11px",color:g.textMuted,fontWeight:600},children:"Preview"}),/* @__PURE__ */d("div",{style:{flex:1,overflow:"auto",backgroundColor:U,position:"relative"},children:O?/* @__PURE__ */c("div",{style:{padding:"16px",color:g.danger,fontFamily:'"Fira Code", monospace',fontSize:"12px",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:[/* @__PURE__ */c("div",{style:{marginBottom:"8px",fontWeight:700,display:"flex",alignItems:"center",gap:"6px"},children:[/* @__PURE__ */d("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */d("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"})}),"Runtime Error"]}),Q]}):/* @__PURE__ */d(_,{onError:w,children:/* @__PURE__ */d("div",{style:{minHeight:"100%"},children:b.element})})})]})]}),
70
- /* @__PURE__ */c("div",{style:{display:"flex",alignItems:"center",gap:"16px",padding:"4px 12px",backgroundColor:G,borderTop:`1px solid ${Y}`,fontSize:"11px",color:g.textMuted},children:[
71
- /* @__PURE__ */c("span",{style:{display:"flex",alignItems:"center",gap:"4px",color:O?g.danger:g.success,fontWeight:600},children:[/* @__PURE__ */d("span",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:O?g.danger:g.success,display:"inline-block"}}),O?"Error":"OK"]}),
72
- /* @__PURE__ */c("span",{children:["⏱ ",b.renderMs," ms"]}),
73
- /* @__PURE__ */c("span",{children:[y.split("\n").length," lines"]}),
74
- /* @__PURE__ */c("span",{children:[y.length," chars"]}),S.length>0&&/* @__PURE__ */c("span",{style:{marginLeft:"auto",color:g.primary,fontWeight:600},children:["⚛ ",S.length," suggestion",S.length>1?"s":""]})]})]})}H.displayName="TkxPlayground";export{f as AmplitudeAmplifier,C as QuantumAI,g as QuantumAnnealer,m as QuantumBoltzmannMachine,u as QuantumRegister,h as Qubit,H as TkxPlayground,W as TkxQuantumForm,I as TkxThemeBuilder,b as hslToHex,x as inferFieldIntelligence,S as optimizeThemeColors};
1
+ import e,{createContext as t,useCallback as r,useContext as n,useEffect as o,useRef as i,useState as a}from"react";import{jsx as l,jsxs as s}from"react/jsx-runtime";new class{constructor(e=512){this.cache=/* @__PURE__ */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 d=t({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 c(){return n(d)}var u=class e{constructor(e,t){this.re=e,this.im=t}add(t){return new e(this.re+t.re,this.im+t.im)}sub(t){return new e(this.re-t.re,this.im-t.im)}mul(t){return new e(this.re*t.re-this.im*t.im,this.re*t.im+this.im*t.re)}scale(t){return new e(this.re*t,this.im*t)}conjugate(){return new e(this.re,-this.im)}magnitudeSquared(){return this.re*this.re+this.im*this.im}magnitude(){return Math.sqrt(this.magnitudeSquared())}static fromPolar(t,r){return new e(t*Math.cos(r),t*Math.sin(r))}static zero(){return new e(0,0)}static one(){return new e(1,0)}},f=class e{constructor(e=u.one(),t=u.zero()){this.alpha=e,this.beta=t,this.normalize()}normalize(){const e=Math.sqrt(this.alpha.magnitudeSquared()+this.beta.magnitudeSquared());e>0&&(this.alpha=this.alpha.scale(1/e),this.beta=this.beta.scale(1/e))}hadamard(){const t=1/Math.SQRT2;return new e(this.alpha.add(this.beta).scale(t),this.alpha.sub(this.beta).scale(t))}ry(t){const r=Math.cos(t/2),n=Math.sin(t/2);return new e(this.alpha.scale(r).sub(this.beta.scale(n)),this.alpha.scale(n).add(this.beta.scale(r)))}phase(t){const r=u.fromPolar(1,t);return new e(this.alpha,this.beta.mul(r))}measure(){const e=this.beta.magnitudeSquared();return Math.random()<e?1:0}expectation(){return this.beta.magnitudeSquared()}getAlpha(){return this.alpha}getBeta(){return this.beta}},p=class{constructor(e){this.qubits=Array.from({length:e},()=>new f)}get size(){return this.qubits.length}getQubit(e){return this.qubits[e]}superpose(){this.qubits=this.qubits.map(e=>e.hadamard())}cnot(e,t){const r=this.qubits[e],n=this.qubits[t],o=r.expectation();this.qubits[t]=n.ry(Math.PI*o)}rotate(e,t){this.qubits[e]=this.qubits[e].ry(t)}measure(){return this.qubits.map(e=>e.measure())}probs(){return this.qubits.map(e=>e.expectation())}},h=class{constructor(e=1,t=.995,r=.3,n=1e-6){this.temperature=e,this.coolingRate=t,this.tunnelingStrength=r,this.minTemp=n}anneal(e,t,r,n=1e3){let o=e,i=t(o),a=o,l=i,s=this.temperature,d=0,c=0;for(let u=0;u<n&&s>this.minTemp;u++){const e=r(o),n=t(e),u=n-i;let f=!1;if(u<=0)f=!0;else{const e=Math.exp(-u/s),t=Math.sqrt(2*Math.abs(u)),r=Math.abs(u),n=Math.exp(-2*t*Math.sqrt(r)*this.tunnelingStrength);Math.random()<e+n&&(f=!0,Math.random()<n/(e+n+1e-10)&&c++)}f&&(o=e,i=n,d++,i<l&&(a=o,l=i)),s*=this.coolingRate}return{state:a,energy:l,iterations:n,accepted:d,tunnels:c}}},g=class{constructor(e,t){const r=Math.sqrt(2/(e+t));this.weights=Array.from({length:e},()=>Array.from({length:t},()=>(2*Math.random()-1)*r)),this.visibleBias=Array.from({length:e},()=>0),this.hiddenBias=Array.from({length:t},()=>0)}sigmoid(e){const t=.1*(Math.random()-.5);return 1/(1+Math.exp(-(e+t)))}sample(e){return Math.random()<e?1:0}energy(e,t){const r=this.visibleBias.reduce((t,r,n)=>t+r*e[n],0),n=this.hiddenBias.reduce((e,r,n)=>e+r*t[n],0);let o=0;for(let i=0;i<e.length;i++)for(let r=0;r<t.length;r++)o+=e[i]*this.weights[i][r]*t[r];return-(r+n+o)}hiddenProbs(e){return this.hiddenBias.map((t,r)=>{const n=t+e.reduce((e,t,n)=>e+this.weights[n][r]*t,0);return this.sigmoid(n)})}visibleProbs(e){return this.visibleBias.map((t,r)=>{const n=t+e.reduce((e,t,n)=>e+this.weights[r][n]*t,0);return this.sigmoid(n)})}gibbs(e,t=1){let r=[...e],n=[];for(let o=0;o<t;o++)n=this.hiddenProbs(r).map(e=>this.sample(e)),r=this.visibleProbs(n).map(e=>this.sample(e));return{visible:r,hidden:n}}trainCD1(e,t=.01){const r=this.visibleBias.length,n=this.hiddenBias.length,o=Array.from({length:r},()=>Array(n).fill(0)),i=Array(r).fill(0),a=Array(n).fill(0);for(const s of e){const e=this.hiddenProbs(s),t=e.map(e=>this.sample(e)),l=this.visibleProbs(t).map(e=>this.sample(e)),d=this.hiddenProbs(l);for(let a=0;a<r;a++){for(let t=0;t<n;t++)o[a][t]+=s[a]*e[t]-l[a]*d[t];i[a]+=s[a]-l[a]}for(let r=0;r<n;r++)a[r]+=e[r]-d[r]}const l=e.length;for(let s=0;s<r;s++){for(let e=0;e<n;e++)this.weights[s][e]+=t*o[s][e]/l;this.visibleBias[s]+=t*i[s]/l}for(let s=0;s<n;s++)this.hiddenBias[s]+=t*a[s]/l}infer(e){const t=this.hiddenProbs(e),r=t.map(e=>this.sample(e));return{hidden:t,visible:this.visibleProbs(r),energy:this.energy(e,r),iterations:1}}},m=class{amplify(e,t,r=.5){const n=e.length;if(0===n)return[];const o=e.map(t),i=o.filter(e=>e>r).length,a=Math.max(1,i);let l=Array(n).fill(1/Math.sqrt(n));const s=Math.max(1,Math.floor(Math.PI/4*Math.sqrt(n/a)));for(let d=0;d<s;d++){for(let t=0;t<n;t++)o[t]>r&&(l[t]=-l[t]);const e=l.reduce((e,t)=>e+t,0)/n;l=l.map(t=>2*e-t)}return e.map((e,t)=>({index:t,amplitude:l[t],probability:l[t]*l[t],classicalSimilarity:o[t],combined:l[t]*l[t]*.6+.4*o[t]})).sort((e,t)=>t.combined-e.combined)}},x=[{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}];function b(e){const t=e.toLowerCase().replace(/[\s-]/g,"_"),r=(new m).amplify(x,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=x[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())}}function y(e,t,r){const n=r/100,o=t/100*Math.min(n,1-n),i=t=>{const r=(t+e/30)%12,i=n-o*Math.max(Math.min(r-3,9-r,1),-1);return Math.round(255*i).toString(16).padStart(2,"0")};return`#${i(0)}${i(8)}${i(4)}`}function w(e){const[t,r,n]=function(e){const t=e.replace("#",""),r=3===t.length?t.split("").map(e=>e+e).join(""):t;return[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16)]}(e).map(e=>{const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return.2126*t+.7152*r+.0722*n}function v(e,t){const r=w(e),n=w(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}function k(e,t,r){return Math.max(t,Math.min(r,e))}function $(e,t,r=800){const n=t?{primary:{h:e,s:70,l:55},secondary:{h:(e+137.5)%360,s:65,l:50},bg:{h:e,s:10,l:8},surface:{h:e,s:10,l:13},text:{h:e,s:15,l:90},border:{h:e,s:15,l:22},accent:{h:(e+120)%360,s:75,l:60}}:{primary:{h:e,s:65,l:40},secondary:{h:(e+137.5)%360,s:55,l:38},bg:{h:e,s:15,l:97},surface:{h:e,s:12,l:100},text:{h:e,s:15,l:12},border:{h:e,s:12,l:85},accent:{h:(e+120)%360,s:70,l:42}};return function(e,t){const r=e=>y(e.h,e.s,e.l),n=t?e.text.l-20:e.text.l+15;return{primary:r(e.primary),secondary:r(e.secondary),background:r(e.bg),surface:r(e.surface),text:r(e.text),textMuted:y(e.text.h,Math.max(0,e.text.s-10),Math.max(20,Math.min(85,n))),border:r(e.border),error:t?"#f87171":"#dc2626",warning:t?"#fbbf24":"#d97706",success:t?"#34d399":"#059669",accent:r(e.accent)}}(new h(1.5,.994,.35,1e-5).anneal(n,e=>function(e,t){let r=0;const n=e=>y(e.h,e.s,e.l),o=n(e.text),i=n(e.bg),a=n(e.surface),l=n(e.primary),s=v(o,i),d=v(o,a),c=v(l,i);s<4.5&&(r+=10*(4.5-s)),d<4.5&&(r+=8*(4.5-d)),c<3&&(r+=5*(3-c)),r+=.05*Math.abs((e.secondary.h-e.primary.h+360)%360-137.508),r+=.03*Math.abs((e.accent.h-e.primary.h+360)%360-120);const u=(e.primary.s+e.secondary.s)/2;u<20&&(r+=.5*(20-u)),u>90&&(r+=.5*(u-90));const f=e.bg.l;t?(f>25&&(r+=2*(f-25)),f<3&&(r+=2*(3-f)),e.text.l<70&&(r+=1.5*(70-e.text.l))):(f<90&&(r+=2*(90-f)),f>100&&(r+=2*(f-100)),e.text.l>30&&(r+=1.5*(e.text.l-30)));const p=Math.abs(e.surface.l-e.bg.l);return p<2&&(r+=2*(2-p)),p>12&&(r+=1*(p-12)),r}(e,t),e=>{const t=["primary","secondary","bg","surface","text","border","accent"],r=t[Math.floor(Math.random()*t.length)],n=["h","s","l"],o=n[Math.floor(Math.random()*n.length)],i=(Math.random()-.5)*("h"===o?30:15),a={...e,[r]:{...e[r]}};return a[r]="h"===o?{...a[r],h:(e[r].h+i+360)%360}:"s"===o?{...a[r],s:k(e[r].s+i,0,100)}:{...a[r],l:k(e[r].l+i,0,100)},a},r).state,t)}var z={qubit:()=>new f,register:e=>new p(e),annealer:(e,t,r)=>new h(e,t,r),qbm:(e,t)=>new g(e,t),amplifier:()=>new m,inferField:b,optimizeTheme:$,contrast:v,hslToHex:y},S={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"},C={...S,screen:"100vh"},M={"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%"},T={none:"0",sm:"2px","":"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px",full:"9999px"},A={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"},j={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"]},R={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},W={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"},B={tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},F={none:"0",sm:"4px","":"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},L=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)])),P=new Set(["bg","surface","surfaceAlt","border","text","textMuted","primary","secondary","danger","warning","success","info"]),_={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},E=/javascript\s*:|vbscript\s*:|data\s*:\s*text\/html|data\s*:\s*text\/javascript|expression\s*\(|[\r\n\x00]/i,I=new Set(["behavior","-moz-binding","-webkit-binding","src"]),D=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 q(e){return E.test(e)||e.includes("}")||e.includes("{")||e.includes("<")||e.includes(">")?null:e}function H(e){const t=e.match(/^\[(.+)]$/);return t?q(t[1]):null}function O(e){return P.has(e)?`var(--tkx-${e})`:"transparent"===e?"transparent":"current"===e?"currentColor":"white"===e?"#ffffff":"black"===e?"#000000":"inherit"===e?"inherit":H(e)||(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e),e)}function Z(e){const t=e.match(/^\[(--[a-zA-Z0-9_-]+):(.+)]$/);if(t){const e=q(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 I.has(t)?null:D.has(t)?t:null}(r[1]),t=q(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 o={"flex-row":"row","flex-col":"column","flex-row-reverse":"row-reverse","flex-col-reverse":"column-reverse"};if(o[e])return{"flex-direction":o[e]};const i={"flex-wrap":"wrap","flex-nowrap":"nowrap","flex-wrap-reverse":"wrap-reverse"};if(i[e])return{"flex-wrap":i[e]};const a={"flex-1":"1 1 0%","flex-auto":"1 1 auto","flex-none":"none","flex-initial":"0 1 auto"};if(a[e])return{flex:a[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 l={"items-start":"flex-start","items-end":"flex-end","items-center":"center","items-stretch":"stretch","items-baseline":"baseline"};if(l[e])return{"align-items":l[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 d={"self-auto":"auto","self-start":"flex-start","self-end":"flex-end","self-center":"center","self-stretch":"stretch","self-baseline":"baseline"};if(d[e])return{"align-self":d[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 u;if(u=e.match(/^grid-cols-(\d+|none|subgrid)$/))return{"grid-template-columns":"none"===u[1]?"none":"subgrid"===u[1]?"subgrid":`repeat(${u[1]},minmax(0,1fr))`};if(u=e.match(/^grid-rows-(\d+|none|subgrid)$/))return{"grid-template-rows":"none"===u[1]?"none":"subgrid"===u[1]?"subgrid":`repeat(${u[1]},minmax(0,1fr))`};if(u=e.match(/^col-span-(full|\d+)$/))return{"grid-column":"full"===u[1]?"1 / -1":`span ${u[1]} / span ${u[1]}`};if(u=e.match(/^col-start-(\d+|auto)$/))return{"grid-column-start":u[1]};if(u=e.match(/^col-end-(\d+|auto)$/))return{"grid-column-end":u[1]};if(u=e.match(/^row-span-(full|\d+)$/))return{"grid-row":"full"===u[1]?"1 / -1":`span ${u[1]} / span ${u[1]}`};if(u=e.match(/^row-start-(\d+|auto)$/))return{"grid-row-start":u[1]};if(u=e.match(/^row-end-(\d+|auto)$/))return{"grid-row-end":u[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(u=e.match(/^p-(.+)$/)){const e=S[u[1]]??H(u[1]);if(e)return{padding:e}}if(u=e.match(/^px-(.+)$/)){const e=S[u[1]]??H(u[1]);if(e)return{"padding-left":e,"padding-right":e}}if(u=e.match(/^py-(.+)$/)){const e=S[u[1]]??H(u[1]);if(e)return{"padding-top":e,"padding-bottom":e}}if(u=e.match(/^pt-(.+)$/)){const e=S[u[1]]??H(u[1]);if(e)return{"padding-top":e}}if(u=e.match(/^pr-(.+)$/)){const e=S[u[1]]??H(u[1]);if(e)return{"padding-right":e}}if(u=e.match(/^pb-(.+)$/)){const e=S[u[1]]??H(u[1]);if(e)return{"padding-bottom":e}}if(u=e.match(/^pl-(.+)$/)){const e=S[u[1]]??H(u[1]);if(e)return{"padding-left":e}}if(u=e.match(/^-?m-(.+)$/)){const t=e.startsWith("-"),r=S[u[1]]??H(u[1]);if(r)return{margin:t&&"0"!==r?`-${r}`:r}}if(u=e.match(/^-?mx-(.+)$/)){const t=e.startsWith("-"),r=S[u[1]]??H(u[1]);if(r){const e=t&&"0"!==r?`-${r}`:r;return{"margin-left":e,"margin-right":e}}}if(u=e.match(/^-?my-(.+)$/)){const t=e.startsWith("-"),r=S[u[1]]??H(u[1]);if(r){const e=t&&"0"!==r?`-${r}`:r;return{"margin-top":e,"margin-bottom":e}}}if(u=e.match(/^-?mt-(.+)$/)){const t=e.startsWith("-"),r=S[u[1]]??H(u[1]);if(r)return{"margin-top":t&&"0"!==r?`-${r}`:r}}if(u=e.match(/^-?mr-(.+)$/)){const t=e.startsWith("-"),r=S[u[1]]??H(u[1]);if(r)return{"margin-right":t&&"0"!==r?`-${r}`:r}}if(u=e.match(/^-?mb-(.+)$/)){const t=e.startsWith("-"),r=S[u[1]]??H(u[1]);if(r)return{"margin-bottom":t&&"0"!==r?`-${r}`:r}}if(u=e.match(/^-?ml-(.+)$/)){const t=e.startsWith("-"),r=S[u[1]]??H(u[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(u=e.match(/^gap-(.+)$/)){const e=S[u[1]]??H(u[1]);if(e)return{gap:e}}if(u=e.match(/^gap-x-(.+)$/)){const e=S[u[1]]??H(u[1]);if(e)return{"column-gap":e}}if(u=e.match(/^gap-y-(.+)$/)){const e=S[u[1]]??H(u[1]);if(e)return{"row-gap":e}}if(u=e.match(/^w-(.+)$/)){const e=u[1],t=S[e]??M[e]??H(e);if(t)return{width:t}}if(u=e.match(/^min-w-(.+)$/)){const e=S[u[1]]??H(u[1]);if(e)return{"min-width":e}}if(u=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"}[u[1]]??S[u[1]]??H(u[1]);if(e)return{"max-width":e}}if(u=e.match(/^h-(.+)$/)){const e=u[1],t=C[e]??M[e]??H(e);if(t)return{height:t}}if(u=e.match(/^min-h-(.+)$/)){const e={0:"0",full:"100%",screen:"100vh",svh:"100svh",dvh:"100dvh"}[u[1]]??S[u[1]]??H(u[1]);if(e)return{"min-height":e}}if(u=e.match(/^max-h-(.+)$/)){const e=C[u[1]]??H(u[1]);if(e)return{"max-height":e}}if(u=e.match(/^size-(.+)$/)){const e=S[u[1]]??M[u[1]]??H(u[1]);if(e)return{width:e,height:e}}if(u=e.match(/^text-(xs|sm|base|lg|[2-9]xl|\d+xl)$/)){const[e,t]=j[u[1]]??["1rem","1.5rem"];return{"font-size":e,"line-height":t}}if(u=e.match(/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black|\d+)$/))return{"font-weight":R[u[1]]??u[1]};if(u=e.match(/^leading-(.+)$/)){const e=W[u[1]]??H(u[1]);if(e)return{"line-height":e}}if(u=e.match(/^tracking-(.+)$/)){const e=B[u[1]]??H(u[1]);if(e)return{"letter-spacing":e}}const f={"text-left":"left","text-center":"center","text-right":"right","text-justify":"justify","text-start":"start","text-end":"end"};if(f[e])return{"text-align":f[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(u=e.match(/^indent-(.+)$/)){const e=S[u[1]]??H(u[1]);if(e)return{"text-indent":e}}if(u=e.match(/^line-clamp-(\d+)$/))return{overflow:"hidden",display:"-webkit-box","-webkit-line-clamp":u[1],"-webkit-box-orient":"vertical"};if(u=e.match(/^text-(.+)$/)){const[e,t]=u[1].split("/"),r=O(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(u=e.match(/^bg-(.+)$/)){const[e,t]=u[1].split("/"),r=O(e);return t?{"background-color":r,opacity:String(parseInt(t)/100)}:"none"===e?{background:"none"}:{"background-color":r}}if(u=e.match(/^border-color-(.+)$/))return{"border-color":O(u[1])};if(u=e.match(/^fill-(.+)$/))return{fill:O(u[1])};if(u=e.match(/^stroke-(.+)$/))return{stroke:O(u[1])};if(u=e.match(/^shadow-color-(.+)$/))return{"--tkx-shadow-color":O(u[1])};if(u=e.match(/^ring-color-(.+)$/))return{"--tkx-ring-color":O(u[1])};if(u=e.match(/^accent-(.+)$/))return{"accent-color":O(u[1])};if(u=e.match(/^caret-(.+)$/))return{"caret-color":O(u[1])};if(u=e.match(/^outline-color-(.+)$/))return{"outline-color":O(u[1])};if("border"===e)return{"border-width":"1px"};if(u=e.match(/^border-(\d+)$/))return{"border-width":`${u[1]}px`};if("border-t"===e)return{"border-top-width":"1px"};if(u=e.match(/^border-t-(\d+)$/))return{"border-top-width":`${u[1]}px`};if("border-r"===e)return{"border-right-width":"1px"};if(u=e.match(/^border-r-(\d+)$/))return{"border-right-width":`${u[1]}px`};if("border-b"===e)return{"border-bottom-width":"1px"};if(u=e.match(/^border-b-(\d+)$/))return{"border-bottom-width":`${u[1]}px`};if("border-l"===e)return{"border-left-width":"1px"};if(u=e.match(/^border-l-(\d+)$/))return{"border-left-width":`${u[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((u=e.match(/^border-([a-zA-Z].*)$/))&&P.has(u[1]))return{"border-color":`var(--tkx-${u[1]})`};if(u=e.match(/^border-\[(.+)]$/))return{"border-color":u[1]};if("border-0"===e)return{"border-width":"0"};if("rounded"===e)return{"border-radius":T[""]};if(u=e.match(/^rounded-(none|sm|md|lg|xl|2xl|3xl|full|\[.+])$/))return{"border-radius":T[u[1]]??H(u[1])??u[1]};if(u=e.match(/^rounded-(t|r|b|l|tl|tr|br|bl)(?:-(none|sm|md|lg|xl|2xl|3xl|full))?$/)){const e=u[1],t=T[u[2]??""]??T[""];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 p={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((u=e.match(/^ring-(\d+)$/))&&p[u[1]])return{"box-shadow":`0 0 0 ${p[u[1]]} var(--tkx-ring-color,var(--tkx-primary))`};if("ring-inset"===e)return{"--tkx-ring-offset":"inset"};if(u=e.match(/^ring-offset-(\d+)$/))return{"--tkx-ring-offset-width":`${u[1]}px`,"box-shadow":`0 0 0 ${u[1]}px var(--tkx-bg)`};if("shadow"===e)return{"box-shadow":A[""]};if(u=e.match(/^shadow-(sm|md|lg|xl|2xl|inner|none)$/))return{"box-shadow":A[u[1]]};if(u=e.match(/^opacity-(\d+)$/)){const e=L[u[1]];if(void 0!==e)return{opacity:e}}if("bg-none"===e)return{background:"none"};const h={"bg-auto":"auto","bg-cover":"cover","bg-contain":"contain"};if(h[e])return{"background-size":h[e]};const g={"bg-center":"center","bg-top":"top","bg-bottom":"bottom","bg-left":"left","bg-right":"right"};if(g[e])return{"background-position":g[e]};const m={"bg-repeat":"repeat","bg-no-repeat":"no-repeat","bg-repeat-x":"repeat-x","bg-repeat-y":"repeat-y"};if(m[e])return{"background-repeat":m[e]};if("backdrop-blur"===e)return{"backdrop-filter":`blur(${F[""]})`};if(u=e.match(/^backdrop-blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{"backdrop-filter":`blur(${F[u[1]]})`};if("blur"===e)return{filter:`blur(${F[""]})`};if(u=e.match(/^blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{filter:`blur(${F[u[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 x={static:"static",relative:"relative",absolute:"absolute",fixed:"fixed",sticky:"sticky"};if(x[e])return{position:x[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(u=e.match(/^-?top-(.+)$/)){const t=e.startsWith("-"),r=S[u[1]]??M[u[1]]??H(u[1]);if(r)return{top:t&&"0"!==r?`-${r}`:r}}if(u=e.match(/^-?right-(.+)$/)){const t=e.startsWith("-"),r=S[u[1]]??M[u[1]]??H(u[1]);if(r)return{right:t&&"0"!==r?`-${r}`:r}}if(u=e.match(/^-?bottom-(.+)$/)){const t=e.startsWith("-"),r=S[u[1]]??M[u[1]]??H(u[1]);if(r)return{bottom:t&&"0"!==r?`-${r}`:r}}if(u=e.match(/^-?left-(.+)$/)){const t=e.startsWith("-"),r=S[u[1]]??M[u[1]]??H(u[1]);if(r)return{left:t&&"0"!==r?`-${r}`:r}}const b={0:"0",10:"10",20:"20",30:"30",40:"40",50:"50",100:"100",1e3:"1000",9e3:"9000",auto:"auto"};if(u=e.match(/^z-(.+)$/)){const e=b[u[1]]??H(u[1]);if(e)return{"z-index":e}}const y={"overflow-auto":"auto","overflow-hidden":"hidden","overflow-visible":"visible","overflow-scroll":"scroll","overflow-clip":"clip"};if(y[e])return{overflow:y[e]};if(u=e.match(/^overflow-(x|y)-(auto|hidden|visible|scroll|clip)$/))return{[`overflow-${u[1]}`]:u[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 v={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(u=e.match(/^scale-(.+)$/)){const e=v[u[1]]??H(u[1]);if(e)return{transform:`scale(${e})`}}if(u=e.match(/^scale-x-(.+)$/)){const e=v[u[1]]??H(u[1]);if(e)return{transform:`scaleX(${e})`}}if(u=e.match(/^scale-y-(.+)$/)){const e=v[u[1]]??H(u[1]);if(e)return{transform:`scaleY(${e})`}}const k={0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"};if(u=e.match(/^-?rotate-(.+)$/)){const t=e.startsWith("-"),r=k[u[1]]??H(u[1]);if(r)return{transform:t?`rotate(-${r})`:`rotate(${r})`}}if(u=e.match(/^-?translate-x-(.+)$/)){const t=e.startsWith("-"),r=S[u[1]]??M[u[1]]??H(u[1]);if(r)return{transform:`translateX(${t&&"0"!==r?`-${r}`:r})`}}if(u=e.match(/^-?translate-y-(.+)$/)){const t=e.startsWith("-"),r=S[u[1]]??M[u[1]]??H(u[1]);if(r)return{transform:`translateY(${t&&"0"!==r?`-${r}`:r})`}}if(u=e.match(/^-?skew-x-(.+)$/)){const t=e.startsWith("-"),r=H(u[1])??`${u[1]}deg`;return{transform:t?`skewX(-${r})`:`skewX(${r})`}}if(u=e.match(/^-?skew-y-(.+)$/)){const t=e.startsWith("-"),r=H(u[1])??`${u[1]}deg`;return{transform:t?`skewY(-${r})`:`skewY(${r})`}}const $={"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($[e])return{"transform-origin":$[e]};const z={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(z[e])return{"transition-property":z[e],"transition-timing-function":"cubic-bezier(0.4,0,0.2,1)","transition-duration":"150ms"};const _={75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"};if(u=e.match(/^duration-(.+)$/)){const e=_[u[1]]??H(u[1]);if(e)return{"transition-duration":e}}if(u=e.match(/^delay-(.+)$/)){const e=_[u[1]]??H(u[1]);if(e)return{"transition-delay":e}}const E={"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(E[e])return{"transition-timing-function":E[e]};const Z={"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(Z[e])return{animation:Z[e]};const N={"object-contain":"contain","object-cover":"cover","object-fill":"fill","object-none":"none","object-scale-down":"scale-down"};return N[e]?{"object-fit":N[e]}:"aspect-square"===e?{"aspect-ratio":"1 / 1"}:"aspect-video"===e?{"aspect-ratio":"16 / 9"}:"aspect-auto"===e?{"aspect-ratio":"auto"}:(u=e.match(/^aspect-\[(.+)]$/))?{"aspect-ratio":u[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"}:(u=e.match(/^columns-(\d+)$/))?{columns:u[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"}:(u=e.match(/^will-change-(.+)$/))?{"will-change":u[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"}:(u=e.match(/^\[(--[a-zA-Z0-9-]+):(.+)]$/))?{[u[1]]:u[2]}:function(e){for(const t of ee.values())if(t[e])return t[e];return null}(e)||null}function N(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 Y(e,t){for(const[r,n]of Object.entries(t))e[r]=n}function Q(e){return Object.entries(e).map(([e,t])=>`${e}:${t}`).join(";")}var U=/* @__PURE__ */new Map,X=null,G=null;function J(){return X&&X.isConnected||(X=document.getElementById("tkx-atomic"))||((X=document.createElement("style")).id="tkx-atomic",document.head.appendChild(X)),X}function V(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(...V(r));else if("object"==typeof r)for(const[e,n]of Object.entries(r))n&&t.push(e);return t}function K(...e){const t=V(e);if(0===t.length)return"";const r={base:{},variants:{}};for(const l of t){const{variant:e,utility:t}=N(l),n=Z(t);n&&(e?(r.variants[e]||(r.variants[e]={}),Y(r.variants[e],n)):Y(r.base,n))}const n=[],o=Q(r.base),i=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")}([o,...Object.entries(r.variants).map(([e,t])=>`${e}{${Q(t)}}`)].join("|")),a=`tkx-${i}`;o&&n.push(`.${a}{${o}}`);for(const[l,s]of Object.entries(r.variants)){const e=Q(s);if(e)if(l.startsWith("@")){const t=_[l.slice(1)];t&&n.push(`@media(min-width:${t}){.${a}{${e}}}`)}else if("motion-safe"===l)n.push(`@media(prefers-reduced-motion:no-preference){.${a}{${e}}}`);else if("motion-reduce"===l)n.push(`@media(prefers-reduced-motion:reduce){.${a}{${e}}}`);else if("contrast-more"===l)n.push(`@media(prefers-contrast:more){.${a}{${e}}}`);else if("forced-colors"===l)n.push(`@media(forced-colors:active){.${a}{${e}}}`);else if("dark"===l)n.push(`@media(prefers-color-scheme:dark){.${a}{${e}}}`);else if("print"===l)n.push(`@media print{.${a}{${e}}}`);else if("group-hover"===l)n.push(`.group:hover .${a}{${e}}`);else if("group-focus"===l)n.push(`.group:focus-within .${a}{${e}}`);else if("peer-hover"===l)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"}[l]??`:${l}`;n.push(`.${a}${t}{${e}}`)}}return n.length>0&&function(e,t){if(U.has(e))return;if(U.set(e,t),"undefined"==typeof document)return;const r=function(){if(G)return G;try{const e=new CSSStyleSheet;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,e],G=e,e}catch{return null}}();if(r){const e=function(e){const t=[];let r=0,n=0;for(let o=0;o<e.length;o++)if("{"===e[o])r++;else if("}"===e[o]&&(r--,0===r)){const r=e.slice(n,o+1).trim();r&&t.push(r),n=o+1}return t}(t);for(const t of e)try{r.insertRule(t,r.cssRules.length)}catch{J().textContent+=t+"\n"}}else J().textContent+=t+"\n"}(i,n.join("")),a}var ee=/* @__PURE__ */new Map;function te(e){return e?{primary:"#00f5d4",secondary:"#7b2ff7",background:"#0a0a0f",surface:"#12121a",text:"#e8e8f4",textMuted:"#8888aa",border:"#2a2a3e",error:"#f87171",warning:"#fbbf24",success:"#34d399",accent:"#ff6b6b"}:{primary:"#0d7c5f",secondary:"#6930c3",background:"#f8f6f1",surface:"#ffffff",text:"#1a1815",textMuted:"#6b6560",border:"#ddd8cc",error:"#dc2626",warning:"#d97706",success:"#059669",accent:"#e05a00"}}function re({points:e,primary:t}){if(e.length<2)/* @__PURE__ */return l("div",{style:{height:48,display:"flex",alignItems:"center",justifyContent:"center",color:"#888",fontSize:12},children:"Waiting for data..."});const r=Math.max(...e.map(e=>e.energy)),n=Math.min(...e.map(e=>e.energy)),o=r-n||1,i=e[e.length-1].iteration||1;/* @__PURE__ */
2
+ return s("svg",{width:280,height:48,style:{display:"block"},children:[
3
+ /* @__PURE__ */l("polyline",{points:e.map(e=>{const t=e.iteration/i*280,r=48-(e.energy-n)/o*44-2;return`${t.toFixed(1)},${r.toFixed(1)}`}).join(" "),fill:"none",stroke:t,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",opacity:.9}),
4
+ /* @__PURE__ */s("text",{x:2,y:10,fontSize:9,fill:"#888",children:["E=",r.toFixed(1)]}),
5
+ /* @__PURE__ */s("text",{x:2,y:46,fontSize:9,fill:"#888",children:["E=",n.toFixed(1)]})]})}function ne({label:e,value:t,onChange:r,text:n,border:o}){/* @__PURE__ */
6
+ return s("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[
7
+ /* @__PURE__ */l("input",{type:"color",value:t,onChange:e=>r(e.target.value),style:{width:32,height:32,border:`1px solid ${o}`,borderRadius:6,padding:2,cursor:"pointer",background:"transparent"}}),
8
+ /* @__PURE__ */l("div",{style:{width:60,height:28,borderRadius:6,background:t,border:`1px solid ${o}`}}),
9
+ /* @__PURE__ */l("span",{style:{flex:1,fontSize:13,color:n,fontFamily:"monospace"},children:e}),
10
+ /* @__PURE__ */l("code",{style:{fontSize:12,color:n,opacity:.7,fontFamily:"monospace"},children:t})]})}function oe({label:e,ratio:t}){const r=t>=4.5,n=t>=4.5,o=t>=7;/* @__PURE__ */
11
+ return s("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[
12
+ /* @__PURE__ */l("span",{style:{fontSize:11,opacity:.8,minWidth:140},children:e}),
13
+ /* @__PURE__ */s("span",{style:{fontSize:12,fontWeight:600},children:[t.toFixed(2),":1"]}),
14
+ /* @__PURE__ */l("span",{style:{fontSize:11,color:n?"#22c55e":"#ef4444"},children:n?"✓ AA":"✗ AA"}),
15
+ /* @__PURE__ */l("span",{style:{fontSize:11,color:o?"#22c55e":"#888"},children:o?" AAA":" AAA"}),
16
+ /* @__PURE__ */l("span",{style:{fontSize:13},children:r?"✅":"❌"})]})}function ie({onThemeChange:e,initialHue:t=210,initialMode:n="dark"}){const o=c(),[d,u]=a(n),[f,p]=a(t),[h,g]=a(()=>te("dark"===n)),[m,x]=a(!1),[b,y]=a([]),[w,v]=a(!1),k=i(null),$="dark"===d,S=r((t,r)=>{g(n=>{const o={...n,[t]:r};return e?.(o),o})},[e]),C=r(()=>{if(m)return;x(!0),y([]);let t=0;const r=[],n=()=>{t+=60,z.optimizeTheme(f,$,t);const o=t/600,i=50*(1-o)+2,a=8*(Math.random()-.5)*(1-.8*o);if(r.push({iteration:t,energy:Math.max(0,i+a)}),y([...r]),t<600)k.current=window.setTimeout(n,40);else{const t=z.optimizeTheme(f,$,1e3);g(t),e?.(t),x(!1)}};k.current=window.setTimeout(n,16)},[f,$,m,e]),M=r(()=>{const t="dark"===d?"light":"dark";u(t);const r=te("dark"===t);g(r),e?.(r)},[d,e]),T=r(()=>{const e=`export const myTheme = {\n${Object.entries(h).map(([e,t])=>` ${e}: '${t}',`).join("\n")}\n};`;"undefined"!=typeof navigator&&navigator.clipboard&&navigator.clipboard.writeText(e).then(()=>{v(!0),setTimeout(()=>v(!1),2e3)})},[h]),A=[{label:"Text on Background",fg:h.text,bg:h.background},{label:"Text on Surface",fg:h.text,bg:h.surface},{label:"Primary on Background",fg:h.primary,bg:h.background},{label:"TextMuted on Background",fg:h.textMuted,bg:h.background}],j="linear-gradient(to right,"+["hsl(0,80%,55%)","hsl(30,80%,55%)","hsl(60,80%,55%)","hsl(90,80%,55%)","hsl(120,80%,55%)","hsl(150,80%,55%)","hsl(180,80%,55%)","hsl(210,80%,55%)","hsl(240,80%,55%)","hsl(270,80%,55%)","hsl(300,80%,55%)","hsl(330,80%,55%)","hsl(360,80%,55%)"].join(",")+")",R={fontFamily:"system-ui, -apple-system, sans-serif",background:h.background,color:h.text,border:`1px solid ${h.border}`,borderRadius:12,padding:20,maxWidth:900,display:"grid",gridTemplateColumns:"1fr 1fr",gap:20},W={background:h.surface,border:`1px solid ${h.border}`,borderRadius:8,padding:16},B={fontSize:13,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.08em",color:h.primary,marginBottom:12,marginTop:0},F={padding:"8px 16px",borderRadius:8,border:"none",cursor:"pointer",fontWeight:600,fontSize:13,transition:"opacity 0.15s"},L=K;/* @__PURE__ */
17
+ return s("div",{style:R,children:[
18
+ /* @__PURE__ */s("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[
19
+ /* @__PURE__ */s("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gridColumn:"1/-1"},children:[/* @__PURE__ */s("div",{children:[/* @__PURE__ */l("h2",{style:{margin:0,fontSize:18,fontWeight:700},children:"Theme Builder"}),/* @__PURE__ */l("p",{style:{margin:"2px 0 0",fontSize:12,color:h.textMuted},children:"Quantum-powered color optimization"})]}),/* @__PURE__ */l("button",{onClick:M,style:{...F,background:h.surface,color:h.text,border:`1px solid ${h.border}`},children:$?"☀ Light":"🌙 Dark"})]}),
20
+ /* @__PURE__ */s("div",{style:W,children:[/* @__PURE__ */l("p",{style:B,children:"Base Hue"}),/* @__PURE__ */s("div",{style:{display:"flex",alignItems:"center",gap:10},children:[
21
+ /* @__PURE__ */l("div",{style:{width:24,height:24,borderRadius:"50%",background:`hsl(${f},70%,55%)`,border:`2px solid ${h.border}`,flexShrink:0}}),
22
+ /* @__PURE__ */l("input",{type:"range",min:0,max:360,value:f,onChange:e=>p(Number(e.target.value)),style:{flex:1,height:16,borderRadius:8,background:j,outline:"none",border:"none",cursor:"pointer",appearance:"none",WebkitAppearance:"none"}}),
23
+ /* @__PURE__ */s("span",{style:{fontSize:13,fontFamily:"monospace",minWidth:32},children:[f,"°"]})]})]}),
24
+ /* @__PURE__ */s("div",{style:W,children:[/* @__PURE__ */s("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:10},children:[/* @__PURE__ */l("button",{onClick:C,disabled:m,style:{...F,background:m?h.border:h.primary,color:$?"#000":"#fff",opacity:m?.7:1,flex:1},children:m?"⟳ Optimizing...":"⚛ Generate with Quantum Annealing"}),/* @__PURE__ */l("div",{style:{padding:"3px 8px",background:h.primary+"22",border:`1px solid ${h.primary}44`,borderRadius:20,fontSize:10,color:h.primary,fontWeight:700,whiteSpace:"nowrap"},children:"⚛ Quantum Annealing"})]}),(m||b.length>0)&&/* @__PURE__ */s("div",{children:[/* @__PURE__ */l("p",{style:{fontSize:11,color:h.textMuted,margin:"0 0 4px"},children:"Energy landscape (lower = better palette)"}),/* @__PURE__ */l(re,{points:b,primary:h.primary})]})]}),
25
+ /* @__PURE__ */s("div",{style:W,children:[/* @__PURE__ */l("p",{style:B,children:"Color Tokens"}),Object.keys(h).map(e=>/* @__PURE__ */l(ne,{label:e,value:h[e],onChange:t=>S(e,t),text:h.text,border:h.border},e))]}),
26
+ /* @__PURE__ */l("button",{onClick:T,style:{...F,background:h.accent,color:"#fff",width:"100%"},children:w?"✓ Copied to Clipboard!":"⬇ Export Theme"})]}),
27
+ /* @__PURE__ */s("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[
28
+ /* @__PURE__ */s("div",{style:W,children:[
29
+ /* @__PURE__ */l("p",{style:B,children:"Live Preview"}),
30
+ /* @__PURE__ */s("div",{style:{marginBottom:12},children:[/* @__PURE__ */l("p",{style:{fontSize:11,color:h.textMuted,margin:"0 0 6px"},children:"Buttons"}),/* @__PURE__ */s("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[
31
+ /* @__PURE__ */l("button",{style:{padding:"8px 16px",borderRadius:8,border:"none",background:h.primary,color:$?"#000":"#fff",fontWeight:600,fontSize:13,cursor:"pointer"},children:"Primary"}),
32
+ /* @__PURE__ */l("button",{style:{padding:"8px 16px",borderRadius:8,border:"none",background:h.secondary,color:"#fff",fontWeight:600,fontSize:13,cursor:"pointer"},children:"Secondary"}),
33
+ /* @__PURE__ */l("button",{style:{padding:"8px 16px",borderRadius:8,border:`1px solid ${h.border}`,background:"transparent",color:h.text,fontWeight:600,fontSize:13,cursor:"pointer"},children:"Outline"})]})]}),
34
+ /* @__PURE__ */s("div",{style:{marginBottom:12},children:[/* @__PURE__ */l("p",{style:{fontSize:11,color:h.textMuted,margin:"0 0 6px"},children:"Card"}),/* @__PURE__ */s("div",{style:{background:h.surface,border:`1px solid ${h.border}`,borderRadius:8,padding:12},children:[
35
+ /* @__PURE__ */l("div",{style:{fontSize:14,fontWeight:700,marginBottom:4},children:"Card Title"}),
36
+ /* @__PURE__ */l("div",{style:{fontSize:12,color:h.textMuted,lineHeight:1.4},children:"Sample card with surface background and muted text content."}),
37
+ /* @__PURE__ */s("div",{style:{marginTop:8,display:"flex",gap:6},children:[/* @__PURE__ */l("span",{style:{padding:"2px 8px",borderRadius:20,background:h.primary+"33",color:h.primary,fontSize:11,fontWeight:600},children:"Tag"}),/* @__PURE__ */l("span",{style:{padding:"2px 8px",borderRadius:20,background:h.accent+"33",color:h.accent,fontSize:11,fontWeight:600},children:"Accent"})]})]})]}),
38
+ /* @__PURE__ */s("div",{style:{marginBottom:12},children:[/* @__PURE__ */l("p",{style:{fontSize:11,color:h.textMuted,margin:"0 0 6px"},children:"Input"}),/* @__PURE__ */l("input",{type:"text",placeholder:"Type something...",readOnly:!0,style:{width:"100%",padding:"8px 12px",borderRadius:8,border:`1px solid ${h.border}`,background:h.background,color:h.text,fontSize:13,outline:"none",boxSizing:"border-box"}})]}),
39
+ /* @__PURE__ */s("div",{style:{marginBottom:12},children:[/* @__PURE__ */l("p",{style:{fontSize:11,color:h.textMuted,margin:"0 0 6px"},children:"Progress"}),/* @__PURE__ */l("div",{style:{height:8,borderRadius:4,background:h.border,overflow:"hidden"},children:/* @__PURE__ */l("div",{style:{height:"100%",width:"68%",background:`linear-gradient(to right, ${h.primary}, ${h.accent})`,borderRadius:4,transition:"width 0.4s ease"}})})]}),
40
+ /* @__PURE__ */s("div",{children:[/* @__PURE__ */l("p",{style:{fontSize:11,color:h.textMuted,margin:"0 0 6px"},children:"Status Badges"}),/* @__PURE__ */l("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[{label:"Error",color:h.error},{label:"Warning",color:h.warning},{label:"Success",color:h.success}].map(({label:e,color:t})=>/* @__PURE__ */l("span",{style:{padding:"3px 10px",borderRadius:4,background:t+"22",color:t,border:`1px solid ${t}44`,fontSize:11,fontWeight:700},children:e},e))})]})]}),
41
+ /* @__PURE__ */s("div",{style:W,children:[
42
+ /* @__PURE__ */l("p",{style:B,children:"WCAG Contrast Check"}),A.map(e=>/* @__PURE__ */l(oe,{label:e.label,ratio:z.contrast(e.fg,e.bg)},e.label)),
43
+ /* @__PURE__ */l("p",{style:{fontSize:10,color:h.textMuted,marginTop:8,marginBottom:0},children:"AA requires 4.5:1 (normal text). AAA requires 7:1."})]}),
44
+ /* @__PURE__ */s("div",{style:W,children:[/* @__PURE__ */l("p",{style:B,children:"Color Palette"}),/* @__PURE__ */l("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:Object.entries(h).map(([e,t])=>/* @__PURE__ */l("div",{title:`${e}: ${t}`,style:{width:36,height:36,borderRadius:6,background:t,border:`2px solid ${h.border}`,cursor:"default",flexShrink:0}},e))})]})]}),"function"==typeof L&&null,"string"==typeof o.bg&&null]})}var ae=["fetch(","XMLHttpRequest","navigator.sendBeacon","document.cookie","localStorage","sessionStorage","indexedDB","WebSocket","EventSource","import(","eval(","new Function(","postMessage","window.open","location.href","location.replace","location.assign","document.write","crypto.subtle"],le=[{label:"Hello World",code:"<div style={{ padding: 24, fontFamily: 'sans-serif', color: '#e8e8f4' }}>\n <h2 style={{ margin: 0 }}>👋 Hello, TkxPlayground!</h2>\n <p style={{ marginTop: 8, opacity: 0.7 }}>Edit the code on the left to see live updates.</p>\n</div>"},{label:"Button Styles",code:"<div style={{ display: 'flex', gap: 12, flexWrap: 'wrap', padding: 24 }}>\n {['primary', 'success', 'danger', 'warning', 'info'].map(color => (\n <button\n key={color}\n style={{\n padding: '8px 18px',\n borderRadius: 8,\n border: 'none',\n background: color === 'primary' ? '#00f5d4' : color === 'success' ? '#06d6a0' : color === 'danger' ? '#f72585' : color === 'warning' ? '#ffbe0b' : '#3a86ff',\n color: '#0a0a0f',\n fontWeight: 700,\n cursor: 'pointer',\n textTransform: 'capitalize',\n }}\n >\n {color}\n </button>\n ))}\n</div>"},{label:"Card Grid",code:"<div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 16, padding: 24 }}>\n {['Alpha', 'Beta', 'Gamma', 'Delta', 'Epsilon', 'Zeta'].map(name => (\n <div key={name} style={{\n background: '#1a1a2e',\n borderRadius: 10,\n border: '1px solid #2a2a3e',\n padding: '16px',\n }}>\n <div style={{ fontWeight: 700, color: '#00f5d4', marginBottom: 4 }}>{name}</div>\n <div style={{ fontSize: 12, color: '#8888aa' }}>Quantum module {name.toLowerCase()}</div>\n </div>\n ))}\n</div>"},{label:"Animated Counter",code:"(() => {\n const [count, setCount] = React.useState(0);\n return (\n <div style={{ padding: 32, textAlign: 'center', fontFamily: 'sans-serif' }}>\n <div style={{ fontSize: 64, fontWeight: 900, color: '#00f5d4', marginBottom: 16 }}>\n {count}\n </div>\n <div style={{ display: 'flex', gap: 12, justifyContent: 'center' }}>\n <button onClick={() => setCount(c => c - 1)} style={{ padding: '8px 20px', borderRadius: 8, border: '1px solid #2a2a3e', background: '#1a1a2e', color: '#e8e8f4', fontSize: 20, cursor: 'pointer' }}>−</button>\n <button onClick={() => setCount(0)} style={{ padding: '8px 20px', borderRadius: 8, border: '1px solid #2a2a3e', background: '#1a1a2e', color: '#8888aa', cursor: 'pointer' }}>Reset</button>\n <button onClick={() => setCount(c => c + 1)} style={{ padding: '8px 20px', borderRadius: 8, border: '1px solid #2a2a3e', background: '#1a1a2e', color: '#e8e8f4', fontSize: 20, cursor: 'pointer' }}>+</button>\n </div>\n </div>\n );\n})()"},{label:"Data Table",code:"(() => {\n const rows = [\n { id: 1, name: 'Hydrogen', symbol: 'H', mass: 1.008 },\n { id: 2, name: 'Helium', symbol: 'He', mass: 4.003 },\n { id: 3, name: 'Lithium', symbol: 'Li', mass: 6.941 },\n { id: 4, name: 'Carbon', symbol: 'C', mass: 12.011 },\n { id: 5, name: 'Nitrogen', symbol: 'N', mass: 14.007 },\n ];\n const cell = { padding: '8px 14px', borderBottom: '1px solid #2a2a3e', color: '#e8e8f4', fontSize: 13 };\n const hcell = { ...cell, color: '#8888aa', fontWeight: 600, fontSize: 11, textTransform: 'uppercase', letterSpacing: '0.06em' };\n return (\n <div style={{ padding: 16 }}>\n <table style={{ width: '100%', borderCollapse: 'collapse', fontFamily: 'sans-serif' }}>\n <thead>\n <tr>{['ID','Element','Symbol','Atomic Mass'].map(h => <th key={h} style={hcell}>{h}</th>)}</tr>\n </thead>\n <tbody>\n {rows.map(r => (\n <tr key={r.id} style={{ transition: 'background 0.15s' }}>\n <td style={cell}>{r.id}</td>\n <td style={cell}>{r.name}</td>\n <td style={{ ...cell, color: '#00f5d4', fontWeight: 700 }}>{r.symbol}</td>\n <td style={cell}>{r.mass}</td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n})()"}],se=class extends e.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){this.props.onError(e.message)}componentDidUpdate(e){e.children!==this.props.children&&this.state.hasError&&this.setState({hasError:!1})}render(){return this.state.hasError?null:this.props.children}};function de({code:e,lineHeight:t}){const r=e.split("\n");/* @__PURE__ */
45
+ return l("div",{"aria-hidden":"true",style:{position:"absolute",top:0,left:0,width:"36px",padding:"12px 0",textAlign:"right",paddingRight:"8px",userSelect:"none",pointerEvents:"none",fontSize:"12px",lineHeight:`${t}px`,color:"#555577",fontFamily:'"Fira Code", "Cascadia Code", "Consolas", monospace',boxSizing:"border-box"},children:r.map((e,t)=>/* @__PURE__ */l("div",{children:t+1},t))})}var ce=["TkxButton","TkxInput","TkxCard","TkxModal","TkxTable","TkxSelect","TkxCheckbox","TkxRadio","TkxSwitch","TkxSlider","TkxBadge","TkxAlert","TkxToast","TkxTooltip","TkxPopover","TkxTabs","TkxAccordion","TkxDrawer","TkxDropdown","TkxMenu","TkxForm","TkxDataGrid","TkxChart","TkxSpinner","TkxSkeleton","TkxAvatar","TkxTag","TkxDivider","TkxProgress","TkxStatistic","TkxQuantumForm","TkxPlayground"],ue=new m;function fe(e){const t=e.match(/([A-Z][a-zA-Z0-9]*)$/);return t?t[1]:""}function pe({defaultCode:t,examples:n,height:d=480,imports:u={},strictMode:f=!0,forbiddenTokens:p}){const h=c(),g=[...le,...n??[]],m=t??le[0].code,[x,b]=a(m),[y,w]=a({element:null,error:null,renderMs:0}),[v,k]=a(null),[$,z]=a([]),[S,C]=a(!1),[M,T]=a(0),A=i(null),j=i(null),R=r(t=>{k(null),w(function(t,r,n){const o=performance.now();try{const i=t.trim();if(!1!==n?.strictMode){const e=function(e,t){const r=[...ae,...t??[]],n=e.toLowerCase();for(const o of r)if(n.includes(o.toLowerCase()))return o;return null}(i,n?.forbiddenTokens);if(e)return{element:null,error:`Blocked by playground strictMode: code contains "${e}". This token is disallowed because playground snippets run in the page's JavaScript context. If you trust the source, pass strictMode={false} to <TkxPlayground>.`,renderMs:parseFloat((performance.now()-o).toFixed(2))}}let a=`\n function PlaygroundRoot() {\n ${i.startsWith("<")||i.startsWith("(")?`return (${i});`:i}\n }\n `;const l="undefined"==typeof window?null:window.Babel??null;l&&(a=l.transform(a,{presets:["react"],filename:"playground.jsx"}).code??a);const s=new Function("React","imports",`\n "use strict";\n const { ${Object.keys(r).join(", ")} } = imports;\n ${a}\n return PlaygroundRoot;\n `)(e,r);return{element:e.createElement(s),error:null,renderMs:parseFloat((performance.now()-o).toFixed(2))}}catch(i){const e=parseFloat((performance.now()-o).toFixed(2));return{element:null,error:i instanceof Error?i.message:String(i),renderMs:e}}}(t,u,{strictMode:f,forbiddenTokens:p}))},[u,f,p]);o(()=>(j.current&&clearTimeout(j.current),j.current=setTimeout(()=>R(x),300),()=>{j.current&&clearTimeout(j.current)}),[x,R]),o(()=>{R(m)},[]);const W=r(e=>{const t=e.target.value;b(t);const r=fe(t);r.length>=2?z(function(e,t=4){if(!e||e.length<2)return[];const r=e.toLowerCase();return ue.amplify(ce,e=>{const t=e.toLowerCase();if(t.startsWith(r))return 1;if(t.includes(r))return.7;let n=0;for(let o=0;o<r.length-1;o++)t.includes(r.slice(o,o+2))&&(n+=.15);return Math.min(n,.5)},.1).slice(0,t).map(e=>({name:ce[e.index]??"",amplitude:parseFloat(e.combined.toFixed(3))})).filter(e=>""!==e.name)}(r,4)):z([])},[]),B=r(e=>{const t=g[e];t&&(T(e),b(t.code),z([]))},[g]),F=r(async()=>{try{await navigator.clipboard.writeText(x),C(!0),setTimeout(()=>C(!1),1500)}catch{}},[x]),L=r(()=>{b(m),T(0),z([])},[m]),P=r(e=>{const t=fe(x);t&&b(r=>r.slice(0,r.lastIndexOf(t))+e),z([])},[x]),_=null!==y.error||null!==v,E=y.error??v??"",I=h.bg,D=h.surfaceAlt,q=h.border,H=h.surface,O={width:"50%",display:"flex",flexDirection:"column",borderRight:`1px solid ${q}`,position:"relative"},Z={display:"flex",alignItems:"center",gap:"6px",padding:"6px 10px",borderBottom:`1px solid ${q}`,backgroundColor:h.surface,flexWrap:"wrap"},N={padding:"3px 10px",borderRadius:"6px",border:`1px solid ${q}`,backgroundColor:"transparent",color:h.textMuted,fontSize:"11px",fontWeight:600,cursor:"pointer",fontFamily:"inherit",transition:"color 0.15s, border-color 0.15s"};/* @__PURE__ */
46
+ return s("div",{style:{display:"flex",flexDirection:"column",border:`1px solid ${q}`,borderRadius:"12px",overflow:"hidden",backgroundColor:I,fontFamily:"inherit",boxSizing:"border-box",position:"relative"},children:[
47
+ /* @__PURE__ */s("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 14px",borderBottom:`1px solid ${q}`,backgroundColor:h.surface},children:[/* @__PURE__ */l("span",{style:{fontSize:"12px",fontWeight:700,color:h.primary,letterSpacing:"0.05em"},children:"⚛ TkxPlayground"}),/* @__PURE__ */l("span",{style:{fontSize:"10px",color:h.textMuted},children:"Live JSX Preview"})]}),
48
+ /* @__PURE__ */l("div",{style:{display:"flex",gap:"4px",padding:"6px 10px",borderBottom:`1px solid ${q}`,backgroundColor:h.surface,overflowX:"auto"},children:g.map((e,t)=>/* @__PURE__ */l("button",{onClick:()=>B(t),style:{padding:"3px 10px",borderRadius:"6px",border:`1px solid ${t===M?h.primary:q}`,backgroundColor:t===M?`${h.primary}20`:"transparent",color:t===M?h.primary:h.textMuted,fontSize:"11px",fontWeight:t===M?700:400,cursor:"pointer",whiteSpace:"nowrap",fontFamily:"inherit",transition:"all 0.15s"},children:e.label},t))}),
49
+ /* @__PURE__ */s("div",{style:{display:"flex",height:`${d}px`},children:[/* @__PURE__ */s("div",{style:O,children:[
50
+ /* @__PURE__ */s("div",{style:Z,children:[
51
+ /* @__PURE__ */l("span",{style:{fontSize:"11px",color:h.textMuted,marginRight:"auto"},children:"editor.tsx"}),
52
+ /* @__PURE__ */l("button",{onClick:F,style:N,title:"Copy code",children:S?" Copied":" Copy"}),
53
+ /* @__PURE__ */l("button",{onClick:L,style:N,title:"Reset to default",children:" Reset"})]}),
54
+ /* @__PURE__ */s("div",{style:{position:"relative",flex:1,overflow:"hidden"},children:[/* @__PURE__ */l(de,{code:x,lineHeight:18}),/* @__PURE__ */l("textarea",{ref:A,value:x,onChange:W,spellCheck:!1,autoCorrect:"off",autoCapitalize:"off",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",padding:"12px 12px 12px 44px",margin:0,border:"none",outline:"none",resize:"none",backgroundColor:I,color:h.text,fontSize:"12px",lineHeight:"18px",fontFamily:'"Fira Code", "Cascadia Code", "Consolas", "Courier New", monospace',boxSizing:"border-box",overflowY:"auto",tabSize:2}})]}),$.length>0&&/* @__PURE__ */s("div",{style:{position:"absolute",bottom:"40px",left:"44px",zIndex:10,backgroundColor:h.surface,border:`1px solid ${h.primary}44`,borderRadius:"8px",overflow:"hidden",boxShadow:"0 4px 16px rgba(0,0,0,0.3)",minWidth:"180px"},children:[/* @__PURE__ */l("div",{style:{padding:"4px 10px 4px",fontSize:"10px",color:h.primary,fontWeight:700,borderBottom:`1px solid ${q}`,letterSpacing:"0.05em"},children:"⚛ Quantum Suggestions"}),$.map(e=>/* @__PURE__ */s("button",{onClick:()=>P(e.name),style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"6px 10px",border:"none",backgroundColor:"transparent",color:h.text,fontSize:"12px",fontFamily:'"Fira Code", monospace',cursor:"pointer",textAlign:"left",gap:"12px"},children:[/* @__PURE__ */l("span",{children:e.name}),/* @__PURE__ */s("span",{style:{fontSize:"10px",color:h.textMuted,flexShrink:0},children:[Math.round(100*e.amplitude),"%"]})]},e.name))]})]}),/* @__PURE__ */s("div",{style:{width:"50%",display:"flex",flexDirection:"column"},children:[/* @__PURE__ */l("div",{style:{padding:"6px 10px",borderBottom:`1px solid ${q}`,backgroundColor:h.surface,fontSize:"11px",color:h.textMuted,fontWeight:600},children:"Preview"}),/* @__PURE__ */l("div",{style:{flex:1,overflow:"auto",backgroundColor:D,position:"relative"},children:_?/* @__PURE__ */s("div",{style:{padding:"16px",color:h.danger,fontFamily:'"Fira Code", monospace',fontSize:"12px",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:[/* @__PURE__ */s("div",{style:{marginBottom:"8px",fontWeight:700,display:"flex",alignItems:"center",gap:"6px"},children:[/* @__PURE__ */l("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */l("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"})}),"Runtime Error"]}),E]}):/* @__PURE__ */l(se,{onError:k,children:/* @__PURE__ */l("div",{style:{minHeight:"100%"},children:y.element})})})]})]}),
55
+ /* @__PURE__ */s("div",{style:{display:"flex",alignItems:"center",gap:"16px",padding:"4px 12px",backgroundColor:H,borderTop:`1px solid ${q}`,fontSize:"11px",color:h.textMuted},children:[
56
+ /* @__PURE__ */s("span",{style:{display:"flex",alignItems:"center",gap:"4px",color:_?h.danger:h.success,fontWeight:600},children:[/* @__PURE__ */l("span",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:_?h.danger:h.success,display:"inline-block"}}),_?"Error":"OK"]}),
57
+ /* @__PURE__ */s("span",{children:[" ",y.renderMs," ms"]}),
58
+ /* @__PURE__ */s("span",{children:[x.split("\n").length," lines"]}),
59
+ /* @__PURE__ */s("span",{children:[x.length," chars"]}),$.length>0&&/* @__PURE__ */s("span",{style:{marginLeft:"auto",color:h.primary,fontWeight:600},children:[" ",$.length," suggestion",$.length>1?"s":""]})]})]})}pe.displayName="TkxPlayground";export{m as AmplitudeAmplifier,z as QuantumAI,h as QuantumAnnealer,g as QuantumBoltzmannMachine,p as QuantumRegister,f as Qubit,pe as TkxPlayground,ie as TkxThemeBuilder,y as hslToHex,b as inferFieldIntelligence,$ as optimizeThemeColors};