tekivex-ui 2.0.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 (173) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +201 -0
  3. package/dist/index.cjs +70 -0
  4. package/dist/index.d.ts +89 -0
  5. package/dist/index.d.ts.map +1 -0
  6. package/dist/index.js +11002 -0
  7. package/dist/src/a11y/index.d.ts +24 -0
  8. package/dist/src/a11y/index.d.ts.map +1 -0
  9. package/dist/src/components/TkxAccordion.d.ts +32 -0
  10. package/dist/src/components/TkxAccordion.d.ts.map +1 -0
  11. package/dist/src/components/TkxAlert.d.ts +14 -0
  12. package/dist/src/components/TkxAlert.d.ts.map +1 -0
  13. package/dist/src/components/TkxAvatar.d.ts +14 -0
  14. package/dist/src/components/TkxAvatar.d.ts.map +1 -0
  15. package/dist/src/components/TkxBadge.d.ts +12 -0
  16. package/dist/src/components/TkxBadge.d.ts.map +1 -0
  17. package/dist/src/components/TkxButton.d.ts +17 -0
  18. package/dist/src/components/TkxButton.d.ts.map +1 -0
  19. package/dist/src/components/TkxCard.d.ts +20 -0
  20. package/dist/src/components/TkxCard.d.ts.map +1 -0
  21. package/dist/src/components/TkxCarousel.d.ts +32 -0
  22. package/dist/src/components/TkxCarousel.d.ts.map +1 -0
  23. package/dist/src/components/TkxChat.d.ts +32 -0
  24. package/dist/src/components/TkxChat.d.ts.map +1 -0
  25. package/dist/src/components/TkxCheckbox.d.ts +13 -0
  26. package/dist/src/components/TkxCheckbox.d.ts.map +1 -0
  27. package/dist/src/components/TkxClock.d.ts +23 -0
  28. package/dist/src/components/TkxClock.d.ts.map +1 -0
  29. package/dist/src/components/TkxColorPicker.d.ts +18 -0
  30. package/dist/src/components/TkxColorPicker.d.ts.map +1 -0
  31. package/dist/src/components/TkxCommand.d.ts +34 -0
  32. package/dist/src/components/TkxCommand.d.ts.map +1 -0
  33. package/dist/src/components/TkxDatePicker.d.ts +47 -0
  34. package/dist/src/components/TkxDatePicker.d.ts.map +1 -0
  35. package/dist/src/components/TkxDivider.d.ts +8 -0
  36. package/dist/src/components/TkxDivider.d.ts.map +1 -0
  37. package/dist/src/components/TkxDrawer.d.ts +16 -0
  38. package/dist/src/components/TkxDrawer.d.ts.map +1 -0
  39. package/dist/src/components/TkxFileUpload.d.ts +16 -0
  40. package/dist/src/components/TkxFileUpload.d.ts.map +1 -0
  41. package/dist/src/components/TkxIcon.d.ts +16 -0
  42. package/dist/src/components/TkxIcon.d.ts.map +1 -0
  43. package/dist/src/components/TkxImage.d.ts +16 -0
  44. package/dist/src/components/TkxImage.d.ts.map +1 -0
  45. package/dist/src/components/TkxInput.d.ts +13 -0
  46. package/dist/src/components/TkxInput.d.ts.map +1 -0
  47. package/dist/src/components/TkxLogo.d.ts +21 -0
  48. package/dist/src/components/TkxLogo.d.ts.map +1 -0
  49. package/dist/src/components/TkxMenu.d.ts +64 -0
  50. package/dist/src/components/TkxMenu.d.ts.map +1 -0
  51. package/dist/src/components/TkxModal.d.ts +14 -0
  52. package/dist/src/components/TkxModal.d.ts.map +1 -0
  53. package/dist/src/components/TkxNumberInput.d.ts +32 -0
  54. package/dist/src/components/TkxNumberInput.d.ts.map +1 -0
  55. package/dist/src/components/TkxOTP.d.ts +24 -0
  56. package/dist/src/components/TkxOTP.d.ts.map +1 -0
  57. package/dist/src/components/TkxPagination.d.ts +19 -0
  58. package/dist/src/components/TkxPagination.d.ts.map +1 -0
  59. package/dist/src/components/TkxProgress.d.ts +13 -0
  60. package/dist/src/components/TkxProgress.d.ts.map +1 -0
  61. package/dist/src/components/TkxRadio.d.ts +22 -0
  62. package/dist/src/components/TkxRadio.d.ts.map +1 -0
  63. package/dist/src/components/TkxRating.d.ts +18 -0
  64. package/dist/src/components/TkxRating.d.ts.map +1 -0
  65. package/dist/src/components/TkxSelect.d.ts +37 -0
  66. package/dist/src/components/TkxSelect.d.ts.map +1 -0
  67. package/dist/src/components/TkxSkeleton.d.ts +12 -0
  68. package/dist/src/components/TkxSkeleton.d.ts.map +1 -0
  69. package/dist/src/components/TkxSlider.d.ts +33 -0
  70. package/dist/src/components/TkxSlider.d.ts.map +1 -0
  71. package/dist/src/components/TkxStepper.d.ts +31 -0
  72. package/dist/src/components/TkxStepper.d.ts.map +1 -0
  73. package/dist/src/components/TkxTable.d.ts +23 -0
  74. package/dist/src/components/TkxTable.d.ts.map +1 -0
  75. package/dist/src/components/TkxTabs.d.ts +32 -0
  76. package/dist/src/components/TkxTabs.d.ts.map +1 -0
  77. package/dist/src/components/TkxTag.d.ts +30 -0
  78. package/dist/src/components/TkxTag.d.ts.map +1 -0
  79. package/dist/src/components/TkxTimeline.d.ts +20 -0
  80. package/dist/src/components/TkxTimeline.d.ts.map +1 -0
  81. package/dist/src/components/TkxToast.d.ts +23 -0
  82. package/dist/src/components/TkxToast.d.ts.map +1 -0
  83. package/dist/src/components/TkxToggle.d.ts +11 -0
  84. package/dist/src/components/TkxToggle.d.ts.map +1 -0
  85. package/dist/src/components/TkxTooltip.d.ts +10 -0
  86. package/dist/src/components/TkxTooltip.d.ts.map +1 -0
  87. package/dist/src/components/TkxVideoPlayer.d.ts +43 -0
  88. package/dist/src/components/TkxVideoPlayer.d.ts.map +1 -0
  89. package/dist/src/components/index.d.ts +41 -0
  90. package/dist/src/components/index.d.ts.map +1 -0
  91. package/dist/src/engine/css.d.ts +24 -0
  92. package/dist/src/engine/css.d.ts.map +1 -0
  93. package/dist/src/engine/index.d.ts +10 -0
  94. package/dist/src/engine/index.d.ts.map +1 -0
  95. package/dist/src/engine/quantum.d.ts +47 -0
  96. package/dist/src/engine/quantum.d.ts.map +1 -0
  97. package/dist/src/engine/security.d.ts +54 -0
  98. package/dist/src/engine/security.d.ts.map +1 -0
  99. package/dist/src/engine/tkx.d.ts +29 -0
  100. package/dist/src/engine/tkx.d.ts.map +1 -0
  101. package/dist/src/engine/wcag.d.ts +34 -0
  102. package/dist/src/engine/wcag.d.ts.map +1 -0
  103. package/dist/src/hooks/index.d.ts +8 -0
  104. package/dist/src/hooks/index.d.ts.map +1 -0
  105. package/dist/src/themes/index.d.ts +26 -0
  106. package/dist/src/themes/index.d.ts.map +1 -0
  107. package/dist/style.css +1 -0
  108. package/dist/tests/TkxButton.test.d.ts +2 -0
  109. package/dist/tests/TkxButton.test.d.ts.map +1 -0
  110. package/dist/tests/a11y/components.test.d.ts +2 -0
  111. package/dist/tests/a11y/components.test.d.ts.map +1 -0
  112. package/dist/tests/quantum.test.d.ts +2 -0
  113. package/dist/tests/quantum.test.d.ts.map +1 -0
  114. package/dist/tests/security.test.d.ts +2 -0
  115. package/dist/tests/security.test.d.ts.map +1 -0
  116. package/dist/tests/setup.d.ts +2 -0
  117. package/dist/tests/setup.d.ts.map +1 -0
  118. package/dist/tests/tkx.test.d.ts +2 -0
  119. package/dist/tests/tkx.test.d.ts.map +1 -0
  120. package/dist/tests/wcag.test.d.ts +2 -0
  121. package/dist/tests/wcag.test.d.ts.map +1 -0
  122. package/package.json +78 -0
  123. package/src/a11y/index.tsx +87 -0
  124. package/src/components/TkxAccordion.tsx +588 -0
  125. package/src/components/TkxAlert.tsx +91 -0
  126. package/src/components/TkxAvatar.tsx +101 -0
  127. package/src/components/TkxBadge.tsx +73 -0
  128. package/src/components/TkxButton.tsx +153 -0
  129. package/src/components/TkxCard.tsx +92 -0
  130. package/src/components/TkxCarousel.tsx +552 -0
  131. package/src/components/TkxChat.tsx +354 -0
  132. package/src/components/TkxCheckbox.tsx +218 -0
  133. package/src/components/TkxClock.tsx +601 -0
  134. package/src/components/TkxColorPicker.tsx +633 -0
  135. package/src/components/TkxCommand.tsx +644 -0
  136. package/src/components/TkxDatePicker.tsx +1567 -0
  137. package/src/components/TkxDivider.tsx +49 -0
  138. package/src/components/TkxDrawer.tsx +234 -0
  139. package/src/components/TkxFileUpload.tsx +371 -0
  140. package/src/components/TkxIcon.tsx +683 -0
  141. package/src/components/TkxImage.tsx +277 -0
  142. package/src/components/TkxInput.tsx +101 -0
  143. package/src/components/TkxLogo.tsx +297 -0
  144. package/src/components/TkxMenu.tsx +1042 -0
  145. package/src/components/TkxModal.tsx +119 -0
  146. package/src/components/TkxNumberInput.tsx +408 -0
  147. package/src/components/TkxOTP.tsx +295 -0
  148. package/src/components/TkxPagination.tsx +388 -0
  149. package/src/components/TkxProgress.tsx +114 -0
  150. package/src/components/TkxRadio.tsx +284 -0
  151. package/src/components/TkxRating.tsx +286 -0
  152. package/src/components/TkxSelect.tsx +923 -0
  153. package/src/components/TkxSkeleton.tsx +105 -0
  154. package/src/components/TkxSlider.tsx +492 -0
  155. package/src/components/TkxStepper.tsx +485 -0
  156. package/src/components/TkxTable.tsx +148 -0
  157. package/src/components/TkxTabs.tsx +124 -0
  158. package/src/components/TkxTag.tsx +319 -0
  159. package/src/components/TkxTimeline.tsx +303 -0
  160. package/src/components/TkxToast.tsx +284 -0
  161. package/src/components/TkxToggle.tsx +93 -0
  162. package/src/components/TkxTooltip.tsx +69 -0
  163. package/src/components/TkxVideoPlayer.tsx +1013 -0
  164. package/src/components/index.ts +40 -0
  165. package/src/engine/css.ts +126 -0
  166. package/src/engine/index.ts +10 -0
  167. package/src/engine/quantum.ts +207 -0
  168. package/src/engine/security.ts +217 -0
  169. package/src/engine/tkx.ts +874 -0
  170. package/src/engine/wcag.ts +275 -0
  171. package/src/hooks/index.ts +120 -0
  172. package/src/styles/global.css +167 -0
  173. package/src/themes/index.ts +111 -0
package/dist/index.cjs ADDED
@@ -0,0 +1,70 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),t=require("react/jsx-runtime"),We=require("react-dom"),Qn=2166136261,eo=16777619;function tt(e){let r=Qn;for(let n=0;n<e.length;n++)r^=e.charCodeAt(n),r=Math.imul(r,eo)>>>0;return r.toString(16).padStart(8,"0")}class Kr{constructor(r=512){this.cache=new Map,this.hits=0,this.misses=0,this.ceiling=Math.min(r,512)}get(r){if(!this.cache.has(r)){this.misses++;return}this.hits++;const n=this.cache.get(r);return this.cache.delete(r),this.cache.set(r,n),n}set(r,n){this.cache.has(r)?this.cache.delete(r):this.cache.size>=this.ceiling&&this.cache.delete(this.cache.keys().next().value),this.cache.set(r,n)}has(r){return this.cache.has(r)}invalidate(r){r!==void 0?this.cache.delete(r):this.cache.clear()}get size(){return this.cache.size}get cacheHitRate(){const r=this.hits+this.misses;return r===0?0:this.hits/r*100}}const st=new Kr(512);function Xr(e,r){const n=st.get(e);if(n!==void 0)return n;const i=r();return st.set(e,i),i}const qr=[];let Vt=!1;const ft=[];let or=0,ot=0;function to(){const e=qr.splice(0),r=performance.now();for(const i of e)try{i()}catch{}const n=performance.now()-r;or+=n,ot++,ft.push({duration:n,timestamp:Date.now()}),ft.length>100&&ft.shift()}function Zr(e){qr.push(e),Vt||(Vt=!0,queueMicrotask(()=>{to(),Vt=!1}))}function ro(e){const r=e!==void 0?ft.slice(-e):ft.slice();return{avgRenderTime:ot===0?0:or/ot,cacheHitRate:st.cacheHitRate,renderCount:ot,recent:r}}function no(e){e!==void 0?st.invalidate(e):st.invalidate()}const oo={hash:tt,memoize:Xr,batchUpdate:Zr,invalidate:no,get avgRenderTime(){return ot===0?0:or/ot},get cacheHitRate(){return st.cacheHitRate},getMetrics:ro},It=new Map;function Gr(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function so(e){return"tkx-"+tt(e)}function Jr(e){const r=so(e);return It.has(r)||It.set(r,e),r}function Qr(e,...r){const n=e.reduce((s,a,l)=>s+a+(r[l]!==void 0?String(r[l]):""),"");return{className:Jr(n.trim()),styles:n.trim()}}function en(e){const r=Object.entries(e).map(([i,s])=>`${Gr(i)}: ${s};`).join(" ");return{className:Jr(r),styles:r}}const io={xs:"480px",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function tn(e,r){return`@media (min-width: ${io[e]}) { ${r} }`}function rn(e,r){const n=Object.entries(r).map(([i,s])=>{const a=Object.entries(s).map(([l,d])=>`${Gr(l)}: ${d};`).join(" ");return`${i} { ${a} }`}).join(" ");return`@keyframes ${e} { ${n} }`}function sr(e,r){return r!==void 0?`--tkx-${e}: ${r};`:`var(--tkx-${e})`}function ir(){return Array.from(It.entries()).map(([e,r])=>`.${e} { ${r} }`).join(`
2
+ `)}function ao(){It.clear()}function nn(){if(typeof document>"u")return;let e=document.getElementById("tkx-styles");e||(e=document.createElement("style"),e.id="tkx-styles",document.head.appendChild(e)),e.textContent=ir()}const lo={css:Qr,fromObject:en,responsive:tn,keyframes:rn,cssVar:sr,extractCSS:ir,injectStyles:nn,resetStyles:ao};function co(e){const r=e.replace("#",""),n=r.length===3?r.split("").map(l=>l+l).join(""):r,i=parseInt(n.slice(0,2),16),s=parseInt(n.slice(2,4),16),a=parseInt(n.slice(4,6),16);return[i,s,a]}function br(e){const[r,n,i]=co(e).map(s=>{const a=s/255;return a<=.03928?a/12.92:((a+.055)/1.055)**2.4});return .2126*r+.7152*n+.0722*i}function it(e,r){const n=br(e),i=br(r),s=Math.max(n,i),a=Math.min(n,i);return(s+.05)/(a+.05)}function Et(e,r,n=!1){return it(e,r)>=(n?3:4.5)}function on(e,r,n=!1){return it(e,r)>=(n?4.5:7)}function Ue(e,r){const i=r??["#ffffff","#000000"];return i.reduce((s,a)=>it(a,e)>it(s,e)?a:s,i[0])}function sn(){const e=document.createElement("div"),r=document.createElement("div");for(const n of[e,r])n.setAttribute("aria-atomic","true"),n.style.cssText="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;",document.body.appendChild(n);return e.setAttribute("aria-live","polite"),r.setAttribute("aria-live","assertive"),{announce(n,i="polite"){const s=i==="assertive"?r:e;s.textContent="",setTimeout(()=>{s.textContent=n},0)},destroy(){e.remove(),r.remove()}}}const uo=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])',"details > summary"].join(", ");function ar(e){let r=null,n=null;function i(){return Array.from(e.querySelectorAll(uo)).filter(s=>!s.closest("[hidden]")&&!s.closest('[aria-hidden="true"]'))}return{activate(){r=document.activeElement;const s=i();s.length>0&&s[0].focus(),n=a=>{if(a.key!=="Tab")return;const l=i();if(l.length===0)return;const d=l[0],u=l[l.length-1];a.shiftKey?document.activeElement===d&&(a.preventDefault(),u.focus()):document.activeElement===u&&(a.preventDefault(),d.focus())},e.addEventListener("keydown",n)},deactivate(){n&&e.removeEventListener("keydown",n),r instanceof HTMLElement&&r.focus(),r=null,n=null}}}function an(e,r,n,i){let s=r;switch(e.key){case"ArrowLeft":case"ArrowUp":e.preventDefault(),s=r===0?n-1:r-1;break;case"ArrowRight":case"ArrowDown":e.preventDefault(),s=r===n-1?0:r+1;break;case"Home":e.preventDefault(),s=0;break;case"End":e.preventDefault(),s=n-1;break;case"Enter":case" ":e.preventDefault(),i(r);return;default:return}i(s)}function fo(e,r,n,i,s){let a=r;switch(e.key){case"ArrowUp":e.preventDefault(),a=r===0?n-1:r-1;break;case"ArrowDown":e.preventDefault(),a=r===n-1?0:r+1;break;case"Home":e.preventDefault(),a=0;break;case"End":e.preventDefault(),a=n-1;break;case"Enter":case" ":e.preventDefault(),i(r);return;case"Escape":e.preventDefault(),s==null||s();return;default:return}i(a)}function lr(){return typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function cr(){return typeof window>"u"?!1:window.matchMedia("(forced-colors: active)").matches}function po(e,r="polite"){if(typeof document>"u")return;let n=document.getElementById("tkx-live-region");n||(n=document.createElement("div"),n.id="tkx-live-region",n.setAttribute("aria-live",r),n.setAttribute("aria-atomic","true"),n.style.cssText="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;",document.body.appendChild(n)),n.textContent="",setTimeout(()=>{n&&(n.textContent=e)},0)}const xo={contrastRatio:it,meetsAA:Et,meetsAAA:on,getAccessibleForeground:Ue,createAnnouncer:sn,createFocusTrap:ar,handleTabsKeyboard:an,handleMenuKeyboard:fo,prefersReducedMotion:lr,prefersHighContrast:cr,announce:po},dr={bg:"#0a0a0f",surface:"#12121a",surfaceAlt:"#1a1a2e",border:"#2a2a3e",text:"#e8e8f4",textMuted:"#8888aa",primary:"#00f5d4",secondary:"#7b2ff7",danger:"#f72585",warning:"#ffbe0b",success:"#06d6a0",info:"#3a86ff"},ho={bg:"#f8f6f1",surface:"#ffffff",surfaceAlt:"#f0ede6",border:"#ddd8cc",text:"#1a1815",textMuted:"#6b6560",primary:"#0d7c5f",secondary:"#6930c3",danger:"#c1121f",warning:"#d4a017",success:"#0d7c5f",info:"#1d4ed8"},mo=/^#[0-9a-fA-F]{3,8}$/;function go(e,r){const n={...e,...r};for(const[i,s]of Object.entries(n))if(!mo.test(s))throw new Error(`Invalid hex color for theme token '${i}': ${s}`);return Et(n.text,n.bg)||console.warn(`[TekiVex] Theme contrast warning: text (${n.text}) vs bg (${n.bg}) does not meet WCAG AA minimum (4.5:1)`),Et(n.primary,n.bg)||console.warn(`[TekiVex] Theme contrast warning: primary (${n.primary}) vs bg (${n.bg}) does not meet WCAG AA minimum`),n}const ur=c.createContext(dr);function bo({theme:e=dr,children:r}){return c.useEffect(()=>{const n=Object.entries(e).map(([s,a])=>sr(s,a)).join(" ");let i=document.getElementById("tkx-theme");i||(i=document.createElement("style"),i.id="tkx-theme",document.head.appendChild(i)),i.textContent=`:root { ${n} }`},[e]),c.createElement(ur.Provider,{value:e},r)}function ee(){return c.useContext(ur)}const yo={"<":"&lt;",">":"&gt;","&":"&amp;","'":"&#39;",'"':"&quot;"};function W(e){return String(e).replace(/[<>&'"]/g,r=>yo[r]??r)}function fr(e){const r={};for(const n of Object.keys(e))r[n]=ln(e[n]);return r}function ln(e){return typeof e=="string"?W(e):Array.isArray(e)?e.map(ln):e!==null&&typeof e=="object"&&!vo(e)?fr(e):e}function vo(e){return typeof e=="object"&&e!==null&&"$$typeof"in e}function Rt(e,r){const n=[];for(const[i,s]of Object.entries(r)){const a=e[i],l=a==null;if(s.required&&l){n.push(`prop '${i}' is required`);continue}if(!l){if(typeof a!==s.type){n.push(`prop '${i}' must be of type ${s.type}, got ${typeof a}`);continue}s.type==="number"&&typeof a=="number"&&(s.min!==void 0&&a<s.min&&n.push(`prop '${i}' must be >= ${s.min}`),s.max!==void 0&&a>s.max&&n.push(`prop '${i}' must be <= ${s.max}`)),s.type==="string"&&typeof a=="string"&&s.pattern&&!s.pattern.test(a)&&n.push(`prop '${i}' does not match pattern ${s.pattern}`),s.enum&&!s.enum.includes(a)&&n.push(`prop '${i}' must be one of: ${s.enum.join(", ")}`)}}return{valid:n.length===0,errors:n}}const cn=new Map;function ko(e,r){const n={"default-src":["'self'"],"style-src":r.allowInlineStyles?["'self'","'unsafe-inline'"]:["'self'"],"img-src":r.allowDataUrls?["'self'","data:"]:r.allowExternalSrc?["'self'","*"]:["'self'"],"script-src":r.allowScripts?["'self'"]:["'none'"]},i={componentId:e,permissions:r,directives:n};return cn.set(e,i),i}function wo(e,r){const n=cn.get(e);return(n==null?void 0:n.permissions[r])===!0}let Je=[];function dn(e,r,n){const i=tt(JSON.stringify(n??{})),s=Je.length>0?Je[Je.length-1].chainHash:"00000000",a=tt(s+i+r+e),l=Object.freeze({timestamp:Date.now(),component:r,action:e,propsHash:i,chainHash:a});return Je=Object.freeze([...Je,l]),l}function un(e){let r=Je;return e!=null&&e.component&&(r=r.filter(n=>n.component===e.component)),e!=null&&e.action&&(r=r.filter(n=>n.action===e.action)),e!=null&&e.limit&&(r=r.slice(-e.limit)),r}function fn(){let e="00000000";for(const r of Je){if(tt(e+r.propsHash+r.component+r.action)!==r.chainHash)return!1;e=r.chainHash}return!0}const jo={sanitize:W,sanitizeProps:fr,validateProps:Rt,createCSP:ko,hasPermission:wo,audit:dn,getAuditLog:un,verifyAuditIntegrity:fn};function we(){const[e,r]=c.useState(()=>typeof window>"u"?!1:lr());return c.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia("(prefers-reduced-motion: reduce)"),i=s=>r(s.matches);return n.addEventListener("change",i),()=>n.removeEventListener("change",i)},[]),e}function So(){const[e,r]=c.useState(()=>typeof window>"u"?!1:cr());return c.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia("(forced-colors: active)"),i=s=>r(s.matches);return n.addEventListener("change",i),()=>n.removeEventListener("change",i)},[]),e}function At(e){const r=c.useRef(null);return c.useEffect(()=>{if(!e||!r.current)return;const n=ar(r.current);return n.activate(),()=>n.deactivate()},[e]),r}function pr(){const e=c.useRef(null);return c.useEffect(()=>{if(!(typeof document>"u"))return e.current=sn(),()=>{var r;(r=e.current)==null||r.destroy()}},[]),c.useCallback((r,n="polite")=>{var i;(i=e.current)==null||i.announce(r,n)},[])}function Lt(e,r=!0){const n=c.useRef(e);n.current=e,c.useEffect(()=>{if(!r)return;const i=s=>{s.key==="Escape"&&n.current()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[r])}function pn(e,r){const n=c.useRef(r);n.current=r,c.useEffect(()=>{const i=s=>{!e.current||e.current.contains(s.target)||n.current()};return document.addEventListener("pointerdown",i),()=>document.removeEventListener("pointerdown",i)},[e])}const he={0:"0",px:"1px","0.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"},yr={...he,screen:"100vh"},Pe={"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%"},St={none:"0",sm:"2px","":"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px",full:"9999px"},vr={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"},$o={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"]},Mo={thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},Co={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"},To={tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},$t={none:"0",sm:"4px","":"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},Io=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)])),xn=new Set(["bg","surface","surfaceAlt","border","text","textMuted","primary","secondary","danger","warning","success","info"]),Eo={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function ae(e){const r=e.match(/^\[(.+)]$/);return r?r[1]:null}function Be(e){if(xn.has(e))return`var(--tkx-${e})`;if(e==="transparent")return"transparent";if(e==="current")return"currentColor";if(e==="white")return"#ffffff";if(e==="black")return"#000000";if(e==="inherit")return"inherit";const r=ae(e);return r||e}function zo(e){const r=e.match(/^\[([a-zA-Z-]+):(.+)]$/);if(r)return{[r[1]]:r[2]};const n={flex:"flex","inline-flex":"inline-flex",grid:"grid","inline-grid":"inline-grid",block:"block","inline-block":"inline-block",inline:"inline",hidden:"none",contents:"contents","flow-root":"flow-root",table:"table","table-row":"table-row","table-cell":"table-cell","table-caption":"table-caption","list-item":"list-item"};if(n[e])return{display:n[e]};const i={"flex-row":"row","flex-col":"column","flex-row-reverse":"row-reverse","flex-col-reverse":"column-reverse"};if(i[e])return{"flex-direction":i[e]};const s={"flex-wrap":"wrap","flex-nowrap":"nowrap","flex-wrap-reverse":"wrap-reverse"};if(s[e])return{"flex-wrap":s[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(e==="grow"||e==="flex-grow")return{"flex-grow":"1"};if(e==="grow-0")return{"flex-grow":"0"};if(e==="shrink"||e==="flex-shrink")return{"flex-shrink":"1"};if(e==="shrink-0"||e==="flex-shrink-0")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 d={"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(d[e])return{"justify-content":d[e]};const u={"self-auto":"auto","self-start":"flex-start","self-end":"flex-end","self-center":"center","self-stretch":"stretch","self-baseline":"baseline"};if(u[e])return{"align-self":u[e]};const x={"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(x[e])return{"align-content":x[e]};let o;if(o=e.match(/^grid-cols-(\d+|none|subgrid)$/))return{"grid-template-columns":o[1]==="none"?"none":o[1]==="subgrid"?"subgrid":`repeat(${o[1]},minmax(0,1fr))`};if(o=e.match(/^grid-rows-(\d+|none|subgrid)$/))return{"grid-template-rows":o[1]==="none"?"none":o[1]==="subgrid"?"subgrid":`repeat(${o[1]},minmax(0,1fr))`};if(o=e.match(/^col-span-(full|\d+)$/))return{"grid-column":o[1]==="full"?"1 / -1":`span ${o[1]} / span ${o[1]}`};if(o=e.match(/^col-start-(\d+|auto)$/))return{"grid-column-start":o[1]};if(o=e.match(/^col-end-(\d+|auto)$/))return{"grid-column-end":o[1]};if(o=e.match(/^row-span-(full|\d+)$/))return{"grid-row":o[1]==="full"?"1 / -1":`span ${o[1]} / span ${o[1]}`};if(o=e.match(/^row-start-(\d+|auto)$/))return{"grid-row-start":o[1]};if(o=e.match(/^row-end-(\d+|auto)$/))return{"grid-row-end":o[1]};if(e==="grid-flow-row")return{"grid-auto-flow":"row"};if(e==="grid-flow-col")return{"grid-auto-flow":"column"};if(e==="grid-flow-dense")return{"grid-auto-flow":"dense"};if(e==="grid-flow-row-dense")return{"grid-auto-flow":"row dense"};if(e==="grid-flow-col-dense")return{"grid-auto-flow":"column dense"};if(o=e.match(/^p-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{padding:f}}if(o=e.match(/^px-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"padding-left":f,"padding-right":f}}if(o=e.match(/^py-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"padding-top":f,"padding-bottom":f}}if(o=e.match(/^pt-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"padding-top":f}}if(o=e.match(/^pr-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"padding-right":f}}if(o=e.match(/^pb-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"padding-bottom":f}}if(o=e.match(/^pl-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"padding-left":f}}if(o=e.match(/^-?m-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??ae(o[1]);if(g)return{margin:f&&g!=="0"?`-${g}`:g}}if(o=e.match(/^-?mx-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??ae(o[1]);if(g){const j=f&&g!=="0"?`-${g}`:g;return{"margin-left":j,"margin-right":j}}}if(o=e.match(/^-?my-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??ae(o[1]);if(g){const j=f&&g!=="0"?`-${g}`:g;return{"margin-top":j,"margin-bottom":j}}}if(o=e.match(/^-?mt-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??ae(o[1]);if(g)return{"margin-top":f&&g!=="0"?`-${g}`:g}}if(o=e.match(/^-?mr-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??ae(o[1]);if(g)return{"margin-right":f&&g!=="0"?`-${g}`:g}}if(o=e.match(/^-?mb-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??ae(o[1]);if(g)return{"margin-bottom":f&&g!=="0"?`-${g}`:g}}if(o=e.match(/^-?ml-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??ae(o[1]);if(g)return{"margin-left":f&&g!=="0"?`-${g}`:g}}if(e==="mx-auto")return{"margin-left":"auto","margin-right":"auto"};if(e==="my-auto")return{"margin-top":"auto","margin-bottom":"auto"};if(o=e.match(/^gap-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{gap:f}}if(o=e.match(/^gap-x-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"column-gap":f}}if(o=e.match(/^gap-y-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"row-gap":f}}if(o=e.match(/^w-(.+)$/)){const f=o[1],g=he[f]??Pe[f]??ae(f);if(g)return{width:g}}if(o=e.match(/^min-w-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"min-width":f}}if(o=e.match(/^max-w-(.+)$/)){const g={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"}[o[1]]??he[o[1]]??ae(o[1]);if(g)return{"max-width":g}}if(o=e.match(/^h-(.+)$/)){const f=o[1],g=yr[f]??Pe[f]??ae(f);if(g)return{height:g}}if(o=e.match(/^min-h-(.+)$/)){const g={0:"0",full:"100%",screen:"100vh",svh:"100svh",dvh:"100dvh"}[o[1]]??he[o[1]]??ae(o[1]);if(g)return{"min-height":g}}if(o=e.match(/^max-h-(.+)$/)){const f=yr[o[1]]??ae(o[1]);if(f)return{"max-height":f}}if(o=e.match(/^size-(.+)$/)){const f=he[o[1]]??Pe[o[1]]??ae(o[1]);if(f)return{width:f,height:f}}if(o=e.match(/^text-(xs|sm|base|lg|[2-9]xl|\d+xl)$/)){const[f,g]=$o[o[1]]??["1rem","1.5rem"];return{"font-size":f,"line-height":g}}if(o=e.match(/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black|\d+)$/))return{"font-weight":Mo[o[1]]??o[1]};if(o=e.match(/^leading-(.+)$/)){const f=Co[o[1]]??ae(o[1]);if(f)return{"line-height":f}}if(o=e.match(/^tracking-(.+)$/)){const f=To[o[1]]??ae(o[1]);if(f)return{"letter-spacing":f}}const m={"text-left":"left","text-center":"center","text-right":"right","text-justify":"justify","text-start":"start","text-end":"end"};if(m[e])return{"text-align":m[e]};if(e==="italic")return{"font-style":"italic"};if(e==="not-italic")return{"font-style":"normal"};if(e==="uppercase")return{"text-transform":"uppercase"};if(e==="lowercase")return{"text-transform":"lowercase"};if(e==="capitalize")return{"text-transform":"capitalize"};if(e==="normal-case")return{"text-transform":"none"};if(e==="underline")return{"text-decoration-line":"underline"};if(e==="overline")return{"text-decoration-line":"overline"};if(e==="line-through")return{"text-decoration-line":"line-through"};if(e==="no-underline")return{"text-decoration-line":"none"};if(e==="truncate")return{overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"};if(e==="text-ellipsis")return{"text-overflow":"ellipsis"};if(e==="text-clip")return{"text-overflow":"clip"};if(e==="whitespace-normal")return{"white-space":"normal"};if(e==="whitespace-nowrap")return{"white-space":"nowrap"};if(e==="whitespace-pre")return{"white-space":"pre"};if(e==="whitespace-pre-wrap")return{"white-space":"pre-wrap"};if(e==="whitespace-pre-line")return{"white-space":"pre-line"};if(e==="break-words")return{"overflow-wrap":"break-word"};if(e==="break-all")return{"word-break":"break-all"};if(e==="break-keep")return{"word-break":"keep-all"};if(e==="font-mono")return{"font-family":"var(--tkx-font-mono,monospace)"};if(e==="font-sans")return{"font-family":"var(--tkx-font-family,system-ui,sans-serif)"};if(e==="font-serif")return{"font-family":"ui-serif,Georgia,serif"};if(e==="antialiased")return{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale"};if(o=e.match(/^indent-(.+)$/)){const f=he[o[1]]??ae(o[1]);if(f)return{"text-indent":f}}if(o=e.match(/^line-clamp-(\d+)$/))return{overflow:"hidden",display:"-webkit-box","-webkit-line-clamp":o[1],"-webkit-box-orient":"vertical"};if(o=e.match(/^text-(.+)$/)){const[f,g]=o[1].split("/"),j=Be(f);if(!["left","center","right","justify","start","end","xs","sm","base","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","9xl"].includes(f)){if(g){const F=parseInt(g)/100;return{color:j,opacity:String(F)}}return{color:j}}}if(o=e.match(/^bg-(.+)$/)){const[f,g]=o[1].split("/"),j=Be(f);return g?{"background-color":j,opacity:String(parseInt(g)/100)}:f==="none"?{background:"none"}:{"background-color":j}}if(o=e.match(/^border-color-(.+)$/))return{"border-color":Be(o[1])};if(o=e.match(/^fill-(.+)$/))return{fill:Be(o[1])};if(o=e.match(/^stroke-(.+)$/))return{stroke:Be(o[1])};if(o=e.match(/^shadow-color-(.+)$/))return{"--tkx-shadow-color":Be(o[1])};if(o=e.match(/^ring-color-(.+)$/))return{"--tkx-ring-color":Be(o[1])};if(o=e.match(/^accent-(.+)$/))return{"accent-color":Be(o[1])};if(o=e.match(/^caret-(.+)$/))return{"caret-color":Be(o[1])};if(o=e.match(/^outline-color-(.+)$/))return{"outline-color":Be(o[1])};if(e==="border")return{"border-width":"1px"};if(o=e.match(/^border-(\d+)$/))return{"border-width":`${o[1]}px`};if(e==="border-t")return{"border-top-width":"1px"};if(o=e.match(/^border-t-(\d+)$/))return{"border-top-width":`${o[1]}px`};if(e==="border-r")return{"border-right-width":"1px"};if(o=e.match(/^border-r-(\d+)$/))return{"border-right-width":`${o[1]}px`};if(e==="border-b")return{"border-bottom-width":"1px"};if(o=e.match(/^border-b-(\d+)$/))return{"border-bottom-width":`${o[1]}px`};if(e==="border-l")return{"border-left-width":"1px"};if(o=e.match(/^border-l-(\d+)$/))return{"border-left-width":`${o[1]}px`};if(e==="border-x")return{"border-left-width":"1px","border-right-width":"1px"};if(e==="border-y")return{"border-top-width":"1px","border-bottom-width":"1px"};if(e==="border-none")return{"border-style":"none"};if(e==="border-solid")return{"border-style":"solid"};if(e==="border-dashed")return{"border-style":"dashed"};if(e==="border-dotted")return{"border-style":"dotted"};if(e==="border-double")return{"border-style":"double"};if((o=e.match(/^border-([a-zA-Z].*)$/))&&xn.has(o[1]))return{"border-color":`var(--tkx-${o[1]})`};if(o=e.match(/^border-\[(.+)]$/))return{"border-color":o[1]};if(e==="border-0")return{"border-width":"0"};if(e==="rounded")return{"border-radius":St[""]};if(o=e.match(/^rounded-(none|sm|md|lg|xl|2xl|3xl|full|\[.+])$/))return{"border-radius":St[o[1]]??ae(o[1])??o[1]};if(o=e.match(/^rounded-(t|r|b|l|tl|tr|br|bl)(?:-(none|sm|md|lg|xl|2xl|3xl|full))?$/)){const f=o[1],g=St[o[2]??""]??St[""];return{t:{"border-top-left-radius":g,"border-top-right-radius":g},r:{"border-top-right-radius":g,"border-bottom-right-radius":g},b:{"border-bottom-left-radius":g,"border-bottom-right-radius":g},l:{"border-top-left-radius":g,"border-bottom-left-radius":g},tl:{"border-top-left-radius":g},tr:{"border-top-right-radius":g},br:{"border-bottom-right-radius":g},bl:{"border-bottom-left-radius":g}}[f]??{}}const p={0:"0",1:"1px",2:"2px",ring:"3px",4:"4px",8:"8px"};if(e==="ring")return{"box-shadow":"0 0 0 3px var(--tkx-ring-color,var(--tkx-primary))"};if((o=e.match(/^ring-(\d+)$/))&&p[o[1]])return{"box-shadow":`0 0 0 ${p[o[1]]} var(--tkx-ring-color,var(--tkx-primary))`};if(e==="ring-inset")return{"--tkx-ring-offset":"inset"};if(o=e.match(/^ring-offset-(\d+)$/))return{"--tkx-ring-offset-width":`${o[1]}px`,"box-shadow":`0 0 0 ${o[1]}px var(--tkx-bg)`};if(e==="shadow")return{"box-shadow":vr[""]};if(o=e.match(/^shadow-(sm|md|lg|xl|2xl|inner|none)$/))return{"box-shadow":vr[o[1]]};if(o=e.match(/^opacity-(\d+)$/)){const f=Io[o[1]];if(f!==void 0)return{opacity:f}}if(e==="bg-none")return{background:"none"};const h={"bg-auto":"auto","bg-cover":"cover","bg-contain":"contain"};if(h[e])return{"background-size":h[e]};const k={"bg-center":"center","bg-top":"top","bg-bottom":"bottom","bg-left":"left","bg-right":"right"};if(k[e])return{"background-position":k[e]};const z={"bg-repeat":"repeat","bg-no-repeat":"no-repeat","bg-repeat-x":"repeat-x","bg-repeat-y":"repeat-y"};if(z[e])return{"background-repeat":z[e]};if(e==="backdrop-blur")return{"backdrop-filter":`blur(${$t[""]})`};if(o=e.match(/^backdrop-blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{"backdrop-filter":`blur(${$t[o[1]]})`};if(e==="blur")return{filter:`blur(${$t[""]})`};if(o=e.match(/^blur-(none|sm|md|lg|xl|2xl|3xl)$/))return{filter:`blur(${$t[o[1]]})`};if(e==="grayscale")return{filter:"grayscale(100%)"};if(e==="grayscale-0")return{filter:"grayscale(0)"};if(e==="invert")return{filter:"invert(100%)"};if(e==="invert-0")return{filter:"invert(0)"};const y={static:"static",relative:"relative",absolute:"absolute",fixed:"fixed",sticky:"sticky"};if(y[e])return{position:y[e]};if(e==="inset-0")return{top:"0",right:"0",bottom:"0",left:"0"};if(e==="inset-auto")return{top:"auto",right:"auto",bottom:"auto",left:"auto"};if(e==="inset-full")return{top:"100%",right:"100%",bottom:"100%",left:"100%"};if(e==="inset-x-0")return{left:"0",right:"0"};if(e==="inset-y-0")return{top:"0",bottom:"0"};if(o=e.match(/^-?top-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??Pe[o[1]]??ae(o[1]);if(g)return{top:f&&g!=="0"?`-${g}`:g}}if(o=e.match(/^-?right-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??Pe[o[1]]??ae(o[1]);if(g)return{right:f&&g!=="0"?`-${g}`:g}}if(o=e.match(/^-?bottom-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??Pe[o[1]]??ae(o[1]);if(g)return{bottom:f&&g!=="0"?`-${g}`:g}}if(o=e.match(/^-?left-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??Pe[o[1]]??ae(o[1]);if(g)return{left:f&&g!=="0"?`-${g}`:g}}const S={0:"0",10:"10",20:"20",30:"30",40:"40",50:"50",100:"100",1e3:"1000",9e3:"9000",auto:"auto"};if(o=e.match(/^z-(.+)$/)){const f=S[o[1]]??ae(o[1]);if(f)return{"z-index":f}}const M={"overflow-auto":"auto","overflow-hidden":"hidden","overflow-visible":"visible","overflow-scroll":"scroll","overflow-clip":"clip"};if(M[e])return{overflow:M[e]};if(o=e.match(/^overflow-(x|y)-(auto|hidden|visible|scroll|clip)$/))return{[`overflow-${o[1]}`]:o[2]};if(e==="scrollbar-hide")return{"-ms-overflow-style":"none","scrollbar-width":"none"};if(e==="visible")return{visibility:"visible"};if(e==="invisible")return{visibility:"hidden"};if(e==="collapse")return{visibility:"collapse"};const C={"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(C[e])return{cursor:C[e]};if(e==="select-none")return{"user-select":"none"};if(e==="select-text")return{"user-select":"text"};if(e==="select-all")return{"user-select":"all"};if(e==="select-auto")return{"user-select":"auto"};if(e==="pointer-events-none")return{"pointer-events":"none"};if(e==="pointer-events-auto")return{"pointer-events":"auto"};const I={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(o=e.match(/^scale-(.+)$/)){const f=I[o[1]]??ae(o[1]);if(f)return{transform:`scale(${f})`}}if(o=e.match(/^scale-x-(.+)$/)){const f=I[o[1]]??ae(o[1]);if(f)return{transform:`scaleX(${f})`}}if(o=e.match(/^scale-y-(.+)$/)){const f=I[o[1]]??ae(o[1]);if(f)return{transform:`scaleY(${f})`}}const R={0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"};if(o=e.match(/^-?rotate-(.+)$/)){const f=e.startsWith("-"),g=R[o[1]]??ae(o[1]);if(g)return{transform:f?`rotate(-${g})`:`rotate(${g})`}}if(o=e.match(/^-?translate-x-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??Pe[o[1]]??ae(o[1]);if(g)return{transform:`translateX(${f&&g!=="0"?`-${g}`:g})`}}if(o=e.match(/^-?translate-y-(.+)$/)){const f=e.startsWith("-"),g=he[o[1]]??Pe[o[1]]??ae(o[1]);if(g)return{transform:`translateY(${f&&g!=="0"?`-${g}`:g})`}}if(o=e.match(/^-?skew-x-(.+)$/)){const f=e.startsWith("-"),g=ae(o[1])??`${o[1]}deg`;return{transform:f?`skewX(-${g})`:`skewX(${g})`}}if(o=e.match(/^-?skew-y-(.+)$/)){const f=e.startsWith("-"),g=ae(o[1])??`${o[1]}deg`;return{transform:f?`skewY(-${g})`:`skewY(${g})`}}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 N={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(N[e])return{"transition-property":N[e],"transition-timing-function":"cubic-bezier(0.4,0,0.2,1)","transition-duration":"150ms"};const T={75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"};if(o=e.match(/^duration-(.+)$/)){const f=T[o[1]]??ae(o[1]);if(f)return{"transition-duration":f}}if(o=e.match(/^delay-(.+)$/)){const f=T[o[1]]??ae(o[1]);if(f)return{"transition-delay":f}}const w={"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(w[e])return{"transition-timing-function":w[e]};const v={"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(v[e])return{animation:v[e]};const O={"object-contain":"contain","object-cover":"cover","object-fill":"fill","object-none":"none","object-scale-down":"scale-down"};return O[e]?{"object-fit":O[e]}:e==="aspect-square"?{"aspect-ratio":"1 / 1"}:e==="aspect-video"?{"aspect-ratio":"16 / 9"}:e==="aspect-auto"?{"aspect-ratio":"auto"}:(o=e.match(/^aspect-\[(.+)]$/))?{"aspect-ratio":o[1]}:e==="list-none"?{"list-style-type":"none"}:e==="list-disc"?{"list-style-type":"disc"}:e==="list-decimal"?{"list-style-type":"decimal"}:e==="list-inside"?{"list-style-position":"inside"}:e==="list-outside"?{"list-style-position":"outside"}:(o=e.match(/^columns-(\d+)$/))?{columns:o[1]}:e==="resize"?{resize:"both"}:e==="resize-none"?{resize:"none"}:e==="resize-x"?{resize:"horizontal"}:e==="resize-y"?{resize:"vertical"}:e==="sr-only"?{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)","white-space":"nowrap",border:"0"}:e==="not-sr-only"?{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",clip:"auto","white-space":"normal"}:e==="focus-ring"?{outline:"2px solid var(--tkx-primary)","outline-offset":"2px","border-radius":"2px"}:e==="appearance-none"?{appearance:"none"}:e==="outline-none"?{outline:"none"}:e==="outline"?{outline:"2px solid currentColor","outline-offset":"2px"}:e==="float-left"?{float:"left"}:e==="float-right"?{float:"right"}:e==="float-none"?{float:"none"}:e==="clear-both"?{clear:"both"}:e==="isolate"?{isolation:"isolate"}:e==="isolation-auto"?{isolation:"auto"}:(o=e.match(/^will-change-(.+)$/))?{"will-change":o[1]}:e==="touch-manipulation"?{"touch-action":"manipulation"}:e==="touch-none"?{"touch-action":"none"}:e==="touch-pan-x"?{"touch-action":"pan-x"}:e==="touch-pan-y"?{"touch-action":"pan-y"}:e==="scroll-smooth"?{"scroll-behavior":"smooth"}:e==="scroll-auto"?{"scroll-behavior":"auto"}:(o=e.match(/^\[(--[a-zA-Z0-9-]+):(.+)]$/))?{[o[1]]:o[2]}:null}function No(e){let r=0,n=-1;for(let i=0;i<e.length;i++)if(e[i]==="[")r++;else if(e[i]==="]")r--;else if(e[i]===":"&&r===0){n=i;break}return n===-1?{variant:null,utility:e}:{variant:e.slice(0,n),utility:e.slice(n+1)}}function kr(e,r){for(const[n,i]of Object.entries(r))e[n]=i}function Yt(e){return Object.entries(e).map(([r,n])=>`${r}:${n}`).join(";")}const zt=new Map;let He=null;function Ro(){return(!He||!He.isConnected)&&(He=document.getElementById("tkx-atomic"),He||(He=document.createElement("style"),He.id="tkx-atomic",document.head.appendChild(He))),He}function Ao(e,r){if(!zt.has(e)&&(zt.set(e,r),typeof document<"u")){const n=Ro();n.textContent+=r+`
3
+ `}}function hn(e){const r=[];for(const n of e)if(n){if(typeof n=="string")r.push(...n.split(/\s+/).filter(Boolean));else if(Array.isArray(n))r.push(...hn(n));else if(typeof n=="object")for(const[i,s]of Object.entries(n))s&&r.push(i)}return r}function b(...e){const r=hn(e);if(r.length===0)return"";const n={base:{},variants:{}};for(const u of r){const{variant:x,utility:o}=No(u),m=zo(o);m&&(x?(n.variants[x]||(n.variants[x]={}),kr(n.variants[x],m)):kr(n.base,m))}const i=[],s=Yt(n.base),a=[s,...Object.entries(n.variants).map(([u,x])=>`${u}{${Yt(x)}}`)].join("|"),l=tt(a),d=`tkx-${l}`;s&&i.push(`.${d}{${s}}`);for(const[u,x]of Object.entries(n.variants)){const o=Yt(x);if(o)if(u.startsWith("@")){const m=u.slice(1),p=Eo[m];p&&i.push(`@media(min-width:${p}){.${d}{${o}}}`)}else if(u==="motion-safe")i.push(`@media(prefers-reduced-motion:no-preference){.${d}{${o}}}`);else if(u==="motion-reduce")i.push(`@media(prefers-reduced-motion:reduce){.${d}{${o}}}`);else if(u==="contrast-more")i.push(`@media(prefers-contrast:more){.${d}{${o}}}`);else if(u==="forced-colors")i.push(`@media(forced-colors:active){.${d}{${o}}}`);else if(u==="dark")i.push(`@media(prefers-color-scheme:dark){.${d}{${o}}}`);else if(u==="print")i.push(`@media print{.${d}{${o}}}`);else if(u==="group-hover")i.push(`.group:hover .${d}{${o}}`);else if(u==="group-focus")i.push(`.group:focus-within .${d}{${o}}`);else if(u==="peer-hover")i.push(`.peer:hover~.${d}{${o}}`);else{const p={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"}[u]??`:${u}`;i.push(`.${d}${p}{${o}}`)}}return i.length>0&&Ao(l,i.join("")),d}const Lo=b;function Do(){return Array.from(zt.values()).join(`
4
+ `)}function Fo(){zt.clear(),He=null}function ue(...e){return e.filter(Boolean).join(" ")}const Bo={sm:"text-xs font-semibold",md:"text-sm font-semibold",lg:"text-base font-semibold",xl:"text-lg font-semibold"},Wo={sm:"py-1.5 px-3",md:"py-2 px-4",lg:"py-2.5 px-5",xl:"py-3 px-6"},wr={sm:"min-h-[32px]",md:"min-h-[40px]",lg:"min-h-[48px]",xl:"min-h-[56px]"},Po={sm:14,md:16,lg:18,xl:20};function Ho({size:e}){const r=Po[e];return t.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:b("animate-spin shrink-0"),children:[t.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeOpacity:"0.25"}),t.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]})}const mn=c.forwardRef(({variant:e="solid",size:r="md",colorScheme:n="primary",isLoading:i=!1,loadingText:s,leftIcon:a,rightIcon:l,isFullWidth:d=!1,glow:u=!1,disabled:x,children:o,className:m,style:p,...h},k)=>{const z=ee(),y=we(),S=x||i,C={primary:z.primary,secondary:z.secondary,danger:z.danger,warning:z.warning,success:z.success}[n],I=Ue(C,["#ffffff","#000000",z.bg]),R=typeof o=="string"?W(o):o,$=s?W(s):void 0,N=e==="solid"?{backgroundColor:C,color:I,border:"none",boxShadow:u&&!y?`0 0 20px ${C}55`:void 0}:e==="outline"?{backgroundColor:"transparent",color:C,border:`2px solid ${C}`}:e==="ghost"?{backgroundColor:"transparent",color:C,border:"none"}:{backgroundColor:"transparent",color:C,border:"none",textDecoration:"underline"},T=b("inline-flex items-center justify-center gap-2","rounded-lg font-sans font-semibold","select-none relative overflow-hidden",Bo[r],Wo[r],wr[r],e!=="link"&&wr[r],d&&"w-full",S?"cursor-not-allowed opacity-60":"cursor-pointer",!y&&"transition-all duration-200","focus-visible:focus-ring");return t.jsx("button",{ref:k,"aria-busy":i,"aria-disabled":S,disabled:S,className:ue(T,m),style:{...N,...p},...h,children:i?t.jsxs(t.Fragment,{children:[t.jsx(Ho,{size:r}),$??R]}):t.jsxs(t.Fragment,{children:[a&&t.jsx("span",{"aria-hidden":"true",children:a}),R,l&&t.jsx("span",{"aria-hidden":"true",children:l})]})})});mn.displayName="TkxButton";const Vo={none:"",sm:"p-3",md:"p-5",lg:"p-7"},gn=c.forwardRef(({variant:e="default",isHoverable:r,isClickable:n,padding:i="md",as:s,children:a,className:l,style:d,...u},x)=>{const o=ee(),m=s??(n?"button":"div"),p={default:{backgroundColor:o.surface,border:`1px solid ${o.border}`},glass:{backgroundColor:`${o.surface}cc`,backdropFilter:"blur(12px)",border:`1px solid ${o.border}55`,boxShadow:`0 4px 24px ${o.bg}40`},quantum:{backgroundColor:o.surfaceAlt,border:`1px solid ${o.primary}33`,boxShadow:`0 0 24px ${o.primary}18`},elevated:{backgroundColor:o.surface,boxShadow:`0 4px 20px ${o.bg}60`},outlined:{backgroundColor:"transparent",border:`2px solid ${o.border}`}}[e],h=b("rounded-xl w-full text-left block font-sans focus-visible:focus-ring",Vo[i],(r||n)&&"transition-transform duration-150 hover:scale-[1.01]",n?"cursor-pointer":"cursor-default");return t.jsx(m,{ref:x,className:ue("tkx-card",h,l),style:{color:o.text,...p,...d},...u,children:a})});gn.displayName="TkxCard";function Yo({title:e,subtitle:r,action:n,children:i,className:s,...a}){const l=ee();return t.jsxs("div",{className:ue(b("flex justify-between items-start mb-4"),s),...a,children:[t.jsxs("div",{className:b("flex-1 min-w-0"),children:[e&&t.jsx("h3",{className:b("text-base font-semibold m-0"),style:{color:l.text},children:e}),r&&t.jsx("p",{className:b("text-sm mt-1 mb-0"),style:{color:l.textMuted},children:r}),i]}),n&&t.jsx("div",{className:b("ml-3 shrink-0"),children:n})]})}function Oo({children:e,className:r,...n}){return t.jsx("div",{className:ue(b(""),r),...n,children:e})}function _o({children:e,className:r,style:n,...i}){const s=ee();return t.jsx("div",{className:ue(b("flex items-center justify-end gap-2 mt-4 pt-4"),r),style:{borderTop:`1px solid ${s.border}`,...n},...i,children:e})}const bn=c.forwardRef(({label:e,id:r,error:n,hint:i,leftAddon:s,rightAddon:a,isInvalid:l,isRequired:d,disabled:u,className:x,style:o,...m},p)=>{const h=ee(),k=c.useId(),z=r??k,y=`${z}-hint`,S=`${z}-error`,M=l||!!n,C=[i&&y,M&&S].filter(Boolean).join(" ")||void 0,I=W(e),R=n?W(n):void 0,$=i?W(i):void 0,N=M?h.danger:h.border;return t.jsxs("div",{className:ue(b("flex flex-col gap-1 w-full"),x),style:o,children:[t.jsxs("label",{htmlFor:z,className:b("text-sm font-medium font-sans"),style:{color:h.text},children:[I,d&&t.jsx("span",{"aria-hidden":"true",className:b("ml-1"),style:{color:h.danger},children:"*"})]}),t.jsxs("div",{className:b("flex items-center rounded-lg overflow-hidden","transition-colors duration-150",u?"opacity-60":""),style:{border:`1.5px solid ${N}`,backgroundColor:h.surface},children:[s&&t.jsx("div",{className:b("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:h.surfaceAlt,color:h.textMuted,borderRight:`1px solid ${h.border}`},children:s}),t.jsx("input",{ref:p,id:z,"aria-invalid":M,"aria-required":d,"aria-describedby":C,disabled:u,className:ue(b("flex-1 border-none bg-transparent text-sm font-sans py-2.5 px-3 outline-none min-w-0 focus-visible:focus-ring")),style:{color:h.text},...m}),a&&t.jsx("div",{className:b("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:h.surfaceAlt,color:h.textMuted,borderLeft:`1px solid ${h.border}`},children:a})]}),$&&!R&&t.jsx("span",{id:y,className:b("text-xs"),style:{color:h.textMuted},children:$}),R&&t.jsxs("span",{id:S,role:"alert",className:b("text-xs flex items-center gap-1"),style:{color:h.danger},children:[t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),R]})]})});bn.displayName="TkxInput";const Uo={sm:"text-xs px-1.5 py-[2px] min-h-[16px]",md:"text-xs px-2 py-[3px] min-h-[20px]",lg:"text-sm px-3 py-1 min-h-[24px]"},Ko={sm:"size-[6px]",md:"size-2",lg:"size-2.5"},yn=c.forwardRef(({variant:e="default",size:r="md",dot:n=!1,pulse:i=!1,outlined:s=!1,children:a,className:l,style:d,...u},x)=>{const o=ee(),p={default:o.border,primary:o.primary,secondary:o.secondary,danger:o.danger,warning:o.warning,success:o.success,info:o.info}[e],h=Ue(p,["#ffffff","#000000",o.bg]),k=typeof a=="string"?W(a):a;return n?t.jsx("span",{ref:x,"aria-label":typeof a=="string"?W(a):void 0,className:ue(b("inline-block rounded-full",Ko[r],i&&"animate-pulse"),l),style:{backgroundColor:p,...d},...u}):t.jsx("span",{ref:x,className:ue(b("inline-flex items-center justify-center rounded-full font-semibold font-sans tracking-wide",Uo[r],i&&"animate-pulse"),l),style:{backgroundColor:s?"transparent":p,color:s?p:h,border:s?`1px solid ${p}`:"none",...d},...u,children:k})});yn.displayName="TkxBadge";const Xo={sm:"4px",md:"8px",lg:"12px"},qo={sm:32,md:48,lg:64},vn=c.forwardRef(({value:e,variant:r="linear",size:n="md",label:i,showValue:s,color:a,className:l,style:d,...u},x)=>{const o=ee(),m=we(),p=a??o.primary,h=e===void 0,k=e!==void 0?Math.min(100,Math.max(0,e)):0;if(e!==void 0){const{errors:y}=Rt({value:e},{value:{type:"number",min:0,max:100}});y.length>0&&console.warn("[TkxProgress]",y.join(", "))}if(r==="circular"){const y=qo[n],S=n==="sm"?3:n==="md"?4:5,M=(y-S*2)/2,C=2*Math.PI*M,I=h?0:C-k/100*C;return t.jsxs("div",{ref:x,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":h?void 0:k,"aria-label":i??(h?"Loading":`${k}%`),className:ue(b("inline-flex flex-col items-center gap-1"),l),style:d,...u,children:[t.jsxs("svg",{width:y,height:y,viewBox:`0 0 ${y} ${y}`,"aria-hidden":"true",children:[t.jsx("circle",{cx:y/2,cy:y/2,r:M,fill:"none",stroke:o.border,strokeWidth:S}),t.jsx("circle",{cx:y/2,cy:y/2,r:M,fill:"none",stroke:p,strokeWidth:S,strokeLinecap:"round",strokeDasharray:C,strokeDashoffset:I,transform:`rotate(-90 ${y/2} ${y/2})`,style:{transition:m?"none":"stroke-dashoffset 300ms ease",animation:h&&!m?"tkx-spin 1s linear infinite":void 0}})]}),s&&!h&&t.jsxs("span",{className:b("text-xs"),style:{color:o.textMuted},children:[k,"%"]})]})}const z=Xo[n];return t.jsxs("div",{ref:x,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":h?void 0:k,"aria-label":i??(h?"Loading":`${k}%`),className:ue(b("flex flex-col gap-1 w-full"),l),style:d,...u,children:[i&&t.jsxs("div",{className:b("flex justify-between text-sm"),style:{color:o.text},children:[t.jsx("span",{children:i}),s&&!h&&t.jsxs("span",{children:[k,"%"]})]}),t.jsx("div",{className:b("w-full overflow-hidden"),style:{height:z,borderRadius:z,backgroundColor:o.border},children:t.jsx("div",{style:{height:"100%",borderRadius:z,backgroundColor:p,width:h?"40%":`${k}%`,transition:m?"none":"width 300ms ease",animation:h&&!m?"tkx-shimmer 1.5s ease-in-out infinite":void 0}})})]})});vn.displayName="TkxProgress";const Zo={sm:{tw:28,th:16,td:10,gap:3},md:{tw:40,th:22,td:14,gap:4},lg:{tw:52,th:28,td:18,gap:5}},kn=c.forwardRef(({checked:e,onChange:r,label:n,size:i="md",hideLabel:s,disabled:a,className:l,style:d,...u},x)=>{const o=ee(),m=we(),p=c.useId();Rt({label:n,checked:e},{label:{type:"string",required:!0},checked:{type:"boolean",required:!0}});const{tw:h,th:k,td:z,gap:y}=Zo[i],S=e?h-z-y:y,M=e?o.primary:o.border;return t.jsxs("div",{className:ue(b("inline-flex items-center gap-2",a?"opacity-50":""),l),style:d,children:[!s&&t.jsx("label",{htmlFor:p,className:b("text-sm font-sans",a?"cursor-not-allowed":"cursor-pointer","select-none"),style:{color:o.text},children:n}),t.jsx("button",{ref:x,id:p,role:"switch","aria-checked":e,"aria-label":s?n:void 0,disabled:a,onClick:()=>!a&&r(!e),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&!a&&(C.preventDefault(),r(!e))},className:ue(b("relative border-none p-0 outline-none shrink-0 focus-visible:focus-ring",a?"cursor-not-allowed":"cursor-pointer",!m&&"transition-colors duration-200")),style:{width:h,height:k,borderRadius:k,backgroundColor:M},...u,children:t.jsx("span",{"aria-hidden":"true",className:b("absolute rounded-full"),style:{top:"50%",left:S,width:z,height:z,transform:"translateY(-50%)",backgroundColor:"#ffffff",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",transition:m?"none":"left 200ms ease"}})})]})});kn.displayName="TkxToggle";const Go={info:t.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})}),success:t.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z"})}),warning:t.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),danger:t.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})})};function Jo({variant:e,title:r,children:n,dismissible:i,onDismiss:s,icon:a,style:l,className:d}){const u=ee(),x=pr(),o=r?W(r):void 0;c.useEffect(()=>{o&&x(o,e==="danger"||e==="warning"?"assertive":"polite")},[o,e,x]);const p={info:u.info,success:u.success,warning:u.warning,danger:u.danger}[e],h=e==="danger"||e==="warning"?"alert":"status";return t.jsxs("div",{role:h,className:b("flex items-start gap-3 px-4 py-3 rounded-lg border animate-fade-in font-sans",d??""),style:{backgroundColor:`${p}18`,borderColor:p,color:u.text,...l},children:[t.jsx("span",{className:b("shrink-0 mt-[1px]"),style:{color:p},children:a??Go[e]}),t.jsxs("div",{className:b("flex-1 min-w-0"),children:[o&&t.jsx("p",{className:b("m-0 font-semibold text-sm mb-1"),children:o}),t.jsx("div",{className:b("text-sm leading-relaxed"),children:n})]}),i&&s&&t.jsx("button",{"aria-label":"Dismiss alert",onClick:s,className:b("bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring"),style:{color:u.textMuted},children:t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}const Qo={sm:"400px",md:"560px",lg:"720px",full:"100vw"};let Qt=0;function es(){++Qt===1&&(document.body.style.overflow="hidden")}function jr(){--Qt<=0&&(Qt=0,document.body.style.overflow="")}function ts({isOpen:e,onClose:r,title:n,size:i="md",closeOnOverlayClick:s=!0,closeOnEscape:a=!0,children:l,footer:d}){const u=ee(),x=c.useId(),o=At(e),m=pr(),p=W(n),h=i==="full";return Lt(r,a&&e),c.useEffect(()=>(e?(es(),m(p,"polite")):jr(),()=>{e&&jr()}),[e,p,m]),!e||typeof document>"u"?null:We.createPortal(t.jsxs("div",{role:"presentation",className:b("fixed inset-0 z-[9000] flex",h?"items-stretch":"items-center justify-center",h?"":"p-4"),children:[t.jsx("div",{"aria-hidden":"true",onClick:s?r:void 0,className:b("absolute inset-0 animate-fade-in"),style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)"}}),t.jsxs("div",{ref:o,role:"dialog","aria-modal":"true","aria-labelledby":x,className:b("relative z-10 flex flex-col overflow-hidden animate-slide-up",h?"":"rounded-xl"),style:{backgroundColor:u.surface,border:`1px solid ${u.border}`,width:Qo[i],maxWidth:"100%",maxHeight:h?"100vh":"90vh",boxShadow:`0 20px 60px ${u.bg}80`},children:[t.jsxs("div",{className:b("flex items-center justify-between px-6 py-5 shrink-0"),style:{borderBottom:`1px solid ${u.border}`},children:[t.jsx("h2",{id:x,className:b("m-0 text-lg font-semibold font-sans"),style:{color:u.text},children:p}),t.jsx("button",{onClick:r,"aria-label":"Close dialog",className:b("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:u.textMuted},children:t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),t.jsx("div",{className:b("flex-1 overflow-y-auto px-6 py-6 font-sans"),style:{color:u.text},children:l}),d&&t.jsx("div",{className:b("flex justify-end gap-2 px-6 py-4 shrink-0"),style:{borderTop:`1px solid ${u.border}`},children:d})]})]}),document.body)}const wn=c.createContext(null);function jn(){const e=c.useContext(wn);if(!e)throw new Error("TkxTab must be used inside TkxTabs");return e}function rs({defaultIndex:e=0,activeIndex:r,onChange:n,children:i,tabCount:s=0,style:a,className:l}){const[d,u]=c.useState(e),x=c.useId(),o=r!==void 0?r:d,m=p=>{r===void 0&&u(p),n==null||n(p)};return t.jsx(wn.Provider,{value:{activeIndex:o,setActiveIndex:m,baseId:x,tabCount:s},children:t.jsx("div",{className:l,style:a,children:i})})}function ns({children:e,className:r,style:n,...i}){const s=ee();return t.jsx("div",{role:"tablist",className:ue(b("flex gap-1"),r),style:{borderBottom:`2px solid ${s.border}`,...n},...i,children:e})}function os({index:e,children:r,disabled:n=!1,className:i,style:s}){const a=ee(),{activeIndex:l,setActiveIndex:d,baseId:u,tabCount:x}=jn(),o=c.useRef(null),m=l===e;return t.jsx("button",{ref:o,role:"tab",id:`${u}-tab-${e}`,"aria-controls":`${u}-panel-${e}`,"aria-selected":m,tabIndex:m?0:-1,disabled:n,className:ue(b("border-none bg-transparent font-sans text-sm rounded-t cursor-pointer select-none","py-2.5 px-4 transition-colors duration-150 focus-visible:focus-ring",n?"opacity-50 cursor-not-allowed":""),i),style:{color:m?a.primary:a.textMuted,fontWeight:m?600:400,borderBottom:m?`2px solid ${a.primary}`:"2px solid transparent",marginBottom:"-2px",...s},onClick:()=>!n&&d(e),onKeyDown:p=>an(p,e,x,h=>{var k;d(h),(k=document.getElementById(`${u}-tab-${h}`))==null||k.focus()}),children:r})}function ss({children:e,className:r,...n}){return t.jsx("div",{className:r,...n,children:e})}function is({index:e,children:r,style:n,className:i}){const{activeIndex:s,baseId:a}=jn();return s!==e?null:t.jsx("div",{role:"tabpanel",id:`${a}-panel-${e}`,"aria-labelledby":`${a}-tab-${e}`,tabIndex:0,className:ue(b("pt-4"),i),style:n,children:r})}const as={top:{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:6},bottom:{top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:6},left:{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:6},right:{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:6}};function ls({content:e,children:r,placement:n="top",delay:i=300}){const s=ee(),[a,l]=c.useState(!1),d=c.useRef(null),u=c.useId(),x=c.useRef(null),o=W(e),m=Ue(s.surfaceAlt,[s.text,"#ffffff","#000000"]);function p(){x.current=setTimeout(()=>l(!0),i)}function h(){x.current&&clearTimeout(x.current),l(!1)}Lt(h,a),pn(d,h);const k=c.cloneElement(r,{"aria-describedby":a?u:void 0,onMouseEnter:z=>{var y,S;(S=(y=r.props).onMouseEnter)==null||S.call(y,z),p()},onMouseLeave:z=>{var y,S;(S=(y=r.props).onMouseLeave)==null||S.call(y,z),h()},onFocus:z=>{var y,S;(S=(y=r.props).onFocus)==null||S.call(y,z),p()},onBlur:z=>{var y,S;(S=(y=r.props).onBlur)==null||S.call(y,z),h()}});return t.jsxs("span",{ref:d,className:b("relative inline-flex"),children:[k,a&&t.jsx("span",{id:u,role:"tooltip",className:b("absolute z-[9000] text-xs font-sans py-1.5 px-2.5 rounded-md whitespace-nowrap pointer-events-none animate-fade-in"),style:{backgroundColor:s.surfaceAlt,color:m,border:`1px solid ${s.border}`,boxShadow:`0 4px 12px ${s.bg}40`,maxWidth:280,...as[n]},children:o})]})}function Sr({variant:e,width:r,height:n,animation:i,bgColor:s,accentColor:a}){const l=r!==void 0?typeof r=="number"?`${r}px`:r:"100%",u=n!==void 0?typeof n=="number"?`${n}px`:n:{text:"1em",circular:l,rectangular:"80px"}[e],x=b(e==="circular"?"rounded-full":e==="text"?"rounded":"rounded-lg"),o=i==="pulse"?b("animate-pulse"):i==="wave"?b("animate-shimmer"):"",m=i==="wave"?{background:`linear-gradient(90deg,${s} 25%,${a} 50%,${s} 75%)`,backgroundSize:"200% 100%"}:{backgroundColor:s};return t.jsx("div",{className:ue(x,o),style:{width:l,height:u,...m}})}const xr=c.forwardRef(({variant:e="rectangular",width:r,height:n,lines:i,animation:s="pulse",className:a,style:l,...d},u)=>{const x=ee(),m=we()?!1:s;return e==="text"&&i&&i>1?t.jsx("div",{ref:u,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:ue(b("flex flex-col gap-2"),a),style:l,...d,children:Array.from({length:i},(p,h)=>t.jsx(Sr,{variant:"text",width:h===i-1?"75%":r,height:n,animation:m,bgColor:x.surfaceAlt,accentColor:x.border},h))}):t.jsx("div",{ref:u,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:a,style:l,...d,children:t.jsx(Sr,{variant:e,width:r,height:n,animation:m,bgColor:x.surfaceAlt,accentColor:x.border})})});xr.displayName="TkxSkeleton";const cs={xs:24,sm:32,md:40,lg:56,xl:72},ds={online:"#06d6a0",offline:"#8888aa",away:"#ffbe0b",busy:"#f72585"},Sn=c.forwardRef(({src:e,alt:r,initials:n,size:i="md",shape:s="circle",status:a,className:l,style:d,...u},x)=>{const o=ee(),[m,p]=c.useState(!1),h=cs[i],k=s==="circle",z=o.surfaceAlt,y=Ue(z,[o.text,o.textMuted]),S=e&&!m,M=!S&&n,C=Math.max(8,h*.22),I=b("relative inline-flex shrink-0",k?"rounded-full":"rounded-lg"),R=b("block object-cover",k?"rounded-full":"rounded-lg"),$=b("flex items-center justify-center font-semibold font-sans select-none",k?"rounded-full":"rounded-lg");return t.jsxs("div",{ref:x,className:ue(I,l),style:{width:h,height:h,...d},...u,children:[S?t.jsx("img",{src:W(e),alt:W(r),onError:()=>p(!0),className:R,style:{width:h,height:h}}):t.jsx("div",{role:"img","aria-label":W(r),className:$,style:{width:h,height:h,backgroundColor:z,color:y,fontSize:h*.38},children:M?W(n).slice(0,2).toUpperCase():t.jsxs("svg",{width:h*.5,height:h*.5,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),t.jsx("circle",{cx:"12",cy:"7",r:"4"})]})}),a&&t.jsx("span",{"aria-label":`Status: ${a}`,className:b("absolute bottom-0 right-0 rounded-full"),style:{width:C,height:C,backgroundColor:ds[a],border:`2px solid ${o.bg}`}})]})});Sn.displayName="TkxAvatar";function us({dir:e}){return t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:b("shrink-0"),children:e==="asc"?t.jsx("path",{d:"M7 14l5-5 5 5H7z"}):e==="desc"?t.jsx("path",{d:"M7 10l5 5 5-5H7z"}):t.jsx("path",{d:"M7 10l5 5 5-5H7zM7 14l5-5 5 5H7z",opacity:"0.4"})})}function fs({columns:e,data:r,caption:n,sortable:i,stickyHeader:s,isLoading:a,emptyState:l,style:d,className:u,striped:x}){const o=ee(),[m,p]=c.useState(null),[h,k]=c.useState("asc"),z=c.useMemo(()=>!m||!i?r:[...r].sort((M,C)=>{const I=M[m],R=C[m];let $=0;return typeof I=="string"&&typeof R=="string"?$=I.localeCompare(R):typeof I=="number"&&typeof R=="number"&&($=I-R),h==="asc"?$:-$}),[r,m,h,i]);function y(M){m===M?k(C=>C==="asc"?"desc":"asc"):(p(M),k("asc"))}function S(M){return m!==M?"none":h}return t.jsx("div",{className:b("w-full overflow-x-auto rounded-lg",u??""),style:{border:`1px solid ${o.border}`,...d},children:t.jsxs("table",{className:b("w-full font-sans text-sm"),style:{borderCollapse:"collapse",color:o.text},children:[n&&t.jsx("caption",{className:b("text-sm text-left p-2"),style:{color:o.textMuted},children:W(n)}),t.jsx("thead",{style:s?{position:"sticky",top:0,backgroundColor:o.surfaceAlt,zIndex:1}:{backgroundColor:o.surfaceAlt},children:t.jsx("tr",{children:e.map(M=>{const C=i&&M.sortable!==!1,I=S(M.key);return t.jsx("th",{scope:"col","aria-sort":C?I==="none"?"none":I==="asc"?"ascending":"descending":void 0,className:b("px-4 py-3 text-left font-semibold whitespace-nowrap",C?"cursor-pointer select-none focus-visible:focus-ring":""),style:{color:o.textMuted,borderBottom:`2px solid ${o.border}`,width:M.width},onClick:()=>C&&y(M.key),onKeyDown:R=>{C&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),y(M.key))},tabIndex:C?0:void 0,children:t.jsxs("span",{className:b("inline-flex items-center gap-1.5"),children:[W(M.header),C&&t.jsx(us,{dir:I})]})},String(M.key))})})}),t.jsx("tbody",{children:a?Array.from({length:5},(M,C)=>t.jsx("tr",{children:e.map(I=>t.jsx("td",{className:b("px-4 py-3"),children:t.jsx(xr,{variant:"text",height:"16px"})},String(I.key)))},C)):z.length===0?t.jsx("tr",{children:t.jsx("td",{colSpan:e.length,className:b("px-4 py-8 text-center"),style:{color:o.textMuted},children:l??"No data available"})}):z.map((M,C)=>t.jsx("tr",{style:{backgroundColor:x&&C%2===1?o.surfaceAlt:"transparent",borderBottom:`1px solid ${o.border}`},children:e.map(I=>{const R=M[I.key],$=I.render?I.render(R,M):typeof R=="string"?W(R):String(R??"");return t.jsx("td",{className:b("px-4 py-3"),style:{color:o.text},children:$},String(I.key))})},C))})]})})}const $n=c.forwardRef(({orientation:e="horizontal",label:r,variant:n="solid",className:i,style:s,...a},l)=>{const d=ee(),u=r?W(r):void 0,x=e==="vertical",o=x?"borderLeft":"borderTop",m=`1px ${n} ${d.border}`;return u?t.jsxs("div",{role:"separator","aria-orientation":e,className:ue(b("flex items-center gap-3 text-xs"),i),style:{color:d.textMuted,...s},...a,children:[t.jsx("hr",{className:b("flex-1 m-0 border-none"),style:{[o]:m}}),t.jsx("span",{children:u}),t.jsx("hr",{className:b("flex-1 m-0 border-none"),style:{[o]:m}})]}):t.jsx("hr",{ref:l,role:"separator","aria-orientation":e,className:ue(b(x?"inline-block self-stretch border-none w-0 h-full":"w-full border-none m-0"),i),style:{[o]:m,...s},...a})});$n.displayName="TkxDivider";const ps={sm:{py:"6px",px:"10px",fontSize:"13px",iconSize:14,tagPy:"1px",tagPx:"6px"},md:{py:"9px",px:"12px",fontSize:"14px",iconSize:16,tagPy:"2px",tagPx:"8px"},lg:{py:"12px",px:"14px",fontSize:"15px",iconSize:18,tagPy:"3px",tagPx:"10px"}};function $r(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function xs(e,r){const n=e.getBoundingClientRect(),i=window.innerHeight,s=6,a=i-n.bottom-s,l=n.top-s,d=a>=Math.min(r,200)||a>=l?"below":"above";return{top:d==="below"?n.bottom+window.scrollY+s:n.top+window.scrollY-s-Math.min(r,280),left:n.left+window.scrollX,width:n.width,placement:d}}function hs({size:e,color:r}){return t.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2.5",strokeLinecap:"round","aria-hidden":"true",style:{animation:"tkx-spin 0.7s linear infinite"},children:[t.jsx("style",{children:"@keyframes tkx-spin{to{transform:rotate(360deg)}}"}),t.jsx("path",{d:"M12 2a10 10 0 0 1 10 10"})]})}function Mn({options:e,value:r,defaultValue:n,placeholder:i="Select an option…",size:s="md",isDisabled:a=!1,isInvalid:l=!1,label:d,hint:u,errorMessage:x,multiple:o=!1,searchable:m=!1,clearable:p=!1,isLoading:h=!1,onChange:k,renderOption:z,maxMenuHeight:y=280,id:S,className:M,style:C}){const I=ee(),R=c.useId(),$=S??R,N=`${$}-listbox`,T=`${$}-hint`,w=`${$}-error`,v=r!==void 0,[O,f]=c.useState($r(n)),g=v?$r(r):O,[j,F]=c.useState(!1),[L,V]=c.useState(""),[E,B]=c.useState(-1),[P,Y]=c.useState(null),[A,H]=c.useState(""),Q=c.useRef(null),G=c.useRef(null),ne=c.useRef(null),pe=c.useRef(null),xe=c.useRef(null),oe=ps[s],me=l||!!x,X=m&&L?e.filter(U=>U.label.toLowerCase().includes(L.toLowerCase())):e,Z=X.filter(U=>!U.disabled),ye=X.reduce((U,le)=>{const se=le.group??"";return U[se]||(U[se]=[]),U[se].push(le),U},{}),ke=c.useCallback(U=>{var se;let le;o?le=g.includes(U)?g.filter(Se=>Se!==U):[...g,U]:le=[U],v||f(le),k==null||k(o?le:le[0]??""),o||(F(!1),V(""),B(-1),(se=G.current)==null||se.focus())},[v,o,k,g]),de=c.useCallback((U,le)=>{le.stopPropagation();const se=g.filter(Se=>Se!==U);v||f(se),k==null||k(o?se:se[0]??"")},[v,o,k,g]),ge=c.useCallback(U=>{U.stopPropagation(),v||f([]),k==null||k(o?[]:"")},[v,o,k]),J=c.useCallback(()=>{!G.current||!j||Y(xs(G.current,y))},[j,y]);c.useEffect(()=>{if(j)return J(),window.addEventListener("scroll",J,!0),window.addEventListener("resize",J),()=>{window.removeEventListener("scroll",J,!0),window.removeEventListener("resize",J)}},[j,J]),c.useEffect(()=>{if(!j)return;const U=le=>{var Se,Ae;const se=le.target;(Se=G.current)!=null&&Se.contains(se)||(Ae=pe.current)!=null&&Ae.contains(se)||(F(!1),V(""))};return document.addEventListener("pointerdown",U),()=>document.removeEventListener("pointerdown",U)},[j]),c.useEffect(()=>{j&&m&&setTimeout(()=>{var U;return(U=ne.current)==null?void 0:U.focus()},0)},[j,m]),c.useEffect(()=>{var le;if(!j||E<0)return;const U=(le=xe.current)==null?void 0:le.querySelector(`[data-idx="${E}"]`);U==null||U.scrollIntoView({block:"nearest"})},[E,j]);const ie=U=>{switch(U.key){case"Enter":case" ":U.preventDefault(),j?E>=0&&Z[E]&&ke(Z[E].value):te();break;case"Escape":U.preventDefault(),F(!1),V("");break;case"ArrowDown":U.preventDefault(),j?B(le=>Math.min(le+1,Z.length-1)):te();break;case"ArrowUp":U.preventDefault(),j?B(le=>Math.max(le-1,0)):te();break;case"Home":U.preventDefault(),j&&B(0);break;case"End":U.preventDefault(),j&&B(Z.length-1);break;default:U.key.length===1&&!U.ctrlKey&&!U.metaKey&&(j||te(),q(U.key))}},re=U=>{var le;switch(U.key){case"Escape":U.preventDefault(),F(!1),V(""),(le=G.current)==null||le.focus();break;case"ArrowDown":U.preventDefault(),B(se=>Math.min(se+1,Z.length-1));break;case"ArrowUp":U.preventDefault(),B(se=>Math.max(se-1,0));break;case"Home":U.preventDefault(),B(0);break;case"End":U.preventDefault(),B(Z.length-1);break;case"Enter":U.preventDefault(),E>=0&&Z[E]&&ke(Z[E].value);break}};function q(U){Q.current&&clearTimeout(Q.current);const le=A+U.toLowerCase();H(le);const se=Z.findIndex(Se=>Se.label.toLowerCase().startsWith(le));se>=0&&B(se),Q.current=setTimeout(()=>H(""),800)}function te(){if(a||h)return;F(!0);const U=Z.findIndex(le=>g.includes(le.value));B(U>=0?U:0)}const be=me?I.danger:j?I.primary:I.border,$e=E>=0&&Z[E]?`${$}-opt-${Z[E].value}`:void 0,Me=[u&&T,me&&w].filter(Boolean).join(" ")||void 0,Te=g.map(U=>e.find(le=>le.value===U)).filter(Boolean),Ke=j&&P?We.createPortal(t.jsxs("div",{ref:pe,role:"listbox",id:N,"aria-label":d?W(d):"Options","aria-multiselectable":o,style:{position:"absolute",top:P.top,left:P.left,width:P.width,zIndex:9999,backgroundColor:I.surface,border:`1.5px solid ${I.border}`,borderRadius:10,boxShadow:"0 8px 32px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.14)",overflow:"hidden",minWidth:P.width,maxHeight:y,display:"flex",flexDirection:"column"},children:[m&&t.jsxs("div",{style:{padding:"8px 10px",borderBottom:`1px solid ${I.border}`,flexShrink:0,display:"flex",alignItems:"center",gap:6},children:[t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:I.textMuted,strokeWidth:"2","aria-hidden":"true",style:{flexShrink:0},children:[t.jsx("circle",{cx:"11",cy:"11",r:"8"}),t.jsx("path",{d:"M21 21l-4.35-4.35"})]}),t.jsx("input",{ref:ne,type:"text",value:L,onChange:U=>{V(U.target.value),B(0)},onKeyDown:re,placeholder:"Search…","aria-label":"Search options",style:{border:"none",outline:"none",background:"transparent",color:I.text,fontSize:oe.fontSize,fontFamily:"inherit",width:"100%"}})]}),t.jsxs("div",{ref:xe,style:{overflowY:"auto",flexGrow:1,maxHeight:y-(m?48:0)},children:[Object.entries(ye).map(([U,le])=>t.jsxs("div",{children:[U&&t.jsx("div",{"aria-hidden":"true",style:{padding:"8px 12px 4px",fontSize:"11px",fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:I.textMuted,fontFamily:"inherit",position:"sticky",top:0,backgroundColor:I.surface,zIndex:1,borderBottom:`1px solid ${I.border}`},children:W(U)}),le.map(se=>{const Se=Z.indexOf(se),Ae=Se===E,Le=g.includes(se.value),at=z?z(se,Le):t.jsxs("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8},children:[se.icon&&t.jsx("span",{style:{flexShrink:0,display:"flex"},children:se.icon}),t.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:W(se.label)})]}),se.description&&t.jsx("span",{style:{fontSize:"12px",color:I.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:W(se.description)})]});return t.jsxs("div",{id:`${$}-opt-${se.value}`,"data-idx":Se>=0?Se:void 0,role:"option","aria-selected":Le,"aria-disabled":se.disabled||void 0,onClick:()=>!se.disabled&&ke(se.value),onMouseEnter:()=>!se.disabled&&Se>=0&&B(Se),style:{padding:`${oe.py} ${oe.px}`,fontSize:oe.fontSize,fontFamily:"inherit",color:se.disabled?I.textMuted:I.text,backgroundColor:Ae?`${I.primary}22`:Le?`${I.primary}12`:"transparent",cursor:se.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,transition:"background-color 80ms",opacity:se.disabled?.5:1,userSelect:"none"},children:[at,Le&&!z&&t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:I.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:t.jsx("path",{d:"M20 6L9 17l-5-5"})})]},se.value)})]},U)),X.length===0&&t.jsx("div",{style:{padding:`${oe.py} ${oe.px}`,fontSize:oe.fontSize,fontFamily:"inherit",color:I.textMuted,textAlign:"center"},children:h?"Loading…":"No options found"})]})]}),document.body):null,Ee=p&&g.length>0&&!a&&!h;return t.jsxs("div",{className:ue(b("flex flex-col gap-1 w-full"),M),style:C,children:[d&&t.jsx("label",{htmlFor:$,style:{fontSize:"14px",fontWeight:500,fontFamily:"inherit",color:I.text,userSelect:"none"},children:W(d)}),t.jsx("div",{style:{position:"relative",width:"100%",opacity:a?.55:1},children:t.jsxs("button",{ref:G,id:$,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":j,"aria-controls":N,"aria-activedescendant":$e,"aria-invalid":me||void 0,"aria-describedby":Me,"aria-multiselectable":o,disabled:a,onClick:()=>j?F(!1):te(),onKeyDown:ie,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:o&&g.length>0?`4px ${oe.px}`:`${oe.py} ${oe.px}`,fontSize:oe.fontSize,fontFamily:"inherit",backgroundColor:I.surface,color:g.length>0?I.text:I.textMuted,border:`1.5px solid ${be}`,borderRadius:8,boxSizing:"border-box",transition:"border-color 150ms",textAlign:"left",cursor:a?"not-allowed":"pointer",outline:"none",minHeight:s==="sm"?34:s==="lg"?50:42,flexWrap:"wrap"},children:[t.jsx("span",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:4,flex:1,minWidth:0},children:o&&Te.length>0?Te.map(U=>t.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:`${oe.tagPy} ${oe.tagPx}`,fontSize:`calc(${oe.fontSize} - 1px)`,fontFamily:"inherit",backgroundColor:`${I.primary}22`,color:I.primary,borderRadius:6,border:`1px solid ${I.primary}44`,lineHeight:1.4,maxWidth:150,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[t.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:110},children:W(U.label)}),t.jsx("span",{role:"button","aria-label":`Remove ${W(U.label)}`,tabIndex:-1,onClick:le=>de(U.value,le),style:{cursor:"pointer",flexShrink:0,display:"flex",alignItems:"center",opacity:.8},children:t.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:t.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]},U.value)):!o&&g.length>0?(()=>{const U=e.find(le=>le.value===g[0]);return t.jsxs("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:6},children:[(U==null?void 0:U.icon)&&t.jsx("span",{style:{flexShrink:0,display:"flex"},children:U.icon}),U?W(U.label):""]})})():t.jsx("span",{style:{opacity:.6},children:W(i)})}),t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0,color:I.textMuted},children:[h&&t.jsx(hs,{size:oe.iconSize,color:I.primary}),Ee&&!h&&t.jsx("span",{role:"button","aria-label":"Clear selection",tabIndex:-1,onClick:ge,style:{cursor:"pointer",display:"flex",alignItems:"center",lineHeight:1,opacity:.7,transition:"opacity 120ms"},onMouseEnter:U=>U.currentTarget.style.opacity="1",onMouseLeave:U=>U.currentTarget.style.opacity="0.7",children:t.jsx("svg",{width:oe.iconSize,height:oe.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:t.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})}),t.jsx("svg",{width:oe.iconSize,height:oe.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",style:{transform:j?"rotate(180deg)":"rotate(0deg)",transition:"transform 150ms",flexShrink:0},children:t.jsx("path",{d:"M6 9l6 6 6-6"})})]})]})}),u&&!me&&t.jsx("span",{id:T,style:{fontSize:"12px",color:I.textMuted,fontFamily:"inherit"},children:W(u)}),me&&x&&t.jsxs("span",{id:w,role:"alert",style:{fontSize:"12px",color:I.danger,display:"flex",alignItems:"center",gap:4,fontFamily:"inherit"},children:[t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),W(x)]}),Ke]})}Mn.displayName="TkxSelect";const ms={sm:{box:16,fontSize:"13px",iconStroke:2.5},md:{box:20,fontSize:"14px",iconStroke:2.5},lg:{box:24,fontSize:"15px",iconStroke:2}},Cn=c.forwardRef(({label:e,hint:r,isInvalid:n,errorMessage:i,isIndeterminate:s=!1,size:a="md",colorScheme:l="primary",checked:d,defaultChecked:u,onChange:x,disabled:o,className:m,style:p,id:h,...k},z)=>{const y=ee(),S=we(),M=c.useId(),C=h??M,I=`${C}-hint`,R=`${C}-error`,$=c.useRef(null),[N,T]=c.useState(!1),w=ms[a],v=n||!!i,f={primary:y.primary,success:y.success,danger:y.danger,warning:y.warning}[l]??y.primary,g=d!==void 0?d:void 0;c.useEffect(()=>{const Y=(z==null?void 0:z.current)??$.current;Y&&(Y.indeterminate=s)},[s,z]);const j=s||(g??!1),F=j?f:y.surface,L=v?y.danger:j?f:y.border,V=Ue(f),E=N?{outline:`2px solid ${f}`,outlineOffset:"2px"}:{},B=[r&&I,v&&R].filter(Boolean).join(" ")||void 0,P=!S&&j?{animation:"tkx-check-scale-in 120ms ease forwards"}:{};return t.jsxs("div",{className:ue(b("flex flex-col gap-1"),m),style:{opacity:o?.5:1,...p},children:[t.jsx("style",{children:`
5
+ @keyframes tkx-check-scale-in {
6
+ from { transform: scale(0.4); opacity: 0; }
7
+ to { transform: scale(1); opacity: 1; }
8
+ }
9
+ `}),t.jsxs("label",{htmlFor:C,className:b("flex items-center gap-2 select-none"),style:{cursor:o?"not-allowed":"pointer",fontFamily:"inherit"},children:[t.jsx("input",{ref:Y=>{$.current=Y,typeof z=="function"?z(Y):z&&(z.current=Y)},id:C,type:"checkbox",checked:d,defaultChecked:u,onChange:x,disabled:o,"aria-invalid":v,"aria-describedby":B,onFocus:Y=>{Y.target.matches(":focus-visible")&&T(!0)},onBlur:()=>T(!1),className:b("sr-only"),...k}),t.jsx("span",{"aria-hidden":"true",style:{width:w.box,height:w.box,minWidth:w.box,borderRadius:"4px",border:`2px solid ${L}`,backgroundColor:F,display:"flex",alignItems:"center",justifyContent:"center",transition:S?"none":"background-color 120ms, border-color 120ms",boxSizing:"border-box",...E},children:s?t.jsx("span",{"aria-hidden":"true",style:{display:"block",width:w.box*.5,height:2,backgroundColor:V,borderRadius:"1px",...P}}):j?t.jsx("svg",{width:w.box*.6,height:w.box*.6,viewBox:"0 0 24 24",fill:"none",stroke:V,strokeWidth:w.iconStroke,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:P,children:t.jsx("path",{d:"M20 6L9 17l-5-5"})}):null}),e&&t.jsx("span",{style:{fontSize:w.fontSize,color:y.text,lineHeight:1.4},children:typeof e=="string"?W(e):e})]}),r&&!v&&t.jsx("span",{id:I,className:b("text-xs ml-7"),style:{color:y.textMuted,marginLeft:w.box+8},children:W(r)}),v&&i&&t.jsxs("span",{id:R,role:"alert",className:b("text-xs flex items-center gap-1"),style:{color:y.danger,marginLeft:w.box+8},children:[t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),W(i)]})]})});Cn.displayName="TkxCheckbox";const Tn=c.createContext(null);function gs(){return c.useContext(Tn)}const bs={sm:{outer:16,inner:7,fontSize:"13px"},md:{outer:20,inner:9,fontSize:"14px"},lg:{outer:24,inner:11,fontSize:"15px"}},In=c.forwardRef(({label:e,hint:r,size:n="md",colorScheme:i="primary",value:s,checked:a,onChange:l,disabled:d,name:u,className:x,style:o,id:m,...p},h)=>{const k=ee(),z=we(),y=c.useId(),S=m??y,M=gs(),C=M?M.value===String(s??""):a??!1,I=d??(M==null?void 0:M.isDisabled)??!1,R=u??(M==null?void 0:M.name)??"",$=()=>{I||(M?M.onChange(String(s??"")):l==null||l({target:{value:String(s??"")}}))},N=bs[n],w={primary:k.primary,success:k.success,danger:k.danger}[i]??k.primary;Ue(w);const v=C?w:k.border,O=k.surface;return t.jsxs("div",{className:ue(b("flex flex-col gap-0.5"),x),style:{opacity:I?.5:1,...o},children:[t.jsx("style",{children:`
10
+ @keyframes tkx-radio-dot-in {
11
+ from { transform: scale(0) translate(-50%, -50%); opacity: 0; }
12
+ to { transform: scale(1) translate(-50%, -50%); opacity: 1; }
13
+ }
14
+ `}),t.jsxs("label",{htmlFor:S,className:b("flex items-center gap-2 select-none"),style:{cursor:I?"not-allowed":"pointer",fontFamily:"inherit"},children:[t.jsx("input",{ref:h,id:S,type:"radio",name:R,value:s,checked:C,onChange:$,disabled:I,"aria-invalid":M==null?void 0:M.isInvalid,className:b("sr-only"),...p}),t.jsx("span",{"aria-hidden":"true",style:{position:"relative",width:N.outer,height:N.outer,minWidth:N.outer,borderRadius:"50%",border:`2px solid ${v}`,backgroundColor:O,display:"inline-block",boxSizing:"border-box",transition:z?"none":"border-color 120ms"},children:C&&t.jsx("span",{"aria-hidden":"true",style:{position:"absolute",top:"50%",left:"50%",width:N.inner,height:N.inner,borderRadius:"50%",backgroundColor:w,transform:"translate(-50%, -50%)",transformOrigin:"center",...z?{}:{animation:"tkx-radio-dot-in 130ms ease forwards"}}})}),e&&t.jsx("span",{style:{fontSize:N.fontSize,color:k.text,lineHeight:1.4},children:typeof e=="string"?W(e):e})]}),r&&t.jsx("span",{className:b("text-xs"),style:{color:k.textMuted,marginLeft:N.outer+8},children:W(r)})]})});In.displayName="TkxRadio";function ys({name:e,value:r,defaultValue:n="",onChange:i,label:s,orientation:a="vertical",isDisabled:l=!1,isInvalid:d=!1,errorMessage:u,children:x}){const o=ee(),p=`${c.useId()}-error`,[h,k]=c.useState(n),z=r!==void 0,y=z?r:h,S=C=>{z||k(C),i==null||i(C)},M=d||!!u;return t.jsx(Tn.Provider,{value:{name:e,value:y,onChange:S,isDisabled:l,isInvalid:d},children:t.jsxs("div",{role:"radiogroup","aria-label":s?W(s):void 0,"aria-describedby":M?p:void 0,"aria-invalid":M,children:[s&&t.jsx("div",{className:b("text-sm font-medium font-sans mb-2"),style:{color:o.text},children:W(s)}),t.jsx("div",{className:b(a==="horizontal"?"flex flex-row flex-wrap gap-4":"flex flex-col gap-2"),children:x}),M&&u&&t.jsxs("span",{id:p,role:"alert",className:b("text-xs flex items-center gap-1 mt-1"),style:{color:o.danger},children:[t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),W(u)]})]})})}const En=5;let et=[],Ne=[];const er=new Set,pt=new Map;function hr(){const e=[...Ne];er.forEach(r=>r(e))}function zn(e,r){r!==0&&pt.set(e,setTimeout(()=>mr(e),r))}function mr(e){clearTimeout(pt.get(e)),pt.delete(e);const r=Ne.some(n=>n.id===e);if(Ne=Ne.filter(n=>n.id!==e),et=et.filter(n=>n.id!==e),r&&et.length>0&&Ne.length<En){const n=et.shift();Ne=[...Ne,n],zn(n.id,n.duration??4e3)}hr()}function vs(e){const r=`tkx-toast-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,n={...e,id:r,duration:e.duration??4e3};return Ne.length<En?(Ne=[...Ne,n],zn(r,n.duration)):et=[...et,n],hr(),r}function ks(){pt.forEach(e=>clearTimeout(e)),pt.clear(),Ne=[],et=[],hr()}function ws(){const e=c.useCallback(i=>vs(i),[]),r=c.useCallback(i=>mr(i),[]),n=c.useCallback(()=>ks(),[]);return{toast:e,dismiss:r,dismissAll:n}}const js={default:t.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})}),success:t.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z"})}),danger:t.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),warning:t.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),info:t.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})})},Ss={"top-right":{top:16,right:16,alignItems:"flex-end"},"top-left":{top:16,left:16,alignItems:"flex-start"},"top-center":{top:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"bottom-right":{bottom:16,right:16,alignItems:"flex-end"},"bottom-left":{bottom:16,left:16,alignItems:"flex-start"},"bottom-center":{bottom:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"}};function $s(e,r){return r?{}:{animation:`tkx-toast-slide-${e.startsWith("top")?"down":"up"} 220ms cubic-bezier(0.16,1,0.3,1) both`}}function Ms({toast:e,position:r,onDismiss:n,reduced:i}){const s=ee(),a=c.useId(),l={default:s.textMuted,success:s.success,danger:s.danger,warning:s.warning,info:s.info},d=e.variant??"default",u=l[d],x=d==="danger",o=e.title?W(e.title):void 0,m=e.description?W(e.description):void 0;return t.jsxs("div",{role:x?"alert":"status","aria-live":x?"assertive":"polite","aria-atomic":"true","aria-labelledby":o?a:void 0,className:b("flex items-start gap-3 px-4 py-3 rounded-lg shadow-lg font-sans min-w-[280px] max-w-[380px]"),style:{backgroundColor:s.surface,border:`1px solid ${u}55`,boxShadow:`0 8px 24px ${s.bg}cc`,color:s.text,...$s(r,i)},children:[t.jsx("span",{className:b("shrink-0 mt-[2px]"),style:{color:u},children:js[d]}),t.jsxs("div",{className:b("flex-1 min-w-0"),children:[o&&t.jsx("p",{id:a,className:b("m-0 font-semibold text-sm leading-snug"),children:o}),m&&t.jsx("p",{className:b("m-0 text-xs mt-[2px] leading-relaxed"),style:{color:s.textMuted},children:m}),e.action&&t.jsx("button",{onClick:()=>{e.action.onClick(),n(e.id)},className:b("border-none bg-transparent cursor-pointer p-0 mt-2 text-xs font-semibold focus-visible:focus-ring"),style:{color:u},children:W(e.action.label)})]}),t.jsx("button",{"aria-label":"Dismiss notification",onClick:()=>n(e.id),className:b("bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring"),style:{color:s.textMuted},children:t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}function Cs({position:e="top-right"}){const[r,n]=c.useState([...Ne]),i=we();c.useEffect(()=>{n([...Ne]);const u=x=>n([...x]);return er.add(u),()=>{er.delete(u)}},[]);const s=e.startsWith("bottom"),a=Ss[e],l=c.useRef(!1);if(c.useEffect(()=>{if(!(l.current||typeof document>"u")&&(l.current=!0,!document.getElementById("tkx-toast-kf"))){const u=document.createElement("style");u.id="tkx-toast-kf",u.textContent=`
15
+ @keyframes tkx-toast-slide-down {
16
+ from { opacity: 0; transform: translateY(-16px); }
17
+ to { opacity: 1; transform: translateY(0); }
18
+ }
19
+ @keyframes tkx-toast-slide-up {
20
+ from { opacity: 0; transform: translateY(16px); }
21
+ to { opacity: 1; transform: translateY(0); }
22
+ }
23
+ `,document.head.appendChild(u)}},[]),typeof document>"u")return null;const d=s?[...r].reverse():r;return We.createPortal(t.jsx("div",{"aria-label":"Notifications",className:b("fixed z-[9999] flex flex-col gap-2 pointer-events-none"),style:a,children:d.map(u=>t.jsx("div",{className:b("pointer-events-auto"),children:t.jsx(Ms,{toast:u,position:e,onDismiss:mr,reduced:i})},u.id))}),document.body)}const Ts={sm:{triggerPadding:"10px 12px",contentPadding:"0 12px 10px 12px",fontSize:"13px",subtitleSize:"11px",iconSize:14},md:{triggerPadding:"14px 16px",contentPadding:"0 16px 14px 16px",fontSize:"14px",subtitleSize:"12px",iconSize:16},lg:{triggerPadding:"18px 20px",contentPadding:"0 20px 18px 20px",fontSize:"16px",subtitleSize:"13px",iconSize:18}};function Mr({open:e,reduced:r,iconStyle:n,size:i,color:s}){const a=r?"none":"transform 240ms cubic-bezier(0.4, 0, 0.2, 1)";return n==="chevron"?t.jsx("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(180deg)":"rotate(0deg)",transition:a,flexShrink:0},children:t.jsx("polyline",{points:"6 9 12 15 18 9"})}):n==="plus"?t.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(45deg)":"rotate(0deg)",transition:a,flexShrink:0},children:[t.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),t.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}):t.jsxs("svg",{width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:s,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(90deg)":"rotate(0deg)",transition:a,flexShrink:0},children:[t.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),t.jsx("polyline",{points:"12 5 19 12 12 19"})]})}function Is({isOpen:e,reduced:r,children:n,id:i,triggerId:s}){const a=c.useRef(null),l=c.useRef(null),d=c.useRef(e),u=c.useRef(!1);c.useEffect(()=>{const o=a.current;o&&(e?(o.style.height="auto",o.style.overflow="visible"):(o.style.height="0px",o.style.overflow="hidden"))},[]),c.useEffect(()=>{if(d.current===e)return;d.current=e;const o=a.current,m=l.current;if(!(!o||!m)){if(r){o.style.height=e?"auto":"0px",o.style.overflow=e?"visible":"hidden";return}if(u.current){const p=o.getBoundingClientRect().height;o.style.transition="none",o.style.height=`${p}px`,o.offsetHeight}u.current=!0,o.style.overflow="hidden",e?(o.style.height="0px",o.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{o.style.height=`${m.scrollHeight}px`})})):(o.style.height=`${m.scrollHeight}px`,o.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{o.style.height="0px"})}))}},[e,r]);const x=o=>{if(o.propertyName!=="height")return;u.current=!1;const m=a.current;m&&(e?(m.style.height="auto",m.style.overflow="visible"):m.style.overflow="hidden")};return t.jsx("div",{ref:a,id:i,role:"region","aria-labelledby":s,onTransitionEnd:x,style:{willChange:"height"},children:t.jsx("div",{ref:l,children:n})})}function Nn({items:e,multiple:r=!1,defaultOpen:n,value:i,onChange:s,variant:a="default",size:l="md",iconPosition:d="right",iconStyle:u="chevron",flush:x=!1,className:o,style:m}){const p=ee(),h=we(),k=c.useId(),z=i!==void 0,y=v=>v?Array.isArray(v)?new Set(v):new Set([v]):new Set,[S,M]=c.useState(()=>y(n)),C=z?y(i):S,I=c.useCallback((v,O)=>{if(O)return;let f;if(z){const j=y(i);f=new Set(j),f.has(v)?f.delete(v):(r||f.clear(),f.add(v))}else{M(j=>{f=new Set(j),f.has(v)?f.delete(v):(r||f.clear(),f.add(v));const F=[...f];return s==null||s(r?F:F[0]??""),f});return}const g=[...f];s==null||s(r?g:g[0]??"")},[r,s,z,i]),R=Ts[l],$=()=>{if(x)return{};switch(a){case"bordered":return{border:`1px solid ${p.border}`,borderRadius:"10px",overflow:"hidden"};case"separated":return{};case"ghost":case"flush":return{};default:return{}}},N=(v,O,f)=>{if(x)return{};switch(a){case"default":return{borderBottom:f?"none":`1px solid ${p.border}`};case"bordered":return{borderBottom:f?"none":`1px solid ${p.border}`};case"separated":return{border:`1px solid ${p.border}`,borderRadius:"10px",overflow:"hidden",boxShadow:"0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)"};case"ghost":return{};default:return{}}},T=v=>a==="ghost"||a==="flush"?v?`${p.primary}10`:`${p.surfaceAlt}80`:v?`${p.primary}0d`:`${p.surfaceAlt}60`,w=a==="separated";return t.jsx("div",{className:b(o??""),style:{...$(),display:w?"flex":void 0,flexDirection:w?"column":void 0,gap:w?"8px":void 0,...m},children:e.map((v,O)=>{const f=C.has(v.id),g=O===e.length-1,j=`${k}-trigger-${v.id}`,F=`${k}-panel-${v.id}`;return t.jsxs("div",{className:v.className,style:N(O,f,g),children:[t.jsxs("button",{id:j,type:"button",role:"button","aria-expanded":f,"aria-controls":F,disabled:v.disabled,onClick:()=>I(v.id,v.disabled),style:{width:"100%",display:"flex",alignItems:v.subtitle?"flex-start":"center",gap:"8px",padding:R.triggerPadding,border:"none",background:"transparent",cursor:v.disabled?"not-allowed":"pointer",textAlign:"left",fontFamily:"inherit",fontSize:R.fontSize,fontWeight:500,color:v.disabled?p.textMuted:p.text,opacity:v.disabled?.5:1,transition:h?"none":"background-color 160ms ease",outline:"none"},onMouseEnter:L=>{v.disabled||(L.currentTarget.style.backgroundColor=T(f))},onMouseLeave:L=>{L.currentTarget.style.backgroundColor=f?`${p.primary}0d`:"transparent"},onFocus:L=>{v.disabled||(L.currentTarget.style.outline=`2px solid ${p.primary}`,L.currentTarget.style.outlineOffset="2px")},onBlur:L=>{L.currentTarget.style.outline="none"},children:[v.icon&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:p.primary,marginTop:v.subtitle?"1px":void 0},children:v.icon}),d==="left"&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:f?p.primary:p.textMuted,marginTop:v.subtitle?"1px":void 0},children:t.jsx(Mr,{open:f,reduced:h,iconStyle:u,size:R.iconSize,color:f?p.primary:p.textMuted})}),t.jsxs("span",{style:{flex:1,minWidth:0},children:[t.jsx("span",{style:{display:"block",lineHeight:1.4},children:v.title}),v.subtitle&&t.jsx("span",{style:{display:"block",fontSize:R.subtitleSize,color:p.textMuted,fontWeight:400,marginTop:"2px",lineHeight:1.3},children:v.subtitle})]}),v.badge&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0},children:v.badge}),d==="right"&&t.jsx("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:f?p.primary:p.textMuted,marginTop:v.subtitle?"1px":void 0},children:t.jsx(Mr,{open:f,reduced:h,iconStyle:u,size:R.iconSize,color:f?p.primary:p.textMuted})})]}),t.jsx(Is,{isOpen:f,reduced:h,id:F,triggerId:j,children:t.jsx("div",{style:{padding:R.contentPadding,fontSize:R.fontSize,lineHeight:1.6,color:p.textMuted,fontFamily:"inherit"},children:v.content})})]},v.id)})})}Nn.displayName="TkxAccordion";const Es={sm:"280px",md:"380px",lg:"480px",xl:"600px",full:"100%"};let tr=0;function zs(){++tr===1&&(document.body.style.overflow="hidden")}function Cr(){--tr<=0&&(tr=0,document.body.style.overflow="")}function Ns(e){switch(e){case"left":return"translateX(-100%)";case"right":return"translateX(100%)";case"top":return"translateY(-100%)";case"bottom":return"translateY(100%)"}}function Rs(e,r){const n=Es[r],i=e==="left"||e==="right",s={position:"absolute"};return i?{...s,top:0,bottom:0,[e]:0,width:n,maxWidth:"100vw",height:"100%"}:{...s,left:0,right:0,[e]:0,height:n,maxHeight:"100vh",width:"100%"}}function Tr(){return t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function As({isOpen:e,onClose:r,placement:n="right",size:i="md",title:s,children:a,footer:l,closeOnOverlayClick:d=!0,closeOnEsc:u=!0}){const x=ee(),o=we(),m=c.useId(),p=At(e);if(Lt(r,u&&e),c.useEffect(()=>(e?zs():Cr(),()=>{e&&Cr()}),[e]),typeof document>"u")return null;const h=Rs(n,i),k=Ns(n),z=o?"none":"transform 280ms cubic-bezier(0.4,0,0.2,1), opacity 280ms ease",y=typeof s=="string"?W(s):s;return We.createPortal(t.jsxs("div",{role:"presentation",className:b("fixed inset-0 z-[9000]"),style:{pointerEvents:e?"auto":"none",visibility:e?"visible":"hidden"},children:[t.jsx("div",{"aria-hidden":"true",onClick:d?r:void 0,className:b("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(3px)",opacity:e?1:0,transition:o?"none":"opacity 280ms ease",cursor:d?"pointer":"default"}}),t.jsxs("div",{ref:p,role:"dialog","aria-modal":"true","aria-labelledby":s?m:void 0,className:b("absolute flex flex-col font-sans"),style:{...h,backgroundColor:x.surface,borderLeft:n==="right"?`1px solid ${x.border}`:void 0,borderRight:n==="left"?`1px solid ${x.border}`:void 0,borderTop:n==="bottom"?`1px solid ${x.border}`:void 0,borderBottom:n==="top"?`1px solid ${x.border}`:void 0,boxShadow:`0 20px 60px ${x.bg}99`,transform:e?"translate(0,0)":k,opacity:e?1:0,transition:z,willChange:"transform"},children:[s!==void 0&&t.jsxs("div",{className:b("flex items-center justify-between px-5 py-4 shrink-0"),style:{borderBottom:`1px solid ${x.border}`},children:[t.jsx("h2",{id:m,className:b("m-0 text-base font-semibold leading-snug"),style:{color:x.text},children:y}),t.jsx("button",{onClick:r,"aria-label":"Close drawer",className:b("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:x.textMuted},children:t.jsx(Tr,{})})]}),s===void 0&&t.jsx("div",{className:b("flex justify-end px-3 pt-3 shrink-0"),children:t.jsx("button",{onClick:r,"aria-label":"Close drawer",className:b("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:x.textMuted},children:t.jsx(Tr,{})})}),t.jsx("div",{className:b("flex-1 overflow-y-auto px-5 py-4"),style:{color:x.text},children:a}),l&&t.jsx("div",{className:b("flex items-center justify-end gap-2 px-5 py-4 shrink-0"),style:{borderTop:`1px solid ${x.border}`},children:l})]})]}),document.body)}const Ls=["Su","Mo","Tu","We","Th","Fr","Sa"],Ir=["January","February","March","April","May","June","July","August","September","October","November","December"],Ds=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Re(e,r){return e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()}function ze(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function Fs(e,r,n){if(!r||!n)return!1;const i=ze(e).getTime(),s=ze(r).getTime(),a=ze(n).getTime(),l=Math.min(s,a),d=Math.max(s,a);return i>l&&i<d}function Er(e,r,n){return!!(r&&Re(e,r)||n&&Re(e,n))}function _e(e,r="en-US"){return e?e.toLocaleDateString(r,{month:"2-digit",day:"2-digit",year:"numeric"}):""}function Bs(e){const r=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(!r)return null;const[,n,i,s]=r.map(Number);if(n<1||n>12||i<1||i>31)return null;const a=new Date(s,n-1,i);return a.getMonth()!==n-1?null:a}function zr(e,r){return new Date(e,r+1,0).getDate()}function Ws(e,r){const n=new Date(e,r,1).getDay(),i=zr(e,r),s=[],a=zr(e,r-1);for(let d=n-1;d>=0;d--)s.push(new Date(e,r-1,a-d));for(let d=1;d<=i;d++)s.push(new Date(e,r,d));let l=1;for(;s.length<42;)s.push(new Date(e,r+1,l++));return s}function Ot(e){return Math.floor(e/10)*10}function Ps(){return[{label:"Today",getValue:()=>{const e=ze(new Date);return[e,e]}},{label:"Yesterday",getValue:()=>{const e=ze(new Date);return e.setDate(e.getDate()-1),[e,e]}},{label:"Last 7 days",getValue:()=>{const e=ze(new Date),r=new Date(e);return r.setDate(r.getDate()-6),[r,e]}},{label:"Last 30 days",getValue:()=>{const e=ze(new Date),r=new Date(e);return r.setDate(r.getDate()-29),[r,e]}},{label:"Last 90 days",getValue:()=>{const e=ze(new Date),r=new Date(e);return r.setDate(r.getDate()-89),[r,e]}},{label:"This week",getValue:()=>{const e=ze(new Date),r=new Date(e);r.setDate(r.getDate()-r.getDay());const n=new Date(r);return n.setDate(n.getDate()+6),[r,n]}},{label:"Last week",getValue:()=>{const e=ze(new Date),r=new Date(e);r.setDate(r.getDate()-r.getDay()-1);const n=new Date(r);return n.setDate(n.getDate()-6),[n,r]}},{label:"This month",getValue:()=>{const e=new Date;return[new Date(e.getFullYear(),e.getMonth(),1),new Date(e.getFullYear(),e.getMonth()+1,0)]}},{label:"Last month",getValue:()=>{const e=new Date;return[new Date(e.getFullYear(),e.getMonth()-1,1),new Date(e.getFullYear(),e.getMonth(),0)]}},{label:"This quarter",getValue:()=>{const e=new Date,r=Math.floor(e.getMonth()/3);return[new Date(e.getFullYear(),r*3,1),new Date(e.getFullYear(),r*3+3,0)]}},{label:"Last quarter",getValue:()=>{const e=new Date,r=Math.floor(e.getMonth()/3),n=r===0?3:r-1,i=r===0?e.getFullYear()-1:e.getFullYear();return[new Date(i,n*3,1),new Date(i,n*3+3,0)]}},{label:"This year",getValue:()=>{const e=new Date().getFullYear();return[new Date(e,0,1),new Date(e,11,31)]}},{label:"Last year",getValue:()=>{const e=new Date().getFullYear()-1;return[new Date(e,0,1),new Date(e,11,31)]}}]}function Hs(e,r){const n=e.getBoundingClientRect(),i=window.innerHeight,s=window.scrollY,a=window.scrollX,d=i-n.bottom<r+8&&n.top>r+8;return{top:d?s+n.top-r-4:s+n.bottom+4,left:a+n.left,flipUp:d}}function Nr({values:e,selected:r,onSelect:n,label:i,theme:s,format:a}){const l=c.useRef([]),d=c.useRef(null);c.useEffect(()=>{const x=l.current[r];x&&d.current&&x.scrollIntoView({block:"nearest"})},[r]);const u=a??(x=>String(x).padStart(2,"0"));return t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px"},children:[t.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:s.textMuted,textTransform:"uppercase",letterSpacing:"0.05em"},children:i}),t.jsx("div",{ref:d,style:{height:"160px",overflowY:"auto",width:"52px",scrollbarWidth:"thin",border:`1px solid ${s.border}`,borderRadius:"8px",padding:"4px"},children:e.map(x=>{const o=x===r;return t.jsx("button",{ref:m=>{l.current[x]=m},type:"button",onClick:()=>n(x),style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"32px",borderRadius:"6px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:o?600:400,backgroundColor:o?s.primary:"transparent",color:o?s.bg:s.text,fontFamily:"monospace",transition:"background-color 100ms ease"},children:u(x)},x)})})]})}function Rr({year:e,month:r,today:n,mode:i,selectedDate:s,selectedRange:a,multiDates:l,hoverDate:d,focusedDate:u,isDateDisabled:x,onSelectDate:o,onHoverDate:m,onSetFocused:p,theme:h,locale:k}){const z=Ws(e,r);return t.jsxs("div",{children:[t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px",marginBottom:"4px"},children:Ls.map(y=>t.jsx("div",{style:{textAlign:"center",fontSize:"11px",fontWeight:600,color:h.textMuted,padding:"4px 0",textTransform:"uppercase",letterSpacing:"0.05em"},children:y},y))}),t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px"},children:z.map((y,S)=>{const M=y.getMonth()===r,C=Re(y,n),I=y.getDay()===0||y.getDay()===6,R=x(y),$=i==="single"&&s!=null&&Re(y,s),N=i==="multiple"&&l.some(Y=>Re(Y,y)),T=i==="range"&&Er(y,a[0],null),w=i==="range"&&Er(y,null,a[1]),v=T||w,O=i==="range"&&a[0]&&!a[1]&&d?d:a[1],f=i==="range"&&Fs(y,a[0],O),g=i==="range"&&a[0]&&!a[1]&&d&&Re(y,d),j=$||N||v,F=u!=null&&Re(y,u);let L="transparent",V=M?I?`${h.text}cc`:h.text:`${h.textMuted}60`,E="none",B=400;j||g?(L=h.primary,V=h.bg,B=600):f&&(L=`${h.primary}18`),C&&!j&&(E=`2px solid ${h.primary}`,B=600),R&&(V=`${h.textMuted}50`),F&&!j&&(E=`2px solid ${h.secondary}`);const P=y.toLocaleDateString(k,{weekday:"long",year:"numeric",month:"long",day:"numeric"});return t.jsx("button",{type:"button","aria-label":P,"aria-pressed":j,"aria-disabled":R,disabled:R,onClick:()=>!R&&o(y),onMouseEnter:()=>m(y),onMouseLeave:()=>m(null),onFocus:()=>p(y),style:{width:"34px",height:"34px",borderRadius:"8px",backgroundColor:L,color:V,border:E,fontSize:"13px",fontWeight:B,cursor:R?"not-allowed":"pointer",opacity:R?.35:1,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"inherit",position:"relative",outline:"none",textDecoration:R?"line-through":"none",transition:"background-color 80ms ease"},children:y.getDate()},S)})})]})}function Rn({value:e,onChange:r,rangeValue:n,onRangeChange:i,multiValue:s,onMultiChange:a,mode:l="single",minDate:d,maxDate:u,disabledDates:x,locale:o="en-US",showTime:m=!1,timeValue:p,onTimeChange:h,showPresets:k=!1,customPresets:z,label:y,placeholder:S="MM/DD/YYYY",hint:M,isDisabled:C=!1,isInvalid:I=!1,errorMessage:R,numberOfMonths:$=1,id:N,className:T,style:w}){const v=ee(),O=c.useId(),f=N??O,g=we(),j=ze(new Date),F=e!==void 0,[L,V]=c.useState(null),E=F?e??null:L,B=n!==void 0,[P,Y]=c.useState([null,null]),A=B?n:P,H=s!==void 0,[Q,G]=c.useState([]),ne=H?s:Q,[pe,xe]=c.useState("start"),oe=l==="range"||l==="single"&&m,[me,X]=c.useState([null,null]),[Z,ye]=c.useState(null),ke=E??A[0]??j,[de,ge]=c.useState(ke.getFullYear()),[J,ie]=c.useState(ke.getMonth()),[re,q]=c.useState("day"),[te,be]=c.useState({h:0,m:0}),$e=p??te,[Me,Te]=c.useState(!1),[Ke,Ee]=c.useState(()=>{if(l==="single")return _e(E,o);if(l==="range"){const[_,K]=A;if(_&&K)return`${_e(_,o)} – ${_e(K,o)}`}return""}),[U,le]=c.useState(null),[se,Se]=c.useState(null),[Ae,Le]=c.useState({top:0,left:0,flipUp:!1}),[,at]=c.useReducer(_=>_+1,0),rt=c.useRef(null),xt=c.useRef(null),ht=c.useRef(null),mt=k?420:m?480:360;c.useEffect(()=>{if(l==="single")Ee(_e(E,o));else if(l==="range"){const[_,K]=A;Ee(_&&K?`${_e(_,o)} – ${_e(K,o)}`:_?_e(_,o):"")}else l==="multiple"&&Ee(ne.length>0?`${ne.length} date${ne.length!==1?"s":""} selected`:"")},[E,A,ne,l,o]);const Ye=c.useCallback(()=>{rt.current&&Le(Hs(rt.current,mt))},[mt]);c.useEffect(()=>{if(Me)return Ye(),window.addEventListener("scroll",Ye,!0),window.addEventListener("resize",Ye),()=>{window.removeEventListener("scroll",Ye,!0),window.removeEventListener("resize",Ye)}},[Me,Ye]),c.useEffect(()=>{if(!Me)return;const _=K=>{var ce,je;(ce=rt.current)!=null&&ce.contains(K.target)||(je=xt.current)!=null&&je.contains(K.target)||Te(!1)};return document.addEventListener("pointerdown",_),()=>document.removeEventListener("pointerdown",_)},[Me]),c.useEffect(()=>{if(!Me)return;const _=K=>{var ce;K.key==="Escape"&&(Te(!1),(ce=ht.current)==null||ce.focus())};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[Me]);const Xe=c.useCallback(_=>d&&ze(_)<ze(d)||u&&ze(_)>ze(u)?!0:x?typeof x=="function"?x(_):x.some(K=>Re(K,_)):!1,[d,u,x]),nt=c.useCallback(_=>{if(!Xe(_)){if(l==="single")oe?ye(_):(F||V(_),r==null||r(_),Ee(_e(_,o)),Te(!1));else if(l==="range")if(pe==="start"){const K=[_,null];X(K),B||Y(K),i==null||i(K),xe("end")}else{const K=me[0]??A[0],ce=K&&_<K?[_,K]:[K,_];X(ce),oe?xe("start"):(B||Y(ce),i==null||i(ce),xe("start"),Te(!1))}else if(l==="multiple"){const ce=ne.some(je=>Re(je,_))?ne.filter(je=>!Re(je,_)):[...ne,_];H||G(ce),a==null||a(ce)}at()}},[l,Xe,F,B,H,r,i,a,pe,me,A,ne,oe,o]),Dt=c.useCallback(()=>{if(l==="single"){const _=Z??E;F||V(_),r==null||r(_)}else l==="range"&&(B||Y(me),i==null||i(me));Te(!1),xe("start")},[l,Z,me,E,F,B,r,i]),Ft=c.useCallback(()=>{ye(null),X([null,null]),xe("start"),Te(!1)},[]),gt=()=>{J===0?(ie(11),ge(_=>_-1)):ie(_=>_-1),q("day")},bt=()=>{J===11?(ie(0),ge(_=>_+1)):ie(_=>_+1),q("day")},Bt=()=>ge(_=>_-1),Wt=()=>ge(_=>_+1),yt=()=>ge(_=>_-10),vt=()=>ge(_=>_+10),Pt=_=>{if(Ee(_),l==="single"){const K=Bs(_);K&&!Xe(K)&&(F||V(K),r==null||r(K),ge(K.getFullYear()),ie(K.getMonth()))}},kt=_=>{if(_.stopPropagation(),l==="single")F||V(null),r==null||r(null),Ee("");else if(l==="range"){const K=[null,null];B||Y(K),i==null||i(K),X(K),Ee(""),xe("start")}else l==="multiple"&&(H||G([]),a==null||a([]),Ee(""))},Ht=_=>{if(re!=="day")return;const K=U??E??j;let ce=null;if(_.key==="ArrowRight")ce=new Date(K.getFullYear(),K.getMonth(),K.getDate()+1);else if(_.key==="ArrowLeft")ce=new Date(K.getFullYear(),K.getMonth(),K.getDate()-1);else if(_.key==="ArrowDown")ce=new Date(K.getFullYear(),K.getMonth(),K.getDate()+7);else if(_.key==="ArrowUp")ce=new Date(K.getFullYear(),K.getMonth(),K.getDate()-7);else if(_.key==="Enter"&&U){nt(U);return}ce&&(_.preventDefault(),le(ce),(ce.getMonth()!==J||ce.getFullYear()!==de)&&(ie(ce.getMonth()),ge(ce.getFullYear())))},D=()=>{ge(j.getFullYear()),ie(j.getMonth()),q("day"),nt(j)},fe=z??Ps(),ve=_=>{const[K,ce]=_.getValue(),je=[K,ce];X(je),B||Y(je),i==null||i(je),ge(K.getFullYear()),ie(K.getMonth()),xe("start"),oe||Te(!1)},Ce=J===11?0:J+1,qe=J===11?de+1:de,Oe=$>=2,lt=y?W(y):void 0,ct=M?W(M):void 0,dt=R?W(R):void 0,wt=W(S),jt=l==="single"&&E!=null||l==="range"&&(A[0]!=null||A[1]!=null)||l==="multiple"&&ne.length>0,Fe=l==="range"?oe?me:A:[null,null],qn=I?v.danger:Me?v.primary:v.border,Zn=Array.from({length:24},(_,K)=>K),Gn=Array.from({length:60},(_,K)=>K),Jn=t.jsxs("div",{ref:xt,role:"dialog","aria-label":"Date picker","aria-modal":"false",onKeyDown:Ht,style:{position:"absolute",top:Ae.top,left:Ae.left,zIndex:9999,backgroundColor:v.surface,border:`1px solid ${v.border}`,borderRadius:"14px",boxShadow:"0 8px 30px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1)",display:"flex",overflow:"hidden",minWidth:Oe?"580px":"300px",maxWidth:Oe&&k?"780px":Oe?"620px":k?"520px":"300px",opacity:Me?1:0,transform:Me?"translateY(0) scale(1)":Ae.flipUp?"translateY(4px) scale(0.98)":"translateY(-4px) scale(0.98)",transition:g?"none":"opacity 120ms ease, transform 120ms ease",fontFamily:"inherit"},children:[k&&l==="range"&&t.jsxs("div",{style:{width:"148px",flexShrink:0,borderRight:`1px solid ${v.border}`,padding:"8px 6px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"1px"},children:[t.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:v.textMuted,textTransform:"uppercase",letterSpacing:"0.07em",padding:"4px 8px 8px"},children:"Quick select"}),fe.map(_=>{const[K,ce]=_.getValue(),je=Fe[0]&&Fe[1]&&Re(Fe[0],K)&&Re(Fe[1],ce);return t.jsx("button",{type:"button",onClick:()=>ve(_),style:{width:"100%",textAlign:"left",padding:"7px 10px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",backgroundColor:je?`${v.primary}20`:"transparent",color:je?v.primary:v.text,fontWeight:je?600:400,fontFamily:"inherit",transition:"background-color 80ms ease"},onMouseEnter:ut=>{je||(ut.currentTarget.style.backgroundColor=`${v.surfaceAlt}`)},onMouseLeave:ut=>{je||(ut.currentTarget.style.backgroundColor="transparent")},children:_.label},_.label)})]}),t.jsxs("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:"column",gap:"12px",minWidth:0},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[t.jsx("button",{type:"button","aria-label":re==="day"?"Previous month":re==="month"?"Previous year":"Previous decade",onClick:()=>{re==="day"?gt():re==="month"?Bt():yt()},style:{border:"none",background:"transparent",cursor:"pointer",color:v.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t.jsx("polyline",{points:"15 18 9 12 15 6"})})}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[re==="day"&&t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",onClick:()=>q("month"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:v.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:Ir[J]}),t.jsx("button",{type:"button",onClick:()=>q("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:v.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:de}),Oe&&t.jsxs(t.Fragment,{children:[t.jsx("span",{style:{color:v.textMuted,fontSize:"14px"},children:"–"}),t.jsxs("span",{style:{fontSize:"14px",fontWeight:600,color:v.text},children:[Ir[Ce]," ",qe]})]})]}),re==="month"&&t.jsx("button",{type:"button",onClick:()=>q("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:v.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:de}),re==="year"&&t.jsxs("span",{style:{fontSize:"14px",fontWeight:600,color:v.text},children:[Ot(de),"–",Ot(de)+9]})]}),t.jsx("button",{type:"button","aria-label":re==="day"?"Next month":re==="month"?"Next year":"Next decade",onClick:()=>{re==="day"?bt():re==="month"?Wt():vt()},style:{border:"none",background:"transparent",cursor:"pointer",color:v.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t.jsx("polyline",{points:"9 18 15 12 9 6"})})})]}),re==="day"&&t.jsxs("div",{style:{display:"flex",gap:"20px"},children:[t.jsx(Rr,{year:de,month:J,today:j,mode:l,selectedDate:E,selectedRange:Fe,multiDates:ne,hoverDate:se,focusedDate:U,isDateDisabled:Xe,onSelectDate:nt,onHoverDate:Se,onSetFocused:le,theme:v,locale:o}),Oe&&t.jsx(Rr,{year:qe,month:Ce,today:j,mode:l,selectedDate:E,selectedRange:Fe,multiDates:ne,hoverDate:se,focusedDate:U,isDateDisabled:Xe,onSelectDate:nt,onHoverDate:Se,onSetFocused:le,theme:v,locale:o})]}),re==="month"&&t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"6px"},children:Ds.map((_,K)=>{const ce=K===J,je=K===j.getMonth()&&de===j.getFullYear();return t.jsx("button",{type:"button",onClick:()=>{ie(K),q("day")},style:{padding:"10px",borderRadius:"8px",border:je&&!ce?`2px solid ${v.primary}`:"none",cursor:"pointer",fontSize:"13px",fontWeight:ce?600:400,backgroundColor:ce?v.primary:"transparent",color:ce?v.bg:v.text,fontFamily:"inherit",transition:"background-color 80ms ease"},children:_},_)})}),re==="year"&&t.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"6px"},children:Array.from({length:12},(_,K)=>{const ce=Ot(de)-1+K,je=ce===de,ut=ce===j.getFullYear(),gr=K===0||K===11;return t.jsx("button",{type:"button",onClick:()=>{ge(ce),q("month")},style:{padding:"10px 6px",borderRadius:"8px",border:ut&&!je?`2px solid ${v.primary}`:"none",cursor:"pointer",fontSize:"13px",fontWeight:je?600:400,backgroundColor:je?v.primary:"transparent",color:je?v.bg:gr?v.textMuted:v.text,fontFamily:"inherit",transition:"background-color 80ms ease",opacity:gr?.5:1},children:ce},ce)})}),m&&re==="day"&&t.jsxs("div",{style:{borderTop:`1px solid ${v.border}`,paddingTop:"12px",display:"flex",alignItems:"flex-start",gap:"8px",justifyContent:"center"},children:[t.jsx(Nr,{values:Zn,selected:$e.h,onSelect:_=>{p||be(K=>({...K,h:_})),h==null||h({...$e,h:_})},label:"Hour",theme:v}),t.jsx("div",{style:{display:"flex",alignItems:"center",height:"40px",marginTop:"28px",fontSize:"16px",fontWeight:700,color:v.textMuted},children:":"}),t.jsx(Nr,{values:Gn,selected:$e.m,onSelect:_=>{p||be(K=>({...K,m:_})),h==null||h({...$e,m:_})},label:"Min",theme:v})]}),l==="multiple"&&re==="day"&&ne.length>0&&t.jsxs("div",{style:{borderTop:`1px solid ${v.border}`,paddingTop:"8px",fontSize:"12px",color:v.textMuted,textAlign:"center"},children:[ne.length," date",ne.length!==1?"s":""," selected"]}),t.jsxs("div",{style:{borderTop:`1px solid ${v.border}`,paddingTop:"10px",display:"flex",alignItems:"center",justifyContent:oe?"space-between":"flex-start",gap:"8px"},children:[t.jsx("button",{type:"button",onClick:D,style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"13px",color:v.primary,fontWeight:500,padding:"6px 10px",borderRadius:"6px",fontFamily:"inherit"},children:"Today"}),oe&&t.jsxs("div",{style:{display:"flex",gap:"6px"},children:[t.jsx("button",{type:"button",onClick:Ft,style:{padding:"6px 14px",borderRadius:"7px",border:`1px solid ${v.border}`,cursor:"pointer",fontSize:"13px",fontWeight:500,backgroundColor:"transparent",color:v.text,fontFamily:"inherit"},children:"Cancel"}),t.jsx("button",{type:"button",onClick:Dt,style:{padding:"6px 14px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:600,backgroundColor:v.primary,color:v.bg,fontFamily:"inherit"},children:"Apply"})]})]})]})]});return t.jsxs("div",{className:T,style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%",position:"relative",...w},children:[lt&&t.jsx("label",{htmlFor:f,style:{fontSize:"13px",fontWeight:500,color:v.text,marginBottom:"2px"},children:lt}),t.jsxs("div",{ref:rt,style:{display:"flex",alignItems:"center",border:`1.5px solid ${qn}`,borderRadius:"8px",backgroundColor:v.surface,overflow:"hidden",transition:g?"none":"border-color 120ms ease",opacity:C?.5:1},children:[t.jsx("span",{style:{display:"flex",alignItems:"center",paddingLeft:"10px",color:v.textMuted,flexShrink:0},children:t.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),t.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),t.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),t.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}),t.jsx("input",{ref:ht,id:f,type:"text",value:Ke,placeholder:wt,disabled:C,"aria-invalid":I,"aria-haspopup":"dialog","aria-expanded":Me,readOnly:l==="range"||l==="multiple",onChange:_=>Pt(_.target.value),onFocus:()=>{C||Te(!0)},style:{flex:1,backgroundColor:"transparent",border:"none",outline:"none",fontSize:"14px",padding:"9px 8px",color:v.text,cursor:l!=="single"?"pointer":"text",fontFamily:"inherit",minWidth:0}}),jt&&!C&&t.jsx("button",{type:"button","aria-label":"Clear selection",onClick:kt,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",background:"transparent",cursor:"pointer",color:v.textMuted,flexShrink:0,borderRadius:"4px",marginRight:"4px"},children:t.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),t.jsx("button",{type:"button","aria-label":Me?"Close calendar":"Open calendar",tabIndex:-1,disabled:C,onClick:()=>{C||Te(_=>!_)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"34px",height:"36px",border:"none",background:"transparent",cursor:C?"not-allowed":"pointer",color:v.textMuted,flexShrink:0},children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:Me?"rotate(180deg)":"rotate(0deg)",transition:g?"none":"transform 160ms ease"},children:t.jsx("polyline",{points:"6 9 12 15 18 9"})})})]}),ct&&!I&&t.jsx("span",{style:{fontSize:"12px",color:v.textMuted},children:ct}),I&&dt&&t.jsx("span",{role:"alert",style:{fontSize:"12px",color:v.danger},children:dt}),Me&&typeof document<"u"&&We.createPortal(Jn,document.body)]})}Rn.displayName="TkxDatePicker";const Vs={sm:{track:4,thumb:14,fontSize:"0.75rem"},md:{track:6,thumb:18,fontSize:"0.875rem"},lg:{track:8,thumb:22,fontSize:"1rem"}};function Qe(e,r,n){return Math.min(Math.max(e,r),n)}function rr(e,r,n){return Math.round((e-r)/n)*n+r}function Ve(e,r,n){return(e-r)/(n-r)*100}function _t({value:e,min:r,max:n,step:i,isDisabled:s,trackColor:a,thumbSize:l,ariaLabel:d,tooltipMode:u,formatValue:x,orientation:o,onChange:m,onChangeEnd:p}){const[h,k]=c.useState(!1),[z,y]=c.useState(!1),[S,M]=c.useState(!1),C=w=>{s||(w.key==="ArrowRight"||w.key==="ArrowUp"?(w.preventDefault(),m(Qe(rr(e+i,r,i),r,n))):w.key==="ArrowLeft"||w.key==="ArrowDown"?(w.preventDefault(),m(Qe(rr(e-i,r,i),r,n))):w.key==="Home"?(w.preventDefault(),m(r)):w.key==="End"&&(w.preventDefault(),m(n)))},I=o==="vertical",R=Ve(e,r,n),$=u==="always"||u==="hover"&&(S||z||h),N=I?{position:"absolute",bottom:`${R}%`,transform:"translateY(50%)",left:"50%",marginLeft:`-${l/2}px`,zIndex:2,cursor:s?"not-allowed":"grab"}:{position:"absolute",left:`${R}%`,transform:"translateX(-50%)",top:"50%",marginTop:`-${l/2}px`,zIndex:2,cursor:s?"not-allowed":"grab"},T=I?{position:"absolute",left:l+6,top:"50%",transform:"translateY(-50%)",backgroundColor:a,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"}:{position:"absolute",bottom:l+6,left:"50%",transform:"translateX(-50%)",backgroundColor:a,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"};return t.jsxs("div",{style:N,children:[$&&t.jsx("div",{style:T,children:x(e)}),t.jsx("div",{role:"slider",tabIndex:s?-1:0,"aria-label":d,"aria-valuemin":r,"aria-valuemax":n,"aria-valuenow":e,"aria-disabled":s,"aria-orientation":o,onKeyDown:C,onFocus:()=>k(!0),onBlur:()=>k(!1),onPointerEnter:()=>M(!0),onPointerLeave:()=>M(!1),onPointerDown:w=>{s||(y(!0),w.target.setPointerCapture(w.pointerId))},onPointerUp:()=>{y(!1),p==null||p()},style:{width:l,height:l,borderRadius:"50%",backgroundColor:s?"#888":a,border:"3px solid #fff",boxShadow:h?`0 0 0 3px ${a}44`:"0 1px 4px rgba(0,0,0,0.3)",outline:"none",display:"block",transition:"box-shadow 150ms ease"}})]})}function An({value:e,defaultValue:r=0,onChange:n,rangeValue:i,onRangeChange:s,min:a=0,max:l=100,step:d=1,isRange:u=!1,label:x,showValue:o=!1,showTicks:m=!1,tickCount:p=5,isDisabled:h=!1,colorScheme:k="primary",size:z="md",marks:y,orientation:S="horizontal",showTooltip:M=!1,formatValue:C,onChangeEnd:I,onRangeChangeEnd:R,gradient:$=!1}){const N=ee(),T=c.useId(),w=we(),v=e!==void 0,[O,f]=c.useState(r),g=v?e:O,j=i!==void 0,[F,L]=c.useState([a,l]),V=j?i:F,E=c.useRef(null),B=c.useRef(g);B.current=g;const P=c.useRef(V);P.current=V;const Y={primary:N.primary,success:N.success,danger:N.danger,warning:N.warning}[k],A=Vs[z],H=S==="vertical",Q=M===!0?"hover":M===!1?!1:M,G=C??(J=>String(J)),ne=Y+"66",pe=c.useCallback((J,ie)=>{const re=E.current;if(!re)return a;const q=re.getBoundingClientRect();let te;H?te=Qe((q.bottom-(ie??0))/q.height,0,1):te=Qe((J-q.left)/q.width,0,1);const be=te*(l-a)+a;return Qe(rr(be,a,d),a,l)},[a,l,d,H]),xe=c.useCallback(J=>{if(h)return;const ie=pe(J.clientX,J.clientY);if(!u)v||f(ie),n==null||n(ie);else{const[re,q]=V,te=Math.abs(ie-re),be=Math.abs(ie-q),$e=te<=be?[ie,q]:[re,ie];j||L($e),s==null||s($e)}},[h,u,v,j,pe,n,s,V]),oe=J=>{v||f(J),n==null||n(J)},me=J=>{const ie=[Qe(J,a,V[1]),V[1]];j||L(ie),s==null||s(ie)},X=J=>{const ie=[V[0],Qe(J,V[0],l)];j||L(ie),s==null||s(ie)},Z=u?Ve(V[0],a,l):0,ye=Ve(u?V[1]:g,a,l),ke=m?Array.from({length:p},(J,ie)=>a+ie/(p-1)*(l-a)):[],de=x?W(x):void 0,ge=w?"none":"background 150ms ease";return t.jsxs("div",{className:b("flex flex-col gap-2"),style:{opacity:h?.55:1,...H?{height:200,width:"auto",display:"inline-flex"}:{width:"100%"}},children:[(de||o)&&t.jsxs("div",{className:b("flex items-center justify-between"),children:[de&&t.jsx("label",{htmlFor:T,className:b("text-sm font-medium"),style:{color:N.text,fontSize:A.fontSize},children:de}),o&&!u&&t.jsx("span",{className:b("text-sm tabular-nums"),style:{color:N.textMuted,fontSize:A.fontSize},children:G(g)}),o&&u&&t.jsxs("span",{className:b("text-sm tabular-nums"),style:{color:N.textMuted,fontSize:A.fontSize},children:[G(V[0])," – ",G(V[1])]})]}),t.jsxs("div",{style:{position:"relative",...H?{paddingLeft:A.thumb/2,paddingRight:A.thumb/2,flex:1}:{paddingTop:A.thumb/2,paddingBottom:A.thumb/2}},children:[t.jsxs("div",{ref:E,onPointerDown:xe,style:{position:"relative",...H?{width:A.track,height:"100%"}:{height:A.track},borderRadius:9999,backgroundColor:N.border,cursor:h?"not-allowed":"pointer",userSelect:"none"},children:[t.jsx("div",{style:{position:"absolute",...H?{left:0,bottom:`${Z}%`,height:`${ye-Z}%`,width:"100%"}:{top:0,left:`${Z}%`,width:`${ye-Z}%`,height:"100%"},borderRadius:9999,...h?{backgroundColor:N.textMuted}:$?{background:H?`linear-gradient(to top, ${ne}, ${Y})`:`linear-gradient(to right, ${ne}, ${Y})`}:{backgroundColor:Y},transition:ge}}),ke.map((J,ie)=>t.jsx("div",{style:{position:"absolute",...H?{bottom:`${Ve(J,a,l)}%`,left:"50%",transform:"translate(-50%, 50%)",height:3,width:A.track+4}:{left:`${Ve(J,a,l)}%`,top:"50%",transform:"translate(-50%, -50%)",width:3,height:A.track+4},backgroundColor:N.surface,borderRadius:9999,pointerEvents:"none"}},ie)),u?t.jsxs(t.Fragment,{children:[t.jsx(_t,{value:V[0],min:a,max:V[1],step:d,isDisabled:h,trackColor:Y,trackHeight:A.track,thumbSize:A.thumb,ariaLabel:`${de??"Range"} start`,tooltipMode:Q,formatValue:G,orientation:S,onChange:me,onChangeEnd:R?()=>R(P.current):void 0}),t.jsx(_t,{value:V[1],min:V[0],max:l,step:d,isDisabled:h,trackColor:Y,trackHeight:A.track,thumbSize:A.thumb,ariaLabel:`${de??"Range"} end`,tooltipMode:Q,formatValue:G,orientation:S,onChange:X,onChangeEnd:R?()=>R(P.current):void 0})]}):t.jsx(_t,{value:g,min:a,max:l,step:d,isDisabled:h,trackColor:Y,trackHeight:A.track,thumbSize:A.thumb,ariaLabel:de??"Slider",tooltipMode:Q,formatValue:G,orientation:S,onChange:oe,onChangeEnd:I?()=>I(B.current):void 0})]}),y&&y.length>0&&t.jsx("div",{style:{position:H?"absolute":"relative",...H?{left:"100%",top:0,bottom:0,marginLeft:8}:{marginTop:8}},children:y.map((J,ie)=>t.jsx("div",{style:{position:"absolute",...H?{bottom:`${Ve(J.value,a,l)}%`,transform:"translateY(50%)",left:0}:{left:`${Ve(J.value,a,l)}%`,transform:"translateX(-50%)"},fontSize:"0.6875rem",color:N.textMuted,whiteSpace:"nowrap"},children:W(J.label)},ie))})]}),m&&!y&&!H&&t.jsx("div",{style:{position:"relative",height:"1rem"},children:ke.map((J,ie)=>t.jsx("span",{style:{position:"absolute",left:`${Ve(J,a,l)}%`,transform:"translateX(-50%)",fontSize:"0.6875rem",color:N.textMuted},children:G(Math.round(J))},ie))})]})}An.displayName="TkxSlider";const Ys={sm:{height:28,minWidth:28,fontSize:"0.75rem",px:8},md:{height:36,minWidth:36,fontSize:"0.875rem",px:10},lg:{height:44,minWidth:44,fontSize:"1rem",px:12}};function Os(e,r,n,i){if(r<=1)return[1];const s=(k,z)=>Array.from({length:Math.max(0,z-k+1)},(y,S)=>k+S),a=Math.max(e-n,1),l=Math.min(e+n,r);if(!i){const k=[];return a>1&&k.push("..."),k.push(...s(a,l)),l<r&&k.push("..."),k}const d=1,u=r,x=a>d+2,o=l<u-2,m=[];m.push(1),x?m.push("left-ellipsis"):m.push(...s(2,a-1)),m.push(...s(Math.max(a,2),Math.min(l,r-1))),o?m.push("right-ellipsis"):m.push(...s(l+1,r-1)),r>1&&m.push(r);const p=new Set,h=[];for(const k of m)typeof k=="number"?p.has(k)||(p.add(k),h.push(k)):h.push(k);return h}function Ln({total:e,pageSize:r=10,page:n,defaultPage:i=1,onChange:s,siblingCount:a=1,showEdges:l=!0,showPageSize:d=!1,onPageSizeChange:u,pageSizeOptions:x=[10,25,50,100],size:o="md",variant:m="default"}){const p=ee(),h=c.useId(),k=n!==void 0,[z,y]=c.useState(i),S=k?n:z,[M,C]=c.useState(r),I=r,R=Math.max(1,Math.ceil(e/I)),$=j=>{const F=Math.min(Math.max(j,1),R);F!==S&&(k||y(F),s==null||s(F))},N=j=>{C(j),u==null||u(j),$(1)},T=Os(S,R,a,l),w=Ys[o],v=Math.min((S-1)*I+1,e),O=Math.min(S*I,e),f=(j,F)=>{const L={height:w.height,minWidth:w.minWidth,paddingLeft:w.px,paddingRight:w.px,fontSize:w.fontSize,borderRadius:"8px",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:F?"not-allowed":"pointer",border:"none",outline:"none",fontFamily:"inherit",transition:"background 120ms ease, color 120ms ease",opacity:F?.4:1};return j?{...L,backgroundColor:p.primary,color:p.bg,fontWeight:600,boxShadow:`0 0 0 2px ${p.primary}44`}:m==="default"?{...L,backgroundColor:p.surface,color:p.text,border:`1px solid ${p.border}`}:m==="outline"?{...L,backgroundColor:"transparent",color:p.text,border:`1px solid ${p.border}`}:{...L,backgroundColor:"transparent",color:p.text}},g=({d:j})=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:t.jsx("polyline",{points:j})});return t.jsxs("nav",{"aria-label":"Pagination",className:b("flex flex-col gap-2"),children:[e>0&&t.jsx("p",{className:b("text-sm"),style:{color:p.textMuted,fontSize:w.fontSize},children:W(`Showing ${v}–${O} of ${e} items`)}),t.jsxs("div",{className:b("flex items-center gap-1 flex-wrap"),children:[l&&t.jsxs("button",{type:"button","aria-label":"First page",disabled:S===1,onClick:()=>$(1),style:f(!1,S===1),children:[t.jsx(g,{d:"15 18 9 12 15 6"}),t.jsx(g,{d:"20 18 14 12 20 6"})]}),t.jsx("button",{type:"button","aria-label":"Previous page",disabled:S===1,onClick:()=>$(S-1),style:f(!1,S===1),children:t.jsx(g,{d:"15 18 9 12 15 6"})}),T.map((j,F)=>{if(typeof j=="string")return t.jsx("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:w.minWidth,height:w.height,fontSize:w.fontSize,color:p.textMuted,userSelect:"none"},children:"…"},`${j}-${F}`);const V=j,E=V===S;return t.jsx("button",{type:"button","aria-label":`Page ${V}`,"aria-current":E?"page":void 0,onClick:()=>$(V),style:f(E,!1),children:V},V)}),t.jsx("button",{type:"button","aria-label":"Next page",disabled:S===R,onClick:()=>$(S+1),style:f(!1,S===R),children:t.jsx(g,{d:"9 18 15 12 9 6"})}),l&&t.jsxs("button",{type:"button","aria-label":"Last page",disabled:S===R,onClick:()=>$(R),style:f(!1,S===R),children:[t.jsx(g,{d:"4 18 10 12 4 6"}),t.jsx(g,{d:"14 18 20 12 14 6"})]}),d&&t.jsxs("div",{className:b("flex items-center gap-2 ml-2"),children:[t.jsx("label",{htmlFor:h,className:b("text-sm"),style:{color:p.textMuted,fontSize:w.fontSize,whiteSpace:"nowrap"},children:"Rows per page"}),t.jsx("select",{id:h,value:M,onChange:j=>N(Number(j.target.value)),style:{height:w.height,paddingLeft:w.px,paddingRight:w.px,fontSize:w.fontSize,borderRadius:"8px",border:`1px solid ${p.border}`,backgroundColor:p.surface,color:p.text,cursor:"pointer",outline:"none",fontFamily:"inherit"},children:x.map(j=>t.jsx("option",{value:j,children:j},j))})]})]})]})}Ln.displayName="TkxPagination";const _s={"1/1":"100%","4/3":"75%","16/9":"56.25%","3/2":"66.666%","9/16":"177.777%"},Us={none:"0",sm:"4px",md:"8px",lg:"16px",full:"9999px"};function Ks({color:e,size:r}){return t.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:1.5,"aria-hidden":"true",children:[t.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),t.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),t.jsx("path",{d:"M21 15l-5-5L5 21"})]})}function Xs({src:e,alt:r,fallback:n,placeholder:i="skeleton",fit:s="cover",ratio:a="auto",radius:l="none",caption:d,lazy:u=!1,preview:x=!1,className:o,style:m,...p}){const h=ee(),k=we(),[z,y]=c.useState(!1),[S,M]=c.useState(!1),[C,I]=c.useState(!1),R=c.useRef(null),$=W(e),N=r?W(r):"",T=d?W(d):"",w=Us[l];c.useEffect(()=>{var H;(H=R.current)!=null&&H.complete&&y(!0)},[]);const v=c.useCallback(()=>y(!0),[]),O=c.useCallback(()=>M(!0),[]),f=c.useCallback(()=>{x&&!S&&I(!0)},[x,S]),g=c.useCallback(()=>I(!1),[]);c.useEffect(()=>{if(!C)return;const H=Q=>{Q.key==="Escape"&&g()};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[C,g]);const j=i==="skeleton"&&!z&&!S,F=j&&!k?{animation:"tkx-shimmer 1.5s ease-in-out infinite"}:{},L=S?null:t.jsx("img",{ref:R,src:$,alt:N||void 0,role:N?void 0:"img","aria-label":N?void 0:"Image",loading:u?"lazy":void 0,onLoad:v,onError:O,onClick:x?f:void 0,className:ue(b("block w-full h-full"),x&&!S?b("cursor-pointer"):""),style:{objectFit:s,borderRadius:w,opacity:z?1:0,transition:k?"none":"opacity 200ms ease",position:a==="auto"?void 0:"absolute",inset:a==="auto"?void 0:0},...p}),V=S?n?t.jsx(t.Fragment,{children:n}):t.jsxs("div",{role:"img","aria-label":N||"Image failed to load",className:b("flex flex-col items-center justify-center gap-2 w-full h-full"),style:{backgroundColor:h.surfaceAlt,borderRadius:w,color:h.textMuted,minHeight:"80px"},children:[t.jsx(Ks,{color:h.textMuted,size:32}),t.jsx("span",{className:b("text-xs"),style:{color:h.textMuted},children:"Failed to load"})]}):null,E=j?t.jsx("div",{"aria-hidden":"true",style:{position:a==="auto"?void 0:"absolute",inset:a==="auto"?void 0:0,width:"100%",height:a==="auto"?"100%":void 0,minHeight:a==="auto"?"80px":void 0,borderRadius:w,backgroundColor:h.surfaceAlt,...F}}):null,B=a==="auto"?t.jsxs("div",{className:b("relative w-full"),style:{borderRadius:w},children:[E,L,V]}):t.jsxs("div",{className:b("relative w-full overflow-hidden"),style:{paddingBottom:_s[a],borderRadius:w},children:[E,L,V]}),P=T?t.jsxs("figure",{className:b("m-0 p-0 flex flex-col gap-2"),style:{borderRadius:w},children:[B,t.jsx("figcaption",{className:b("text-sm text-center"),style:{color:h.textMuted},children:T})]}):B,Y=t.jsx("div",{className:ue(b("inline-block w-full"),o),style:m,children:P}),A=C&&typeof document<"u"?We.createPortal(t.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":N||"Image preview",className:b("fixed inset-0 z-[9500] flex items-center justify-center p-4"),onClick:g,children:[t.jsx("div",{"aria-hidden":"true",className:b("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.85)",backdropFilter:"blur(6px)"}}),t.jsx("img",{src:$,alt:N||"Full-size preview",onClick:H=>H.stopPropagation(),className:b("relative z-10 max-w-full max-h-full"),style:{objectFit:"contain",borderRadius:"8px",boxShadow:"0 25px 60px rgba(0,0,0,0.5)"}}),t.jsx("button",{"aria-label":"Close preview",onClick:g,className:b("absolute top-4 right-4 z-10 flex items-center justify-center","bg-transparent border-none cursor-pointer rounded-full p-2"),style:{color:"#fff",backgroundColor:"rgba(255,255,255,0.15)"},children:t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),document.body):null;return t.jsxs(t.Fragment,{children:[Y,A]})}function Ar(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function qs({mimeType:e,color:r}){return e.startsWith("image/")?t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:1.5,"aria-hidden":"true",children:[t.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),t.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),t.jsx("path",{d:"M21 15l-5-5L5 21"})]}):e==="application/pdf"?t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:1.5,"aria-hidden":"true",children:[t.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),t.jsx("polyline",{points:"14 2 14 8 20 8"}),t.jsx("line",{x1:"9",y1:"13",x2:"15",y2:"13"}),t.jsx("line",{x1:"9",y1:"17",x2:"11",y2:"17"})]}):t.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:1.5,"aria-hidden":"true",children:[t.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),t.jsx("polyline",{points:"14 2 14 8 20 8"})]})}let Zs=0;function Gs(){return`tkx-file-${++Zs}`}function Js({accept:e,multiple:r=!1,maxSize:n,maxFiles:i,onChange:s,onError:a,label:l="Upload files",hint:d,isDisabled:u=!1,preview:x=!0,dragDrop:o=!0,variant:m="dropzone"}){const p=ee(),h=we(),k=c.useId(),z=c.useRef(null),[y,S]=c.useState(!1),[M,C]=c.useState([]);c.useEffect(()=>()=>{M.forEach(E=>{E.objectUrl&&URL.revokeObjectURL(E.objectUrl)})},[]);const I=c.useCallback(E=>{let B=0;const P=setInterval(()=>{B+=Math.floor(Math.random()*20)+10,B>=100&&(B=100,clearInterval(P)),C(Y=>Y.map(A=>A.id===E?{...A,progress:B}:A))},100)},[]),R=c.useCallback(E=>{if(n&&E.size>n)return`"${W(E.name)}" exceeds max size of ${Ar(n)}`;if(e&&!e.split(",").map(Y=>Y.trim()).some(Y=>Y.startsWith(".")?E.name.toLowerCase().endsWith(Y.toLowerCase()):Y.endsWith("/*")?E.type.startsWith(Y.slice(0,-1)):E.type===Y))return`"${W(E.name)}" is not an accepted file type`},[e,n]),$=c.useCallback(E=>{const B=i?i-M.length:1/0;if(B<=0){a==null||a(`Maximum of ${i} file${i===1?"":"s"} allowed`);return}const Y=E.slice(0,B).map(A=>{const H=R(A),Q=x&&A.type.startsWith("image/")&&!H?URL.createObjectURL(A):void 0;return{file:A,id:Gs(),objectUrl:Q,progress:0,error:H}});C(A=>{const H=r?[...A,...Y]:Y,Q=H.filter(G=>!G.error).map(G=>G.file);return s==null||s(Q),H}),Y.forEach(A=>{A.error&&(a==null||a(A.error))}),Y.forEach(A=>{A.error||I(A.id)})},[M.length,i,r,s,a,x,I,R]),N=c.useCallback(E=>{const B=Array.from(E.target.files??[]);B.length&&$(B),E.target.value=""},[$]),T=c.useCallback(E=>{if(E.preventDefault(),S(!1),u)return;const B=Array.from(E.dataTransfer.files);B.length&&$(B)},[u,$]),w=c.useCallback(E=>{E.preventDefault(),u||S(!0)},[u]),v=c.useCallback(()=>S(!1),[]),O=c.useCallback(E=>{C(B=>{const P=B.find(A=>A.id===E);P!=null&&P.objectUrl&&URL.revokeObjectURL(P.objectUrl);const Y=B.filter(A=>A.id!==E);return s==null||s(Y.filter(A=>!A.error).map(A=>A.file)),Y})},[s]),f=c.useCallback(()=>{var E;u||(E=z.current)==null||E.click()},[u]),g=y?p.primary:p.border,j=W(l),F=d?W(d):"",L=t.jsxs("div",{role:"button",tabIndex:u?-1:0,"aria-label":j,"aria-describedby":d?k:void 0,"aria-disabled":u,onClick:f,onKeyDown:E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),f())},onDrop:o?T:void 0,onDragOver:o?w:void 0,onDragLeave:o?v:void 0,className:b("flex flex-col items-center justify-center gap-3 w-full p-8 rounded-lg"),style:{border:`2px dashed ${g}`,backgroundColor:y?`${p.primary}10`:p.surface,cursor:u?"not-allowed":"pointer",opacity:u?.5:1,transition:h?"none":"border-color 150ms ease, background-color 150ms ease",outline:"none"},children:[t.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:y?p.primary:p.textMuted,strokeWidth:1.5,"aria-hidden":"true",children:[t.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),t.jsx("polyline",{points:"17 8 12 3 7 8"}),t.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),t.jsxs("div",{className:b("text-center"),children:[t.jsx("p",{className:b("m-0 text-sm font-medium"),style:{color:p.text},children:y?"Drop files here":j}),F&&t.jsx("p",{id:k,className:b("m-0 text-xs mt-1"),style:{color:p.textMuted},children:F})]})]}),V=t.jsxs("button",{type:"button",disabled:u,onClick:f,"aria-describedby":d?k:void 0,className:b("flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium font-sans border-none cursor-pointer"),style:{backgroundColor:p.primary,color:p.bg,opacity:u?.5:1,cursor:u?"not-allowed":"pointer"},children:[t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),t.jsx("polyline",{points:"17 8 12 3 7 8"}),t.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),j,d&&t.jsx("span",{id:k,className:b("sr-only"),children:F})]});return t.jsxs("div",{className:b("flex flex-col gap-3 w-full font-sans"),children:[t.jsx("input",{ref:z,type:"file",accept:e,multiple:r,disabled:u,onChange:N,className:b("sr-only"),tabIndex:-1,"aria-hidden":"true"}),m==="dropzone"?L:V,M.length>0&&t.jsx("ul",{role:"status","aria-live":"polite","aria-label":"Uploaded files",className:b("m-0 p-0 flex flex-col gap-2"),style:{listStyle:"none"},children:M.map(E=>t.jsxs("li",{className:b("flex flex-col gap-1 rounded-md p-3"),style:{backgroundColor:p.surfaceAlt,border:`1px solid ${E.error?p.danger:p.border}`},children:[t.jsxs("div",{className:b("flex items-center gap-3"),children:[E.objectUrl&&x?t.jsx("img",{src:E.objectUrl,alt:W(E.file.name),className:b("rounded"),style:{width:40,height:40,objectFit:"cover",flexShrink:0}}):t.jsx("span",{style:{flexShrink:0},children:t.jsx(qs,{mimeType:E.file.type,color:E.error?p.danger:p.textMuted})}),t.jsxs("div",{className:b("flex flex-col gap-0.5 flex-1 min-w-0"),children:[t.jsx("span",{className:b("text-sm font-medium truncate"),style:{color:E.error?p.danger:p.text},title:E.file.name,children:W(E.file.name)}),t.jsxs("span",{className:b("text-xs"),style:{color:p.textMuted},children:[Ar(E.file.size),E.error&&` — ${E.error}`]})]}),t.jsx("button",{type:"button","aria-label":`Remove ${W(E.file.name)}`,onClick:()=>O(E.id),className:b("flex items-center justify-center bg-transparent border-none cursor-pointer rounded p-1"),style:{color:p.textMuted,flexShrink:0},children:t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),!E.error&&E.progress<100&&t.jsx("div",{className:b("w-full overflow-hidden"),style:{height:"3px",borderRadius:"3px",backgroundColor:p.border},"aria-hidden":"true",children:t.jsx("div",{style:{height:"100%",borderRadius:"3px",backgroundColor:p.primary,width:`${E.progress}%`,transition:h?"none":"width 100ms ease"}})})]},E.id))})]})}const Qs={sm:16,md:24,lg:32,xl:40};function ei({size:e,filled:r,color:n,halfFilled:i,id:s}){const a=s?`hg-${s}`:void 0;return t.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[i&&a&&t.jsx("defs",{children:t.jsxs("linearGradient",{id:a,x1:"0",x2:"1",y1:"0",y2:"0",children:[t.jsx("stop",{offset:"50%",stopColor:n}),t.jsx("stop",{offset:"50%",stopColor:"transparent"})]})}),t.jsx("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",fill:i&&a?`url(#${a})`:r?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function ti({size:e,filled:r,color:n,halfFilled:i,id:s}){const a=s?`hg-${s}`:void 0;return t.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[i&&a&&t.jsx("defs",{children:t.jsxs("linearGradient",{id:a,x1:"0",x2:"1",y1:"0",y2:"0",children:[t.jsx("stop",{offset:"50%",stopColor:n}),t.jsx("stop",{offset:"50%",stopColor:"transparent"})]})}),t.jsx("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z",fill:i&&a?`url(#${a})`:r?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function ri({size:e,filled:r,color:n,halfFilled:i,id:s}){const a=s?`hg-${s}`:void 0;return t.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[i&&a&&t.jsx("defs",{children:t.jsxs("linearGradient",{id:a,x1:"0",x2:"1",y1:"0",y2:"0",children:[t.jsx("stop",{offset:"50%",stopColor:n}),t.jsx("stop",{offset:"50%",stopColor:"transparent"})]})}),t.jsx("circle",{cx:"12",cy:"12",r:"9",fill:i&&a?`url(#${a})`:r?n:"none",stroke:n,strokeWidth:1.5})]})}function ni({type:e,size:r,filled:n,color:i,halfFilled:s,uid:a}){const l={size:r,filled:n,color:i,halfFilled:s,id:a};return e==="heart"?t.jsx(ti,{...l}):e==="circle"?t.jsx(ri,{...l}):t.jsx(ei,{...l})}function Lr(e,r,n){return Math.min(n,Math.max(r,e))}function oi(e,r){return r===1?Math.round(e):Math.round(e*2)/2}function Dr(e,r,n){if(n===1)return r+1;const i=e.currentTarget.getBoundingClientRect(),s=i.left+i.width/2;return e.clientX<s?r+.5:r+1}function si({value:e,defaultValue:r=0,onChange:n,max:i=5,precision:s=1,size:a="md",isReadOnly:l=!1,isDisabled:d=!1,label:u,showValue:x=!1,colorScheme:o="warning",emptyIcon:m="star",filledIcon:p="star"}){const h=ee(),k=we(),z=c.useId(),y=e!==void 0,[S,M]=c.useState(r),[C,I]=c.useState(null),R=c.useRef(null),$=y?e??0:S,N=C??$,w={warning:h.warning,primary:h.primary,danger:h.danger}[o]??h.warning,v=Qs[a],O=!l&&!d,f=c.useCallback(E=>{y||M(E),n==null||n(E)},[y,n]),g=c.useCallback((E,B)=>{O&&I(Dr(E,B,s))},[O,s]),j=c.useCallback(()=>{O&&I(null)},[O]),F=c.useCallback((E,B)=>{if(!O)return;const P=Dr(E,B,s);f(P===$?0:P)},[O,s,$,f]),L=c.useCallback(E=>{if(!O)return;const B=s;let P=$;if(E.key==="ArrowRight"||E.key==="ArrowUp")E.preventDefault(),P=Lr($+B,0,i);else if(E.key==="ArrowLeft"||E.key==="ArrowDown")E.preventDefault(),P=Lr($-B,0,i);else if(E.key==="Home")E.preventDefault(),P=0;else if(E.key==="End")E.preventDefault(),P=i;else return;P=oi(P,s),f(P)},[O,$,i,s,f]),V=u?W(u):"Rating";return t.jsxs("div",{className:ue(b("inline-flex items-center gap-2 font-sans"),d?b("opacity-50"):""),children:[t.jsx("div",{ref:R,role:"radiogroup","aria-label":V,"aria-disabled":d,"aria-readonly":l,tabIndex:O?0:-1,onKeyDown:L,onMouseLeave:j,className:b("flex items-center gap-0.5 outline-none"),style:{cursor:O?"pointer":"default"},children:Array.from({length:i},(E,B)=>{const P=B+1,Y=B+.5,A=N>=P,H=!A&&s===.5&&N>=Y,Q=`${z}-${B}`;return t.jsx("span",{role:"radio","aria-checked":s===.5&&$===Y||$===P,"aria-label":s===.5?`${Y} star${Y!==1?"s":""} / ${P} star${P!==1?"s":""}`:`${P} star${P!==1?"s":""}`,tabIndex:-1,onMouseMove:G=>g(G,B),onClick:G=>F(G,B),style:{display:"inline-flex",alignItems:"center",lineHeight:0,transition:k?"none":"transform 120ms ease",transform:C!==null&&N>=Y&&O?"scale(1.15)":"scale(1)"},children:t.jsx(ni,{type:A||H?p:m,size:v,filled:A,halfFilled:H,color:A||H?w:h.border,uid:H?Q:void 0})},B)})}),x&&t.jsxs("span",{className:b("text-sm tabular-nums"),style:{color:h.textMuted},"aria-live":"polite","aria-atomic":"true",children:[$%1===0?$.toFixed(0):$.toFixed(1)," / ",i]})]})}let Fr=!1;function ii(){if(Fr||typeof document>"u")return;Fr=!0;const e=document.createElement("style");e.textContent=`
24
+ @keyframes tkx-blink { 0%,100% { opacity:1 } 50% { opacity:0 } }
25
+ @keyframes tkx-bounce { 0%,100% { transform:translateY(0) } 50% { transform:translateY(-5px) } }
26
+ .tkx-cursor::after { content:'▋'; display:inline-block; animation:tkx-blink 1s step-start infinite; margin-left:1px; }
27
+ .tkx-dot1 { animation:tkx-bounce 1s ease-in-out infinite; }
28
+ .tkx-dot2 { animation:tkx-bounce 1s ease-in-out 0.2s infinite; }
29
+ .tkx-dot3 { animation:tkx-bounce 1s ease-in-out 0.4s infinite; }
30
+ `,document.head.appendChild(e)}function ai(){return t.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"14",cy:"14",r:"14",fill:"currentColor",fillOpacity:"0.15"}),t.jsx("circle",{cx:"14",cy:"11",r:"4",fill:"currentColor"}),t.jsx("path",{d:"M6 24c0-4.418 3.582-8 8-8s8 3.582 8 8",fill:"currentColor"})]})}function li(){return t.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"14",cy:"14",r:"14",fill:"currentColor",fillOpacity:"0.15"}),t.jsx("path",{d:"M14 5l2.2 6.5H23l-5.6 4 2.2 6.5L14 18l-5.6 4 2.2-6.5L5 11.5h6.8z",fill:"currentColor"})]})}function Dn(){const e=ee();return t.jsxs("div",{className:b("flex items-center gap-1.5 px-4 py-3 rounded-2xl w-fit"),style:{backgroundColor:e.surface,border:`1px solid ${e.border}`},"aria-label":"Assistant is thinking",children:[t.jsx("span",{className:"tkx-dot1 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}}),t.jsx("span",{className:"tkx-dot2 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}}),t.jsx("span",{className:"tkx-dot3 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}})]})}function Fn({message:e,showTimestamp:r,avatarUser:n,avatarAssistant:i}){const s=ee(),a=we(),{role:l,content:d,timestamp:u,isStreaming:x,error:o}=e,m=W(d),p=u?new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}).format(u):null;if(l==="system")return t.jsx("div",{role:"listitem",className:b("flex justify-center my-2"),children:t.jsx("p",{className:b("text-xs italic px-3 py-1 rounded-full"),style:{color:s.textMuted,backgroundColor:s.surfaceAlt},children:m})});const h=l==="user",k=h?n??t.jsx(ai,{}):i??t.jsx(li,{}),z=h?{backgroundColor:s.primary,color:s.bg}:{backgroundColor:s.surface,color:s.text,border:`1px solid ${o?s.danger:s.border}`};return o&&(z.borderColor=s.danger,z.borderWidth="2px"),t.jsxs("div",{role:"listitem",className:b("flex gap-2 mb-4",h?"flex-row-reverse":"flex-row"),children:[t.jsx("div",{className:b("shrink-0 w-8 h-8 rounded-full flex items-center justify-center overflow-hidden"),style:{color:h?s.primary:s.secondary},children:k}),t.jsxs("div",{className:b("flex flex-col gap-1 max-w-[75%]",h?"items-end":"items-start"),children:[t.jsxs("div",{className:ue(b("px-4 py-2.5 rounded-2xl text-sm leading-relaxed break-words whitespace-pre-wrap"),x&&!a?"tkx-cursor":""),style:z,children:[m,o&&t.jsx("span",{"aria-label":"Error",style:{marginLeft:6,color:s.danger},children:"⚠"})]}),r&&p&&t.jsx("span",{className:b("text-[10px]"),style:{color:s.textMuted},children:p})]})]})}function ci({messages:e,onSend:r,isLoading:n=!1,placeholder:i="Type a message…",maxLength:s,showTimestamps:a=!1,avatarUser:l,avatarAssistant:d,height:u=480,inputPosition:x="bottom"}){const o=ee(),m=we(),[p,h]=c.useState(""),k=c.useRef(null),z=c.useRef(null);c.useEffect(()=>{ii()},[]),c.useEffect(()=>{const N=k.current;N&&N.scrollTo({top:N.scrollHeight,behavior:m?"auto":"smooth"})},[e,n,m]);const y=c.useCallback(()=>{const N=p.trim();!N||!r||(r(N),h(""),z.current&&(z.current.style.height="auto"))},[p,r]),S=c.useCallback(N=>{N.key==="Enter"&&!N.shiftKey&&(N.preventDefault(),y())},[y]),M=c.useCallback(N=>{const T=s?N.target.value.slice(0,s):N.target.value;h(T);const w=z.current;if(w){w.style.height="auto";const O=24*4+24;w.style.height=`${Math.min(w.scrollHeight,O)}px`}},[s]),C=p.trim().length>0&&!n,I=typeof u=="number"?`${u}px`:u,R=x==="floating",$=t.jsxs("div",{className:b("flex flex-col gap-1 p-3"),style:R?{position:"absolute",bottom:12,left:12,right:12,borderRadius:16,backgroundColor:o.surface,border:`1px solid ${o.border}`,boxShadow:"0 4px 24px rgba(0,0,0,0.18)"}:{borderTop:`1px solid ${o.border}`,backgroundColor:o.surface},children:[t.jsxs("div",{className:b("flex items-end gap-2"),children:[t.jsx("textarea",{ref:z,rows:1,value:p,onChange:M,onKeyDown:S,placeholder:W(i),"aria-label":"Message input","aria-multiline":"true",disabled:n,className:b("flex-1 resize-none text-sm leading-6 bg-transparent outline-none py-1"),style:{color:o.text,caretColor:o.primary,minHeight:32,maxHeight:120}}),t.jsx("button",{onClick:y,disabled:!C,"aria-label":"Send message",className:b("shrink-0 w-9 h-9 rounded-xl flex items-center justify-center",!m&&"transition-opacity duration-150",C?"cursor-pointer opacity-100":"opacity-40 cursor-not-allowed"),style:{backgroundColor:o.primary,color:o.bg},children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 14L14 8 2 2v4.5l8 1.5-8 1.5V14z",fill:"currentColor"})})})]}),s&&t.jsxs("div",{className:b("text-right text-[10px]"),style:{color:o.textMuted},children:[p.length,"/",s]})]});return t.jsxs("div",{className:b("flex flex-col overflow-hidden rounded-2xl"),style:{height:I,backgroundColor:o.bg,border:`1px solid ${o.border}`,position:"relative"},children:[t.jsx("div",{ref:k,role:"log","aria-live":"polite","aria-label":"Chat messages",className:b("flex-1 overflow-y-auto p-4"),style:{paddingBottom:R?80:void 0},children:t.jsxs("div",{role:"list",children:[e.map(N=>t.jsx(Fn,{message:N,showTimestamp:a,avatarUser:l,avatarAssistant:d},N.id)),n&&t.jsxs("div",{role:"listitem",className:b("flex gap-2 mb-4"),children:[t.jsx("div",{className:b("w-8 h-8 shrink-0")}),t.jsx(Dn,{})]})]})}),$]})}const di={sm:"text-[11px]",md:"text-xs",lg:"text-sm"},ui={sm:"px-2 py-0.5",md:"px-2.5 py-1",lg:"px-3 py-1.5"},fi={sm:"gap-1",md:"gap-1.5",lg:"gap-2"},pi={sm:12,md:14,lg:16};function xi(e,r){const n=ee(),s={default:n.textMuted,primary:n.primary,secondary:n.secondary,success:n.success,danger:n.danger,warning:n.warning,info:n.info}[e];return r==="solid"?{bg:s,color:n.bg,border:"transparent"}:r==="subtle"?{bg:`${s}22`,color:s,border:"transparent"}:{bg:"transparent",color:s,border:s}}function Bn({variant:e="subtle",size:r="md",colorScheme:n="default",onRemove:i,leftIcon:s,isDisabled:a=!1,clickable:l=!1,children:d,className:u,style:x,onClick:o,...m}){ee();const p=we(),h=xi(n,e),k=typeof d=="string"?W(d):d,z=pi[r],y=b("inline-flex items-center font-medium rounded-full select-none",di[r],ui[r],fi[r],a?"opacity-50 cursor-not-allowed":l?"cursor-pointer":"cursor-default",l&&!p&&"transition-opacity duration-150");return t.jsxs("span",{role:l?"button":void 0,tabIndex:l&&!a?0:void 0,"aria-disabled":a||void 0,className:ue(y,u),style:{backgroundColor:h.bg,color:h.color,border:`1px solid ${h.border==="transparent"?"transparent":h.border}`,...x},onClick:a?void 0:o,onKeyDown:l&&!a&&o?S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),o(S))}:void 0,...m,children:[s&&t.jsx("span",{"aria-hidden":"true",className:b("shrink-0 flex items-center"),children:s}),t.jsx("span",{children:k}),i&&!a&&t.jsx("button",{type:"button","aria-label":`Remove ${typeof d=="string"?d:"tag"}`,onClick:S=>{S.stopPropagation(),i()},className:b("shrink-0 flex items-center justify-center rounded-full cursor-pointer"),style:{width:z+4,height:z+4,color:h.color,backgroundColor:"transparent",border:"none",padding:0},tabIndex:0,children:t.jsx("svg",{width:z,height:z,viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})})]})}function hi({value:e,defaultValue:r=[],onChange:n,placeholder:i="Add tag…",maxTags:s,allowDuplicates:a=!1,validate:l,colorScheme:d="primary",size:u="md",label:x,hint:o,isDisabled:m=!1}){const p=ee(),h=we(),[k,z]=c.useState(r),[y,S]=c.useState(""),[M,C]=c.useState(null),I=c.useRef(null),R=e!==void 0,$=R?e:k,N=c.useCallback(j=>{R||z(j),n==null||n(j)},[R,n]),T=c.useCallback(j=>{const F=j.trim();if(F){if(s!==void 0&&$.length>=s){C(`Maximum ${s} tags allowed`);return}if(!a&&$.includes(F)){C("Duplicate tags are not allowed");return}if(l){const L=l(F);if(L===!1){C("Invalid tag");return}if(typeof L=="string"){C(L);return}}C(null),N([...$,F]),S("")}},[$,s,a,l,N]),w=c.useCallback(j=>{const F=$.filter((L,V)=>V!==j);N(F),C(null)},[$,N]),v=c.useCallback(j=>{j.key==="Enter"||j.key===","?(j.preventDefault(),T(y)):j.key==="Backspace"&&y===""&&$.length>0&&w($.length-1)},[y,$,T,w]),O=c.useCallback(j=>{const F=j.target.value;F.endsWith(",")?T(F.slice(0,-1)):(S(F),M&&C(null))},[T,M]),f=u==="sm"?"6px 8px":u==="lg"?"10px 12px":"8px 10px",g=u==="sm"?11:u==="lg"?14:12;return t.jsxs("div",{className:b("flex flex-col gap-1.5"),children:[x&&t.jsx("label",{className:b("text-sm font-medium"),style:{color:p.text},onClick:()=>{var j;return(j=I.current)==null?void 0:j.focus()},children:W(x)}),t.jsxs("div",{className:b("flex flex-wrap items-center gap-1.5 rounded-lg cursor-text",!h&&"transition-colors duration-150"),style:{padding:f,backgroundColor:p.surface,border:`1.5px solid ${M?p.danger:p.border}`,opacity:m?.55:1,minHeight:u==="sm"?36:u==="lg"?48:40},onClick:()=>{var j;return!m&&((j=I.current)==null?void 0:j.focus())},children:[$.map((j,F)=>t.jsx(Bn,{size:u,variant:"subtle",colorScheme:d,onRemove:m?void 0:()=>w(F),isDisabled:m,children:j},`${j}-${F}`)),(!s||$.length<s)&&!m&&t.jsx("input",{ref:I,type:"text",value:y,onChange:O,onKeyDown:v,placeholder:$.length===0?W(i):"",disabled:m,className:b("flex-1 bg-transparent outline-none min-w-[80px]"),style:{fontSize:g,color:p.text,caretColor:p.primary},"aria-label":x??"Tag input"})]}),M&&t.jsx("p",{className:b("text-xs"),style:{color:p.danger},role:"alert",children:M}),o&&!M&&t.jsx("p",{className:b("text-xs"),style:{color:p.textMuted},children:W(o)})]})}let Br=!1;function mi(){if(Br||typeof document>"u")return;Br=!0;const e=document.createElement("style");e.textContent=`
31
+ @keyframes tkx-pulse-dot { 0%,100% { box-shadow:0 0 0 0 currentColor; opacity:1; } 70% { box-shadow:0 0 0 8px transparent; opacity:0.7; } }
32
+ @keyframes tkx-draw-line { from { transform:scaleY(0); transform-origin:top center; } to { transform:scaleY(1); } }
33
+ @keyframes tkx-draw-line-h { from { transform:scaleX(0); transform-origin:left center; } to { transform:scaleX(1); } }
34
+ .tkx-pulse-dot { animation: tkx-pulse-dot 1.5s ease-in-out infinite; }
35
+ .tkx-draw-v { animation: tkx-draw-line 0.6s ease forwards; }
36
+ .tkx-draw-h { animation: tkx-draw-line-h 0.6s ease forwards; }
37
+ `,document.head.appendChild(e)}function gi(e="pending"){const r=ee();return{completed:r.success,active:r.primary,pending:r.border,error:r.danger}[e]}function Ut({status:e="pending",icon:r,size:n=28}){const i=ee(),s=we(),a=gi(e),l=e==="active";return t.jsx("div",{className:ue(b("relative flex items-center justify-center rounded-full shrink-0 z-10"),l&&!s?"tkx-pulse-dot":""),style:{width:n,height:n,backgroundColor:e==="pending"?i.surface:a,border:`2px solid ${a}`,color:e==="pending"?a:i.bg},"aria-hidden":"true",children:r?t.jsx("span",{style:{fontSize:n*.45,lineHeight:1},children:r}):t.jsx("span",{style:{width:n*.35,height:n*.35,borderRadius:"50%",backgroundColor:e==="pending"?a:i.bg,display:"block"}})})}function Wr({style:e,color:r,animate:n}){return ee(),t.jsx("div",{className:ue(b("w-0.5 flex-1 min-h-[24px]"),n?"tkx-draw-v":""),style:{borderLeft:`2px ${e} ${r}`,backgroundColor:"transparent",alignSelf:"stretch",borderColor:r,marginLeft:1},"aria-hidden":"true"})}function Pr({style:e,color:r,animate:n}){return t.jsx("div",{className:ue(b("h-0.5 flex-1 min-w-[24px]"),n?"tkx-draw-h":""),style:{borderTop:`2px ${e} ${r}`,borderColor:r},"aria-hidden":"true"})}function Kt({item:e,compact:r}){const n=ee(),i=e.timestamp?W(e.timestamp):null;return t.jsxs("div",{className:b("flex flex-col gap-0.5",r?"pb-3":"pb-5"),children:[t.jsxs("div",{className:b("flex items-center gap-2 flex-wrap"),children:[t.jsx("span",{className:b("text-sm font-semibold leading-snug"),style:{color:n.text},children:typeof e.title=="string"?W(e.title):e.title}),e.badge&&t.jsx("span",{children:e.badge}),i&&t.jsx("span",{className:b("text-[11px] ml-auto"),style:{color:n.textMuted},children:i})]}),e.description&&!r&&t.jsx("div",{className:b("text-xs leading-relaxed mt-0.5"),style:{color:n.textMuted},children:typeof e.description=="string"?W(e.description):e.description})]})}function bi({items:e,variant:r="default",orientation:n="vertical",connectorStyle:i="solid"}){const s=ee(),a=we(),l=c.useRef(!1);c.useEffect(()=>{mi(),l.current=!0},[]);const d=!a,u=r==="compact",x=r==="alternating"&&n==="vertical";return n==="horizontal"?t.jsx("div",{role:"list","aria-label":"Timeline",className:b("flex items-start w-full overflow-x-auto"),children:e.map((m,p)=>{const h=m.status??"pending",k=h==="completed"?s.success:s.border,z=p===e.length-1;return t.jsx("div",{role:"listitem",className:b("flex items-start flex-1 min-w-0"),children:t.jsxs("div",{className:b("flex flex-col items-center flex-1 min-w-0"),children:[t.jsxs("div",{className:b("flex items-center w-full"),children:[p>0&&t.jsx(Pr,{style:i,color:k,animate:d}),t.jsx(Ut,{status:h,icon:m.icon,size:24}),!z&&t.jsx(Pr,{style:i,color:k,animate:d})]}),t.jsxs("div",{className:b("mt-2 px-1 text-center min-w-0 w-full"),children:[t.jsx("div",{className:b("text-xs font-semibold truncate"),style:{color:s.text},children:typeof m.title=="string"?W(m.title):m.title}),m.timestamp&&t.jsx("div",{className:b("text-[10px] mt-0.5"),style:{color:s.textMuted},children:W(m.timestamp)})]})]})},m.id)})}):t.jsx("div",{role:"list","aria-label":"Timeline",className:b("flex flex-col"),children:e.map((m,p)=>{const h=m.status??"pending",k=p===e.length-1,z=h==="completed"?s.success:s.border,y=x&&p%2===0;return x?t.jsxs("div",{role:"listitem",className:b("flex items-stretch gap-0"),children:[t.jsx("div",{className:b("flex-1 flex flex-col items-end pr-4",y?"":"invisible"),children:y&&t.jsx(Kt,{item:m,compact:u})}),t.jsxs("div",{className:b("flex flex-col items-center"),children:[t.jsx(Ut,{status:h,icon:m.icon,size:28}),!k&&t.jsx(Wr,{style:i,color:z,animate:d})]}),t.jsx("div",{className:b("flex-1 flex flex-col items-start pl-4",y?"invisible":""),children:!y&&t.jsx(Kt,{item:m,compact:u})})]},m.id):t.jsxs("div",{role:"listitem",className:b("flex gap-3 items-stretch"),children:[t.jsxs("div",{className:b("flex flex-col items-center"),children:[t.jsx(Ut,{status:h,icon:m.icon,size:u?22:28}),!k&&t.jsx(Wr,{style:i,color:z,animate:d})]}),t.jsx("div",{className:b("flex-1 min-w-0 pt-0.5"),children:t.jsx(Kt,{item:m,compact:u})})]},m.id)})})}function Hr(e,r,n,i){const s=window.innerWidth,a=window.innerHeight,l=6;let d=0,u=0,x="top left";switch(r){case"bottom-start":d=e.bottom+l,u=e.left,x="top left",d+i>a&&e.top-l-i>0&&(d=e.top-l-i,x="bottom left"),u+n>s&&(u=Math.max(0,s-n-8));break;case"bottom-end":d=e.bottom+l,u=e.right-n,x="top right",d+i>a&&e.top-l-i>0&&(d=e.top-l-i,x="bottom right"),u<0&&(u=8);break;case"top-start":d=e.top-l-i,u=e.left,x="bottom left",d<0&&(d=e.bottom+l,x="top left"),u+n>s&&(u=Math.max(0,s-n-8));break;case"top-end":d=e.top-l-i,u=e.right-n,x="bottom right",d<0&&(d=e.bottom+l,x="top right"),u<0&&(u=8);break;case"right-start":d=e.top,u=e.right+l,x="top left",u+n>s&&(u=e.left-l-n,x="top right"),d+i>a&&(d=Math.max(8,a-i-8));break;case"left-start":d=e.top,u=e.left-l-n,x="top right",u<0&&(u=e.right+l,x="top left"),d+i>a&&(d=Math.max(8,a-i-8));break}return{top:d+window.scrollY,left:u+window.scrollX,transformOrigin:x}}function yi(e,r,n){const i=window.innerWidth,s=window.innerHeight,a=4;let l=e.right+a,d="top left";l+r>i&&(l=e.left-a-r,d="top right");let u=e.top;return u+n>s&&(u=Math.max(8,s-n-8)),{top:u+window.scrollY,left:l+window.scrollX,transformOrigin:d}}const vi=`
38
+ @keyframes tkxMenuIn {
39
+ from { opacity: 0; transform: scale(0.94); }
40
+ to { opacity: 1; transform: scale(1); }
41
+ }
42
+ @keyframes tkxMenuInReduced {
43
+ from { opacity: 0; }
44
+ to { opacity: 1; }
45
+ }
46
+ @media (prefers-reduced-motion: no-preference) {
47
+ .tkx-menu-panel {
48
+ animation: tkxMenuIn 130ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
49
+ }
50
+ }
51
+ @media (prefers-reduced-motion: reduce) {
52
+ .tkx-menu-panel {
53
+ animation: tkxMenuInReduced 100ms ease forwards;
54
+ }
55
+ }
56
+ `;function ki(e,r){return{position:"absolute",top:r.top,left:r.left,zIndex:9999,minWidth:200,maxWidth:320,backgroundColor:e.surface,border:`1.5px solid ${e.border}`,borderRadius:10,boxShadow:"0 8px 32px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.14)",padding:"4px 0",transformOrigin:r.transformOrigin,overflow:"hidden"}}function wi({color:e}){return t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:t.jsx("path",{d:"M20 6L9 17l-5-5"})})}function ji({color:e}){return t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":"true",children:[t.jsx("circle",{cx:"12",cy:"12",r:"5",fill:e}),t.jsx("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:e,strokeWidth:"2"})]})}function Si({color:e}){return t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:"2","aria-hidden":"true",children:t.jsx("path",{d:"M9 18l6-6-6-6"})})}function $i(e){const r=[];let n=0;for(const i of e)if(i.type!=="separator")if(i.type==="radio-group")for(let s=0;s<i.options.length;s++)r.push({kind:"radio",item:i,optionIdx:s,idx:n++});else i.type==="check"?r.push({kind:"check",item:i,idx:n++}):i.type==="submenu"?r.push({kind:"submenu",item:i,idx:n++}):r.push({kind:"action",item:i,idx:n++});return r}function Wn({items:e,pos:r,panelId:n,onClose:i,onCloseAll:s,isSubmenu:a=!1}){const l=ee(),[d,u]=c.useState(-1),[x,o]=c.useState(null),[m,p]=c.useState(null),h=c.useRef(null),[k,z]=c.useState(""),y=c.useRef(null),S=$i(e);c.useEffect(()=>{var T;(T=h.current)==null||T.focus()},[]),c.useEffect(()=>{var w;if(d<0)return;const T=(w=h.current)==null?void 0:w.querySelector(`[data-midx="${d}"]`);T==null||T.scrollIntoView({block:"nearest"})},[d]);const M=c.useCallback(T=>{var w,v,O,f,g,j;if(T.kind==="action"){if(T.item.disabled)return;(v=(w=T.item).onClick)==null||v.call(w),s()}else if(T.kind==="check"){if(T.item.disabled)return;(f=(O=T.item).onChange)==null||f.call(O,!T.item.checked)}else if(T.kind==="radio"){if(T.item.disabled)return;(j=(g=T.item).onChange)==null||j.call(g,T.item.options[T.optionIdx].value)}else if(T.kind==="submenu"){if(T.item.disabled)return;o(T.item.id)}},[s]),C=T=>{var w;switch(T.key){case"ArrowDown":T.preventDefault(),u(v=>{const O=v+1;return O<S.length?O:0});break;case"ArrowUp":T.preventDefault(),u(v=>{const O=v-1;return O>=0?O:S.length-1});break;case"Home":T.preventDefault(),u(0);break;case"End":T.preventDefault(),u(S.length-1);break;case"Enter":case" ":T.preventDefault(),d>=0&&S[d]&&M(S[d]);break;case"Escape":T.preventDefault(),a?i():s();break;case"Tab":T.preventDefault(),s();break;case"ArrowRight":T.preventDefault(),d>=0&&((w=S[d])==null?void 0:w.kind)==="submenu"&&o(S[d].item.id);break;case"ArrowLeft":T.preventDefault(),a&&i();break;default:T.key.length===1&&!T.ctrlKey&&!T.metaKey&&I(T.key)}};function I(T){y.current&&clearTimeout(y.current);const w=k+T.toLowerCase();z(w);const v=S.findIndex(O=>(O.kind==="radio"?O.item.options[O.optionIdx].label:O.item.label).toLowerCase().startsWith(w));v>=0&&u(v),y.current=setTimeout(()=>z(""),800)}function R(T,w){const v=w.getBoundingClientRect();o(T.id);const O=Math.min(T.items.length*38+12,360);p(yi(v,220,O))}function $(){o(null),p(null)}const N=()=>{let T=-1;return e.map(w=>{if(w.type==="separator")return t.jsx("div",{role:"separator",style:{margin:(w.label,"4px 0"),display:"flex",alignItems:"center",gap:8},children:w.label?t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{flex:1,height:1,backgroundColor:l.border,marginLeft:14}}),t.jsx("span",{style:{fontSize:"11px",fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:l.textMuted,fontFamily:"inherit",whiteSpace:"nowrap"},children:W(w.label)}),t.jsx("div",{style:{flex:1,height:1,backgroundColor:l.border,marginRight:14}})]}):t.jsx("div",{style:{flex:1,height:1,backgroundColor:l.border,margin:"0 10px"}})},w.id);if(w.type==="radio-group")return t.jsxs("div",{role:"group","aria-label":w.label,children:[w.label&&t.jsx("div",{style:{padding:"6px 14px 2px",fontSize:"11px",fontWeight:700,letterSpacing:"0.07em",textTransform:"uppercase",color:l.textMuted,fontFamily:"inherit"},"aria-hidden":"true",children:W(w.label)}),w.options.map((L,V)=>{T++;const E=T,B=E===d,P=L.value===w.value,Y=!!w.disabled,A=Mt(l,B,!1,Y);return t.jsxs("div",{role:"menuitemradio","aria-checked":P,"aria-disabled":Y||void 0,"data-midx":E,tabIndex:-1,style:A,onClick:()=>{var H;return!Y&&((H=w.onChange)==null?void 0:H.call(w,L.value))},onMouseEnter:()=>!Y&&u(E),children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:P?t.jsx(ji,{color:l.primary}):t.jsx("span",{style:{width:14,height:14,borderRadius:"50%",border:`2px solid ${l.border}`,display:"inline-block"}})}),L.icon&&t.jsx("span",{style:{flexShrink:0,display:"flex",color:l.textMuted},children:L.icon}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:W(L.label)})]},L.value)})]},w.id);if(w.type==="check"){T++;const L=T,V=L===d,E=!!w.disabled,B=Mt(l,V,!1,E);return t.jsxs("div",{role:"menuitemcheckbox","aria-checked":w.checked,"aria-disabled":E||void 0,"data-midx":L,tabIndex:-1,style:B,onClick:()=>{var P;return!E&&((P=w.onChange)==null?void 0:P.call(w,!w.checked))},onMouseEnter:()=>!E&&u(L),children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:w.checked?t.jsx(wi,{color:l.primary}):t.jsx("span",{style:{width:14,height:14,display:"inline-block"}})}),w.icon&&t.jsx("span",{style:{flexShrink:0,display:"flex",color:l.textMuted},children:w.icon}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:W(w.label)})]},w.id)}if(w.type==="submenu"){T++;const L=T,V=L===d,E=!!w.disabled,B=x===w.id,P=Mt(l,V||B,!1,E);return t.jsxs("div",{style:{position:"relative"},children:[t.jsxs("div",{role:"menuitem","aria-haspopup":"menu","aria-expanded":B,"aria-disabled":E||void 0,"data-midx":L,tabIndex:-1,style:P,onMouseEnter:Y=>{E||(u(L),R(w,Y.currentTarget))},onMouseLeave:()=>{},onClick:()=>{E||o(B?null:w.id)},children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:w.icon?t.jsx("span",{style:{display:"flex",color:l.textMuted},children:w.icon}):t.jsx("span",{style:{width:14}})}),t.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:W(w.label)}),t.jsx(Si,{color:l.textMuted})]}),B&&m&&We.createPortal(t.jsx(Wn,{items:w.items,pos:m,panelId:`${n}-sub-${w.id}`,onClose:$,onCloseAll:s,isSubmenu:!0}),document.body)]},w.id)}const v=w;T++;const O=T,f=O===d,g=!!v.disabled,j=!!v.danger,F=Mt(l,f,j,g);return t.jsxs("div",{role:"menuitem","aria-disabled":g||void 0,"data-midx":O,tabIndex:-1,style:F,onClick:()=>{var L;g||((L=v.onClick)==null||L.call(v),s())},onMouseEnter:()=>{g||(u(O),$())},children:[t.jsx("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:v.icon?t.jsx("span",{style:{display:"flex",color:j?l.danger:l.textMuted},children:v.icon}):t.jsx("span",{style:{width:14}})}),t.jsxs("span",{style:{flex:1,minWidth:0},children:[t.jsx("span",{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:W(v.label)}),v.description&&t.jsx("span",{style:{display:"block",fontSize:"12px",color:l.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:W(v.description)})]}),v.shortcut&&t.jsx("span",{style:{fontSize:"12px",color:l.textMuted,fontFamily:"inherit",flexShrink:0,marginLeft:16,opacity:.8},children:W(v.shortcut)})]},v.id)})};return t.jsxs(t.Fragment,{children:[t.jsx("style",{children:vi}),t.jsx("div",{ref:h,id:n,role:"menu",tabIndex:-1,className:"tkx-menu-panel",onKeyDown:C,style:{...ki(l,r),maxHeight:400,overflowY:"auto"},children:N()})]})}function Mt(e,r,n,i){const s=n?e.danger:e.text;return{display:"flex",alignItems:"center",gap:8,padding:"7px 14px",fontSize:"14px",fontFamily:"inherit",cursor:i?"not-allowed":"pointer",userSelect:"none",color:i?e.textMuted:r&&n?e.danger:s,backgroundColor:r?n?`${e.danger}18`:`${e.primary}18`:"transparent",transition:"background-color 80ms",opacity:i?.5:1,outline:"none"}}function Pn({trigger:e,items:r,placement:n="bottom-start",isDisabled:i=!1,onOpen:s,onClose:a,className:l,style:d}){const x=`tkx-menu-${c.useId().replace(/:/g,"")}`,[o,m]=c.useState(!1),[p,h]=c.useState(null),k=c.useRef(null),z=c.useCallback(()=>{if(i)return;const M=k.current;if(!M)return;const C=M.getBoundingClientRect(),I=Math.min(r.length*38+12,360);h(Hr(C,n,220,I)),m(!0),s==null||s()},[i,r.length,s,n]),y=c.useCallback(()=>{var M,C,I;m(!1),a==null||a(),(I=(C=(M=k.current)==null?void 0:M.firstElementChild)==null?void 0:C.focus)==null||I.call(C)},[a]);c.useEffect(()=>{if(!o)return;const M=C=>{var $;const I=C.target;if(($=k.current)!=null&&$.contains(I))return;const R=document.querySelectorAll(".tkx-menu-panel");for(const N of R)if(N.contains(I))return;y()};return document.addEventListener("pointerdown",M),()=>document.removeEventListener("pointerdown",M)},[o,y]),c.useEffect(()=>{if(!o)return;const M=()=>{const C=k.current;if(!C)return;const I=C.getBoundingClientRect(),R=Math.min(r.length*38+12,360);h(Hr(I,n,220,R))};return window.addEventListener("scroll",M,!0),window.addEventListener("resize",M),()=>{window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",M)}},[o,r.length,n]);const S=M=>{(M.key==="Enter"||M.key===" "||M.key==="ArrowDown")&&(M.preventDefault(),o||z()),M.key==="Escape"&&o&&(M.preventDefault(),y())};return t.jsxs("span",{ref:k,className:l,style:{display:"inline-flex",...d},children:[t.jsx("span",{role:"button",tabIndex:i?-1:0,"aria-haspopup":"menu","aria-expanded":o,"aria-controls":o?x:void 0,"aria-disabled":i||void 0,onClick:()=>o?y():z(),onKeyDown:S,style:{display:"inline-flex",cursor:i?"not-allowed":"pointer",opacity:i?.55:1,outline:"none"},children:e}),o&&p&&We.createPortal(t.jsx(Wn,{items:r,pos:p,panelId:x,onClose:y,onCloseAll:y}),document.body)]})}Pn.displayName="TkxMenu";const Mi={sm:120,md:180,lg:240,xl:320};function Ct(e){const r=new Date;if(e)try{const l=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"numeric",second:"numeric",hour12:!1,weekday:"long",month:"long",day:"2-digit",year:"numeric"}).formatToParts(r),d=y=>{var S;return((S=l.find(M=>M.type===y))==null?void 0:S.value)??"0"};let u=parseInt(d("hour"),10);u===24&&(u=0);const x=parseInt(d("minute"),10),o=parseInt(d("second"),10),m=d("weekday"),p=d("month"),h=d("day"),k=d("year"),z=`${m}, ${p} ${h}, ${k}`;return{hours:u,minutes:x,seconds:o,milliseconds:r.getMilliseconds(),dateString:z}}catch{}const n=r.getHours(),i=r.getMinutes(),s=r.getSeconds(),a=r.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"2-digit",year:"numeric"});return{hours:n,minutes:i,seconds:s,milliseconds:r.getMilliseconds(),dateString:a}}function Ci({time:e,size:r,analogStyle:n,showSeconds:i,reducedMotion:s,primary:a,danger:l,text:d,textMuted:u,border:x,surface:o,bg:m}){const p=r/2,h=r/2,k=r/2-4,{hours:z,minutes:y,seconds:S,milliseconds:M}=e,I=(S+(s?0:M)/1e3)/60*360,R=y/60*360+S/60*6,$=z%12/12*360+y/60*30,N=(j,F)=>{const L=(j-90)*Math.PI/180;return{x:p+Math.cos(L)*F,y:h+Math.sin(L)*F}},T=s?"none":"transform 0.15s cubic-bezier(0.4, 2.08, 0.55, 0.44)";if(n==="modern"){const j=(Y,A)=>{const Q=-90+Y*360,G={x:p+Math.cos(-90*Math.PI/180)*A,y:h+Math.sin(-90*Math.PI/180)*A},ne={x:p+Math.cos(Q*Math.PI/180)*A,y:h+Math.sin(Q*Math.PI/180)*A},pe=Y>.5?1:0;return`M ${G.x} ${G.y} A ${A} ${A} 0 ${pe} 1 ${ne.x} ${ne.y}`},F=z%12/12+y/60/12,L=y/60+S/3600,V=(S+(s?0:M/1e3))/60,E=k-2,B=k-10,P=k-18;return t.jsxs("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,"aria-hidden":"true",children:[t.jsx("circle",{cx:p,cy:h,r:E,fill:"none",stroke:x,strokeWidth:4}),t.jsx("circle",{cx:p,cy:h,r:B,fill:"none",stroke:x,strokeWidth:4}),i&&t.jsx("circle",{cx:p,cy:h,r:P,fill:"none",stroke:x,strokeWidth:3}),t.jsx("path",{d:j(F,E),fill:"none",stroke:a,strokeWidth:4,strokeLinecap:"round"}),t.jsx("path",{d:j(L,B),fill:"none",stroke:d,strokeWidth:4,strokeLinecap:"round"}),i&&t.jsx("path",{d:j(V,P),fill:"none",stroke:l,strokeWidth:3,strokeLinecap:"round"}),t.jsx("circle",{cx:p,cy:h,r:4,fill:a}),t.jsxs("text",{x:p,y:h+20,textAnchor:"middle",fontSize:r*.12,fill:u,fontFamily:"monospace",style:{fontVariantNumeric:"tabular-nums"},children:[String(z).padStart(2,"0"),":",String(y).padStart(2,"0")]})]})}const w=N($,k*.5),v=N(R,k*.75),O=N(I,k*.85),f=N(I+180,k*.2),g=[];if(n==="classic"){for(let F=0;F<60;F++){const L=F/60*360,V=F%5===0,E=(L-90)*Math.PI/180,B=V?k-10:k-6,P=p+Math.cos(E)*k,Y=h+Math.sin(E)*k,A=p+Math.cos(E)*B,H=h+Math.sin(E)*B;g.push(t.jsx("line",{x1:P,y1:Y,x2:A,y2:H,stroke:V?d:u,strokeWidth:V?2:1,strokeLinecap:"round"},F))}const j=[{n:12,angle:0},{n:3,angle:90},{n:6,angle:180},{n:9,angle:270}];for(const{n:F,angle:L}of j){const V=(L-90)*Math.PI/180,E=k-20;g.push(t.jsx("text",{x:p+Math.cos(V)*E,y:h+Math.sin(V)*E,textAnchor:"middle",dominantBaseline:"central",fontSize:r*.09,fill:d,fontFamily:"system-ui, sans-serif",fontWeight:"600",children:F},`n${F}`))}}else for(let j=0;j<12;j++){const L=(j/12*360-90)*Math.PI/180,V=k-8;g.push(t.jsx("circle",{cx:p+Math.cos(L)*V,cy:h+Math.sin(L)*V,r:j%3===0?3:2,fill:j%3===0?d:u},j))}return t.jsxs("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,"aria-hidden":"true",style:{display:"block"},children:[t.jsx("circle",{cx:p,cy:h,r:k,fill:o,stroke:x,strokeWidth:2}),g,t.jsx("line",{x1:p,y1:h,x2:w.x,y2:w.y,stroke:a,strokeWidth:n==="minimal"?3:4,strokeLinecap:"round",style:{transformOrigin:`${p}px ${h}px`,transition:T}}),t.jsx("line",{x1:p,y1:h,x2:v.x,y2:v.y,stroke:d,strokeWidth:n==="minimal"?2:3,strokeLinecap:"round",style:{transformOrigin:`${p}px ${h}px`,transition:T}}),i&&t.jsxs(t.Fragment,{children:[t.jsx("line",{x1:f.x,y1:f.y,x2:O.x,y2:O.y,stroke:l,strokeWidth:1.5,strokeLinecap:"round",style:{transformOrigin:`${p}px ${h}px`,transition:"none"}}),t.jsx("circle",{cx:p,cy:h,r:3,fill:l})]}),t.jsx("circle",{cx:p,cy:h,r:n==="minimal"?3:5,fill:a})]})}function Vr({time:e,format:r,showSeconds:n,showDate:i,label:s,size:a,primary:l,text:d,textMuted:u,colonVisible:x}){const{hours:o,minutes:m,seconds:p,dateString:h}=e;let k=o,z="";r==="12h"&&(z=o>=12?"PM":"AM",k=o%12||12);const y=a*.2,S={opacity:x?1:0,transition:"opacity 0.1s",display:"inline-block",minWidth:"0.5ch",textAlign:"center"};return t.jsxs("div",{style:{textAlign:"center",fontFamily:"'Courier New', Courier, monospace",fontVariantNumeric:"tabular-nums",lineHeight:1.1},children:[t.jsxs("div",{style:{fontSize:y,color:l,fontWeight:700,letterSpacing:"0.05em",display:"flex",alignItems:"center",justifyContent:"center",gap:0},children:[t.jsx("span",{children:String(k).padStart(2,"0")}),t.jsx("span",{style:S,children:":"}),t.jsx("span",{children:String(m).padStart(2,"0")}),n&&t.jsxs(t.Fragment,{children:[t.jsx("span",{style:S,children:":"}),t.jsx("span",{children:String(p).padStart(2,"0")})]}),r==="12h"&&t.jsx("span",{style:{fontSize:y*.45,color:u,marginLeft:"0.4ch",alignSelf:"flex-end",marginBottom:y*.05},children:z})]}),i&&t.jsx("div",{style:{fontSize:a*.072,color:u,marginTop:a*.025,letterSpacing:"0.03em"},children:h}),s&&t.jsx("div",{style:{fontSize:a*.065,color:u,marginTop:a*.015,textTransform:"uppercase",letterSpacing:"0.08em"},children:W(s)})]})}function Hn({variant:e="both",size:r="md",showSeconds:n=!0,showDate:i=!1,format:s="24h",timezone:a,timezone2:l,label:d,analogStyle:u="classic",className:x,style:o}){const m=ee(),p=we(),[h,k]=c.useState(()=>Ct(a)),[z,y]=c.useState(()=>l?Ct(l):null),[S,M]=c.useState(!0),[C,I]=c.useState(!1),R=c.useRef(null);c.useEffect(()=>{I(!0)},[]),c.useEffect(()=>{const v=()=>{k(Ct(a)),l&&y(Ct(l))};v();const O=setInterval(v,1e3);return()=>clearInterval(O)},[a,l]),c.useEffect(()=>(R.current=setInterval(()=>{M(v=>!v)},500),()=>{R.current&&clearInterval(R.current)}),[]);const $=Mi[r],N=e==="analog"||e==="both",T=e==="digital"||e==="both",w={display:"inline-flex",flexDirection:"column",alignItems:"center",gap:e==="both"?`${$*.06}px`:0,opacity:C?1:0,transition:p?"none":"opacity 0.4s ease",...o};return t.jsxs("div",{className:x,style:w,role:"timer","aria-live":"off",children:[N&&t.jsx(Ci,{time:h,size:$,analogStyle:u,showSeconds:n,reducedMotion:p,primary:m.primary,danger:m.danger,text:m.text,textMuted:m.textMuted,border:m.border,surface:m.surface,bg:m.bg}),T&&t.jsx(Vr,{time:h,format:s,showSeconds:n,showDate:i,label:d,size:$,primary:m.primary,text:m.text,textMuted:m.textMuted,colonVisible:S}),z&&l&&t.jsx("div",{style:{marginTop:$*.04,padding:`${$*.03}px ${$*.06}px`,borderTop:`1px solid ${m.border}`,textAlign:"center"},children:t.jsx(Vr,{time:z,format:s,showSeconds:!1,showDate:!1,label:l,size:$*.7,primary:m.secondary,text:m.text,textMuted:m.textMuted,colonVisible:S})})]})}Hn.displayName="TkxClock";function Xt(e){if(!isFinite(e)||isNaN(e))return"0:00";const r=Math.floor(e/3600),n=Math.floor(e%3600/60),i=Math.floor(e%60);return r>0?`${r}:${String(n).padStart(2,"0")}:${String(i).padStart(2,"0")}`:`${n}:${String(i).padStart(2,"0")}`}function De({path:e,size:r=20,color:n="currentColor",title:i}){return t.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:n,"aria-hidden":i?void 0:"true",role:i?"img":void 0,"aria-label":i,style:{display:"block",flexShrink:0},children:t.jsx("path",{d:e})})}const Ie={play:"M8 5v14l11-7z",pause:"M6 19h4V5H6v14zm8-14v14h4V5h-4z",volumeUp:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z",volumeMute:"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z",volumeDown:"M18.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM5 9v6h4l5 5V4L9 9H5z",fullscreen:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z",fullscreenExit:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z",pip:"M19 11h-8v6h8v-6zm4 8V4.98C23 3.88 22.1 3 21 3H3c-1.1 0-2 .88-2 1.98V19c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H3V4.97h18v14.05z",download:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z",closedCaption:"M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 7H9.5v-.5h-2v3h2V13H11v1c0 .55-.45 1-1 1H7c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v1zm7 0h-1.5v-.5h-2v3h2V13H18v1c0 .55-.45 1-1 1h-3c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v1z",replay10:"M11.99 5V1l-5 5 5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6h-2c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z",forward10:"M18 13c0 3.31-2.69 6-6 6s-6-2.69-6-6h-2c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8V1l-5 5 5 5V7c3.31 0 6 2.69 6 6z",errorOutline:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z",refresh:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"};function Ze({onClick:e,title:r,children:n,active:i,primary:s}){const[a,l]=c.useState(!1);return t.jsx("button",{type:"button",onClick:e,title:r,"aria-label":r,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{background:"none",border:"none",padding:"6px",cursor:"pointer",color:i||a?s:"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",flexShrink:0,transition:"color 0.15s ease"},children:n})}function Vn({src:e,poster:r,title:n,width:i="100%",height:s,autoPlay:a=!1,loop:l=!1,muted:d=!1,controls:u=!0,showTitle:x=!0,allowFullscreen:o=!0,allowPiP:m=!0,allowDownload:p=!1,chapters:h=[],subtitles:k=[],startTime:z,onPlay:y,onPause:S,onEnded:M,onTimeUpdate:C,className:I,style:R}){const $=ee(),N=we(),T=c.useRef(null),w=c.useRef(null),v=c.useRef(null),O=c.useRef(null),[f,g]=c.useState(!1),[j,F]=c.useState(0),[L,V]=c.useState(0),[E,B]=c.useState(0),[P,Y]=c.useState(1),[A,H]=c.useState(d),[Q,G]=c.useState(!1),[ne,pe]=c.useState(!0),[xe,oe]=c.useState(!1),[me,X]=c.useState(1),[Z,ye]=c.useState(!1),[ke,de]=c.useState(-1),[ge,J]=c.useState(null),[ie,re]=c.useState(0),[q,te]=c.useState(null),[be,$e]=c.useState(!1),[Me,Te]=c.useState(!1),[Ke,Ee]=c.useState(null),[U,le]=c.useState(!1);c.useEffect(()=>{const D=T.current;if(!D)return;z!==void 0&&(D.currentTime=z);const fe=()=>{F(D.currentTime),D.buffered.length>0&&B(D.buffered.end(D.buffered.length-1))},ve=()=>V(D.duration),Ce=()=>g(!0),qe=()=>{g(!1),oe(!0)},Oe=()=>{g(!1),oe(!0),M==null||M()},lt=()=>$e(!0),ct=()=>$e(!1),dt=()=>Te(!0),wt=()=>Te(!1),jt=()=>{const Fe=D.error;Ee(Fe?`Error ${Fe.code}: ${Fe.message||"Failed to load video"}`:"Failed to load video"),Te(!1)};return D.addEventListener("timeupdate",fe),D.addEventListener("durationchange",ve),D.addEventListener("play",Ce),D.addEventListener("pause",qe),D.addEventListener("ended",Oe),D.addEventListener("enterpictureinpicture",lt),D.addEventListener("leavepictureinpicture",ct),D.addEventListener("waiting",dt),D.addEventListener("canplay",wt),D.addEventListener("error",jt),()=>{D.removeEventListener("timeupdate",fe),D.removeEventListener("durationchange",ve),D.removeEventListener("play",Ce),D.removeEventListener("pause",qe),D.removeEventListener("ended",Oe),D.removeEventListener("enterpictureinpicture",lt),D.removeEventListener("leavepictureinpicture",ct),D.removeEventListener("waiting",dt),D.removeEventListener("canplay",wt),D.removeEventListener("error",jt)}},[M,z]),c.useEffect(()=>{T.current&&(f?y==null||y():S==null||S())},[f,y,S]),c.useEffect(()=>{C==null||C(j,L)},[j,L,C]),c.useEffect(()=>{const D=T.current;if(!D)return;const fe=D.textTracks;for(let ve=0;ve<fe.length;ve++)fe[ve].mode=ve===ke?"showing":"disabled"},[ke]),c.useEffect(()=>{const D=()=>G(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",D),()=>document.removeEventListener("fullscreenchange",D)},[]),c.useEffect(()=>{const D=w.current;if(!D)return;const fe=ve=>{const Ce=T.current;if(Ce&&ve.target.tagName!=="INPUT")switch(ve.key){case" ":case"k":ve.preventDefault(),Se();break;case"f":case"F":o&&Le();break;case"m":case"M":Ae();break;case"ArrowRight":ve.preventDefault(),Ce.currentTime=Math.min(Ce.currentTime+10,Ce.duration);break;case"ArrowLeft":ve.preventDefault(),Ce.currentTime=Math.max(Ce.currentTime-10,0);break;case"ArrowUp":ve.preventDefault(),Y(Math.min(P+.1,1)),T.current&&(T.current.volume=Math.min(P+.1,1));break;case"ArrowDown":ve.preventDefault(),Y(Math.max(P-.1,0)),T.current&&(T.current.volume=Math.max(P-.1,0));break}};return D.addEventListener("keydown",fe),()=>D.removeEventListener("keydown",fe)},[P,o]);const se=c.useCallback(()=>{pe(!0),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{f&&pe(!1)},3e3)},[f]);c.useEffect(()=>(se(),()=>{O.current&&clearTimeout(O.current)}),[f,se]);const Se=c.useCallback(()=>{const D=T.current;D&&(D.paused?(D.play().catch(()=>{}),te("play"),oe(!1)):(D.pause(),te("pause")),setTimeout(()=>te(null),600))},[]),Ae=c.useCallback(()=>{const D=T.current;if(!D)return;const fe=!A;H(fe),D.muted=fe},[A]),Le=c.useCallback(()=>{const D=w.current;D&&(document.fullscreenElement?document.exitFullscreen().catch(()=>{}):D.requestFullscreen().catch(()=>{}))},[]),at=c.useCallback(async()=>{const D=T.current;if(D)try{document.pictureInPictureElement?await document.exitPictureInPicture():await D.requestPictureInPicture()}catch{}},[]),rt=c.useCallback(()=>{k.length!==0&&(de(D=>(D+1)%(k.length+1)-1),de(D=>{const fe=D+1;return fe>=k.length?-1:fe}))},[k.length]),xt=c.useCallback(()=>{const D=T.current;D&&(D.currentTime=Math.min(D.currentTime+10,D.duration||0))},[]),ht=c.useCallback(()=>{const D=T.current;D&&(D.currentTime=Math.max(D.currentTime-10,0))},[]),mt=c.useCallback(()=>{const D=T.current;D&&(Ee(null),D.load())},[]),Ye=c.useCallback(()=>{o&&Le()},[o,Le]),Xe=c.useCallback(D=>{const fe=T.current,ve=v.current;if(!fe||!ve||!L)return;const Ce=ve.getBoundingClientRect(),qe=Math.max(0,Math.min(1,(D.clientX-Ce.left)/Ce.width));fe.currentTime=qe*L},[L]),nt=c.useCallback(D=>{const fe=v.current;if(!fe||!L)return;const ve=fe.getBoundingClientRect(),Ce=Math.max(0,Math.min(1,(D.clientX-ve.left)/ve.width));J(Ce*L),re(D.clientX-ve.left)},[L]),Dt=c.useCallback(D=>{const fe=parseFloat(D.target.value);Y(fe),T.current&&(T.current.volume=fe,T.current.muted=fe===0,H(fe===0))},[]),Ft=c.useCallback(D=>{X(D),T.current&&(T.current.playbackRate=D),ye(!1)},[]),gt=h.length>0?[...h].reverse().find(D=>j>=D.time):null,bt=D=>[...h].reverse().find(fe=>D>=fe.time)??null,Bt=Array.isArray(e)?e:[{src:e,type:"video/mp4"}],Wt=Array.isArray(e)?e[0].src:e,yt=ne||xe||!f,vt=N?"none":"opacity 0.25s ease",Pt=A||P===0?Ie.volumeMute:P<.5?Ie.volumeDown:Ie.volumeUp,kt=L>0?j/L*100:0,Ht=L>0?E/L*100:0;return t.jsxs("div",{ref:w,className:I,tabIndex:0,onMouseMove:se,onMouseLeave:()=>{f&&pe(!1)},style:{position:"relative",width:i,height:s??"auto",background:"#000",borderRadius:"8px",overflow:"hidden",outline:"none",userSelect:"none",...R},children:[t.jsxs("video",{ref:T,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"},poster:r,autoPlay:a,loop:l,muted:d,playsInline:!0,onClick:Se,onDoubleClick:Ye,children:[Bt.map((D,fe)=>t.jsx("source",{src:D.src,type:D.type},fe)),k.map((D,fe)=>t.jsx("track",{kind:"subtitles",label:W(D.label),srcLang:D.lang,src:D.src,default:D.default},fe))]}),x&&n&&t.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,background:"linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, transparent 100%)",padding:"16px 16px 32px",opacity:yt?1:0,transition:vt,pointerEvents:"none"},children:[t.jsx("span",{style:{color:"#fff",fontSize:"0.95rem",fontWeight:600,textShadow:"0 1px 3px rgba(0,0,0,0.7)"},children:W(n)}),gt&&t.jsxs("span",{style:{color:"rgba(255,255,255,0.65)",fontSize:"0.8rem",marginLeft:8},children:["— ",W(gt.label)]})]}),q&&t.jsx("div",{"aria-hidden":"true",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:"rgba(0,0,0,0.45)",borderRadius:"50%",width:64,height:64,display:"flex",alignItems:"center",justifyContent:"center",animation:N?"none":"tkxvp-flash 0.6s ease forwards",pointerEvents:"none"},children:t.jsx(De,{path:q==="play"?Ie.play:Ie.pause,size:32,color:"#fff"})}),Me&&!Ke&&t.jsx("div",{"aria-label":"Loading",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:10},children:t.jsx("div",{style:{width:48,height:48,border:"4px solid rgba(255,255,255,0.25)",borderTopColor:$.primary,borderRadius:"50%",animation:N?"none":"tkxvp-spin 0.8s linear infinite"}})}),Ke&&t.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.8)",zIndex:20,gap:12},children:[t.jsx(De,{path:Ie.errorOutline,size:48,color:"#ef4444"}),t.jsx("span",{style:{color:"#fff",fontSize:"0.9rem",maxWidth:"80%",textAlign:"center"},children:Ke}),t.jsxs("button",{type:"button",onClick:mt,style:{display:"flex",alignItems:"center",gap:6,background:$.primary,color:"#fff",border:"none",borderRadius:6,padding:"8px 18px",fontSize:"0.85rem",fontWeight:600,cursor:"pointer",marginTop:4},children:[t.jsx(De,{path:Ie.refresh,size:18,color:"#fff"}),"Retry"]})]}),u&&t.jsxs("div",{style:{position:"absolute",bottom:0,left:0,right:0,background:"linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 70%, transparent 100%)",padding:"32px 12px 8px",opacity:yt?1:0,transition:vt},onMouseEnter:()=>oe(!0),onMouseLeave:()=>oe(!1),children:[t.jsxs("div",{ref:v,role:"slider","aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.floor(L),"aria-valuenow":Math.floor(j),tabIndex:0,onClick:Xe,onMouseMove:nt,style:{position:"relative",height:4,borderRadius:2,background:"rgba(255,255,255,0.25)",cursor:"pointer",marginBottom:8,transition:"height 0.15s ease"},onMouseEnter:D=>{D.currentTarget.style.height="8px"},onMouseLeave:D=>{D.currentTarget.style.height="4px",J(null)},children:[t.jsx("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${Ht}%`,background:"rgba(255,255,255,0.3)",borderRadius:2,pointerEvents:"none"}}),t.jsx("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${kt}%`,background:$.primary,borderRadius:2,pointerEvents:"none"}}),t.jsx("div",{style:{position:"absolute",top:"50%",left:`${kt}%`,transform:"translate(-50%, -50%)",width:12,height:12,borderRadius:"50%",background:$.primary,pointerEvents:"none"}}),h.map((D,fe)=>{const ve=L>0?D.time/L*100:0;return t.jsx("div",{title:W(D.label),style:{position:"absolute",top:"50%",left:`${ve}%`,transform:"translate(-50%, -50%)",width:8,height:8,borderRadius:"50%",background:"#fff",border:`2px solid ${$.primary}`,zIndex:2,cursor:"pointer",pointerEvents:"auto"}},fe)}),ge!==null&&t.jsxs("div",{style:{position:"absolute",bottom:12,left:ie,transform:"translateX(-50%)",background:"rgba(0,0,0,0.8)",color:"#fff",fontSize:"0.72rem",padding:"2px 6px",borderRadius:4,whiteSpace:"nowrap",pointerEvents:"none"},children:[Xt(ge),bt(ge)&&t.jsx("span",{style:{display:"block",fontSize:"0.65rem",color:"rgba(255,255,255,0.7)"},children:W(bt(ge).label)})]})]}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:2},children:[t.jsx(Ze,{onClick:Se,title:f?"Pause":"Play",primary:$.primary,children:t.jsx(De,{path:f?Ie.pause:Ie.play,size:22})}),t.jsx(Ze,{onClick:ht,title:"Skip back 10 seconds",primary:$.primary,children:t.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx(De,{path:Ie.replay10,size:22}),t.jsx("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),t.jsx(Ze,{onClick:xt,title:"Skip forward 10 seconds",primary:$.primary,children:t.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx(De,{path:Ie.forward10,size:22}),t.jsx("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),t.jsxs("div",{style:{display:"flex",alignItems:"center",position:"relative"},onMouseEnter:()=>le(!0),onMouseLeave:()=>le(!1),children:[t.jsx(Ze,{onClick:Ae,title:A?"Unmute":"Mute",primary:$.primary,children:t.jsx(De,{path:Pt,size:20})}),t.jsx("div",{style:{overflow:"hidden",width:U?64:0,opacity:U?1:0,transition:N?"none":"width 0.2s ease, opacity 0.2s ease",display:"flex",alignItems:"center"},children:t.jsx("input",{type:"range",min:0,max:1,step:.05,value:A?0:P,onChange:Dt,"aria-label":"Volume",style:{width:64,accentColor:$.primary,cursor:"pointer",height:4}})})]}),t.jsxs("span",{style:{color:"#fff",fontSize:"0.78rem",fontFamily:"monospace",fontVariantNumeric:"tabular-nums",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:[Xt(j)," / ",Xt(L)]}),t.jsx("div",{style:{flex:1}}),k.length>0&&t.jsx(Ze,{onClick:rt,title:"Subtitles",primary:$.primary,active:ke>=0,children:t.jsx(De,{path:Ie.closedCaption,size:20})}),t.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[t.jsxs("button",{type:"button",onClick:()=>ye(D=>!D),title:"Playback speed",style:{background:"none",border:"none",cursor:"pointer",color:"#fff",fontSize:"0.75rem",fontWeight:600,padding:"6px 8px",letterSpacing:"0.02em",position:"relative"},children:[me,"×"]}),me!==1&&t.jsxs("span",{style:{position:"absolute",top:0,right:0,background:$.primary,color:"#fff",fontSize:"0.55rem",fontWeight:700,borderRadius:6,padding:"1px 4px",lineHeight:1.2,pointerEvents:"none"},children:[me,"x"]}),Z&&t.jsx("div",{style:{position:"absolute",bottom:"100%",right:0,background:"rgba(20,20,20,0.97)",border:`1px solid ${$.border}`,borderRadius:6,overflow:"hidden",zIndex:100,minWidth:80},children:[.5,.75,1,1.25,1.5,2].map(D=>t.jsxs("button",{type:"button",onClick:()=>Ft(D),style:{display:"block",width:"100%",padding:"6px 14px",background:D===me?$.primary+"30":"none",border:"none",color:D===me?$.primary:"#fff",fontSize:"0.8rem",cursor:"pointer",textAlign:"left"},children:[D,"×"]},D))})]}),m&&typeof document<"u"&&"pictureInPictureEnabled"in document&&t.jsx(Ze,{onClick:at,title:"Picture-in-Picture",primary:$.primary,active:be,children:t.jsx(De,{path:Ie.pip,size:20})}),p&&t.jsx("a",{href:Wt,download:!0,title:"Download",style:{color:"#fff",display:"flex",alignItems:"center",padding:"6px"},children:t.jsx(De,{path:Ie.download,size:20})}),o&&t.jsx(Ze,{onClick:Le,title:Q?"Exit fullscreen":"Fullscreen",primary:$.primary,children:t.jsx(De,{path:Q?Ie.fullscreenExit:Ie.fullscreen,size:20})})]})]}),t.jsx("style",{children:`
57
+ @keyframes tkxvp-flash {
58
+ 0% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
59
+ 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.5); }
60
+ }
61
+ @keyframes tkxvp-spin {
62
+ 0% { transform: rotate(0deg); }
63
+ 100% { transform: rotate(360deg); }
64
+ }
65
+ `})]})}Vn.displayName="TkxVideoPlayer";const Ti={sm:{circle:24,fontSize:"0.75rem",titleSize:"0.8rem",descSize:"0.7rem",connectorWidth:2},md:{circle:32,fontSize:"0.875rem",titleSize:"0.9rem",descSize:"0.775rem",connectorWidth:2},lg:{circle:40,fontSize:"1rem",titleSize:"1rem",descSize:"0.85rem",connectorWidth:3}};function Ii({size:e}){const r=e*.55;return t.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"})})}function Ei({size:e}){const r=e*.55;return t.jsx("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})})}function zi({status:e,index:r,showStepNumbers:n,icon:i,circleSize:s,fontSize:a,primary:l,danger:d,success:u,text:x,textMuted:o,border:m,surface:p,variant:h,reducedMotion:k,clickable:z}){const y=e==="completed",S=e==="active",M=e==="error",C=e==="pending";let I=p,R=m,$=o,N=2;y?(I=h==="filled"?u:p,R=u,$=h==="filled"?"#fff":u):S?(I=h==="outlined"?p:l,R=l,$=h==="outlined"?l:"#fff",N=2):M?(I=h==="filled"?d:p,R=d,$=h==="filled"?"#fff":d):C&&(I=p,R=m,$=o);const T=S&&!k?{boxShadow:`0 0 0 4px ${l}30`,animation:"tkxstepper-pulse 2s ease-in-out infinite"}:{},w=z?{cursor:"pointer",transition:"transform 0.15s ease, box-shadow 0.15s ease"}:{};let v;return i&&!y&&!M?v=t.jsx("span",{style:{fontSize:a,lineHeight:1},children:i}):y?v=t.jsx(Ii,{size:s}):M?v=t.jsx(Ei,{size:s}):n?v=t.jsx("span",{style:{fontSize:a,fontWeight:600,lineHeight:1},children:r+1}):v=t.jsx("span",{style:{fontSize:s*.22,lineHeight:1,background:$,borderRadius:"50%",width:s*.22,height:s*.22,display:"block"}}),t.jsxs(t.Fragment,{children:[t.jsx("style",{children:`
66
+ @keyframes tkxstepper-pulse {
67
+ 0%, 100% { box-shadow: 0 0 0 0 ${l}50; }
68
+ 50% { box-shadow: 0 0 0 6px ${l}20; }
69
+ }
70
+ `}),t.jsx("div",{style:{width:s,height:s,minWidth:s,borderRadius:"50%",border:`${N}px solid ${R}`,backgroundColor:I,color:$,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:k?"none":"background-color 0.2s, border-color 0.2s",...T,...w},children:v})]})}function Yr({completed:e,orientation:r,connectorStyle:n,connectorWidth:i,primary:s,border:a,reducedMotion:l}){const d=e?s:a;return r==="horizontal"?t.jsx("div",{"aria-hidden":"true",style:{flex:1,height:i,background:n==="solid"?d:"none",backgroundImage:n!=="solid"?`repeating-linear-gradient(90deg, ${d} 0, ${d} 6px, transparent 6px, transparent ${n==="dashed"?12:9}px)`:"none",borderRadius:1,transition:l?"none":"background 0.3s ease",alignSelf:"center",marginLeft:4,marginRight:4}}):t.jsx("div",{"aria-hidden":"true",style:{width:i,flex:1,minHeight:20,background:n==="solid"?d:"none",backgroundImage:n!=="solid"?`repeating-linear-gradient(180deg, ${d} 0, ${d} 6px, transparent 6px, transparent ${n==="dashed"?12:9}px)`:"none",borderRadius:1,transition:l?"none":"background 0.3s ease",alignSelf:"stretch",marginTop:4,marginBottom:4,marginLeft:"auto",marginRight:"auto"}})}function Yn({steps:e,activeStep:r=0,orientation:n="horizontal",variant:i="default",size:s="md",clickable:a=!1,onStepClick:l,showStepNumbers:d=!0,alternateLabel:u=!1,connector:x="solid",className:o,style:m}){const p=ee(),h=we(),k=Ti[s],z=(S,M)=>S.status?S.status:M<r?"completed":M===r?"active":"pending",y=n==="horizontal";return t.jsx("div",{className:o,role:"list","aria-label":"Steps",style:{display:"flex",flexDirection:y?"row":"column",alignItems:y?u?"flex-start":"center":"stretch",width:"100%",gap:0,...m},children:e.map((S,M)=>{const C=z(S,M),I=M===e.length-1,R=C==="completed"||M<r,$=M%2===0,N=()=>{a&&(l==null||l(M))},T=t.jsx(zi,{status:C,index:M,showStepNumbers:d,icon:S.icon,circleSize:k.circle,fontSize:k.fontSize,primary:p.primary,danger:p.danger,success:p.success,text:p.text,textMuted:p.textMuted,border:p.border,surface:p.surface,variant:i,reducedMotion:h,clickable:a}),w=t.jsxs("div",{style:{textAlign:y&&!u?"center":"left",maxWidth:y?120:void 0},children:[t.jsxs("div",{style:{fontSize:k.titleSize,fontWeight:C==="active"?600:500,color:C==="pending"?p.textMuted:C==="error"?p.danger:p.text,lineHeight:1.3,transition:h?"none":"color 0.2s"},children:[W(S.title),S.optional&&t.jsx("span",{style:{fontSize:k.descSize,color:p.textMuted,fontWeight:400,marginLeft:4},children:"(optional)"})]}),S.description&&t.jsx("div",{style:{fontSize:k.descSize,color:p.textMuted,marginTop:2,lineHeight:1.4},children:W(S.description)}),S.error&&C==="error"&&t.jsx("div",{style:{fontSize:k.descSize,color:p.danger,marginTop:2},children:W(S.error)})]});return y?t.jsxs("div",{role:"listitem",style:{display:"flex",flex:I?0:1,alignItems:"center",minWidth:0},children:[t.jsxs("div",{onClick:N,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6,cursor:a?"pointer":"default",flexShrink:0},"aria-current":C==="active"?"step":void 0,children:[u&&!$&&t.jsx("div",{style:{minHeight:k.circle*1.5+6,display:"flex",alignItems:"flex-end",paddingBottom:6},children:w}),T,!u&&w,u&&$&&t.jsx("div",{style:{marginTop:6},children:w})]}),!I&&t.jsx(Yr,{completed:R,orientation:"horizontal",connectorStyle:x,connectorWidth:k.connectorWidth,primary:p.primary,border:p.border,reducedMotion:h})]},S.id):t.jsxs("div",{role:"listitem",style:{display:"flex",flexDirection:"row",minHeight:0},children:[t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginRight:14,flexShrink:0},children:[t.jsx("div",{onClick:N,style:{cursor:a?"pointer":"default"},"aria-current":C==="active"?"step":void 0,children:T}),!I&&t.jsx(Yr,{completed:R,orientation:"vertical",connectorStyle:x,connectorWidth:k.connectorWidth,primary:p.primary,border:p.border,reducedMotion:h})]}),t.jsx("div",{style:{paddingTop:(k.circle-parseFloat(k.titleSize)*16)/2,paddingBottom:I?0:16,flex:1,minWidth:0},children:w})]},S.id)})})}Yn.displayName="TkxStepper";function On(e){let r=0,n=0,i=0;const s=e.replace("#","");s.length===3?(r=parseInt(s[0]+s[0],16),n=parseInt(s[1]+s[1],16),i=parseInt(s[2]+s[2],16)):s.length>=6&&(r=parseInt(s.slice(0,2),16),n=parseInt(s.slice(2,4),16),i=parseInt(s.slice(4,6),16)),r/=255,n/=255,i/=255;const a=Math.max(r,n,i),l=Math.min(r,n,i);let d=0,u=0;const x=(a+l)/2;if(a!==l){const o=a-l;switch(u=x>.5?o/(2-a-l):o/(a+l),a){case r:d=((n-i)/o+(n<i?6:0))/6;break;case n:d=((i-r)/o+2)/6;break;case i:d=((r-n)/o+4)/6;break}}return[Math.round(d*360),Math.round(u*100),Math.round(x*100)]}function nr(e,r,n){r/=100,n/=100;const i=r*Math.min(n,1-n),s=a=>{const l=(a+e/30)%12,d=n-i*Math.max(Math.min(l-3,9-l,1),-1);return Math.round(255*d).toString(16).padStart(2,"0")};return`#${s(0)}${s(8)}${s(4)}`}function Nt(e){const r=e.replace("#",""),n=parseInt(r.slice(0,2),16),i=parseInt(r.slice(2,4),16),s=parseInt(r.slice(4,6),16);return[isNaN(n)?0:n,isNaN(i)?0:i,isNaN(s)?0:s]}function qt(e,r,n){return`#${e.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}function Ge(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e)}function Zt(e,r,n){if(n==="hex")return r<1?`${e}${Math.round(r*255).toString(16).padStart(2,"0")}`:e;const[i,s,a]=Nt(e);if(n==="rgb")return r<1?`rgba(${i}, ${s}, ${a}, ${r.toFixed(2)})`:`rgb(${i}, ${s}, ${a})`;const[l,d,u]=On(e);return n==="hsl"?r<1?`hsla(${l}, ${d}%, ${u}%, ${r.toFixed(2)})`:`hsl(${l}, ${d}%, ${u}%)`:e}const Ni=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899","#ffffff","#94a3b8","#475569","#0f172a"];function Ri({hue:e,sat:r,bright:n,onChange:i}){const s=c.useRef(null),a=c.useRef(!1),l=c.useCallback(x=>{const o=s.current;if(!o)return;const m=o.getBoundingClientRect(),p=Math.max(0,Math.min(1,(x.clientX-m.left)/m.width)),h=Math.max(0,Math.min(1,(x.clientY-m.top)/m.height));i(Math.round(p*100),Math.round((1-h)*100))},[i]);c.useEffect(()=>{const x=m=>{a.current&&l(m)},o=()=>{a.current=!1};return document.addEventListener("mousemove",x),document.addEventListener("mouseup",o),()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",o)}},[l]);const d=`${r}%`,u=`${100-n}%`;return t.jsxs("div",{ref:s,style:{position:"relative",width:"100%",height:"160px",borderRadius:"6px",cursor:"crosshair",background:`hsl(${e}, 100%, 50%)`,flexShrink:0},onMouseDown:x=>{a.current=!0,l(x)},children:[t.jsx("div",{style:{position:"absolute",inset:0,borderRadius:"6px",background:"linear-gradient(to right, #ffffff, transparent)"}}),t.jsx("div",{style:{position:"absolute",inset:0,borderRadius:"6px",background:"linear-gradient(to bottom, transparent, #000000)"}}),t.jsx("div",{style:{position:"absolute",left:d,top:u,transform:"translate(-50%, -50%)",width:"14px",height:"14px",borderRadius:"50%",border:"2px solid white",boxShadow:"0 0 0 1px rgba(0,0,0,0.4)",pointerEvents:"none",backgroundColor:nr(e,r,n/2+25)}})]})}function Ai({hue:e,onChange:r}){const n=c.useRef(null),i=c.useRef(!1),s=c.useCallback(a=>{const l=n.current;if(!l)return;const d=l.getBoundingClientRect(),u=Math.max(0,Math.min(1,(a.clientX-d.left)/d.width));r(Math.round(u*360))},[r]);return c.useEffect(()=>{const a=d=>{i.current&&s(d)},l=()=>{i.current=!1};return document.addEventListener("mousemove",a),document.addEventListener("mouseup",l),()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",l)}},[s]),t.jsx("div",{ref:n,style:{position:"relative",height:"12px",borderRadius:"6px",cursor:"pointer",background:"linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)"},onMouseDown:a=>{i.current=!0,s(a)},children:t.jsx("div",{style:{position:"absolute",left:`${e/360*100}%`,top:"50%",transform:"translate(-50%, -50%)",width:"16px",height:"16px",borderRadius:"50%",border:"2px solid white",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)",backgroundColor:`hsl(${e}, 100%, 50%)`,pointerEvents:"none"}})})}function Li({alpha:e,hex:r,onChange:n}){const i=c.useRef(null),s=c.useRef(!1),a=c.useCallback(x=>{const o=i.current;if(!o)return;const m=o.getBoundingClientRect(),p=Math.max(0,Math.min(1,(x.clientX-m.left)/m.width));n(Math.round(p*100)/100)},[n]);c.useEffect(()=>{const x=m=>{s.current&&a(m)},o=()=>{s.current=!1};return document.addEventListener("mousemove",x),document.addEventListener("mouseup",o),()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",o)}},[a]);const[l,d,u]=Nt(r);return t.jsxs("div",{style:{position:"relative"},children:[t.jsx("div",{style:{position:"absolute",inset:0,borderRadius:"6px",backgroundImage:"repeating-conic-gradient(#ccc 0% 25%, white 0% 50%)",backgroundSize:"8px 8px"}}),t.jsx("div",{ref:i,style:{position:"relative",height:"12px",borderRadius:"6px",cursor:"pointer",background:`linear-gradient(to right, rgba(${l},${d},${u},0), rgba(${l},${d},${u},1))`},onMouseDown:x=>{s.current=!0,a(x)},children:t.jsx("div",{style:{position:"absolute",left:`${e*100}%`,top:"50%",transform:"translate(-50%, -50%)",width:"16px",height:"16px",borderRadius:"50%",border:"2px solid white",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)",backgroundColor:`rgba(${l},${d},${u},${e})`,pointerEvents:"none"}})})]})}function Di({value:e,defaultValue:r="#3b82f6",onChange:n,format:i="hex",showAlpha:s=!1,presets:a=Ni,disabled:l=!1,size:d="md",placeholder:u,label:x,style:o}){const m=ee(),p=c.useRef(null),h=c.useRef(null),[k,z]=c.useState(!1),y=e!==void 0,[S,M]=c.useState(y&&e||r),C=y?e||r:S,[I,R]=c.useState(1),[$,N]=c.useState(C),[T,w]=c.useState({top:0,left:0}),[v,O,f]=On(Ge(C)?C:r),g=c.useCallback((X,Z=I)=>{Ge(X)&&(N(X),y||M(X),n==null||n(Zt(X,Z,i),i))},[I,y,i,n]);c.useEffect(()=>{y&&e&&Ge(e)&&N(e)},[y,e]);const j=()=>{if(l)return;const X=p.current;if(!X)return;const Z=X.getBoundingClientRect(),ke=window.innerHeight-Z.bottom>320?Z.bottom+6:Z.top-326;w({top:ke+window.scrollY,left:Z.left+window.scrollX}),z(!0)};c.useEffect(()=>{if(!k)return;const X=Z=>{h.current&&!h.current.contains(Z.target)&&p.current&&!p.current.contains(Z.target)&&z(!1)};return document.addEventListener("mousedown",X),()=>document.removeEventListener("mousedown",X)},[k]),c.useEffect(()=>{if(!k)return;const X=Z=>{Z.key==="Escape"&&z(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[k]);const F=(X,Z)=>{const ye=Z/100,ke=X/100,de=ye*(1-ke/2),ge=de===0||de===1?0:(ye-de)/Math.min(de,1-de),J=nr(v,Math.round(ge*100),Math.round(de*100));g(J)},L=X=>{const Z=nr(X,O,f);g(Z)},V=X=>{R(X),n==null||n(Zt(C,X,i),i)},E=X=>{const Z=X.target.value;N(Z),Ge(Z)&&g(Z)},B=(X,Z)=>{const ye=Math.max(0,Math.min(255,parseInt(Z)||0)),[ke,de,ge]=Nt(C),J=X==="r"?qt(ye,de,ge):X==="g"?qt(ke,ye,ge):qt(ke,de,ye);g(J)},Y={sm:28,md:34,lg:40}[d],[A,H,Q]=Nt(Ge(C)?C:r),G={display:"inline-flex",alignItems:"center",gap:"8px",height:`${Y}px`,padding:"4px 10px 4px 6px",borderRadius:"8px",border:`1px solid ${m.border}`,backgroundColor:m.surface,cursor:l?"not-allowed":"pointer",opacity:l?.5:1,color:m.text,fontSize:"13px",fontFamily:"inherit",transition:"border-color 0.15s",...o},ne={width:`${Y-8}px`,height:`${Y-8}px`,borderRadius:"4px",backgroundColor:`rgba(${A},${H},${Q},${I})`,border:`1px solid ${m.border}`,flexShrink:0},pe={position:"absolute",top:T.top,left:T.left,zIndex:9999,width:"260px",backgroundColor:m.surface,border:`1px solid ${m.border}`,borderRadius:"12px",padding:"16px",boxShadow:"0 8px 32px rgba(0,0,0,0.24)",display:"flex",flexDirection:"column",gap:"12px"},xe={width:"100%",padding:"6px 10px",borderRadius:"6px",border:`1px solid ${m.border}`,backgroundColor:m.bg,color:m.text,fontSize:"12px",fontFamily:"monospace",outline:"none"},oe={flex:1,padding:"5px 6px",borderRadius:"6px",border:`1px solid ${m.border}`,backgroundColor:m.bg,color:m.text,fontSize:"11px",textAlign:"center",fontFamily:"monospace",outline:"none"},me=X=>({width:"20px",height:"20px",borderRadius:"50%",backgroundColor:X,border:X.toLowerCase()===C.toLowerCase()?`2px solid ${m.primary}`:`1px solid ${m.border}`,cursor:"pointer",flexShrink:0,transition:"transform 0.1s"});return t.jsxs(t.Fragment,{children:[x&&t.jsx("label",{style:{display:"block",fontSize:"13px",color:m.text,marginBottom:"6px",fontWeight:500},children:x}),t.jsxs("button",{ref:p,type:"button",style:G,onClick:j,disabled:l,"aria-label":`Color picker, current color ${C}`,"aria-haspopup":"dialog","aria-expanded":k,children:[t.jsx("div",{style:ne}),t.jsx("span",{style:{fontFamily:"monospace",fontSize:"12px",color:m.textMuted},children:u??Zt(Ge(C)?C:r,I,i)})]}),k&&We.createPortal(t.jsxs("div",{ref:h,style:pe,role:"dialog","aria-label":"Color picker",children:[t.jsx(Ri,{hue:v,sat:O,bright:f,onChange:F}),t.jsx(Ai,{hue:v,onChange:L}),s&&t.jsx(Li,{alpha:I,hex:Ge(C)?C:r,onChange:V}),t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[t.jsx("div",{style:{width:"28px",height:"28px",borderRadius:"6px",flexShrink:0,backgroundColor:`rgba(${A},${H},${Q},${I})`,border:`1px solid ${m.border}`}}),t.jsx("input",{style:xe,value:$,onChange:E,maxLength:7,spellCheck:!1,"aria-label":"Hex color value"})]}),t.jsxs("div",{style:{display:"flex",gap:"6px",alignItems:"center"},children:[["r","g","b"].map(X=>{const Z=X==="r"?A:X==="g"?H:Q;return t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[t.jsx("input",{style:oe,type:"number",min:0,max:255,value:Z,onChange:ye=>B(X,ye.target.value),"aria-label":`${X.toUpperCase()} channel`}),t.jsx("span",{style:{fontSize:"10px",color:m.textMuted,textTransform:"uppercase"},children:X})]},X)}),s&&t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[t.jsx("input",{style:oe,type:"number",min:0,max:100,value:Math.round(I*100),onChange:X=>V(Math.max(0,Math.min(1,parseInt(X.target.value)/100||0))),"aria-label":"Alpha channel"}),t.jsx("span",{style:{fontSize:"10px",color:m.textMuted},children:"A%"})]})]}),a.length>0&&t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:"11px",color:m.textMuted,marginBottom:"6px",fontWeight:500},children:"Presets"}),t.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:a.map(X=>t.jsx("button",{type:"button",style:me(X),onClick:()=>g(X),"aria-label":`Select color ${X}`,onMouseEnter:Z=>{Z.currentTarget.style.transform="scale(1.15)"},onMouseLeave:Z=>{Z.currentTarget.style.transform="scale(1)"}},X))})]})]}),document.body)]})}const Fi={sm:{height:"32px",fontSize:"0.8125rem",px:"8px",btnW:"28px",iconSz:14},md:{height:"40px",fontSize:"0.875rem",px:"12px",btnW:"34px",iconSz:16},lg:{height:"48px",fontSize:"1rem",px:"14px",btnW:"40px",iconSz:18}};function Or(e,r,n){let i=e;return r!==void 0&&(i=Math.max(i,r)),n!==void 0&&(i=Math.min(i,n)),i}function Gt(e,r){if(r===void 0)return e;const n=Math.pow(10,r);return Math.round(e*n)/n}function Bi(e,r,n,i,s){const a=i??"en-US";return r==="currency"?new Intl.NumberFormat(a,{style:"currency",currency:n??"USD",minimumFractionDigits:s??2,maximumFractionDigits:s??2}).format(e):r==="percent"?new Intl.NumberFormat(a,{style:"percent",minimumFractionDigits:s??0,maximumFractionDigits:s??0}).format(e/100):r==="decimal"||s!==void 0?new Intl.NumberFormat(a,{minimumFractionDigits:s??0,maximumFractionDigits:s??20}).format(e):String(e)}function _r({direction:e,isDisabled:r,btnW:n,height:i,primaryColor:s,borderColor:a,textMuted:l,iconSz:d,onStep:u}){const x=c.useRef(null),o=c.useRef(null),m=e==="inc"?1:-1,p=c.useCallback(()=>{u(m),x.current=setTimeout(()=>{o.current=setInterval(()=>u(m),60)},400)},[m,u]),h=c.useCallback(()=>{x.current&&(clearTimeout(x.current),x.current=null),o.current&&(clearInterval(o.current),o.current=null)},[]);c.useEffect(()=>()=>h(),[h]);const k=e==="inc";return t.jsx("button",{type:"button","aria-label":k?"Increment":"Decrement",disabled:r,onMouseDown:p,onMouseUp:h,onMouseLeave:h,onTouchStart:z=>{z.preventDefault(),p()},onTouchEnd:h,style:{width:n,height:i,minWidth:n,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"none",borderRight:k?void 0:`1px solid ${a}`,borderLeft:k?`1px solid ${a}`:void 0,cursor:r?"not-allowed":"pointer",color:r?l:s,transition:"color 120ms ease, background 120ms ease",outline:"none"},onFocus:z=>{r||(z.currentTarget.style.background=`${s}12`)},onBlur:z=>{z.currentTarget.style.background="transparent"},children:k?t.jsxs("svg",{width:d,height:d,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[t.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),t.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}):t.jsx("svg",{width:d,height:d,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:t.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})})}function _n({value:e,defaultValue:r=0,onChange:n,min:i,max:s,step:a=1,precision:l,prefix:d,suffix:u,format:x,currency:o,locale:m,clampOnBlur:p=!0,allowMouseWheel:h=!1,size:k="md",label:z,hint:y,isDisabled:S=!1,isReadOnly:M=!1,isInvalid:C=!1,errorMessage:I,id:R,className:$,style:N}){const T=ee(),w=c.useId(),v=R??w,O=`${v}-hint`,f=`${v}-error`,g=e!==void 0,[j,F]=c.useState(r),L=g?e:j,[V,E]=c.useState(!1),[B,P]=c.useState(""),Y=Fi[k],A=C||!!I,H=A?T.danger:V?T.primary:T.border,Q=[y&&O,A&&f].filter(Boolean).join(" ")||void 0,G=z?W(z):void 0,ne=y?W(y):void 0,pe=I?W(I):void 0,xe=d?W(d):void 0,oe=u?W(u):void 0,me=c.useCallback(re=>{const q=Gt(re,l);g||F(q),n==null||n(q)},[g,n,l]),X=c.useCallback(re=>{if(S||M)return;const q=Or(Gt(L+re*a,l),i,s);me(q)},[S,M,L,a,l,i,s,me]),Z=()=>{E(!0),P(String(L))},ye=()=>{E(!1);const re=parseFloat(B);if(isNaN(re)){n==null||n(null),P(String(L));return}let q=Gt(re,l);p&&(q=Or(q,i,s)),me(q)},ke=re=>{P(re.target.value)},de=re=>{re.key==="ArrowUp"&&(re.preventDefault(),X(1)),re.key==="ArrowDown"&&(re.preventDefault(),X(-1))},ge=re=>{!h||!V||(re.preventDefault(),X(re.deltaY<0?1:-1))},J=V?B:Bi(L,x,o,m,l),ie=(xe||oe)&&!V;return t.jsxs("div",{className:ue(b("flex flex-col gap-1 w-full"),$),style:N,children:[G&&t.jsx("label",{htmlFor:v,className:b("text-sm font-medium font-sans"),style:{color:T.text},children:G}),t.jsxs("div",{className:b("flex items-stretch overflow-hidden rounded-lg transition-colors duration-150"),style:{border:`1.5px solid ${H}`,backgroundColor:S?T.surfaceAlt:T.surface,opacity:S?.65:1,height:Y.height},children:[t.jsx(_r,{direction:"dec",isDisabled:S||M,btnW:Y.btnW,height:Y.height,primaryColor:T.primary,borderColor:T.border,textMuted:T.textMuted,iconSz:Y.iconSz,onStep:X}),t.jsxs("div",{className:b("relative flex-1 flex items-center overflow-hidden"),children:[ie&&xe&&t.jsx("span",{style:{position:"absolute",left:Y.px,fontSize:Y.fontSize,color:T.textMuted,pointerEvents:"none",userSelect:"none"},children:xe}),t.jsx("input",{id:v,type:"text",inputMode:"decimal",value:V?B:J,readOnly:M,disabled:S,"aria-invalid":A,"aria-describedby":Q,"aria-valuemin":i,"aria-valuemax":s,"aria-valuenow":L,style:{width:"100%",height:"100%",border:"none",background:"transparent",outline:"none",textAlign:"center",fontSize:Y.fontSize,fontFamily:"inherit",color:T.text,paddingLeft:ie&&xe?`calc(${Y.px} + 1.2em)`:Y.px,paddingRight:ie&&oe?`calc(${Y.px} + 1.2em)`:Y.px,cursor:S?"not-allowed":M?"default":"text"},onFocus:Z,onBlur:ye,onChange:ke,onKeyDown:de,onWheel:ge}),ie&&oe&&t.jsx("span",{style:{position:"absolute",right:Y.px,fontSize:Y.fontSize,color:T.textMuted,pointerEvents:"none",userSelect:"none"},children:oe})]}),t.jsx(_r,{direction:"inc",isDisabled:S||M,btnW:Y.btnW,height:Y.height,primaryColor:T.primary,borderColor:T.border,textMuted:T.textMuted,iconSz:Y.iconSz,onStep:X})]}),ne&&!pe&&t.jsx("span",{id:O,className:b("text-xs"),style:{color:T.textMuted},children:ne}),pe&&t.jsxs("span",{id:f,role:"alert",className:b("text-xs flex items-center gap-1"),style:{color:T.danger},children:[t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),pe]})]})}_n.displayName="TkxNumberInput";const Wi={sm:{box:"36px",fontSize:"1rem",gap:"6px"},md:{box:"44px",fontSize:"1.25rem",gap:"8px"},lg:{box:"52px",fontSize:"1.5rem",gap:"10px"}},Pi={number:/^\d$/,alphanumeric:/^[a-zA-Z0-9]$/,alpha:/^[a-zA-Z]$/};function Ur(e,r){return Pi[r].test(e)?e.toUpperCase():""}function Un({length:e=6,value:r,onChange:n,onComplete:i,type:s="number",mask:a=!1,autoFocus:l=!1,isDisabled:d=!1,isInvalid:u=!1,errorMessage:x,hint:o,size:m="md",separator:p,separatorPosition:h,className:k,style:z}){const y=ee(),S=c.useId(),M=`${S}-hint`,C=`${S}-error`,I=r!==void 0,R=A=>{const H=A.split("").slice(0,e);for(;H.length<e;)H.push("");return H},[$,N]=c.useState(()=>R(I?r:"")),T=I?R(r):$,w=c.useRef([]),v=Wi[m],O=u||!!x,f=T.every(A=>A!==""),g=o?W(o):void 0,j=x?W(x):void 0,F=A=>O?y.danger:f?y.success:y.border;c.useEffect(()=>{var A;l&&((A=w.current[0])==null||A.focus())},[]);const L=c.useCallback(A=>{I||N(A);const H=A.join("");n==null||n(H),A.every(Q=>Q!=="")&&(i==null||i(H))},[I,n,i]),V=A=>{var Q;const H=Math.max(0,Math.min(e-1,A));(Q=w.current[H])==null||Q.focus()},E=A=>H=>{if(!d){if(H.key==="Backspace"){if(H.preventDefault(),T[A]!==""){const Q=[...T];Q[A]="",L(Q)}else if(A>0){const Q=[...T];Q[A-1]="",L(Q),V(A-1)}return}if(H.key==="Delete"){H.preventDefault();const Q=[...T];Q[A]="",L(Q);return}if(H.key==="ArrowLeft"){H.preventDefault(),V(A-1);return}if(H.key==="ArrowRight"){H.preventDefault(),V(A+1);return}if(H.key==="Home"){H.preventDefault(),V(0);return}if(H.key==="End"){H.preventDefault(),V(e-1);return}}},B=A=>H=>{if(d)return;const G=H.target.value.slice(-1);if(!G)return;const ne=Ur(G,s);if(!ne)return;const pe=[...T];pe[A]=ne,L(pe),A<e-1&&V(A+1)},P=A=>H=>{if(H.preventDefault(),d)return;const G=H.clipboardData.getData("text").split("").map(xe=>Ur(xe,s)).filter(Boolean);if(!G.length)return;const ne=[...T];let pe=A;for(const xe of G){if(pe>=e)break;ne[pe]=xe,pe++}L(ne),V(Math.min(pe,e-1))},Y=[g&&M,O&&C].filter(Boolean).join(" ")||void 0;return t.jsxs("div",{className:ue(b("flex flex-col gap-2 w-fit"),k),style:z,children:[t.jsx("div",{role:"group","aria-label":"One-time password","aria-describedby":Y,className:b("flex items-center"),style:{gap:v.gap},children:Array.from({length:e},(A,H)=>{const Q=F();return typeof document<"u"&&(document.activeElement,w.current[H]),t.jsxs("div",{className:b("flex items-center"),style:{gap:v.gap},children:[p&&h===H&&H!==0&&t.jsx("span",{"aria-hidden":"true",style:{color:y.textMuted,userSelect:"none",flexShrink:0},children:p}),t.jsx("input",{ref:G=>{w.current[H]=G},type:a?"password":"text",inputMode:s==="number"?"numeric":"text",maxLength:1,value:T[H],disabled:d,"aria-label":`Digit ${H+1} of ${e}`,autoComplete:"one-time-code",spellCheck:!1,onChange:B(H),onKeyDown:E(H),onPaste:P(H),onFocus:G=>G.target.select(),style:{width:v.box,height:v.box,textAlign:"center",fontSize:v.fontSize,fontFamily:"monospace",fontWeight:600,border:`1.5px solid ${Q}`,borderRadius:"8px",backgroundColor:d?y.surfaceAlt:y.surface,color:y.text,outline:"none",boxShadow:"none",cursor:d?"not-allowed":"text",transition:"border-color 150ms ease, box-shadow 150ms ease",opacity:d?.6:1},onFocusCapture:G=>{d||(G.currentTarget.style.borderColor=O?y.danger:y.primary,G.currentTarget.style.boxShadow=`0 0 0 3px ${O?y.danger:y.primary}33`)},onBlurCapture:G=>{G.currentTarget.style.borderColor=F(),G.currentTarget.style.boxShadow="none"}})]},H)})}),g&&!j&&t.jsx("span",{id:M,className:b("text-xs"),style:{color:y.textMuted},children:g}),j&&t.jsxs("span",{id:C,role:"alert",className:b("text-xs flex items-center gap-1"),style:{color:y.danger},children:[t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:t.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),j]})]})}Un.displayName="TkxOTP";function Hi(e,r){c.useEffect(()=>{if(!r)return;const n=i=>{i.key==="Escape"&&e()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e,r])}function Vi(e){const r=c.useRef(null);return c.useEffect(()=>{if(!e||!r.current)return;const n=r.current,i=n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),s=i[0],a=i[i.length-1],l=d=>{d.key==="Tab"&&(d.shiftKey?document.activeElement===s&&(d.preventDefault(),a==null||a.focus()):document.activeElement===a&&(d.preventDefault(),s==null||s.focus()))};return n.addEventListener("keydown",l),()=>n.removeEventListener("keydown",l)},[e]),r}function Yi(){const[e,r]=c.useState(!1),n=c.useCallback(()=>r(!0),[]),i=c.useCallback(()=>r(!1),[]),s=c.useCallback(()=>r(a=>!a),[]);return{isOpen:e,open:n,close:i,toggle:s}}function Jt(e,r){if(!e)return{matched:!0,ranges:[],score:0};const n=e.toLowerCase(),i=r.toLowerCase(),s=i.indexOf(n);if(s!==-1)return{matched:!0,ranges:[[s,s+n.length-1]],score:s===0?100:80};const a=[];let l=0,d=-1,u=-1;for(let x=0;x<i.length&&l<n.length;x++)i[x]===n[l]&&((u===-1||x!==u+1)&&(d!==-1&&a.push([d,u]),d=x),u=x,l++);return d!==-1&&u!==-1&&a.push([d,u]),l<n.length?{matched:!1,ranges:[],score:0}:{matched:!0,ranges:a,score:40}}function Oi(e,r){if(!e.trim())return r.filter(i=>!i.disabled).map(i=>({item:i,score:0,labelRanges:[]}));const n=[];for(const i of r){if(i.disabled)continue;const s=Jt(e,i.label),a=i.description?Jt(e,i.description):{matched:!1,score:0},l=(i.keywords??[]).some(d=>Jt(e,d).matched);s.matched?n.push({item:i,score:s.score+20,labelRanges:s.ranges}):a.matched?n.push({item:i,score:a.score,labelRanges:[]}):l&&n.push({item:i,score:20,labelRanges:[]})}return n.sort((i,s)=>s.score-i.score)}function _i({text:e,ranges:r,color:n}){if(!r.length)return t.jsx(t.Fragment,{children:e});const i=[];let s=0;for(const[a,l]of r)s<a&&i.push(t.jsx("span",{children:e.slice(s,a)},`t-${s}`)),i.push(t.jsx("span",{style:{color:n,fontWeight:700},children:e.slice(a,l+1)},`h-${a}`)),s=l+1;return s<e.length&&i.push(t.jsx("span",{children:e.slice(s)},"t-end")),t.jsx(t.Fragment,{children:i})}function Ui({surface:e,border:r}){return t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 12px",borderRadius:8,overflow:"hidden"},children:[t.jsx("div",{style:{width:24,height:24,borderRadius:6,background:`linear-gradient(90deg, ${r} 25%, ${e} 50%, ${r} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out infinite",flexShrink:0}}),t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:5},children:[t.jsx("div",{style:{height:13,borderRadius:4,width:"60%",background:`linear-gradient(90deg, ${r} 25%, ${e} 50%, ${r} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out infinite"}}),t.jsx("div",{style:{height:10,borderRadius:4,width:"40%",background:`linear-gradient(90deg, ${r} 25%, ${e} 50%, ${r} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out 0.2s infinite"}})]})]})}function Kn({items:e,isOpen:r=!1,onClose:n,placeholder:i="Type a command or search…",emptyMessage:s,maxItems:a=8,onItemSelect:l,className:d,style:u}){const x=ee(),[o,m]=c.useState(""),[p,h]=c.useState(0),[k,z]=c.useState(!1),y=c.useRef(null),S=c.useRef(null),M=c.useId(),C=Vi(r),I=Oi(o,e).slice(0,a),R=[];for(const f of I){const g=f.item.group,j=R.find(F=>F.group===g);j?j.items.push(f):R.push({group:g,items:[f]})}const $=R.flatMap(f=>f.items);Hi(()=>{n==null||n()},r),c.useEffect(()=>{r&&(m(""),h(0),setTimeout(()=>{var f;return(f=y.current)==null?void 0:f.focus()},30))},[r]),c.useEffect(()=>{p>=$.length&&h(Math.max(0,$.length-1))},[$.length,p]);const N=c.useCallback(f=>{const g=S.current;if(!g)return;const j=g.querySelectorAll("[data-command-item]")[f];j==null||j.scrollIntoView({block:"nearest"})},[]),T=f=>{if(f.key==="ArrowDown"){f.preventDefault();const g=Math.min($.length-1,p+1);h(g),N(g)}else if(f.key==="ArrowUp"){f.preventDefault();const g=Math.max(0,p-1);h(g),N(g)}else if(f.key==="Enter"){f.preventDefault();const g=$[p];g&&w(g.item)}},w=f=>{var g;f.disabled||((g=f.onSelect)==null||g.call(f),l==null||l(f),n==null||n())};if(!r||typeof document>"u")return null;const v=W(i),O=s?W(s):`No results for "${W(o)}"`;if(typeof document<"u"&&!document.getElementById("tkx-shimmer-style")){const f=document.createElement("style");f.id="tkx-shimmer-style",f.textContent="@keyframes tkx-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }",document.head.appendChild(f)}return We.createPortal(t.jsxs("div",{role:"presentation",style:{position:"fixed",inset:0,zIndex:1e4,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"15vh",paddingLeft:16,paddingRight:16},children:[t.jsx("div",{"aria-hidden":"true",onClick:n,style:{position:"absolute",inset:0,backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(4px)",animation:"tkx-fade-in 120ms ease"}}),t.jsxs("div",{ref:C,role:"dialog","aria-modal":"true","aria-label":"Command palette",id:M,className:ue(d),style:{position:"relative",zIndex:1,width:"100%",maxWidth:560,backgroundColor:x.surface,border:`1px solid ${x.border}`,borderRadius:16,boxShadow:`0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px ${x.border}`,overflow:"hidden",display:"flex",flexDirection:"column",maxHeight:"70vh",...u},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 16px",borderBottom:`1px solid ${x.border}`},children:[t.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:x.textMuted,strokeWidth:2,"aria-hidden":"true",style:{flexShrink:0},children:[t.jsx("circle",{cx:"11",cy:"11",r:"8"}),t.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),t.jsx("input",{ref:y,type:"text",role:"combobox","aria-expanded":!0,"aria-autocomplete":"list","aria-controls":`${M}-list`,"aria-activedescendant":$[p]?`${M}-item-${$[p].item.id}`:void 0,value:o,onChange:f=>{m(f.target.value),h(0)},onKeyDown:T,placeholder:v,style:{flex:1,border:"none",background:"transparent",outline:"none",fontSize:16,fontFamily:"inherit",color:x.text}}),o&&t.jsx("button",{type:"button","aria-label":"Clear search",onClick:()=>{var f;m(""),h(0),(f=y.current)==null||f.focus()},style:{border:"none",background:"transparent",cursor:"pointer",color:x.textMuted,display:"flex",alignItems:"center",padding:0},children:t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),t.jsx("div",{id:`${M}-list`,ref:S,role:"listbox","aria-label":"Command results",style:{overflowY:"auto",flex:1,padding:"6px 8px"},children:k?Array.from({length:4},(f,g)=>t.jsx(Ui,{surface:x.surface,border:x.border},g)):$.length===0?t.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,padding:"32px 16px",color:x.textMuted},children:[t.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:[t.jsx("circle",{cx:"11",cy:"11",r:"8"}),t.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),t.jsx("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]}),t.jsx("span",{style:{fontSize:"0.875rem"},children:O})]}):R.map(({group:f,items:g},j)=>{const F=R.slice(0,j).reduce((L,V)=>L+V.items.length,0);return t.jsxs("div",{children:[f&&t.jsx("div",{role:"presentation",style:{fontSize:"0.6875rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em",color:x.textMuted,padding:"10px 12px 4px"},children:W(f)}),g.map((L,V)=>{const E=F+V,B=E===p,P=L.item;return t.jsxs("div",{id:`${M}-item-${P.id}`,role:"option","aria-selected":B,"aria-disabled":P.disabled,"data-command-item":!0,onClick:()=>w(P),onMouseEnter:()=>h(E),style:{display:"flex",alignItems:"center",gap:10,padding:"9px 12px",borderRadius:8,cursor:P.disabled?"not-allowed":"pointer",opacity:P.disabled?.45:1,backgroundColor:B?`${x.primary}18`:"transparent",borderLeft:B?`2px solid ${x.primary}`:"2px solid transparent",transition:"background 80ms ease",userSelect:"none"},children:[P.icon&&t.jsx("span",{style:{width:20,height:20,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",color:B?x.primary:x.textMuted},children:P.icon}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsx("div",{style:{fontSize:"0.875rem",fontWeight:500,color:x.text,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.jsx(_i,{text:P.label,ranges:L.labelRanges,color:x.primary})}),P.description&&t.jsx("div",{style:{fontSize:"0.75rem",color:x.textMuted,marginTop:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:W(P.description)})]}),P.shortcut&&t.jsx("span",{style:{flexShrink:0,fontSize:"0.6875rem",fontWeight:500,color:x.textMuted,backgroundColor:x.surfaceAlt,border:`1px solid ${x.border}`,borderRadius:6,padding:"2px 6px",fontFamily:"monospace",letterSpacing:"0.04em"},children:W(P.shortcut)})]},P.id)})]},f??"__default__")})}),$.length>0&&t.jsxs("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",gap:12,padding:"8px 16px",borderTop:`1px solid ${x.border}`,fontSize:"0.6875rem",color:x.textMuted},children:[t.jsxs("span",{children:[t.jsx("kbd",{style:{fontFamily:"monospace"},children:"↑↓"})," navigate"]}),t.jsxs("span",{children:[t.jsx("kbd",{style:{fontFamily:"monospace"},children:"↵"})," select"]}),t.jsxs("span",{children:[t.jsx("kbd",{style:{fontFamily:"monospace"},children:"Esc"})," close"]})]})]})]}),document.body)}Kn.displayName="TkxCommand";function Tt({direction:e,onClick:r,isDisabled:n,primaryColor:i,position:s,orientation:a}){const l=a==="vertical",d=e==="prev",u=s==="inside"?{position:"absolute",zIndex:3,...l?{[d?"top":"bottom"]:10,left:"50%",transform:"translateX(-50%)"}:{[d?"left":"right"]:10,top:"50%",transform:"translateY(-50%)"}}:{flexShrink:0,position:"relative"};return t.jsx("button",{type:"button","aria-label":d?"Previous slide":"Next slide",disabled:n,onClick:r,style:{...u,width:36,height:36,borderRadius:"50%",border:"none",backgroundColor:"rgba(0,0,0,0.45)",backdropFilter:"blur(4px)",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",cursor:n?"not-allowed":"pointer",opacity:n?.35:1,transition:"background 150ms ease, opacity 150ms ease",outline:"none"},onFocus:x=>{x.currentTarget.style.boxShadow=`0 0 0 3px ${i}55`},onBlur:x=>{x.currentTarget.style.boxShadow="none"},onMouseEnter:x=>{n||(x.currentTarget.style.backgroundColor="rgba(0,0,0,0.65)")},onMouseLeave:x=>{x.currentTarget.style.backgroundColor="rgba(0,0,0,0.45)"},children:l?d?t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:t.jsx("polyline",{points:"18 15 12 9 6 15"})}):t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:t.jsx("polyline",{points:"6 9 12 15 18 9"})}):d?t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:t.jsx("polyline",{points:"15 18 9 12 15 6"})}):t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:t.jsx("polyline",{points:"9 18 15 12 9 6"})})})}function Xn({slides:e,autoPlay:r=!1,autoPlayInterval:n=4e3,pauseOnHover:i=!0,loop:s=!0,showArrows:a=!0,showDots:l=!0,showThumbnails:d=!1,orientation:u="horizontal",slidesToShow:x=1,gap:o=0,transitionDuration:m=400,swipeable:p=!0,initialIndex:h=0,onChange:k,arrowPosition:z="inside",height:y=320,className:S,style:M}){const C=ee(),I=we(),R=c.useId(),$=e.length,[N,T]=c.useState(h),[w,v]=c.useState(s?h+1:h),[O,f]=c.useState(!1),[g,j]=c.useState(!1),F=c.useRef(null),L=c.useRef(null),V=c.useRef(null),E=c.useRef(0),B=c.useRef(!1),P=u==="vertical",Y=I?0:m,A=s&&$>1?[e[$-1],...e,e[0]]:e,H=A.length,Q=100/x,G=(q,te=0)=>{const be=te!==0?` - ${te}px`:"";return P?`translateY(calc(-${q*Q}%${be}))`:`translateX(calc(-${q*Q}%${be}))`},ne=c.useCallback((q,te=!1)=>{const be=s?(q%$+$)%$:Math.max(0,Math.min($-1,q)),$e=s?be+1:be;te&&F.current?(F.current.style.transition="none",v($e),T(be),F.current.offsetHeight,F.current.style.transition=""):(f(!0),v($e),T(be)),k==null||k(be)},[$,s,k]),pe=c.useCallback(()=>ne(N-1),[N,ne]),xe=c.useCallback(()=>ne(N+1),[N,ne]),oe=c.useCallback(()=>{f(!1),!(!s||$<=1)&&(w===0?ne($-1,!0):w===H-1&&ne(0,!0))},[s,$,w,H,ne]);c.useEffect(()=>{if(!(!r||g||$<=1))return L.current=setInterval(xe,n),()=>{L.current&&clearInterval(L.current)}},[r,g,n,xe,$]),c.useEffect(()=>{const q=te=>{const be=document.activeElement,$e=document.getElementById(R);$e!=null&&$e.contains(be)&&(te.key===(P?"ArrowUp":"ArrowLeft")&&(te.preventDefault(),pe()),te.key===(P?"ArrowDown":"ArrowRight")&&(te.preventDefault(),xe()))};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[R,P,pe,xe]);const me=q=>"touches"in q?P?q.touches[0].clientY:q.touches[0].clientX:P?q.clientY:q.clientX,X=q=>{p&&(V.current=me(q),E.current=0,B.current=!0)},Z=q=>{if(!B.current||V.current===null)return;const te=me(q)-V.current;E.current=te,F.current&&(F.current.style.transition="none",F.current.style.transform=G(w,-te))},ye=()=>{if(!B.current)return;B.current=!1;const q=E.current,te=50;F.current&&(F.current.style.transition="",F.current.style.transform=""),q<-te?xe():q>te?pe():F.current&&(F.current.style.transform=G(w)),V.current=null,E.current=0},ke=typeof y=="number"?`${y}px`:y,de={display:"flex",flexDirection:P?"column":"row",width:P?"100%":`${H/x*100}%`,height:P?`${H/x*100}%`:"100%",transform:G(w),transition:O||!I?`transform ${Y}ms cubic-bezier(0.4, 0, 0.2, 1)`:"none",willChange:"transform",gap:o>0?o:void 0},ge={flexShrink:0,width:P?"100%":`${Q/(H/x)}%`,height:P?`${Q/(H/x)}%`:"100%",overflow:"hidden",position:"relative"},J=s||N>0,ie=s||N<$-1,re=z==="outside";return t.jsxs("div",{id:R,className:ue(b("flex flex-col gap-2"),S),style:M,"aria-roledescription":"carousel","aria-label":"Content carousel",children:[t.jsxs("div",{className:b("flex items-center gap-2"),style:{gap:re&&a?8:0},children:[a&&re&&t.jsx(Tt,{direction:"prev",onClick:pe,isDisabled:!J,primaryColor:C.primary,position:"outside",orientation:u}),t.jsxs("div",{style:{position:"relative",flex:1,overflow:"hidden",height:ke,borderRadius:12,cursor:p?B.current?"grabbing":"grab":"default",userSelect:"none"},onMouseEnter:()=>i&&j(!0),onMouseLeave:()=>{j(!1),ye()},onTouchStart:X,onTouchMove:Z,onTouchEnd:ye,onMouseDown:X,onMouseMove:Z,onMouseUp:ye,"aria-live":"polite","aria-atomic":"false",children:[a&&!re&&t.jsxs(t.Fragment,{children:[t.jsx(Tt,{direction:"prev",onClick:pe,isDisabled:!J,primaryColor:C.primary,position:"inside",orientation:u}),t.jsx(Tt,{direction:"next",onClick:xe,isDisabled:!ie,primaryColor:C.primary,position:"inside",orientation:u})]}),t.jsx("div",{ref:F,style:de,onTransitionEnd:oe,children:A.map((q,te)=>t.jsx("div",{style:ge,role:"group","aria-roledescription":"slide","aria-label":`Slide ${(te-(s?1:0)+$)%$+1} of ${$}`,"aria-hidden":(te-(s?1:0)+$)%$!==N,children:q.content},`${q.id}-${te}`))}),l&&!d&&t.jsx("div",{"aria-label":"Slide indicators",style:{position:"absolute",bottom:12,left:"50%",transform:"translateX(-50%)",display:"flex",gap:6,zIndex:2},children:e.map((q,te)=>t.jsx("button",{type:"button","aria-label":`Go to slide ${te+1}`,"aria-current":te===N?"true":void 0,onClick:()=>ne(te),style:{width:te===N?20:8,height:8,borderRadius:9999,border:"none",backgroundColor:te===N?C.primary:"rgba(255,255,255,0.5)",cursor:"pointer",padding:0,transition:"width 250ms ease, background 250ms ease",outline:"none"},onFocus:be=>{be.currentTarget.style.boxShadow=`0 0 0 3px ${C.primary}66`},onBlur:be=>{be.currentTarget.style.boxShadow="none"}},q.id))})]}),a&&re&&t.jsx(Tt,{direction:"next",onClick:xe,isDisabled:!ie,primaryColor:C.primary,position:"outside",orientation:u})]}),d&&t.jsx("div",{role:"tablist","aria-label":"Slide thumbnails",style:{display:"flex",gap:6,overflowX:"auto",paddingBottom:4,scrollbarWidth:"thin"},children:e.map((q,te)=>t.jsxs("button",{type:"button",role:"tab","aria-selected":te===N,"aria-label":`Thumbnail for slide ${te+1}`,onClick:()=>ne(te),style:{flexShrink:0,width:60,height:42,border:`2px solid ${te===N?C.primary:C.border}`,borderRadius:6,overflow:"hidden",cursor:"pointer",padding:0,background:C.surfaceAlt,transition:"border-color 150ms ease",outline:"none",position:"relative"},onFocus:be=>{be.currentTarget.style.boxShadow=`0 0 0 3px ${C.primary}55`},onBlur:be=>{be.currentTarget.style.boxShadow="none"},children:[q.thumbnail?t.jsx("img",{src:q.thumbnail,alt:"","aria-hidden":"true",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):t.jsx("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.625rem",color:C.textMuted,fontWeight:600},children:te+1}),te===N&&t.jsx("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:`${C.primary}22`}})]},q.id))})]})}Xn.displayName="TkxCarousel";function Ki({contentId:e="tkx-main-content",label:r="Skip to main content"}){return t.jsx("a",{href:`#${e}`,className:"tkx-skip-nav",children:r})}function Xi({politeness:e="polite",children:r,atomic:n=!0}){return t.jsx("div",{role:"status","aria-live":e,"aria-atomic":n,className:"tkx-sr-only",children:r})}function qi({active:e,children:r,as:n="div"}){const i=At(e);return t.jsx(n,{ref:i,children:r})}function Zi({as:e,children:r,...n}){const i=e??"span";return t.jsx(i,{className:"tkx-sr-only",...n,children:r})}exports.FocusTrap=qi;exports.LRUCache=Kr;exports.LiveRegion=Xi;exports.Quantum=oo;exports.Shield=jo;exports.SkipNav=Ki;exports.TKX=lo;exports.ThemeContext=ur;exports.ThemeProvider=bo;exports.TkxAccordion=Nn;exports.TkxAlert=Jo;exports.TkxAvatar=Sn;exports.TkxBadge=yn;exports.TkxButton=mn;exports.TkxCard=gn;exports.TkxCardBody=Oo;exports.TkxCardFooter=_o;exports.TkxCardHeader=Yo;exports.TkxCarousel=Xn;exports.TkxChat=ci;exports.TkxChatBubble=Fn;exports.TkxCheckbox=Cn;exports.TkxClock=Hn;exports.TkxColorPicker=Di;exports.TkxCommand=Kn;exports.TkxDatePicker=Rn;exports.TkxDivider=$n;exports.TkxDrawer=As;exports.TkxFileUpload=Js;exports.TkxImage=Xs;exports.TkxInput=bn;exports.TkxMenu=Pn;exports.TkxModal=ts;exports.TkxNumberInput=_n;exports.TkxOTP=Un;exports.TkxPagination=Ln;exports.TkxProgress=vn;exports.TkxRadio=In;exports.TkxRadioGroup=ys;exports.TkxRating=si;exports.TkxSelect=Mn;exports.TkxSkeleton=xr;exports.TkxSlider=An;exports.TkxStepper=Yn;exports.TkxTab=os;exports.TkxTabList=ns;exports.TkxTabPanel=is;exports.TkxTabPanels=ss;exports.TkxTable=fs;exports.TkxTabs=rs;exports.TkxTag=Bn;exports.TkxTagInput=hi;exports.TkxThinkingIndicator=Dn;exports.TkxTimeline=bi;exports.TkxToastProvider=Cs;exports.TkxToggle=kn;exports.TkxTooltip=ls;exports.TkxVideoPlayer=Vn;exports.VisuallyHidden=Zi;exports.WCAGEngine=xo;exports.audit=dn;exports.auroraLight=ho;exports.batchUpdate=Zr;exports.contrastRatio=it;exports.createFocusTrap=ar;exports.createTheme=go;exports.css=Qr;exports.cssVar=sr;exports.cx=ue;exports.extractAtomicCSS=Do;exports.extractCSS=ir;exports.fnv1aHash=tt;exports.fromObject=en;exports.getAccessibleForeground=Ue;exports.getAuditLog=un;exports.injectStyles=nn;exports.keyframes=rn;exports.meetsAA=Et;exports.meetsAAA=on;exports.memoize=Xr;exports.prefersHighContrast=cr;exports.prefersReducedMotion=lr;exports.quantumDark=dr;exports.resetAtomicCSS=Fo;exports.responsive=tn;exports.sanitizeProps=fr;exports.sanitizeString=W;exports.tkx=b;exports.tx=Lo;exports.useAnnounce=pr;exports.useClickOutside=pn;exports.useEscapeKey=Lt;exports.useFocusTrap=At;exports.useHighContrast=So;exports.useReducedMotion=we;exports.useTheme=ee;exports.useTkxCommand=Yi;exports.useToast=ws;exports.validateProps=Rt;exports.verifyAuditIntegrity=fn;